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

Side by Side Diff: chrome/content/common.js

Issue 29369510: Issue 4754 - Adjust for the new element hiding emulation filters (Closed) Base URL: https://bitbucket.org/fhd/adblockplustests
Patch Set: Created Dec. 22, 2016, 12:56 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 const Cc = Components.classes; 1 const Cc = Components.classes;
2 const Ci = Components.interfaces; 2 const Ci = Components.interfaces;
3 const Cr = Components.results; 3 const Cr = Components.results;
4 const Cu = Components.utils; 4 const Cu = Components.utils;
5 5
6 const {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); 6 const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
7 7
8 const SDK = Cu.import("resource://gre/modules/commonjs/toolkit/require.js", {}); 8 const SDK = Cu.import("resource://gre/modules/commonjs/toolkit/require.js", {});
9 SDK.require("sdk/tabs"); 9 SDK.require("sdk/tabs");
10 10
(...skipping 17 matching lines...) Expand all
28 result = XPIProvider.bootstrapScopes[addonID]; 28 result = XPIProvider.bootstrapScopes[addonID];
29 } 29 }
30 30
31 if ("require" in result) 31 if ("require" in result)
32 result = result.require.scopes[module]; 32 result = result.require.scopes[module];
33 return result; 33 return result;
34 } 34 }
35 35
36 let {Filter, InvalidFilter, CommentFilter, ActiveFilter, RegExpFilter, 36 let {Filter, InvalidFilter, CommentFilter, ActiveFilter, RegExpFilter,
37 BlockingFilter, WhitelistFilter, ElemHideBase, ElemHideFilter, 37 BlockingFilter, WhitelistFilter, ElemHideBase, ElemHideFilter,
38 ElemHideException, CSSPropertyFilter} = require("filterClasses"); 38 ElemHideException, ElemHideEmulationFilter} = require("filterClasses");
39 let {Subscription, SpecialSubscription, RegularSubscription, 39 let {Subscription, SpecialSubscription, RegularSubscription,
40 ExternalSubscription, DownloadableSubscription} = require("subscriptionClas ses"); 40 ExternalSubscription, DownloadableSubscription} = require("subscriptionClas ses");
41 let {defaultMatcher, Matcher, CombinedMatcher} = require("matcher"); 41 let {defaultMatcher, Matcher, CombinedMatcher} = require("matcher");
42 let {FilterListener} = require("filterListener"); 42 let {FilterListener} = require("filterListener");
43 let {FilterNotifier} = require("filterNotifier"); 43 let {FilterNotifier} = require("filterNotifier");
44 let {FilterStorage} = require("filterStorage"); 44 let {FilterStorage} = require("filterStorage");
45 let {ElemHide} = require("elemHide"); 45 let {ElemHide} = require("elemHide");
46 let {CSSRules} = require("cssRules"); 46 let {ElemHideEmulation} = require("elemHideEmulation");
47 let {IO} = require("io"); 47 let {IO} = require("io");
48 let {Notification} = require("notification"); 48 let {Notification} = require("notification");
49 let {Prefs} = require("prefs"); 49 let {Prefs} = require("prefs");
50 let {RequestNotifier} = require("requestNotifier"); 50 let {RequestNotifier} = require("requestNotifier");
51 let {Synchronizer} = require("synchronizer"); 51 let {Synchronizer} = require("synchronizer");
52 let {UI} = require("ui"); 52 let {UI} = require("ui");
53 let {Utils} = require("utils"); 53 let {Utils} = require("utils");
54 54
55 function prepareFilterComponents(keepListeners) 55 function prepareFilterComponents(keepListeners)
56 { 56 {
(...skipping 13 matching lines...) Expand all
70 FilterStorage.knownSubscriptions = Object.create(null); 70 FilterStorage.knownSubscriptions = Object.create(null);
71 Subscription.knownSubscriptions = Object.create(null); 71 Subscription.knownSubscriptions = Object.create(null);
72 Filter.knownFilters = Object.create(null); 72 Filter.knownFilters = Object.create(null);
73 if (!keepListeners) 73 if (!keepListeners)
74 { 74 {
75 FilterNotifierGlobal.listeners = []; 75 FilterNotifierGlobal.listeners = [];
76 } 76 }
77 77
78 defaultMatcher.clear(); 78 defaultMatcher.clear();
79 ElemHide.clear(); 79 ElemHide.clear();
80 CSSRules.clear(); 80 ElemHideEmulation.clear();
81 } 81 }
82 82
83 function restoreFilterComponents() 83 function restoreFilterComponents()
84 { 84 {
85 let FilterNotifierGlobal = getModuleGlobal("filterNotifier"); 85 let FilterNotifierGlobal = getModuleGlobal("filterNotifier");
86 86
87 FilterStorage.subscriptions = this._backup.subscriptions; 87 FilterStorage.subscriptions = this._backup.subscriptions;
88 FilterStorage.knownSubscriptions = this._backup.storageKnown; 88 FilterStorage.knownSubscriptions = this._backup.storageKnown;
89 Subscription.knownSubscriptions = this._backup.subscriptionsKnown; 89 Subscription.knownSubscriptions = this._backup.subscriptionsKnown;
90 Filter.knownFilters = this._backup.filtersKnown; 90 Filter.knownFilters = this._backup.filtersKnown;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 return oldFinish.apply(this, arguments); 221 return oldFinish.apply(this, arguments);
222 } 222 }
223 window.addEventListener("unload", function() 223 window.addEventListener("unload", function()
224 { 224 {
225 debuggerService.off(); 225 debuggerService.off();
226 }, true); 226 }, true);
227 debuggerService.on(); 227 debuggerService.on();
228 debuggerService.flags |= debuggerService.COLLECT_PROFILE_DATA; 228 debuggerService.flags |= debuggerService.COLLECT_PROFILE_DATA;
229 debuggerService.clearProfileData(); 229 debuggerService.clearProfileData();
230 } 230 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld