Closed
Bug 911098
Opened 11 years ago
Closed 10 years ago
Implement the UI part of the Add-on Debugger
Categories
(DevTools :: Debugger, defect, P2)
DevTools
Debugger
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 31
People
(Reporter: mhordecki, Assigned: jsantell)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 10 obsolete files)
3.11 KB,
patch
|
Details | Diff | Splinter Review | |
38.40 KB,
patch
|
jsantell
:
review+
|
Details | Diff | Splinter Review |
637 bytes,
patch
|
Details | Diff | Splinter Review |
No description provided.
Reporter | ||
Comment 1•11 years ago
|
||
Updated•11 years ago
|
Priority: -- → P2
Updated•11 years ago
|
Priority: -- → P2
Updated•11 years ago
|
Attachment #810954 -
Flags: review?(dtownsend+bugmail)
Comment 2•11 years ago
|
||
Comment on attachment 810954 [details] [diff] [review] 0001-Add-the-debug-button-to-the-add-on-manager.patch Review of attachment 810954 [details] [diff] [review]: ----------------------------------------------------------------- Looks pretty straightforward enough, one logic error here though ::: toolkit/mozapps/extensions/XPIProvider.jsm @@ +6305,5 @@ > }); > > + this.__defineGetter__("isDebuggable", function AddonWrapper_isDebuggable() { > + return this.isActive && > + this.operationsRequiringRestart == AddonManager.OP_NEEDS_RESTART_NONE; My understanding is that only SDK based add-ons are debuggable right now so this isn't quite right. ::: toolkit/mozapps/extensions/content/extensions.js @@ +922,5 @@ > + }, > + > + isEnabled: function cmd_debugItem_isEnabled(aAddon) { > + return Services.prefs.getBoolPref('devtools.debugger.addon-enabled') > + && aAddon && aAddon.isDebuggable; Put the initial && on the previous line and line up aAddon with Service. ::: toolkit/mozapps/extensions/test/browser/Makefile.in @@ +34,4 @@ > browser_bug679604.js \ > browser_bug714593.js \ > browser_bug590347.js \ > + browser_debug_button.js \ Nit: bad indentation
Attachment #810954 -
Flags: review?(dtownsend+bugmail) → review-
Comment 3•11 years ago
|
||
(In reply to Dave Townsend (:Mossop) from comment #2) > Comment on attachment 810954 [details] [diff] [review] > 0001-Add-the-debug-button-to-the-add-on-manager.patch > > Review of attachment 810954 [details] [diff] [review]: > ----------------------------------------------------------------- > > Looks pretty straightforward enough, one logic error here though > > ::: toolkit/mozapps/extensions/XPIProvider.jsm > @@ +6305,5 @@ > > }); > > > > + this.__defineGetter__("isDebuggable", function AddonWrapper_isDebuggable() { > > + return this.isActive && > > + this.operationsRequiringRestart == AddonManager.OP_NEEDS_RESTART_NONE; > > My understanding is that only SDK based add-ons are debuggable right now so > this isn't quite right. > > ::: toolkit/mozapps/extensions/content/extensions.js > @@ +922,5 @@ > > + }, > > + > > + isEnabled: function cmd_debugItem_isEnabled(aAddon) { > > + return Services.prefs.getBoolPref('devtools.debugger.addon-enabled') > > + && aAddon && aAddon.isDebuggable; > > Put the initial && on the previous line and line up aAddon with Service. > > ::: toolkit/mozapps/extensions/test/browser/Makefile.in > @@ +34,4 @@ > > browser_bug679604.js \ > > browser_bug714593.js \ > > browser_bug590347.js \ > > + browser_debug_button.js \ > > Nit: bad indentation This patch never landed. Review comments haven't been addressed, and as far as I can tell, the add-ons used by test_isDebuggable.js are missing from the patch. It will take me some time to piece things back together.
Comment 4•11 years ago
|
||
*bump* status?
Comment 5•10 years ago
|
||
Attachment #810954 -
Attachment is obsolete: true
Attachment #8359931 -
Flags: review?(dtownsend+bugmail)
Comment 6•10 years ago
|
||
Comment on attachment 8359931 [details] [review] Address review comments I'd like to avoid exposing anything more than the necessary isDebuggable in the API, otherwise this looks good.
Attachment #8359931 -
Flags: review?(dtownsend+bugmail) → review-
Assignee | ||
Updated•10 years ago
|
Assignee: mike → jsantell
Assignee | ||
Comment 7•10 years ago
|
||
This bitrotted quite a bit already, fixing this up for today
Assignee: jsantell → mike
Assignee | ||
Comment 8•10 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=c6f4e676aced
Attachment #8359931 -
Attachment is obsolete: true
Assignee | ||
Comment 9•10 years ago
|
||
Updated try push: https://tbpl.mozilla.org/?tree=Try&rev=dee5181169ae
Assignee | ||
Comment 10•10 years ago
|
||
Fixed xpcshell tests
Attachment #8389393 -
Attachment is obsolete: true
Assignee | ||
Comment 11•10 years ago
|
||
try for xpcshell and extensions mochitests https://tbpl.mozilla.org/?tree=Try&rev=d9bedf2a7303
Assignee | ||
Comment 12•10 years ago
|
||
XPCshell tests passing, but seeing some failures on bc tests, pushing without patch to see if it was caused by these changes: https://tbpl.mozilla.org/?tree=Try&rev=5563c625b8a2
Assignee | ||
Updated•10 years ago
|
Assignee: mike → jsantell
Assignee | ||
Comment 13•10 years ago
|
||
Looks like there was an observer that never cleaned up, hopefully the cause of window leaks: https://tbpl.mozilla.org/?tree=Try&rev=d07d09dc4dab
Comment 14•10 years ago
|
||
I ran the above try build, after flipping the pref I see the debug button but I see these errors: JavaScript error: chrome://mozapps/content/extensions/extensions.js, line 20: NS_ERROR_FILE_NOT_FOUND: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIXPCComponents_Utils.import] JavaScript error: chrome://mozapps/content/extensions/extensions.js, line 957: BrowserDebuggerProcess is not defined
Assignee | ||
Comment 15•10 years ago
|
||
Looks like the tests aren't comprehensive -- good catch, I'll add some more
Assignee | ||
Comment 16•10 years ago
|
||
Not crashing for me, but OTOH, not doing much of anything else either.
Assignee | ||
Comment 17•10 years ago
|
||
Everything seems to be working, pushing to try https://tbpl.mozilla.org/?tree=Try&rev=ab7bc56b604d
Assignee | ||
Comment 18•10 years ago
|
||
Attachment #8393286 -
Flags: review?(nfitzgerald)
Assignee | ||
Comment 19•10 years ago
|
||
Got communication to debug only addons over the process working, added more tests, fixed bitrotting, pushed to try: r?ing Nick and Eddy -- not sure which one of you guys should review. Thanks!
Attachment #8389556 -
Attachment is obsolete: true
Attachment #8393286 -
Attachment is obsolete: true
Attachment #8393286 -
Flags: review?(nfitzgerald)
Attachment #8393288 -
Flags: review?(nfitzgerald)
Attachment #8393288 -
Flags: review?(ejpbruel)
Assignee | ||
Comment 20•10 years ago
|
||
New try patch, made a dumb mistake https://tbpl.mozilla.org/?tree=Try&rev=f956dadab2ec
Assignee | ||
Comment 21•10 years ago
|
||
Attachment #8393288 -
Attachment is obsolete: true
Attachment #8393288 -
Flags: review?(nfitzgerald)
Attachment #8393288 -
Flags: review?(ejpbruel)
Attachment #8393629 -
Flags: review?(nfitzgerald)
Attachment #8393629 -
Flags: review?(ejpbruel)
Assignee | ||
Comment 22•10 years ago
|
||
Now with -U8
Attachment #8393629 -
Attachment is obsolete: true
Attachment #8393629 -
Flags: review?(nfitzgerald)
Attachment #8393629 -
Flags: review?(ejpbruel)
Attachment #8393789 -
Flags: review?(nfitzgerald)
Comment 23•10 years ago
|
||
Comment on attachment 8393789 [details] [diff] [review] 911098-addon-debugger-ui.patch Review of attachment 8393789 [details] [diff] [review]: ----------------------------------------------------------------- I only reviewed the debugger changes. You'll need to find someone else for the framework stuff (:harth volunteered) and another person for the addon stuff. LGTM just a few comments below. ::: browser/devtools/debugger/debugger-panes.js @@ +130,5 @@ > let label = SourceUtils.getSourceLabel(url.split(" -> ").pop()); > let group = SourceUtils.getSourceGroup(url.split(" -> ").pop()); > let unicodeUrl = NetworkHelper.convertToUnicode(unescape(url)); > > + dump("addSource: " + url + "\n"); rm debug stuff @@ +134,5 @@ > + dump("addSource: " + url + "\n"); > + > + // Do some parsing to see if it's a part of an Addon > + let lastChunk = url.substring(url.lastIndexOf("->")).trim(); > + let match = /resource:\/\/gre\/modules\/commonjs\/(.*)/.exec(lastChunk); Should use |nsIURI| to parse this information. const uri = Services.io.newURI(lastChunk); if (uri.scheme == "resource" && ...) ... https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIURI While you're here, can you define |lastChunk| underneath |let url = ...| and replace the |url.split(...).pop()| calls with references to |lastChunk|? ::: browser/devtools/debugger/test/browser_dbg_addon-sources.js @@ +1,4 @@ > +/* Any copyright is dedicated to the Public Domain. > + http://creativecommons.org/publicdomain/zero/1.0/ */ > + > +// Make sure we can attach to addon actors. Update this comment to better reflect what this test is doing. ::: browser/devtools/debugger/test/head.js @@ +500,5 @@ > return deferred.promise; > }); > } > > +function initAddonDebugger(aClient, aUrl, frame) { aFrame to match style :( @@ +525,5 @@ > + let debuggerPanel = aToolbox.getCurrentPanel(); > + let panelWin = debuggerPanel.panelWin; > + > + // Wait for the initial resume... > + panelWin.gClient.addOneTimeListener("resumed", () => { You can use |waitForClientEvents("resumed")| instead of reimplementing it here.
Attachment #8393789 -
Flags: review?(nfitzgerald) → review+
Comment 24•10 years ago
|
||
Comment on attachment 8393789 [details] [diff] [review] 911098-addon-debugger-ui.patch Review of attachment 8393789 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/devtools/debugger/debugger-panes.js @@ +137,5 @@ > + let lastChunk = url.substring(url.lastIndexOf("->")).trim(); > + let match = /resource:\/\/gre\/modules\/commonjs\/(.*)/.exec(lastChunk); > + if (match) { > + label = match[1]; > + group = "Add-on SDK"; Should this be localized?
Assignee | ||
Comment 25•10 years ago
|
||
ni?ing L10N on Victor's question -- listing addon SDK sources in the addon debugger labels them under the group "Add-on SDK" -- should this be localized, or is the "Add-on SDK" considered a brand/product/proper noun?
Flags: needinfo?(community)
Assignee | ||
Comment 26•10 years ago
|
||
Comment on attachment 8393789 [details] [diff] [review] 911098-addon-debugger-ui.patch r?ing Mossop for XPI/extension changes, Harth for Framework changes -- thanks!
Attachment #8393789 -
Flags: review?(fayearthur)
Attachment #8393789 -
Flags: review?(dtownsend+bugmail)
Comment 27•10 years ago
|
||
(In reply to Jordan Santell [:jsantell] [@jsantell] from comment #25) > ni?ing L10N on Victor's question -- listing addon SDK sources in the addon > debugger labels them under the group "Add-on SDK" -- should this be > localized, or is the "Add-on SDK" considered a brand/product/proper noun? Is the name localized in, say, the documentation?
Comment 28•10 years ago
|
||
I already said on irc that it's not the l10n folks that decide what's a band or a proper noun. Please ask the branding or copy guys for that. A screenshot of the string in use might be helpful to decide if there are l12y problems if the Add-on SDK happens to be a proper noun.
Flags: needinfo?(community)
Comment 29•10 years ago
|
||
Comment on attachment 8393789 [details] [diff] [review] 911098-addon-debugger-ui.patch Review of attachment 8393789 [details] [diff] [review]: ----------------------------------------------------------------- Looks good ::: toolkit/mozapps/extensions/content/extensions.js @@ +3428,5 @@ > if (aProperties.indexOf("applyBackgroundUpdates") != -1) > this.updateAvailableCount(); > } > }; > + Nit: whitespace @@ +3429,5 @@ > this.updateAvailableCount(); > } > }; > + > +let addonDebuggingObs = { This can just be a function, call it debuggingPrefChanged ::: toolkit/mozapps/extensions/internal/XPIProvider.jsm @@ +6450,5 @@ > return ops; > }); > > + this.__defineGetter__("isBootstrapped", function AddonWrapper_isBootstrapped() { > + return this.operationsRequiringRestart === AddonManager.OP_NEEDS_RESTART_NONE; return aAddon.bootstrap; @@ +6453,5 @@ > + this.__defineGetter__("isBootstrapped", function AddonWrapper_isBootstrapped() { > + return this.operationsRequiringRestart === AddonManager.OP_NEEDS_RESTART_NONE; > + }); > + > + this.__defineGetter__("isJetpack", function AddonWrapper_isJetpack() { Let's use isCommonJS instead ::: toolkit/mozapps/extensions/test/xpcshell/test_isDebuggable.js @@ +16,5 @@ > +]; > + > +function run_test() { > + do_test_pending(); > + Nit: whitespace
Attachment #8393789 -
Flags: review?(dtownsend+bugmail) → review+
Comment 30•10 years ago
|
||
Comment on attachment 8393789 [details] [diff] [review] 911098-addon-debugger-ui.patch Thinking about it, I don't think we should add the isJetpack or isBootstrapped properties to this API. We don't need them here so let's keep it simple and only expose isDebuggable
Attachment #8393789 -
Flags: review+ → review-
Comment 31•10 years ago
|
||
Comment on attachment 8393789 [details] [diff] [review] 911098-addon-debugger-ui.patch Review of attachment 8393789 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/mozapps/extensions/content/extensions.js @@ +958,5 @@ > + }, > + > + isEnabled: function cmd_debugItem_isEnabled(aAddon) { > + let debuggerEnabled = Services.prefs. > + getBoolPref("devtools.debugger.addon-enabled"); You need to check that chrome debugging and remote debugging are enabled too or the add-on debugger won't work
Assignee | ||
Comment 32•10 years ago
|
||
Added 'debug' button to only display once remote and addon debugging is enabled (chrome isn't required) and added tests for this. Fixed Dave and Nick's comments. Pushing changes to try: https://tbpl.mozilla.org/?tree=Try&rev=77c90f8fc14b
Assignee | ||
Comment 33•10 years ago
|
||
Attachment #8393789 -
Attachment is obsolete: true
Attachment #8393789 -
Flags: review?(fayearthur)
Attachment #8394590 -
Flags: review?(fayearthur)
Attachment #8394590 -
Flags: review?(dtownsend+bugmail)
Updated•10 years ago
|
Attachment #8394590 -
Flags: review?(dtownsend+bugmail) → review+
Comment 34•10 years ago
|
||
Comment on attachment 8394590 [details] [diff] [review] 911098-addon-debugger-ui.patch Review of attachment 8394590 [details] [diff] [review]: ----------------------------------------------------------------- Looks good for the framework pieces.
Attachment #8394590 -
Flags: review?(fayearthur) → review+
Comment 35•10 years ago
|
||
Comment on attachment 8394590 [details] [diff] [review] 911098-addon-debugger-ui.patch Review of attachment 8394590 [details] [diff] [review]: ----------------------------------------------------------------- Strangely this patch is still failing try but only on Windows 7. When I add my patches it starts failing in a similar way on other platforms too :( ::: browser/devtools/debugger/test/browser_dbg_addon-sources.js @@ +5,5 @@ > +// addon itself, or the SDK, with proper groups and labels. > + > +const ADDON3_URL = EXAMPLE_URL + "addon3.xpi"; > +const TAB_URL = EXAMPLE_URL + "doc_iframes.html"; > +const DBG_XUL = "chrome://browser/content/devtools/framework/toolbox-process-window.xul"; These two variables seem to be unused.
Comment 36•10 years ago
|
||
Comment on attachment 8394590 [details] [diff] [review] 911098-addon-debugger-ui.patch Review of attachment 8394590 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/devtools/debugger/test/browser_dbg_addon-sources.js @@ +36,5 @@ > + > + yield testSources(); > + yield uninstallAddon(); > + yield closeConnection(); > + finish(); Mentioned on IRC but you need to iframe.remove() before calling finish()
Assignee | ||
Comment 37•10 years ago
|
||
Attachment #8394590 -
Attachment is obsolete: true
Attachment #8395987 -
Flags: review+
Backed out in https://hg.mozilla.org/integration/fx-team/rev/f353b6a98a3d for causing a few leaks: https://tbpl.mozilla.org/php/getParsedLog.php?id=36636961&tree=Fx-Team Your try push would need to include debug builds if you want to catch the leaks.
Flags: needinfo?(jsantell)
Flags: needinfo?(dtownsend+bugmail)
Comment 40•10 years ago
|
||
Odd since we saw some leaks in non-debug builds too. Ah well. Jordan I think you said you had this. Feel free to ping me if you need help.
Flags: needinfo?(dtownsend+bugmail)
Assignee | ||
Comment 41•10 years ago
|
||
Pushed a debug try build with the toolbox closing https://tbpl.mozilla.org/?tree=Try&rev=4dca4b693eba
Flags: needinfo?(jsantell)
Assignee | ||
Comment 42•10 years ago
|
||
Try fixed, https://tbpl.mozilla.org/?tree=Try&rev=5922670c85ec
Comment 43•10 years ago
|
||
Jordan, can you merge this patch into yours, it just makes all restartless add-ons debuggable straight away (though they won't show anything until the other bug lands).
Assignee | ||
Comment 44•10 years ago
|
||
Attaching updated, try-passing, restartless-addon-debuggable-merged, patch
Attachment #8395987 -
Attachment is obsolete: true
Attachment #8396817 -
Flags: review+
Comment 45•10 years ago
|
||
Spinning a try run (https://tbpl.mozilla.org/?tree=Try&rev=c60f1767b35c) but I think this is the leak fix we're looking for.
Comment 47•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/0c4f13342090
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 31
Comment 48•10 years ago
|
||
Kind of late in the Beta cycle but does this need any testing before we release Firefox 31?
Flags: needinfo?(dtownsend+bugmail)
Comment 49•10 years ago
|
||
Probably not a lot, it's a disabled by default feature in its early stages.
Flags: needinfo?(dtownsend+bugmail)
Comment 50•10 years ago
|
||
(In reply to Dave Townsend [:mossop] from comment #49) > Probably not a lot, it's a disabled by default feature in its early stages. Okay, thanks. Please needinfo me if/when that changes.
QA Whiteboard: [qa-]
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•