Last Comment Bug 850449 - Expose 'addon' to scripts matching custom addon-page URIs
: Expose 'addon' to scripts matching custom addon-page URIs
Status: RESOLVED WONTFIX
:
Product: Add-on SDK
Classification: Client Software
Component: General (show other bugs)
: unspecified
: All All
: P1 normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
: 850451 (view as bug list)
Depends on: 852240 790367 873102
Blocks: sdk/addon-page
  Show dependency treegraph
 
Reported: 2013-03-12 15:29 PDT by Wes Kocher (:KWierso)
Modified: 2013-05-30 10:00 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Pull request 851 (165 bytes, text/html)
2013-03-12 16:59 PDT, Alexandre Poirot [:ochameau]
myk: feedback+
rFobic: feedback-
Details

Description Wes Kocher (:KWierso) 2013-03-12 15:29:06 PDT
It'd be nice to expose the addon object to page scripts similar to trusted page content in panels, so the scripts can communicate back to the main addon script without attaching a content script.
Comment 1 Wes Kocher (:KWierso) 2013-03-12 15:33:26 PDT
*** Bug 850451 has been marked as a duplicate of this bug. ***
Comment 2 Alexandre Poirot [:ochameau] 2013-03-12 16:59:08 PDT
Created attachment 724213 [details]
Pull request 851

Myk, would something like this ease the usage of addon-page?
We are automagically exposing an `addon` global object that act exactly like `self` in content scripts but injected directly into all addon page documents.
Then you can send and receive page events with :
let page = require("sdk/addon-page");
page.on("message",...);
page.postMessage()
page.port.on(...);
page.port.emit(...);

Irakli, Would you bless such new high-level feature?
Comment 3 Myk Melez [:myk] [@mykmelez] 2013-03-13 10:13:30 PDT
Comment on attachment 724213 [details]
Pull request 851

Yes, that would indeed make addon-page easier to use!  It would enable me to eliminate a whole layer of the stack.
Comment 4 Dave Townsend [:mossop] 2013-05-16 09:32:01 PDT
Looks like addon-page is going to be dropped in australis so we probably don't need to work on this bug anymore

Note You need to log in before you can comment on or make changes to this bug.