Skip to content

Commit

Permalink
Merge pull request #761 from zetashift/fix/#746
Browse files Browse the repository at this point in the history
Fixup Location#origin and Location#reload
  • Loading branch information
armanbilge authored Jan 28, 2023
2 parents b2034ed + f5baadf commit 21d6bad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions api-reports/2_12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15709,11 +15709,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 @@ -15709,11 +15709,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

0 comments on commit 21d6bad

Please sign in to comment.