Skip to content

Commit

Permalink
return "_header_editor_cancel_" will cancel request now
Browse files Browse the repository at this point in the history
  • Loading branch information
sylingd committed Oct 29, 2018
1 parent 70040cd commit 4125ba0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,17 @@ 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 {
const r = item._func(redirectTo, detail);
if (typeof(r) === 'string') {
redirectTo = r;
}
if (r === '_header_editor_cancel_') {
return { "cancel": true };
}
} catch (e) {
console.log(e);
}
Expand Down

0 comments on commit 4125ba0

Please sign in to comment.