forked from chromedp/chromedp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
js.go
59 lines (48 loc) · 2.02 KB
/
js.go
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
package chromedp
import (
_ "embed"
)
var (
// textJS is a javascript snippet that returns the innerText of the specified
// visible (ie, offsetWidth || offsetHeight || getClientRects().length ) element.
//go:embed js/text.js
textJS string
// textContentJS is a javascript snippet that returns the textContent of the
// specified element.
//go:embed js/textContent.js
textContentJS string
// blurJS is a javascript snippet that blurs the specified element.
//go:embed js/blur.js
blurJS string
// submitJS is a javascript snippet that will call the containing form's
// submit function, returning true or false if the call was successful.
//go:embed js/submit.js
submitJS string
// resetJS is a javascript snippet that will call the containing form's
// reset function, returning true or false if the call was successful.
//go:embed js/reset.js
resetJS string
// attributeJS is a javascript snippet that returns the attribute of a specified
// node.
//go:embed js/attribute.js
attributeJS string
// setAttributeJS is a javascript snippet that sets the value of the specified
// node, and returns the value.
//go:embed js/setAttribute.js
setAttributeJS string
// visibleJS is a javascript snippet that returns true or false depending on if
// the specified node's offsetWidth, offsetHeight or getClientRects().length is
// not null.
//go:embed js/visible.js
visibleJS string
// getClientRectJS is a javascript snippet that returns the information about the
// size of the specified node and its position relative to its owner document.
//go:embed js/getClientRect.js
getClientRectJS string
// waitForPredicatePageFunction is a javascript snippet that runs the polling in the
// browser. It's copied from puppeteer. See
// https://github.com/puppeteer/puppeteer/blob/669f04a7a6e96cc8353a8cb152898edbc25e7c15/src/common/DOMWorld.ts#L870-L944
// It's modified to make mutation polling respect timeout even when there is not DOM mutation.
//go:embed js/waitForPredicatePageFunction.js
waitForPredicatePageFunction string
)