@@ -4,7 +4,13 @@ import { loadConfig } from './config-loader.js';
44
55export const SettingPageFilter = {
66 enabled : true ,
7- blockedPrefixes : [ 'edge://settings/' ] ,
7+ notifyOnBlocked : true ,
8+ blockedPrefixes : [
9+ 'edge://settings' ,
10+ 'edge://extensions' ,
11+ 'edge://flags' ,
12+ 'edge://policy' ,
13+ ] ,
814
915 async init ( ) {
1016 const config = await loadConfig ( ) ;
@@ -17,9 +23,13 @@ export const SettingPageFilter = {
1723 if ( typeof settingPageFilter . Enabled === 'boolean' ) {
1824 this . enabled = settingPageFilter . Enabled ;
1925 }
26+ if ( typeof settingPageFilter . NotifyOnBlocked === 'boolean' ) {
27+ this . notifyOnBlocked = settingPageFilter . NotifyOnBlocked ;
28+ }
2029 if ( Array . isArray ( settingPageFilter . BlockedPrefixes ) ) {
2130 this . blockedPrefixes = settingPageFilter . BlockedPrefixes ;
2231 }
32+
2333 } ,
2434
2535 isBlockedUrl ( url ) {
@@ -33,12 +43,14 @@ export const SettingPageFilter = {
3343 chrome . tabs . goBack ( details . tabId ) . catch ( ( ) =>
3444 chrome . tabs . update ( details . tabId , { url : 'about:blank' } )
3545 ) ;
36- chrome . notifications . create ( 'settings-blocked' , {
37- type : 'basic' ,
38- iconUrl : 'misc/128x128.png' ,
39- title : '設定画面へのアクセスはブロックされています' ,
40- message : '拡張機能のポリシーにより edge://settings/ は表示できません。' ,
41- } ) ;
46+ if ( this . notifyOnBlocked ) {
47+ chrome . notifications . create ( 'settings-blocked' , {
48+ type : 'basic' ,
49+ iconUrl : 'misc/128x128.png' ,
50+ title : '設定画面へのアクセスはブロックされています' ,
51+ message : `拡張機能のポリシーにより ${ details . url } は表示できません。` ,
52+ } ) ;
53+ }
4254 } ,
4355}
4456
0 commit comments