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

Unified Diff: messageResponder.js

Issue 29338430: Noissue - Fix messageResponder for Firefox (Closed)
Patch Set: Created March 16, 2016, 1:44 p.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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: messageResponder.js
===================================================================
--- a/messageResponder.js
+++ b/messageResponder.js
@@ -138,17 +138,26 @@
var subscription = Subscription.fromURL(message.url);
subscription.title = message.title;
onFilterChange("addSubscription", subscription);
});
break;
case "app.get":
if (message.what == "issues")
{
- var subscriptionInit = require("subscriptionInit");
+ var subscriptionInit;
+ try
+ {
+ subscriptionInit = require("subscriptionInit");
+ }
+ catch (e)
+ {
+ // Expected exception, this module doesn't exist on Firefox
+ }
+
var info = require("info");
callback({
filterlistsReinitialized: subscriptionInit ? subscriptionInit.reinitialized : false,
legacySafariVersion: (info.platform == "safari" && (
Services.vc.compare(info.platformVersion, "6.0") < 0 || // beforeload breaks websites in Safari 5
Services.vc.compare(info.platformVersion, "6.1") == 0 || // extensions are broken in 6.1 and 7.0
Services.vc.compare(info.platformVersion, "7.0") == 0))
});
@@ -350,17 +359,17 @@
subscription.title = message.title;
subscription.homepage = message.homepage;
FilterStorage.addSubscription(subscription);
if (!subscription.lastDownload)
Synchronizer.execute(subscription);
}
break;
case "subscriptions.update":
- var subscriptions = message.url ? [Subscription.fromURL(message.url)] :
+ 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
FilterStorage.subscriptions;
for (var i = 0; i < subscriptions.length; i++)
{
var subscription = subscriptions[i];
if (subscription instanceof DownloadableSubscription)
Synchronizer.execute(subscription, true);
}
break;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld