Skip to content
This repository was archived by the owner on Aug 23, 2024. It is now read-only.

Commit 2b5f7c1

Browse files
Ignore InvalidAccessError when reading rules
Error occurs with Firefox, Edge when trying to include rules coming from 3rd-party stylesheets.
1 parent adefff4 commit 2b5f7c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ElementQueries.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@
389389
try {
390390
readRules(document.styleSheets[i].cssRules || document.styleSheets[i].rules || document.styleSheets[i].cssText);
391391
} catch(e) {
392-
if (e.name !== 'SecurityError') {
392+
if (e.name !== 'SecurityError' && e.name !== 'InvalidAccessError') {
393393
throw e;
394394
}
395395
}

0 commit comments

Comments
 (0)