@@ -16,8 +16,7 @@ const WebpackPatchBootstrapPlugin = require('./tools/webpack-patch-bootstrap');
1616const { escapeForRe, getManifestOvrName, stripSourceMap, DEV , MANIFEST , ROOT } =
1717 require ( './tools/util' ) ;
1818
19- const GITHUB_ACTIONS = process . env . GITHUB_ACTIONS ;
20- const NODE_ENV = process . env . NODE_ENV ;
19+ const { DEBUG , GITHUB_ACTIONS , NODE_ENV } = process . env ;
2120const [ TARGET , ZIP ] = NODE_ENV ?. split ( ':' ) || [ '' ] ;
2221const [ BUILD , FLAVOR , CHANNEL ] = TARGET . split ( '-' ) ;
2322const SRC = ROOT + 'src/' ;
@@ -75,7 +74,7 @@ const VARS = {
7574 BUILD ,
7675 CLIENT_DATA : 'clientData' , // hiding the global from IDE
7776 CM_PATH ,
78- DEBUG : process . env . DEBUG ?. split ( ',' ) . reduce ( ( res , s ) => res + DEBUGMASK [ s ] , 1 ) || 0 ,
77+ DEBUG : DEBUG ?. split ( ',' ) . reduce ( ( res , s ) => res + DEBUGMASK [ s ] , 1 ) || 0 ,
7978 DEV ,
8079 ENTRY : false ,
8180 IS_BG : false ,
@@ -86,9 +85,9 @@ const VARS = {
8685 ZIP : ! ! ZIP ,
8786} ;
8887const RAW_VARS = {
89- DEBUGLOG : ( process . env . DEBUG ? '' : 'null&&' ) + 'console.log' ,
90- DEBUGTRACE : ( process . env . DEBUG ? '' : 'null&&' ) + 'console.trace' ,
91- DEBUGWARN : ( process . env . DEBUG ? '' : 'null&&' ) + 'console.warn' ,
88+ DEBUGLOG : ( DEBUG ? '' : 'null&&' ) + 'console.log' ,
89+ DEBUGTRACE : ( DEBUG ? '' : 'null&&' ) + 'console.trace' ,
90+ DEBUGWARN : ( DEBUG ? '' : 'null&&' ) + 'console.warn' ,
9291 KEEP_ALIVE : '1&&' ,
9392} ;
9493const BANNER = '{const global = this, window = global;' ;
@@ -314,6 +313,9 @@ function makeManifest(files) {
314313 if ( MV3 && CHANNEL === 'beta' && parseInt ( ver ) === 2 ) {
315314 ver = base . version = 3 + ver . slice ( 1 ) ;
316315 }
316+ if ( MV3 && ( DEBUG || DEV ) ) {
317+ base . permissions . push ( 'declarativeNetRequestFeedback' ) ;
318+ }
317319 if ( GITHUB_ACTIONS ) {
318320 delete base . key ;
319321 childProcess . execSync ( `echo "_VER=${ ver } " >> $GITHUB_ENV` ) ;
0 commit comments