Hi jorgev,
Thank you for taking the time to reply.
I understand that Mozilla is trying to encourage the use of Add-on SDK and that the “old” bootstrapped model is more difficult to use; at the same time, your own docs make no guarantee that add-on SDK based extensions will work with e10s unless this or that…and due to your rather tight release schedule (e10s and the signing of addons) I don’t afford the luxury of migrating everything to add-on SDK anyway.
At this point, please assume that I have a decent understanding of message passing/manager which I already use for a lot of other stuff going on between chrome and frame scripts.
The context menu issue boils down to this: the context menu is about to show up and I have to decide what menu items to display based on the page content (which should only be accessible from framescript - not really true, if you check my posts above). The context menu items however can not be modified from framescript so it has to be done from chrome. Framescript needs to send a message to chrome script - I’m OK with that as long as someone is willing to explain to me how will that work: the way I see it, if I send an async message (frame>chrome), I have zero guarantees that the message will arrive before chrome script’s own “popupshowing” event is triggered. If I send a sync message…my understanding is that I should avoid sending sync messages to chrome (especially since this is a pretty time sensitive case and it might delay the display of the context menu, make FF seem sluggish and/or result in a rejection during add-on review).
Since there’s basically zero documentation on how context menus are supposed to work in e10s, I don’t know which process is handling the menu and what is, internally, the sequence of events. Is chrome process (who manages the context menu window and items) the one which “catches” the event first, then maybe dispatch it to the content/page browser in some other process (frame) or is the frame catching the event first and them dispatches it to the chrome process?
Based on the discussion found here https://bugzilla.mozilla.org/show_bug.cgi?id=1060138, the issue seems to be far from trivial and your own patch to make add-on sdk context menus work with e10s is quite large and complex. It basically looks like message manager alone is not the solution.
Frankly, I don’t really want to know what FF does internally - it’s already unbelievable/unacceptable how much time I already spent on this “non issue” - I just want to know how to handle this case properly without add-on sdk (ideally through a core module created/supported by you but I’ll settle for anything that works). Is that possible?
Are you suggesting that Mozilla has no/little interest in supporting the “old” bootstrapped extensions any longer at this point and the only way forward is add-on sdk?
Will Michael’s solution above work and be accepted during add-on review?