Index: lib/antiadblockInit.js |
=================================================================== |
--- a/lib/antiadblockInit.js |
+++ b/lib/antiadblockInit.js |
@@ -10,16 +10,18 @@ |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU General Public License for more details. |
* |
* You should have received a copy of the GNU General Public License |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
+/* globals publicSuffixes */ |
+ |
"use strict"; |
const {Prefs} = require("prefs"); |
const {ActiveFilter} = require("filterClasses"); |
const {FilterStorage} = require("filterStorage"); |
const {FilterNotifier} = require("filterNotifier"); |
const {Subscription} = require("subscriptionClasses"); |
const {Notification} = require("notification"); |
@@ -47,17 +49,23 @@ |
for (let filter of subscription.filters) |
{ |
if (filter instanceof ActiveFilter && filter.domains) |
{ |
for (let [domain, included] of filter.domains) |
{ |
let urlFilter = "||" + domain + "^$document"; |
if (domain && included && urlFilters.indexOf(urlFilter) == -1) |
- urlFilters.push(urlFilter); |
+ { |
+ if (domain.indexOf(".") != -1 || domain.endsWith(".")) |
Thomas Greiner
2018/05/23 13:45:54
Effectively, this logic leads to the following res
Thomas Greiner
2018/05/23 13:45:54
Suggestion: Double negation usually makes code qui
kzar
2018/05/23 14:41:45
Also please can you use `.includes(".")` instead o
Jon Sonesen
2018/05/23 23:12:51
For sure
Jon Sonesen
2018/05/23 23:12:51
Acknowledged.
Jon Sonesen
2018/05/23 23:12:52
Hey,
My bad I think I misunderstood the last comm
Jon Sonesen
2018/05/24 00:00:09
Actually, on second thought would it be better to
kzar
2018/05/24 11:28:57
I'm not sure I understand the question. Why do you
|
+ { |
+ if (!(publicSuffixes.hasOwnProperty(domain))) |
+ urlFilters.push(urlFilter); |
+ } |
+ } |
} |
} |
} |
notification.urlFilters = urlFilters; |
Notification.addNotification(notification); |
Notification.addQuestionListener(notification.id, notificationListener); |
} |