Open Bug 1403242 Opened 8 years ago Updated 3 years ago

Clicking on error messages in addon debugger console opens blank window

Categories

(WebExtensions :: Developer Tools, defect, P3)

57 Branch
defect

Tracking

(Not tracked)

People

(Reporter: kats, Unassigned)

References

Details

(Whiteboard: [addon-debugging])

+++ This bug was initially created as a clone of Bug #1403241 +++ Continuing from the STR in bug 1403241 comment 0. Once I had the debugger window on the browser, I reloaded a bugzilla.mozilla.org page, which triggers the content script in the addon to run. This produced a JS error (which is the thing I'm trying to debug) which got reported to the "console" tab in the debugger window. This looks like this: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data bugtags.user.js:110:28 As normal, the "bugtags.user.js:110:28" text is a link which is supposed to open the bugtags.user.js file to relevant line. However when I click on this link it just opens a blank window. The window has a title bar but no title or contents. Note that if I open the browser console in my main Firefox window (as opposed to the debugger window), the same JS error is reported there. And when I click on the link to bugtags.user.js there, it does work as intended and opens the file in a "view source" type of window. So this appears to be a bug specific to the debugger.
Component: Developer Tools → WebExtensions: Developer Tools
Product: Firefox → Toolkit
The reason for the different behaviors of the Browser Toolbox and the Browser Console is the following: - the Browser Console is opened as part of the main process of the Firefox instance where the addon is installed, and so when you click the extension url, the opened viewsource window is able to load the extension url as expected because the addon is installed in that Firefox instance. - the Browser Toolbox is opened as part of a separate process and a separate instance of Firefox with its own profile (the reason is that from the Browser Toolbox you are supposed to be able to put a breakpoint on code that is running in the main process as part of the browser itself, and so the Browser Toolbox needs to run on its own process and being able to work correctly while the browser main process is paused on a breakpoint). - in the Browser Toolbox, when the user click on the url related to a console log message, the expected default behavior is that the clicked url is opened in the debugger panel, but if the debugger doesn't think that the script has been ever loaded (and when it is a content script, it has never been loaded in the main process, it has been only loaded in the tab child content process) then it tries to open the url in a viewsource window as a fallback, but this viewsource window is part of the Browser Toolbox profile and its separate Firefox profile, where the addon is not actually installed and so the viewsource window will not be able to load the unknown extension url.
Priority: -- → P3
Product: Toolkit → WebExtensions
Whiteboard: [addon-debugging]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.