Skip to content

Commit 7850c1a

Browse files
committed
hotfix: ignore foreign stylesheets (ff)
1 parent a470ad8 commit 7850c1a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-round-div",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Make your rounded corners look phenomenal with g2 continuity.",
55
"main": "dist/main.js",
66
"scripts": {

src/external/getMatchedCSSRules-polyfill.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ if (typeof window !== 'undefined' && typeof window.getMatchedCSSRules !== 'funct
3838
// if this sheet's media is specified and doesn't match the viewport then skip it
3939
if (sheet_media && sheet_media.length && !window.matchMedia(sheet_media).matches) return [];
4040
// get the style rules of this sheet
41-
return toArray(stylesheet.cssRules);
41+
try {
42+
// modification to original (try statement):
43+
// firefox doesn't allow accessing "cssRules" of foreign stylesheets => just return empty array
44+
return toArray(stylesheet.cssRules);
45+
} catch (e) {
46+
return [];
47+
}
4248
}
4349

4450
function _find(string, re) {

0 commit comments

Comments
 (0)