Closed Bug 1060945 Opened 10 years ago Closed 10 years ago

Cannot disable a devtools panel if its visibilityswitch pref doesn't exist

Categories

(DevTools :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 35

People

(Reporter: canuckistani, Assigned: bgrins)

References

Details

Attachments

(1 file, 1 obsolete file)

I have a couple of extensions installed that use the new sdk pane api, and I can no longer disable enable them with today's nightly. The error is:

System JS : ERROR resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/framework/toolbox-options.js:55 - Error: Unknown type
( I also have the ember extension installed, and it can be enabled / disabled just fine )
I'm guessing that since tool.visibilityswitch is not a known pref (something like "devtools.foo.enabled") it is failing to set it.  The ember extension probably works because you had already installed it and toggled it, initializing the pref before this bug was introduced.  Most likely we just need to *not* call SetPref when a tool enable/disable checkbox is pressed, and instead just call Services.prefs.setBoolPref directly.
OS: Mac OS X → All
Hardware: x86 → All
Summary: Cannot disable a devtools sdk pane-based add-on → Cannot disable a devtools panel if its visibilityswitch pref doesn't exist
Assignee: nobody → bgrinstead
Status: NEW → ASSIGNED
Attached patch disable-addon-panel.patch (obsolete) — Splinter Review
Fixes issue, as described in Comment 2.  Try push: https://tbpl.mozilla.org/?tree=Try&rev=9b73f56730ad
Attachment #8484379 - Flags: review?(pbrosset)
Comment on attachment 8484379 [details] [diff] [review]
disable-addon-panel.patch

Review of attachment 8484379 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me.
My only comment is that, while we're at it, we might as well change the test a little more to:
- add a comment at the top explaining what the test is supposed to be testing
- make use of asyncTest which exists in head.js in this directory to simplify a bit the test
Attachment #8484379 - Flags: review?(pbrosset) → review+
Refactored test and added a comment at the top of it: https://tbpl.mozilla.org/?tree=Try&rev=a2bcf8f54b62
Attachment #8484379 - Attachment is obsolete: true
Attachment #8485871 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/integration/fx-team/rev/c5ca9293fd67
Flags: in-testsuite+
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/c5ca9293fd67
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 35
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: