uBlockOrigin / uMatrix-issues

This is the community-maintained issue tracker for uMatrix
https://github.com/gorhill/uMatrix
123 stars 17 forks source link

Access to localStorage blocked for in 3rd party context #274

Closed Kein closed 4 years ago

Kein commented 4 years ago

Prerequisites

Description

Access to localStorage blocked for in 3rd party context

A specific URL where the issue occurs

discord.com

Steps to Reproduce

  1. Run Discord in browser
  2. Disable matrix for domain
  3. Try to play any embed Twitch clip

Ruleset

N/A, uMatrix disabled, web-workers allowed (rest of the setting max allowance)

Supporting evidence

player-main-a60a54700d8681907841.js:1 Failed to get log level override from local storage. {err: DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this d…, key: "twilight.minConsoleLogLevel"}err: DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
    at new e (https://static.twitchcdn.net/assets/player-main-a60a54700d8681907841.js:1:203860)
    at Se (https://static.twitchcdn.net/assets/player-main-a60a54700d8681907841.js:1:201825)
    at Module.gg62 (https://static.twitchcdn.net/assets/player-main-a60a54700d8681907841.js:1:1467827)
    at m (https://player.twitch.tv/?channel=systemarcadia&player=facebook&autoplay=1&parent=meta.tag&auto_play=1:1:4294)
    at Object.246 (https://static.twitchcdn.net/assets/player-main-a60a54700d8681907841.js:1:154199)
    at m (https://player.twitch.tv/?channel=systemarcadia&player=facebook&autoplay=1&parent=meta.tag&auto_play=1:1:4294)
    at i (https://player.twitch.tv/?channel=systemarcadia&player=facebook&autoplay=1&parent=meta.tag&auto_play=1:1:4155)
    at Array.e [as push] (https://player.twitch.tv/?channel=systemarcadia&player=facebook&autoplay=1&parent=meta.tag&auto_play=1:1:4018)
    at https://static.twitchcdn.net/assets/player-main-a60a54700d8681907841.js:1:47key: "twilight.minConsoleLogLevel"__proto__: Object
e @ player-main-a60a54700d8681907841.js:1
Se @ player-main-a60a54700d8681907841.js:1
gg62 @ player-main-a60a54700d8681907841.js:1
m @ ?channel=systemarcadia&player=facebook&autoplay=1&parent=meta.tag&auto_play=1:1
246 @ player-main-a60a54700d8681907841.js:1
m @ ?channel=systemarcadia&player=facebook&autoplay=1&parent=meta.tag&auto_play=1:1
i @ ?channel=systemarcadia&player=facebook&autoplay=1&parent=meta.tag&auto_play=1:1
e @ ?channel=systemarcadia&player=facebook&autoplay=1&parent=meta.tag&auto_play=1:1
(anonymous) @ player-main-a60a54700d8681907841.js:1
04:16:57.240 player-main-a60a54700d8681907841.js:1 4:16:57 AM [ERROR] Uncaught error. DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.

Your environment

uBlock-user commented 4 years ago

Blocking third-party cookies/storage causes this. Are you blocking third-party cookies/storage ?

Disable matrix for domain

Disabling matrix does not disable per-site switches. Did you disable them all individually ?

gorhill commented 4 years ago

I don't see any errors in there that I can link to uMatrix.

Blocking 3rd-party cookies/data in the browser preferences will cause this.

Kein commented 4 years ago

No 3rd party cookies are blocked by browser, cookies are managed by uMatrix, I've assumed that disabling uMatrix for domain should disable cookie restrictions imposed by uMatrix as well? Is that not the case?

uBlock-user commented 4 years ago

Only outgoing cookies are blocked by uMatrix.

Kein commented 4 years ago

Okay? That does not explain why the error persist unless uMatrix is uninstalled though ¯\_(ツ)_\/¯

gorhill commented 4 years ago

Your repro steps are problematic, they assume whoever is interested in trying to reproduce knows anything about Discord. I don't. I loaded https://discord.com in the browser, clicked "Open Discord in your browser", and I don't see any embedded Twitch video.

liamengland1 commented 4 years ago

Your repro steps are problematic, they assume whoever is interested in trying to reproduce knows anything about Discord. I don't. I loaded https://discord.com in the browser, clicked "Open Discord in your browser", and I don't see any embedded Twitch video.

I made a test server: https://discord.gg/pp3fnhR

gorhill commented 4 years ago

Thanks.

Starting from default ruleset, I create these rules and I could play the embedded Twitch video fine:

discord.com d3gdm2urgmeunj.cloudfront.net * allow
discord.com discord.gg * allow
discord.com discord.media * allow
discord.com twitch.map.fastly.net * allow
discord.com twitch.map.fastly.net frame allow
discord.com twitch.tv * allow
discord.com twitch.tv frame allow
discord.com twitchcdn.net * allow
discord.com twitchsvc.net * allow

Using Firefox 77, set "Enhanced Tracking Protection" set to "Standard".

uBlock-user commented 4 years ago

https://www.chromium.org/for-testers/bug-reporting-guidelines/uncaught-securityerror-failed-to-read-the-localstorage-property-from-window-access-is-denied-for-this-document

why the error persist unless uMatrix is uninstalled though

Can you reproduce this on Chrome/Chromium, if not, then it's a ungoogled chromium issue.