Last Comment Bug 839814 - Returning undefined from a context listener in a contentScript should hide the menu
: Returning undefined from a context listener in a contentScript should hide th...
Status: RESOLVED FIXED
:
Product: Add-on SDK
Classification: Client Software
Component: General (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Dave Townsend [:mossop]
:
:
Mentors:
Depends on:
Blocks: 839322
  Show dependency treegraph
 
Reported: 2013-02-09 12:55 PST by Dave Townsend [:mossop]
Modified: 2013-02-11 14:54 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/778 (355 bytes, text/html)
2013-02-09 16:13 PST, Erik Vold [:erikvold] (please needinfo? me)
dtownsend: review-
Details
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/779 (355 bytes, text/html)
2013-02-09 17:10 PST, Dave Townsend [:mossop]
evold: review+
Details

Description Dave Townsend [:mossop] 2013-02-09 12:55:56 PST
From the forum, if you have this in a contentScript:

self.on("context", function(node) {
  if (node.nodeName == "A") return true
});

It should hide the menu item if not clicking on an anchor node.
Comment 1 Erik Vold [:erikvold] (please needinfo? me) 2013-02-09 16:13:34 PST
Created attachment 712214 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/778

Pointer to Github pull-request
Comment 2 Dave Townsend [:mossop] 2013-02-09 16:38:21 PST
Comment on attachment 712214 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/778

This breaks when a context listener returns a string to change the item's label. I have a fix for this bug already though I'm just verifying one edge case against the old behaviour before submitting.
Comment 3 Dave Townsend [:mossop] 2013-02-09 17:10:28 PST
Created attachment 712217 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/779

Pointer to Github pull-request
Comment 4 [github robot] 2013-02-11 04:52:36 PST
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/11b766d803947adbc36e460bab5758c00c22be37
Bug 839814: Returning undefined from a context listener should hide the menu item.

https://github.com/mozilla/addon-sdk/commit/f26737bba08fa80e0775ecf08d2af59b02200cec
Merge pull request #779 from Mossop/bug839814

Fix Bug 839814: Returning undefined from a context listener should hide the menu item. r=@erikvold
Comment 5 [github robot] 2013-02-11 14:54:33 PST
Commit pushed to stabilization at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/22cda4b088a46f086fdfd6d8cabbf7e30605b7f3
Bug 839814: Returning undefined from a context listener should hide the menu item.
(cherry picked from commit 11b766d803947adbc36e460bab5758c00c22be37)

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