CanisLupus / swift-selection-search

Swift Selection Search (SSS) is a simple Firefox add-on that lets you quickly search for some text in a page using your favorite search engines.
https://addons.mozilla.org/firefox/addon/swift-selection-search/
MIT License
215 stars 26 forks source link

Extension completely breaks kobo.com #239

Closed Gortus closed 2 years ago

Gortus commented 2 years ago

Going to kobo.com with this extension enabled completely breaks the site. I believe all JS and CSS are completely disabled, leaving pages unintelligible and unusable.

Adding the website to the popup blocklist does disable the popup, but doesn't fix the behavior.

CanisLupus commented 2 years ago

Very interesting find! I was confused at first but this did reveal a bug in the code that tries to circumvent the Content Security Policies of strict websites (which SSS has to do for the popup to show up in them).

It seems that in some cases the code is messing with the policies in an unintended way that causes the page to reject its own content, so that's what we're seeing in kobo.com.

Thank you! Definitely an important bug. I'm surprised this wasn't reported before, or that I didn't see it myself in some other website, but maybe I wouldn't think of SSS anyway. I will try to fix it tomorrow, or at least soon.

CanisLupus commented 2 years ago

And if you're wondering why this still affects a website you blocked explicitly, it's because the circumvention of the policies still has to occur in case you use the keyboard shortcut that opens the popup on request (because that still works if the website is blocked, as the description for "Website blocklist" mentions).

Now, is that extremely important? Probably not, but I don't think we need to change that behavior, just fix the underlying bug. :)

CanisLupus commented 2 years ago

Hi! I just submitted SSS v3.47.4 to Mozilla for review. They had a warning saying it's a period with many submissions, so it may take longer than usual to be accepted (they mentioned "weeks").

After that, this issue will hopefully be fixed and I'll be able to close this if there are no subsequent problems. :)

Cheers!

Gortus commented 2 years ago

That's great, thank you!

CanisLupus commented 2 years ago

You're welcome! Thanks for reporting this and noticing that it was SSS causing the problem.

Btw, apparently Mozilla approved the new version already! ¯_(ツ)_/¯ I'll close this but feel free to reopen if you run into any issues with the new version. Cheers!

Gortus commented 2 years ago

Confirmed, that fixed it for me. Thanks again!