Circumventing Chrome Access-control-allow-origin on the local file system?

I think I’ve figured it out. All I really needed to do was add a callback into my <script> tag. Final code: I have an element named next… So, in the $(“#next”).click() function I have the following code. This only gets executed if they click “next”. //remove old dynamically written script tag- var old = … Read more

How does Same Origin Policy apply to browser extensions?

The same-origin policy (SOP) appplies to ordinary web pages, not browser extensions, even if they are written in JavaScript. What does “different server” mean when the extension code does not origingate from a server? (The extension script might have some kind of orgin, like chrome-extension://longhashidentificationstr, but not an traditional domain/origin.) To communicate with any Web … Read more

Can Cross-Origin Resource Sharing headers authorize X-Domain IFRAME access?

CORS doesn’t let you do that, but you can use cross-document messaging to send strings between iframes and their parent windows even on different domains, and use that to communicate. Most browsers support this although Internet Explorer’s way differs from the others‘. Assuming what you want is to have the iframe announce to the parent … Read more

Embedding Google Apps Script in an iFrame

Google had just recently enabled this feature. It has been under a ‘feature request’ status for quite a long time. Link here You can now explicitly define X-Frame-Options. To allow embedding under another domain, the option should be HtmlService.XFrameOptionsMode.ALLOWALL Google documentation on the subject: https://developers.google.com/apps-script/reference/html/html-output#setXFrameOptionsMode(XFrameOptionsMode) Example: function doGet() { return HtmlService.createTemplateFromFile(‘form.html’) .evaluate() // evaluate MUST … Read more

Using iframe with local files in Chrome

I’m sorry to say you that I’ve tried during weeks to solve this issue (I needed it for a project) and my conclusion is that it’s not possible. There are a lot of problems arround local access through javascript with chrome, and some of them can be solved using –allow-file-access-from-files and –disable-web-security, including some HTML5 … Read more

Access child iFrame DOM from parent page

There is a way. When the page in the iframe loads, have it do the following parent.childGetElementById = function (id) {return document.getElementById(id);} parent.childLoaded(); This will make a function in the global scope of the parent page (that contains the iframe). Then in the parent, just have the following function childLoaded() {var dom = childGetElementById(‘someid’);} This … Read more