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

[Feature Request]: Emit webContents 'dom-ready' event for sub frames #27344

Closed
3 tasks done
samuelmaddock opened this issue Jan 18, 2021 · 0 comments · Fixed by #29290
Closed
3 tasks done

[Feature Request]: Emit webContents 'dom-ready' event for sub frames #27344

samuelmaddock opened this issue Jan 18, 2021 · 0 comments · Fixed by #29290

Comments

@samuelmaddock
Copy link
Member

samuelmaddock commented Jan 18, 2021

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem Description

The webContents 'dom-ready' event isn't emitted for any iframe navigation.

void WebContents::DOMContentLoaded(
content::RenderFrameHost* render_frame_host) {
if (!render_frame_host->GetParent())
Emit("dom-ready");
}

Proposed Solution

Update this event to emit an instance of WebFrameMain

Alternatives Considered

  1. Should we instead be consistent with the API and provide isMainFrame, frameProcessId, and frameRoutingId? I think it'd eventually be nice if all navigation events could simply provide a reference to WebFrameMain.

  2. Create a new event for sub frames called frame-dom-ready

Additional Information

I'll probably submit a PR for this myself soon enough. Any feedback before that would be appreciated!

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.

2 participants