Closed
Bug 1320840
Opened 9 years ago
Closed 9 years ago
Permission denied to access parent.postMessage from iframe
Categories
(Firefox :: Extension Compatibility, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: srt19170, Unassigned)
Details
Attachments
(1 file)
|
101.35 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0
Build ID: 20161123182536
Steps to reproduce:
1. Install the Rsstler RSS reader extension (https://addons.mozilla.org/en-US/firefox/addon/rsstler/).
2. Attempt to read RSS feed.
Actual results:
No content is displayed for feed items. The console reports "Error: Permission denied to access property "postMessage".
Expected results:
The feed item content should have been displayed.
Rsstler puts RSS content in an iframe as recommended. It then uses parent.postMessage() to pass information back to the parent window. With the release of 50.0.1, this stopped working.
An example of the code within a feed item iframe:
<html><head><style type='text/css'>img {max-width: 100%;}</style></head>
<body onload=" parent.postMessage('iframe6:'+document.body.scrollHeight, '*');">
[ Various HTML deleted ]
</body>
</html>
The parent is obviously a chrome: URL.
Do you have a screenshot of the blank windows of the RSS add-on, please. I'm not I'm able to reproduce it on Win 7 with FF50.
Flags: needinfo?(srt19170)
| Reporter | ||
Comment 2•9 years ago
|
||
Flags: needinfo?(srt19170)
| Reporter | ||
Comment 3•9 years ago
|
||
Let me clarify: In the screenshot where the feed item titles are shown (e.g., "python string concatenation performance") there should be the RSS item content shown below the title.
| Reporter | ||
Comment 4•9 years ago
|
||
Further clarification: The extension puts some content into an iframe, and then the iframe uses postMessage to send the height of the content back to the parent, which uses that information to resize the iframe so that the content is visible. Because the postMessage is failing the iframe never gets resized and the content remains hidden.
The fact that the content isn't visible is just a symptom of the problem, but I included that so that testers could confirm that the problem is reproducible.
| Reporter | ||
Comment 5•9 years ago
|
||
Some additional information:
The approach I'm using to communicate from an iframe to its parent was taken from here:
https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Interaction_between_privileged_and_non-privileged_pages
This page is now archived as obsolete, but there's no replacement page.
There's a warning on ttps://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage about using postMessage in extensions, but nothing to indicate why it stopped working. (The warning does not apply in this situation, I don't believe.) There's also no alternative method suggested for communicating from an iframe to it's parent.
Updated•9 years ago
|
Component: Untriaged → Extension Compatibility
| Reporter | ||
Comment 6•9 years ago
|
||
I install mozregression tonight to try to identify the source of the problem. Surprisingly, the extension worked fine in all the builds.
So I started bisecting my extensions, and discovered that NoScript was causing the error. Bisecting all the controls on NoScript I eventually figured out that the option "Block every object coming from a site marked as untrusted" is the culprit.
I'll close this bug and report out to the NoScript guys and see what they say.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•