puppeteer-ruby 0.0.12 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +2 -14
  3. data/.github/workflows/docs.yml +45 -0
  4. data/.github/workflows/reviewdog.yml +15 -0
  5. data/README.md +52 -1
  6. data/lib/puppeteer.rb +10 -2
  7. data/lib/puppeteer/browser.rb +53 -34
  8. data/lib/puppeteer/browser_context.rb +35 -5
  9. data/lib/puppeteer/cdp_session.rb +3 -19
  10. data/lib/puppeteer/concurrent_ruby_utils.rb +6 -0
  11. data/lib/puppeteer/connection.rb +9 -16
  12. data/lib/puppeteer/debug_print.rb +1 -1
  13. data/lib/puppeteer/define_async_method.rb +23 -0
  14. data/lib/puppeteer/dom_world.rb +67 -78
  15. data/lib/puppeteer/element_handle.rb +19 -47
  16. data/lib/puppeteer/emulation_manager.rb +2 -6
  17. data/lib/puppeteer/env.rb +18 -0
  18. data/lib/puppeteer/execution_context.rb +1 -6
  19. data/lib/puppeteer/frame.rb +34 -39
  20. data/lib/puppeteer/frame_manager.rb +7 -25
  21. data/lib/puppeteer/js_handle.rb +3 -12
  22. data/lib/puppeteer/keyboard.rb +9 -29
  23. data/lib/puppeteer/launcher/chrome.rb +9 -7
  24. data/lib/puppeteer/mouse.rb +20 -24
  25. data/lib/puppeteer/network_manager.rb +163 -5
  26. data/lib/puppeteer/page.rb +213 -179
  27. data/lib/puppeteer/page/pdf_options.rb +166 -0
  28. data/lib/puppeteer/remote_object.rb +2 -5
  29. data/lib/puppeteer/request.rb +330 -0
  30. data/lib/puppeteer/response.rb +113 -0
  31. data/lib/puppeteer/touch_screen.rb +2 -7
  32. data/lib/puppeteer/version.rb +1 -1
  33. data/lib/puppeteer/wait_task.rb +2 -4
  34. data/lib/puppeteer/web_socket.rb +7 -0
  35. data/puppeteer-ruby.gemspec +2 -1
  36. metadata +25 -103
  37. data/docs/Puppeteer.html +0 -2338
  38. data/docs/Puppeteer/AsyncAwaitBehavior.html +0 -105
  39. data/docs/Puppeteer/Browser.html +0 -2258
  40. data/docs/Puppeteer/BrowserContext.html +0 -809
  41. data/docs/Puppeteer/BrowserFetcher.html +0 -214
  42. data/docs/Puppeteer/BrowserRunner.html +0 -914
  43. data/docs/Puppeteer/BrowserRunner/BrowserProcess.html +0 -477
  44. data/docs/Puppeteer/CDPSession.html +0 -813
  45. data/docs/Puppeteer/CDPSession/Error.html +0 -124
  46. data/docs/Puppeteer/ConcurrentRubyUtils.html +0 -438
  47. data/docs/Puppeteer/Connection.html +0 -964
  48. data/docs/Puppeteer/Connection/MessageCallback.html +0 -434
  49. data/docs/Puppeteer/Connection/ProtocolError.html +0 -216
  50. data/docs/Puppeteer/Connection/RequestDebugPrinter.html +0 -217
  51. data/docs/Puppeteer/Connection/ResponseDebugPrinter.html +0 -244
  52. data/docs/Puppeteer/ConsoleMessage.html +0 -565
  53. data/docs/Puppeteer/ConsoleMessage/Location.html +0 -433
  54. data/docs/Puppeteer/DOMWorld.html +0 -2219
  55. data/docs/Puppeteer/DOMWorld/DetachedError.html +0 -124
  56. data/docs/Puppeteer/DOMWorld/DocumentEvaluationError.html +0 -124
  57. data/docs/Puppeteer/DebugPrint.html +0 -233
  58. data/docs/Puppeteer/Device.html +0 -470
  59. data/docs/Puppeteer/Devices.html +0 -139
  60. data/docs/Puppeteer/ElementHandle.html +0 -2542
  61. data/docs/Puppeteer/ElementHandle/BoundingBox.html +0 -507
  62. data/docs/Puppeteer/ElementHandle/BoxModel.html +0 -404
  63. data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +0 -206
  64. data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +0 -206
  65. data/docs/Puppeteer/ElementHandle/Point.html +0 -492
  66. data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +0 -124
  67. data/docs/Puppeteer/EmulationManager.html +0 -454
  68. data/docs/Puppeteer/EventCallbackable.html +0 -499
  69. data/docs/Puppeteer/EventCallbackable/EventListeners.html +0 -435
  70. data/docs/Puppeteer/ExecutionContext.html +0 -998
  71. data/docs/Puppeteer/ExecutionContext/EvaluationError.html +0 -124
  72. data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +0 -357
  73. data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +0 -389
  74. data/docs/Puppeteer/FileChooser.html +0 -455
  75. data/docs/Puppeteer/Frame.html +0 -3813
  76. data/docs/Puppeteer/FrameManager.html +0 -2410
  77. data/docs/Puppeteer/FrameManager/NavigationError.html +0 -124
  78. data/docs/Puppeteer/IfPresent.html +0 -222
  79. data/docs/Puppeteer/JSHandle.html +0 -1352
  80. data/docs/Puppeteer/Keyboard.html +0 -1557
  81. data/docs/Puppeteer/Keyboard/KeyDefinition.html +0 -831
  82. data/docs/Puppeteer/Keyboard/KeyDescription.html +0 -603
  83. data/docs/Puppeteer/Launcher.html +0 -237
  84. data/docs/Puppeteer/Launcher/Base.html +0 -385
  85. data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +0 -124
  86. data/docs/Puppeteer/Launcher/BrowserOptions.html +0 -441
  87. data/docs/Puppeteer/Launcher/Chrome.html +0 -669
  88. data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +0 -382
  89. data/docs/Puppeteer/Launcher/ChromeArgOptions.html +0 -531
  90. data/docs/Puppeteer/Launcher/LaunchOptions.html +0 -893
  91. data/docs/Puppeteer/LifecycleWatcher.html +0 -834
  92. data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +0 -363
  93. data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +0 -206
  94. data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +0 -124
  95. data/docs/Puppeteer/Mouse.html +0 -1095
  96. data/docs/Puppeteer/Mouse/Button.html +0 -136
  97. data/docs/Puppeteer/NetworkManager.html +0 -901
  98. data/docs/Puppeteer/NetworkManager/Credentials.html +0 -385
  99. data/docs/Puppeteer/Page.html +0 -6173
  100. data/docs/Puppeteer/Page/FileChooserTimeoutError.html +0 -206
  101. data/docs/Puppeteer/Page/ScreenshotOptions.html +0 -845
  102. data/docs/Puppeteer/Page/ScriptTag.html +0 -555
  103. data/docs/Puppeteer/Page/StyleTag.html +0 -448
  104. data/docs/Puppeteer/Page/TargetCrashedError.html +0 -124
  105. data/docs/Puppeteer/RemoteObject.html +0 -1087
  106. data/docs/Puppeteer/Target.html +0 -1336
  107. data/docs/Puppeteer/Target/InitializeFailure.html +0 -124
  108. data/docs/Puppeteer/Target/TargetInfo.html +0 -729
  109. data/docs/Puppeteer/TimeoutError.html +0 -135
  110. data/docs/Puppeteer/TimeoutSettings.html +0 -496
  111. data/docs/Puppeteer/TouchScreen.html +0 -464
  112. data/docs/Puppeteer/Viewport.html +0 -837
  113. data/docs/Puppeteer/WaitTask.html +0 -637
  114. data/docs/Puppeteer/WaitTask/TerminatedError.html +0 -124
  115. data/docs/Puppeteer/WaitTask/TimeoutError.html +0 -206
  116. data/docs/Puppeteer/WebSocket.html +0 -673
  117. data/docs/Puppeteer/WebSocket/DriverImpl.html +0 -412
  118. data/docs/Puppeteer/WebSocket/TransportError.html +0 -124
  119. data/docs/Puppeteer/WebSocketTransport.html +0 -600
  120. data/docs/Puppeteer/WebSocktTransportError.html +0 -124
  121. data/docs/_index.html +0 -816
  122. data/docs/class_list.html +0 -51
  123. data/docs/css/common.css +0 -1
  124. data/docs/css/full_list.css +0 -58
  125. data/docs/css/style.css +0 -496
  126. data/docs/file.README.html +0 -125
  127. data/docs/file_list.html +0 -56
  128. data/docs/frames.html +0 -17
  129. data/docs/index.html +0 -125
  130. data/docs/js/app.js +0 -314
  131. data/docs/js/full_list.js +0 -216
  132. data/docs/js/jquery.js +0 -4
  133. data/docs/method_list.html +0 -4115
  134. data/docs/top-level-namespace.html +0 -126
  135. data/lib/puppeteer/async_await_behavior.rb +0 -38
