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

Unified Diff: lib/elemHide.js

Issue 29790629: Issue 6690 - Always ignore trailing dot in document domain (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Ignore trailing dot in ElemHide.getSelectorsForDomain Created May 26, 2018, 12:10 a.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 | lib/filterClasses.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/elemHide.js
===================================================================
--- a/lib/elemHide.js
+++ b/lib/elemHide.js
@@ -229,17 +229,17 @@
* @param {boolean} [specificOnly] true if generic filters should not apply.
* @returns {string[]} List of selectors.
*/
getSelectorsForDomain(domain, specificOnly = false)
{
let selectors = [];
let excluded = new Set();
- let currentDomain = domain ? domain.toUpperCase() : "";
+ let currentDomain = domain ? domain.replace(/\.+$/, "").toUpperCase() : "";
// This code is a performance hot-spot, which is why we've made certain
// micro-optimisations. Please be careful before making changes.
while (true)
{
if (specificOnly && currentDomain == "")
break;
« no previous file with comments | « no previous file | lib/filterClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld