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); |