by koolba · 10y ago · 0 comments
# https://github.com/marlabrizel/genius-blocker/blob/master/lib/genius/blocker.rb#L11
var annotated = window.location.href.indexOf("genius.it/") != -1;
if (annotated) {
window.location.href = window.location.href.replace("genius.it/", "")
}
Wouldn't this match any instance of "genius.it" throughout the URL, not just at the beginning?For example it'd match "https://example.com/blog/how-to-block-genius.it" and redirect the user to a (probably) non-existent link with that string removed.
[1]: I just play one on HN.
Thanks for the code review - it's always good to see suggestions on how to improve things. If you have ideas on how to make the code better, please feel free to submit a pull request. Thanks for sharing your feedback!