If you add ||twitter.com to the ignore list, you'll find that sticky headers on nytimes.com aren't disappeared by Sticky Ducky, as expected. Further testing suggests that adding any domain ignore entry with the same length as the current domain (or one of the current domain's parent domains) causes this to happen: ||7777777.zzz breaks Sticky Ducky on nytimes.com, ||88888888.zzz or ||666666.zzz does not. This occurs on Firefox 84/Linux and Chrome 87/ChromeOS, at least.
let index = location.hostname.endsWith(rule.domain);
if (index < 0) return false;
MDN says that String.prototype.endsWith() returns a boolean, not an index into the string, so index < 0 is never true and execution always continues into the following length comparison code.
If you add
||twitter.com
to the ignore list, you'll find that sticky headers on nytimes.com aren't disappeared by Sticky Ducky, as expected. Further testing suggests that adding any domain ignore entry with the same length as the current domain (or one of the current domain's parent domains) causes this to happen:||7777777.zzz
breaks Sticky Ducky on nytimes.com,||88888888.zzz
or||666666.zzz
does not. This occurs on Firefox 84/Linux and Chrome 87/ChromeOS, at least.I suspect this is due to the code at https://github.com/lykahb/sticky-ducky/blob/master/src/js/whitelist.js#L50:
MDN says that String.prototype.endsWith() returns a boolean, not an index into the string, so
index < 0
is never true and execution always continues into the following length comparison code.