Skip to content

Commit

Permalink
Fixed can not use custom function in cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
sylingd committed Jul 3, 2019
1 parent 830b3a4 commit 1c8c353
Show file tree
Hide file tree
Showing 2 changed files with 927 additions and 927 deletions.
4 changes: 2 additions & 2 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ browser.webRequest.onBeforeRequest.addListener(function(e) {
originUrl: e.originUrl || ''
};
for (const item of rule) {
if (item.action === 'cancel') {
if (item.action === 'cancel' && !item.isFunction) {
return { cancel: true };
} else {
if (item.isFunction) {
Expand All @@ -112,7 +112,7 @@ browser.webRequest.onBeforeRequest.addListener(function(e) {
if (typeof(r) === 'string') {
redirectTo = r;
}
if (r === '_header_editor_cancel_') {
if (r === '_header_editor_cancel_' || (item.action === 'cancel' && r === true)) {
return { "cancel": true };
}
} catch (e) {
Expand Down
Loading

0 comments on commit 1c8c353

Please sign in to comment.