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

feat: expose initiator in navigation events #37085

Merged
merged 35 commits into from Feb 28, 2023
Merged

feat: expose initiator in navigation events #37085

merged 35 commits into from Feb 28, 2023

Conversation

nornagon
Copy link
Member

@nornagon nornagon commented Jan 31, 2023

Description of Change

This exposes the initator of a navigation event, i.e. the frame which caused
the navigation to happen. This is a draft API just as a proof of concept,
because appending more positional arguments is a terrible idea.

This information allows distinguishing window.open from a parent frame causing a navigation vs. a child-initiated navigation. Ref #36949.

Checklist

Release Notes

Notes: Added initiator information to navigator events.

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Feb 7, 2023
@nornagon nornagon marked this pull request as ready for review February 14, 2023 05:17
Copy link
Member

@erickzhao erickzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@itsananderson
Copy link
Contributor

API LGTM

shell/browser/api/electron_api_web_frame_main.cc Outdated Show resolved Hide resolved
shell/browser/api/electron_api_web_contents.cc Outdated Show resolved Hide resolved
shell/browser/api/electron_api_web_contents.cc Outdated Show resolved Hide resolved
Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@nornagon nornagon merged commit 3a5ae28 into main Feb 28, 2023
@nornagon nornagon deleted the navigate-initiator branch February 28, 2023 19:08
@release-clerk
Copy link

release-clerk bot commented Feb 28, 2023

Release Notes Persisted

Added initiator information to navigator events.

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

Successfully merging this pull request may close these issues.

None yet

6 participants