Closed Bug 579764 Opened 10 years ago Closed 9 years ago
notify observers after the document element has been created but before script inside it has run
Note that right now there may not be such a time. Making such a time exist may well involve parser changes for both xml and html.
Another problem is, are we fine with notifying into a jetpack from the content thread, and blocking until the jetpack is done handling that notification? I guess it's ok once we have process separation between chrome and content? But before then? What do we do elsewhere?
(In reply to comment #2) > Another problem is, are we fine with notifying into a jetpack from the content > thread, and blocking until the jetpack is done handling that notification? Don't we already do this for content-document-global-created?
content-document-global-created is just a observerService notification. But if someone calls into jetpacks when they fire and block until the jetpack returns, then yes, we are. Is that the case?
(In reply to comment #4) > content-document-global-created is just a observerService notification. But if > someone calls into jetpacks when they fire and block until the jetpack returns, > then yes, we are. > > Is that the case? Yes. When the notification fires, if a Jetpack-based addon has registered some code to be run alongside the page being loaded (via the Page Mods API or some other API with access to content pages), an observer creates a sandbox with access to the page's JS context and loads code provided by the addon into it. However, once Jetpack-based addons run in separate "jetpack" processes, this particular chunk of work will probably still happen in the content process, so there will be no need for the content process to block waiting for the jetpack process (which, as understand it from conversations with bsmedberg, is tricky to implement and requires some bridging infrastructure).
9 years ago
Assignee: nobody → jonas
blocking2.0: --- → beta5+
This is an untested patch.
Comment on attachment 469280 [details] [diff] [review] v0.1 Err.. nevermind
Attachment #469280 - Attachment is obsolete: true
Ok, this one should work better.
Comment on attachment 469310 [details] [diff] [review] Patch v0.2 I tested this patch with my Jetpack SDK changes in bug 590968, attachment 469514 [details] [diff] [review], and it worked fine. I was able to load jQuery as a content script on document-element-inserted without exceptions being thrown, and it behaved as expected.
Attachment #469310 - Flags: feedback+
9 years ago
Attachment #469310 - Flags: review?(jst)
Jonas: is this safe to land or is there a high risk of regression from it? If so, I'd rather push it to beta6+; what say you?
This was actually already checked in friday night: http://hg.mozilla.org/mozilla-central/rev/34afbe32fb0e
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Documented here: https://developer.mozilla.org/en/Observer_Notifications#Documents And mentioned on Firefox 4 for developers.
You need to log in before you can comment on or make changes to this bug.