Skip to content

Commit b6e0a00

Browse files
author
Claudéric Demers
authored
Merge pull request #106 from funnel-mark/master
fix: workaround for mozilla bug
2 parents fed09b9 + 398ccf7 commit b6e0a00

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/utils.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ export const events = {
1818

1919
export const vendorPrefix = (function () {
2020
if (typeof window === 'undefined' || typeof document === 'undefined') return ''; // server environment
21-
let styles = window.getComputedStyle(document.documentElement, '');
21+
// fix for:
22+
// https://bugzilla.mozilla.org/show_bug.cgi?id=548397
23+
// window.getComputedStyle() returns null inside an iframe with display: none
24+
// in this case return an array with a fake mozilla style in it.
25+
let styles = window.getComputedStyle(document.documentElement, '') || ['-moz-hidden-iframe'];
2226
const pre = (Array.prototype.slice
2327
.call(styles)
2428
.join('')

0 commit comments

Comments
 (0)