forked from capricorn86/happy-dom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Location.ts
43 lines (39 loc) · 962 Bytes
/
Location.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import URL from './URL';
/**
*
*/
export default class Location extends URL {
/**
* Constructor.
*/
constructor() {
super('about:blank');
}
/**
* 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 the user won't be able to use the back button to navigate to it.
*
* @param url URL.
*/
public replace(url: string): void {
this.href = url;
}
/**
* Loads the resource at the URL provided in parameter.
*
* Note: Will do the same thing as "replace()" as server-dom does not support loading the URL.
*
* @param url
* @see this.replace()
*/
public assign(url: string): void {
this.replace(url);
}
/**
* Reloads the resource from the current URL.
*
* Note: Will do nothing as reloading is not supported in server-dom.
*/
public reload(): void {
// Do nothing
}
}