Closed Bug 1713120 Opened 3 years ago Closed 3 years ago

TypeError: n.getAttribute is not a function in ext-pageAction.js

Categories

(WebExtensions :: Frontend, defect)

defect

Tracking

(firefox-esr78 unaffected, firefox88 unaffected, firefox89 unaffected, firefox90 fixed)

RESOLVED FIXED
90 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox88 --- unaffected
firefox89 --- unaffected
firefox90 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

bug 1706479 has caused a regression.

STR:

  1. Install an extension that has a pageAction, e.g. https://addons.mozilla.org/en-US/firefox/addon/crxviewer/ (tested with version 1.6.11)
  2. Right-click anywhere in the browser UI
  3. Look at the browser console.

Expected:

  • No errors

Actual:

The reported error happens because .parentNode can be a document,
which doesn't implement the Element interface. Using .parentElement
solves this issue.

And while I'm fixing this: move the logic behind the menu ID check, so
that the logic is not unnecessarily run for non-pageAction contextmenus.

Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/1c164041529d
Fix TypeError: n.getAttribute is not a function in ext-pageAction.js r=rpl
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: