Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ext/background.js

Issue 29752564: Issue 4580 - Removed ext.webRequest.handlerBehaviorChanged() (Closed)
Patch Set: Created April 14, 2018, 12:22 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/requestBlocker.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ext/background.js
===================================================================
--- a/ext/background.js
+++ b/ext/background.js
@@ -518,39 +518,6 @@
return frames && frames.get(frameId);
};
- let handlerBehaviorChangedQuota =
- browser.webRequest.MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES;
-
- function propagateHandlerBehaviorChange()
- {
- // Make sure to not call handlerBehaviorChanged() more often than allowed
- // by browser.webRequest.MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES.
- // Otherwise Chrome notifies the user that this extension is causing issues.
- if (handlerBehaviorChangedQuota > 0)
- {
- browser.webNavigation.onBeforeNavigate.removeListener(
- propagateHandlerBehaviorChange
- );
- browser.webRequest.handlerBehaviorChanged();
-
- handlerBehaviorChangedQuota--;
- setTimeout(() => { handlerBehaviorChangedQuota++; }, 600000);
- }
- }
-
- ext.webRequest = {
- handlerBehaviorChanged()
- {
- // Defer handlerBehaviorChanged() until navigation occurs.
- // There wouldn't be any visible effect when calling it earlier,
- // but it's an expensive operation and that way we avoid to call
- // it multiple times, if multiple filters are added/removed.
- let {onBeforeNavigate} = browser.webNavigation;
- if (!onBeforeNavigate.hasListener(propagateHandlerBehaviorChange))
- onBeforeNavigate.addListener(propagateHandlerBehaviorChange);
- }
- };
-
browser.tabs.query({}, tabs =>
{
tabs.forEach(tab =>
« no previous file with comments | « no previous file | lib/requestBlocker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld