Skip to content

Commit a510994

Browse files
save file
1 parent e9fe8cd commit a510994

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
3+
if(typeof browser==='undefined'){
4+
browser = chrome;
5+
}
6+
7+
browser.runtime.onInstalled.addListener(()=>{
8+
9+
var rule = {
10+
id: 1,
11+
condition: {},
12+
action: {
13+
type: 'modifyHeaders',
14+
responseHeaders: [
15+
{header: 'access-control-allow-origin',operation:'set',value:'*'},
16+
],
17+
},
18+
};
19+
20+
browser.declarativeNetRequest.updateDynamicRules({addRules:[rule],removeRuleIds:[rule.id]});
21+
22+
});
23+
24+

0 commit comments

Comments
 (0)