Closed Bug 826080 Opened 11 years ago Closed 11 years ago

New context-menu module applies the PageContext in cases where it shouldn't

Categories

(Add-on SDK Graveyard :: General, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mossop, Unassigned)

References

Details

Attachments

(1 file)

Let's say you have the following code:

require("context-menu").Item({
  label: "This Page Has Images",
  contentScript: 'self.on("context", function (node) {' +
                 '  return !!document.querySelector("img");' +
                 '});'
});

If you right click in a textarea the old context-menu module would execute the content script listener and show or hide the menu item depending on its result. The new context-menu module first uses the PageContext context which says to not show items in text areas and so the context listener isn't even executed.
Attachment #697250 - Flags: review?(rFobic)
OS: Windows 8 → All
Hardware: x86_64 → All
Will this/should this end up on stabilization once landed?
I think it should
Attachment #697250 - Flags: review?(rFobic) → review+
Commit pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/faee375caae180369c927f9c2e500ceee297463e
Merge pull request #706 from Mossop/bug826080

Bug 826080 - New context-menu module applies the PageContext in cases where it shouldn't. r=@gozala
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.14
Are we cherry-picking this for 1.13? If it is safe to do so, I vote yes.
I think we should
Commit pushed to stabilization at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/566a45a965b0029e0213fc2f9216bfef0d8e9315
Merge pull request #706 from Mossop/bug826080

Bug 826080 - New context-menu module applies the PageContext in cases where it shouldn't. r=@gozala(cherry picked from commit faee375caae180369c927f9c2e500ceee297463e)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: