puppeteer-ruby 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +30 -0
- data/.rubocop.yml +4 -5
- data/docs/Puppeteer.html +2010 -0
- data/docs/Puppeteer/AsyncAwaitBehavior.html +105 -0
- data/docs/Puppeteer/Browser.html +2150 -0
- data/docs/Puppeteer/BrowserContext.html +809 -0
- data/docs/Puppeteer/BrowserFetcher.html +214 -0
- data/docs/Puppeteer/BrowserRunner.html +914 -0
- data/docs/Puppeteer/BrowserRunner/BrowserProcess.html +477 -0
- data/docs/Puppeteer/CDPSession.html +784 -0
- data/docs/Puppeteer/CDPSession/Error.html +124 -0
- data/docs/Puppeteer/ConcurrentRubyUtils.html +430 -0
- data/docs/Puppeteer/Connection.html +960 -0
- data/docs/Puppeteer/Connection/MessageCallback.html +434 -0
- data/docs/Puppeteer/Connection/ProtocolError.html +216 -0
- data/docs/Puppeteer/Connection/RequestDebugPrinter.html +217 -0
- data/docs/Puppeteer/Connection/ResponseDebugPrinter.html +244 -0
- data/docs/Puppeteer/ConsoleMessage.html +565 -0
- data/docs/Puppeteer/ConsoleMessage/Location.html +433 -0
- data/docs/Puppeteer/DOMWorld.html +1580 -0
- data/docs/Puppeteer/DOMWorld/DetachedError.html +124 -0
- data/docs/Puppeteer/DOMWorld/DocumentEvaluationError.html +124 -0
- data/docs/Puppeteer/DebugPrint.html +233 -0
- data/docs/Puppeteer/Device.html +470 -0
- data/docs/Puppeteer/Devices.html +139 -0
- data/docs/Puppeteer/ElementHandle.html +1603 -0
- data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +206 -0
- data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +206 -0
- data/docs/Puppeteer/ElementHandle/Point.html +481 -0
- data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +124 -0
- data/docs/Puppeteer/EmulationManager.html +454 -0
- data/docs/Puppeteer/EventCallbackable.html +433 -0
- data/docs/Puppeteer/EventCallbackable/EventListeners.html +435 -0
- data/docs/Puppeteer/ExecutionContext.html +772 -0
- data/docs/Puppeteer/ExecutionContext/EvaluationError.html +124 -0
- data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +357 -0
- data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +389 -0
- data/docs/Puppeteer/Frame.html +3625 -0
- data/docs/Puppeteer/FrameManager.html +2414 -0
- data/docs/Puppeteer/FrameManager/NavigationError.html +124 -0
- data/docs/Puppeteer/IfPresent.html +222 -0
- data/docs/Puppeteer/JSHandle.html +1352 -0
- data/docs/Puppeteer/Keyboard.html +1557 -0
- data/docs/Puppeteer/Keyboard/KeyDefinition.html +831 -0
- data/docs/Puppeteer/Keyboard/KeyDescription.html +603 -0
- data/docs/Puppeteer/Launcher.html +237 -0
- data/docs/Puppeteer/Launcher/Base.html +385 -0
- data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +124 -0
- data/docs/Puppeteer/Launcher/BrowserOptions.html +441 -0
- data/docs/Puppeteer/Launcher/Chrome.html +628 -0
- data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +382 -0
- data/docs/Puppeteer/Launcher/ChromeArgOptions.html +531 -0
- data/docs/Puppeteer/Launcher/LaunchOptions.html +893 -0
- data/docs/Puppeteer/LifecycleWatcher.html +834 -0
- data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +363 -0
- data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +206 -0
- data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +124 -0
- data/docs/Puppeteer/Mouse.html +1105 -0
- data/docs/Puppeteer/Mouse/Button.html +136 -0
- data/docs/Puppeteer/NetworkManager.html +901 -0
- data/docs/Puppeteer/NetworkManager/Credentials.html +385 -0
- data/docs/Puppeteer/Page.html +5426 -0
- data/docs/Puppeteer/Page/ScreenshotOptions.html +845 -0
- data/docs/Puppeteer/Page/ScriptTag.html +555 -0
- data/docs/Puppeteer/Page/StyleTag.html +448 -0
- data/docs/Puppeteer/Page/TargetCrashedError.html +124 -0
- data/docs/Puppeteer/RemoteObject.html +951 -0
- data/docs/Puppeteer/Target.html +1384 -0
- data/docs/Puppeteer/Target/InitializeFailure.html +124 -0
- data/docs/Puppeteer/Target/TargetInfo.html +729 -0
- data/docs/Puppeteer/TimeoutError.html +135 -0
- data/docs/Puppeteer/TimeoutSettings.html +496 -0
- data/docs/Puppeteer/TouchScreen.html +464 -0
- data/docs/Puppeteer/Viewport.html +757 -0
- data/docs/Puppeteer/WaitTask.html +211 -0
- data/docs/Puppeteer/WaitTask/TerminatedError.html +124 -0
- data/docs/Puppeteer/WebSocket.html +673 -0
- data/docs/Puppeteer/WebSocket/DriverImpl.html +412 -0
- data/docs/Puppeteer/WebSocketTransport.html +600 -0
- data/docs/Puppeteer/WebSocktTransportError.html +124 -0
- data/docs/_index.html +788 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +496 -0
- data/docs/file.README.html +121 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +121 -0
- data/docs/js/app.js +314 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +3747 -0
- data/docs/top-level-namespace.html +126 -0
- data/lib/puppeteer.rb +9 -7
- data/lib/puppeteer/async_await_behavior.rb +6 -0
- data/lib/puppeteer/browser.rb +21 -1
- data/lib/puppeteer/connection.rb +1 -1
- data/lib/puppeteer/dom_world.rb +15 -2
- data/lib/puppeteer/element_handle.rb +3 -2
- data/lib/puppeteer/frame.rb +4 -0
- data/lib/puppeteer/frame_manager.rb +1 -1
- data/lib/puppeteer/js_handle.rb +3 -2
- data/lib/puppeteer/launcher.rb +0 -1
- data/lib/puppeteer/lifecycle_watcher.rb +3 -3
- data/lib/puppeteer/page.rb +6 -4
- data/lib/puppeteer/version.rb +1 -1
- data/puppeteer-ruby.gemspec +4 -1
- metadata +138 -4
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>
|
|
7
|
+
Module: Puppeteer::AsyncAwaitBehavior
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.9.24
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript">
|
|
18
|
+
pathId = "Puppeteer::AsyncAwaitBehavior";
|
|
19
|
+
relpath = '../';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
24
|
+
|
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<div class="nav_wrap">
|
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
|
32
|
+
<div id="resizer"></div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div id="main" tabindex="-1">
|
|
36
|
+
<div id="header">
|
|
37
|
+
<div id="menu">
|
|
38
|
+
|
|
39
|
+
<a href="../_index.html">Index (A)</a> »
|
|
40
|
+
<span class='title'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span>
|
|
41
|
+
»
|
|
42
|
+
<span class="title">AsyncAwaitBehavior</span>
|
|
43
|
+
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div id="search">
|
|
47
|
+
|
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
|
49
|
+
href="../class_list.html">
|
|
50
|
+
|
|
51
|
+
<svg width="24" height="24">
|
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
55
|
+
</svg>
|
|
56
|
+
</a>
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
<div class="clear"></div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div id="content"><h1>Module: Puppeteer::AsyncAwaitBehavior
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</h1>
|
|
67
|
+
<div class="box_info">
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<dl>
|
|
80
|
+
<dt>Defined in:</dt>
|
|
81
|
+
<dd>lib/puppeteer/async_await_behavior.rb</dd>
|
|
82
|
+
</dl>
|
|
83
|
+
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div id="footer">
|
|
98
|
+
Generated on Sun Apr 26 15:52:55 2020 by
|
|
99
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
100
|
+
0.9.24 (ruby-2.6.3).
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
</div>
|
|
104
|
+
</body>
|
|
105
|
+
</html>
|
|
@@ -0,0 +1,2150 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>
|
|
7
|
+
Class: Puppeteer::Browser
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.9.24
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript">
|
|
18
|
+
pathId = "Puppeteer::Browser";
|
|
19
|
+
relpath = '../';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
24
|
+
|
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<div class="nav_wrap">
|
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
|
32
|
+
<div id="resizer"></div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div id="main" tabindex="-1">
|
|
36
|
+
<div id="header">
|
|
37
|
+
<div id="menu">
|
|
38
|
+
|
|
39
|
+
<a href="../_index.html">Index (B)</a> »
|
|
40
|
+
<span class='title'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span>
|
|
41
|
+
»
|
|
42
|
+
<span class="title">Browser</span>
|
|
43
|
+
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div id="search">
|
|
47
|
+
|
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
|
49
|
+
href="../class_list.html">
|
|
50
|
+
|
|
51
|
+
<svg width="24" height="24">
|
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
55
|
+
</svg>
|
|
56
|
+
</a>
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
<div class="clear"></div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div id="content"><h1>Class: Puppeteer::Browser
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</h1>
|
|
67
|
+
<div class="box_info">
|
|
68
|
+
|
|
69
|
+
<dl>
|
|
70
|
+
<dt>Inherits:</dt>
|
|
71
|
+
<dd>
|
|
72
|
+
<span class="inheritName">Object</span>
|
|
73
|
+
|
|
74
|
+
<ul class="fullTree">
|
|
75
|
+
<li>Object</li>
|
|
76
|
+
|
|
77
|
+
<li class="next">Puppeteer::Browser</li>
|
|
78
|
+
|
|
79
|
+
</ul>
|
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
81
|
+
|
|
82
|
+
</dd>
|
|
83
|
+
</dl>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
<dl>
|
|
91
|
+
<dt>Includes:</dt>
|
|
92
|
+
<dd><span class='object_link'><a href="DebugPrint.html" title="Puppeteer::DebugPrint (module)">DebugPrint</a></span>, <span class='object_link'><a href="EventCallbackable.html" title="Puppeteer::EventCallbackable (module)">EventCallbackable</a></span>, <span class='object_link'><a href="IfPresent.html" title="Puppeteer::IfPresent (module)">IfPresent</a></span></dd>
|
|
93
|
+
</dl>
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<dl>
|
|
101
|
+
<dt>Defined in:</dt>
|
|
102
|
+
<dd>lib/puppeteer/browser.rb</dd>
|
|
103
|
+
</dl>
|
|
104
|
+
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
<h2>
|
|
116
|
+
Class Method Summary
|
|
117
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
118
|
+
</h2>
|
|
119
|
+
|
|
120
|
+
<ul class="summary">
|
|
121
|
+
|
|
122
|
+
<li class="public ">
|
|
123
|
+
<span class="summary_signature">
|
|
124
|
+
|
|
125
|
+
<a href="#create-class_method" title="create (class method)">.<strong>create</strong>(connection:, context_ids:, ignore_https_errors:, default_viewport:, process:, close_callback:) ⇒ Object </a>
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
</span>
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
140
|
+
|
|
141
|
+
</li>
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
</ul>
|
|
145
|
+
|
|
146
|
+
<h2>
|
|
147
|
+
Instance Method Summary
|
|
148
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
149
|
+
</h2>
|
|
150
|
+
|
|
151
|
+
<ul class="summary">
|
|
152
|
+
|
|
153
|
+
<li class="public ">
|
|
154
|
+
<span class="summary_signature">
|
|
155
|
+
|
|
156
|
+
<a href="#browser_contexts-instance_method" title="#browser_contexts (instance method)">#<strong>browser_contexts</strong> ⇒ Object </a>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
</span>
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
171
|
+
|
|
172
|
+
</li>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
<li class="public ">
|
|
176
|
+
<span class="summary_signature">
|
|
177
|
+
|
|
178
|
+
<a href="#close-instance_method" title="#close (instance method)">#<strong>close</strong> ⇒ Object </a>
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
</span>
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
193
|
+
|
|
194
|
+
</li>
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
<li class="public ">
|
|
198
|
+
<span class="summary_signature">
|
|
199
|
+
|
|
200
|
+
<a href="#connected%3F-instance_method" title="#connected? (instance method)">#<strong>connected?</strong> ⇒ Boolean </a>
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
</span>
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
215
|
+
|
|
216
|
+
</li>
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
<li class="public ">
|
|
220
|
+
<span class="summary_signature">
|
|
221
|
+
|
|
222
|
+
<a href="#create_incognito_browser_context-instance_method" title="#create_incognito_browser_context (instance method)">#<strong>create_incognito_browser_context</strong> ⇒ Puppeteer::BrowserContext </a>
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
</span>
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
237
|
+
|
|
238
|
+
</li>
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
<li class="public ">
|
|
242
|
+
<span class="summary_signature">
|
|
243
|
+
|
|
244
|
+
<a href="#create_page_in_context-instance_method" title="#create_page_in_context (instance method)">#<strong>create_page_in_context</strong>(context_id) ⇒ !Promise<!Puppeteer.Page> </a>
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
</span>
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
259
|
+
|
|
260
|
+
</li>
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
<li class="public ">
|
|
264
|
+
<span class="summary_signature">
|
|
265
|
+
|
|
266
|
+
<a href="#default_browser_context-instance_method" title="#default_browser_context (instance method)">#<strong>default_browser_context</strong> ⇒ Puppeteer::BrowserContext </a>
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
</span>
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
281
|
+
|
|
282
|
+
</li>
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
<li class="public ">
|
|
286
|
+
<span class="summary_signature">
|
|
287
|
+
|
|
288
|
+
<a href="#disconnect-instance_method" title="#disconnect (instance method)">#<strong>disconnect</strong> ⇒ Object </a>
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
</span>
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
303
|
+
|
|
304
|
+
</li>
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
<li class="public ">
|
|
308
|
+
<span class="summary_signature">
|
|
309
|
+
|
|
310
|
+
<a href="#dispose_context-instance_method" title="#dispose_context (instance method)">#<strong>dispose_context</strong>(context_id) ⇒ Object </a>
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
</span>
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
325
|
+
|
|
326
|
+
</li>
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
<li class="public ">
|
|
330
|
+
<span class="summary_signature">
|
|
331
|
+
|
|
332
|
+
<a href="#handle_target_created-instance_method" title="#handle_target_created (instance method)">#<strong>handle_target_created</strong>(event) ⇒ Object </a>
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
</span>
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
347
|
+
|
|
348
|
+
</li>
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
<li class="public ">
|
|
352
|
+
<span class="summary_signature">
|
|
353
|
+
|
|
354
|
+
<a href="#handle_target_destroyed-instance_method" title="#handle_target_destroyed (instance method)">#<strong>handle_target_destroyed</strong>(event) ⇒ Object </a>
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
</span>
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
369
|
+
|
|
370
|
+
</li>
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
<li class="public ">
|
|
374
|
+
<span class="summary_signature">
|
|
375
|
+
|
|
376
|
+
<a href="#handle_target_info_changed-instance_method" title="#handle_target_info_changed (instance method)">#<strong>handle_target_info_changed</strong>(event) ⇒ Object </a>
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
</span>
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
391
|
+
|
|
392
|
+
</li>
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
<li class="public ">
|
|
396
|
+
<span class="summary_signature">
|
|
397
|
+
|
|
398
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(connection:, context_ids:, ignore_https_errors:, default_viewport:, process:, close_callback:) ⇒ Browser </a>
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
</span>
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
<span class="note title constructor">constructor</span>
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
<span class="summary_desc"><div class='inline'>
|
|
415
|
+
<p>A new instance of Browser.</p>
|
|
416
|
+
</div></span>
|
|
417
|
+
|
|
418
|
+
</li>
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
<li class="public ">
|
|
422
|
+
<span class="summary_signature">
|
|
423
|
+
|
|
424
|
+
<a href="#new_page-instance_method" title="#new_page (instance method)">#<strong>new_page</strong> ⇒ Object </a>
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
</span>
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
439
|
+
|
|
440
|
+
</li>
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
<li class="public ">
|
|
444
|
+
<span class="summary_signature">
|
|
445
|
+
|
|
446
|
+
<a href="#pages-instance_method" title="#pages (instance method)">#<strong>pages</strong> ⇒ !Promise<!Array<!Puppeteer.Page>> </a>
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
</span>
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
461
|
+
|
|
462
|
+
</li>
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
<li class="public ">
|
|
466
|
+
<span class="summary_signature">
|
|
467
|
+
|
|
468
|
+
<a href="#process-instance_method" title="#process (instance method)">#<strong>process</strong> ⇒ Puppeteer::BrowserRunner::BrowserProcess </a>
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
</span>
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
483
|
+
|
|
484
|
+
</li>
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
<li class="public ">
|
|
488
|
+
<span class="summary_signature">
|
|
489
|
+
|
|
490
|
+
<a href="#target-instance_method" title="#target (instance method)">#<strong>target</strong> ⇒ !Target </a>
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
</span>
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
505
|
+
|
|
506
|
+
</li>
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
<li class="public ">
|
|
510
|
+
<span class="summary_signature">
|
|
511
|
+
|
|
512
|
+
<a href="#targets-instance_method" title="#targets (instance method)">#<strong>targets</strong> ⇒ !Array<!Target> </a>
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
</span>
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
527
|
+
|
|
528
|
+
</li>
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
<li class="public ">
|
|
532
|
+
<span class="summary_signature">
|
|
533
|
+
|
|
534
|
+
<a href="#user_agent-instance_method" title="#user_agent (instance method)">#<strong>user_agent</strong> ⇒ String </a>
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
</span>
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
549
|
+
|
|
550
|
+
</li>
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
<li class="public ">
|
|
554
|
+
<span class="summary_signature">
|
|
555
|
+
|
|
556
|
+
<a href="#version-instance_method" title="#version (instance method)">#<strong>version</strong> ⇒ String </a>
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
</span>
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
571
|
+
|
|
572
|
+
</li>
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
<li class="public ">
|
|
576
|
+
<span class="summary_signature">
|
|
577
|
+
|
|
578
|
+
<a href="#wait_for_target-instance_method" title="#wait_for_target (instance method)">#<strong>wait_for_target</strong>(predicate:, timeout: nil) ⇒ !Promise<!Target> </a>
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
</span>
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
593
|
+
|
|
594
|
+
</li>
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
<li class="public ">
|
|
598
|
+
<span class="summary_signature">
|
|
599
|
+
|
|
600
|
+
<a href="#websocket_endpoint-instance_method" title="#websocket_endpoint (instance method)">#<strong>websocket_endpoint</strong> ⇒ String </a>
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
</span>
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
615
|
+
|
|
616
|
+
</li>
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
</ul>
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="IfPresent.html" title="Puppeteer::IfPresent (module)">IfPresent</a></span></h3>
|
|
632
|
+
<p class="inherited"><span class='object_link'><a href="IfPresent.html#if_present-instance_method" title="Puppeteer::IfPresent#if_present (method)">#if_present</a></span></p>
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="EventCallbackable.html" title="Puppeteer::EventCallbackable (module)">EventCallbackable</a></span></h3>
|
|
643
|
+
<p class="inherited"><span class='object_link'><a href="EventCallbackable.html#add_event_listener-instance_method" title="Puppeteer::EventCallbackable#add_event_listener (method)">#add_event_listener</a></span>, <span class='object_link'><a href="EventCallbackable.html#emit_event-instance_method" title="Puppeteer::EventCallbackable#emit_event (method)">#emit_event</a></span>, <span class='object_link'><a href="EventCallbackable.html#on_event-instance_method" title="Puppeteer::EventCallbackable#on_event (method)">#on_event</a></span>, <span class='object_link'><a href="EventCallbackable.html#remove_event_listener-instance_method" title="Puppeteer::EventCallbackable#remove_event_listener (method)">#remove_event_listener</a></span></p>
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="DebugPrint.html" title="Puppeteer::DebugPrint (module)">DebugPrint</a></span></h3>
|
|
654
|
+
<p class="inherited"><span class='object_link'><a href="DebugPrint.html#debug_print-instance_method" title="Puppeteer::DebugPrint#debug_print (method)">#debug_print</a></span>, <span class='object_link'><a href="DebugPrint.html#debug_puts-instance_method" title="Puppeteer::DebugPrint#debug_puts (method)">#debug_puts</a></span></p>
|
|
655
|
+
<div id="constructor_details" class="method_details_list">
|
|
656
|
+
<h2>Constructor Details</h2>
|
|
657
|
+
|
|
658
|
+
<div class="method_details first">
|
|
659
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
660
|
+
|
|
661
|
+
#<strong>initialize</strong>(connection:, context_ids:, ignore_https_errors:, default_viewport:, process:, close_callback:) ⇒ <tt><span class='object_link'><a href="" title="Puppeteer::Browser (class)">Browser</a></span></tt>
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
</h3><div class="docstring">
|
|
668
|
+
<div class="discussion">
|
|
669
|
+
|
|
670
|
+
<p>Returns a new instance of Browser.</p>
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
</div>
|
|
674
|
+
</div>
|
|
675
|
+
<div class="tags">
|
|
676
|
+
<p class="tag_title">Parameters:</p>
|
|
677
|
+
<ul class="param">
|
|
678
|
+
|
|
679
|
+
<li>
|
|
680
|
+
|
|
681
|
+
<span class='name'>connection</span>
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
<span class='type'>(<tt>!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Connection.html" title="Puppeteer::Connection (class)">Connection</a></span></tt>)</span>
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
</li>
|
|
689
|
+
|
|
690
|
+
<li>
|
|
691
|
+
|
|
692
|
+
<span class='name'>contextIds</span>
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
<span class='type'>(<tt>!Array<string></tt>)</span>
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
</li>
|
|
700
|
+
|
|
701
|
+
<li>
|
|
702
|
+
|
|
703
|
+
<span class='name'>ignoreHTTPSErrors</span>
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
<span class='type'>(<tt>boolean</tt>)</span>
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
</li>
|
|
711
|
+
|
|
712
|
+
<li>
|
|
713
|
+
|
|
714
|
+
<span class='name'>defaultViewport</span>
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
<span class='type'>(<tt>?<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Viewport.html" title="Puppeteer::Viewport (class)">Viewport</a></span></tt>)</span>
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+
</li>
|
|
722
|
+
|
|
723
|
+
<li>
|
|
724
|
+
|
|
725
|
+
<span class='name'>process</span>
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
<span class='type'>(<tt>?<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.ChildProcess</tt>)</span>
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
</li>
|
|
733
|
+
|
|
734
|
+
<li>
|
|
735
|
+
|
|
736
|
+
<span class='name'>closeCallback</span>
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
<span class='type'>(<tt>(function():Promise)=</tt>)</span>
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
</li>
|
|
744
|
+
|
|
745
|
+
</ul>
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
</div><table class="source_code">
|
|
749
|
+
<tr>
|
|
750
|
+
<td>
|
|
751
|
+
<pre class="lines">
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
35
|
|
755
|
+
36
|
|
756
|
+
37
|
|
757
|
+
38
|
|
758
|
+
39
|
|
759
|
+
40
|
|
760
|
+
41
|
|
761
|
+
42
|
|
762
|
+
43
|
|
763
|
+
44
|
|
764
|
+
45
|
|
765
|
+
46
|
|
766
|
+
47
|
|
767
|
+
48
|
|
768
|
+
49
|
|
769
|
+
50
|
|
770
|
+
51
|
|
771
|
+
52
|
|
772
|
+
53
|
|
773
|
+
54
|
|
774
|
+
55</pre>
|
|
775
|
+
</td>
|
|
776
|
+
<td>
|
|
777
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 35</span>
|
|
778
|
+
|
|
779
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>connection:</span><span class='comma'>,</span> <span class='label'>context_ids:</span><span class='comma'>,</span> <span class='label'>ignore_https_errors:</span><span class='comma'>,</span> <span class='label'>default_viewport:</span><span class='comma'>,</span> <span class='label'>process:</span><span class='comma'>,</span> <span class='label'>close_callback:</span><span class='rparen'>)</span>
|
|
780
|
+
<span class='ivar'>@ignore_https_errors</span> <span class='op'>=</span> <span class='id identifier rubyid_ignore_https_errors'>ignore_https_errors</span>
|
|
781
|
+
<span class='ivar'>@default_viewport</span> <span class='op'>=</span> <span class='id identifier rubyid_default_viewport'>default_viewport</span>
|
|
782
|
+
<span class='ivar'>@process</span> <span class='op'>=</span> <span class='id identifier rubyid_process'>process</span>
|
|
783
|
+
<span class='comment'># @screenshot_task_queue = TaskQueue.new
|
|
784
|
+
</span> <span class='ivar'>@connection</span> <span class='op'>=</span> <span class='id identifier rubyid_connection'>connection</span>
|
|
785
|
+
<span class='ivar'>@close_callback</span> <span class='op'>=</span> <span class='id identifier rubyid_close_callback'>close_callback</span>
|
|
786
|
+
|
|
787
|
+
<span class='ivar'>@default_context</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="BrowserContext.html" title="Puppeteer::BrowserContext (class)">BrowserContext</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="BrowserContext.html#initialize-instance_method" title="Puppeteer::BrowserContext#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@connection</span><span class='comma'>,</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
788
|
+
<span class='ivar'>@contexts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
789
|
+
<span class='id identifier rubyid_context_ids'>context_ids</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_context_id'>context_id</span><span class='op'>|</span>
|
|
790
|
+
<span class='ivar'>@contexts</span><span class='lbracket'>[</span><span class='id identifier rubyid_context_id'>context_id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="BrowserContext.html" title="Puppeteer::BrowserContext (class)">BrowserContext</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="BrowserContext.html#initialize-instance_method" title="Puppeteer::BrowserContext#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@connection</span><span class='comma'>,</span> <span class='kw'>self</span><span class='period'>.</span> <span class='id identifier rubyid_context_id'>context_id</span><span class='rparen'>)</span>
|
|
791
|
+
<span class='kw'>end</span>
|
|
792
|
+
<span class='ivar'>@targets</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
793
|
+
<span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_on_event'>on_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.CDPSession.Disconnected</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span>
|
|
794
|
+
<span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.Browser.Disconnected</span><span class='tstring_end'>'</span></span>
|
|
795
|
+
<span class='kw'>end</span>
|
|
796
|
+
<span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_on_event'>on_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Target.targetCreated</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:handle_target_created</span><span class='rparen'>)</span>
|
|
797
|
+
<span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_on_event'>on_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Target.targetDestroyed</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:handle_target_destroyed</span><span class='rparen'>)</span>
|
|
798
|
+
<span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_on_event'>on_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Target.targetInfoChanged</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:handle_target_info_changed</span><span class='rparen'>)</span>
|
|
799
|
+
<span class='kw'>end</span></pre>
|
|
800
|
+
</td>
|
|
801
|
+
</tr>
|
|
802
|
+
</table>
|
|
803
|
+
</div>
|
|
804
|
+
|
|
805
|
+
</div>
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
<div id="class_method_details" class="method_details_list">
|
|
809
|
+
<h2>Class Method Details</h2>
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
<div class="method_details first">
|
|
813
|
+
<h3 class="signature first" id="create-class_method">
|
|
814
|
+
|
|
815
|
+
.<strong>create</strong>(connection:, context_ids:, ignore_https_errors:, default_viewport:, process:, close_callback:) ⇒ <tt>Object</tt>
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
</h3><div class="docstring">
|
|
822
|
+
<div class="discussion">
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
</div>
|
|
826
|
+
</div>
|
|
827
|
+
<div class="tags">
|
|
828
|
+
<p class="tag_title">Parameters:</p>
|
|
829
|
+
<ul class="param">
|
|
830
|
+
|
|
831
|
+
<li>
|
|
832
|
+
|
|
833
|
+
<span class='name'>connection</span>
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
<span class='type'>(<tt>!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Connection.html" title="Puppeteer::Connection (class)">Connection</a></span></tt>)</span>
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
</li>
|
|
841
|
+
|
|
842
|
+
<li>
|
|
843
|
+
|
|
844
|
+
<span class='name'>contextIds</span>
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
<span class='type'>(<tt>!Array<string></tt>)</span>
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
</li>
|
|
852
|
+
|
|
853
|
+
<li>
|
|
854
|
+
|
|
855
|
+
<span class='name'>ignoreHTTPSErrors</span>
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
<span class='type'>(<tt>boolean</tt>)</span>
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
</li>
|
|
863
|
+
|
|
864
|
+
<li>
|
|
865
|
+
|
|
866
|
+
<span class='name'>defaultViewport</span>
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
<span class='type'>(<tt>?<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Viewport.html" title="Puppeteer::Viewport (class)">Viewport</a></span></tt>)</span>
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
</li>
|
|
874
|
+
|
|
875
|
+
<li>
|
|
876
|
+
|
|
877
|
+
<span class='name'>process</span>
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
<span class='type'>(<tt><span class='object_link'><a href="BrowserRunner/BrowserProcess.html" title="Puppeteer::BrowserRunner::BrowserProcess (class)">Puppeteer::BrowserRunner::BrowserProcess</a></span>|NilClass</tt>)</span>
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
</li>
|
|
885
|
+
|
|
886
|
+
<li>
|
|
887
|
+
|
|
888
|
+
<span class='name'>closeCallback</span>
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
<span class='type'>(<tt>function()=</tt>)</span>
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
</li>
|
|
896
|
+
|
|
897
|
+
</ul>
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
</div><table class="source_code">
|
|
901
|
+
<tr>
|
|
902
|
+
<td>
|
|
903
|
+
<pre class="lines">
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
16
|
|
907
|
+
17
|
|
908
|
+
18
|
|
909
|
+
19
|
|
910
|
+
20
|
|
911
|
+
21
|
|
912
|
+
22
|
|
913
|
+
23
|
|
914
|
+
24
|
|
915
|
+
25
|
|
916
|
+
26
|
|
917
|
+
27</pre>
|
|
918
|
+
</td>
|
|
919
|
+
<td>
|
|
920
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 16</span>
|
|
921
|
+
|
|
922
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='label'>connection:</span><span class='comma'>,</span> <span class='label'>context_ids:</span><span class='comma'>,</span> <span class='label'>ignore_https_errors:</span><span class='comma'>,</span> <span class='label'>default_viewport:</span><span class='comma'>,</span> <span class='label'>process:</span><span class='comma'>,</span> <span class='label'>close_callback:</span><span class='rparen'>)</span>
|
|
923
|
+
<span class='id identifier rubyid_browser'>browser</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Puppeteer::Browser (class)">Browser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Puppeteer::Browser#initialize (method)">new</a></span></span><span class='lparen'>(</span>
|
|
924
|
+
<span class='label'>connection:</span> <span class='id identifier rubyid_connection'>connection</span><span class='comma'>,</span>
|
|
925
|
+
<span class='label'>context_ids:</span> <span class='id identifier rubyid_context_ids'>context_ids</span><span class='comma'>,</span>
|
|
926
|
+
<span class='label'>ignore_https_errors:</span> <span class='id identifier rubyid_ignore_https_errors'>ignore_https_errors</span><span class='comma'>,</span>
|
|
927
|
+
<span class='label'>default_viewport:</span> <span class='id identifier rubyid_default_viewport'>default_viewport</span><span class='comma'>,</span>
|
|
928
|
+
<span class='label'>process:</span> <span class='id identifier rubyid_process'>process</span><span class='comma'>,</span>
|
|
929
|
+
<span class='label'>close_callback:</span> <span class='id identifier rubyid_close_callback'>close_callback</span><span class='comma'>,</span>
|
|
930
|
+
<span class='rparen'>)</span>
|
|
931
|
+
<span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_send_message'>send_message</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Target.setDiscoverTargets</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>discover:</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
|
932
|
+
<span class='id identifier rubyid_browser'>browser</span>
|
|
933
|
+
<span class='kw'>end</span></pre>
|
|
934
|
+
</td>
|
|
935
|
+
</tr>
|
|
936
|
+
</table>
|
|
937
|
+
</div>
|
|
938
|
+
|
|
939
|
+
</div>
|
|
940
|
+
|
|
941
|
+
<div id="instance_method_details" class="method_details_list">
|
|
942
|
+
<h2>Instance Method Details</h2>
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
<div class="method_details first">
|
|
946
|
+
<h3 class="signature first" id="browser_contexts-instance_method">
|
|
947
|
+
|
|
948
|
+
#<strong>browser_contexts</strong> ⇒ <tt>Object</tt>
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
</h3><table class="source_code">
|
|
955
|
+
<tr>
|
|
956
|
+
<td>
|
|
957
|
+
<pre class="lines">
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
69
|
|
961
|
+
70
|
|
962
|
+
71</pre>
|
|
963
|
+
</td>
|
|
964
|
+
<td>
|
|
965
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 69</span>
|
|
966
|
+
|
|
967
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_browser_contexts'>browser_contexts</span>
|
|
968
|
+
<span class='lbracket'>[</span><span class='ivar'>@default_context</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_concat'>concat</span><span class='lparen'>(</span><span class='ivar'>@contexts</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='rparen'>)</span>
|
|
969
|
+
<span class='kw'>end</span></pre>
|
|
970
|
+
</td>
|
|
971
|
+
</tr>
|
|
972
|
+
</table>
|
|
973
|
+
</div>
|
|
974
|
+
|
|
975
|
+
<div class="method_details ">
|
|
976
|
+
<h3 class="signature " id="close-instance_method">
|
|
977
|
+
|
|
978
|
+
#<strong>close</strong> ⇒ <tt>Object</tt>
|
|
979
|
+
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
</h3><table class="source_code">
|
|
985
|
+
<tr>
|
|
986
|
+
<td>
|
|
987
|
+
<pre class="lines">
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
244
|
|
991
|
+
245
|
|
992
|
+
246
|
|
993
|
+
247</pre>
|
|
994
|
+
</td>
|
|
995
|
+
<td>
|
|
996
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 244</span>
|
|
997
|
+
|
|
998
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
|
|
999
|
+
<span class='ivar'>@close_callback</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
|
|
1000
|
+
<span class='id identifier rubyid_disconnect'>disconnect</span>
|
|
1001
|
+
<span class='kw'>end</span></pre>
|
|
1002
|
+
</td>
|
|
1003
|
+
</tr>
|
|
1004
|
+
</table>
|
|
1005
|
+
</div>
|
|
1006
|
+
|
|
1007
|
+
<div class="method_details ">
|
|
1008
|
+
<h3 class="signature " id="connected?-instance_method">
|
|
1009
|
+
|
|
1010
|
+
#<strong>connected?</strong> ⇒ <tt>Boolean</tt>
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
|
|
1016
|
+
</h3><div class="docstring">
|
|
1017
|
+
<div class="discussion">
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
</div>
|
|
1021
|
+
</div>
|
|
1022
|
+
<div class="tags">
|
|
1023
|
+
|
|
1024
|
+
<p class="tag_title">Returns:</p>
|
|
1025
|
+
<ul class="return">
|
|
1026
|
+
|
|
1027
|
+
<li>
|
|
1028
|
+
|
|
1029
|
+
|
|
1030
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
</li>
|
|
1035
|
+
|
|
1036
|
+
</ul>
|
|
1037
|
+
|
|
1038
|
+
</div><table class="source_code">
|
|
1039
|
+
<tr>
|
|
1040
|
+
<td>
|
|
1041
|
+
<pre class="lines">
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
253
|
|
1045
|
+
254
|
|
1046
|
+
255</pre>
|
|
1047
|
+
</td>
|
|
1048
|
+
<td>
|
|
1049
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 253</span>
|
|
1050
|
+
|
|
1051
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_connected?'>connected?</span>
|
|
1052
|
+
<span class='op'>!</span><span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_closed?'>closed?</span>
|
|
1053
|
+
<span class='kw'>end</span></pre>
|
|
1054
|
+
</td>
|
|
1055
|
+
</tr>
|
|
1056
|
+
</table>
|
|
1057
|
+
</div>
|
|
1058
|
+
|
|
1059
|
+
<div class="method_details ">
|
|
1060
|
+
<h3 class="signature " id="create_incognito_browser_context-instance_method">
|
|
1061
|
+
|
|
1062
|
+
#<strong>create_incognito_browser_context</strong> ⇒ <tt><span class='object_link'><a href="BrowserContext.html" title="Puppeteer::BrowserContext (class)">Puppeteer::BrowserContext</a></span></tt>
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
</h3><div class="docstring">
|
|
1069
|
+
<div class="discussion">
|
|
1070
|
+
|
|
1071
|
+
|
|
1072
|
+
</div>
|
|
1073
|
+
</div>
|
|
1074
|
+
<div class="tags">
|
|
1075
|
+
|
|
1076
|
+
<p class="tag_title">Returns:</p>
|
|
1077
|
+
<ul class="return">
|
|
1078
|
+
|
|
1079
|
+
<li>
|
|
1080
|
+
|
|
1081
|
+
|
|
1082
|
+
<span class='type'>(<tt><span class='object_link'><a href="BrowserContext.html" title="Puppeteer::BrowserContext (class)">Puppeteer::BrowserContext</a></span></tt>)</span>
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
|
|
1086
|
+
</li>
|
|
1087
|
+
|
|
1088
|
+
</ul>
|
|
1089
|
+
|
|
1090
|
+
</div><table class="source_code">
|
|
1091
|
+
<tr>
|
|
1092
|
+
<td>
|
|
1093
|
+
<pre class="lines">
|
|
1094
|
+
|
|
1095
|
+
|
|
1096
|
+
63
|
|
1097
|
+
64
|
|
1098
|
+
65
|
|
1099
|
+
66
|
|
1100
|
+
67</pre>
|
|
1101
|
+
</td>
|
|
1102
|
+
<td>
|
|
1103
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 63</span>
|
|
1104
|
+
|
|
1105
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_create_incognito_browser_context'>create_incognito_browser_context</span>
|
|
1106
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_send_message'>send_message</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Target.createBrowserContext</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
1107
|
+
<span class='id identifier rubyid_browser_context_id'>browser_context_id</span> <span class='op'>=</span> <span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>browserContextId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
|
1108
|
+
<span class='ivar'>@contexts</span><span class='lbracket'>[</span><span class='id identifier rubyid_browser_context_id'>browser_context_id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="BrowserContext.html" title="Puppeteer::BrowserContext (class)">BrowserContext</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="BrowserContext.html#initialize-instance_method" title="Puppeteer::BrowserContext#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@connection</span><span class='comma'>,</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_browser_context_id'>browser_context_id</span><span class='rparen'>)</span>
|
|
1109
|
+
<span class='kw'>end</span></pre>
|
|
1110
|
+
</td>
|
|
1111
|
+
</tr>
|
|
1112
|
+
</table>
|
|
1113
|
+
</div>
|
|
1114
|
+
|
|
1115
|
+
<div class="method_details ">
|
|
1116
|
+
<h3 class="signature " id="create_page_in_context-instance_method">
|
|
1117
|
+
|
|
1118
|
+
#<strong>create_page_in_context</strong>(context_id) ⇒ <tt>!Promise<!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Page.html" title="Puppeteer::Page (class)">Page</a></span>></tt>
|
|
1119
|
+
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
</h3><div class="docstring">
|
|
1125
|
+
<div class="discussion">
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
</div>
|
|
1129
|
+
</div>
|
|
1130
|
+
<div class="tags">
|
|
1131
|
+
<p class="tag_title">Parameters:</p>
|
|
1132
|
+
<ul class="param">
|
|
1133
|
+
|
|
1134
|
+
<li>
|
|
1135
|
+
|
|
1136
|
+
<span class='name'>contextId</span>
|
|
1137
|
+
|
|
1138
|
+
|
|
1139
|
+
<span class='type'>(<tt>?string</tt>)</span>
|
|
1140
|
+
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
</li>
|
|
1144
|
+
|
|
1145
|
+
</ul>
|
|
1146
|
+
|
|
1147
|
+
<p class="tag_title">Returns:</p>
|
|
1148
|
+
<ul class="return">
|
|
1149
|
+
|
|
1150
|
+
<li>
|
|
1151
|
+
|
|
1152
|
+
|
|
1153
|
+
<span class='type'>(<tt>!Promise<!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Page.html" title="Puppeteer::Page (class)">Page</a></span>></tt>)</span>
|
|
1154
|
+
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
</li>
|
|
1158
|
+
|
|
1159
|
+
</ul>
|
|
1160
|
+
|
|
1161
|
+
</div><table class="source_code">
|
|
1162
|
+
<tr>
|
|
1163
|
+
<td>
|
|
1164
|
+
<pre class="lines">
|
|
1165
|
+
|
|
1166
|
+
|
|
1167
|
+
172
|
|
1168
|
+
173
|
|
1169
|
+
174
|
|
1170
|
+
175
|
|
1171
|
+
176
|
|
1172
|
+
177
|
|
1173
|
+
178
|
|
1174
|
+
179
|
|
1175
|
+
180
|
|
1176
|
+
181
|
|
1177
|
+
182</pre>
|
|
1178
|
+
</td>
|
|
1179
|
+
<td>
|
|
1180
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 172</span>
|
|
1181
|
+
|
|
1182
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_create_page_in_context'>create_page_in_context</span><span class='lparen'>(</span><span class='id identifier rubyid_context_id'>context_id</span><span class='rparen'>)</span>
|
|
1183
|
+
<span class='id identifier rubyid_create_target_params'>create_target_params</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>url:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>about:blank</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span>
|
|
1184
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_context_id'>context_id</span>
|
|
1185
|
+
<span class='id identifier rubyid_create_target_params'>create_target_params</span><span class='lbracket'>[</span><span class='symbol'>:browserContextId</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_context_id'>context_id</span>
|
|
1186
|
+
<span class='kw'>end</span>
|
|
1187
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_send_message'>send_message</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Target.createTarget</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_create_target_params'>create_target_params</span><span class='rparen'>)</span>
|
|
1188
|
+
<span class='id identifier rubyid_target_id'>target_id</span> <span class='op'>=</span> <span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>targetId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
|
1189
|
+
<span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='ivar'>@targets</span><span class='lbracket'>[</span><span class='id identifier rubyid_target_id'>target_id</span><span class='rbracket'>]</span>
|
|
1190
|
+
<span class='id identifier rubyid_await'><span class='object_link'><a href="ConcurrentRubyUtils.html#await-instance_method" title="Puppeteer::ConcurrentRubyUtils#await (method)">await</a></span></span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_initialized_promise'>initialized_promise</span>
|
|
1191
|
+
<span class='id identifier rubyid_await'><span class='object_link'><a href="ConcurrentRubyUtils.html#await-instance_method" title="Puppeteer::ConcurrentRubyUtils#await (method)">await</a></span></span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_page'>page</span>
|
|
1192
|
+
<span class='kw'>end</span></pre>
|
|
1193
|
+
</td>
|
|
1194
|
+
</tr>
|
|
1195
|
+
</table>
|
|
1196
|
+
</div>
|
|
1197
|
+
|
|
1198
|
+
<div class="method_details ">
|
|
1199
|
+
<h3 class="signature " id="default_browser_context-instance_method">
|
|
1200
|
+
|
|
1201
|
+
#<strong>default_browser_context</strong> ⇒ <tt><span class='object_link'><a href="BrowserContext.html" title="Puppeteer::BrowserContext (class)">Puppeteer::BrowserContext</a></span></tt>
|
|
1202
|
+
|
|
1203
|
+
|
|
1204
|
+
|
|
1205
|
+
|
|
1206
|
+
|
|
1207
|
+
</h3><div class="docstring">
|
|
1208
|
+
<div class="discussion">
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
</div>
|
|
1212
|
+
</div>
|
|
1213
|
+
<div class="tags">
|
|
1214
|
+
|
|
1215
|
+
<p class="tag_title">Returns:</p>
|
|
1216
|
+
<ul class="return">
|
|
1217
|
+
|
|
1218
|
+
<li>
|
|
1219
|
+
|
|
1220
|
+
|
|
1221
|
+
<span class='type'>(<tt><span class='object_link'><a href="BrowserContext.html" title="Puppeteer::BrowserContext (class)">Puppeteer::BrowserContext</a></span></tt>)</span>
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
|
|
1225
|
+
</li>
|
|
1226
|
+
|
|
1227
|
+
</ul>
|
|
1228
|
+
|
|
1229
|
+
</div><table class="source_code">
|
|
1230
|
+
<tr>
|
|
1231
|
+
<td>
|
|
1232
|
+
<pre class="lines">
|
|
1233
|
+
|
|
1234
|
+
|
|
1235
|
+
74
|
|
1236
|
+
75
|
|
1237
|
+
76</pre>
|
|
1238
|
+
</td>
|
|
1239
|
+
<td>
|
|
1240
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 74</span>
|
|
1241
|
+
|
|
1242
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_default_browser_context'>default_browser_context</span>
|
|
1243
|
+
<span class='ivar'>@default_context</span>
|
|
1244
|
+
<span class='kw'>end</span></pre>
|
|
1245
|
+
</td>
|
|
1246
|
+
</tr>
|
|
1247
|
+
</table>
|
|
1248
|
+
</div>
|
|
1249
|
+
|
|
1250
|
+
<div class="method_details ">
|
|
1251
|
+
<h3 class="signature " id="disconnect-instance_method">
|
|
1252
|
+
|
|
1253
|
+
#<strong>disconnect</strong> ⇒ <tt>Object</tt>
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
|
|
1258
|
+
|
|
1259
|
+
</h3><table class="source_code">
|
|
1260
|
+
<tr>
|
|
1261
|
+
<td>
|
|
1262
|
+
<pre class="lines">
|
|
1263
|
+
|
|
1264
|
+
|
|
1265
|
+
249
|
|
1266
|
+
250
|
|
1267
|
+
251</pre>
|
|
1268
|
+
</td>
|
|
1269
|
+
<td>
|
|
1270
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 249</span>
|
|
1271
|
+
|
|
1272
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_disconnect'>disconnect</span>
|
|
1273
|
+
<span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_dispose'>dispose</span>
|
|
1274
|
+
<span class='kw'>end</span></pre>
|
|
1275
|
+
</td>
|
|
1276
|
+
</tr>
|
|
1277
|
+
</table>
|
|
1278
|
+
</div>
|
|
1279
|
+
|
|
1280
|
+
<div class="method_details ">
|
|
1281
|
+
<h3 class="signature " id="dispose_context-instance_method">
|
|
1282
|
+
|
|
1283
|
+
#<strong>dispose_context</strong>(context_id) ⇒ <tt>Object</tt>
|
|
1284
|
+
|
|
1285
|
+
|
|
1286
|
+
|
|
1287
|
+
|
|
1288
|
+
|
|
1289
|
+
</h3><div class="docstring">
|
|
1290
|
+
<div class="discussion">
|
|
1291
|
+
|
|
1292
|
+
|
|
1293
|
+
</div>
|
|
1294
|
+
</div>
|
|
1295
|
+
<div class="tags">
|
|
1296
|
+
<p class="tag_title">Parameters:</p>
|
|
1297
|
+
<ul class="param">
|
|
1298
|
+
|
|
1299
|
+
<li>
|
|
1300
|
+
|
|
1301
|
+
<span class='name'>context_id</span>
|
|
1302
|
+
|
|
1303
|
+
|
|
1304
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
1305
|
+
|
|
1306
|
+
|
|
1307
|
+
|
|
1308
|
+
</li>
|
|
1309
|
+
|
|
1310
|
+
</ul>
|
|
1311
|
+
|
|
1312
|
+
|
|
1313
|
+
</div><table class="source_code">
|
|
1314
|
+
<tr>
|
|
1315
|
+
<td>
|
|
1316
|
+
<pre class="lines">
|
|
1317
|
+
|
|
1318
|
+
|
|
1319
|
+
79
|
|
1320
|
+
80
|
|
1321
|
+
81
|
|
1322
|
+
82</pre>
|
|
1323
|
+
</td>
|
|
1324
|
+
<td>
|
|
1325
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 79</span>
|
|
1326
|
+
|
|
1327
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_dispose_context'>dispose_context</span><span class='lparen'>(</span><span class='id identifier rubyid_context_id'>context_id</span><span class='rparen'>)</span>
|
|
1328
|
+
<span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_send_message'>send_message</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Target.disposeBrowserContext</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>browserContextId:</span> <span class='id identifier rubyid_context_id'>context_id</span><span class='rparen'>)</span>
|
|
1329
|
+
<span class='ivar'>@contexts</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span><span class='id identifier rubyid_context_id'>context_id</span><span class='rparen'>)</span>
|
|
1330
|
+
<span class='kw'>end</span></pre>
|
|
1331
|
+
</td>
|
|
1332
|
+
</tr>
|
|
1333
|
+
</table>
|
|
1334
|
+
</div>
|
|
1335
|
+
|
|
1336
|
+
<div class="method_details ">
|
|
1337
|
+
<h3 class="signature " id="handle_target_created-instance_method">
|
|
1338
|
+
|
|
1339
|
+
#<strong>handle_target_created</strong>(event) ⇒ <tt>Object</tt>
|
|
1340
|
+
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
|
|
1344
|
+
|
|
1345
|
+
</h3><div class="docstring">
|
|
1346
|
+
<div class="discussion">
|
|
1347
|
+
|
|
1348
|
+
|
|
1349
|
+
</div>
|
|
1350
|
+
</div>
|
|
1351
|
+
<div class="tags">
|
|
1352
|
+
<p class="tag_title">Parameters:</p>
|
|
1353
|
+
<ul class="param">
|
|
1354
|
+
|
|
1355
|
+
<li>
|
|
1356
|
+
|
|
1357
|
+
<span class='name'>event</span>
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
<span class='type'>(<tt>!Protocol.<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span>.targetCreatedPayload</tt>)</span>
|
|
1361
|
+
|
|
1362
|
+
|
|
1363
|
+
|
|
1364
|
+
</li>
|
|
1365
|
+
|
|
1366
|
+
</ul>
|
|
1367
|
+
|
|
1368
|
+
|
|
1369
|
+
</div><table class="source_code">
|
|
1370
|
+
<tr>
|
|
1371
|
+
<td>
|
|
1372
|
+
<pre class="lines">
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
85
|
|
1376
|
+
86
|
|
1377
|
+
87
|
|
1378
|
+
88
|
|
1379
|
+
89
|
|
1380
|
+
90
|
|
1381
|
+
91
|
|
1382
|
+
92
|
|
1383
|
+
93
|
|
1384
|
+
94
|
|
1385
|
+
95
|
|
1386
|
+
96
|
|
1387
|
+
97
|
|
1388
|
+
98
|
|
1389
|
+
99
|
|
1390
|
+
100
|
|
1391
|
+
101
|
|
1392
|
+
102
|
|
1393
|
+
103
|
|
1394
|
+
104
|
|
1395
|
+
105
|
|
1396
|
+
106
|
|
1397
|
+
107
|
|
1398
|
+
108
|
|
1399
|
+
109
|
|
1400
|
+
110
|
|
1401
|
+
111
|
|
1402
|
+
112
|
|
1403
|
+
113
|
|
1404
|
+
114</pre>
|
|
1405
|
+
</td>
|
|
1406
|
+
<td>
|
|
1407
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 85</span>
|
|
1408
|
+
|
|
1409
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_handle_target_created'>handle_target_created</span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='rparen'>)</span>
|
|
1410
|
+
<span class='id identifier rubyid_target_info'>target_info</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Target/TargetInfo.html" title="Puppeteer::Target::TargetInfo (class)">TargetInfo</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Target/TargetInfo.html#initialize-instance_method" title="Puppeteer::Target::TargetInfo#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>targetInfo</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
1411
|
+
<span class='id identifier rubyid_browser_context_id'>browser_context_id</span> <span class='op'>=</span> <span class='id identifier rubyid_target_info'>target_info</span><span class='period'>.</span><span class='id identifier rubyid_browser_context_id'>browser_context_id</span>
|
|
1412
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span>
|
|
1413
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_browser_context_id'>browser_context_id</span> <span class='op'>&&</span> <span class='ivar'>@contexts</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_browser_context_id'>browser_context_id</span><span class='rparen'>)</span>
|
|
1414
|
+
<span class='ivar'>@contexts</span><span class='lbracket'>[</span><span class='id identifier rubyid_browser_context_id'>browser_context_id</span><span class='rbracket'>]</span>
|
|
1415
|
+
<span class='kw'>else</span>
|
|
1416
|
+
<span class='ivar'>@default_context</span>
|
|
1417
|
+
<span class='kw'>end</span>
|
|
1418
|
+
|
|
1419
|
+
<span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Target.html#initialize-instance_method" title="Puppeteer::Target#initialize (method)">new</a></span></span><span class='lparen'>(</span>
|
|
1420
|
+
<span class='label'>target_info:</span> <span class='id identifier rubyid_target_info'>target_info</span><span class='comma'>,</span>
|
|
1421
|
+
<span class='label'>browser_context:</span> <span class='id identifier rubyid_context'>context</span><span class='comma'>,</span>
|
|
1422
|
+
<span class='label'>session_factory:</span> <span class='tlambda'>-></span> <span class='tlambeg'>{</span> <span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_create_session'>create_session</span><span class='lparen'>(</span><span class='id identifier rubyid_target_info'>target_info</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span>
|
|
1423
|
+
<span class='label'>ignore_https_errors:</span> <span class='ivar'>@ignore_https_errors</span><span class='comma'>,</span>
|
|
1424
|
+
<span class='label'>default_viewport:</span> <span class='ivar'>@default_viewport</span><span class='comma'>,</span>
|
|
1425
|
+
<span class='label'>screenshot_task_queue:</span> <span class='ivar'>@screenshot_task_queue</span><span class='comma'>,</span>
|
|
1426
|
+
<span class='rparen'>)</span>
|
|
1427
|
+
<span class='comment'># assert(!this._targets.has(event.targetInfo.targetId), 'Target should not exist before targetCreated');
|
|
1428
|
+
</span> <span class='ivar'>@targets</span><span class='lbracket'>[</span><span class='id identifier rubyid_target_info'>target_info</span><span class='period'>.</span><span class='id identifier rubyid_target_id'>target_id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_target'>target</span>
|
|
1429
|
+
|
|
1430
|
+
<span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_on_initialize_succeeded'>on_initialize_succeeded</span> <span class='kw'>do</span>
|
|
1431
|
+
<span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.Browser.TargetCreated</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span>
|
|
1432
|
+
<span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.BrowserContext.TargetCreated</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span>
|
|
1433
|
+
<span class='kw'>end</span>
|
|
1434
|
+
|
|
1435
|
+
<span class='id identifier rubyid_if_present'>if_present</span><span class='lparen'>(</span><span class='id identifier rubyid_pending_target_info_changed_event'>pending_target_info_changed_event</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_target_info'>target_info</span><span class='period'>.</span><span class='id identifier rubyid_target_id'>target_id</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_pending_event'>pending_event</span><span class='op'>|</span>
|
|
1436
|
+
<span class='id identifier rubyid_handle_target_info_changed'>handle_target_info_changed</span><span class='lparen'>(</span><span class='id identifier rubyid_pending_event'>pending_event</span><span class='rparen'>)</span>
|
|
1437
|
+
<span class='kw'>end</span>
|
|
1438
|
+
<span class='kw'>end</span></pre>
|
|
1439
|
+
</td>
|
|
1440
|
+
</tr>
|
|
1441
|
+
</table>
|
|
1442
|
+
</div>
|
|
1443
|
+
|
|
1444
|
+
<div class="method_details ">
|
|
1445
|
+
<h3 class="signature " id="handle_target_destroyed-instance_method">
|
|
1446
|
+
|
|
1447
|
+
#<strong>handle_target_destroyed</strong>(event) ⇒ <tt>Object</tt>
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
|
|
1451
|
+
|
|
1452
|
+
|
|
1453
|
+
</h3><div class="docstring">
|
|
1454
|
+
<div class="discussion">
|
|
1455
|
+
|
|
1456
|
+
|
|
1457
|
+
</div>
|
|
1458
|
+
</div>
|
|
1459
|
+
<div class="tags">
|
|
1460
|
+
<p class="tag_title">Parameters:</p>
|
|
1461
|
+
<ul class="param">
|
|
1462
|
+
|
|
1463
|
+
<li>
|
|
1464
|
+
|
|
1465
|
+
<span class='name'>event</span>
|
|
1466
|
+
|
|
1467
|
+
|
|
1468
|
+
<span class='type'>(<tt>{targetId: string}</tt>)</span>
|
|
1469
|
+
|
|
1470
|
+
|
|
1471
|
+
|
|
1472
|
+
</li>
|
|
1473
|
+
|
|
1474
|
+
</ul>
|
|
1475
|
+
|
|
1476
|
+
|
|
1477
|
+
</div><table class="source_code">
|
|
1478
|
+
<tr>
|
|
1479
|
+
<td>
|
|
1480
|
+
<pre class="lines">
|
|
1481
|
+
|
|
1482
|
+
|
|
1483
|
+
118
|
|
1484
|
+
119
|
|
1485
|
+
120
|
|
1486
|
+
121
|
|
1487
|
+
122
|
|
1488
|
+
123
|
|
1489
|
+
124
|
|
1490
|
+
125
|
|
1491
|
+
126
|
|
1492
|
+
127
|
|
1493
|
+
128</pre>
|
|
1494
|
+
</td>
|
|
1495
|
+
<td>
|
|
1496
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 118</span>
|
|
1497
|
+
|
|
1498
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_handle_target_destroyed'>handle_target_destroyed</span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='rparen'>)</span>
|
|
1499
|
+
<span class='id identifier rubyid_target_id'>target_id</span> <span class='op'>=</span> <span class='id identifier rubyid_event'>event</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>targetId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
|
1500
|
+
<span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='ivar'>@targets</span><span class='lbracket'>[</span><span class='id identifier rubyid_target_id'>target_id</span><span class='rbracket'>]</span>
|
|
1501
|
+
<span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_handle_initialized'>handle_initialized</span><span class='lparen'>(</span><span class='kw'>false</span><span class='rparen'>)</span>
|
|
1502
|
+
<span class='ivar'>@targets</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_target_id'>target_id</span><span class='rparen'>)</span>
|
|
1503
|
+
<span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_handle_closed'>handle_closed</span>
|
|
1504
|
+
<span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_on_initialize_succeeded'>on_initialize_succeeded</span> <span class='kw'>do</span>
|
|
1505
|
+
<span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.Browser.TargetDestroyed</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span>
|
|
1506
|
+
<span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_browser_context'>browser_context</span><span class='period'>.</span><span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.BrowserContext.TargetDestroyed</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span>
|
|
1507
|
+
<span class='kw'>end</span>
|
|
1508
|
+
<span class='kw'>end</span></pre>
|
|
1509
|
+
</td>
|
|
1510
|
+
</tr>
|
|
1511
|
+
</table>
|
|
1512
|
+
</div>
|
|
1513
|
+
|
|
1514
|
+
<div class="method_details ">
|
|
1515
|
+
<h3 class="signature " id="handle_target_info_changed-instance_method">
|
|
1516
|
+
|
|
1517
|
+
#<strong>handle_target_info_changed</strong>(event) ⇒ <tt>Object</tt>
|
|
1518
|
+
|
|
1519
|
+
|
|
1520
|
+
|
|
1521
|
+
|
|
1522
|
+
|
|
1523
|
+
</h3><div class="docstring">
|
|
1524
|
+
<div class="discussion">
|
|
1525
|
+
|
|
1526
|
+
|
|
1527
|
+
</div>
|
|
1528
|
+
</div>
|
|
1529
|
+
<div class="tags">
|
|
1530
|
+
<p class="tag_title">Parameters:</p>
|
|
1531
|
+
<ul class="param">
|
|
1532
|
+
|
|
1533
|
+
<li>
|
|
1534
|
+
|
|
1535
|
+
<span class='name'>event</span>
|
|
1536
|
+
|
|
1537
|
+
|
|
1538
|
+
<span class='type'>(<tt>!Protocol.<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span>.targetInfoChangedPayload</tt>)</span>
|
|
1539
|
+
|
|
1540
|
+
|
|
1541
|
+
|
|
1542
|
+
</li>
|
|
1543
|
+
|
|
1544
|
+
</ul>
|
|
1545
|
+
|
|
1546
|
+
|
|
1547
|
+
</div><table class="source_code">
|
|
1548
|
+
<tr>
|
|
1549
|
+
<td>
|
|
1550
|
+
<pre class="lines">
|
|
1551
|
+
|
|
1552
|
+
|
|
1553
|
+
131
|
|
1554
|
+
132
|
|
1555
|
+
133
|
|
1556
|
+
134
|
|
1557
|
+
135
|
|
1558
|
+
136
|
|
1559
|
+
137
|
|
1560
|
+
138
|
|
1561
|
+
139
|
|
1562
|
+
140
|
|
1563
|
+
141
|
|
1564
|
+
142
|
|
1565
|
+
143
|
|
1566
|
+
144
|
|
1567
|
+
145
|
|
1568
|
+
146
|
|
1569
|
+
147
|
|
1570
|
+
148
|
|
1571
|
+
149
|
|
1572
|
+
150
|
|
1573
|
+
151
|
|
1574
|
+
152
|
|
1575
|
+
153
|
|
1576
|
+
154
|
|
1577
|
+
155</pre>
|
|
1578
|
+
</td>
|
|
1579
|
+
<td>
|
|
1580
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 131</span>
|
|
1581
|
+
|
|
1582
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_handle_target_info_changed'>handle_target_info_changed</span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='rparen'>)</span>
|
|
1583
|
+
<span class='id identifier rubyid_target_info'>target_info</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Target/TargetInfo.html" title="Puppeteer::Target::TargetInfo (class)">TargetInfo</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Target/TargetInfo.html#initialize-instance_method" title="Puppeteer::Target::TargetInfo#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>targetInfo</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
1584
|
+
<span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='ivar'>@targets</span><span class='lbracket'>[</span><span class='id identifier rubyid_target_info'>target_info</span><span class='period'>.</span><span class='id identifier rubyid_target_id'>target_id</span><span class='rbracket'>]</span>
|
|
1585
|
+
<span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_target'>target</span>
|
|
1586
|
+
<span class='comment'># targetCreated is sometimes notified after targetInfoChanged.
|
|
1587
|
+
</span> <span class='comment'># We don't raise error. Instead, keep the event as a pending change,
|
|
1588
|
+
</span> <span class='comment'># and handle it on handle_target_created.
|
|
1589
|
+
</span> <span class='comment'>#
|
|
1590
|
+
</span> <span class='comment'># D, [2020-04-22T00:22:26.630328 #79646] DEBUG -- : RECV << {"method"=>"Target.targetInfoChanged", "params"=>{"targetInfo"=>{"targetId"=>"8068CED48357B9557EEC85AA62165A8E", "type"=>"iframe", "title"=>"", "url"=>"", "attached"=>true, "browserContextId"=>"7895BFB24BF22CE40584808713D96E8D"}}}
|
|
1591
|
+
</span> <span class='comment'># E, [2020-04-22T00:22:26.630448 #79646] ERROR -- : target should exist before targetInfoChanged (StandardError)
|
|
1592
|
+
</span> <span class='comment'># D, [2020-04-22T00:22:26.630648 #79646] DEBUG -- : RECV << {"method"=>"Target.targetCreated", "params"=>{"targetInfo"=>{"targetId"=>"8068CED48357B9557EEC85AA62165A8E", "type"=>"iframe", "title"=>"", "url"=>"", "attached"=>false, "browserContextId"=>"7895BFB24BF22CE40584808713D96E8D"}}}
|
|
1593
|
+
</span> <span class='id identifier rubyid_pending_target_info_changed_event'>pending_target_info_changed_event</span><span class='lbracket'>[</span><span class='id identifier rubyid_target_info'>target_info</span><span class='period'>.</span><span class='id identifier rubyid_target_id'>target_id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_event'>event</span>
|
|
1594
|
+
<span class='kw'>return</span>
|
|
1595
|
+
<span class='comment'># original implementation is:
|
|
1596
|
+
</span> <span class='comment'>#
|
|
1597
|
+
</span> <span class='comment'># raise StandardError.new('target should exist before targetInfoChanged')
|
|
1598
|
+
</span> <span class='kw'>end</span>
|
|
1599
|
+
<span class='id identifier rubyid_previous_url'>previous_url</span> <span class='op'>=</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_url'>url</span>
|
|
1600
|
+
<span class='id identifier rubyid_was_initialized'>was_initialized</span> <span class='op'>=</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_initialized?'>initialized?</span>
|
|
1601
|
+
<span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_handle_target_info_changed'>handle_target_info_changed</span><span class='lparen'>(</span><span class='id identifier rubyid_target_info'>target_info</span><span class='rparen'>)</span>
|
|
1602
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_was_initialized'>was_initialized</span> <span class='op'>&&</span> <span class='id identifier rubyid_previous_url'>previous_url</span> <span class='op'>!=</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_url'>url</span>
|
|
1603
|
+
<span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.Browser.TargetChanged</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span>
|
|
1604
|
+
<span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_browser_context'>browser_context</span><span class='period'>.</span><span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.BrowserContext.TargetChanged</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span>
|
|
1605
|
+
<span class='kw'>end</span>
|
|
1606
|
+
<span class='kw'>end</span></pre>
|
|
1607
|
+
</td>
|
|
1608
|
+
</tr>
|
|
1609
|
+
</table>
|
|
1610
|
+
</div>
|
|
1611
|
+
|
|
1612
|
+
<div class="method_details ">
|
|
1613
|
+
<h3 class="signature " id="new_page-instance_method">
|
|
1614
|
+
|
|
1615
|
+
#<strong>new_page</strong> ⇒ <tt>Object</tt>
|
|
1616
|
+
|
|
1617
|
+
|
|
1618
|
+
|
|
1619
|
+
|
|
1620
|
+
|
|
1621
|
+
</h3><table class="source_code">
|
|
1622
|
+
<tr>
|
|
1623
|
+
<td>
|
|
1624
|
+
<pre class="lines">
|
|
1625
|
+
|
|
1626
|
+
|
|
1627
|
+
166
|
|
1628
|
+
167
|
|
1629
|
+
168</pre>
|
|
1630
|
+
</td>
|
|
1631
|
+
<td>
|
|
1632
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 166</span>
|
|
1633
|
+
|
|
1634
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_new_page'>new_page</span>
|
|
1635
|
+
<span class='ivar'>@default_context</span><span class='period'>.</span><span class='id identifier rubyid_new_page'>new_page</span>
|
|
1636
|
+
<span class='kw'>end</span></pre>
|
|
1637
|
+
</td>
|
|
1638
|
+
</tr>
|
|
1639
|
+
</table>
|
|
1640
|
+
</div>
|
|
1641
|
+
|
|
1642
|
+
<div class="method_details ">
|
|
1643
|
+
<h3 class="signature " id="pages-instance_method">
|
|
1644
|
+
|
|
1645
|
+
#<strong>pages</strong> ⇒ <tt>!Promise<!Array<!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Page.html" title="Puppeteer::Page (class)">Page</a></span>>></tt>
|
|
1646
|
+
|
|
1647
|
+
|
|
1648
|
+
|
|
1649
|
+
|
|
1650
|
+
|
|
1651
|
+
</h3><div class="docstring">
|
|
1652
|
+
<div class="discussion">
|
|
1653
|
+
|
|
1654
|
+
|
|
1655
|
+
</div>
|
|
1656
|
+
</div>
|
|
1657
|
+
<div class="tags">
|
|
1658
|
+
|
|
1659
|
+
<p class="tag_title">Returns:</p>
|
|
1660
|
+
<ul class="return">
|
|
1661
|
+
|
|
1662
|
+
<li>
|
|
1663
|
+
|
|
1664
|
+
|
|
1665
|
+
<span class='type'>(<tt>!Promise<!Array<!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Page.html" title="Puppeteer::Page (class)">Page</a></span>>></tt>)</span>
|
|
1666
|
+
|
|
1667
|
+
|
|
1668
|
+
|
|
1669
|
+
</li>
|
|
1670
|
+
|
|
1671
|
+
</ul>
|
|
1672
|
+
|
|
1673
|
+
</div><table class="source_code">
|
|
1674
|
+
<tr>
|
|
1675
|
+
<td>
|
|
1676
|
+
<pre class="lines">
|
|
1677
|
+
|
|
1678
|
+
|
|
1679
|
+
230
|
|
1680
|
+
231
|
|
1681
|
+
232</pre>
|
|
1682
|
+
</td>
|
|
1683
|
+
<td>
|
|
1684
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 230</span>
|
|
1685
|
+
|
|
1686
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_pages'>pages</span>
|
|
1687
|
+
<span class='id identifier rubyid_browser_contexts'>browser_contexts</span><span class='period'>.</span><span class='id identifier rubyid_flat_map'>flat_map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:pages</span><span class='rparen'>)</span>
|
|
1688
|
+
<span class='kw'>end</span></pre>
|
|
1689
|
+
</td>
|
|
1690
|
+
</tr>
|
|
1691
|
+
</table>
|
|
1692
|
+
</div>
|
|
1693
|
+
|
|
1694
|
+
<div class="method_details ">
|
|
1695
|
+
<h3 class="signature " id="process-instance_method">
|
|
1696
|
+
|
|
1697
|
+
#<strong>process</strong> ⇒ <tt><span class='object_link'><a href="BrowserRunner/BrowserProcess.html" title="Puppeteer::BrowserRunner::BrowserProcess (class)">Puppeteer::BrowserRunner::BrowserProcess</a></span></tt>
|
|
1698
|
+
|
|
1699
|
+
|
|
1700
|
+
|
|
1701
|
+
|
|
1702
|
+
|
|
1703
|
+
</h3><div class="docstring">
|
|
1704
|
+
<div class="discussion">
|
|
1705
|
+
|
|
1706
|
+
|
|
1707
|
+
</div>
|
|
1708
|
+
</div>
|
|
1709
|
+
<div class="tags">
|
|
1710
|
+
|
|
1711
|
+
<p class="tag_title">Returns:</p>
|
|
1712
|
+
<ul class="return">
|
|
1713
|
+
|
|
1714
|
+
<li>
|
|
1715
|
+
|
|
1716
|
+
|
|
1717
|
+
<span class='type'>(<tt><span class='object_link'><a href="BrowserRunner/BrowserProcess.html" title="Puppeteer::BrowserRunner::BrowserProcess (class)">Puppeteer::BrowserRunner::BrowserProcess</a></span></tt>)</span>
|
|
1718
|
+
|
|
1719
|
+
|
|
1720
|
+
|
|
1721
|
+
</li>
|
|
1722
|
+
|
|
1723
|
+
</ul>
|
|
1724
|
+
|
|
1725
|
+
</div><table class="source_code">
|
|
1726
|
+
<tr>
|
|
1727
|
+
<td>
|
|
1728
|
+
<pre class="lines">
|
|
1729
|
+
|
|
1730
|
+
|
|
1731
|
+
58
|
|
1732
|
+
59
|
|
1733
|
+
60</pre>
|
|
1734
|
+
</td>
|
|
1735
|
+
<td>
|
|
1736
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 58</span>
|
|
1737
|
+
|
|
1738
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span>
|
|
1739
|
+
<span class='ivar'>@process</span>
|
|
1740
|
+
<span class='kw'>end</span></pre>
|
|
1741
|
+
</td>
|
|
1742
|
+
</tr>
|
|
1743
|
+
</table>
|
|
1744
|
+
</div>
|
|
1745
|
+
|
|
1746
|
+
<div class="method_details ">
|
|
1747
|
+
<h3 class="signature " id="target-instance_method">
|
|
1748
|
+
|
|
1749
|
+
#<strong>target</strong> ⇒ <tt>!<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span></tt>
|
|
1750
|
+
|
|
1751
|
+
|
|
1752
|
+
|
|
1753
|
+
|
|
1754
|
+
|
|
1755
|
+
</h3><div class="docstring">
|
|
1756
|
+
<div class="discussion">
|
|
1757
|
+
|
|
1758
|
+
|
|
1759
|
+
</div>
|
|
1760
|
+
</div>
|
|
1761
|
+
<div class="tags">
|
|
1762
|
+
|
|
1763
|
+
<p class="tag_title">Returns:</p>
|
|
1764
|
+
<ul class="return">
|
|
1765
|
+
|
|
1766
|
+
<li>
|
|
1767
|
+
|
|
1768
|
+
|
|
1769
|
+
<span class='type'>(<tt>!<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span></tt>)</span>
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
|
|
1773
|
+
</li>
|
|
1774
|
+
|
|
1775
|
+
</ul>
|
|
1776
|
+
|
|
1777
|
+
</div><table class="source_code">
|
|
1778
|
+
<tr>
|
|
1779
|
+
<td>
|
|
1780
|
+
<pre class="lines">
|
|
1781
|
+
|
|
1782
|
+
|
|
1783
|
+
191
|
|
1784
|
+
192
|
|
1785
|
+
193</pre>
|
|
1786
|
+
</td>
|
|
1787
|
+
<td>
|
|
1788
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 191</span>
|
|
1789
|
+
|
|
1790
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_target'>target</span>
|
|
1791
|
+
<span class='id identifier rubyid_targets'>targets</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_target'>target</span><span class='op'>|</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>browser</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span>
|
|
1792
|
+
<span class='kw'>end</span></pre>
|
|
1793
|
+
</td>
|
|
1794
|
+
</tr>
|
|
1795
|
+
</table>
|
|
1796
|
+
</div>
|
|
1797
|
+
|
|
1798
|
+
<div class="method_details ">
|
|
1799
|
+
<h3 class="signature " id="targets-instance_method">
|
|
1800
|
+
|
|
1801
|
+
#<strong>targets</strong> ⇒ <tt>!Array<!<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span>></tt>
|
|
1802
|
+
|
|
1803
|
+
|
|
1804
|
+
|
|
1805
|
+
|
|
1806
|
+
|
|
1807
|
+
</h3><div class="docstring">
|
|
1808
|
+
<div class="discussion">
|
|
1809
|
+
|
|
1810
|
+
|
|
1811
|
+
</div>
|
|
1812
|
+
</div>
|
|
1813
|
+
<div class="tags">
|
|
1814
|
+
|
|
1815
|
+
<p class="tag_title">Returns:</p>
|
|
1816
|
+
<ul class="return">
|
|
1817
|
+
|
|
1818
|
+
<li>
|
|
1819
|
+
|
|
1820
|
+
|
|
1821
|
+
<span class='type'>(<tt>!Array<!<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span>></tt>)</span>
|
|
1822
|
+
|
|
1823
|
+
|
|
1824
|
+
|
|
1825
|
+
</li>
|
|
1826
|
+
|
|
1827
|
+
</ul>
|
|
1828
|
+
|
|
1829
|
+
</div><table class="source_code">
|
|
1830
|
+
<tr>
|
|
1831
|
+
<td>
|
|
1832
|
+
<pre class="lines">
|
|
1833
|
+
|
|
1834
|
+
|
|
1835
|
+
185
|
|
1836
|
+
186
|
|
1837
|
+
187</pre>
|
|
1838
|
+
</td>
|
|
1839
|
+
<td>
|
|
1840
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 185</span>
|
|
1841
|
+
|
|
1842
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_targets'>targets</span>
|
|
1843
|
+
<span class='ivar'>@targets</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_target'>target</span><span class='op'>|</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_initialized?'>initialized?</span> <span class='rbrace'>}</span>
|
|
1844
|
+
<span class='kw'>end</span></pre>
|
|
1845
|
+
</td>
|
|
1846
|
+
</tr>
|
|
1847
|
+
</table>
|
|
1848
|
+
</div>
|
|
1849
|
+
|
|
1850
|
+
<div class="method_details ">
|
|
1851
|
+
<h3 class="signature " id="user_agent-instance_method">
|
|
1852
|
+
|
|
1853
|
+
#<strong>user_agent</strong> ⇒ <tt>String</tt>
|
|
1854
|
+
|
|
1855
|
+
|
|
1856
|
+
|
|
1857
|
+
|
|
1858
|
+
|
|
1859
|
+
</h3><div class="docstring">
|
|
1860
|
+
<div class="discussion">
|
|
1861
|
+
|
|
1862
|
+
|
|
1863
|
+
</div>
|
|
1864
|
+
</div>
|
|
1865
|
+
<div class="tags">
|
|
1866
|
+
|
|
1867
|
+
<p class="tag_title">Returns:</p>
|
|
1868
|
+
<ul class="return">
|
|
1869
|
+
|
|
1870
|
+
<li>
|
|
1871
|
+
|
|
1872
|
+
|
|
1873
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
1874
|
+
|
|
1875
|
+
|
|
1876
|
+
|
|
1877
|
+
</li>
|
|
1878
|
+
|
|
1879
|
+
</ul>
|
|
1880
|
+
|
|
1881
|
+
</div><table class="source_code">
|
|
1882
|
+
<tr>
|
|
1883
|
+
<td>
|
|
1884
|
+
<pre class="lines">
|
|
1885
|
+
|
|
1886
|
+
|
|
1887
|
+
240
|
|
1888
|
+
241
|
|
1889
|
+
242</pre>
|
|
1890
|
+
</td>
|
|
1891
|
+
<td>
|
|
1892
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 240</span>
|
|
1893
|
+
|
|
1894
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_user_agent'>user_agent</span>
|
|
1895
|
+
<span class='id identifier rubyid_get_version'>get_version</span><span class='period'>.</span><span class='id identifier rubyid_user_agent'>user_agent</span>
|
|
1896
|
+
<span class='kw'>end</span></pre>
|
|
1897
|
+
</td>
|
|
1898
|
+
</tr>
|
|
1899
|
+
</table>
|
|
1900
|
+
</div>
|
|
1901
|
+
|
|
1902
|
+
<div class="method_details ">
|
|
1903
|
+
<h3 class="signature " id="version-instance_method">
|
|
1904
|
+
|
|
1905
|
+
#<strong>version</strong> ⇒ <tt>String</tt>
|
|
1906
|
+
|
|
1907
|
+
|
|
1908
|
+
|
|
1909
|
+
|
|
1910
|
+
|
|
1911
|
+
</h3><div class="docstring">
|
|
1912
|
+
<div class="discussion">
|
|
1913
|
+
|
|
1914
|
+
|
|
1915
|
+
</div>
|
|
1916
|
+
</div>
|
|
1917
|
+
<div class="tags">
|
|
1918
|
+
|
|
1919
|
+
<p class="tag_title">Returns:</p>
|
|
1920
|
+
<ul class="return">
|
|
1921
|
+
|
|
1922
|
+
<li>
|
|
1923
|
+
|
|
1924
|
+
|
|
1925
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
1926
|
+
|
|
1927
|
+
|
|
1928
|
+
|
|
1929
|
+
</li>
|
|
1930
|
+
|
|
1931
|
+
</ul>
|
|
1932
|
+
|
|
1933
|
+
</div><table class="source_code">
|
|
1934
|
+
<tr>
|
|
1935
|
+
<td>
|
|
1936
|
+
<pre class="lines">
|
|
1937
|
+
|
|
1938
|
+
|
|
1939
|
+
235
|
|
1940
|
+
236
|
|
1941
|
+
237</pre>
|
|
1942
|
+
</td>
|
|
1943
|
+
<td>
|
|
1944
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 235</span>
|
|
1945
|
+
|
|
1946
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_version'>version</span>
|
|
1947
|
+
<span class='id identifier rubyid_get_version'>get_version</span><span class='period'>.</span><span class='id identifier rubyid_product'>product</span>
|
|
1948
|
+
<span class='kw'>end</span></pre>
|
|
1949
|
+
</td>
|
|
1950
|
+
</tr>
|
|
1951
|
+
</table>
|
|
1952
|
+
</div>
|
|
1953
|
+
|
|
1954
|
+
<div class="method_details ">
|
|
1955
|
+
<h3 class="signature " id="wait_for_target-instance_method">
|
|
1956
|
+
|
|
1957
|
+
#<strong>wait_for_target</strong>(predicate:, timeout: nil) ⇒ <tt>!Promise<!<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span>></tt>
|
|
1958
|
+
|
|
1959
|
+
|
|
1960
|
+
|
|
1961
|
+
|
|
1962
|
+
|
|
1963
|
+
</h3><div class="docstring">
|
|
1964
|
+
<div class="discussion">
|
|
1965
|
+
|
|
1966
|
+
|
|
1967
|
+
</div>
|
|
1968
|
+
</div>
|
|
1969
|
+
<div class="tags">
|
|
1970
|
+
<p class="tag_title">Parameters:</p>
|
|
1971
|
+
<ul class="param">
|
|
1972
|
+
|
|
1973
|
+
<li>
|
|
1974
|
+
|
|
1975
|
+
<span class='name'>predicate</span>
|
|
1976
|
+
|
|
1977
|
+
|
|
1978
|
+
<span class='type'>(<tt>function(!<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span>):boolean</tt>)</span>
|
|
1979
|
+
|
|
1980
|
+
|
|
1981
|
+
|
|
1982
|
+
</li>
|
|
1983
|
+
|
|
1984
|
+
<li>
|
|
1985
|
+
|
|
1986
|
+
<span class='name'>options</span>
|
|
1987
|
+
|
|
1988
|
+
|
|
1989
|
+
<span class='type'>(<tt>{timeout?: number}=</tt>)</span>
|
|
1990
|
+
|
|
1991
|
+
|
|
1992
|
+
|
|
1993
|
+
</li>
|
|
1994
|
+
|
|
1995
|
+
</ul>
|
|
1996
|
+
|
|
1997
|
+
<p class="tag_title">Returns:</p>
|
|
1998
|
+
<ul class="return">
|
|
1999
|
+
|
|
2000
|
+
<li>
|
|
2001
|
+
|
|
2002
|
+
|
|
2003
|
+
<span class='type'>(<tt>!Promise<!<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span>></tt>)</span>
|
|
2004
|
+
|
|
2005
|
+
|
|
2006
|
+
|
|
2007
|
+
</li>
|
|
2008
|
+
|
|
2009
|
+
</ul>
|
|
2010
|
+
|
|
2011
|
+
</div><table class="source_code">
|
|
2012
|
+
<tr>
|
|
2013
|
+
<td>
|
|
2014
|
+
<pre class="lines">
|
|
2015
|
+
|
|
2016
|
+
|
|
2017
|
+
198
|
|
2018
|
+
199
|
|
2019
|
+
200
|
|
2020
|
+
201
|
|
2021
|
+
202
|
|
2022
|
+
203
|
|
2023
|
+
204
|
|
2024
|
+
205
|
|
2025
|
+
206
|
|
2026
|
+
207
|
|
2027
|
+
208
|
|
2028
|
+
209
|
|
2029
|
+
210
|
|
2030
|
+
211
|
|
2031
|
+
212
|
|
2032
|
+
213
|
|
2033
|
+
214
|
|
2034
|
+
215
|
|
2035
|
+
216
|
|
2036
|
+
217
|
|
2037
|
+
218
|
|
2038
|
+
219
|
|
2039
|
+
220
|
|
2040
|
+
221
|
|
2041
|
+
222
|
|
2042
|
+
223
|
|
2043
|
+
224
|
|
2044
|
+
225
|
|
2045
|
+
226
|
|
2046
|
+
227</pre>
|
|
2047
|
+
</td>
|
|
2048
|
+
<td>
|
|
2049
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 198</span>
|
|
2050
|
+
|
|
2051
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_wait_for_target'>wait_for_target</span><span class='lparen'>(</span><span class='label'>predicate:</span><span class='comma'>,</span> <span class='label'>timeout:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
2052
|
+
<span class='id identifier rubyid_timeout_in_sec'>timeout_in_sec</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_timeout'>timeout</span> <span class='op'>||</span> <span class='int'>30000</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>/</span> <span class='float'>1000.0</span>
|
|
2053
|
+
<span class='id identifier rubyid_existing_target'>existing_target</span> <span class='op'>=</span> <span class='id identifier rubyid_targets'>targets</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_target'>target</span><span class='op'>|</span> <span class='id identifier rubyid_predicate'>predicate</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
2054
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_existing_target'>existing_target</span> <span class='kw'>if</span> <span class='id identifier rubyid_existing_target'>existing_target</span>
|
|
2055
|
+
|
|
2056
|
+
<span class='id identifier rubyid_event_listening_ids'>event_listening_ids</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
2057
|
+
<span class='id identifier rubyid_target_promise'>target_promise</span> <span class='op'>=</span> <span class='id identifier rubyid_resolvable_future'><span class='object_link'><a href="ConcurrentRubyUtils.html#resolvable_future-instance_method" title="Puppeteer::ConcurrentRubyUtils#resolvable_future (method)">resolvable_future</a></span></span>
|
|
2058
|
+
<span class='id identifier rubyid_event_listening_ids'>event_listening_ids</span> <span class='op'><<</span> <span class='id identifier rubyid_add_event_listener'>add_event_listener</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.Browser.TargetCreated</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_target'>target</span><span class='op'>|</span>
|
|
2059
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_predicate'>predicate</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
|
|
2060
|
+
<span class='id identifier rubyid_target_promise'>target_promise</span><span class='period'>.</span><span class='id identifier rubyid_fulfill'>fulfill</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
|
|
2061
|
+
<span class='kw'>end</span>
|
|
2062
|
+
<span class='kw'>end</span>
|
|
2063
|
+
<span class='id identifier rubyid_event_listening_ids'>event_listening_ids</span> <span class='op'><<</span> <span class='id identifier rubyid_add_event_listener'>add_event_listener</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.Browser.TargetChanged</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_target'>target</span><span class='op'>|</span>
|
|
2064
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_predicate'>predicate</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
|
|
2065
|
+
<span class='id identifier rubyid_target_promise'>target_promise</span><span class='period'>.</span><span class='id identifier rubyid_fulfill'>fulfill</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
|
|
2066
|
+
<span class='kw'>end</span>
|
|
2067
|
+
<span class='kw'>end</span>
|
|
2068
|
+
|
|
2069
|
+
<span class='kw'>begin</span>
|
|
2070
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_timeout_in_sec'>timeout_in_sec</span> <span class='op'>></span> <span class='int'>0</span>
|
|
2071
|
+
<span class='const'>Timeout</span><span class='period'>.</span><span class='id identifier rubyid_timeout'>timeout</span><span class='lparen'>(</span><span class='id identifier rubyid_timeout_in_sec'>timeout_in_sec</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
|
2072
|
+
<span class='id identifier rubyid_target_promise'>target_promise</span><span class='period'>.</span><span class='id identifier rubyid_value!'>value!</span>
|
|
2073
|
+
<span class='kw'>end</span>
|
|
2074
|
+
<span class='kw'>else</span>
|
|
2075
|
+
<span class='id identifier rubyid_target_promise'>target_promise</span><span class='period'>.</span><span class='id identifier rubyid_value!'>value!</span>
|
|
2076
|
+
<span class='kw'>end</span>
|
|
2077
|
+
<span class='kw'>ensure</span>
|
|
2078
|
+
<span class='id identifier rubyid_remove_event_listener'>remove_event_listener</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_event_listening_ids'>event_listening_ids</span><span class='rparen'>)</span>
|
|
2079
|
+
<span class='kw'>end</span>
|
|
2080
|
+
<span class='kw'>end</span></pre>
|
|
2081
|
+
</td>
|
|
2082
|
+
</tr>
|
|
2083
|
+
</table>
|
|
2084
|
+
</div>
|
|
2085
|
+
|
|
2086
|
+
<div class="method_details ">
|
|
2087
|
+
<h3 class="signature " id="websocket_endpoint-instance_method">
|
|
2088
|
+
|
|
2089
|
+
#<strong>websocket_endpoint</strong> ⇒ <tt>String</tt>
|
|
2090
|
+
|
|
2091
|
+
|
|
2092
|
+
|
|
2093
|
+
|
|
2094
|
+
|
|
2095
|
+
</h3><div class="docstring">
|
|
2096
|
+
<div class="discussion">
|
|
2097
|
+
|
|
2098
|
+
|
|
2099
|
+
</div>
|
|
2100
|
+
</div>
|
|
2101
|
+
<div class="tags">
|
|
2102
|
+
|
|
2103
|
+
<p class="tag_title">Returns:</p>
|
|
2104
|
+
<ul class="return">
|
|
2105
|
+
|
|
2106
|
+
<li>
|
|
2107
|
+
|
|
2108
|
+
|
|
2109
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
2110
|
+
|
|
2111
|
+
|
|
2112
|
+
|
|
2113
|
+
</li>
|
|
2114
|
+
|
|
2115
|
+
</ul>
|
|
2116
|
+
|
|
2117
|
+
</div><table class="source_code">
|
|
2118
|
+
<tr>
|
|
2119
|
+
<td>
|
|
2120
|
+
<pre class="lines">
|
|
2121
|
+
|
|
2122
|
+
|
|
2123
|
+
162
|
|
2124
|
+
163
|
|
2125
|
+
164</pre>
|
|
2126
|
+
</td>
|
|
2127
|
+
<td>
|
|
2128
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 162</span>
|
|
2129
|
+
|
|
2130
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_websocket_endpoint'>websocket_endpoint</span>
|
|
2131
|
+
<span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_url'>url</span>
|
|
2132
|
+
<span class='kw'>end</span></pre>
|
|
2133
|
+
</td>
|
|
2134
|
+
</tr>
|
|
2135
|
+
</table>
|
|
2136
|
+
</div>
|
|
2137
|
+
|
|
2138
|
+
</div>
|
|
2139
|
+
|
|
2140
|
+
</div>
|
|
2141
|
+
|
|
2142
|
+
<div id="footer">
|
|
2143
|
+
Generated on Sun Apr 26 15:52:56 2020 by
|
|
2144
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
2145
|
+
0.9.24 (ruby-2.6.3).
|
|
2146
|
+
</div>
|
|
2147
|
+
|
|
2148
|
+
</div>
|
|
2149
|
+
</body>
|
|
2150
|
+
</html>
|