Skip to content

Conversation

@karlseguin
Copy link
Collaborator

This is hacky, but it's inspired by how NetSurf does it. While the Window isn't the parent of the Document, many events should bubble from the Document to the Window. libdom simply doesn't handle this (it has no concept of a Window, and the Document has no parent).

We potentially need to do this for multiple event types (NetSurf only does it for the 'load' event as far as I can tell). It would be nice to find a generic way to do this...maybe intercept any addEventListener on the body and registering special events on the Window? For now, DOMContentLoaded is the blocking (for finance.yahoo.com) and we can see if this is really an issue for other event types.

This is hacky, but it's inspired by how NetSurf does it. While the Window isn't
the parent of the Document, many events should bubble from the Document to the
Window. libdom simply doesn't handle this (it has no concept of a Window, and
the Document has no parent).

We potentially need to do this for multiple event types (NetSurf only does it
for the 'load' event as far as I can tell). It would be nice to find a generic
way to do this...maybe intercept any addEventListener on the body and
registering special events on the Window? For now, `DOMContentLoaded` is the
blocking (for finance.yahoo.com) and we can see if this is really an issue for
other event types.
@karlseguin karlseguin merged commit d7745a4 into main Jul 19, 2025
10 checks passed
@karlseguin karlseguin deleted the window_DOMContentLoaded branch July 19, 2025 00:51
@github-actions github-actions bot locked and limited conversation to collaborators Jul 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants