From c21e61fa6d86a79f85d7decfed962c110d28f8ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Sun, 10 Jul 2016 13:18:53 -0700 Subject: [PATCH] Add URL constructor --- .../org/scalajs/dom/experimental/URL.scala | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 src/main/scala/org/scalajs/dom/experimental/URL.scala diff --git a/src/main/scala/org/scalajs/dom/experimental/URL.scala b/src/main/scala/org/scalajs/dom/experimental/URL.scala new file mode 100644 index 000000000..1e801ab6e --- /dev/null +++ b/src/main/scala/org/scalajs/dom/experimental/URL.scala @@ -0,0 +1,93 @@ +package org.scalajs.dom.experimental + +import scala.scalajs.js + +/** + * The URL() constructor returns a newly created URL object representing the URL + * defined by the parameters. + * + * MDN + */ +@js.native +class URL(url: String, base: String = js.native) extends js.Object { + + /** + * Returns a DOMString containing the origin of the URL, that is its scheme, + * its domain and its port. + * + * MDN + */ + def origin: String = js.native + + /** + * Is a DOMString containing the whole URL. + * + * MDN + */ + var href: String = js.native + + /** + * Is a DOMString containing the protocol scheme of the URL, + * including the final ':'. + * + * MDN + */ + var protocol: String = js.native + + /** + * Is a DOMString containing the username specified before the domain name. + * + * MDN + */ + var username: String = js.native + + /** + * Is a DOMString containing the password specified before the domain name. + * + * MDN + */ + var password: String = js.native + + /** + * Is a DOMString containing the host, that is the hostname, a ':', + * and the port of the URL. + * + * MDN + */ + var host: String = js.native + + /** + * Is a DOMString containing the domain of the URL. + * + * MDN + */ + var hostname: String = js.native + + /** + * Is a DOMString containing the port number of the URL. + * + * MDN + */ + var port: String = js.native + + /** + * Is a DOMString containing an initial '/' followed by the path of the URL. + * + * MDN + */ + var pathname: String = js.native + + /** + * Is a DOMString containing a '?' followed by the parameters of the URL. + * + * MDN + */ + var search: String = js.native + + /** + * Is a DOMString containing a '#' followed by the fragment identifier of the URL. + * + * MDN + */ + var hash: String = js.native +}