feat: csp list
This commit is contained in:
@@ -91,7 +91,7 @@ async function addContextMenus(contextMenuType = 1) {
|
||||
|
||||
/**
|
||||
* 更新CSP策略
|
||||
* @param {*} csplist
|
||||
* @param {*} csplist
|
||||
*/
|
||||
async function updateCspRules(csplist = DEFAULT_CSPLIST.join(",\n")) {
|
||||
try {
|
||||
@@ -132,9 +132,6 @@ browser.runtime.onInstalled.addListener(() => {
|
||||
|
||||
// 右键菜单
|
||||
addContextMenus();
|
||||
|
||||
// 禁用CSP
|
||||
updateCspRules();
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -156,6 +153,9 @@ browser.runtime.onStartup.addListener(async () => {
|
||||
// firefox重启后菜单会消失,故重复添加
|
||||
addContextMenus(contextMenuType);
|
||||
|
||||
// 禁用CSP
|
||||
updateCspRules();
|
||||
|
||||
// 同步订阅规则
|
||||
trySyncAllSubRules({ subrulesList });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user