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

Send beacon #956

Merged
merged 1 commit into from
Oct 3, 2024
Merged

Conversation

Ihromant
Copy link
Contributor

@Ihromant Ihromant commented Oct 2, 2024

Hi @konsoletyper . This PR adds navigator.sendBeacon function. Still, when I looked at navigator class, I noticed that all its methods are static. This is very different from Window or Document, which are abstract, but are instantiated using Window.current() or HTMLDocument.current(). Is it made for a reason and is it working or it is just a mistake that happened during the refactoring?

@konsoletyper
Copy link
Owner

This is very different from Window or Document, which are abstract, but are instantiated using Window.current() or HTMLDocument.current(). Is it made for a reason and is it working or it is just a mistake that happened during the refactoring?

It was made by reason. There can be multiple instances of Document or Window per app, for example, when parsing XML/HTML manually (and thus using DOM to navigated detached document) or when using iframes. However, Navigator only needs single instance per browser. If you look at its methods, it becomes quite clear that it does not act in the context of a frame or a tab.

@konsoletyper konsoletyper merged commit 2414d74 into konsoletyper:master Oct 3, 2024
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants