Closed Bug 810656 Opened 12 years ago Closed 12 years ago

Explain how to remove listeners in content scripts when using port

Categories

(Add-on SDK Graveyard :: Documentation, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: evold, Assigned: wbamberg)

Details

Attachments

(1 file)

https://addons.mozilla.org/en-US/developers/docs/sdk/1.11/dev-guide/guides/content-scripts/using-port.html The above page explains how to add listeners and emit events, but not how to remove a listener. Also if the `once` method is available that should be mentioned on the link above.
Assignee: nobody → wbamberg
So it looks like "once" works, but my example of "removeListener" does not. WOuld you mind taking a look and see if I'm doing anything wrong? https://builder.addons.mozilla.org/package/162389/latest/
(In reply to Will Bamberg [:wbamberg] from comment #1) > So it looks like "once" works, but my example of "removeListener" does not. > WOuld you mind taking a look and see if I'm doing anything wrong? > https://builder.addons.mozilla.org/package/162389/latest/ You found a bug! :/ My fork of your example works https://builder.addons.mozilla.org/package/163229/latest/ So removeListener works, except in your test case..
(In reply to Will Bamberg [:wbamberg] from comment #1) > So it looks like "once" works, but my example of "removeListener" does not. > WOuld you mind taking a look and see if I'm doing anything wrong? > https://builder.addons.mozilla.org/package/162389/latest/ I made bug 816272 for this.
Attached file a pull request
I'm still not quite sure about this queuing bug (bug 816272). It looks to me as if it only affects page-mod, but that's kind of hard to believe.
Attachment #709261 - Flags: review?(evold)
Commit pushed to master at https://github.com/mozilla/addon-sdk https://github.com/mozilla/addon-sdk/commit/5257d2f9772c454901d78b9e5733f5626a37c379 Merge pull request #759 from wbamberg/810656 Fix Bug 810656: updated 'Using Port' content script documentation to include removeListener() and once() r=@erikvold
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Attachment #709261 - Flags: review?(evold) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: