brian-girko / always-active

Pretend a webpage is in its active state even if not
https://webextension.org/listing/always-active.html
75 stars 12 forks source link

Netflix can detect user inactivity #26

Closed ghost closed 1 year ago

ghost commented 2 years ago

This disease is spreading. Sites are using the method described in #18.

This addon may hide changes to page visibility, but does not ever make the page 'visible' in the first place. So, now netflix considers itself invisible until I click on it and it suddenly 'comes to life'. This is correct on netflix's part, this addon breaks the browser's compliance to HTML spec.

Please, please, please, could we just have it fire that visibilitychange event so pages behave normally and can't spy on us? This addon is so great but it breaks so often because of this simple oversight.

brian-girko commented 1 year ago

https://github.com/brian-girko/always-active/commit/a5476f6815ba96bc7dc2507a9f0dccad28d11771

As of the next release, the extension allows the "focus" and "visibilitychange" events once. Hope this helps!

ghost commented 1 year ago

Absolutely mint, thanks mate!

ghost commented 1 year ago

Hi, just a little update. I'm pretty hyped for this, so I got impatient waiting for AMO approval, and decided to try and disable signatures and load the addon. It failed, with the message "this addon could not be installed because it appears to be corrupt". I tried to use about:debugging to load it, and got the error message, "background.service_worker is currently disabled". I went into about:config and 'extensions.backgroundServiceWorker.enabled' was set to false. I toggled it to true, restarted the browser, and the addon loaded.

The fix is immediately apparent. Brilliant, thank you so much!!

I thought I should report this, because according to documentation, background service workers are mandatory replacements for the old background scripts, and background service workers are disabled by default in firefox, so, for this addon to work in it's current form, firefox users will need to change 'extensions.backgroundServiceWorker.enabled' to true

Hope this is helpful, and thanks again for the awesome update :)

ghost commented 1 year ago

Another update, less pleasant.... It seems this isn't actually working. The page loads and it receives all the necessary events, so this appears to be a fix, because background pages do actually load as if they're foreground now..... but subsequent events aren't blocked any more. I've been testing using https://page-visibility.vercel.app/ with the latest firefox nightly.

brian-girko commented 1 year ago

Try the recent commit of the "v2" directory. The "v3" is not meant for Firefox yet!

ghost commented 1 year ago

The "v3" is not meant for Firefox yet!

I stopped looking into this after my last post because I had a pretty strong gut feeling you were going to say that :D Thanks for adding it into the ye olde version, too!

Works like a charm now. As far as I can tell from a quick test, this fixed #18 #21 #22 #23 #26

brian-girko commented 1 year ago

Perfect! I'll submit to AMO

ghost commented 1 year ago

Perfect! I'll submit to AMO

Wow, they've sped things up, that went through in no time! After spending the whole day with the new version, I really wanted to say thanks again for this. It's completely transformed the browsing experience for me, and I know that sounds like an overstatement, but it really has.

Now, whole page lays out and gets a dark CSS theme, in the background, just as if I'd been looking at it. When I swap to it, it's totally ready, seamless, no blinking, no re-layout, nothing, on every site I visit. So good. This seemingly humble change is the final piece of the puzzle of a dark themed internet, but it is more than that, it stops the migraine-inducing flickering when pages lay out when you swap to them. Thanks!!! You fixed prefers-reduced-motion!

That's funny for me, because I really wanted this addon for two reasons - privacy, and consistent functionality of websites when I swap tabs.... Never expected it to improve the accessibility of the entire internet.

This is easily the most underrated addon there is. Thanks for taking the time and sharing with us.