Hi,
I've written several bits of code in JavaScript/Jquery where I look at details in frames other than the topic frame. For example, to see if the navigation pane is open when resizing the browser, I set a variable:
displayed=top.$("#navigation").css("display");
It's the "top." part that makes it look in all of the frames. It works fine in IE, even without MOTW, but Chrome an Opera hate it. My research indicates that they regard it as a security issue:
Uncaught SecurityError: Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains and ports must match"
I thought that "null" and "null" were the same, but anyway...
Does anyone know of a foolproof way to access non-topic information? Surely Flare must have to do this itself all the time.
Problems with cross-frame references in Chrome
-
- Propeller Head
- Posts: 68
- Joined: Fri Aug 22, 2014 12:24 pm
Re: Problems with cross-frame references in Chrome
Did you try putting that project output on a web server? I found that testing frame-to-frame JavaScript on a local machine or file server would yield those results. It's a security issue that IE hasn't bothered to patch. For me, the solution to that security issue was putting the content on an actual web server (Apache and IIS worked).
Re: Problems with cross-frame references in Chrome
Hi Mike,
Thanks for replying. I didn't think about that but I'm sure it would work. The problem is that we don't have any intention of ever hosting the help on a web server. We want the look of HTML5 but not on the web. The developers are dead against installing any kind of web infrastructure at the customer.
To get past this, I had to move the code around and pass messages between frames using postMessage. It works fine in IE, Chrome, Firefox and Opera.
Thanks for replying. I didn't think about that but I'm sure it would work. The problem is that we don't have any intention of ever hosting the help on a web server. We want the look of HTML5 but not on the web. The developers are dead against installing any kind of web infrastructure at the customer.
To get past this, I had to move the code around and pass messages between frames using postMessage. It works fine in IE, Chrome, Firefox and Opera.