CptFoobar / Owl

A Mozilla Firefox add-on to make online reading comfortable.
http://owl.sidhant.io
Other
63 stars 8 forks source link

Owl sometimes enables even if site is on disable list #24

Closed bemug closed 6 years ago

bemug commented 6 years ago

It's been hard to reproduce but i finally got an example.

Edit: This doesn't work, see my next comment.

I have www.reddit.com on my disable list.

This main page is correctly ignored by owl: https://www.reddit.com/r/ProgrammerHumor/ This comment page is also correctly ignored: https://www.reddit.com/r/ProgrammerHumor/comments/6wgc78/optimizations/

However, this one is not, and owl is still enable even with disable list: https://www.reddit.com/r/ProgrammerHumor/comments/6we9ur/i_guess_scratch_does_teach_kids_how_to_be/ And by the way there is no owl icon in my firefox searchbar on this URL, just as if it was correctly disabled.

My first guess is that the URL is way longer than the second one, but I didn't read the code to make myself sure.

CptFoobar commented 6 years ago

Hi, I tried reproducing this bug on 2 systems today, running Owl v2.2.4 on Fx55 and Fx56, and I can't seem to reproduce it. Are you still facing the same issue?

CptFoobar commented 6 years ago

I tried more sites to reproduce, and though I couldn't reproduce the owl enabling issue, but I did reproduce the missing URL bar icon one. Creating one issue for that: #28

bemug commented 6 years ago

I just checked and my reproduce steps were wrong. I've only been able to reproduce it on reddit, and you need the RES extension in order to do so.

Go to www.reddit.com with the RES exention enabled. Disable owl for this website. Now click on any links comments to see the comments. Owl is behaving well and ignores thee website. But if you press the RES shortcut (shift C) to go to the comment section, the bug happens. Howewer it doesn't if you simply press C wich opens the comment section in the same tab.

I can't find a simpler way to reproduce it, as it's even hard to catch.

Firefox 58.0a1 (2017-10-07) (64-bit)

markotny commented 6 years ago

To reproduce You need to use nightly (58). For me this bug now happens almost everytime I open in new tab page with Owl disabled (the owl icon in url bar is gone too even though colors are inverted). After reloading page owl no longer inverts, nor does it invert after opening page with owl disabled in the same tab.

bemug commented 6 years ago

I can confirm it happens on every new tab in 58.0a1 (2017-10-09) (64 bits)

CptFoobar commented 6 years ago

@markotny @bemug I tried reproducing the bug on Firefox Nightly 58.0a1 (2017-10-10) (64-bit), and though I couldn't reproduce the exact bug (inverted colors on new tab page). I can see the Owl URL bar icons disappears on some sites when disabled there, but apart from that, the inverted colors on new tab page doesn't happen. To be sure, I checked on Windows 10 and Ubuntu 15.10 and got the same results. Is it possible that you are using some add-on that sets a custom new tab page? Also, would it be possible for you to check the browser logs for Owl's messages when opening a new tab? (You can open browser console using Ctrl+Shift+J)

markotny commented 6 years ago

I use Group Speed Dial for new tab, but I tested without it and nothing changed. It's not the new tab page itself that is inverted (it is my understanding that it is not even possible with webextensions), it's the page that is loaded after. Like this: open new tab -> in that tab open page that is on Owl's disabled list -> page is inverted -> reload page -> page no longer inverted. From that point onward, every site on owl disabled list is no longer inverted if opened in this tab. So basicly, each tab requires a reload for owl to work properly. It doesn't happen in 100% cases though, On this page, for example, I have Owl disabled, because I have custom css style for github. I open the link to Owl page on the top 10 times in new tabs (clicking mouse wheel). Out of the 10 tabs that open, there is usually 1 page that has Owl working correctly. I tried this on different sites that I don't have css style for but the result is the same. No idea why it works once in ten tries.

As for the console logs:

Hope it helps ;)

CptFoobar commented 6 years ago

Thanks for the console logs and the more elaborate reproducible test case. After a many attempts, I was able to reliably reproduce the bug. Turns out, the reason this is occuring is because of the way Firefox is handling opening of tabs, especially tabs that were recently closed (opening a disable site, closing the tab and reopening with Ctrl+Shift-T is another way to see this). I have made a simple fix for this which I'll push today, and see if I can squash a few more bugs to justify a minor update. Anyhow, this will surely go away in v3.