Closed Bug 1220867 Opened 9 years ago Closed 9 years ago

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

Categories

(Developer Documentation Graveyard :: Add-ons, defect, P5)

All
Other
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: markus.heidelberg, Unassigned)

References

()

Details

:: 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)
Indeed, I just had too little webdev knowledge to see this myself.
Status: UNCONFIRMED → RESOLVED
Closed: 9 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.