brian-girko / always-active

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

[Request] Policy filters, for site compatibility with minimal privacy impact. #17

Closed ghost closed 2 years ago

ghost commented 2 years ago

As we are aware, blocking these APIs breaks some websites, so we need to allow some events to pass. For example, hovering many elements on youtube shows a tooltip, and the tooltip will never disappear, unless we allow mouseleave like so:

  "www.youtube.com": [
    "mouseleave"
  ]

However, while we need to allow mouseleave for the individual elements within the page (divs), in order to enjoy the functionality of things like tooltips, we don't need to allow it for elements such as window, document, html, body, etc. etc., since they rarely offer any real functionality besides tracking.

I wonder if we could provide an element selector as a filter for allowing events to pass?

For example, something like:

  "www.youtube.com": [
    "mouseleave" : {
      "body *"
    }
  ]

Would allow mouseleave events for elements within the body, so tooltips could work, but at the same time, block everything from the body up, so not allow the site to know when we're in another tab. Allowing multiple selectors will allow users to be very specific with their compromise between privacy and functionality.

brian-girko commented 2 years ago

As of version 0.1.8, the extension only blocks events targeted to the "document" or "window". So There is no need for this enhancement. If you still have a use case, please reopen this bug report.

https://github.com/brian-girko/always-active/blob/38038b0ba550921d76b2c19c070349af6bbba479/src/v2/data/inject.js#L68

ghost commented 2 years ago

Nice! Thanks mate.