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

Unified Diff: background.js

Issue 8482159: Initial element hiding functionality (Closed)
Patch Set: Created Oct. 9, 2012, 10:42 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 | includes/cssFilter.js » ('j') | includes/include.preload.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: background.js
===================================================================
--- a/background.js
+++ b/background.js
@@ -1,8 +1,9 @@
+var ElemHide = require("elemHide").ElemHide;
var FilterNotifier = require("filterNotifier").FilterNotifier;
var FilterStorage = require("filterStorage").FilterStorage;
var Synchronizer = require("synchronizer").Synchronizer;
var Subscription = require("subscriptionClasses").Subscription;
var DownloadableSubscription = require("subscriptionClasses").DownloadableSubscription;
var isFirstRun = false;
FilterNotifier.addListener(function(action)
@@ -139,8 +140,21 @@ function executeFirstRunActions()
subscription.homepage = selectedItem.getAttribute("homepage");
if (subscription instanceof DownloadableSubscription && !subscription.lastDownload)
Synchronizer.execute(subscription);
FilterStorage.addSubscription(subscription);
}
};
request.send(null);
}
+
+opera.extension.addEventListener("message", function(event)
+{
+ var request = event.data;
+ switch (request.reqtype)
Felix Dahlke 2012/10/10 14:21:42 I'd prefer an if here, since there is only one cas
Wladimir Palant 2012/10/17 10:15:57 This code is essentially identical to Chrome and w
+ {
+ case "get-settings":
+ var host = extractHostFromURL(request.frameUrl);
+ var selectors = ElemHide.getSelectorsForDomain(host, false);
+ event.source.postMessage({reqtype: "get-settings-response", selectors: selectors});
+ break;
+ }
+}, false);
« no previous file with comments | « no previous file | includes/cssFilter.js » ('j') | includes/include.preload.js » ('J')

Powered by Google App Engine
This is Rietveld