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

Three-argument document.open() #1925

Merged
merged 1 commit into from Oct 10, 2023

Conversation

Bruce0203
Copy link
Contributor

corrected redirection in js

@@ -11,7 +11,7 @@ import org.w3c.files.*
class DialogInterfaceJs : DialogInterface {

override suspend fun browse(url: URL) {
document.open(url.fullUrl)
document.open(url.fullUrl, "", "noopener=true")
Copy link
Member

@soywiz soywiz Oct 5, 2023

Choose a reason for hiding this comment

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

Now that I notice. Shouldn't it be window.open?
https://developer.mozilla.org/en-US/docs/Web/API/Window/open

@soywiz soywiz enabled auto-merge (squash) October 10, 2023 13:43
@soywiz soywiz disabled auto-merge October 10, 2023 13:43
@soywiz soywiz merged commit bb74ad1 into korlibs:main Oct 10, 2023
8 checks passed
@soywiz
Copy link
Member

soywiz commented Oct 10, 2023

Thanks! It seemed that the three argument version works also with document. While the single argument one works only with window. Not sure if a bug or not. In any case I will change to the window one.

Edit:

https://developer.mozilla.org/en-US/docs/Web/API/Document/open#three-argument_document.open

Three-argument document.open()
There is a lesser-known and little-used three-argument version of document.open(), which is an alias of Window.open() (see its page for full details).

This call, for example opens github.com in a new window, with its opener set to null:

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.

None yet

2 participants