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

Add will-frame-navigate event #7097

Closed
bdxing opened this issue Sep 5, 2016 · 14 comments · Fixed by #34418
Closed

Add will-frame-navigate event #7097

bdxing opened this issue Sep 5, 2016 · 14 comments · Fixed by #34418

Comments

@bdxing
Copy link

bdxing commented Sep 5, 2016

  • Electron version:

* Operating system: window 7

Found in webContents listening 'will - navigate' with 'event callback function event. The preventDefault ();'can't stop jumping events in the iframe.Example: in the iframe "< a href =" github.com "> test < / a >"

@kevinsawicki
Copy link
Contributor

kevinsawicki commented Sep 6, 2016

Closing as duplicate of #1378

@kevinsawicki kevinsawicki reopened this Sep 6, 2016
@kevinsawicki kevinsawicki changed the title Found in webContents listening 'will - navigate' with 'event BUG preventDefault() of will-navigate event not working for iframes Sep 6, 2016
@deepak1556 deepak1556 changed the title preventDefault() of will-navigate event not working for iframes will-navigate event not triggered for sub-frame loads Sep 6, 2016
@deepak1556
Copy link
Member

I am not sure if this is a bug or enhancement, the original event was never specified for sub-frame navigations. Will defer to others for thoughts.

@MarshallOfSound
Copy link
Member

@deepak1556 Should we just expose the isMainFrame property on the event like we do on things like did-navigate-in-page so used can filter out iframe events if they want to?

@bdxing
Copy link
Author

bdxing commented Sep 7, 2016

@deepak1556 @MarshallOfSound @kevinsawicki did-navigate-in-page Don't listen to change the url in the iframe, tested

@MarshallOfSound
Copy link
Member

@bdxing did-navigate-in-page definitely fires in iFrames as I fixed an issue related to it #6808

@zcbenz
Copy link
Member

zcbenz commented Sep 12, 2016

did-navigate-in-page only emits for in-page navigations, that's probably why it doesn't emit for you.

We need to add a new will-frame-navigate event that also emits for subframe navigations, changing the behavior of will-navigate is not an option, since most code using the event assumes it only emits for the main frame.

@zcbenz zcbenz changed the title will-navigate event not triggered for sub-frame loads Add will-frame-navigate event Sep 12, 2016
@bdxing
Copy link
Author

bdxing commented Sep 12, 2016

@zcbenz OK, The first thank you, waiting for the event.

@codebytere codebytere self-assigned this Apr 13, 2018
@codebytere codebytere removed their assignment May 3, 2018
@mduvanel
Copy link

Hi, I would be interested in working on this issue if nobody is actively working on it?

@burtonator
Copy link

Wow.. I actually didn't realize this was missing and probably opened up a security hole if someone really wanted to exploit it. If you assume you're not allowing iframes to load by preventing them then you could accidentally load a page when you intended to abort.

@miniak
Copy link
Contributor

miniak commented Jun 25, 2021

cc @samuelmaddock

@samuelmaddock
Copy link
Member

This functionality should be easy enough to add after #29290 is merged.

@samuelmaddock samuelmaddock self-assigned this Jun 27, 2021
@pushkin-
Copy link

@samuelmaddock It would be nice to add this now that the other PR got merged if someone on the team has some time :)

@HimanshuNarware
Copy link

hey, I want to work on this issue,please assing me this issue.

@codebytere
Copy link
Member

@HimanshuNarware this issue is already in progress and has an assignee and PR. You're welcome to try and find another if you wish!

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

Successfully merging a pull request may close this issue.