Using dojo in a chrome app?-Collection of common programming errors
2 issues here really, one that I’ve encountered before in another questions: Using dojo 1.8 in a packaged app (uncaught unload is not available in packaged apps)
And another that has to do with fetching dojo template resources (html files) from inside the packaged app from a sandboxed frame.
Let’s start with 1: As an update to the previous question link, the current status is that using the dojo parser in a sandboxed frame will throw an error and break dojo due to an exception thrown from an addEventListener shim inserted by chrome… rather than discourage the use of this function for unload and before unload events, it breaks code by throwing an error. I can work around this by hooking this function myself, and issuing the error without calling the original function to work around the issue (but you guys really might want to fix that…)
2: I’m not finding a good way to work around this. By placing something like this in a sandboxed page: and calling parser.parse(), an error gets thrown trying to fetch the html file from the chrome extension (even when I sandbox the html page it’s trying to fetch).
The error I get is OPTIONS chrome-extension://agkdjbplfceapkkficelgmomnjjjfdpe/source_1.8.0-20120830_dojo/dijit/form/templates/Button.html Cannot make any requests from null.
I realize the vulnerabilities you guys are trying to protect against, but I really need the ability to use dojo in a chrome app. Allowing me to specify a whitelist of resources available to the sandboxed iframes would be great… if I made a ticket, would this be something that you guys would consider?