Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix site breakage related to the Tracker-Tally CSS #727

Conversation

philipp-classen
Copy link
Member

The Tracker-Tally can break sites that run JavaScript that interacts with the injected css code. A recent example is
"https://mycovidrecord.health.nz/", which fails with:

Uncaught DOMException: CSSStyleSheet.cssRules getter: Not allowed to access cross-origin stylesheet

These older examples could be duplicates as well:

We can delay the css injection to "document_end" instead of "document_start". It may still happen, but it should make it
less likely with little downsides. In the concrete example, I can no longer reproduce with the change.

  • Have you followed the guidelines in CONTRIBUTING.md?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do?
  • Does your submission pass tests?
  • Did you lint your code prior to submission?

that interacts with the injected css code. A recent example is
"https://mycovidrecord.health.nz/", which fails with:

Uncaught DOMException: CSSStyleSheet.cssRules getter: Not allowed to access cross-origin stylesheet

These older examples could be duplicates as well:
* niklasvh/html2canvas#2197
* https://stackoverflow.com/a/62475347/783510

We can delay the css injection to "document_end" instead of
"document_start". It may still happen, but it should make it
less likely.
@philipp-classen
Copy link
Member Author

Also, disabling the feature for new installations (users can enable it through the UI: settings -> Tracker Tally).

chrmod
chrmod previously approved these changes Nov 19, 2021
@philipp-classen philipp-classen merged commit 3efea5d into ghostery:master Nov 23, 2021
@philipp-classen philipp-classen deleted the inject_tracker_tally_css_at_the_end branch November 23, 2021 12:58
@varun-raj
Copy link

This is still happening for our webapp. We use rails + webpacker.
Is there any ways to prevent the site break?

@philipp-classen
Copy link
Member Author

@varun-raj We will push a release soon (most likely tomorrow). Apology for the delay, but once it is live, it should fix the problems.

chrmod pushed a commit that referenced this pull request Jul 28, 2022
* On Firefox, the Tracker-Tally can break sites that run JavaScript
that interacts with the injected css code. A recent example is
"https://mycovidrecord.health.nz/", which fails with:

Uncaught DOMException: CSSStyleSheet.cssRules getter: Not allowed to access cross-origin stylesheet

These older examples could be duplicates as well:
* niklasvh/html2canvas#2197
* https://stackoverflow.com/a/62475347/783510

We can delay the css injection to "document_end" instead of
"document_start". It may still happen, but it should make it
less likely.

* Make the Tracker-Tally opt-in for new installations.

* Remove dead variable
chrmod pushed a commit that referenced this pull request Jul 29, 2022
* On Firefox, the Tracker-Tally can break sites that run JavaScript
that interacts with the injected css code. A recent example is
"https://mycovidrecord.health.nz/", which fails with:

Uncaught DOMException: CSSStyleSheet.cssRules getter: Not allowed to access cross-origin stylesheet

These older examples could be duplicates as well:
* niklasvh/html2canvas#2197
* https://stackoverflow.com/a/62475347/783510

We can delay the css injection to "document_end" instead of
"document_start". It may still happen, but it should make it
less likely.

* Make the Tracker-Tally opt-in for new installations.

* Remove dead variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants