Skip to content

Fixup Location#origin and Location#reload #761

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

Merged
merged 5 commits into from
Jan 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api-reports/2_12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15482,11 +15482,11 @@ Location[JT] var hash: String
Location[JT] var host: String
Location[JT] var hostname: String
Location[JT] var href: String
Location[JT] def origin: js.UndefOr[String]
Location[JT] def origin: String
Location[JT] var pathname: String
Location[JT] var port: String
Location[JT] var protocol: String
Location[JT] def reload(flag: Boolean?): Unit
Location[JT] def reload(): Unit
Location[JT] def replace(url: String): Unit
Location[JT] var search: String
MIMEType[JT]
Expand Down
4 changes: 2 additions & 2 deletions api-reports/2_13.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15482,11 +15482,11 @@ Location[JT] var hash: String
Location[JT] var host: String
Location[JT] var hostname: String
Location[JT] var href: String
Location[JT] def origin: js.UndefOr[String]
Location[JT] def origin: String
Location[JT] var pathname: String
Location[JT] var port: String
Location[JT] var protocol: String
Location[JT] def reload(flag: Boolean?): Unit
Location[JT] def reload(): Unit
Location[JT] def replace(url: String): Unit
Location[JT] var search: String
MIMEType[JT]
Expand Down
12 changes: 5 additions & 7 deletions dom/src/main/scala/org/scalajs/dom/Location.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,14 @@ trait Location extends js.Object {
* URL, that is, for http and https, the scheme followed by '://', followed by the domain, followed by ':', followed
* by the port (the default port, 80 and 443 respectively, if explicitly specified). For URL using file: scheme, the
* value is browser dependant.
*
* This property also does not exist consistently on IE, even as new as IE11, hence it must be UndefOr.
*/
def origin: js.UndefOr[String] = js.native
def origin: String = js.native

/** The Location.reload()method Reloads the resource from the current URL. Its optional unique parameter is a Boolean,
* which, when it is true, causes the page to always be reloaded from the server. If it is false or not specified,
* the browser may reload the page from its cache.
/** Reloads the resource from the current URL, like the Refresh button. The reload may be blocked and a SECURITY_ERROR
* DOMException thrown. This happens if the origin of the script calling location.reload() differs from the origin of
* the page that owns the Location object.
*/
def reload(flag: Boolean = js.native): Unit = js.native
def reload(): Unit = js.native

/** The Location.replace()method replaces the current resource with the one at the provided URL. The difference from
* the assign() method is that after using replace() the current page will not be saved in session History, meaning
Expand Down