Skip to content

Commit 911f30f

Browse files
authored
Merge pull request #235 from turbolent/bastian/url-class
Add URL constructor
2 parents d56f7ac + c21e61f commit 911f30f

File tree

1 file changed

+93
-0
lines changed
  • src/main/scala/org/scalajs/dom/experimental

1 file changed

+93
-0
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
package org.scalajs.dom.experimental
2+
3+
import scala.scalajs.js
4+
5+
/**
6+
* The URL() constructor returns a newly created URL object representing the URL
7+
* defined by the parameters.
8+
*
9+
* MDN
10+
*/
11+
@js.native
12+
class URL(url: String, base: String = js.native) extends js.Object {
13+
14+
/**
15+
* Returns a DOMString containing the origin of the URL, that is its scheme,
16+
* its domain and its port.
17+
*
18+
* MDN
19+
*/
20+
def origin: String = js.native
21+
22+
/**
23+
* Is a DOMString containing the whole URL.
24+
*
25+
* MDN
26+
*/
27+
var href: String = js.native
28+
29+
/**
30+
* Is a DOMString containing the protocol scheme of the URL,
31+
* including the final ':'.
32+
*
33+
* MDN
34+
*/
35+
var protocol: String = js.native
36+
37+
/**
38+
* Is a DOMString containing the username specified before the domain name.
39+
*
40+
* MDN
41+
*/
42+
var username: String = js.native
43+
44+
/**
45+
* Is a DOMString containing the password specified before the domain name.
46+
*
47+
* MDN
48+
*/
49+
var password: String = js.native
50+
51+
/**
52+
* Is a DOMString containing the host, that is the hostname, a ':',
53+
* and the port of the URL.
54+
*
55+
* MDN
56+
*/
57+
var host: String = js.native
58+
59+
/**
60+
* Is a DOMString containing the domain of the URL.
61+
*
62+
* MDN
63+
*/
64+
var hostname: String = js.native
65+
66+
/**
67+
* Is a DOMString containing the port number of the URL.
68+
*
69+
* MDN
70+
*/
71+
var port: String = js.native
72+
73+
/**
74+
* Is a DOMString containing an initial '/' followed by the path of the URL.
75+
*
76+
* MDN
77+
*/
78+
var pathname: String = js.native
79+
80+
/**
81+
* Is a DOMString containing a '?' followed by the parameters of the URL.
82+
*
83+
* MDN
84+
*/
85+
var search: String = js.native
86+
87+
/**
88+
* Is a DOMString containing a '#' followed by the fragment identifier of the URL.
89+
*
90+
* MDN
91+
*/
92+
var hash: String = js.native
93+
}

0 commit comments

Comments
 (0)