document.adoptedStyleSheets is not iterable in a content script
Categories
(WebExtensions :: Untriaged, defect, P3)
Tracking
(firefox100 ?, firefox101 affected, firefox102 affected)
People
(Reporter: danny0838, Unassigned)
References
(Depends on 1 open bug)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0
Steps to reproduce:
- Download and install the attchment as a temporary add-on.
- Visit https://example.com and open the inspector from the tab.
- Click the browser action.
Actual results:
"document.adoptedStyleSheets is not iterable" is thrown at for (... of document.adoptedStyleSheets)
(tested on Firefox 101.0b9)
Expected results:
No error should occur when running for (... of document.adoptedStyleSheets)
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•2 years ago
|
||
Hello,
I reproduced the issue on the latest Nightly (102.0a1/20220522190601) and Beta (101.0b9/20220519220322) and pretty sure on Release (100.0.220220519220738) as well – an error is thrown but it’s a bit different from what occurs on Nightly and Beta.
Tested under Windows 10 x64 and Ubuntu 16.04 LTS.
On Nightly and Beta, clicking the browser action will throw a TypeError: document.adoptedStyleSheets is not iterable
in the web console, while on Release, clicking the browser action will throw a TypeError: document.adoptedStyleSheets is undefined
.
For further details, please see the attached screenshots.
Note: I will be marking only Nightly and Beta as affected at the moment, as only there did the bug manifest fully as described.
Comment 3•2 years ago
|
||
Comment 4•2 years ago
|
||
@Alex Cornestean:
Thank you for confirmation. document.adoptedStyleSheets is not implemented in Firefox 100.*, so it's unrelated with this issue.
Comment 6•2 years ago
|
||
The feature was enabled by default in 101 (bug 1644102).
Emilio, this looks like a XrayWrapper issue. I don't know what an ObservableArray
is; could this be caused by bug 1023984 (i.e. should it depend on that bug)?
Updated•2 years ago
|
Could you raise severity/priority? adoptedStyleSheets is completely unusable in a content script regardless of iterators. The only workaround is wrappedJSObject but it's unsafe.
Description
•