The default bug view has changed. See this FAQ.

Hide Inspect Element context menu items if not enabled

RESOLVED FIXED in Firefox 9

Status

()

Firefox
Developer Tools
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: rc, Assigned: rc)

Tracking

unspecified
Firefox 9
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
I noticed the Inspect Element context menu items are not hidden by default and rely on InspectorUI.enabled which breaks in a subsequent patch. I've added a check against the preference in the context menu's showItem code.
(Assignee)

Comment 1

6 years ago
Created attachment 561861 [details] [diff] [review]
[in-fx-team] inspect menu hiding
Assignee: nobody → rcampbell
Status: NEW → ASSIGNED
Attachment #561861 - Flags: review?(gavin.sharp)
Comment on attachment 561861 [details] [diff] [review]
[in-fx-team] inspect menu hiding

>diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js

>+    document.getElementById("inspect-separator").hidden = false;
>+    document.getElementById("context-inspect").hidden = false;

Shouldn't need this, since the context menu code runs on every show anyways.

>diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js

>+    var showInspect = Cc["@mozilla.org/preferences-service;1"]
>+           .getService(Ci.nsIPrefService)
>+           .QueryInterface(Ci.nsIPrefBranch2)
>+           .getBoolPref("devtools.inspector.enabled");

Use gPrefService.getBoolPref()

r=me with both of those changes made
Attachment #561861 - Flags: review?(gavin.sharp) → review+
(Assignee)

Comment 3

6 years ago
Comment on attachment 561861 [details] [diff] [review]
[in-fx-team] inspect menu hiding

https://hg.mozilla.org/integration/fx-team/rev/7d5311c92e04
Attachment #561861 - Attachment description: inspect menu hiding → [in-fx-team] inspect menu hiding
(Assignee)

Comment 4

6 years ago
https://hg.mozilla.org/mozilla-central/rev/7d5311c92e04
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 9
You need to log in before you can comment on or make changes to this bug.