danzen / zimjs

ZIM JavaScript Canvas Framework - Code Creativity! Interactive Media For All.
Other
507 stars 47 forks source link

Zim.Frame("tagID") does not work well. #35

Closed kero13ro closed 5 years ago

kero13ro commented 5 years ago

When I set Frame parameters tagID in version 10.5.4, it alerts "Uncaught DOMException: Failed to read the 'rules' property from 'CSSStyleSheet': Cannot access rules". But it works well in 9.4.1 version.

danzen commented 5 years ago

Thanks for the report - we had that happen before - just trying to think what it was. You can see that the sample pages here https://zimjs.com/templates/tag.html and here https://zimjs.com/templates/tag2.html are working... do you see anything different about your tag in the HTML? It was something odd, like if you applied a class to the tag it gave an error - could you send some code as to how you set up your tag. Thanks.

danzen commented 5 years ago

I think maybe it is a CORS issue... https://stackoverflow.com/questions/48753691/cannot-access-cssrules-from-local-css-file-in-chrome-64?noredirect=1 similar to loading images locally. Do you get the error when the page is on the server? To test locally you can set the chrome allow files access from files flag - if this is not the case, please let us know.

// ON FIREFOX: // type: about:config into your Browser URL bar // search for security.fileuri.strict_origin_policy and double click it to set it to false   // ON PC CHROME: // To test locally, find your Chrome icon or shortcut, right click and choose properties // then under Target, adjust your target to include --allow-file-access-from-files (after the quotes) // eg. "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files   // ON MAC CHROME: // open your terminal anywhere, make sure Google Chrome is currently not running // copy paste this line and hit enter: // open -a "Google Chrome" --args --allow-file-access-from-files   // once again, there is no problem for end users when the files are on a server

kero13ro commented 5 years ago

It was CORS issue. Thanks for helping!