@@ -1,136 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- Module: Puppeteer::Mouse::Button
8
-
9
- &mdash; 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::Mouse::Button";
19
- relpath = '../../';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="../../class_list.html?1"></iframe>
32
- <div id="resizer"></div>
33
- </div>
34
-
35
- <div id="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="../../_index.html">Index (B)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Mouse.html" title="Puppeteer::Mouse (class)">Mouse</a></span></span>
41
- &raquo;
42
- <span class="title">Button</span>
43
-
44
- </div>
45
-
46
- <div id="search">
47
-
48
- <a class="full_list_link" id="class_list_link"
49
- href="../../class_list.html">
50
-
51
- <svg width="24" height="24">
52
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
- </svg>
56
- </a>
57
-
58
- </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <div id="content"><h1>Module: Puppeteer::Mouse::Button
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
- <dl>
80
- <dt>Defined in:</dt>
81
- <dd>lib/puppeteer/mouse.rb</dd>
82
- </dl>
83
-
84
- </div>
85
-
86
-
87
-
88
- <h2>
89
- Constant Summary
90
- <small><a href="#" class="constants_summary_toggle">collapse</a></small>
91
- </h2>
92
-
93
- <dl class="constants">
94
-
95
- <dt id="NONE-constant" class="">NONE =
96
-
97
- </dt>
98
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>none</span><span class='tstring_end'>&#39;</span></span></pre></dd>
99
-
100
- <dt id="LEFT-constant" class="">LEFT =
101
-
102
- </dt>
103
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>left</span><span class='tstring_end'>&#39;</span></span></pre></dd>
104
-
105
- <dt id="RIGHT-constant" class="">RIGHT =
106
-
107
- </dt>
108
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>right</span><span class='tstring_end'>&#39;</span></span></pre></dd>
109
-
110
- <dt id="MIDDLE-constant" class="">MIDDLE =
111
-
112
- </dt>
113
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>middle</span><span class='tstring_end'>&#39;</span></span></pre></dd>
114
-
115
- </dl>
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
- </div>
127
-
128
- <div id="footer">
129
- Generated on Tue Jun 23 10:24:58 2020 by
130
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
131
- 0.9.24 (ruby-2.6.3).
132
- </div>
133
-
134
- </div>
135
- </body>
136
- </html>
@@ -1,901 +0,0 @@
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::NetworkManager
8
-
9
- &mdash; 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::NetworkManager";
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 (N)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span>
41
- &raquo;
42
- <span class="title">NetworkManager</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::NetworkManager
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::NetworkManager</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="EventCallbackable.html" title="Puppeteer::EventCallbackable (module)">EventCallbackable</a></span></dd>
93
- </dl>
94
-
95
-
96
-
97
-
98
-
99
-
100
- <dl>
101
- <dt>Defined in:</dt>
102
- <dd>lib/puppeteer/network_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="NetworkManager/Credentials.html" title="Puppeteer::NetworkManager::Credentials (class)">Credentials</a></span>
114
-
115
-
116
- </p>
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
- <h2>
126
- Instance Method Summary
127
- <small><a href="#" class="summary_toggle">collapse</a></small>
128
- </h2>
129
-
130
- <ul class="summary">
131
-
132
- <li class="public ">
133
- <span class="summary_signature">
134
-
135
- <a href="#authenticate-instance_method" title="#authenticate (instance method)">#<strong>authenticate</strong>(username:, password:) &#x21d2; Object </a>
136
-
137
-
138
-
139
- </span>
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
-
149
- <span class="summary_desc"><div class='inline'></div></span>
150
-
151
- </li>
152
-
153
-
154
- <li class="public ">
155
- <span class="summary_signature">
156
-
157
- <a href="#cache_enabled=-instance_method" title="#cache_enabled= (instance method)">#<strong>cache_enabled=</strong>(enabled) &#x21d2; Object </a>
158
-
159
-
160
-
161
- </span>
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
-
171
- <span class="summary_desc"><div class='inline'></div></span>
172
-
173
- </li>
174
-
175
-
176
- <li class="public ">
177
- <span class="summary_signature">
178
-
179
- <a href="#extra_http_headers-instance_method" title="#extra_http_headers (instance method)">#<strong>extra_http_headers</strong> &#x21d2; !Object&lt;string, string&gt; </a>
180
-
181
-
182
-
183
- </span>
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
-
192
-
193
- <span class="summary_desc"><div class='inline'></div></span>
194
-
195
- </li>
196
-
197
-
198
- <li class="public ">
199
- <span class="summary_signature">
200
-
201
- <a href="#extra_http_headers=-instance_method" title="#extra_http_headers= (instance method)">#<strong>extra_http_headers=</strong>(headers) &#x21d2; Object </a>
202
-
203
-
204
-
205
- </span>
206
-
207
-
208
-
209
-
210
-
211
-
212
-
213
-
214
-
215
- <span class="summary_desc"><div class='inline'></div></span>
216
-
217
- </li>
218
-
219
-
220
- <li class="public ">
221
- <span class="summary_signature">
222
-
223
- <a href="#init-instance_method" title="#init (instance method)">#<strong>init</strong> &#x21d2; Object </a>
224
-
225
-
226
-
227
- </span>
228
-
229
-
230
-
231
-
232
-
233
-
234
-
235
-
236
-
237
- <span class="summary_desc"><div class='inline'></div></span>
238
-
239
- </li>
240
-
241
-
242
- <li class="public ">
243
- <span class="summary_signature">
244
-
245
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(client, ignore_https_errors, frame_manager) &#x21d2; NetworkManager </a>
246
-
247
-
248
-
249
- </span>
250
-
251
-
252
- <span class="note title constructor">constructor</span>
253
-
254
-
255
-
256
-
257
-
258
-
259
-
260
-
261
- <span class="summary_desc"><div class='inline'>
262
- <p>A new instance of NetworkManager.</p>
263
- </div></span>
264
-
265
- </li>
266
-
267
-
268
- <li class="public ">
269
- <span class="summary_signature">
270
-
271
- <a href="#offline_mode=-instance_method" title="#offline_mode= (instance method)">#<strong>offline_mode=</strong>(value) &#x21d2; Object </a>
272
-
273
-
274
-
275
- </span>
276
-
277
-
278
-
279
-
280
-
281
-
282
-
283
-
284
-
285
- <span class="summary_desc"><div class='inline'></div></span>
286
-
287
- </li>
288
-
289
-
290
- <li class="public ">
291
- <span class="summary_signature">
292
-
293
- <a href="#request_interception=-instance_method" title="#request_interception= (instance method)">#<strong>request_interception=</strong>(enabled) &#x21d2; Object </a>
294
-
295
-
296
-
297
- </span>
298
-
299
-
300
-
301
-
302
-
303
-
304
-
305
-
306
-
307
- <span class="summary_desc"><div class='inline'></div></span>
308
-
309
- </li>
310
-
311
-
312
- <li class="public ">
313
- <span class="summary_signature">
314
-
315
- <a href="#user_agent=-instance_method" title="#user_agent= (instance method)">#<strong>user_agent=</strong>(user_agent) &#x21d2; Object </a>
316
-
317
-
318
-
319
- </span>
320
-
321
-
322
-
323
-
324
-
325
-
326
-
327
-
328
-
329
- <span class="summary_desc"><div class='inline'></div></span>
330
-
331
- </li>
332
-
333
-
334
- </ul>
335
-
336
-
337
-
338
-
339
-
340
-
341
-
342
-
343
-
344
-
345
-
346
- <h3 class="inherited">Methods included from <span class='object_link'><a href="EventCallbackable.html" title="Puppeteer::EventCallbackable (module)">EventCallbackable</a></span></h3>
347
- <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#observe_first-instance_method" title="Puppeteer::EventCallbackable#observe_first (method)">#observe_first</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>
348
- <div id="constructor_details" class="method_details_list">
349
- <h2>Constructor Details</h2>
350
-
351
- <div class="method_details first">
352
- <h3 class="signature first" id="initialize-instance_method">
353
-
354
- #<strong>initialize</strong>(client, ignore_https_errors, frame_manager) &#x21d2; <tt><span class='object_link'><a href="" title="Puppeteer::NetworkManager (class)">NetworkManager</a></span></tt>
355
-
356
-
357
-
358
-
359
-
360
- </h3><div class="docstring">
361
- <div class="discussion">
362
-
363
- <p>Returns a new instance of NetworkManager.</p>
364
-
365
-
366
- </div>
367
- </div>
368
- <div class="tags">
369
- <p class="tag_title">Parameters:</p>
370
- <ul class="param">
371
-
372
- <li>
373
-
374
- <span class='name'>client</span>
375
-
376
-
377
- <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>
378
-
379
-
380
-
381
- </li>
382
-
383
- <li>
384
-
385
- <span class='name'>ignoreHTTPSErrors</span>
386
-
387
-
388
- <span class='type'>(<tt>boolean</tt>)</span>
389
-
390
-
391
-
392
- </li>
393
-
394
- <li>
395
-
396
- <span class='name'>frameManager</span>
397
-
398
-
399
- <span class='type'>(<tt>!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="FrameManager.html" title="Puppeteer::FrameManager (class)">FrameManager</a></span></tt>)</span>
400
-
401
-
402
-
403
- </li>
404
-
405
- </ul>
406
-
407
-
408
- </div><table class="source_code">
409
- <tr>
410
- <td>
411
- <pre class="lines">
412
-
413
-
414
- 17
415
- 18
416
- 19
417
- 20
418
- 21
419
- 22
420
- 23
421
- 24
422
- 25
423
- 26
424
- 27
425
- 28
426
- 29
427
- 30
428
- 31
429
- 32
430
- 33
431
- 34
432
- 35
433
- 36
434
- 37
435
- 38
436
- 39</pre>
437
- </td>
438
- <td>
439
- <pre class="code"><span class="info file"># File 'lib/puppeteer/network_manager.rb', line 17</span>
440
-
441
- <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_ignore_https_errors'>ignore_https_errors</span><span class='comma'>,</span> <span class='id identifier rubyid_frame_manager'>frame_manager</span><span class='rparen'>)</span>
442
- <span class='ivar'>@client</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span>
443
- <span class='ivar'>@ignore_https_errors</span> <span class='op'>=</span> <span class='id identifier rubyid_ignore_https_errors'>ignore_https_errors</span>
444
- <span class='ivar'>@frame_manager</span> <span class='op'>=</span> <span class='id identifier rubyid_frame_manager'>frame_manager</span>
445
-
446
- <span class='comment'># @type {!Map&lt;string, !Request&gt;}
447
- </span> <span class='ivar'>@request_id_to_request</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
448
-
449
- <span class='comment'># @type {!Map&lt;string, !Protocol.Network.requestWillBeSentPayload&gt;}
450
- </span> <span class='ivar'>@request_id_to_request_with_be_sent_event</span>
451
-
452
- <span class='ivar'>@extra_http_headers</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
453
-
454
- <span class='ivar'>@offline</span> <span class='op'>=</span> <span class='kw'>false</span>
455
-
456
- <span class='comment'># /** @type {!Set&lt;string&gt;} */
457
- </span> <span class='comment'># this._attemptedAuthentications = new Set();
458
- </span> <span class='ivar'>@user_request_interception_enabled</span> <span class='op'>=</span> <span class='kw'>false</span>
459
- <span class='ivar'>@protocol_request_interception_enabled</span> <span class='op'>=</span> <span class='kw'>false</span>
460
- <span class='ivar'>@user_cache_disabled</span> <span class='op'>=</span> <span class='kw'>false</span>
461
- <span class='comment'># /** @type {!Map&lt;string, string&gt;} */
462
- </span> <span class='comment'># this._requestIdToInterceptionId = new Map();
463
- </span><span class='kw'>end</span></pre>
464
- </td>
465
- </tr>
466
- </table>
467
- </div>
468
-
469
- </div>
470
-
471
-
472
- <div id="instance_method_details" class="method_details_list">
473
- <h2>Instance Method Details</h2>
474
-
475
-
476
- <div class="method_details first">
477
- <h3 class="signature first" id="authenticate-instance_method">
478
-
479
- #<strong>authenticate</strong>(username:, password:) &#x21d2; <tt>Object</tt>
480
-
481
-
482
-
483
-
484
-
485
- </h3><div class="docstring">
486
- <div class="discussion">
487
-
488
-
489
- </div>
490
- </div>
491
- <div class="tags">
492
- <p class="tag_title">Parameters:</p>
493
- <ul class="param">
494
-
495
- <li>
496
-
497
- <span class='name'>username</span>
498
-
499
-
500
- <span class='type'>(<tt>String|NilClass</tt>)</span>
501
-
502
-
503
-
504
- </li>
505
-
506
- <li>
507
-
508
- <span class='name'>password</span>
509
-
510
-
511
- <span class='type'>(<tt>String|NilClass</tt>)</span>
512
-
513
-
514
-
515
- </li>
516
-
517
- </ul>
518
-
519
-
520
- </div><table class="source_code">
521
- <tr>
522
- <td>
523
- <pre class="lines">
524
-
525
-
526
- 50
527
- 51
528
- 52
529
- 53</pre>
530
- </td>
531
- <td>
532
- <pre class="code"><span class="info file"># File 'lib/puppeteer/network_manager.rb', line 50</span>
533
-
534
- <span class='kw'>def</span> <span class='id identifier rubyid_authenticate'>authenticate</span><span class='lparen'>(</span><span class='label'>username:</span><span class='comma'>,</span> <span class='label'>password:</span><span class='rparen'>)</span>
535
- <span class='ivar'>@credentials</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="NetworkManager/Credentials.html" title="Puppeteer::NetworkManager::Credentials (class)">Credentials</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="NetworkManager/Credentials.html#initialize-instance_method" title="Puppeteer::NetworkManager::Credentials#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>username:</span> <span class='id identifier rubyid_username'>username</span><span class='comma'>,</span> <span class='label'>password:</span> <span class='id identifier rubyid_password'>password</span><span class='rparen'>)</span>
536
- <span class='id identifier rubyid_update_protocol_request_interception'>update_protocol_request_interception</span>
537
- <span class='kw'>end</span></pre>
538
- </td>
539
- </tr>
540
- </table>
541
- </div>
542
-
543
- <div class="method_details ">
544
- <h3 class="signature " id="cache_enabled=-instance_method">
545
-
546
- #<strong>cache_enabled=</strong>(enabled) &#x21d2; <tt>Object</tt>
547
-
548
-
549
-
550
-
551
-
552
- </h3><table class="source_code">
553
- <tr>
554
- <td>
555
- <pre class="lines">
556
-
557
-
558
- 91
559
- 92
560
- 93
561
- 94</pre>
562
- </td>
563
- <td>
564
- <pre class="code"><span class="info file"># File 'lib/puppeteer/network_manager.rb', line 91</span>
565
-
566
- <span class='kw'>def</span> <span class='id identifier rubyid_cache_enabled='>cache_enabled=</span><span class='lparen'>(</span><span class='id identifier rubyid_enabled'>enabled</span><span class='rparen'>)</span>
567
- <span class='ivar'>@user_cache_disabled</span> <span class='op'>=</span> <span class='op'>!</span><span class='id identifier rubyid_enabled'>enabled</span>
568
- <span class='id identifier rubyid_update_protocol_cache_disabled'>update_protocol_cache_disabled</span>
569
- <span class='kw'>end</span></pre>
570
- </td>
571
- </tr>
572
- </table>
573
- </div>
574
-
575
- <div class="method_details ">
576
- <h3 class="signature " id="extra_http_headers-instance_method">
577
-
578
- #<strong>extra_http_headers</strong> &#x21d2; <tt>!Object&lt;string, string&gt;</tt>
579
-
580
-
581
-
582
-
583
-
584
- </h3><div class="docstring">
585
- <div class="discussion">
586
-
587
-
588
- </div>
589
- </div>
590
- <div class="tags">
591
-
592
- <p class="tag_title">Returns:</p>
593
- <ul class="return">
594
-
595
- <li>
596
-
597
-
598
- <span class='type'>(<tt>!Object&lt;string, string&gt;</tt>)</span>
599
-
600
-
601
-
602
- </li>
603
-
604
- </ul>
605
-
606
- </div><table class="source_code">
607
- <tr>
608
- <td>
609
- <pre class="lines">
610
-
611
-
612
- 69
613
- 70
614
- 71</pre>
615
- </td>
616
- <td>
617
- <pre class="code"><span class="info file"># File 'lib/puppeteer/network_manager.rb', line 69</span>
618
-
619
- <span class='kw'>def</span> <span class='id identifier rubyid_extra_http_headers'>extra_http_headers</span>
620
- <span class='ivar'>@extra_http_headers</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
621
- <span class='kw'>end</span></pre>
622
- </td>
623
- </tr>
624
- </table>
625
- </div>
626
-
627
- <div class="method_details ">
628
- <h3 class="signature " id="extra_http_headers=-instance_method">
629
-
630
- #<strong>extra_http_headers=</strong>(headers) &#x21d2; <tt>Object</tt>
631
-
632
-
633
-
634
-
635
-
636
- </h3><div class="docstring">
637
- <div class="discussion">
638
-
639
-
640
- </div>
641
- </div>
642
- <div class="tags">
643
- <p class="tag_title">Parameters:</p>
644
- <ul class="param">
645
-
646
- <li>
647
-
648
- <span class='name'>extraHTTPHeaders</span>
649
-
650
-
651
- <span class='type'>(<tt>!Object&lt;string, string&gt;</tt>)</span>
652
-
653
-
654
-
655
- </li>
656
-
657
- </ul>
658
-
659
-
660
- </div><table class="source_code">
661
- <tr>
662
- <td>
663
- <pre class="lines">
664
-
665
-
666
- 56
667
- 57
668
- 58
669
- 59
670
- 60
671
- 61
672
- 62
673
- 63
674
- 64
675
- 65
676
- 66</pre>
677
- </td>
678
- <td>
679
- <pre class="code"><span class="info file"># File 'lib/puppeteer/network_manager.rb', line 56</span>
680
-
681
- <span class='kw'>def</span> <span class='id identifier rubyid_extra_http_headers='>extra_http_headers=</span><span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='rparen'>)</span>
682
- <span class='id identifier rubyid_new_extra_http_headers'>new_extra_http_headers</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
683
- <span class='id identifier rubyid_headers'>headers</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_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
684
- <span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
685
- <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'>&quot;</span><span class='tstring_content'>Expected value of header \&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'>\&quot; to be String, but \&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_content'>\&quot; is found.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
686
- <span class='kw'>end</span>
687
- <span class='id identifier rubyid_new_extra_http_headers'>new_extra_http_headers</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
688
- <span class='kw'>end</span>
689
- <span class='ivar'>@extra_http_headers</span> <span class='op'>=</span> <span class='id identifier rubyid_new_extra_http_headers'>new_extra_http_headers</span>
690
- <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'>&#39;</span><span class='tstring_content'>Network.setExtraHTTPHeaders</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='id identifier rubyid_new_extra_http_headers'>new_extra_http_headers</span><span class='rparen'>)</span>
691
- <span class='kw'>end</span></pre>
692
- </td>
693
- </tr>
694
- </table>
695
- </div>
696
-
697
- <div class="method_details ">
698
- <h3 class="signature " id="init-instance_method">
699
-
700
- #<strong>init</strong> &#x21d2; <tt>Object</tt>
701
-
702
-
703
-
704
-
705
-
706
- </h3><table class="source_code">
707
- <tr>
708
- <td>
709
- <pre class="lines">
710
-
711
-
712
- 41
713
- 42
714
- 43
715
- 44
716
- 45
717
- 46</pre>
718
- </td>
719
- <td>
720
- <pre class="code"><span class="info file"># File 'lib/puppeteer/network_manager.rb', line 41</span>
721
-
722
- <span class='kw'>def</span> <span class='id identifier rubyid_init'>init</span>
723
- <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'>&#39;</span><span class='tstring_content'>Network.enable</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
724
- <span class='kw'>if</span> <span class='ivar'>@ignore_https_errors</span>
725
- <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'>&#39;</span><span class='tstring_content'>Security.setIgnoreCertificateErrors</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>ignore:</span> <span class='kw'>true</span><span class='rparen'>)</span>
726
- <span class='kw'>end</span>
727
- <span class='kw'>end</span></pre>
728
- </td>
729
- </tr>
730
- </table>
731
- </div>
732
-
733
- <div class="method_details ">
734
- <h3 class="signature " id="offline_mode=-instance_method">
735
-
736
- #<strong>offline_mode=</strong>(value) &#x21d2; <tt>Object</tt>
737
-
738
-
739
-
740
-
741
-
742
- </h3><div class="docstring">
743
- <div class="discussion">
744
-
745
-
746
- </div>
747
- </div>
748
- <div class="tags">
749
- <p class="tag_title">Parameters:</p>
750
- <ul class="param">
751
-
752
- <li>
753
-
754
- <span class='name'>value</span>
755
-
756
-
757
- <span class='type'>(<tt>TrueClass|FalseClass</tt>)</span>
758
-
759
-
760
-
761
- </li>
762
-
763
- </ul>
764
-
765
-
766
- </div><table class="source_code">
767
- <tr>
768
- <td>
769
- <pre class="lines">
770
-
771
-
772
- 74
773
- 75
774
- 76
775
- 77
776
- 78
777
- 79
778
- 80
779
- 81
780
- 82
781
- 83
782
- 84</pre>
783
- </td>
784
- <td>
785
- <pre class="code"><span class="info file"># File 'lib/puppeteer/network_manager.rb', line 74</span>
786
-
787
- <span class='kw'>def</span> <span class='id identifier rubyid_offline_mode='>offline_mode=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
788
- <span class='kw'>return</span> <span class='kw'>if</span> <span class='ivar'>@offline</span> <span class='op'>==</span> <span class='id identifier rubyid_value'>value</span>
789
- <span class='ivar'>@offline</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
790
- <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'>&#39;</span><span class='tstring_content'>Network.emulateNetworkConditions</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
791
- <span class='label'>offline:</span> <span class='ivar'>@offline</span><span class='comma'>,</span>
792
- <span class='comment'># values of 0 remove any active throttling. crbug.com/456324#c9
793
- </span> <span class='label'>latency:</span> <span class='int'>0</span><span class='comma'>,</span>
794
- <span class='label'>downloadThroughput:</span> <span class='op'>-</span><span class='int'>1</span><span class='comma'>,</span>
795
- <span class='label'>uploadThroughput:</span> <span class='op'>-</span><span class='int'>1</span><span class='comma'>,</span>
796
- <span class='rparen'>)</span>
797
- <span class='kw'>end</span></pre>
798
- </td>
799
- </tr>
800
- </table>
801
- </div>
802
-
803
- <div class="method_details ">
804
- <h3 class="signature " id="request_interception=-instance_method">
805
-
806
- #<strong>request_interception=</strong>(enabled) &#x21d2; <tt>Object</tt>
807
-
808
-
809
-
810
-
811
-
812
- </h3><table class="source_code">
813
- <tr>
814
- <td>
815
- <pre class="lines">
816
-
817
-
818
- 96
819
- 97
820
- 98
821
- 99</pre>
822
- </td>
823
- <td>
824
- <pre class="code"><span class="info file"># File 'lib/puppeteer/network_manager.rb', line 96</span>
825
-
826
- <span class='kw'>def</span> <span class='id identifier rubyid_request_interception='>request_interception=</span><span class='lparen'>(</span><span class='id identifier rubyid_enabled'>enabled</span><span class='rparen'>)</span>
827
- <span class='ivar'>@user_request_interception_enabled</span> <span class='op'>=</span> <span class='id identifier rubyid_enabled'>enabled</span>
828
- <span class='id identifier rubyid_update_protocol_request_interception'>update_protocol_request_interception</span>
829
- <span class='kw'>end</span></pre>
830
- </td>
831
- </tr>
832
- </table>
833
- </div>
834
-
835
- <div class="method_details ">
836
- <h3 class="signature " id="user_agent=-instance_method">
837
-
838
- #<strong>user_agent=</strong>(user_agent) &#x21d2; <tt>Object</tt>
839
-
840
-
841
-
842
-
843
-
844
- </h3><div class="docstring">
845
- <div class="discussion">
846
-
847
-
848
- </div>
849
- </div>
850
- <div class="tags">
851
- <p class="tag_title">Parameters:</p>
852
- <ul class="param">
853
-
854
- <li>
855
-
856
- <span class='name'>user_agent</span>
857
-
858
-
859
- <span class='type'>(<tt>String</tt>)</span>
860
-
861
-
862
-
863
- </li>
864
-
865
- </ul>
866
-
867
-
868
- </div><table class="source_code">
869
- <tr>
870
- <td>
871
- <pre class="lines">
872
-
873
-
874
- 87
875
- 88
876
- 89</pre>
877
- </td>
878
- <td>
879
- <pre class="code"><span class="info file"># File 'lib/puppeteer/network_manager.rb', line 87</span>
880
-
881
- <span class='kw'>def</span> <span class='id identifier rubyid_user_agent='>user_agent=</span><span class='lparen'>(</span><span class='id identifier rubyid_user_agent'>user_agent</span><span class='rparen'>)</span>
882
- <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'>&#39;</span><span class='tstring_content'>Network.setUserAgentOverride</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>userAgent:</span> <span class='id identifier rubyid_user_agent'>user_agent</span><span class='rparen'>)</span>
883
- <span class='kw'>end</span></pre>
884
- </td>
885
- </tr>
886
- </table>
887
- </div>
888
-
889
- </div>
890
-
891
- </div>
892
-
893
- <div id="footer">
894
- Generated on Tue Jun 23 10:25:00 2020 by
895
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
896
- 0.9.24 (ruby-2.6.3).
897
- </div>
898
-
899
- </div>
900
- </body>
901
- </html>