nette-forms-gpspicker
nette-forms-gpspicker copied to clipboard
Crossdomain stylesheets
Hello,
when first css style in page is from another domain, then JS fails on:
var stylesheet = window.document.styleSheets[0];
var method = stylesheet.cssRules ? 'insertRule' : 'addRule';
for (var i = 0; i < rules.length; i++) {
stylesheet[method].call(stylesheet, rules[i], 0);
because JS in Firefox can't modify cross domain css.
I'm suggesting as solution add this code into loop, try+catch and if try was successful, then break loop. If is caught exception, then do next loop iteration with next styleSheets.
Do you agree with this solution, so I can prepare commit?