sindresorhus / electron-debug

Adds useful debug features to your Electron app
MIT License
750 stars 49 forks source link

BrowserWindowProxy debug #45

Open riteshatsencha opened 7 years ago

riteshatsencha commented 7 years ago

Issuehunt badges

Does electron-debug support BrowserWindowProxy? It seems like BrowserWindowProxy has very limited features and I can't seem to figure out how to debug.

I have an app that opens a proxy window. Kind'a stumped on debugging it.

Thx

There is a $40.00 open bounty on this issue. Add more on Issuehunt.

sindresorhus commented 7 years ago

Not at the moment. I don't really see an obvious way to support it, but happy to take a pull request if there is.

parro-it commented 7 years ago

@riteshatsencha you can debug it remotely, using command argument `--remote-debugging-port=' and later connecting to that port via http (from chrome).

Actually I'm working on a tool to simplify exactly this use case: it let you open multiple devtools within the same window, each one debugging a different renderer process: ![image](https://cloud.githubusercontent.com/assets/11197111/21285378/21866b4a-c437-11e6-9010-5f8cc389f03f.png) _in the tab showed I'm debugging a page I opened with window.open_ It support browser windows, webview and window proxies (also main process when Electron will support node --inspect flag)
riteshatsencha commented 7 years ago

@parro-it Thanks for the response. Yeah, tried it. Doesn't work.

Remote debugging for the main browser window works just fine. I can work with the dev tools like expected.

As soon as I open a BrowserWindowProxy none of the console logs are displayed in the console. Heck there is no way to open dev tools for BrowserWindowProxy, unless I am missing something.

parro-it commented 7 years ago

@riteshatsencha that's strange, it's working for me. Are you doing the following steps, in order?

1) --remote-debugging-port= command line arg when you launch electron? 2) open your window with window.open as you usually do 3) connecting to http://localhost: using chrome you should see a devtools instance connected to the page you opened. What do you see instead?

You should see in chrome a list of links. Could you post it? One of this links should show an instance of devtools

riteshatsencha commented 7 years ago

@parro-it as per the steps above...

1) Launched electron with remote-debugging-port option. 2) App launches main window and I can see the dev tools attached to it. I can print console logs. All good here. 3) Next, this main browser window opens another window which is a window proxy. This is where I have an issue. I just can't seem to open dev tools for the proxy window. May be it just doesn't support it.

Where exactly should I be looking for links? Let me know and I will be happy to post it here.

Thx

parro-it commented 7 years ago

After step 3), you have to open chrome and navigate to http://localhost: Port is the debugging port you put in cmd line arg in step 1.

You should see a list of link, one for each renderer process in your app. Clicking them, you get a devtools (in chrome, not in your window) connected to the process you clicked.

One of the process should be the window.opened one...

riteshatsencha commented 7 years ago

Here are the links from http://localhost:9222.

remote-debugger-links
parro-it commented 7 years ago

Have you tried them?

riteshatsencha commented 7 years ago

Yeah, so clicking on both links I see this error in the console.

dev-tools-error

IssueHuntBot commented 5 years ago

@issuehunt has funded $40.00 to this issue.