Example for page scripts from "Scripting trusted panel content" section does not work

RESOLVED FIXED

Status

P5
normal
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: markus.heidelberg, Unassigned)

Tracking

Details

(URL)

(Reporter)

Description

3 years ago
:: Developer Documentation Request

      Request Type: Correction
     Gecko Version: 41 Branch
 Technical Contact: 

:: Details

Either the documentation is lacking something or maybe there is a bug in the SDK.
It seems as if addon.port.on() and addon.port.emit() doesn't work.

The example from the preceding section "Getting user input" works. This is the same Add-On, but using a content script instead of a page script:
https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/panel#Getting_user_input

Using jpm 1.0.3.
It looks as if the problem might be that a revision to this page[1] moved the "get-text.js" include in text-entry.html" to before the textarea declaration, so the script couldn't find the textarea.

I've reverted this change. Does it work for you now?

[1] https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/panel$compare?locale=en-US&to=793159&from=781261
Flags: needinfo?(markus.heidelberg)
(Reporter)

Comment 2

3 years ago
Indeed, I just had too little webdev knowledge to see this myself.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Flags: needinfo?(markus.heidelberg)
Resolution: --- → WORKSFORME
Thanks for finding and reporting the bug Markus!
Resolution: WORKSFORME → FIXED
You need to log in before you can comment on or make changes to this bug.