Closed Bug 1242576 Opened 9 years ago Closed 3 years ago

How to postMessage from Firefox frame-script to a web page? 'content' is <unavaiable>

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: oded.hutzler, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36 Actual results: The Firefox documnatation says i should try to use 'content' object instead of the 'window' object. When trying to access the content page i get an error: . // frame-script.js addMessageListener("message_from_ext", function(message){ try{ var _message = { from: "content", to: "web", data: message }; content.postMessage(_message, "*"); //getting <unavailable> on the content object }catch(e){ console.log(e); } }); how should i access the content object? should i load anything to my frame-script.js? FF The Firefox documnatation says i should try to use 'content' object instead of the 'window' object. When trying to access the content page i get an error: . // frame-script.js addMessageListener("message_from_ext", function(message){ try{ var _message = { from: "content", to: "web", data: message }; content.postMessage(_message, "*"); //getting <unavailable> on the content object }catch(e){ console.log(e); } }); how should i access the content object? should i load anything to my frame-script.js? FF nightly 46.01a
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.