puppeteer-ruby 0.0.10
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 +7 -0
- data/.circleci/config.yml +71 -0
- data/.github/stale.yml +16 -0
- data/.gitignore +19 -0
- data/.rspec +3 -0
- data/.rubocop.yml +302 -0
- data/.travis.yml +7 -0
- data/Dockerfile +6 -0
- data/Gemfile +6 -0
- data/README.md +54 -0
- data/Rakefile +1 -0
- data/bin/console +11 -0
- data/bin/setup +8 -0
- data/docker-compose.yml +15 -0
- data/docs/Puppeteer.html +2020 -0
- data/docs/Puppeteer/AsyncAwaitBehavior.html +105 -0
- data/docs/Puppeteer/Browser.html +2148 -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 +813 -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 +2219 -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 +2542 -0
- data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +206 -0
- data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +206 -0
- data/docs/Puppeteer/ElementHandle/Point.html +492 -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 +998 -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/FileChooser.html +455 -0
- data/docs/Puppeteer/Frame.html +3677 -0
- data/docs/Puppeteer/FrameManager.html +2410 -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 +669 -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 +5970 -0
- data/docs/Puppeteer/Page/FileChooserTimeoutError.html +206 -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 +1087 -0
- data/docs/Puppeteer/Target.html +1336 -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 +837 -0
- data/docs/Puppeteer/WaitTask.html +637 -0
- data/docs/Puppeteer/WaitTask/TerminatedError.html +124 -0
- data/docs/Puppeteer/WaitTask/TimeoutError.html +206 -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 +823 -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 +123 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +123 -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 +4075 -0
- data/docs/top-level-namespace.html +126 -0
- data/lib/puppeteer.rb +200 -0
- data/lib/puppeteer/async_await_behavior.rb +38 -0
- data/lib/puppeteer/browser.rb +259 -0
- data/lib/puppeteer/browser_context.rb +90 -0
- data/lib/puppeteer/browser_fetcher.rb +6 -0
- data/lib/puppeteer/browser_runner.rb +161 -0
- data/lib/puppeteer/cdp_session.rb +100 -0
- data/lib/puppeteer/concurrent_ruby_utils.rb +37 -0
- data/lib/puppeteer/connection.rb +254 -0
- data/lib/puppeteer/console_message.rb +24 -0
- data/lib/puppeteer/debug_print.rb +20 -0
- data/lib/puppeteer/device.rb +12 -0
- data/lib/puppeteer/devices.rb +885 -0
- data/lib/puppeteer/dom_world.rb +484 -0
- data/lib/puppeteer/element_handle.rb +433 -0
- data/lib/puppeteer/element_handle/bounding_box.rb +12 -0
- data/lib/puppeteer/element_handle/box_model.rb +19 -0
- data/lib/puppeteer/element_handle/point.rb +26 -0
- data/lib/puppeteer/emulation_manager.rb +46 -0
- data/lib/puppeteer/errors.rb +2 -0
- data/lib/puppeteer/event_callbackable.rb +88 -0
- data/lib/puppeteer/execution_context.rb +254 -0
- data/lib/puppeteer/file_chooser.rb +29 -0
- data/lib/puppeteer/frame.rb +286 -0
- data/lib/puppeteer/frame_manager.rb +378 -0
- data/lib/puppeteer/if_present.rb +18 -0
- data/lib/puppeteer/js_handle.rb +142 -0
- data/lib/puppeteer/keyboard.rb +183 -0
- data/lib/puppeteer/keyboard/key_description.rb +19 -0
- data/lib/puppeteer/keyboard/us_keyboard_layout.rb +283 -0
- data/lib/puppeteer/launcher.rb +25 -0
- data/lib/puppeteer/launcher/base.rb +48 -0
- data/lib/puppeteer/launcher/browser_options.rb +41 -0
- data/lib/puppeteer/launcher/chrome.rb +211 -0
- data/lib/puppeteer/launcher/chrome_arg_options.rb +49 -0
- data/lib/puppeteer/launcher/launch_options.rb +68 -0
- data/lib/puppeteer/lifecycle_watcher.rb +171 -0
- data/lib/puppeteer/mouse.rb +123 -0
- data/lib/puppeteer/network_manager.rb +122 -0
- data/lib/puppeteer/page.rb +1065 -0
- data/lib/puppeteer/page/screenshot_options.rb +78 -0
- data/lib/puppeteer/remote_object.rb +143 -0
- data/lib/puppeteer/target.rb +150 -0
- data/lib/puppeteer/timeout_settings.rb +15 -0
- data/lib/puppeteer/touch_screen.rb +43 -0
- data/lib/puppeteer/version.rb +3 -0
- data/lib/puppeteer/viewport.rb +54 -0
- data/lib/puppeteer/wait_task.rb +188 -0
- data/lib/puppeteer/web_socket.rb +122 -0
- data/lib/puppeteer/web_socket_transport.rb +49 -0
- data/puppeteer-ruby.gemspec +32 -0
- metadata +355 -0
|
@@ -0,0 +1,2410 @@
|
|
|
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::FrameManager
|
|
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::FrameManager";
|
|
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 (F)</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">FrameManager</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::FrameManager
|
|
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::FrameManager</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/frame_manager.rb</dd>
|
|
103
|
+
</dl>
|
|
104
|
+
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<h2>Defined Under Namespace</h2>
|
|
108
|
+
<p class="children">
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="FrameManager/NavigationError.html" title="Puppeteer::FrameManager::NavigationError (class)">NavigationError</a></span>
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
</p>
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
<h2>
|
|
120
|
+
Constant Summary
|
|
121
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
|
122
|
+
</h2>
|
|
123
|
+
|
|
124
|
+
<dl class="constants">
|
|
125
|
+
|
|
126
|
+
<dt id="UTILITY_WORLD_NAME-constant" class="">UTILITY_WORLD_NAME =
|
|
127
|
+
|
|
128
|
+
</dt>
|
|
129
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>__puppeteer_utility_world__</span><span class='tstring_end'>'</span></span></pre></dd>
|
|
130
|
+
|
|
131
|
+
</dl>
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
|
138
|
+
<ul class="summary">
|
|
139
|
+
|
|
140
|
+
<li class="public ">
|
|
141
|
+
<span class="summary_signature">
|
|
142
|
+
|
|
143
|
+
<a href="#client-instance_method" title="#client (instance method)">#<strong>client</strong> ⇒ Object </a>
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
</span>
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
<span class="note title readonly">readonly</span>
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
<span class="summary_desc"><div class='inline'>
|
|
163
|
+
<p>Returns the value of attribute client.</p>
|
|
164
|
+
</div></span>
|
|
165
|
+
|
|
166
|
+
</li>
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
<li class="public ">
|
|
170
|
+
<span class="summary_signature">
|
|
171
|
+
|
|
172
|
+
<a href="#network_manager-instance_method" title="#network_manager (instance method)">#<strong>network_manager</strong> ⇒ Object </a>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
</span>
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
<span class="note title readonly">readonly</span>
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
<span class="summary_desc"><div class='inline'>
|
|
192
|
+
<p>Returns the value of attribute network_manager.</p>
|
|
193
|
+
</div></span>
|
|
194
|
+
|
|
195
|
+
</li>
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
<li class="public ">
|
|
199
|
+
<span class="summary_signature">
|
|
200
|
+
|
|
201
|
+
<a href="#timeout_settings-instance_method" title="#timeout_settings (instance method)">#<strong>timeout_settings</strong> ⇒ Object </a>
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
</span>
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
<span class="note title readonly">readonly</span>
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
<span class="summary_desc"><div class='inline'>
|
|
221
|
+
<p>Returns the value of attribute timeout_settings.</p>
|
|
222
|
+
</div></span>
|
|
223
|
+
|
|
224
|
+
</li>
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
</ul>
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
<h2>
|
|
234
|
+
Instance Method Summary
|
|
235
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
236
|
+
</h2>
|
|
237
|
+
|
|
238
|
+
<ul class="summary">
|
|
239
|
+
|
|
240
|
+
<li class="public ">
|
|
241
|
+
<span class="summary_signature">
|
|
242
|
+
|
|
243
|
+
<a href="#ensure_isolated_world-instance_method" title="#ensure_isolated_world (instance method)">#<strong>ensure_isolated_world</strong>(name) ⇒ Object </a>
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
</span>
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
258
|
+
|
|
259
|
+
</li>
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
<li class="public ">
|
|
263
|
+
<span class="summary_signature">
|
|
264
|
+
|
|
265
|
+
<a href="#execution_context_by_id-instance_method" title="#execution_context_by_id (instance method)">#<strong>execution_context_by_id</strong>(context_id) ⇒ Object </a>
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
</span>
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
280
|
+
|
|
281
|
+
</li>
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
<li class="public ">
|
|
285
|
+
<span class="summary_signature">
|
|
286
|
+
|
|
287
|
+
<a href="#frame-instance_method" title="#frame (instance method)">#<strong>frame</strong>(frame_id) ⇒ ?Frame </a>
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
</span>
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
302
|
+
|
|
303
|
+
</li>
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
<li class="public ">
|
|
307
|
+
<span class="summary_signature">
|
|
308
|
+
|
|
309
|
+
<a href="#frames-instance_method" title="#frames (instance method)">#<strong>frames</strong> ⇒ !Array<!Frame> </a>
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
</span>
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
324
|
+
|
|
325
|
+
</li>
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
<li class="public ">
|
|
329
|
+
<span class="summary_signature">
|
|
330
|
+
|
|
331
|
+
<a href="#handle_execution_context_created-instance_method" title="#handle_execution_context_created (instance method)">#<strong>handle_execution_context_created</strong>(context_payload) ⇒ Object </a>
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
</span>
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
346
|
+
|
|
347
|
+
</li>
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
<li class="public ">
|
|
351
|
+
<span class="summary_signature">
|
|
352
|
+
|
|
353
|
+
<a href="#handle_execution_context_destroyed-instance_method" title="#handle_execution_context_destroyed (instance method)">#<strong>handle_execution_context_destroyed</strong>(execution_context_id) ⇒ Object </a>
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
</span>
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
368
|
+
|
|
369
|
+
</li>
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
<li class="public ">
|
|
373
|
+
<span class="summary_signature">
|
|
374
|
+
|
|
375
|
+
<a href="#handle_execution_contexts_cleared-instance_method" title="#handle_execution_contexts_cleared (instance method)">#<strong>handle_execution_contexts_cleared</strong> ⇒ Object </a>
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
</span>
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
390
|
+
|
|
391
|
+
</li>
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
<li class="public ">
|
|
395
|
+
<span class="summary_signature">
|
|
396
|
+
|
|
397
|
+
<a href="#handle_frame_attached-instance_method" title="#handle_frame_attached (instance method)">#<strong>handle_frame_attached</strong>(frame_id, parent_frame_id) ⇒ Object </a>
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
</span>
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
412
|
+
|
|
413
|
+
</li>
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
<li class="public ">
|
|
417
|
+
<span class="summary_signature">
|
|
418
|
+
|
|
419
|
+
<a href="#handle_frame_detached-instance_method" title="#handle_frame_detached (instance method)">#<strong>handle_frame_detached</strong>(frame_id) ⇒ Object </a>
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
</span>
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
434
|
+
|
|
435
|
+
</li>
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
<li class="public ">
|
|
439
|
+
<span class="summary_signature">
|
|
440
|
+
|
|
441
|
+
<a href="#handle_frame_navigated-instance_method" title="#handle_frame_navigated (instance method)">#<strong>handle_frame_navigated</strong>(frame_payload) ⇒ Object </a>
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
</span>
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
456
|
+
|
|
457
|
+
</li>
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
<li class="public ">
|
|
461
|
+
<span class="summary_signature">
|
|
462
|
+
|
|
463
|
+
<a href="#handle_frame_navigated_within_document-instance_method" title="#handle_frame_navigated_within_document (instance method)">#<strong>handle_frame_navigated_within_document</strong>(frame_id, url) ⇒ Object </a>
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
</span>
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
478
|
+
|
|
479
|
+
</li>
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
<li class="public ">
|
|
483
|
+
<span class="summary_signature">
|
|
484
|
+
|
|
485
|
+
<a href="#handle_frame_stopped_loading-instance_method" title="#handle_frame_stopped_loading (instance method)">#<strong>handle_frame_stopped_loading</strong>(frame_id) ⇒ Object </a>
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
</span>
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
500
|
+
|
|
501
|
+
</li>
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
<li class="public ">
|
|
505
|
+
<span class="summary_signature">
|
|
506
|
+
|
|
507
|
+
<a href="#handle_frame_tree-instance_method" title="#handle_frame_tree (instance method)">#<strong>handle_frame_tree</strong>(frame_tree) ⇒ Object </a>
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
</span>
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
522
|
+
|
|
523
|
+
</li>
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
<li class="public ">
|
|
527
|
+
<span class="summary_signature">
|
|
528
|
+
|
|
529
|
+
<a href="#handle_lifecycle_event-instance_method" title="#handle_lifecycle_event (instance method)">#<strong>handle_lifecycle_event</strong>(event) ⇒ Object </a>
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
</span>
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
544
|
+
|
|
545
|
+
</li>
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
<li class="public ">
|
|
549
|
+
<span class="summary_signature">
|
|
550
|
+
|
|
551
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(client, page, ignore_https_errors, timeout_settings) ⇒ FrameManager </a>
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
</span>
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
<span class="note title constructor">constructor</span>
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
<span class="summary_desc"><div class='inline'>
|
|
568
|
+
<p>A new instance of FrameManager.</p>
|
|
569
|
+
</div></span>
|
|
570
|
+
|
|
571
|
+
</li>
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
<li class="public ">
|
|
575
|
+
<span class="summary_signature">
|
|
576
|
+
|
|
577
|
+
<a href="#main_frame-instance_method" title="#main_frame (instance method)">#<strong>main_frame</strong> ⇒ !Frame </a>
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
</span>
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
592
|
+
|
|
593
|
+
</li>
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
<li class="public ">
|
|
597
|
+
<span class="summary_signature">
|
|
598
|
+
|
|
599
|
+
<a href="#navigate_frame-instance_method" title="#navigate_frame (instance method)">#<strong>navigate_frame</strong>(frame, url, referer: nil, timeout: nil, wait_until: nil) ⇒ Puppeteer::Response </a>
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
</span>
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
614
|
+
|
|
615
|
+
</li>
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
<li class="public ">
|
|
619
|
+
<span class="summary_signature">
|
|
620
|
+
|
|
621
|
+
<a href="#page-instance_method" title="#page (instance method)">#<strong>page</strong> ⇒ !Puppeteer.Page </a>
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
</span>
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
636
|
+
|
|
637
|
+
</li>
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
<li class="public ">
|
|
641
|
+
<span class="summary_signature">
|
|
642
|
+
|
|
643
|
+
<a href="#wait_for_frame_navigation-instance_method" title="#wait_for_frame_navigation (instance method)">#<strong>wait_for_frame_navigation</strong>(frame, timeout: nil, wait_until: nil) ⇒ Puppeteer::Response </a>
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
</span>
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
658
|
+
|
|
659
|
+
</li>
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
</ul>
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="EventCallbackable.html" title="Puppeteer::EventCallbackable (module)">EventCallbackable</a></span></h3>
|
|
675
|
+
<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>
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="IfPresent.html" title="Puppeteer::IfPresent (module)">IfPresent</a></span></h3>
|
|
686
|
+
<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>
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="DebugPrint.html" title="Puppeteer::DebugPrint (module)">DebugPrint</a></span></h3>
|
|
697
|
+
<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>
|
|
698
|
+
<div id="constructor_details" class="method_details_list">
|
|
699
|
+
<h2>Constructor Details</h2>
|
|
700
|
+
|
|
701
|
+
<div class="method_details first">
|
|
702
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
703
|
+
|
|
704
|
+
#<strong>initialize</strong>(client, page, ignore_https_errors, timeout_settings) ⇒ <tt><span class='object_link'><a href="" title="Puppeteer::FrameManager (class)">FrameManager</a></span></tt>
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
</h3><div class="docstring">
|
|
711
|
+
<div class="discussion">
|
|
712
|
+
|
|
713
|
+
<p>Returns a new instance of FrameManager.</p>
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
</div>
|
|
717
|
+
</div>
|
|
718
|
+
<div class="tags">
|
|
719
|
+
<p class="tag_title">Parameters:</p>
|
|
720
|
+
<ul class="param">
|
|
721
|
+
|
|
722
|
+
<li>
|
|
723
|
+
|
|
724
|
+
<span class='name'>client</span>
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
<span class='type'>(<tt>!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="CDPSession.html" title="Puppeteer::CDPSession (class)">CDPSession</a></span></tt>)</span>
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
</li>
|
|
732
|
+
|
|
733
|
+
<li>
|
|
734
|
+
|
|
735
|
+
<span class='name'>page</span>
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
<span class='type'>(<tt>!<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>
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
</li>
|
|
743
|
+
|
|
744
|
+
<li>
|
|
745
|
+
|
|
746
|
+
<span class='name'>ignoreHTTPSErrors</span>
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
<span class='type'>(<tt>boolean</tt>)</span>
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
</li>
|
|
754
|
+
|
|
755
|
+
<li>
|
|
756
|
+
|
|
757
|
+
<span class='name'>timeoutSettings</span>
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
<span class='type'>(<tt>!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="TimeoutSettings.html" title="Puppeteer::TimeoutSettings (class)">TimeoutSettings</a></span></tt>)</span>
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
</li>
|
|
765
|
+
|
|
766
|
+
</ul>
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
</div><table class="source_code">
|
|
770
|
+
<tr>
|
|
771
|
+
<td>
|
|
772
|
+
<pre class="lines">
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
15
|
|
776
|
+
16
|
|
777
|
+
17
|
|
778
|
+
18
|
|
779
|
+
19
|
|
780
|
+
20
|
|
781
|
+
21
|
|
782
|
+
22
|
|
783
|
+
23
|
|
784
|
+
24
|
|
785
|
+
25
|
|
786
|
+
26
|
|
787
|
+
27
|
|
788
|
+
28
|
|
789
|
+
29
|
|
790
|
+
30
|
|
791
|
+
31
|
|
792
|
+
32
|
|
793
|
+
33
|
|
794
|
+
34
|
|
795
|
+
35
|
|
796
|
+
36
|
|
797
|
+
37
|
|
798
|
+
38
|
|
799
|
+
39
|
|
800
|
+
40
|
|
801
|
+
41
|
|
802
|
+
42
|
|
803
|
+
43
|
|
804
|
+
44
|
|
805
|
+
45
|
|
806
|
+
46
|
|
807
|
+
47
|
|
808
|
+
48
|
|
809
|
+
49
|
|
810
|
+
50
|
|
811
|
+
51
|
|
812
|
+
52
|
|
813
|
+
53
|
|
814
|
+
54
|
|
815
|
+
55
|
|
816
|
+
56
|
|
817
|
+
57
|
|
818
|
+
58</pre>
|
|
819
|
+
</td>
|
|
820
|
+
<td>
|
|
821
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 15</span>
|
|
822
|
+
|
|
823
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='comma'>,</span> <span class='id identifier rubyid_page'>page</span><span class='comma'>,</span> <span class='id identifier rubyid_ignore_https_errors'>ignore_https_errors</span><span class='comma'>,</span> <span class='id identifier rubyid_timeout_settings'>timeout_settings</span><span class='rparen'>)</span>
|
|
824
|
+
<span class='ivar'>@client</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span>
|
|
825
|
+
<span class='ivar'>@page</span> <span class='op'>=</span> <span class='id identifier rubyid_page'>page</span>
|
|
826
|
+
<span class='ivar'>@network_manager</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="NetworkManager.html" title="Puppeteer::NetworkManager (class)">NetworkManager</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="NetworkManager.html#initialize-instance_method" title="Puppeteer::NetworkManager#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='comma'>,</span> <span class='id identifier rubyid_ignore_https_errors'>ignore_https_errors</span><span class='comma'>,</span> <span class='kw'>self</span><span class='rparen'>)</span>
|
|
827
|
+
<span class='ivar'>@timeout_settings</span> <span class='op'>=</span> <span class='id identifier rubyid_timeout_settings'>timeout_settings</span>
|
|
828
|
+
|
|
829
|
+
<span class='comment'># @type {!Map<string, !Frame>}
|
|
830
|
+
</span> <span class='ivar'>@frames</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
831
|
+
|
|
832
|
+
<span class='comment'># @type {!Map<number, !ExecutionContext>}
|
|
833
|
+
</span> <span class='ivar'>@context_id_to_context</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
834
|
+
<span class='ivar'>@context_id_created</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
835
|
+
|
|
836
|
+
<span class='comment'># @type {!Set<string>}
|
|
837
|
+
</span> <span class='ivar'>@isolated_worlds</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
838
|
+
|
|
839
|
+
<span class='ivar'>@client</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'>Page.frameAttached</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_event'>event</span><span class='op'>|</span>
|
|
840
|
+
<span class='id identifier rubyid_handle_frame_attached'>handle_frame_attached</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'>frameId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</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'>parentFrameId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
841
|
+
<span class='kw'>end</span>
|
|
842
|
+
<span class='ivar'>@client</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'>Page.frameNavigated</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_event'>event</span><span class='op'>|</span>
|
|
843
|
+
<span class='id identifier rubyid_handle_frame_navigated'>handle_frame_navigated</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'>frame</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
844
|
+
<span class='kw'>end</span>
|
|
845
|
+
<span class='ivar'>@client</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'>Page.navigatedWithinDocument</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_event'>event</span><span class='op'>|</span>
|
|
846
|
+
<span class='id identifier rubyid_handle_frame_navigated_within_document'>handle_frame_navigated_within_document</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'>frameId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</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'>url</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
847
|
+
<span class='kw'>end</span>
|
|
848
|
+
<span class='ivar'>@client</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'>Page.frameDetached</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_event'>event</span><span class='op'>|</span>
|
|
849
|
+
<span class='id identifier rubyid_handle_frame_detached'>handle_frame_detached</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'>frameId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
850
|
+
<span class='kw'>end</span>
|
|
851
|
+
<span class='ivar'>@client</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'>Page.frameStoppedLoading</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_event'>event</span><span class='op'>|</span>
|
|
852
|
+
<span class='id identifier rubyid_handle_frame_stopped_loading'>handle_frame_stopped_loading</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'>frameId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
853
|
+
<span class='kw'>end</span>
|
|
854
|
+
<span class='ivar'>@client</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'>Runtime.executionContextCreated</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_event'>event</span><span class='op'>|</span>
|
|
855
|
+
<span class='id identifier rubyid_handle_execution_context_created'>handle_execution_context_created</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'>context</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
856
|
+
<span class='kw'>end</span>
|
|
857
|
+
<span class='ivar'>@client</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'>Runtime.executionContextDestroyed</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_event'>event</span><span class='op'>|</span>
|
|
858
|
+
<span class='id identifier rubyid_handle_execution_context_destroyed'>handle_execution_context_destroyed</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'>executionContextId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
859
|
+
<span class='kw'>end</span>
|
|
860
|
+
<span class='ivar'>@client</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'>Runtime.executionContextsCleared</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_event'>event</span><span class='op'>|</span>
|
|
861
|
+
<span class='id identifier rubyid_handle_execution_contexts_cleared'>handle_execution_contexts_cleared</span>
|
|
862
|
+
<span class='kw'>end</span>
|
|
863
|
+
<span class='ivar'>@client</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'>Page.lifecycleEvent</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_event'>event</span><span class='op'>|</span>
|
|
864
|
+
<span class='id identifier rubyid_handle_lifecycle_event'>handle_lifecycle_event</span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='rparen'>)</span>
|
|
865
|
+
<span class='kw'>end</span>
|
|
866
|
+
<span class='kw'>end</span></pre>
|
|
867
|
+
</td>
|
|
868
|
+
</tr>
|
|
869
|
+
</table>
|
|
870
|
+
</div>
|
|
871
|
+
|
|
872
|
+
</div>
|
|
873
|
+
|
|
874
|
+
<div id="instance_attr_details" class="attr_details">
|
|
875
|
+
<h2>Instance Attribute Details</h2>
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
<span id=""></span>
|
|
879
|
+
<div class="method_details first">
|
|
880
|
+
<h3 class="signature first" id="client-instance_method">
|
|
881
|
+
|
|
882
|
+
#<strong>client</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
</h3><div class="docstring">
|
|
889
|
+
<div class="discussion">
|
|
890
|
+
|
|
891
|
+
<p>Returns the value of attribute client.</p>
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
</div>
|
|
895
|
+
</div>
|
|
896
|
+
<div class="tags">
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
</div><table class="source_code">
|
|
900
|
+
<tr>
|
|
901
|
+
<td>
|
|
902
|
+
<pre class="lines">
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
60
|
|
906
|
+
61
|
|
907
|
+
62</pre>
|
|
908
|
+
</td>
|
|
909
|
+
<td>
|
|
910
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 60</span>
|
|
911
|
+
|
|
912
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_client'>client</span>
|
|
913
|
+
<span class='ivar'>@client</span>
|
|
914
|
+
<span class='kw'>end</span></pre>
|
|
915
|
+
</td>
|
|
916
|
+
</tr>
|
|
917
|
+
</table>
|
|
918
|
+
</div>
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
<span id=""></span>
|
|
922
|
+
<div class="method_details ">
|
|
923
|
+
<h3 class="signature " id="network_manager-instance_method">
|
|
924
|
+
|
|
925
|
+
#<strong>network_manager</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
</h3><div class="docstring">
|
|
932
|
+
<div class="discussion">
|
|
933
|
+
|
|
934
|
+
<p>Returns the value of attribute network_manager.</p>
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
</div>
|
|
938
|
+
</div>
|
|
939
|
+
<div class="tags">
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
</div><table class="source_code">
|
|
943
|
+
<tr>
|
|
944
|
+
<td>
|
|
945
|
+
<pre class="lines">
|
|
946
|
+
|
|
947
|
+
|
|
948
|
+
81
|
|
949
|
+
82
|
|
950
|
+
83</pre>
|
|
951
|
+
</td>
|
|
952
|
+
<td>
|
|
953
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 81</span>
|
|
954
|
+
|
|
955
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_network_manager'>network_manager</span>
|
|
956
|
+
<span class='ivar'>@network_manager</span>
|
|
957
|
+
<span class='kw'>end</span></pre>
|
|
958
|
+
</td>
|
|
959
|
+
</tr>
|
|
960
|
+
</table>
|
|
961
|
+
</div>
|
|
962
|
+
|
|
963
|
+
|
|
964
|
+
<span id=""></span>
|
|
965
|
+
<div class="method_details ">
|
|
966
|
+
<h3 class="signature " id="timeout_settings-instance_method">
|
|
967
|
+
|
|
968
|
+
#<strong>timeout_settings</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
969
|
+
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
|
|
974
|
+
</h3><div class="docstring">
|
|
975
|
+
<div class="discussion">
|
|
976
|
+
|
|
977
|
+
<p>Returns the value of attribute timeout_settings.</p>
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
</div>
|
|
981
|
+
</div>
|
|
982
|
+
<div class="tags">
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
</div><table class="source_code">
|
|
986
|
+
<tr>
|
|
987
|
+
<td>
|
|
988
|
+
<pre class="lines">
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
60
|
|
992
|
+
61
|
|
993
|
+
62</pre>
|
|
994
|
+
</td>
|
|
995
|
+
<td>
|
|
996
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 60</span>
|
|
997
|
+
|
|
998
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_timeout_settings'>timeout_settings</span>
|
|
999
|
+
<span class='ivar'>@timeout_settings</span>
|
|
1000
|
+
<span class='kw'>end</span></pre>
|
|
1001
|
+
</td>
|
|
1002
|
+
</tr>
|
|
1003
|
+
</table>
|
|
1004
|
+
</div>
|
|
1005
|
+
|
|
1006
|
+
</div>
|
|
1007
|
+
|
|
1008
|
+
|
|
1009
|
+
<div id="instance_method_details" class="method_details_list">
|
|
1010
|
+
<h2>Instance Method Details</h2>
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
<div class="method_details first">
|
|
1014
|
+
<h3 class="signature first" id="ensure_isolated_world-instance_method">
|
|
1015
|
+
|
|
1016
|
+
#<strong>ensure_isolated_world</strong>(name) ⇒ <tt>Object</tt>
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
|
|
1022
|
+
</h3><div class="docstring">
|
|
1023
|
+
<div class="discussion">
|
|
1024
|
+
|
|
1025
|
+
|
|
1026
|
+
</div>
|
|
1027
|
+
</div>
|
|
1028
|
+
<div class="tags">
|
|
1029
|
+
<p class="tag_title">Parameters:</p>
|
|
1030
|
+
<ul class="param">
|
|
1031
|
+
|
|
1032
|
+
<li>
|
|
1033
|
+
|
|
1034
|
+
<span class='name'>name</span>
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
</li>
|
|
1042
|
+
|
|
1043
|
+
</ul>
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
</div><table class="source_code">
|
|
1047
|
+
<tr>
|
|
1048
|
+
<td>
|
|
1049
|
+
<pre class="lines">
|
|
1050
|
+
|
|
1051
|
+
|
|
1052
|
+
262
|
|
1053
|
+
263
|
|
1054
|
+
264
|
|
1055
|
+
265
|
|
1056
|
+
266
|
|
1057
|
+
267
|
|
1058
|
+
268
|
|
1059
|
+
269
|
|
1060
|
+
270
|
|
1061
|
+
271
|
|
1062
|
+
272
|
|
1063
|
+
273
|
|
1064
|
+
274
|
|
1065
|
+
275
|
|
1066
|
+
276
|
|
1067
|
+
277
|
|
1068
|
+
278</pre>
|
|
1069
|
+
</td>
|
|
1070
|
+
<td>
|
|
1071
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 262</span>
|
|
1072
|
+
|
|
1073
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_ensure_isolated_world'>ensure_isolated_world</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|
1074
|
+
<span class='kw'>return</span> <span class='kw'>if</span> <span class='ivar'>@isolated_worlds</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|
1075
|
+
<span class='ivar'>@isolated_worlds</span> <span class='op'><<</span> <span class='id identifier rubyid_name'>name</span>
|
|
1076
|
+
|
|
1077
|
+
<span class='ivar'>@client</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'>Page.addScriptToEvaluateOnNewDocument</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
|
1078
|
+
<span class='label'>source:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>//# sourceURL=</span><span class='embexpr_beg'>#{</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="ExecutionContext.html" title="Puppeteer::ExecutionContext (class)">ExecutionContext</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ExecutionContext.html#EVALUATION_SCRIPT_URL-constant" title="Puppeteer::ExecutionContext::EVALUATION_SCRIPT_URL (constant)">EVALUATION_SCRIPT_URL</a></span></span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
|
1079
|
+
<span class='label'>worldName:</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
|
1080
|
+
<span class='rparen'>)</span>
|
|
1081
|
+
<span class='id identifier rubyid_create_isolated_worlds_promises'>create_isolated_worlds_promises</span> <span class='op'>=</span> <span class='id identifier rubyid_frames'>frames</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_frame'>frame</span><span class='op'>|</span>
|
|
1082
|
+
<span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_async_send_message'>async_send_message</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Page.createIsolatedWorld</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
|
1083
|
+
<span class='label'>frameId:</span> <span class='id identifier rubyid_frame'>frame</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span>
|
|
1084
|
+
<span class='label'>grantUniveralAccess:</span> <span class='kw'>true</span><span class='comma'>,</span>
|
|
1085
|
+
<span class='label'>worldName:</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
|
1086
|
+
<span class='rparen'>)</span>
|
|
1087
|
+
<span class='kw'>end</span>
|
|
1088
|
+
<span class='id identifier rubyid_await_all'><span class='object_link'><a href="ConcurrentRubyUtils.html#await_all-instance_method" title="Puppeteer::ConcurrentRubyUtils#await_all (method)">await_all</a></span></span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_create_isolated_worlds_promises'>create_isolated_worlds_promises</span><span class='rparen'>)</span>
|
|
1089
|
+
<span class='kw'>end</span></pre>
|
|
1090
|
+
</td>
|
|
1091
|
+
</tr>
|
|
1092
|
+
</table>
|
|
1093
|
+
</div>
|
|
1094
|
+
|
|
1095
|
+
<div class="method_details ">
|
|
1096
|
+
<h3 class="signature " id="execution_context_by_id-instance_method">
|
|
1097
|
+
|
|
1098
|
+
#<strong>execution_context_by_id</strong>(context_id) ⇒ <tt>Object</tt>
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
|
|
1102
|
+
|
|
1103
|
+
|
|
1104
|
+
</h3><table class="source_code">
|
|
1105
|
+
<tr>
|
|
1106
|
+
<td>
|
|
1107
|
+
<pre class="lines">
|
|
1108
|
+
|
|
1109
|
+
|
|
1110
|
+
355
|
|
1111
|
+
356
|
|
1112
|
+
357
|
|
1113
|
+
358
|
|
1114
|
+
359
|
|
1115
|
+
360
|
|
1116
|
+
361</pre>
|
|
1117
|
+
</td>
|
|
1118
|
+
<td>
|
|
1119
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 355</span>
|
|
1120
|
+
|
|
1121
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_execution_context_by_id'>execution_context_by_id</span><span class='lparen'>(</span><span class='id identifier rubyid_context_id'>context_id</span><span class='rparen'>)</span>
|
|
1122
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='ivar'>@context_id_to_context</span><span class='lbracket'>[</span><span class='id identifier rubyid_context_id'>context_id</span><span class='rbracket'>]</span>
|
|
1123
|
+
<span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_context'>context</span>
|
|
1124
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>INTERNAL ERROR: missing context with id = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_context_id'>context_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|
1125
|
+
<span class='kw'>end</span>
|
|
1126
|
+
<span class='id identifier rubyid_context'>context</span>
|
|
1127
|
+
<span class='kw'>end</span></pre>
|
|
1128
|
+
</td>
|
|
1129
|
+
</tr>
|
|
1130
|
+
</table>
|
|
1131
|
+
</div>
|
|
1132
|
+
|
|
1133
|
+
<div class="method_details ">
|
|
1134
|
+
<h3 class="signature " id="frame-instance_method">
|
|
1135
|
+
|
|
1136
|
+
#<strong>frame</strong>(frame_id) ⇒ <tt>?<span class='object_link'><a href="Frame.html" title="Puppeteer::Frame (class)">Frame</a></span></tt>
|
|
1137
|
+
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+
|
|
1141
|
+
|
|
1142
|
+
</h3><div class="docstring">
|
|
1143
|
+
<div class="discussion">
|
|
1144
|
+
|
|
1145
|
+
|
|
1146
|
+
</div>
|
|
1147
|
+
</div>
|
|
1148
|
+
<div class="tags">
|
|
1149
|
+
<p class="tag_title">Parameters:</p>
|
|
1150
|
+
<ul class="param">
|
|
1151
|
+
|
|
1152
|
+
<li>
|
|
1153
|
+
|
|
1154
|
+
<span class='name'>frameId</span>
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
<span class='type'>(<tt>!string</tt>)</span>
|
|
1158
|
+
|
|
1159
|
+
|
|
1160
|
+
|
|
1161
|
+
</li>
|
|
1162
|
+
|
|
1163
|
+
</ul>
|
|
1164
|
+
|
|
1165
|
+
<p class="tag_title">Returns:</p>
|
|
1166
|
+
<ul class="return">
|
|
1167
|
+
|
|
1168
|
+
<li>
|
|
1169
|
+
|
|
1170
|
+
|
|
1171
|
+
<span class='type'>(<tt>?<span class='object_link'><a href="Frame.html" title="Puppeteer::Frame (class)">Frame</a></span></tt>)</span>
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
|
|
1175
|
+
</li>
|
|
1176
|
+
|
|
1177
|
+
</ul>
|
|
1178
|
+
|
|
1179
|
+
</div><table class="source_code">
|
|
1180
|
+
<tr>
|
|
1181
|
+
<td>
|
|
1182
|
+
<pre class="lines">
|
|
1183
|
+
|
|
1184
|
+
|
|
1185
|
+
202
|
|
1186
|
+
203
|
|
1187
|
+
204</pre>
|
|
1188
|
+
</td>
|
|
1189
|
+
<td>
|
|
1190
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 202</span>
|
|
1191
|
+
|
|
1192
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_frame'>frame</span><span class='lparen'>(</span><span class='id identifier rubyid_frame_id'>frame_id</span><span class='rparen'>)</span>
|
|
1193
|
+
<span class='ivar'>@frames</span><span class='lbracket'>[</span><span class='id identifier rubyid_frame_id'>frame_id</span><span class='rbracket'>]</span>
|
|
1194
|
+
<span class='kw'>end</span></pre>
|
|
1195
|
+
</td>
|
|
1196
|
+
</tr>
|
|
1197
|
+
</table>
|
|
1198
|
+
</div>
|
|
1199
|
+
|
|
1200
|
+
<div class="method_details ">
|
|
1201
|
+
<h3 class="signature " id="frames-instance_method">
|
|
1202
|
+
|
|
1203
|
+
#<strong>frames</strong> ⇒ <tt>!Array<!<span class='object_link'><a href="Frame.html" title="Puppeteer::Frame (class)">Frame</a></span>></tt>
|
|
1204
|
+
|
|
1205
|
+
|
|
1206
|
+
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
</h3><div class="docstring">
|
|
1210
|
+
<div class="discussion">
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
</div>
|
|
1214
|
+
</div>
|
|
1215
|
+
<div class="tags">
|
|
1216
|
+
|
|
1217
|
+
<p class="tag_title">Returns:</p>
|
|
1218
|
+
<ul class="return">
|
|
1219
|
+
|
|
1220
|
+
<li>
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
<span class='type'>(<tt>!Array<!<span class='object_link'><a href="Frame.html" title="Puppeteer::Frame (class)">Frame</a></span>></tt>)</span>
|
|
1224
|
+
|
|
1225
|
+
|
|
1226
|
+
|
|
1227
|
+
</li>
|
|
1228
|
+
|
|
1229
|
+
</ul>
|
|
1230
|
+
|
|
1231
|
+
</div><table class="source_code">
|
|
1232
|
+
<tr>
|
|
1233
|
+
<td>
|
|
1234
|
+
<pre class="lines">
|
|
1235
|
+
|
|
1236
|
+
|
|
1237
|
+
196
|
|
1238
|
+
197
|
|
1239
|
+
198</pre>
|
|
1240
|
+
</td>
|
|
1241
|
+
<td>
|
|
1242
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 196</span>
|
|
1243
|
+
|
|
1244
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_frames'>frames</span>
|
|
1245
|
+
<span class='ivar'>@frames</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span>
|
|
1246
|
+
<span class='kw'>end</span></pre>
|
|
1247
|
+
</td>
|
|
1248
|
+
</tr>
|
|
1249
|
+
</table>
|
|
1250
|
+
</div>
|
|
1251
|
+
|
|
1252
|
+
<div class="method_details ">
|
|
1253
|
+
<h3 class="signature " id="handle_execution_context_created-instance_method">
|
|
1254
|
+
|
|
1255
|
+
#<strong>handle_execution_context_created</strong>(context_payload) ⇒ <tt>Object</tt>
|
|
1256
|
+
|
|
1257
|
+
|
|
1258
|
+
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
</h3><div class="docstring">
|
|
1262
|
+
<div class="discussion">
|
|
1263
|
+
|
|
1264
|
+
|
|
1265
|
+
</div>
|
|
1266
|
+
</div>
|
|
1267
|
+
<div class="tags">
|
|
1268
|
+
<p class="tag_title">Parameters:</p>
|
|
1269
|
+
<ul class="param">
|
|
1270
|
+
|
|
1271
|
+
<li>
|
|
1272
|
+
|
|
1273
|
+
<span class='name'>context_payload</span>
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
1277
|
+
|
|
1278
|
+
|
|
1279
|
+
|
|
1280
|
+
</li>
|
|
1281
|
+
|
|
1282
|
+
</ul>
|
|
1283
|
+
|
|
1284
|
+
|
|
1285
|
+
</div><table class="source_code">
|
|
1286
|
+
<tr>
|
|
1287
|
+
<td>
|
|
1288
|
+
<pre class="lines">
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
299
|
|
1292
|
+
300
|
|
1293
|
+
301
|
|
1294
|
+
302
|
|
1295
|
+
303
|
|
1296
|
+
304
|
|
1297
|
+
305
|
|
1298
|
+
306
|
|
1299
|
+
307
|
|
1300
|
+
308
|
|
1301
|
+
309
|
|
1302
|
+
310
|
|
1303
|
+
311
|
|
1304
|
+
312
|
|
1305
|
+
313
|
|
1306
|
+
314
|
|
1307
|
+
315
|
|
1308
|
+
316
|
|
1309
|
+
317
|
|
1310
|
+
318
|
|
1311
|
+
319
|
|
1312
|
+
320
|
|
1313
|
+
321
|
|
1314
|
+
322
|
|
1315
|
+
323
|
|
1316
|
+
324</pre>
|
|
1317
|
+
</td>
|
|
1318
|
+
<td>
|
|
1319
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 299</span>
|
|
1320
|
+
|
|
1321
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_handle_execution_context_created'>handle_execution_context_created</span><span class='lparen'>(</span><span class='id identifier rubyid_context_payload'>context_payload</span><span class='rparen'>)</span>
|
|
1322
|
+
<span class='id identifier rubyid_frame'>frame</span> <span class='op'>=</span> <span class='id identifier rubyid_if_present'>if_present</span><span class='lparen'>(</span><span class='id identifier rubyid_context_payload'>context_payload</span><span class='period'>.</span><span class='id identifier rubyid_dig'>dig</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>auxData</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>frameId</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_frame_id'>frame_id</span><span class='op'>|</span> <span class='ivar'>@frames</span><span class='lbracket'>[</span><span class='id identifier rubyid_frame_id'>frame_id</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
|
|
1323
|
+
|
|
1324
|
+
<span class='id identifier rubyid_world'>world</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
1325
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_frame'>frame</span>
|
|
1326
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_context_payload'>context_payload</span><span class='period'>.</span><span class='id identifier rubyid_dig'>dig</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>auxData</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>isDefault</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
1327
|
+
<span class='id identifier rubyid_world'>world</span> <span class='op'>=</span> <span class='id identifier rubyid_frame'>frame</span><span class='period'>.</span><span class='id identifier rubyid_main_world'>main_world</span>
|
|
1328
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_context_payload'>context_payload</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>name</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='const'><span class='object_link'><a href="#UTILITY_WORLD_NAME-constant" title="Puppeteer::FrameManager::UTILITY_WORLD_NAME (constant)">UTILITY_WORLD_NAME</a></span></span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_frame'>frame</span><span class='period'>.</span><span class='id identifier rubyid_secondary_world'>secondary_world</span><span class='period'>.</span><span class='id identifier rubyid_has_context?'>has_context?</span>
|
|
1329
|
+
<span class='comment'># In case of multiple sessions to the same target, there's a race between
|
|
1330
|
+
</span> <span class='comment'># connections so we might end up creating multiple isolated worlds.
|
|
1331
|
+
</span> <span class='comment'># We can use either.
|
|
1332
|
+
</span> <span class='id identifier rubyid_world'>world</span> <span class='op'>=</span> <span class='id identifier rubyid_frame'>frame</span><span class='period'>.</span><span class='id identifier rubyid_secondary_world'>secondary_world</span>
|
|
1333
|
+
<span class='kw'>end</span>
|
|
1334
|
+
<span class='kw'>end</span>
|
|
1335
|
+
|
|
1336
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_context_payload'>context_payload</span><span class='period'>.</span><span class='id identifier rubyid_dig'>dig</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>auxData</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>type</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>isolated</span><span class='tstring_end'>'</span></span>
|
|
1337
|
+
<span class='ivar'>@isolated_worlds</span> <span class='op'><<</span> <span class='id identifier rubyid_context_payload'>context_payload</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>name</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
|
1338
|
+
<span class='kw'>end</span>
|
|
1339
|
+
|
|
1340
|
+
<span class='id identifier rubyid_context'>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="ExecutionContext.html" title="Puppeteer::ExecutionContext (class)">ExecutionContext</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ExecutionContext.html#initialize-instance_method" title="Puppeteer::ExecutionContext#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@client</span><span class='comma'>,</span> <span class='id identifier rubyid_context_payload'>context_payload</span><span class='comma'>,</span> <span class='id identifier rubyid_world'>world</span><span class='rparen'>)</span>
|
|
1341
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_world'>world</span>
|
|
1342
|
+
<span class='id identifier rubyid_world'>world</span><span class='period'>.</span><span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span>
|
|
1343
|
+
<span class='kw'>end</span>
|
|
1344
|
+
<span class='ivar'>@context_id_to_context</span><span class='lbracket'>[</span><span class='id identifier rubyid_context_payload'>context_payload</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>id</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span>
|
|
1345
|
+
<span class='ivar'>@context_id_created</span><span class='lbracket'>[</span><span class='id identifier rubyid_context_payload'>context_payload</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>id</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span>
|
|
1346
|
+
<span class='kw'>end</span></pre>
|
|
1347
|
+
</td>
|
|
1348
|
+
</tr>
|
|
1349
|
+
</table>
|
|
1350
|
+
</div>
|
|
1351
|
+
|
|
1352
|
+
<div class="method_details ">
|
|
1353
|
+
<h3 class="signature " id="handle_execution_context_destroyed-instance_method">
|
|
1354
|
+
|
|
1355
|
+
#<strong>handle_execution_context_destroyed</strong>(execution_context_id) ⇒ <tt>Object</tt>
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
</h3><div class="docstring">
|
|
1362
|
+
<div class="discussion">
|
|
1363
|
+
|
|
1364
|
+
|
|
1365
|
+
</div>
|
|
1366
|
+
</div>
|
|
1367
|
+
<div class="tags">
|
|
1368
|
+
<p class="tag_title">Parameters:</p>
|
|
1369
|
+
<ul class="param">
|
|
1370
|
+
|
|
1371
|
+
<li>
|
|
1372
|
+
|
|
1373
|
+
<span class='name'>executionContextId</span>
|
|
1374
|
+
|
|
1375
|
+
|
|
1376
|
+
<span class='type'>(<tt>number</tt>)</span>
|
|
1377
|
+
|
|
1378
|
+
|
|
1379
|
+
|
|
1380
|
+
</li>
|
|
1381
|
+
|
|
1382
|
+
</ul>
|
|
1383
|
+
|
|
1384
|
+
|
|
1385
|
+
</div><table class="source_code">
|
|
1386
|
+
<tr>
|
|
1387
|
+
<td>
|
|
1388
|
+
<pre class="lines">
|
|
1389
|
+
|
|
1390
|
+
|
|
1391
|
+
327
|
|
1392
|
+
328
|
|
1393
|
+
329
|
|
1394
|
+
330
|
|
1395
|
+
331
|
|
1396
|
+
332
|
|
1397
|
+
333
|
|
1398
|
+
334
|
|
1399
|
+
335</pre>
|
|
1400
|
+
</td>
|
|
1401
|
+
<td>
|
|
1402
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 327</span>
|
|
1403
|
+
|
|
1404
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_handle_execution_context_destroyed'>handle_execution_context_destroyed</span><span class='lparen'>(</span><span class='id identifier rubyid_execution_context_id'>execution_context_id</span><span class='rparen'>)</span>
|
|
1405
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='ivar'>@context_id_to_context</span><span class='lbracket'>[</span><span class='id identifier rubyid_execution_context_id'>execution_context_id</span><span class='rbracket'>]</span>
|
|
1406
|
+
<span class='kw'>return</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_context'>context</span>
|
|
1407
|
+
<span class='ivar'>@context_id_to_context</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_execution_context_id'>execution_context_id</span><span class='rparen'>)</span>
|
|
1408
|
+
<span class='ivar'>@context_id_created</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_execution_context_id'>execution_context_id</span><span class='rparen'>)</span>
|
|
1409
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_world'>world</span>
|
|
1410
|
+
<span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_world'>world</span><span class='period'>.</span><span class='id identifier rubyid_delete_context'>delete_context</span><span class='lparen'>(</span><span class='id identifier rubyid_execution_context_id'>execution_context_id</span><span class='rparen'>)</span>
|
|
1411
|
+
<span class='kw'>end</span>
|
|
1412
|
+
<span class='kw'>end</span></pre>
|
|
1413
|
+
</td>
|
|
1414
|
+
</tr>
|
|
1415
|
+
</table>
|
|
1416
|
+
</div>
|
|
1417
|
+
|
|
1418
|
+
<div class="method_details ">
|
|
1419
|
+
<h3 class="signature " id="handle_execution_contexts_cleared-instance_method">
|
|
1420
|
+
|
|
1421
|
+
#<strong>handle_execution_contexts_cleared</strong> ⇒ <tt>Object</tt>
|
|
1422
|
+
|
|
1423
|
+
|
|
1424
|
+
|
|
1425
|
+
|
|
1426
|
+
|
|
1427
|
+
</h3><table class="source_code">
|
|
1428
|
+
<tr>
|
|
1429
|
+
<td>
|
|
1430
|
+
<pre class="lines">
|
|
1431
|
+
|
|
1432
|
+
|
|
1433
|
+
337
|
|
1434
|
+
338
|
|
1435
|
+
339
|
|
1436
|
+
340
|
|
1437
|
+
341
|
|
1438
|
+
342
|
|
1439
|
+
343
|
|
1440
|
+
344
|
|
1441
|
+
345
|
|
1442
|
+
346
|
|
1443
|
+
347
|
|
1444
|
+
348
|
|
1445
|
+
349
|
|
1446
|
+
350
|
|
1447
|
+
351
|
|
1448
|
+
352
|
|
1449
|
+
353</pre>
|
|
1450
|
+
</td>
|
|
1451
|
+
<td>
|
|
1452
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 337</span>
|
|
1453
|
+
|
|
1454
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_handle_execution_contexts_cleared'>handle_execution_contexts_cleared</span>
|
|
1455
|
+
<span class='comment'># executionContextsCleared is often notified after executionContextCreated.
|
|
1456
|
+
</span> <span class='comment'># D, [2020-04-06T01:47:03.101227 #13823] DEBUG -- : RECV << {"method"=>"Runtime.executionContextCreated", "params"=>{"context"=>{"id"=>5, "origin"=>"https://github.com", "name"=>"", "auxData"=>{"isDefault"=>true, "type"=>"default", "frameId"=>"71C347B70848B89DDDEFAA8AB5B0BC92"}}}, "sessionId"=>"53F088EED260C28001D26A019F95D9E3"}
|
|
1457
|
+
</span> <span class='comment'># D, [2020-04-06T01:47:03.101439 #13823] DEBUG -- : RECV << {"method"=>"Page.frameNavigated", "params"=>{"frame"=>{"id"=>"71C347B70848B89DDDEFAA8AB5B0BC92", "loaderId"=>"80338225D035AC96BAE8F6D4E81C7D51", "url"=>"https://github.com/search?q=puppeteer", "securityOrigin"=>"https://github.com", "mimeType"=>"text/html"}}, "sessionId"=>"53F088EED260C28001D26A019F95D9E3"}
|
|
1458
|
+
</span> <span class='comment'># D, [2020-04-06T01:47:03.101325 #13823] DEBUG -- : RECV << {"method"=>"Target.targetInfoChanged", "params"=>{"targetInfo"=>{"targetId"=>"71C347B70848B89DDDEFAA8AB5B0BC92", "type"=>"page", "title"=>"https://github.com/search?q=puppeteer", "url"=>"https://github.com/search?q=puppeteer", "attached"=>true, "browserContextId"=>"AF37BC660284CE1552B4ECB147BE9305"}}}
|
|
1459
|
+
</span> <span class='comment'># D, [2020-04-06T01:47:03.101269 #13823] DEBUG -- : RECV << {"method"=>"Runtime.executionContextsCleared", "params"=>{}, "sessionId"=>"53F088EED260C28001D26A019F95D9E3"}
|
|
1460
|
+
</span> <span class='comment'># it unexpectedly clears the created execution context.
|
|
1461
|
+
</span> <span class='comment'># To avoid the problem, just skip recent created ids.
|
|
1462
|
+
</span> <span class='id identifier rubyid_now'>now</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span>
|
|
1463
|
+
<span class='id identifier rubyid_context_ids_to_skip'>context_ids_to_skip</span> <span class='op'>=</span> <span class='ivar'>@context_id_created</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_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_now'>now</span> <span class='op'>-</span> <span class='id identifier rubyid_v'>v</span> <span class='op'><</span> <span class='int'>1</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span>
|
|
1464
|
+
<span class='ivar'>@context_id_to_context</span><span class='period'>.</span><span class='id identifier rubyid_reject'>reject</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_context_ids_to_skip'>context_ids_to_skip</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='rparen'>)</span> <span class='rbrace'>}</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_execution_context_id'>execution_context_id</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='op'>|</span>
|
|
1465
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_world'>world</span>
|
|
1466
|
+
<span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_world'>world</span><span class='period'>.</span><span class='id identifier rubyid_delete_context'>delete_context</span><span class='lparen'>(</span><span class='id identifier rubyid_execution_context_id'>execution_context_id</span><span class='rparen'>)</span>
|
|
1467
|
+
<span class='kw'>end</span>
|
|
1468
|
+
<span class='kw'>end</span>
|
|
1469
|
+
<span class='ivar'>@context_id_to_context</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_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_context_ids_to_skip'>context_ids_to_skip</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
1470
|
+
<span class='kw'>end</span></pre>
|
|
1471
|
+
</td>
|
|
1472
|
+
</tr>
|
|
1473
|
+
</table>
|
|
1474
|
+
</div>
|
|
1475
|
+
|
|
1476
|
+
<div class="method_details ">
|
|
1477
|
+
<h3 class="signature " id="handle_frame_attached-instance_method">
|
|
1478
|
+
|
|
1479
|
+
#<strong>handle_frame_attached</strong>(frame_id, parent_frame_id) ⇒ <tt>Object</tt>
|
|
1480
|
+
|
|
1481
|
+
|
|
1482
|
+
|
|
1483
|
+
|
|
1484
|
+
|
|
1485
|
+
</h3><div class="docstring">
|
|
1486
|
+
<div class="discussion">
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
</div>
|
|
1490
|
+
</div>
|
|
1491
|
+
<div class="tags">
|
|
1492
|
+
<p class="tag_title">Parameters:</p>
|
|
1493
|
+
<ul class="param">
|
|
1494
|
+
|
|
1495
|
+
<li>
|
|
1496
|
+
|
|
1497
|
+
<span class='name'>frameId</span>
|
|
1498
|
+
|
|
1499
|
+
|
|
1500
|
+
<span class='type'>(<tt>string</tt>)</span>
|
|
1501
|
+
|
|
1502
|
+
|
|
1503
|
+
|
|
1504
|
+
</li>
|
|
1505
|
+
|
|
1506
|
+
<li>
|
|
1507
|
+
|
|
1508
|
+
<span class='name'>parentFrameId</span>
|
|
1509
|
+
|
|
1510
|
+
|
|
1511
|
+
<span class='type'>(<tt>?string</tt>)</span>
|
|
1512
|
+
|
|
1513
|
+
|
|
1514
|
+
|
|
1515
|
+
</li>
|
|
1516
|
+
|
|
1517
|
+
</ul>
|
|
1518
|
+
|
|
1519
|
+
|
|
1520
|
+
</div><table class="source_code">
|
|
1521
|
+
<tr>
|
|
1522
|
+
<td>
|
|
1523
|
+
<pre class="lines">
|
|
1524
|
+
|
|
1525
|
+
|
|
1526
|
+
208
|
|
1527
|
+
209
|
|
1528
|
+
210
|
|
1529
|
+
211
|
|
1530
|
+
212
|
|
1531
|
+
213
|
|
1532
|
+
214
|
|
1533
|
+
215
|
|
1534
|
+
216
|
|
1535
|
+
217
|
|
1536
|
+
218</pre>
|
|
1537
|
+
</td>
|
|
1538
|
+
<td>
|
|
1539
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 208</span>
|
|
1540
|
+
|
|
1541
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_handle_frame_attached'>handle_frame_attached</span><span class='lparen'>(</span><span class='id identifier rubyid_frame_id'>frame_id</span><span class='comma'>,</span> <span class='id identifier rubyid_parent_frame_id'>parent_frame_id</span><span class='rparen'>)</span>
|
|
1542
|
+
<span class='kw'>return</span> <span class='kw'>if</span> <span class='ivar'>@frames</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_frame_id'>frame_id</span><span class='rparen'>)</span>
|
|
1543
|
+
<span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_parent_frame_id'>parent_frame_id</span>
|
|
1544
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgymentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>parent_frame_id must not be nil</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
1545
|
+
<span class='kw'>end</span>
|
|
1546
|
+
<span class='id identifier rubyid_parent_frame'>parent_frame</span> <span class='op'>=</span> <span class='ivar'>@frames</span><span class='lbracket'>[</span><span class='id identifier rubyid_parent_frame_id'>parent_frame_id</span><span class='rbracket'>]</span>
|
|
1547
|
+
<span class='id identifier rubyid_frame'>frame</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="Frame.html" title="Puppeteer::Frame (class)">Frame</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Frame.html#initialize-instance_method" title="Puppeteer::Frame#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='ivar'>@client</span><span class='comma'>,</span> <span class='id identifier rubyid_parent_frame'>parent_frame</span><span class='comma'>,</span> <span class='id identifier rubyid_frame_id'>frame_id</span><span class='rparen'>)</span>
|
|
1548
|
+
<span class='ivar'>@frames</span><span class='lbracket'>[</span><span class='id identifier rubyid_frame_id'>frame_id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_frame'>frame</span>
|
|
1549
|
+
|
|
1550
|
+
<span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.FrameManager.FrameAttached</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_frame'>frame</span>
|
|
1551
|
+
<span class='kw'>end</span></pre>
|
|
1552
|
+
</td>
|
|
1553
|
+
</tr>
|
|
1554
|
+
</table>
|
|
1555
|
+
</div>
|
|
1556
|
+
|
|
1557
|
+
<div class="method_details ">
|
|
1558
|
+
<h3 class="signature " id="handle_frame_detached-instance_method">
|
|
1559
|
+
|
|
1560
|
+
#<strong>handle_frame_detached</strong>(frame_id) ⇒ <tt>Object</tt>
|
|
1561
|
+
|
|
1562
|
+
|
|
1563
|
+
|
|
1564
|
+
|
|
1565
|
+
|
|
1566
|
+
</h3><div class="docstring">
|
|
1567
|
+
<div class="discussion">
|
|
1568
|
+
|
|
1569
|
+
|
|
1570
|
+
</div>
|
|
1571
|
+
</div>
|
|
1572
|
+
<div class="tags">
|
|
1573
|
+
<p class="tag_title">Parameters:</p>
|
|
1574
|
+
<ul class="param">
|
|
1575
|
+
|
|
1576
|
+
<li>
|
|
1577
|
+
|
|
1578
|
+
<span class='name'>frame_id</span>
|
|
1579
|
+
|
|
1580
|
+
|
|
1581
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
1582
|
+
|
|
1583
|
+
|
|
1584
|
+
|
|
1585
|
+
</li>
|
|
1586
|
+
|
|
1587
|
+
</ul>
|
|
1588
|
+
|
|
1589
|
+
|
|
1590
|
+
</div><table class="source_code">
|
|
1591
|
+
<tr>
|
|
1592
|
+
<td>
|
|
1593
|
+
<pre class="lines">
|
|
1594
|
+
|
|
1595
|
+
|
|
1596
|
+
291
|
|
1597
|
+
292
|
|
1598
|
+
293
|
|
1599
|
+
294
|
|
1600
|
+
295
|
|
1601
|
+
296</pre>
|
|
1602
|
+
</td>
|
|
1603
|
+
<td>
|
|
1604
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 291</span>
|
|
1605
|
+
|
|
1606
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_handle_frame_detached'>handle_frame_detached</span><span class='lparen'>(</span><span class='id identifier rubyid_frame_id'>frame_id</span><span class='rparen'>)</span>
|
|
1607
|
+
<span class='id identifier rubyid_frame'>frame</span> <span class='op'>=</span> <span class='ivar'>@frames</span><span class='lbracket'>[</span><span class='id identifier rubyid_frame_id'>frame_id</span><span class='rbracket'>]</span>
|
|
1608
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_frame'>frame</span>
|
|
1609
|
+
<span class='id identifier rubyid_remove_frame_recursively'>remove_frame_recursively</span><span class='lparen'>(</span><span class='id identifier rubyid_frame'>frame</span><span class='rparen'>)</span>
|
|
1610
|
+
<span class='kw'>end</span>
|
|
1611
|
+
<span class='kw'>end</span></pre>
|
|
1612
|
+
</td>
|
|
1613
|
+
</tr>
|
|
1614
|
+
</table>
|
|
1615
|
+
</div>
|
|
1616
|
+
|
|
1617
|
+
<div class="method_details ">
|
|
1618
|
+
<h3 class="signature " id="handle_frame_navigated-instance_method">
|
|
1619
|
+
|
|
1620
|
+
#<strong>handle_frame_navigated</strong>(frame_payload) ⇒ <tt>Object</tt>
|
|
1621
|
+
|
|
1622
|
+
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
|
|
1626
|
+
</h3><div class="docstring">
|
|
1627
|
+
<div class="discussion">
|
|
1628
|
+
|
|
1629
|
+
|
|
1630
|
+
</div>
|
|
1631
|
+
</div>
|
|
1632
|
+
<div class="tags">
|
|
1633
|
+
<p class="tag_title">Parameters:</p>
|
|
1634
|
+
<ul class="param">
|
|
1635
|
+
|
|
1636
|
+
<li>
|
|
1637
|
+
|
|
1638
|
+
<span class='name'>frame_payload</span>
|
|
1639
|
+
|
|
1640
|
+
|
|
1641
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
1642
|
+
|
|
1643
|
+
|
|
1644
|
+
|
|
1645
|
+
</li>
|
|
1646
|
+
|
|
1647
|
+
</ul>
|
|
1648
|
+
|
|
1649
|
+
|
|
1650
|
+
</div><table class="source_code">
|
|
1651
|
+
<tr>
|
|
1652
|
+
<td>
|
|
1653
|
+
<pre class="lines">
|
|
1654
|
+
|
|
1655
|
+
|
|
1656
|
+
221
|
|
1657
|
+
222
|
|
1658
|
+
223
|
|
1659
|
+
224
|
|
1660
|
+
225
|
|
1661
|
+
226
|
|
1662
|
+
227
|
|
1663
|
+
228
|
|
1664
|
+
229
|
|
1665
|
+
230
|
|
1666
|
+
231
|
|
1667
|
+
232
|
|
1668
|
+
233
|
|
1669
|
+
234
|
|
1670
|
+
235
|
|
1671
|
+
236
|
|
1672
|
+
237
|
|
1673
|
+
238
|
|
1674
|
+
239
|
|
1675
|
+
240
|
|
1676
|
+
241
|
|
1677
|
+
242
|
|
1678
|
+
243
|
|
1679
|
+
244
|
|
1680
|
+
245
|
|
1681
|
+
246
|
|
1682
|
+
247
|
|
1683
|
+
248
|
|
1684
|
+
249
|
|
1685
|
+
250
|
|
1686
|
+
251
|
|
1687
|
+
252
|
|
1688
|
+
253
|
|
1689
|
+
254
|
|
1690
|
+
255
|
|
1691
|
+
256
|
|
1692
|
+
257
|
|
1693
|
+
258
|
|
1694
|
+
259</pre>
|
|
1695
|
+
</td>
|
|
1696
|
+
<td>
|
|
1697
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 221</span>
|
|
1698
|
+
|
|
1699
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_handle_frame_navigated'>handle_frame_navigated</span><span class='lparen'>(</span><span class='id identifier rubyid_frame_payload'>frame_payload</span><span class='rparen'>)</span>
|
|
1700
|
+
<span class='id identifier rubyid_is_main_frame'>is_main_frame</span> <span class='op'>=</span> <span class='op'>!</span><span class='id identifier rubyid_frame_payload'>frame_payload</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>parentId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
|
1701
|
+
<span class='id identifier rubyid_frame'>frame</span> <span class='op'>=</span>
|
|
1702
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_is_main_frame'>is_main_frame</span>
|
|
1703
|
+
<span class='ivar'>@main_frame</span>
|
|
1704
|
+
<span class='kw'>else</span>
|
|
1705
|
+
<span class='ivar'>@frames</span><span class='lbracket'>[</span><span class='id identifier rubyid_frame_payload'>frame_payload</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>id</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rbracket'>]</span>
|
|
1706
|
+
<span class='kw'>end</span>
|
|
1707
|
+
|
|
1708
|
+
<span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_is_main_frame'>is_main_frame</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_frame'>frame</span>
|
|
1709
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>We either navigate top level or have old version of the navigated frame</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
1710
|
+
<span class='kw'>end</span>
|
|
1711
|
+
|
|
1712
|
+
<span class='comment'># Detach all child frames first.
|
|
1713
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_frame'>frame</span>
|
|
1714
|
+
<span class='id identifier rubyid_frame'>frame</span><span class='period'>.</span><span class='id identifier rubyid_child_frames'>child_frames</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_child'>child</span><span class='op'>|</span>
|
|
1715
|
+
<span class='id identifier rubyid_remove_frame_recursively'>remove_frame_recursively</span><span class='lparen'>(</span><span class='id identifier rubyid_child'>child</span><span class='rparen'>)</span>
|
|
1716
|
+
<span class='kw'>end</span>
|
|
1717
|
+
<span class='kw'>end</span>
|
|
1718
|
+
|
|
1719
|
+
<span class='comment'># Update or create main frame.
|
|
1720
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_is_main_frame'>is_main_frame</span>
|
|
1721
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_frame'>frame</span>
|
|
1722
|
+
<span class='comment'># Update frame id to retain frame identity on cross-process navigation.
|
|
1723
|
+
</span> <span class='ivar'>@frames</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_frame'>frame</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
|
1724
|
+
<span class='id identifier rubyid_frame'>frame</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='id identifier rubyid_frame_payload'>frame_payload</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>id</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
|
1725
|
+
<span class='kw'>else</span>
|
|
1726
|
+
<span class='comment'># Initial main frame navigation.
|
|
1727
|
+
</span> <span class='id identifier rubyid_frame'>frame</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="Frame.html" title="Puppeteer::Frame (class)">Frame</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Frame.html#initialize-instance_method" title="Puppeteer::Frame#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='ivar'>@client</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_frame_payload'>frame_payload</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>id</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
1728
|
+
<span class='kw'>end</span>
|
|
1729
|
+
<span class='ivar'>@frames</span><span class='lbracket'>[</span><span class='id identifier rubyid_frame_payload'>frame_payload</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>id</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_frame'>frame</span>
|
|
1730
|
+
<span class='ivar'>@main_frame</span> <span class='op'>=</span> <span class='id identifier rubyid_frame'>frame</span>
|
|
1731
|
+
<span class='kw'>end</span>
|
|
1732
|
+
|
|
1733
|
+
<span class='comment'># Update frame payload.
|
|
1734
|
+
</span> <span class='id identifier rubyid_frame'>frame</span><span class='period'>.</span><span class='id identifier rubyid_navigated'>navigated</span><span class='lparen'>(</span><span class='id identifier rubyid_frame_payload'>frame_payload</span><span class='rparen'>)</span>
|
|
1735
|
+
|
|
1736
|
+
<span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.FrameManager.FrameNavigated</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_frame'>frame</span>
|
|
1737
|
+
<span class='kw'>end</span></pre>
|
|
1738
|
+
</td>
|
|
1739
|
+
</tr>
|
|
1740
|
+
</table>
|
|
1741
|
+
</div>
|
|
1742
|
+
|
|
1743
|
+
<div class="method_details ">
|
|
1744
|
+
<h3 class="signature " id="handle_frame_navigated_within_document-instance_method">
|
|
1745
|
+
|
|
1746
|
+
#<strong>handle_frame_navigated_within_document</strong>(frame_id, url) ⇒ <tt>Object</tt>
|
|
1747
|
+
|
|
1748
|
+
|
|
1749
|
+
|
|
1750
|
+
|
|
1751
|
+
|
|
1752
|
+
</h3><div class="docstring">
|
|
1753
|
+
<div class="discussion">
|
|
1754
|
+
|
|
1755
|
+
|
|
1756
|
+
</div>
|
|
1757
|
+
</div>
|
|
1758
|
+
<div class="tags">
|
|
1759
|
+
<p class="tag_title">Parameters:</p>
|
|
1760
|
+
<ul class="param">
|
|
1761
|
+
|
|
1762
|
+
<li>
|
|
1763
|
+
|
|
1764
|
+
<span class='name'>frame_id</span>
|
|
1765
|
+
|
|
1766
|
+
|
|
1767
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
1768
|
+
|
|
1769
|
+
|
|
1770
|
+
|
|
1771
|
+
</li>
|
|
1772
|
+
|
|
1773
|
+
<li>
|
|
1774
|
+
|
|
1775
|
+
<span class='name'>url</span>
|
|
1776
|
+
|
|
1777
|
+
|
|
1778
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
1779
|
+
|
|
1780
|
+
|
|
1781
|
+
|
|
1782
|
+
</li>
|
|
1783
|
+
|
|
1784
|
+
</ul>
|
|
1785
|
+
|
|
1786
|
+
|
|
1787
|
+
</div><table class="source_code">
|
|
1788
|
+
<tr>
|
|
1789
|
+
<td>
|
|
1790
|
+
<pre class="lines">
|
|
1791
|
+
|
|
1792
|
+
|
|
1793
|
+
282
|
|
1794
|
+
283
|
|
1795
|
+
284
|
|
1796
|
+
285
|
|
1797
|
+
286
|
|
1798
|
+
287
|
|
1799
|
+
288</pre>
|
|
1800
|
+
</td>
|
|
1801
|
+
<td>
|
|
1802
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 282</span>
|
|
1803
|
+
|
|
1804
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_handle_frame_navigated_within_document'>handle_frame_navigated_within_document</span><span class='lparen'>(</span><span class='id identifier rubyid_frame_id'>frame_id</span><span class='comma'>,</span> <span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
|
|
1805
|
+
<span class='id identifier rubyid_frame'>frame</span> <span class='op'>=</span> <span class='ivar'>@frames</span><span class='lbracket'>[</span><span class='id identifier rubyid_frame_id'>frame_id</span><span class='rbracket'>]</span>
|
|
1806
|
+
<span class='kw'>return</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_frame'>frame</span>
|
|
1807
|
+
<span class='id identifier rubyid_frame'>frame</span><span class='period'>.</span><span class='id identifier rubyid_navigated_within_document'>navigated_within_document</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
|
|
1808
|
+
<span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.FrameManager.FrameNavigatedWithinDocument</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_frame'>frame</span>
|
|
1809
|
+
<span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.FrameManager.FrameNavigated</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_frame'>frame</span>
|
|
1810
|
+
<span class='kw'>end</span></pre>
|
|
1811
|
+
</td>
|
|
1812
|
+
</tr>
|
|
1813
|
+
</table>
|
|
1814
|
+
</div>
|
|
1815
|
+
|
|
1816
|
+
<div class="method_details ">
|
|
1817
|
+
<h3 class="signature " id="handle_frame_stopped_loading-instance_method">
|
|
1818
|
+
|
|
1819
|
+
#<strong>handle_frame_stopped_loading</strong>(frame_id) ⇒ <tt>Object</tt>
|
|
1820
|
+
|
|
1821
|
+
|
|
1822
|
+
|
|
1823
|
+
|
|
1824
|
+
|
|
1825
|
+
</h3><div class="docstring">
|
|
1826
|
+
<div class="discussion">
|
|
1827
|
+
|
|
1828
|
+
|
|
1829
|
+
</div>
|
|
1830
|
+
</div>
|
|
1831
|
+
<div class="tags">
|
|
1832
|
+
<p class="tag_title">Parameters:</p>
|
|
1833
|
+
<ul class="param">
|
|
1834
|
+
|
|
1835
|
+
<li>
|
|
1836
|
+
|
|
1837
|
+
<span class='name'>frameId</span>
|
|
1838
|
+
|
|
1839
|
+
|
|
1840
|
+
<span class='type'>(<tt>string</tt>)</span>
|
|
1841
|
+
|
|
1842
|
+
|
|
1843
|
+
|
|
1844
|
+
</li>
|
|
1845
|
+
|
|
1846
|
+
</ul>
|
|
1847
|
+
|
|
1848
|
+
|
|
1849
|
+
</div><table class="source_code">
|
|
1850
|
+
<tr>
|
|
1851
|
+
<td>
|
|
1852
|
+
<pre class="lines">
|
|
1853
|
+
|
|
1854
|
+
|
|
1855
|
+
165
|
|
1856
|
+
166
|
|
1857
|
+
167
|
|
1858
|
+
168
|
|
1859
|
+
169
|
|
1860
|
+
170</pre>
|
|
1861
|
+
</td>
|
|
1862
|
+
<td>
|
|
1863
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 165</span>
|
|
1864
|
+
|
|
1865
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_handle_frame_stopped_loading'>handle_frame_stopped_loading</span><span class='lparen'>(</span><span class='id identifier rubyid_frame_id'>frame_id</span><span class='rparen'>)</span>
|
|
1866
|
+
<span class='id identifier rubyid_frame'>frame</span> <span class='op'>=</span> <span class='ivar'>@frames</span><span class='lbracket'>[</span><span class='id identifier rubyid_frame_id'>frame_id</span><span class='rbracket'>]</span>
|
|
1867
|
+
<span class='kw'>return</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_frame'>frame</span>
|
|
1868
|
+
<span class='id identifier rubyid_frame'>frame</span><span class='period'>.</span><span class='id identifier rubyid_handle_loading_stopped'>handle_loading_stopped</span>
|
|
1869
|
+
<span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.FrameManager.LifecycleEvent</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_frame'>frame</span>
|
|
1870
|
+
<span class='kw'>end</span></pre>
|
|
1871
|
+
</td>
|
|
1872
|
+
</tr>
|
|
1873
|
+
</table>
|
|
1874
|
+
</div>
|
|
1875
|
+
|
|
1876
|
+
<div class="method_details ">
|
|
1877
|
+
<h3 class="signature " id="handle_frame_tree-instance_method">
|
|
1878
|
+
|
|
1879
|
+
#<strong>handle_frame_tree</strong>(frame_tree) ⇒ <tt>Object</tt>
|
|
1880
|
+
|
|
1881
|
+
|
|
1882
|
+
|
|
1883
|
+
|
|
1884
|
+
|
|
1885
|
+
</h3><div class="docstring">
|
|
1886
|
+
<div class="discussion">
|
|
1887
|
+
|
|
1888
|
+
|
|
1889
|
+
</div>
|
|
1890
|
+
</div>
|
|
1891
|
+
<div class="tags">
|
|
1892
|
+
<p class="tag_title">Parameters:</p>
|
|
1893
|
+
<ul class="param">
|
|
1894
|
+
|
|
1895
|
+
<li>
|
|
1896
|
+
|
|
1897
|
+
<span class='name'>frame_tree</span>
|
|
1898
|
+
|
|
1899
|
+
|
|
1900
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
1901
|
+
|
|
1902
|
+
|
|
1903
|
+
|
|
1904
|
+
</li>
|
|
1905
|
+
|
|
1906
|
+
</ul>
|
|
1907
|
+
|
|
1908
|
+
|
|
1909
|
+
</div><table class="source_code">
|
|
1910
|
+
<tr>
|
|
1911
|
+
<td>
|
|
1912
|
+
<pre class="lines">
|
|
1913
|
+
|
|
1914
|
+
|
|
1915
|
+
173
|
|
1916
|
+
174
|
|
1917
|
+
175
|
|
1918
|
+
176
|
|
1919
|
+
177
|
|
1920
|
+
178
|
|
1921
|
+
179
|
|
1922
|
+
180
|
|
1923
|
+
181
|
|
1924
|
+
182
|
|
1925
|
+
183</pre>
|
|
1926
|
+
</td>
|
|
1927
|
+
<td>
|
|
1928
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 173</span>
|
|
1929
|
+
|
|
1930
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_handle_frame_tree'>handle_frame_tree</span><span class='lparen'>(</span><span class='id identifier rubyid_frame_tree'>frame_tree</span><span class='rparen'>)</span>
|
|
1931
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_frame_tree'>frame_tree</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>frame</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>parentId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
|
1932
|
+
<span class='id identifier rubyid_handle_frame_attached'>handle_frame_attached</span><span class='lparen'>(</span><span class='id identifier rubyid_frame_tree'>frame_tree</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>frame</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>id</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_frame_tree'>frame_tree</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>frame</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>parentId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
1933
|
+
<span class='kw'>end</span>
|
|
1934
|
+
<span class='id identifier rubyid_handle_frame_navigated'>handle_frame_navigated</span><span class='lparen'>(</span><span class='id identifier rubyid_frame_tree'>frame_tree</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>frame</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
1935
|
+
<span class='kw'>return</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_frame_tree'>frame_tree</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>childFrames</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
|
1936
|
+
|
|
1937
|
+
<span class='id identifier rubyid_frame_tree'>frame_tree</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>childFrames</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</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_child'>child</span><span class='op'>|</span>
|
|
1938
|
+
<span class='id identifier rubyid_handle_frame_tree'>handle_frame_tree</span><span class='lparen'>(</span><span class='id identifier rubyid_child'>child</span><span class='rparen'>)</span>
|
|
1939
|
+
<span class='kw'>end</span>
|
|
1940
|
+
<span class='kw'>end</span></pre>
|
|
1941
|
+
</td>
|
|
1942
|
+
</tr>
|
|
1943
|
+
</table>
|
|
1944
|
+
</div>
|
|
1945
|
+
|
|
1946
|
+
<div class="method_details ">
|
|
1947
|
+
<h3 class="signature " id="handle_lifecycle_event-instance_method">
|
|
1948
|
+
|
|
1949
|
+
#<strong>handle_lifecycle_event</strong>(event) ⇒ <tt>Object</tt>
|
|
1950
|
+
|
|
1951
|
+
|
|
1952
|
+
|
|
1953
|
+
|
|
1954
|
+
|
|
1955
|
+
</h3><div class="docstring">
|
|
1956
|
+
<div class="discussion">
|
|
1957
|
+
|
|
1958
|
+
|
|
1959
|
+
</div>
|
|
1960
|
+
</div>
|
|
1961
|
+
<div class="tags">
|
|
1962
|
+
<p class="tag_title">Parameters:</p>
|
|
1963
|
+
<ul class="param">
|
|
1964
|
+
|
|
1965
|
+
<li>
|
|
1966
|
+
|
|
1967
|
+
<span class='name'>event</span>
|
|
1968
|
+
|
|
1969
|
+
|
|
1970
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
1971
|
+
|
|
1972
|
+
|
|
1973
|
+
|
|
1974
|
+
</li>
|
|
1975
|
+
|
|
1976
|
+
</ul>
|
|
1977
|
+
|
|
1978
|
+
|
|
1979
|
+
</div><table class="source_code">
|
|
1980
|
+
<tr>
|
|
1981
|
+
<td>
|
|
1982
|
+
<pre class="lines">
|
|
1983
|
+
|
|
1984
|
+
|
|
1985
|
+
157
|
|
1986
|
+
158
|
|
1987
|
+
159
|
|
1988
|
+
160
|
|
1989
|
+
161
|
|
1990
|
+
162</pre>
|
|
1991
|
+
</td>
|
|
1992
|
+
<td>
|
|
1993
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 157</span>
|
|
1994
|
+
|
|
1995
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_handle_lifecycle_event'>handle_lifecycle_event</span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='rparen'>)</span>
|
|
1996
|
+
<span class='id identifier rubyid_frame'>frame</span> <span class='op'>=</span> <span class='ivar'>@frames</span><span class='lbracket'>[</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'>frameId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rbracket'>]</span>
|
|
1997
|
+
<span class='kw'>return</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_frame'>frame</span>
|
|
1998
|
+
<span class='id identifier rubyid_frame'>frame</span><span class='period'>.</span><span class='id identifier rubyid_handle_lifecycle_event'>handle_lifecycle_event</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'>loaderId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</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'>name</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
1999
|
+
<span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Events.FrameManager.LifecycleEvent</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_frame'>frame</span>
|
|
2000
|
+
<span class='kw'>end</span></pre>
|
|
2001
|
+
</td>
|
|
2002
|
+
</tr>
|
|
2003
|
+
</table>
|
|
2004
|
+
</div>
|
|
2005
|
+
|
|
2006
|
+
<div class="method_details ">
|
|
2007
|
+
<h3 class="signature " id="main_frame-instance_method">
|
|
2008
|
+
|
|
2009
|
+
#<strong>main_frame</strong> ⇒ <tt>!<span class='object_link'><a href="Frame.html" title="Puppeteer::Frame (class)">Frame</a></span></tt>
|
|
2010
|
+
|
|
2011
|
+
|
|
2012
|
+
|
|
2013
|
+
|
|
2014
|
+
|
|
2015
|
+
</h3><div class="docstring">
|
|
2016
|
+
<div class="discussion">
|
|
2017
|
+
|
|
2018
|
+
|
|
2019
|
+
</div>
|
|
2020
|
+
</div>
|
|
2021
|
+
<div class="tags">
|
|
2022
|
+
|
|
2023
|
+
<p class="tag_title">Returns:</p>
|
|
2024
|
+
<ul class="return">
|
|
2025
|
+
|
|
2026
|
+
<li>
|
|
2027
|
+
|
|
2028
|
+
|
|
2029
|
+
<span class='type'>(<tt>!<span class='object_link'><a href="Frame.html" title="Puppeteer::Frame (class)">Frame</a></span></tt>)</span>
|
|
2030
|
+
|
|
2031
|
+
|
|
2032
|
+
|
|
2033
|
+
</li>
|
|
2034
|
+
|
|
2035
|
+
</ul>
|
|
2036
|
+
|
|
2037
|
+
</div><table class="source_code">
|
|
2038
|
+
<tr>
|
|
2039
|
+
<td>
|
|
2040
|
+
<pre class="lines">
|
|
2041
|
+
|
|
2042
|
+
|
|
2043
|
+
191
|
|
2044
|
+
192
|
|
2045
|
+
193</pre>
|
|
2046
|
+
</td>
|
|
2047
|
+
<td>
|
|
2048
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 191</span>
|
|
2049
|
+
|
|
2050
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_main_frame'>main_frame</span>
|
|
2051
|
+
<span class='ivar'>@main_frame</span>
|
|
2052
|
+
<span class='kw'>end</span></pre>
|
|
2053
|
+
</td>
|
|
2054
|
+
</tr>
|
|
2055
|
+
</table>
|
|
2056
|
+
</div>
|
|
2057
|
+
|
|
2058
|
+
<div class="method_details ">
|
|
2059
|
+
<h3 class="signature " id="navigate_frame-instance_method">
|
|
2060
|
+
|
|
2061
|
+
#<strong>navigate_frame</strong>(frame, url, referer: nil, timeout: nil, wait_until: nil) ⇒ <tt>Puppeteer::Response</tt>
|
|
2062
|
+
|
|
2063
|
+
|
|
2064
|
+
|
|
2065
|
+
|
|
2066
|
+
|
|
2067
|
+
</h3><div class="docstring">
|
|
2068
|
+
<div class="discussion">
|
|
2069
|
+
|
|
2070
|
+
|
|
2071
|
+
</div>
|
|
2072
|
+
</div>
|
|
2073
|
+
<div class="tags">
|
|
2074
|
+
<p class="tag_title">Parameters:</p>
|
|
2075
|
+
<ul class="param">
|
|
2076
|
+
|
|
2077
|
+
<li>
|
|
2078
|
+
|
|
2079
|
+
<span class='name'>frame</span>
|
|
2080
|
+
|
|
2081
|
+
|
|
2082
|
+
<span class='type'>(<tt><span class='object_link'><a href="Frame.html" title="Puppeteer::Frame (class)">Puppeteer::Frame</a></span></tt>)</span>
|
|
2083
|
+
|
|
2084
|
+
|
|
2085
|
+
|
|
2086
|
+
</li>
|
|
2087
|
+
|
|
2088
|
+
<li>
|
|
2089
|
+
|
|
2090
|
+
<span class='name'>url</span>
|
|
2091
|
+
|
|
2092
|
+
|
|
2093
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
2094
|
+
|
|
2095
|
+
|
|
2096
|
+
|
|
2097
|
+
</li>
|
|
2098
|
+
|
|
2099
|
+
<li>
|
|
2100
|
+
|
|
2101
|
+
<span class='name'>options</span>
|
|
2102
|
+
|
|
2103
|
+
|
|
2104
|
+
<span class='type'>(<tt>!{referer?: string, timeout?: number, waitUntil?: string|!Array<string>}=</tt>)</span>
|
|
2105
|
+
|
|
2106
|
+
|
|
2107
|
+
|
|
2108
|
+
</li>
|
|
2109
|
+
|
|
2110
|
+
</ul>
|
|
2111
|
+
|
|
2112
|
+
<p class="tag_title">Returns:</p>
|
|
2113
|
+
<ul class="return">
|
|
2114
|
+
|
|
2115
|
+
<li>
|
|
2116
|
+
|
|
2117
|
+
|
|
2118
|
+
<span class='type'>(<tt>Puppeteer::Response</tt>)</span>
|
|
2119
|
+
|
|
2120
|
+
|
|
2121
|
+
|
|
2122
|
+
</li>
|
|
2123
|
+
|
|
2124
|
+
</ul>
|
|
2125
|
+
|
|
2126
|
+
</div><table class="source_code">
|
|
2127
|
+
<tr>
|
|
2128
|
+
<td>
|
|
2129
|
+
<pre class="lines">
|
|
2130
|
+
|
|
2131
|
+
|
|
2132
|
+
89
|
|
2133
|
+
90
|
|
2134
|
+
91
|
|
2135
|
+
92
|
|
2136
|
+
93
|
|
2137
|
+
94
|
|
2138
|
+
95
|
|
2139
|
+
96
|
|
2140
|
+
97
|
|
2141
|
+
98
|
|
2142
|
+
99
|
|
2143
|
+
100
|
|
2144
|
+
101
|
|
2145
|
+
102
|
|
2146
|
+
103
|
|
2147
|
+
104
|
|
2148
|
+
105
|
|
2149
|
+
106
|
|
2150
|
+
107
|
|
2151
|
+
108
|
|
2152
|
+
109
|
|
2153
|
+
110
|
|
2154
|
+
111
|
|
2155
|
+
112
|
|
2156
|
+
113
|
|
2157
|
+
114
|
|
2158
|
+
115
|
|
2159
|
+
116
|
|
2160
|
+
117
|
|
2161
|
+
118
|
|
2162
|
+
119
|
|
2163
|
+
120
|
|
2164
|
+
121
|
|
2165
|
+
122
|
|
2166
|
+
123
|
|
2167
|
+
124
|
|
2168
|
+
125
|
|
2169
|
+
126
|
|
2170
|
+
127
|
|
2171
|
+
128
|
|
2172
|
+
129
|
|
2173
|
+
130
|
|
2174
|
+
131
|
|
2175
|
+
132</pre>
|
|
2176
|
+
</td>
|
|
2177
|
+
<td>
|
|
2178
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 89</span>
|
|
2179
|
+
|
|
2180
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_navigate_frame'>navigate_frame</span><span class='lparen'>(</span><span class='id identifier rubyid_frame'>frame</span><span class='comma'>,</span> <span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='label'>referer:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>timeout:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>wait_until:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
2181
|
+
<span class='id identifier rubyid_assert_no_legacy_navigation_options'>assert_no_legacy_navigation_options</span><span class='lparen'>(</span><span class='label'>wait_until:</span> <span class='id identifier rubyid_wait_until'>wait_until</span><span class='rparen'>)</span>
|
|
2182
|
+
|
|
2183
|
+
<span class='id identifier rubyid_navigate_params'>navigate_params</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
|
2184
|
+
<span class='label'>url:</span> <span class='id identifier rubyid_url'>url</span><span class='comma'>,</span>
|
|
2185
|
+
<span class='label'>referer:</span> <span class='id identifier rubyid_referer'>referer</span> <span class='op'>||</span> <span class='ivar'>@network_manager</span><span class='period'>.</span><span class='id identifier rubyid_extra_http_headers'>extra_http_headers</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>referer</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
|
2186
|
+
<span class='label'>frameId:</span> <span class='id identifier rubyid_frame'>frame</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span>
|
|
2187
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span>
|
|
2188
|
+
<span class='id identifier rubyid_option_wait_until'>option_wait_until</span> <span class='op'>=</span> <span class='id identifier rubyid_wait_until'>wait_until</span> <span class='op'>||</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>load</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
|
2189
|
+
<span class='id identifier rubyid_option_timeout'>option_timeout</span> <span class='op'>=</span> <span class='id identifier rubyid_timeout'>timeout</span> <span class='op'>||</span> <span class='ivar'>@timeout_settings</span><span class='period'>.</span><span class='id identifier rubyid_navigation_timeout'>navigation_timeout</span>
|
|
2190
|
+
|
|
2191
|
+
<span class='id identifier rubyid_watcher'>watcher</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="LifecycleWatcher.html" title="Puppeteer::LifecycleWatcher (class)">LifecycleWatcher</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="LifecycleWatcher.html#initialize-instance_method" title="Puppeteer::LifecycleWatcher#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_frame'>frame</span><span class='comma'>,</span> <span class='id identifier rubyid_option_wait_until'>option_wait_until</span><span class='comma'>,</span> <span class='id identifier rubyid_option_timeout'>option_timeout</span><span class='rparen'>)</span>
|
|
2192
|
+
<span class='id identifier rubyid_ensure_new_document_navigation'>ensure_new_document_navigation</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|
2193
|
+
|
|
2194
|
+
<span class='kw'>begin</span>
|
|
2195
|
+
<span class='id identifier rubyid_navigate'>navigate</span> <span class='op'>=</span> <span class='id identifier rubyid_future'><span class='object_link'><a href="ConcurrentRubyUtils.html#future-instance_method" title="Puppeteer::ConcurrentRubyUtils#future (method)">future</a></span></span> <span class='kw'>do</span>
|
|
2196
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='ivar'>@client</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'>Page.navigate</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_navigate_params'>navigate_params</span><span class='rparen'>)</span>
|
|
2197
|
+
<span class='id identifier rubyid_loader_id'>loader_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'>loaderId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
|
2198
|
+
<span class='id identifier rubyid_ensure_new_document_navigation'>ensure_new_document_navigation</span> <span class='op'>=</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_loader_id'>loader_id</span>
|
|
2199
|
+
<span class='kw'>if</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'>errorText</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
|
2200
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="FrameManager/NavigationError.html" title="Puppeteer::FrameManager::NavigationError (class)">NavigationError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Puppeteer::FrameManager#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</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'>errorText</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'> at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_url'>url</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
2201
|
+
<span class='kw'>end</span>
|
|
2202
|
+
<span class='kw'>end</span>
|
|
2203
|
+
<span class='id identifier rubyid_await_any'><span class='object_link'><a href="ConcurrentRubyUtils.html#await_any-instance_method" title="Puppeteer::ConcurrentRubyUtils#await_any (method)">await_any</a></span></span><span class='lparen'>(</span>
|
|
2204
|
+
<span class='id identifier rubyid_navigate'>navigate</span><span class='comma'>,</span>
|
|
2205
|
+
<span class='id identifier rubyid_watcher'>watcher</span><span class='period'>.</span><span class='id identifier rubyid_timeout_or_termination_promise'>timeout_or_termination_promise</span><span class='comma'>,</span>
|
|
2206
|
+
<span class='rparen'>)</span>
|
|
2207
|
+
|
|
2208
|
+
<span class='id identifier rubyid_document_navigation_promise'>document_navigation_promise</span> <span class='op'>=</span>
|
|
2209
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_ensure_new_document_navigation'>ensure_new_document_navigation</span>
|
|
2210
|
+
<span class='id identifier rubyid_watcher'>watcher</span><span class='period'>.</span><span class='id identifier rubyid_new_document_navigation_promise'>new_document_navigation_promise</span>
|
|
2211
|
+
<span class='kw'>else</span>
|
|
2212
|
+
<span class='id identifier rubyid_watcher'>watcher</span><span class='period'>.</span><span class='id identifier rubyid_same_document_navigation_promise'>same_document_navigation_promise</span>
|
|
2213
|
+
<span class='kw'>end</span>
|
|
2214
|
+
<span class='id identifier rubyid_await_any'><span class='object_link'><a href="ConcurrentRubyUtils.html#await_any-instance_method" title="Puppeteer::ConcurrentRubyUtils#await_any (method)">await_any</a></span></span><span class='lparen'>(</span>
|
|
2215
|
+
<span class='id identifier rubyid_document_navigation_promise'>document_navigation_promise</span><span class='comma'>,</span>
|
|
2216
|
+
<span class='id identifier rubyid_watcher'>watcher</span><span class='period'>.</span><span class='id identifier rubyid_timeout_or_termination_promise'>timeout_or_termination_promise</span><span class='comma'>,</span>
|
|
2217
|
+
<span class='rparen'>)</span>
|
|
2218
|
+
<span class='kw'>ensure</span>
|
|
2219
|
+
<span class='id identifier rubyid_watcher'>watcher</span><span class='period'>.</span><span class='id identifier rubyid_dispose'>dispose</span>
|
|
2220
|
+
<span class='kw'>end</span>
|
|
2221
|
+
|
|
2222
|
+
<span class='id identifier rubyid_watcher'>watcher</span><span class='period'>.</span><span class='id identifier rubyid_navigation_response'>navigation_response</span>
|
|
2223
|
+
<span class='kw'>end</span></pre>
|
|
2224
|
+
</td>
|
|
2225
|
+
</tr>
|
|
2226
|
+
</table>
|
|
2227
|
+
</div>
|
|
2228
|
+
|
|
2229
|
+
<div class="method_details ">
|
|
2230
|
+
<h3 class="signature " id="page-instance_method">
|
|
2231
|
+
|
|
2232
|
+
#<strong>page</strong> ⇒ <tt>!<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>
|
|
2233
|
+
|
|
2234
|
+
|
|
2235
|
+
|
|
2236
|
+
|
|
2237
|
+
|
|
2238
|
+
</h3><div class="docstring">
|
|
2239
|
+
<div class="discussion">
|
|
2240
|
+
|
|
2241
|
+
|
|
2242
|
+
</div>
|
|
2243
|
+
</div>
|
|
2244
|
+
<div class="tags">
|
|
2245
|
+
|
|
2246
|
+
<p class="tag_title">Returns:</p>
|
|
2247
|
+
<ul class="return">
|
|
2248
|
+
|
|
2249
|
+
<li>
|
|
2250
|
+
|
|
2251
|
+
|
|
2252
|
+
<span class='type'>(<tt>!<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>
|
|
2253
|
+
|
|
2254
|
+
|
|
2255
|
+
|
|
2256
|
+
</li>
|
|
2257
|
+
|
|
2258
|
+
</ul>
|
|
2259
|
+
|
|
2260
|
+
</div><table class="source_code">
|
|
2261
|
+
<tr>
|
|
2262
|
+
<td>
|
|
2263
|
+
<pre class="lines">
|
|
2264
|
+
|
|
2265
|
+
|
|
2266
|
+
186
|
|
2267
|
+
187
|
|
2268
|
+
188</pre>
|
|
2269
|
+
</td>
|
|
2270
|
+
<td>
|
|
2271
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 186</span>
|
|
2272
|
+
|
|
2273
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_page'>page</span>
|
|
2274
|
+
<span class='ivar'>@page</span>
|
|
2275
|
+
<span class='kw'>end</span></pre>
|
|
2276
|
+
</td>
|
|
2277
|
+
</tr>
|
|
2278
|
+
</table>
|
|
2279
|
+
</div>
|
|
2280
|
+
|
|
2281
|
+
<div class="method_details ">
|
|
2282
|
+
<h3 class="signature " id="wait_for_frame_navigation-instance_method">
|
|
2283
|
+
|
|
2284
|
+
#<strong>wait_for_frame_navigation</strong>(frame, timeout: nil, wait_until: nil) ⇒ <tt>Puppeteer::Response</tt>
|
|
2285
|
+
|
|
2286
|
+
|
|
2287
|
+
|
|
2288
|
+
|
|
2289
|
+
|
|
2290
|
+
</h3><div class="docstring">
|
|
2291
|
+
<div class="discussion">
|
|
2292
|
+
|
|
2293
|
+
|
|
2294
|
+
</div>
|
|
2295
|
+
</div>
|
|
2296
|
+
<div class="tags">
|
|
2297
|
+
<p class="tag_title">Parameters:</p>
|
|
2298
|
+
<ul class="param">
|
|
2299
|
+
|
|
2300
|
+
<li>
|
|
2301
|
+
|
|
2302
|
+
<span class='name'>timeout</span>
|
|
2303
|
+
|
|
2304
|
+
|
|
2305
|
+
<span class='type'>(<tt>number|nil</tt>)</span>
|
|
2306
|
+
|
|
2307
|
+
|
|
2308
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
2309
|
+
|
|
2310
|
+
|
|
2311
|
+
</li>
|
|
2312
|
+
|
|
2313
|
+
<li>
|
|
2314
|
+
|
|
2315
|
+
<span class='name'>wait_until</span>
|
|
2316
|
+
|
|
2317
|
+
|
|
2318
|
+
<span class='type'>(<tt>string|nil</tt>)</span>
|
|
2319
|
+
|
|
2320
|
+
|
|
2321
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
2322
|
+
|
|
2323
|
+
|
|
2324
|
+
—
|
|
2325
|
+
<div class='inline'>
|
|
2326
|
+
<p>'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2'</p>
|
|
2327
|
+
</div>
|
|
2328
|
+
|
|
2329
|
+
</li>
|
|
2330
|
+
|
|
2331
|
+
</ul>
|
|
2332
|
+
|
|
2333
|
+
<p class="tag_title">Returns:</p>
|
|
2334
|
+
<ul class="return">
|
|
2335
|
+
|
|
2336
|
+
<li>
|
|
2337
|
+
|
|
2338
|
+
|
|
2339
|
+
<span class='type'>(<tt>Puppeteer::Response</tt>)</span>
|
|
2340
|
+
|
|
2341
|
+
|
|
2342
|
+
|
|
2343
|
+
</li>
|
|
2344
|
+
|
|
2345
|
+
</ul>
|
|
2346
|
+
|
|
2347
|
+
</div><table class="source_code">
|
|
2348
|
+
<tr>
|
|
2349
|
+
<td>
|
|
2350
|
+
<pre class="lines">
|
|
2351
|
+
|
|
2352
|
+
|
|
2353
|
+
137
|
|
2354
|
+
138
|
|
2355
|
+
139
|
|
2356
|
+
140
|
|
2357
|
+
141
|
|
2358
|
+
142
|
|
2359
|
+
143
|
|
2360
|
+
144
|
|
2361
|
+
145
|
|
2362
|
+
146
|
|
2363
|
+
147
|
|
2364
|
+
148
|
|
2365
|
+
149
|
|
2366
|
+
150
|
|
2367
|
+
151
|
|
2368
|
+
152
|
|
2369
|
+
153
|
|
2370
|
+
154</pre>
|
|
2371
|
+
</td>
|
|
2372
|
+
<td>
|
|
2373
|
+
<pre class="code"><span class="info file"># File 'lib/puppeteer/frame_manager.rb', line 137</span>
|
|
2374
|
+
|
|
2375
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_wait_for_frame_navigation'>wait_for_frame_navigation</span><span class='lparen'>(</span><span class='id identifier rubyid_frame'>frame</span><span class='comma'>,</span> <span class='label'>timeout:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>wait_until:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
2376
|
+
<span class='id identifier rubyid_assert_no_legacy_navigation_options'>assert_no_legacy_navigation_options</span><span class='lparen'>(</span><span class='label'>wait_until:</span> <span class='id identifier rubyid_wait_until'>wait_until</span><span class='rparen'>)</span>
|
|
2377
|
+
|
|
2378
|
+
<span class='id identifier rubyid_option_wait_until'>option_wait_until</span> <span class='op'>=</span> <span class='id identifier rubyid_wait_until'>wait_until</span> <span class='op'>||</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>load</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
|
2379
|
+
<span class='id identifier rubyid_option_timeout'>option_timeout</span> <span class='op'>=</span> <span class='id identifier rubyid_timeout'>timeout</span> <span class='op'>||</span> <span class='ivar'>@timeout_settings</span><span class='period'>.</span><span class='id identifier rubyid_navigation_timeout'>navigation_timeout</span>
|
|
2380
|
+
<span class='id identifier rubyid_watcher'>watcher</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="LifecycleWatcher.html" title="Puppeteer::LifecycleWatcher (class)">LifecycleWatcher</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="LifecycleWatcher.html#initialize-instance_method" title="Puppeteer::LifecycleWatcher#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_frame'>frame</span><span class='comma'>,</span> <span class='id identifier rubyid_option_wait_until'>option_wait_until</span><span class='comma'>,</span> <span class='id identifier rubyid_option_timeout'>option_timeout</span><span class='rparen'>)</span>
|
|
2381
|
+
<span class='kw'>begin</span>
|
|
2382
|
+
<span class='id identifier rubyid_await_any'><span class='object_link'><a href="ConcurrentRubyUtils.html#await_any-instance_method" title="Puppeteer::ConcurrentRubyUtils#await_any (method)">await_any</a></span></span><span class='lparen'>(</span>
|
|
2383
|
+
<span class='id identifier rubyid_watcher'>watcher</span><span class='period'>.</span><span class='id identifier rubyid_timeout_or_termination_promise'>timeout_or_termination_promise</span><span class='comma'>,</span>
|
|
2384
|
+
<span class='id identifier rubyid_watcher'>watcher</span><span class='period'>.</span><span class='id identifier rubyid_same_document_navigation_promise'>same_document_navigation_promise</span><span class='comma'>,</span>
|
|
2385
|
+
<span class='id identifier rubyid_watcher'>watcher</span><span class='period'>.</span><span class='id identifier rubyid_new_document_navigation_promise'>new_document_navigation_promise</span><span class='comma'>,</span>
|
|
2386
|
+
<span class='rparen'>)</span>
|
|
2387
|
+
<span class='kw'>ensure</span>
|
|
2388
|
+
<span class='id identifier rubyid_watcher'>watcher</span><span class='period'>.</span><span class='id identifier rubyid_dispose'>dispose</span>
|
|
2389
|
+
<span class='kw'>end</span>
|
|
2390
|
+
|
|
2391
|
+
<span class='id identifier rubyid_watcher'>watcher</span><span class='period'>.</span><span class='id identifier rubyid_navigation_response'>navigation_response</span>
|
|
2392
|
+
<span class='kw'>end</span></pre>
|
|
2393
|
+
</td>
|
|
2394
|
+
</tr>
|
|
2395
|
+
</table>
|
|
2396
|
+
</div>
|
|
2397
|
+
|
|
2398
|
+
</div>
|
|
2399
|
+
|
|
2400
|
+
</div>
|
|
2401
|
+
|
|
2402
|
+
<div id="footer">
|
|
2403
|
+
Generated on Fri Jun 12 12:38:34 2020 by
|
|
2404
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
2405
|
+
0.9.24 (ruby-2.6.3).
|
|
2406
|
+
</div>
|
|
2407
|
+
|
|
2408
|
+
</div>
|
|
2409
|
+
</body>
|
|
2410
|
+
</html>
|