From 4125ba051a6a6b561dddfa0794bbcd42225341ca Mon Sep 17 00:00:00 2001 From: ShuangYa <896640547@qq.com> Date: Mon, 29 Oct 2018 10:14:12 +0800 Subject: [PATCH] return "_header_editor_cancel_" will cancel request now --- src/background.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/background.js b/src/background.js index 584dbc5..39e20a9 100644 --- a/src/background.js +++ b/src/background.js @@ -96,7 +96,7 @@ browser.webRequest.onBeforeRequest.addListener(function(e) { }; for (const item of rule) { if (item.action === 'cancel') { - return {"cancel": true}; + return { "cancel": true }; } else { if (item.isFunction) { try { @@ -104,6 +104,9 @@ browser.webRequest.onBeforeRequest.addListener(function(e) { if (typeof(r) === 'string') { redirectTo = r; } + if (r === '_header_editor_cancel_') { + return { "cancel": true }; + } } catch (e) { console.log(e); }