-
Notifications
You must be signed in to change notification settings - Fork 0
/
WindowClient.cljs
87 lines (62 loc) · 2.82 KB
/
WindowClient.cljs
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
(ns web.service-workers.WindowClient
"The WindowClient interface of the ServiceWorker API represents
scope of a service worker client that is a document in a browser
controlled by an active worker. The service worker client independently
and uses a service worker for its own loading and sub-resources."
(:refer-clojure :exclude []))
(defn focus
"Method.
The focus() method of the `web.service-workers.WindowClient`
gives user input focus to the current client and returns a `js.Promise`
resolves to the existing `web.service-workers.WindowClient`.
`Client.focus().then(function(WindowClient) {
// do something with your WindowClient once it has been focused
});`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/WindowClient/focus`"
[this & args]
(-> this .-focus (.apply this (clj->js args))))
(defn navigate
"Method.
The navigate() method of the `web.service-workers.WindowClient`
loads a specified URL into a controlled client page then returns
`js.Promise` that resolves to the existing `web.service-workers.WindowClient`.
`WindowClient.navigate(url).then(function(WindowClient) {
// do something with your WindowClient after navigation
});`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/WindowClient/navigate`"
[this & args]
(-> this .-navigate (.apply this (clj->js args))))
(defn focused
"Property.
The focused read-only property of the `web.service-workers.WindowClient`
is a `js.Boolean` that indicates whether the current client has
`myFocused = WindowClient.focused;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/WindowClient/focused`"
[this]
(-> this (.-focused)))
(defn set-focused!
"Property.
The focused read-only property of the `web.service-workers.WindowClient`
is a `js.Boolean` that indicates whether the current client has
`myFocused = WindowClient.focused;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/WindowClient/focused`"
[this val]
(aset this "focused" val))
(defn visibility-state
"Property.
The visibilityState read-only property of the `web.service-workers.WindowClient`
indicates the visibility of the current client. This value can
one of hidden, visible, prerender, or unloaded.
`myVisState = WindowClient.visibilityState;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/WindowClient/visibilityState`"
[this]
(-> this (.-visibilityState)))
(defn set-visibility-state!
"Property.
The visibilityState read-only property of the `web.service-workers.WindowClient`
indicates the visibility of the current client. This value can
one of hidden, visible, prerender, or unloaded.
`myVisState = WindowClient.visibilityState;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/WindowClient/visibilityState`"
[this val]
(aset this "visibilityState" val))