| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 Loading... | |
| 136 { | 136 { |
| 137 let listenerFilters = changeListeners.get(page); | 137 let listenerFilters = changeListeners.get(page); |
| 138 if (!listenerFilters) | 138 if (!listenerFilters) |
| 139 { | 139 { |
| 140 listenerFilters = Object.create(null); | 140 listenerFilters = Object.create(null); |
| 141 changeListeners.set(page, listenerFilters); | 141 changeListeners.set(page, listenerFilters); |
| 142 } | 142 } |
| 143 return listenerFilters; | 143 return listenerFilters; |
| 144 } | 144 } |
| 145 | 145 |
| 146 function addSubscription(subscription, message) | 146 function addSubscription(subscription, properties) |
|
Thomas Greiner
2017/09/29 16:39:18
Detail: The name "message" here is quite generic.
saroyanm
2017/09/29 16:58:56
Done.
| |
| 147 { | 147 { |
| 148 subscription.disabled = false; | 148 subscription.disabled = false; |
| 149 if ("title" in message) | 149 if ("title" in properties) |
|
saroyanm
2017/09/29 14:35:17
Lack of this check were causing the unexpected beh
Thomas Greiner
2017/09/29 16:39:18
The URL is used as a fallback whenever there's no
saroyanm
2017/09/29 16:58:56
I see, thanks for the info.
| |
| 150 subscription.title = message.title; | 150 subscription.title = properties.title; |
| 151 if ("homepage" in message) | 151 if ("homepage" in properties) |
| 152 subscription.homepage = message.homepage; | 152 subscription.homepage = properties.homepage; |
| 153 | 153 |
| 154 FilterStorage.addSubscription(subscription); | 154 FilterStorage.addSubscription(subscription); |
| 155 if (subscription instanceof DownloadableSubscription && | 155 if (subscription instanceof DownloadableSubscription && |
|
saroyanm
2017/09/29 14:35:17
Previously we were not checking if it's a Download
Thomas Greiner
2017/09/29 16:39:18
Acknowledged.
| |
| 156 !subscription.lastDownload) | 156 !subscription.lastDownload) |
| 157 Synchronizer.execute(subscription); | 157 Synchronizer.execute(subscription); |
| 158 } | 158 } |
| 159 | 159 |
| 160 port.on("app.get", (message, sender) => | 160 port.on("app.get", (message, sender) => |
| 161 { | 161 { |
| 162 if (message.what == "issues") | 162 if (message.what == "issues") |
| 163 { | 163 { |
| 164 let subscriptionInit = require("subscriptionInit"); | 164 let subscriptionInit = require("subscriptionInit"); |
| 165 let result = subscriptionInit ? subscriptionInit.reinitialized : false; | 165 let result = subscriptionInit ? subscriptionInit.reinitialized : false; |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 414 if (message.url) | 414 if (message.url) |
| 415 subscriptions = [Subscription.fromURL(message.url)]; | 415 subscriptions = [Subscription.fromURL(message.url)]; |
| 416 | 416 |
| 417 for (let subscription of subscriptions) | 417 for (let subscription of subscriptions) |
| 418 { | 418 { |
| 419 if (subscription instanceof DownloadableSubscription) | 419 if (subscription instanceof DownloadableSubscription) |
| 420 Synchronizer.execute(subscription, true); | 420 Synchronizer.execute(subscription, true); |
| 421 } | 421 } |
| 422 }); | 422 }); |
| 423 })(this); | 423 })(this); |
| LEFT | RIGHT |