Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Expose 'addon' to scripts matching custom addon-page URIs

RESOLVED WONTFIX

Status

Add-on SDK
General
P1
normal
RESOLVED WONTFIX
4 years ago
4 years ago

People

(Reporter: KWierso, Unassigned)

Tracking

(Depends on: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
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.
(Reporter)

Updated

4 years ago
Duplicate of this bug: 850451
Assignee: nobody → poirot.alex
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?
Attachment #724213 - Flags: feedback?(rFobic)
Attachment #724213 - Flags: feedback?(myk)
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.
Attachment #724213 - Flags: feedback?(myk) → feedback+
(Reporter)

Updated

4 years ago
Priority: -- → P1
Attachment #724213 - Flags: feedback?(rFobic) → feedback-
Depends on: 852240
Looks like addon-page is going to be dropped in australis so we probably don't need to work on this bug anymore
Assignee: poirot.alex → nobody
Depends on: 873102
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.