Closed
Bug 647501
Opened 14 years ago
Closed 14 years ago
Can't inject api into the navigator
Categories
(Firefox for Android Graveyard :: Extension Compatibility, defect)
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: aamariutei, Unassigned)
Details
// Setup the main event listeners
window.addEventListener("load", function(e) {
messageManager.loadFrameScript("chrome://notifications/content/script.js", true);
}, false);
//script.js
content.navigator.wrappedJSObject.pushNotifications = {
...
};
I expect navigator.pushNotifications to be present inside the DOM to any webapp that gets loaded in fennec. (unfortunately, currently, it doesn't),
Comment 1•14 years ago
|
||
Ok, there are a couple problems here. First, load events occur in the child, not the parent, so you actually need to add a load listener in the frame script so that the navigator object is updated every time a new pageload occurs. However, when I tried this I found that there were timing problems, such that the web content that checked pushNotifications ran before the content script load event. That's a problem that you'll need to solve. This bug, however, is invalid as far as I can tell.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 2•14 years ago
|
||
Yeah, I was able to resolve this issue with a little bit of help from mfinkle. You're right, that needs to be done on a load event.
You need to log in
before you can comment on or make changes to this bug.
Description
•