Error: Permission denied to access property "mediaText"
Categories
(Core :: DOM: Bindings (WebIDL), defect)
Tracking
()
People
(Reporter: ab, Unassigned)
References
Details
(Whiteboard: [domcore-bugbash-triaged])
Comment 5•8 years ago
|
||
Comment 6•8 years ago
|
||
Updated•8 years ago
|
| Assignee | ||
Updated•7 years ago
|
Comment 8•6 years ago
|
||
| str | ||
I can reproduce this error, or at least a similar one. We ran into it with a customer report of an error in BrowserLink in Visual Studio.
I've created a minimal repro that works with just one html file and one css file:
<!DOCTYPE html>
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<link rel="stylesheet" href="FirefoxReproStyles.css" />
</head>
<body>
<h1>Some Text</h1>
<p><a href="#" onclick="ProcessStyles();return false;">Click Me</a></p>
</body>
<script>
function ProcessStyles() {
const media = document.styleSheets[0].media;
let mt = media.mediaText;
console.log(mt);
}
</script>
</html>
FirefoxReproStyles.css:
@media all and (min-width: 1000px) {
h1 {
font-size: 3.5rem; }
h2 {
font-size: 2.5rem; }
h3 {
font-size: 2rem; }
}
The steps here are pretty simple, but specific:
- Load the page in Firefox.
- Right-click on the big "Some Text" at the top and choose Inspect Element
- Click the "Click Me" link to execute the script block.
- Look in the console output and you'll see the OP's exception message.
Interestingly, if you replace step 2 with just hitting F12, the problem does not happen, at least not immediately. A combination of inspecting the element from the Inspect tab and hitting refresh on the browser will cause it to happen eventually.
I tested this on 70.0b8 (64-bit) on Windows 10 initially.
I confirmed it was also an issue on:
Developer: 70.0b8 (64-bit) and
Nightly: 71.0a1 (2019-09-19) (64-bit)
The error does not happen in Chrome or Chromium-based Edge. I did not test other browsers.
Comment 9•6 years ago
|
||
Based on the steps in comment 8, I can reproduce this bug. It doesn't seem to happen very reliably. Need further investigation.
| Reporter | ||
Comment 10•6 years ago
|
||
Sorry I couldn't find the time to create a reproducible test case.
Luckily Tim apparently found the cause of this heisenbug, that's great!
The issue I mentioned 2 years ago is still open and CodeKit's maintainer summed up the problem here.
As you can see from this single thread, that bug as affected a number of devs.
It would be great to be able to work with the Firefox console open!
Comment 11•6 years ago
|
||
I looked into this a bit, and it doesn't seem to me that there is anything related to our CSSOM implementation. It seems that there is somewhere in the binding code that thinks the value returned from media should be restricted in some cases. I'm not very familiar with binding code so it probably need someone who knows the internal of JS more to investigate.
Moving this to binding so that someone with expertise there could shed some light.
Comment 12•5 years ago
|
||
I have found a case where this bug always occurs. Using Salvattore, a library agnostic JS script, this bug always shows up when Web Console (Ctrl+Shift+K) is opened and reload a page with Salvattore javascript. I'm using Salvattore on a new website project I'm currently working on and I'm using Firefox Web Developer Tools to debug, which is how I came across this bug.
https://salvattore.js.org
https://github.com/rnmp/salvattore
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0
Build ID: 20201014125134
Reproducible: Always
Steps to Reproduce:
- Open a website with Salvattore js, for example https://salvattore.js.org
- Open Web Console (Ctrl+Shift+K)
- Reload the page
Actual Results:
The javascript for Salvattore has stopped with error.
This message is displayed in Web Console:
Uncaught Error: Permission denied to access property "mediaText"
v https://salvattore.js.org/site.js:1
v https://salvattore.js.org/site.js:1
v https://salvattore.js.org/site.js:1
m https://salvattore.js.org/site.js:1
<anonymous> https://salvattore.js.org/site.js:1
i https://salvattore.js.org/site.js:1
b https://salvattore.js.org/site.js:1
i https://salvattore.js.org/site.js:1
b https://salvattore.js.org/site.js:1
i https://salvattore.js.org/site.js:1
s https://salvattore.js.org/site.js:1
setTimeout handler*s https://salvattore.js.org/site.js:1
<anonymous> https://salvattore.js.org/site.js:1
<anonymous> https://salvattore.js.org/site.js:1
Expected Results:
The javascript for Salvattore is executed.
You have to close Web Console and Web Developer window, then reload the page to make Salvattore javacript run normal.
This bug never occurs when Web Console and Web Developer window is not opened.
Comment 13•5 years ago
|
||
(In reply to Michael from comment #12)
I have found a case where this bug always occurs. Using Salvattore, a library agnostic JS script, this bug always shows up when Web Console (Ctrl+Shift+K) is opened and reload a page with Salvattore javascript. I'm using Salvattore on a new website project I'm currently working on and I'm using Firefox Web Developer Tools to debug, which is how I came across this bug.
https://salvattore.js.org
https://github.com/rnmp/salvattoreUser Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0
Build ID: 20201014125134Reproducible: Always
Steps to Reproduce:
- Open a website with Salvattore js, for example https://salvattore.js.org
- Open Web Console (Ctrl+Shift+K)
- Reload the page
Actual Results:
The javascript for Salvattore has stopped with error.
This message is displayed in Web Console:
Uncaught Error: Permission denied to access property "mediaText"
v https://salvattore.js.org/site.js:1
v https://salvattore.js.org/site.js:1
v https://salvattore.js.org/site.js:1
m https://salvattore.js.org/site.js:1
<anonymous> https://salvattore.js.org/site.js:1
i https://salvattore.js.org/site.js:1
b https://salvattore.js.org/site.js:1
i https://salvattore.js.org/site.js:1
b https://salvattore.js.org/site.js:1
i https://salvattore.js.org/site.js:1
s https://salvattore.js.org/site.js:1
setTimeout handler*s https://salvattore.js.org/site.js:1
<anonymous> https://salvattore.js.org/site.js:1
<anonymous> https://salvattore.js.org/site.js:1Expected Results:
The javascript for Salvattore is executed.You have to close Web Console and Web Developer window, then reload the page to make Salvattore javacript run normal.
This bug never occurs when Web Console and Web Developer window is not opened.
More information:
This bug with Salvattore JS (for example https://salvattore.js.org) doesn't not occur with Firefox 80.0.1.
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0
Build ID: 20200831163820
Comment 14•5 years ago
|
||
(In reply to Michael from comment #12)
I have found a case where this bug always occurs. Using Salvattore, a library agnostic JS script, this bug always shows up when Web Console (Ctrl+Shift+K) is opened and reload a page with Salvattore javascript. I'm using Salvattore on a new website project I'm currently working on and I'm using Firefox Web Developer Tools to debug, which is how I came across this bug.
https://salvattore.js.org
https://github.com/rnmp/salvattoreUser Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0
Build ID: 20201014125134Reproducible: Always
Steps to Reproduce:
- Open a website with Salvattore js, for example https://salvattore.js.org
- Open Web Console (Ctrl+Shift+K)
- Reload the page
Actual Results:
The javascript for Salvattore has stopped with error.
This message is displayed in Web Console:
Uncaught Error: Permission denied to access property "mediaText"
v https://salvattore.js.org/site.js:1
v https://salvattore.js.org/site.js:1
v https://salvattore.js.org/site.js:1
m https://salvattore.js.org/site.js:1
<anonymous> https://salvattore.js.org/site.js:1
i https://salvattore.js.org/site.js:1
b https://salvattore.js.org/site.js:1
i https://salvattore.js.org/site.js:1
b https://salvattore.js.org/site.js:1
i https://salvattore.js.org/site.js:1
s https://salvattore.js.org/site.js:1
setTimeout handler*s https://salvattore.js.org/site.js:1
<anonymous> https://salvattore.js.org/site.js:1
<anonymous> https://salvattore.js.org/site.js:1Expected Results:
The javascript for Salvattore is executed.You have to close Web Console and Web Developer window, then reload the page to make Salvattore javacript run normal.
This bug never occurs when Web Console and Web Developer window is not opened.
More information:
This bug with Salvattore JS (for example https://salvattore.js.org) doesn't not occur with Firefox 81.0.2.
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0
Build ID: 20201012085804
Comment 15•5 years ago
|
||
I can repro that issue, but given it seems unrelated to comment 0 and is a regression (see there), I filed bug 1673199.
Comment 16•5 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #15)
I can repro that issue, but given it seems unrelated to comment 0 and is a regression (see there), I filed bug 1673199.
Thank you!
Comment 17•4 years ago
|
||
Clear a needinfo that is pending on an inactive user.
For more information, please visit auto_nag documentation.
Updated•3 years ago
|
Comment 18•2 years ago
|
||
worksforme with Nightly Fx 129.
Description
•