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

Side by Side Diff: background.js

Issue 8482159: Initial element hiding functionality (Closed)
Patch Set: Created Oct. 9, 2012, 10:42 a.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 | includes/cssFilter.js » ('j') | includes/include.preload.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var ElemHide = require("elemHide").ElemHide;
1 var FilterNotifier = require("filterNotifier").FilterNotifier; 2 var FilterNotifier = require("filterNotifier").FilterNotifier;
2 var FilterStorage = require("filterStorage").FilterStorage; 3 var FilterStorage = require("filterStorage").FilterStorage;
3 var Synchronizer = require("synchronizer").Synchronizer; 4 var Synchronizer = require("synchronizer").Synchronizer;
4 var Subscription = require("subscriptionClasses").Subscription; 5 var Subscription = require("subscriptionClasses").Subscription;
5 var DownloadableSubscription = require("subscriptionClasses").DownloadableSubscr iption; 6 var DownloadableSubscription = require("subscriptionClasses").DownloadableSubscr iption;
6 7
7 var isFirstRun = false; 8 var isFirstRun = false;
8 FilterNotifier.addListener(function(action) 9 FilterNotifier.addListener(function(action)
9 { 10 {
10 if (action == "load") 11 if (action == "load")
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 subscription.disabled = false; 138 subscription.disabled = false;
138 subscription.title = selectedItem.getAttribute("title"); 139 subscription.title = selectedItem.getAttribute("title");
139 subscription.homepage = selectedItem.getAttribute("homepage"); 140 subscription.homepage = selectedItem.getAttribute("homepage");
140 if (subscription instanceof DownloadableSubscription && !subscription.last Download) 141 if (subscription instanceof DownloadableSubscription && !subscription.last Download)
141 Synchronizer.execute(subscription); 142 Synchronizer.execute(subscription);
142 FilterStorage.addSubscription(subscription); 143 FilterStorage.addSubscription(subscription);
143 } 144 }
144 }; 145 };
145 request.send(null); 146 request.send(null);
146 } 147 }
148
149 opera.extension.addEventListener("message", function(event)
150 {
151 var request = event.data;
152 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
153 {
154 case "get-settings":
155 var host = extractHostFromURL(request.frameUrl);
156 var selectors = ElemHide.getSelectorsForDomain(host, false);
157 event.source.postMessage({reqtype: "get-settings-response", selectors: sel ectors});
158 break;
159 }
160 }, false);
OLDNEW
« 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