Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: empty URL in IPCMainEvent.senderFrame.url #33800

Closed
3 tasks done
bpasero opened this issue Apr 15, 2022 · 4 comments
Closed
3 tasks done

[Bug]: empty URL in IPCMainEvent.senderFrame.url #33800

bpasero opened this issue Apr 15, 2022 · 4 comments
Labels

Comments

@bpasero
Copy link
Contributor

bpasero commented Apr 15, 2022

Preflight Checklist

Electron Version

17.x

What operating system are you using?

Windows

Operating System Version

Windows 11

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

No response

Expected Behavior

The IPCMainEvent.senderFrame.url should never be the empty string.

Actual Behavior

The IPCMainEvent.senderFrame.url is an empty string.

Testcase Gist URL

No response

Additional Information

Steps to reproduce:

  • git clone https://github.com/bpasero/playwright-electron.git
  • yarn
  • node index.js

Notice how this line throws an error: https://github.com/bpasero/playwright-electron/blob/53d16919a89984f7d889102c69b30679495e337e/main.js#L41

This does not reproduce when not running with playwright so it is probably related.

//cc @deepak1556

@MarshallOfSound
Copy link
Member

@bpasero I believe the empty URL actually means the page failed to load and is ending up at chrome-error://chromewebdata/. Basically your custom protocol handler is returning a completely invalid file path and the page is failing to load.

For legacy reasons your preload script will still run on the chrome error page but the URL of that page to most APIs is the empty string.

I fixed up your custom protocol handler in this PR: bpasero/playwright-electron#1

Not sure if your vscode protocol handler has similar issues or not, debugging playwright is kinda tricky I couldn't find an easy way to get main process logs 🤷

@bpasero
Copy link
Contributor Author

bpasero commented Apr 15, 2022

Thanks for the prompt follow up, too bad I was unlucky in finding the issue we see in VSCode and the Windows paths are all wrong.

In VSCode we still see this and it reproduces on macOS too and paths seems to be fine. So I still have to find a way to reproduce this in a minimal sample...

@bpasero
Copy link
Contributor Author

bpasero commented Apr 15, 2022

Btw playwright prints very detailed logs when setting export DEBUG=pw:browser.

@MarshallOfSound
Copy link
Member

I'd look for a similar cause, maybe listen to the did-fail-load event and log out any relevant information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants