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

Side by Side Diff: messageResponder.js

Issue 29338430: Noissue - Fix messageResponder for Firefox (Closed)
Patch Set: Created March 16, 2016, 1:44 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 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 ext.showOptions(function() 136 ext.showOptions(function()
137 { 137 {
138 var subscription = Subscription.fromURL(message.url); 138 var subscription = Subscription.fromURL(message.url);
139 subscription.title = message.title; 139 subscription.title = message.title;
140 onFilterChange("addSubscription", subscription); 140 onFilterChange("addSubscription", subscription);
141 }); 141 });
142 break; 142 break;
143 case "app.get": 143 case "app.get":
144 if (message.what == "issues") 144 if (message.what == "issues")
145 { 145 {
146 var subscriptionInit = require("subscriptionInit"); 146 var subscriptionInit;
147 try
148 {
149 subscriptionInit = require("subscriptionInit");
150 }
151 catch (e)
152 {
153 // Expected exception, this module doesn't exist on Firefox
154 }
155
147 var info = require("info"); 156 var info = require("info");
148 callback({ 157 callback({
149 filterlistsReinitialized: subscriptionInit ? subscriptionInit.reinit ialized : false, 158 filterlistsReinitialized: subscriptionInit ? subscriptionInit.reinit ialized : false,
150 legacySafariVersion: (info.platform == "safari" && ( 159 legacySafariVersion: (info.platform == "safari" && (
151 Services.vc.compare(info.platformVersion, "6.0") < 0 || // bef oreload breaks websites in Safari 5 160 Services.vc.compare(info.platformVersion, "6.0") < 0 || // bef oreload breaks websites in Safari 5
152 Services.vc.compare(info.platformVersion, "6.1") == 0 || // ext ensions are broken in 6.1 and 7.0 161 Services.vc.compare(info.platformVersion, "6.1") == 0 || // ext ensions are broken in 6.1 and 7.0
153 Services.vc.compare(info.platformVersion, "7.0") == 0)) 162 Services.vc.compare(info.platformVersion, "7.0") == 0))
154 }); 163 });
155 } 164 }
156 else if (message.what == "doclink") 165 else if (message.what == "doclink")
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 { 357 {
349 subscription.disabled = false; 358 subscription.disabled = false;
350 subscription.title = message.title; 359 subscription.title = message.title;
351 subscription.homepage = message.homepage; 360 subscription.homepage = message.homepage;
352 FilterStorage.addSubscription(subscription); 361 FilterStorage.addSubscription(subscription);
353 if (!subscription.lastDownload) 362 if (!subscription.lastDownload)
354 Synchronizer.execute(subscription); 363 Synchronizer.execute(subscription);
355 } 364 }
356 break; 365 break;
357 case "subscriptions.update": 366 case "subscriptions.update":
358 var subscriptions = message.url ? [Subscription.fromURL(message.url)] : 367 var subscriptions = message.url ? [Subscription.fromURL(message.url)] :
Sebastian Noack 2016/03/16 13:47:45 What is the change here? Anyway, LGTM.
Wladimir Palant 2016/03/16 13:57:49 Trailing whitespace removed, my editor does this a
359 FilterStorage.subscriptions; 368 FilterStorage.subscriptions;
360 for (var i = 0; i < subscriptions.length; i++) 369 for (var i = 0; i < subscriptions.length; i++)
361 { 370 {
362 var subscription = subscriptions[i]; 371 var subscription = subscriptions[i];
363 if (subscription instanceof DownloadableSubscription) 372 if (subscription instanceof DownloadableSubscription)
364 Synchronizer.execute(subscription, true); 373 Synchronizer.execute(subscription, true);
365 } 374 }
366 break; 375 break;
367 case "subscriptions.isDownloading": 376 case "subscriptions.isDownloading":
368 callback(Synchronizer.isExecuting(message.url)); 377 callback(Synchronizer.isExecuting(message.url));
369 break; 378 break;
370 } 379 }
371 }); 380 });
372 })(this); 381 })(this);
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