How to debug Firefox's XUL startup (on Windows) - debugging

I have a problem that causes Firefox to behave strangely during startup.
(Specifically, it displays the "Firefox seems slow... to... start" message, even though I didn't install any new extensions or anything like that.)
The function that displays that message is _showSlowStartupNotification in browser/components/nsBrowserGlue.js which is called from _trackSlowStartup which in turn is called by _onFirstWindowLoaded.
I want to debug that. How can I do that?
I can debug the Firefox binaries easily with WinDbg and Mozilla's symbol server. But that's not what I want. I want to debug the XUL, not the C++.
I can debug the XUL if I enable the Browser Toolbox, but only after the startup. Even if I set devtools.debugger.prompt-connection to false and run firefox.exe -jsdebugger to immediately open the Browser Toolbox, I get access to it only after the startup code has already been executed. Setting a breakpoint on the interesting function doesn't help as they are not persistent; restarting Firefox doesn't cause the internal XUL debugger to break on them.
So, any suggestions? Is there a way to debug Firefox's XUL from the early start?

Related

Connecting an external debugger for browser extension development

I'm trying to figure out how to properly attach an external debugger from, say WebStorm or vs-code to debug a browser extension.
How my ideal workflow would look like:
I launch an extension in dev-mode with https://github.com/mozilla/web-ext and then can attach debugger to that browser instance, see break-points/etc.
What I've tried
Configure https://www.jetbrains.com/help/webstorm/configuring-javascript-debugger.html specifying a URL on which my extension operates.
Add a break-point to a content-script
After browser is started by debug process - load my extension from disk & reload the page
Expected: debugger stops at a break point
Actual: page loads without interruption (or sometimes debugger stops at a random code not from my extension 😅 )
I've also tried setting the breakpoint for a background script, which didn't seem to have any effect either.
Misc
For content-script WebStorm seems to indicate that break-points are not in a valid state
Background script breakpoint is, not that it helps
Code is bundled with Parcel with source-maps enabled
Browser is Chrome 99.0.4844.51 (FF debugging does not seem to be supported)
System: macOS 12.2

VS2013 won't debug a specific web application

I have a web application that uses IIS, but when I try to debug it VS just locks up and gives me the hour glass cursor icon. No browser window opens, nor does an instance pop up in the Task Manager. VS says its Running / not "Not Responding", but I cannot interact with the IDE. Can't Ctrl-Break to stop or anything.
I was able to run it before, and I'm not aware of any system or IIS changes that could cause this. I've disabled source control and I've tried launching the app in both Chrome and IE but it still behaves the exact same way as described above.
Has anyone else encountered this? The only threads I could find just describe general slowness in the IDE but otherwise its functional. The recommended fix was to disable the source control functionality, which as I said I already tried.
I should note that I don't seem to have an issue running & debugging winforms applications. I also just created a web application and was able to launch it in Chrome and get to the homepage. Also, it doesn't make a difference if I have a breakpoint set or not.
This solution has 4 different projects. If I set a different project as the Startup Project, it does run and launches the browser but it just gives me a 'file explorer' sort of view where it just lists the files in that project's directly which is obviously not what I want.
Edit; If I manually open a browser tab, try to navigate to http://localhost/myApplication, VS pops up and asks if I want to attach process w3wp.exe to IIS APPPOOL\myAppPool. If I attach, it opens a new tab in Chrome and my application runs. But unless I do these 2 steps, it does not run.

Windows 8.1 Flash Debugging on Google Chrome

I have a Flash game (written in Haxe with Sublime Text 3) that I am trying to debug in the browser. It doesn't matter which browser - I just need to be able to see the trace statements and exceptions thrown.
I've tried a tool like vizzy and it just keeps telling me that I don't have a Flash debugger. I've tried to disable the default one and install one from the Adobe but it never appears on the plugins page of chrome.
I installed the 8.1 Flash update but it does nothing for me in terms of viewing trace statements. The flashlog.txt file is empty and I've set the variables in the mm.cfg file.
I'm at my wits end. Anyone have a workaround for this or maybe some open source tool to view the trace statements?

Error when use vs just-in-time debugger on Firefox plugin-container.exe

Does anyone ever use vs just-in-time debugger on Firefox plugin-container.exe?
I want to debug my Firefox plugin on start-up, so I try the just-in-time debugger on plugin-container.exe. I expect once the plugin-container.exe is running, it will trigger the debugger, when I can start VS to debug it.
However, I met the following error, and it happens on each plugin I try to load.
What is wrong here? I am using Firefox 23.0.1
You can't launch the plugin-container.exe with the JIT debugger; what you can do is connect to it after it launches. The easiest way to do this is to add a Sleep(10000) in the NP_Initialize or DllMain functions so that you have time to connect the debugger to the process.
As Georg suggested, the tips page he linked to has some other ideas you could use.

possibility to debug user-extensions.js in selenium

I have a webapp which is tested by selenium. Everything works well: writing tests in java, setting breakpoints in my webapp through firebug.
unfortunately I am not able to debug the user-extensions.js it self: After starting the java-test, two firefox windows are opened. One holds the webapp to test, the other one holds the data-flow which uses the user-extensions.
How can I debug the user-extensions?
It seems that it is not possible. I made a workaround and switched the functions to my webapp to debug them there.
It really depends on the browser you're using. I've been able to debug user-extensions using Chrome. In the control Window, you need to right-click and then view the window as a tab. Once you do that, you can activate the developer tools for the control window, which will include the JavaScript debugger.
It's possibile using the Venkman debugger (a separate Firefox extension) and Firefox up until version 32, and that's quite a precious combination.
With Firefox 33 and later, Venkman is broken by api changes, and the native debugger unluckily doesn't allow to debug xul based extensions.

Resources