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

Unified Diff: background.js

Issue 29339314: Issue 3870 - Rewrite legacy options page to use async messages (Closed)
Patch Set: Make use of the subscription.isDownloading property Created April 6, 2016, 9:31 a.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 | dependencies » ('j') | dependencies » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: background.js
diff --git a/background.js b/background.js
index fbfb7166751946e15b0dee1268fedc9fbf3551da..3e2eb08be89145c56ce79fe3ad3d676b8a4655dd 100644
--- a/background.js
+++ b/background.js
@@ -15,46 +15,13 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-with(require("filterClasses"))
-{
- this.RegExpFilter = RegExpFilter;
- this.WhitelistFilter = WhitelistFilter;
-}
-var FilterStorage = require("filterStorage").FilterStorage;
-var SpecialSubscription = require("subscriptionClasses").SpecialSubscription;
+var RegExpFilter = require("filterClasses").RegExpFilter;
var ElemHide = require("elemHide").ElemHide;
var checkWhitelisted = require("whitelisting").checkWhitelisted;
var extractHostFromFrame = require("url").extractHostFromFrame;
var port = require("messaging").port;
var devtools = require("devtools");
-// This is a hack to speedup loading of the options page on Safari.
-// Once we replaced the background page proxy with message passing
-// this global function should removed.
-function getUserFilters()
-{
- var filters = [];
- var exceptions = [];
-
- for (var i = 0; i < FilterStorage.subscriptions.length; i++)
- {
- var subscription = FilterStorage.subscriptions[i];
- if (!(subscription instanceof SpecialSubscription))
- continue;
-
- for (var j = 0; j < subscription.filters.length; j++)
- {
- var filter = subscription.filters[j];
- if (filter instanceof WhitelistFilter && /^@@\|\|([^\/:]+)\^\$document$/.test(filter.text))
- exceptions.push(RegExp.$1);
- else
- filters.push(filter.text);
- }
- }
-
- return {filters: filters, exceptions: exceptions};
-}
-
port.on("get-selectors", function(msg, sender)
{
var selectors;
« no previous file with comments | « no previous file | dependencies » ('j') | dependencies » ('J')

Powered by Google App Engine
This is Rietveld