Skip to content

Commit 996d903

Browse files
committed
Merge pull request marcj#52 from ElManouche/master
Fix the External stylesheets error in Firefox
2 parents 2cc37a8 + 76d8de3 commit 996d903

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ElementQueries.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,13 @@
232232
this.init = function(withTracking) {
233233
this.withTracking = withTracking;
234234
for (var i = 0, j = document.styleSheets.length; i < j; i++) {
235-
readRules(document.styleSheets[i].cssText || document.styleSheets[i].cssRules || document.styleSheets[i].rules);
235+
try {
236+
readRules(document.styleSheets[i].cssText || document.styleSheets[i].cssRules || document.styleSheets[i].rules);
237+
} catch(e) {
238+
if (e.name !== 'SecurityError') {
239+
throw e;
240+
}
241+
}
236242
}
237243
};
238244

0 commit comments

Comments
 (0)