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

mailto link inside webxdc causes blank page #3355

Closed
adbenitez opened this issue Aug 15, 2023 · 13 comments · Fixed by #3457
Closed

mailto link inside webxdc causes blank page #3355

adbenitez opened this issue Aug 15, 2023 · 13 comments · Fixed by #3457
Assignees
Labels
bug Something isn't working webxdc

Comments

@adbenitez
Copy link
Member

image

@adbenitez adbenitez added bug Something isn't working webxdc labels Aug 15, 2023
@Simon-Laux
Copy link
Member

we would need to upgrade electron for this or get rid of the iframe (FILL 500 hack)

@Simon-Laux
Copy link
Member

this requires electron 25+

@Simon-Laux
Copy link
Member

#3381

@WofWca
Copy link
Collaborator

WofWca commented Sep 11, 2023

get rid of the iframe (FILL 500 hack)

How would that work? I see that the wrapper is still used in #3381.

It looks to me like this piece of code does nothing, after the introduction of the WebRTC exfiltration mitigation:

app.on('web-contents-created', (_ev, contents) => {
const is_webxdc = contents.session.storagePath?.indexOf('webxdc_') !== -1
if (is_webxdc) {
contents.on('will-navigate', (e, navigationUrl) => {
if (navigationUrl.startsWith('webxdc://')) {
// allow internal webxdc nav
return
} else if (navigationUrl.startsWith('mailto:')) {
// handle mailto in dc
e.preventDefault()
open_url(navigationUrl)
mainWindow.window?.focus()
} else {
// prevent navigation to unknown scheme
e.preventDefault()
}
})
} else {

Because all navigation is prevented anyway:

// prevent reload and navigation of wrapper page
webxdc_windows.webContents.on('will-navigate', ev => {
ev.preventDefault()
})

I might be wrong though.

@Simon-Laux
Copy link
Member

We need to either get rid of the frame again or use an electron version that has the "will-frame-navigate" event.

Someone could also attempt to backport the event to electron 22, but that might be to complicated.

@WofWca
Copy link
Collaborator

WofWca commented Sep 12, 2023

How does "will-frame-navigate" help?

We want an <iframe> because:

  • Upon initial load, we want to execute the 500 hack before the app gets a chance to execute its code
  • If there is a page reload, we need to make sure to have 500 RTCPeerConnection at all times while the user script is active.

Does the new Electron allow to solve the reload problem?

@Simon-Laux
Copy link
Member

Simon-Laux commented Sep 12, 2023

How does "will-frame-navigate" help?

It allows us to use the code you mentioned in your previous comment again. Or have I missed something?

@WofWca
Copy link
Collaborator

WofWca commented Sep 12, 2023

Yeah, for "will-frame-navigate" that's true (I think), but I'm asking about how it's gonna help get rid of the wrapper <iframe>.

@Simon-Laux
Copy link
Member

It won't, I said we "either" need one or the other, not both.

@WofWca
Copy link
Collaborator

WofWca commented Sep 12, 2023

Oh I see.
How does the new Electron version allow to get rid of the 500 hack then?

@Simon-Laux
Copy link
Member

How does the new Electron version allow to get rid of the 500 hack then?

no, this is just about the mailto: stuff discussed in this issue.

My communication seems lacks here, please tell me how to improve it.

@WofWca
Copy link
Collaborator

WofWca commented Sep 13, 2023

Ok, it's my bad, sorry 🤦‍♀️
I read

we would need to upgrade electron for this or get rid of the iframe (FILL 500 hack)

as "for this to get rid". I thought you have an idea of how to get rid of the <iframe>, it's why I keep asking.

@Simon-Laux
Copy link
Member

looks like we did not even need the electron upgrade, in the end it was contents.setWindowOpenHandler()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working webxdc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants