Closed Bug 668591 Opened 15 years ago Closed 15 years ago

Persona previews loaded via iframe not working

Categories

(www.mozilla.org :: General, defect, P1)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: sgarrity, Assigned: brandon)

References

()

Details

Attachments

(2 files)

On pages like: http://www.mozilla.com/en-US/firefox/customize/#style http://www.mozilla.com/pa-IN/firefox/3.6/firstrun/ The persona previews do not seem to be working anymore. They are loaded through an iframe. If you load the contents of the iframe directly, they do work: http://www.getpersonas.com/en-US/external/mozilla/
A few notes: This doesn't seem to work in 3.6, 4.0.x, or 5. At first I assumed it might have been a security-related change in a point release, but even the original 3.6 doesn't seem to work (and it DID work at some point). Also, I've ruled out other stuff on the parent page interacting with the iframe. The attached HTML file shows the simplest possible HTML file including the iframe, and it still doesn't work.
Assignee: nobody → bsavage
Mkelly will have some insight into this. He recognized this yesterday and we thought it had something to do with the Snippet. He was able to get it working by cutting down the code to the basics.
Attached is a sample of the minimum code needed to preview a persona in an iframe. This example works when included in an iframe on FF6 and FF5.
I am able to replicate this issue on the getpersonas.com homepage by just including it within any iframe. This problem is not unique to the two examples in comment #1.
I looked into it more, and the issue appears to be in script.js: http://svn.mozilla.org/projects/getpersonas.com/trunk/static/js/script.js Specifically, if (self != top) { PERSONAS_ENABLED = false; } This sets PERSONAS_ENABLED to false when executed in an iframe, which causes the persona preview and install to fail. I removed this in a local test copy and the page worked again.
r88675 perhaps?
https://bugzilla.mozilla.org/show_bug.cgi?id=542020#c3 says we need to add code to mozilla.com
(In reply to comment #7) > https://bugzilla.mozilla.org/show_bug.cgi?id=542020#c3 says we need to add > code to mozilla.com I've added this code to the /firefox/customize page in trunk in r91928. We'll have to get to into production to test though (only works for www.mozilla.com). Can someone with super-powers get this into production?
(In reply to comment #8) > (In reply to comment #7) > > https://bugzilla.mozilla.org/show_bug.cgi?id=542020#c3 says we need to add > > code to mozilla.com > > I've added this code to the /firefox/customize page in trunk in r91928. > We'll have to get to into production to test though (only works for > www.mozilla.com). Can someone with super-powers get this into production? Maybe James Long can? James?
Pushed to stage/production with r92047. It's in prod but not working apparently. I suggest removing the try/catch and replace with a if(iframe.contentWindow.postMessage) to make debugging easier. You can also play with your /etc/hosts to make your working environment respond to mozilla.com.
(In reply to comment #10) > It's in prod but not working apparently. I suggest removing the try/catch > and replace with a if(iframe.contentWindow.postMessage) to make debugging > easier. Do you mind doing that? I can, but I'd still need you to push to production.
Committed on trunk with r92080 and stage/production with r92081. Steven: I just added a line in my /etc/hosts to fake it. 127.0.0.1 www.mozilla.com Also, the fix was to wait for the frame to load before sending the message so that the receiving listener is set up.
Status: NEW → RESOLVED
Closed: 15 years ago
Keywords: qawanted
Resolution: --- → FIXED
Confirmed that the persona previews are now working. Thanks!
Verified, FIXED.
Status: RESOLVED → VERIFIED
Component: www.mozilla.org/firefox → www.mozilla.org
Component: www.mozilla.org → General
Product: Websites → www.mozilla.org
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: