@@ -33,6 +33,7 @@ console.log(`${MANIFEST_SRC} --[${MANIFEST_VER}]--> ${MANIFEST_DEST}`);
3333
3434const srcContent = fs . readFileSync ( MANIFEST_SRC , 'utf8' ) ;
3535const json = JSON . parse ( srcContent ) ;
36+ const permissions = new Set ( json . permissions ) ;
3637
3738if ( MANIFEST_VER . includes ( 3 ) ) {
3839 delete json . browser_specific_settings ;
@@ -41,11 +42,10 @@ if (MANIFEST_VER.includes(3)) {
4142 } else if ( json . update_url === EDGE_UPDATE_URL ) {
4243 delete json . update_url ;
4344 }
44- json . permissions = json . permissions
45- . filter ( p => !
46- / ^ (?: < a l l _ u r l s > | w e b R e q u e s t B l o c k i n g ) $ /
47- . test ( p )
48- ) ;
45+
46+ permissions . delete ( "<all_urls>" ) ;
47+ permissions . delete ( "webRequestBlocking" ) ;
48+
4949 const excludedScriptsRx = / \b c o n t e n t \/ (?: e m b e d d i n g D o c u m e n t | d i r i n d e x ) \. j s $ / ;
5050 for ( const cs of json . content_scripts ) {
5151 cs . js = cs . js . filter ( path => ! excludedScriptsRx . test ( path ) ) ;
@@ -54,6 +54,11 @@ if (MANIFEST_VER.includes(3)) {
5454 delete json . commands . _execute_browser_action
5555}
5656
57+ // remove developer-only stuff
58+ permissions . delete ( "declarativeNetRequestFeedback" ) ;
59+
60+ json . permissions = [ ...permissions ] ;
61+
5762const destContent = JSON . stringify ( json , null , 2 ) ;
5863fs . writeFileSync ( MANIFEST_DEST , destContent ) ;
5964console . log ( `Written ${ MANIFEST_DEST } ` ) ;
0 commit comments