puppeteer-ruby 0.0.10 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +0 -12
  3. data/.github/workflows/docs.yml +45 -0
  4. data/.github/workflows/reviewdog.yml +15 -0
  5. data/README.md +54 -1
  6. data/lib/puppeteer.rb +37 -13
  7. data/lib/puppeteer/browser.rb +39 -26
  8. data/lib/puppeteer/cdp_session.rb +3 -19
  9. data/lib/puppeteer/concurrent_ruby_utils.rb +12 -2
  10. data/lib/puppeteer/connection.rb +16 -16
  11. data/lib/puppeteer/define_async_method.rb +23 -0
  12. data/lib/puppeteer/dom_world.rb +58 -71
  13. data/lib/puppeteer/element_handle.rb +15 -44
  14. data/lib/puppeteer/emulation_manager.rb +2 -6
  15. data/lib/puppeteer/event_callbackable.rb +11 -0
  16. data/lib/puppeteer/execution_context.rb +1 -6
  17. data/lib/puppeteer/frame.rb +38 -3
  18. data/lib/puppeteer/frame_manager.rb +7 -25
  19. data/lib/puppeteer/js_handle.rb +3 -12
  20. data/lib/puppeteer/keyboard.rb +6 -27
  21. data/lib/puppeteer/launcher.rb +6 -6
  22. data/lib/puppeteer/launcher/chrome.rb +10 -8
  23. data/lib/puppeteer/mouse.rb +8 -33
  24. data/lib/puppeteer/page.rb +132 -121
  25. data/lib/puppeteer/page/pdf_options.rb +166 -0
  26. data/lib/puppeteer/remote_object.rb +2 -5
  27. data/lib/puppeteer/target.rb +1 -1
  28. data/lib/puppeteer/touch_screen.rb +2 -7
  29. data/lib/puppeteer/version.rb +1 -1
  30. data/lib/puppeteer/wait_task.rb +2 -4
  31. data/lib/puppeteer/web_socket_transport.rb +8 -8
  32. data/puppeteer-ruby.gemspec +1 -1
  33. data/puppeteer-ruby.png +0 -0
  34. metadata +9 -102
  35. data/Dockerfile +0 -6
  36. data/docker-compose.yml +0 -15
  37. data/docs/Puppeteer.html +0 -2020
  38. data/docs/Puppeteer/AsyncAwaitBehavior.html +0 -105
  39. data/docs/Puppeteer/Browser.html +0 -2148
  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 -430
  47. data/docs/Puppeteer/Connection.html +0 -960
  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/ElementNotFoundError.html +0 -206
  62. data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +0 -206
  63. data/docs/Puppeteer/ElementHandle/Point.html +0 -492
  64. data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +0 -124
  65. data/docs/Puppeteer/EmulationManager.html +0 -454
  66. data/docs/Puppeteer/EventCallbackable.html +0 -433
  67. data/docs/Puppeteer/EventCallbackable/EventListeners.html +0 -435
  68. data/docs/Puppeteer/ExecutionContext.html +0 -998
  69. data/docs/Puppeteer/ExecutionContext/EvaluationError.html +0 -124
  70. data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +0 -357
  71. data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +0 -389
  72. data/docs/Puppeteer/FileChooser.html +0 -455
  73. data/docs/Puppeteer/Frame.html +0 -3677
  74. data/docs/Puppeteer/FrameManager.html +0 -2410
  75. data/docs/Puppeteer/FrameManager/NavigationError.html +0 -124
  76. data/docs/Puppeteer/IfPresent.html +0 -222
  77. data/docs/Puppeteer/JSHandle.html +0 -1352
  78. data/docs/Puppeteer/Keyboard.html +0 -1557
  79. data/docs/Puppeteer/Keyboard/KeyDefinition.html +0 -831
  80. data/docs/Puppeteer/Keyboard/KeyDescription.html +0 -603
  81. data/docs/Puppeteer/Launcher.html +0 -237
  82. data/docs/Puppeteer/Launcher/Base.html +0 -385
  83. data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +0 -124
  84. data/docs/Puppeteer/Launcher/BrowserOptions.html +0 -441
  85. data/docs/Puppeteer/Launcher/Chrome.html +0 -669
  86. data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +0 -382
  87. data/docs/Puppeteer/Launcher/ChromeArgOptions.html +0 -531
  88. data/docs/Puppeteer/Launcher/LaunchOptions.html +0 -893
  89. data/docs/Puppeteer/LifecycleWatcher.html +0 -834
  90. data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +0 -363
  91. data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +0 -206
  92. data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +0 -124
  93. data/docs/Puppeteer/Mouse.html +0 -1105
  94. data/docs/Puppeteer/Mouse/Button.html +0 -136
  95. data/docs/Puppeteer/NetworkManager.html +0 -901
  96. data/docs/Puppeteer/NetworkManager/Credentials.html +0 -385
  97. data/docs/Puppeteer/Page.html +0 -5970
  98. data/docs/Puppeteer/Page/FileChooserTimeoutError.html +0 -206
  99. data/docs/Puppeteer/Page/ScreenshotOptions.html +0 -845
  100. data/docs/Puppeteer/Page/ScriptTag.html +0 -555
  101. data/docs/Puppeteer/Page/StyleTag.html +0 -448
  102. data/docs/Puppeteer/Page/TargetCrashedError.html +0 -124
  103. data/docs/Puppeteer/RemoteObject.html +0 -1087
  104. data/docs/Puppeteer/Target.html +0 -1336
  105. data/docs/Puppeteer/Target/InitializeFailure.html +0 -124
  106. data/docs/Puppeteer/Target/TargetInfo.html +0 -729
  107. data/docs/Puppeteer/TimeoutError.html +0 -135
  108. data/docs/Puppeteer/TimeoutSettings.html +0 -496
  109. data/docs/Puppeteer/TouchScreen.html +0 -464
  110. data/docs/Puppeteer/Viewport.html +0 -837
  111. data/docs/Puppeteer/WaitTask.html +0 -637
  112. data/docs/Puppeteer/WaitTask/TerminatedError.html +0 -124
  113. data/docs/Puppeteer/WaitTask/TimeoutError.html +0 -206
  114. data/docs/Puppeteer/WebSocket.html +0 -673
  115. data/docs/Puppeteer/WebSocket/DriverImpl.html +0 -412
  116. data/docs/Puppeteer/WebSocketTransport.html +0 -600
  117. data/docs/Puppeteer/WebSocktTransportError.html +0 -124
  118. data/docs/_index.html +0 -823
  119. data/docs/class_list.html +0 -51
  120. data/docs/css/common.css +0 -1
  121. data/docs/css/full_list.css +0 -58
  122. data/docs/css/style.css +0 -496
  123. data/docs/file.README.html +0 -123
  124. data/docs/file_list.html +0 -56
  125. data/docs/frames.html +0 -17
  126. data/docs/index.html +0 -123
  127. data/docs/js/app.js +0 -314
  128. data/docs/js/full_list.js +0 -216
  129. data/docs/js/jquery.js +0 -4
  130. data/docs/method_list.html +0 -4075
  131. data/docs/top-level-namespace.html +0 -126
  132. data/lib/puppeteer/async_await_behavior.rb +0 -38
@@ -1,124 +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
- Exception: Puppeteer::FrameManager::NavigationError
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::FrameManager::NavigationError";
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> &raquo; <span class='title'><span class='object_link'><a href="../FrameManager.html" title="Puppeteer::FrameManager (class)">FrameManager</a></span></span>
41
- &raquo;
42
- <span class="title">NavigationError</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>Exception: Puppeteer::FrameManager::NavigationError
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
- <dl>
70
- <dt>Inherits:</dt>
71
- <dd>
72
- <span class="inheritName">StandardError</span>
73
-
74
- <ul class="fullTree">
75
- <li>Object</li>
76
-
77
- <li class="next">StandardError</li>
78
-
79
- <li class="next">Puppeteer::FrameManager::NavigationError</li>
80
-
81
- </ul>
82
- <a href="#" class="inheritanceTree">show all</a>
83
-
84
- </dd>
85
- </dl>
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
- <dl>
98
- <dt>Defined in:</dt>
99
- <dd>lib/puppeteer/frame_manager.rb</dd>
100
- </dl>
101
-
102
- </div>
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
- </div>
115
-
116
- <div id="footer">
117
- Generated on Fri Jun 12 12:38:34 2020 by
118
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
- 0.9.24 (ruby-2.6.3).
120
- </div>
121
-
122
- </div>
123
- </body>
124
- </html>
@@ -1,222 +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::IfPresent
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::IfPresent";
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 (I)</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">IfPresent</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::IfPresent
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
- <dl>
78
- <dt>Included in:</dt>
79
- <dd><span class='object_link'><a href="Browser.html" title="Puppeteer::Browser (class)">Browser</a></span>, <span class='object_link'><a href="ElementHandle.html" title="Puppeteer::ElementHandle (class)">ElementHandle</a></span>, <span class='object_link'><a href="ExecutionContext.html" title="Puppeteer::ExecutionContext (class)">ExecutionContext</a></span>, <span class='object_link'><a href="ExecutionContext/JavaScriptFunction.html" title="Puppeteer::ExecutionContext::JavaScriptFunction (class)">ExecutionContext::JavaScriptFunction</a></span>, <span class='object_link'><a href="FrameManager.html" title="Puppeteer::FrameManager (class)">FrameManager</a></span>, <span class='object_link'><a href="LifecycleWatcher.html" title="Puppeteer::LifecycleWatcher (class)">LifecycleWatcher</a></span>, <span class='object_link'><a href="Page.html" title="Puppeteer::Page (class)">Page</a></span></dd>
80
- </dl>
81
-
82
-
83
-
84
- <dl>
85
- <dt>Defined in:</dt>
86
- <dd>lib/puppeteer/if_present.rb</dd>
87
- </dl>
88
-
89
- </div>
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- <h2>
100
- Instance Method Summary
101
- <small><a href="#" class="summary_toggle">collapse</a></small>
102
- </h2>
103
-
104
- <ul class="summary">
105
-
106
- <li class="public ">
107
- <span class="summary_signature">
108
-
109
- <a href="#if_present-instance_method" title="#if_present (instance method)">#<strong>if_present</strong>(target, &amp;block) &#x21d2; Object </a>
110
-
111
-
112
-
113
- </span>
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
- <span class="summary_desc"><div class='inline'>
124
- <p>Similar to #try in ActiveSupport::CoreExt.</p>
125
- </div></span>
126
-
127
- </li>
128
-
129
-
130
- </ul>
131
-
132
-
133
-
134
-
135
- <div id="instance_method_details" class="method_details_list">
136
- <h2>Instance Method Details</h2>
137
-
138
-
139
- <div class="method_details first">
140
- <h3 class="signature first" id="if_present-instance_method">
141
-
142
- #<strong>if_present</strong>(target, &amp;block) &#x21d2; <tt>Object</tt>
143
-
144
-
145
-
146
-
147
-
148
- </h3><div class="docstring">
149
- <div class="discussion">
150
-
151
- <p>Similar to #try in ActiveSupport::CoreExt.</p>
152
-
153
- <p>Evaluate block with the target, only if target is not nil. Returns nil if target is nil.</p>
154
- <hr>
155
-
156
- <p><a href="'target'">if_present(params</a>) do |target|</p>
157
-
158
- <pre class="code ruby"><code class="ruby"><span class='const'>Point</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>x</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>y</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
159
- </code></pre>
160
-
161
- <p>end</p>
162
- <hr>
163
-
164
-
165
- </div>
166
- </div>
167
- <div class="tags">
168
-
169
- <p class="tag_title">Raises:</p>
170
- <ul class="raise">
171
-
172
- <li>
173
-
174
-
175
- <span class='type'>(<tt>ArgumentError</tt>)</span>
176
-
177
-
178
-
179
- </li>
180
-
181
- </ul>
182
-
183
- </div><table class="source_code">
184
- <tr>
185
- <td>
186
- <pre class="lines">
187
-
188
-
189
- 12
190
- 13
191
- 14
192
- 15
193
- 16
194
- 17</pre>
195
- </td>
196
- <td>
197
- <pre class="code"><span class="info file"># File 'lib/puppeteer/if_present.rb', line 12</span>
198
-
199
- <span class='kw'>def</span> <span class='id identifier rubyid_if_present'>if_present</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
200
- <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'>&#39;</span><span class='tstring_content'>block must be provided for #if_present</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
201
- <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
202
-
203
- <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
204
- <span class='kw'>end</span></pre>
205
- </td>
206
- </tr>
207
- </table>
208
- </div>
209
-
210
- </div>
211
-
212
- </div>
213
-
214
- <div id="footer">
215
- Generated on Fri Jun 12 12:38:32 2020 by
216
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
217
- 0.9.24 (ruby-2.6.3).
218
- </div>
219
-
220
- </div>
221
- </body>
222
- </html>
@@ -1,1352 +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::JSHandle
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::JSHandle";
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 (J)</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">JSHandle</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::JSHandle
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::JSHandle</li>
78
-
79
- </ul>
80
- <a href="#" class="inheritanceTree">show all</a>
81
-
82
- </dd>
83
- </dl>
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
- <dl>
96
- <dt>Defined in:</dt>
97
- <dd>lib/puppeteer/js_handle.rb</dd>
98
- </dl>
99
-
100
- </div>
101
-
102
- <div id="subclasses">
103
- <h2>Direct Known Subclasses</h2>
104
- <p class="children"><span class='object_link'><a href="ElementHandle.html" title="Puppeteer::ElementHandle (class)">ElementHandle</a></span></p>
105
- </div>
106
-
107
-
108
-
109
-
110
- <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
111
- <ul class="summary">
112
-
113
- <li class="public ">
114
- <span class="summary_signature">
115
-
116
- <a href="#context-instance_method" title="#context (instance method)">#<strong>context</strong> &#x21d2; Object </a>
117
-
118
-
119
-
120
- </span>
121
-
122
-
123
-
124
-
125
- <span class="note title readonly">readonly</span>
126
-
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
- <span class="summary_desc"><div class='inline'>
136
- <p>Returns the value of attribute context.</p>
137
- </div></span>
138
-
139
- </li>
140
-
141
-
142
- <li class="public ">
143
- <span class="summary_signature">
144
-
145
- <a href="#remote_object-instance_method" title="#remote_object (instance method)">#<strong>remote_object</strong> &#x21d2; Object </a>
146
-
147
-
148
-
149
- </span>
150
-
151
-
152
-
153
-
154
- <span class="note title readonly">readonly</span>
155
-
156
-
157
-
158
-
159
-
160
-
161
-
162
-
163
-
164
- <span class="summary_desc"><div class='inline'>
165
- <p>Returns the value of attribute remote_object.</p>
166
- </div></span>
167
-
168
- </li>
169
-
170
-
171
- </ul>
172
-
173
-
174
-
175
-
176
-
177
- <h2>
178
- Class Method Summary
179
- <small><a href="#" class="summary_toggle">collapse</a></small>
180
- </h2>
181
-
182
- <ul class="summary">
183
-
184
- <li class="public ">
185
- <span class="summary_signature">
186
-
187
- <a href="#create-class_method" title="create (class method)">.<strong>create</strong>(context:, remote_object:) &#x21d2; Object </a>
188
-
189
-
190
-
191
- </span>
192
-
193
-
194
-
195
-
196
-
197
-
198
-
199
-
200
-
201
- <span class="summary_desc"><div class='inline'></div></span>
202
-
203
- </li>
204
-
205
-
206
- </ul>
207
-
208
- <h2>
209
- Instance Method Summary
210
- <small><a href="#" class="summary_toggle">collapse</a></small>
211
- </h2>
212
-
213
- <ul class="summary">
214
-
215
- <li class="public ">
216
- <span class="summary_signature">
217
-
218
- <a href="#as_element-instance_method" title="#as_element (instance method)">#<strong>as_element</strong> &#x21d2; Object </a>
219
-
220
-
221
-
222
- </span>
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
- <span class="summary_desc"><div class='inline'></div></span>
233
-
234
- </li>
235
-
236
-
237
- <li class="public ">
238
- <span class="summary_signature">
239
-
240
- <a href="#async_evaluate-instance_method" title="#async_evaluate (instance method)">#<strong>async_evaluate</strong> &#x21d2; Future&lt;Object&gt; </a>
241
-
242
-
243
-
244
- </span>
245
-
246
-
247
-
248
-
249
-
250
-
251
-
252
-
253
-
254
- <span class="summary_desc"><div class='inline'></div></span>
255
-
256
- </li>
257
-
258
-
259
- <li class="public ">
260
- <span class="summary_signature">
261
-
262
- <a href="#async_evaluate_handle-instance_method" title="#async_evaluate_handle (instance method)">#<strong>async_evaluate_handle</strong> &#x21d2; Future&lt;Puppeteer::JSHandle&gt; </a>
263
-
264
-
265
-
266
- </span>
267
-
268
-
269
-
270
-
271
-
272
-
273
-
274
-
275
-
276
- <span class="summary_desc"><div class='inline'></div></span>
277
-
278
- </li>
279
-
280
-
281
- <li class="public ">
282
- <span class="summary_signature">
283
-
284
- <a href="#dispose-instance_method" title="#dispose (instance method)">#<strong>dispose</strong> &#x21d2; Object </a>
285
-
286
-
287
-
288
- </span>
289
-
290
-
291
-
292
-
293
-
294
-
295
-
296
-
297
-
298
- <span class="summary_desc"><div class='inline'></div></span>
299
-
300
- </li>
301
-
302
-
303
- <li class="public ">
304
- <span class="summary_signature">
305
-
306
- <a href="#disposed%3F-instance_method" title="#disposed? (instance method)">#<strong>disposed?</strong> &#x21d2; Boolean </a>
307
-
308
-
309
-
310
- </span>
311
-
312
-
313
-
314
-
315
-
316
-
317
-
318
-
319
-
320
- <span class="summary_desc"><div class='inline'></div></span>
321
-
322
- </li>
323
-
324
-
325
- <li class="public ">
326
- <span class="summary_signature">
327
-
328
- <a href="#evaluate-instance_method" title="#evaluate (instance method)">#<strong>evaluate</strong>(page_function, *args) &#x21d2; Object </a>
329
-
330
-
331
-
332
- </span>
333
-
334
-
335
-
336
-
337
-
338
-
339
-
340
-
341
-
342
- <span class="summary_desc"><div class='inline'></div></span>
343
-
344
- </li>
345
-
346
-
347
- <li class="public ">
348
- <span class="summary_signature">
349
-
350
- <a href="#evaluate_handle-instance_method" title="#evaluate_handle (instance method)">#<strong>evaluate_handle</strong>(page_function, *args) &#x21d2; Puppeteer::JSHandle </a>
351
-
352
-
353
-
354
- </span>
355
-
356
-
357
-
358
-
359
-
360
-
361
-
362
-
363
-
364
- <span class="summary_desc"><div class='inline'></div></span>
365
-
366
- </li>
367
-
368
-
369
- <li class="public ">
370
- <span class="summary_signature">
371
-
372
- <a href="#execution_context-instance_method" title="#execution_context (instance method)">#<strong>execution_context</strong> &#x21d2; Puppeteer::ExecutionContext </a>
373
-
374
-
375
-
376
- </span>
377
-
378
-
379
-
380
-
381
-
382
-
383
-
384
-
385
-
386
- <span class="summary_desc"><div class='inline'></div></span>
387
-
388
- </li>
389
-
390
-
391
- <li class="public ">
392
- <span class="summary_signature">
393
-
394
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(context:, client:, remote_object:) &#x21d2; JSHandle </a>
395
-
396
-
397
-
398
- </span>
399
-
400
-
401
- <span class="note title constructor">constructor</span>
402
-
403
-
404
-
405
-
406
-
407
-
408
-
409
-
410
- <span class="summary_desc"><div class='inline'>
411
- <p>A new instance of JSHandle.</p>
412
- </div></span>
413
-
414
- </li>
415
-
416
-
417
- <li class="public ">
418
- <span class="summary_signature">
419
-
420
- <a href="#json_value-instance_method" title="#json_value (instance method)">#<strong>json_value</strong> &#x21d2; Object </a>
421
-
422
-
423
-
424
- </span>
425
-
426
-
427
-
428
-
429
-
430
-
431
-
432
-
433
-
434
- <span class="summary_desc"><div class='inline'></div></span>
435
-
436
- </li>
437
-
438
-
439
- <li class="public ">
440
- <span class="summary_signature">
441
-
442
- <a href="#properties-instance_method" title="#properties (instance method)">#<strong>properties</strong> &#x21d2; Hash&lt;String, JSHandle&gt; </a>
443
-
444
-
445
-
446
- </span>
447
-
448
-
449
-
450
-
451
-
452
-
453
-
454
-
455
-
456
- <span class="summary_desc"><div class='inline'>
457
- <p>getProperties in JavaScript.</p>
458
- </div></span>
459
-
460
- </li>
461
-
462
-
463
- </ul>
464
-
465
-
466
- <div id="constructor_details" class="method_details_list">
467
- <h2>Constructor Details</h2>
468
-
469
- <div class="method_details first">
470
- <h3 class="signature first" id="initialize-instance_method">
471
-
472
- #<strong>initialize</strong>(context:, client:, remote_object:) &#x21d2; <tt><span class='object_link'><a href="" title="Puppeteer::JSHandle (class)">JSHandle</a></span></tt>
473
-
474
-
475
-
476
-
477
-
478
- </h3><div class="docstring">
479
- <div class="discussion">
480
-
481
- <p>Returns a new instance of JSHandle.</p>
482
-
483
-
484
- </div>
485
- </div>
486
- <div class="tags">
487
- <p class="tag_title">Parameters:</p>
488
- <ul class="param">
489
-
490
- <li>
491
-
492
- <span class='name'>context</span>
493
-
494
-
495
- <span class='type'>(<tt><span class='object_link'><a href="ExecutionContext.html" title="Puppeteer::ExecutionContext (class)">Puppeteer::ExecutionContext</a></span></tt>)</span>
496
-
497
-
498
-
499
- </li>
500
-
501
- <li>
502
-
503
- <span class='name'>client</span>
504
-
505
-
506
- <span class='type'>(<tt><span class='object_link'><a href="CDPSession.html" title="Puppeteer::CDPSession (class)">Puppeteer::CDPSession</a></span></tt>)</span>
507
-
508
-
509
-
510
- </li>
511
-
512
- <li>
513
-
514
- <span class='name'>remote_object</span>
515
-
516
-
517
- <span class='type'>(<tt><span class='object_link'><a href="RemoteObject.html" title="Puppeteer::RemoteObject (class)">Puppeteer::RemoteObject</a></span></tt>)</span>
518
-
519
-
520
-
521
- </li>
522
-
523
- </ul>
524
-
525
-
526
- </div><table class="source_code">
527
- <tr>
528
- <td>
529
- <pre class="lines">
530
-
531
-
532
- 29
533
- 30
534
- 31
535
- 32
536
- 33
537
- 34</pre>
538
- </td>
539
- <td>
540
- <pre class="code"><span class="info file"># File 'lib/puppeteer/js_handle.rb', line 29</span>
541
-
542
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>context:</span><span class='comma'>,</span> <span class='label'>client:</span><span class='comma'>,</span> <span class='label'>remote_object:</span><span class='rparen'>)</span>
543
- <span class='ivar'>@context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span>
544
- <span class='ivar'>@client</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span>
545
- <span class='ivar'>@remote_object</span> <span class='op'>=</span> <span class='id identifier rubyid_remote_object'>remote_object</span>
546
- <span class='ivar'>@disposed</span> <span class='op'>=</span> <span class='kw'>false</span>
547
- <span class='kw'>end</span></pre>
548
- </td>
549
- </tr>
550
- </table>
551
- </div>
552
-
553
- </div>
554
-
555
- <div id="instance_attr_details" class="attr_details">
556
- <h2>Instance Attribute Details</h2>
557
-
558
-
559
- <span id=""></span>
560
- <div class="method_details first">
561
- <h3 class="signature first" id="context-instance_method">
562
-
563
- #<strong>context</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
564
-
565
-
566
-
567
-
568
-
569
- </h3><div class="docstring">
570
- <div class="discussion">
571
-
572
- <p>Returns the value of attribute context.</p>
573
-
574
-
575
- </div>
576
- </div>
577
- <div class="tags">
578
-
579
-
580
- </div><table class="source_code">
581
- <tr>
582
- <td>
583
- <pre class="lines">
584
-
585
-
586
- 36
587
- 37
588
- 38</pre>
589
- </td>
590
- <td>
591
- <pre class="code"><span class="info file"># File 'lib/puppeteer/js_handle.rb', line 36</span>
592
-
593
- <span class='kw'>def</span> <span class='id identifier rubyid_context'>context</span>
594
- <span class='ivar'>@context</span>
595
- <span class='kw'>end</span></pre>
596
- </td>
597
- </tr>
598
- </table>
599
- </div>
600
-
601
-
602
- <span id=""></span>
603
- <div class="method_details ">
604
- <h3 class="signature " id="remote_object-instance_method">
605
-
606
- #<strong>remote_object</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
607
-
608
-
609
-
610
-
611
-
612
- </h3><div class="docstring">
613
- <div class="discussion">
614
-
615
- <p>Returns the value of attribute remote_object.</p>
616
-
617
-
618
- </div>
619
- </div>
620
- <div class="tags">
621
-
622
-
623
- </div><table class="source_code">
624
- <tr>
625
- <td>
626
- <pre class="lines">
627
-
628
-
629
- 36
630
- 37
631
- 38</pre>
632
- </td>
633
- <td>
634
- <pre class="code"><span class="info file"># File 'lib/puppeteer/js_handle.rb', line 36</span>
635
-
636
- <span class='kw'>def</span> <span class='id identifier rubyid_remote_object'>remote_object</span>
637
- <span class='ivar'>@remote_object</span>
638
- <span class='kw'>end</span></pre>
639
- </td>
640
- </tr>
641
- </table>
642
- </div>
643
-
644
- </div>
645
-
646
-
647
- <div id="class_method_details" class="method_details_list">
648
- <h2>Class Method Details</h2>
649
-
650
-
651
- <div class="method_details first">
652
- <h3 class="signature first" id="create-class_method">
653
-
654
- .<strong>create</strong>(context:, remote_object:) &#x21d2; <tt>Object</tt>
655
-
656
-
657
-
658
-
659
-
660
- </h3><div class="docstring">
661
- <div class="discussion">
662
-
663
-
664
- </div>
665
- </div>
666
- <div class="tags">
667
- <p class="tag_title">Parameters:</p>
668
- <ul class="param">
669
-
670
- <li>
671
-
672
- <span class='name'>context</span>
673
-
674
-
675
- <span class='type'>(<tt><span class='object_link'><a href="ExecutionContext.html" title="Puppeteer::ExecutionContext (class)">Puppeteer::ExecutionContext</a></span></tt>)</span>
676
-
677
-
678
-
679
- </li>
680
-
681
- <li>
682
-
683
- <span class='name'>remote_object</span>
684
-
685
-
686
- <span class='type'>(<tt><span class='object_link'><a href="RemoteObject.html" title="Puppeteer::RemoteObject (class)">Puppeteer::RemoteObject</a></span></tt>)</span>
687
-
688
-
689
-
690
- </li>
691
-
692
- </ul>
693
-
694
-
695
- </div><table class="source_code">
696
- <tr>
697
- <td>
698
- <pre class="lines">
699
-
700
-
701
- 6
702
- 7
703
- 8
704
- 9
705
- 10
706
- 11
707
- 12
708
- 13
709
- 14
710
- 15
711
- 16
712
- 17
713
- 18
714
- 19
715
- 20
716
- 21
717
- 22
718
- 23
719
- 24</pre>
720
- </td>
721
- <td>
722
- <pre class="code"><span class="info file"># File 'lib/puppeteer/js_handle.rb', line 6</span>
723
-
724
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='label'>context:</span><span class='comma'>,</span> <span class='label'>remote_object:</span><span class='rparen'>)</span>
725
- <span class='id identifier rubyid_frame'>frame</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_frame'>frame</span>
726
- <span class='kw'>if</span> <span class='id identifier rubyid_remote_object'>remote_object</span><span class='period'>.</span><span class='id identifier rubyid_sub_type'>sub_type</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>node</span><span class='tstring_end'>&#39;</span></span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_frame'>frame</span>
727
- <span class='id identifier rubyid_frame_manager'>frame_manager</span> <span class='op'>=</span> <span class='id identifier rubyid_frame'>frame</span><span class='period'>.</span><span class='id identifier rubyid_frame_manager'>frame_manager</span>
728
- <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="ElementHandle.html" title="Puppeteer::ElementHandle (class)">ElementHandle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ElementHandle.html#initialize-instance_method" title="Puppeteer::ElementHandle#initialize (method)">new</a></span></span><span class='lparen'>(</span>
729
- <span class='label'>context:</span> <span class='id identifier rubyid_context'>context</span><span class='comma'>,</span>
730
- <span class='label'>client:</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span><span class='comma'>,</span>
731
- <span class='label'>remote_object:</span> <span class='id identifier rubyid_remote_object'>remote_object</span><span class='comma'>,</span>
732
- <span class='label'>page:</span> <span class='id identifier rubyid_frame_manager'>frame_manager</span><span class='period'>.</span><span class='id identifier rubyid_page'>page</span><span class='comma'>,</span>
733
- <span class='label'>frame_manager:</span> <span class='id identifier rubyid_frame_manager'>frame_manager</span><span class='comma'>,</span>
734
- <span class='rparen'>)</span>
735
- <span class='kw'>else</span>
736
- <span class='const'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Puppeteer::JSHandle (class)">JSHandle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Puppeteer::JSHandle#initialize (method)">new</a></span></span><span class='lparen'>(</span>
737
- <span class='label'>context:</span> <span class='id identifier rubyid_context'>context</span><span class='comma'>,</span>
738
- <span class='label'>client:</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span><span class='comma'>,</span>
739
- <span class='label'>remote_object:</span> <span class='id identifier rubyid_remote_object'>remote_object</span><span class='comma'>,</span>
740
- <span class='rparen'>)</span>
741
- <span class='kw'>end</span>
742
- <span class='kw'>end</span></pre>
743
- </td>
744
- </tr>
745
- </table>
746
- </div>
747
-
748
- </div>
749
-
750
- <div id="instance_method_details" class="method_details_list">
751
- <h2>Instance Method Details</h2>
752
-
753
-
754
- <div class="method_details first">
755
- <h3 class="signature first" id="as_element-instance_method">
756
-
757
- #<strong>as_element</strong> &#x21d2; <tt>Object</tt>
758
-
759
-
760
-
761
-
762
-
763
- </h3><table class="source_code">
764
- <tr>
765
- <td>
766
- <pre class="lines">
767
-
768
-
769
- 116
770
- 117
771
- 118</pre>
772
- </td>
773
- <td>
774
- <pre class="code"><span class="info file"># File 'lib/puppeteer/js_handle.rb', line 116</span>
775
-
776
- <span class='kw'>def</span> <span class='id identifier rubyid_as_element'>as_element</span>
777
- <span class='kw'>nil</span>
778
- <span class='kw'>end</span></pre>
779
- </td>
780
- </tr>
781
- </table>
782
- </div>
783
-
784
- <div class="method_details ">
785
- <h3 class="signature " id="async_evaluate-instance_method">
786
-
787
- #<strong>async_evaluate</strong> &#x21d2; <tt>Future&lt;Object&gt;</tt>
788
-
789
-
790
-
791
-
792
-
793
- </h3><div class="docstring">
794
- <div class="discussion">
795
-
796
-
797
- </div>
798
- </div>
799
- <div class="tags">
800
- <p class="tag_title">Parameters:</p>
801
- <ul class="param">
802
-
803
- <li>
804
-
805
- <span class='name'>page_function</span>
806
-
807
-
808
- <span class='type'>(<tt>String</tt>)</span>
809
-
810
-
811
-
812
- </li>
813
-
814
- </ul>
815
-
816
- <p class="tag_title">Returns:</p>
817
- <ul class="return">
818
-
819
- <li>
820
-
821
-
822
- <span class='type'>(<tt>Future&lt;Object&gt;</tt>)</span>
823
-
824
-
825
-
826
- </li>
827
-
828
- </ul>
829
-
830
- </div><table class="source_code">
831
- <tr>
832
- <td>
833
- <pre class="lines">
834
-
835
-
836
- 51
837
- 52
838
- 53</pre>
839
- </td>
840
- <td>
841
- <pre class="code"><span class="info file"># File 'lib/puppeteer/js_handle.rb', line 51</span>
842
-
843
- <span class='id identifier rubyid_async'>async</span> <span class='kw'>def</span> <span class='id identifier rubyid_async_evaluate'>async_evaluate</span><span class='lparen'>(</span><span class='id identifier rubyid_page_function'>page_function</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
844
- <span class='id identifier rubyid_evaluate'>evaluate</span><span class='lparen'>(</span><span class='id identifier rubyid_page_function'>page_function</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
845
- <span class='kw'>end</span></pre>
846
- </td>
847
- </tr>
848
- </table>
849
- </div>
850
-
851
- <div class="method_details ">
852
- <h3 class="signature " id="async_evaluate_handle-instance_method">
853
-
854
- #<strong>async_evaluate_handle</strong> &#x21d2; <tt>Future&lt;<span class='object_link'><a href="" title="Puppeteer::JSHandle (class)">Puppeteer::JSHandle</a></span>&gt;</tt>
855
-
856
-
857
-
858
-
859
-
860
- </h3><div class="docstring">
861
- <div class="discussion">
862
-
863
-
864
- </div>
865
- </div>
866
- <div class="tags">
867
- <p class="tag_title">Parameters:</p>
868
- <ul class="param">
869
-
870
- <li>
871
-
872
- <span class='name'>page_function</span>
873
-
874
-
875
- <span class='type'>(<tt>String</tt>)</span>
876
-
877
-
878
-
879
- </li>
880
-
881
- <li>
882
-
883
- <span class='name'>args</span>
884
-
885
-
886
- <span class='type'>(<tt>Array&lt;*&gt;</tt>)</span>
887
-
888
-
889
-
890
- </li>
891
-
892
- </ul>
893
-
894
- <p class="tag_title">Returns:</p>
895
- <ul class="return">
896
-
897
- <li>
898
-
899
-
900
- <span class='type'>(<tt>Future&lt;<span class='object_link'><a href="" title="Puppeteer::JSHandle (class)">Puppeteer::JSHandle</a></span>&gt;</tt>)</span>
901
-
902
-
903
-
904
- </li>
905
-
906
- </ul>
907
-
908
- </div><table class="source_code">
909
- <tr>
910
- <td>
911
- <pre class="lines">
912
-
913
-
914
- 65
915
- 66
916
- 67</pre>
917
- </td>
918
- <td>
919
- <pre class="code"><span class="info file"># File 'lib/puppeteer/js_handle.rb', line 65</span>
920
-
921
- <span class='id identifier rubyid_async'>async</span> <span class='kw'>def</span> <span class='id identifier rubyid_async_evaluate_handle'>async_evaluate_handle</span><span class='lparen'>(</span><span class='id identifier rubyid_page_function'>page_function</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
922
- <span class='id identifier rubyid_evaluate_handle'>evaluate_handle</span><span class='lparen'>(</span><span class='id identifier rubyid_page_function'>page_function</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
923
- <span class='kw'>end</span></pre>
924
- </td>
925
- </tr>
926
- </table>
927
- </div>
928
-
929
- <div class="method_details ">
930
- <h3 class="signature " id="dispose-instance_method">
931
-
932
- #<strong>dispose</strong> &#x21d2; <tt>Object</tt>
933
-
934
-
935
-
936
-
937
-
938
- </h3><table class="source_code">
939
- <tr>
940
- <td>
941
- <pre class="lines">
942
-
943
-
944
- 120
945
- 121
946
- 122
947
- 123
948
- 124
949
- 125</pre>
950
- </td>
951
- <td>
952
- <pre class="code"><span class="info file"># File 'lib/puppeteer/js_handle.rb', line 120</span>
953
-
954
- <span class='kw'>def</span> <span class='id identifier rubyid_dispose'>dispose</span>
955
- <span class='kw'>return</span> <span class='kw'>if</span> <span class='ivar'>@disposed</span>
956
-
957
- <span class='ivar'>@disposed</span> <span class='op'>=</span> <span class='kw'>true</span>
958
- <span class='ivar'>@remote_object</span><span class='period'>.</span><span class='id identifier rubyid_release'>release</span><span class='lparen'>(</span><span class='ivar'>@client</span><span class='rparen'>)</span>
959
- <span class='kw'>end</span></pre>
960
- </td>
961
- </tr>
962
- </table>
963
- </div>
964
-
965
- <div class="method_details ">
966
- <h3 class="signature " id="disposed?-instance_method">
967
-
968
- #<strong>disposed?</strong> &#x21d2; <tt>Boolean</tt>
969
-
970
-
971
-
972
-
973
-
974
- </h3><div class="docstring">
975
- <div class="discussion">
976
-
977
-
978
- </div>
979
- </div>
980
- <div class="tags">
981
-
982
- <p class="tag_title">Returns:</p>
983
- <ul class="return">
984
-
985
- <li>
986
-
987
-
988
- <span class='type'>(<tt>Boolean</tt>)</span>
989
-
990
-
991
-
992
- </li>
993
-
994
- </ul>
995
-
996
- </div><table class="source_code">
997
- <tr>
998
- <td>
999
- <pre class="lines">
1000
-
1001
-
1002
- 127
1003
- 128
1004
- 129</pre>
1005
- </td>
1006
- <td>
1007
- <pre class="code"><span class="info file"># File 'lib/puppeteer/js_handle.rb', line 127</span>
1008
-
1009
- <span class='kw'>def</span> <span class='id identifier rubyid_disposed?'>disposed?</span>
1010
- <span class='ivar'>@disposed</span>
1011
- <span class='kw'>end</span></pre>
1012
- </td>
1013
- </tr>
1014
- </table>
1015
- </div>
1016
-
1017
- <div class="method_details ">
1018
- <h3 class="signature " id="evaluate-instance_method">
1019
-
1020
- #<strong>evaluate</strong>(page_function, *args) &#x21d2; <tt>Object</tt>
1021
-
1022
-
1023
-
1024
-
1025
-
1026
- </h3><div class="docstring">
1027
- <div class="discussion">
1028
-
1029
-
1030
- </div>
1031
- </div>
1032
- <div class="tags">
1033
- <p class="tag_title">Parameters:</p>
1034
- <ul class="param">
1035
-
1036
- <li>
1037
-
1038
- <span class='name'>page_function</span>
1039
-
1040
-
1041
- <span class='type'>(<tt>String</tt>)</span>
1042
-
1043
-
1044
-
1045
- </li>
1046
-
1047
- </ul>
1048
-
1049
- <p class="tag_title">Returns:</p>
1050
- <ul class="return">
1051
-
1052
- <li>
1053
-
1054
-
1055
- <span class='type'>(<tt>Object</tt>)</span>
1056
-
1057
-
1058
-
1059
- </li>
1060
-
1061
- </ul>
1062
-
1063
- </div><table class="source_code">
1064
- <tr>
1065
- <td>
1066
- <pre class="lines">
1067
-
1068
-
1069
- 45
1070
- 46
1071
- 47</pre>
1072
- </td>
1073
- <td>
1074
- <pre class="code"><span class="info file"># File 'lib/puppeteer/js_handle.rb', line 45</span>
1075
-
1076
- <span class='kw'>def</span> <span class='id identifier rubyid_evaluate'>evaluate</span><span class='lparen'>(</span><span class='id identifier rubyid_page_function'>page_function</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
1077
- <span class='id identifier rubyid_execution_context'>execution_context</span><span class='period'>.</span><span class='id identifier rubyid_evaluate'>evaluate</span><span class='lparen'>(</span><span class='id identifier rubyid_page_function'>page_function</span><span class='comma'>,</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
1078
- <span class='kw'>end</span></pre>
1079
- </td>
1080
- </tr>
1081
- </table>
1082
- </div>
1083
-
1084
- <div class="method_details ">
1085
- <h3 class="signature " id="evaluate_handle-instance_method">
1086
-
1087
- #<strong>evaluate_handle</strong>(page_function, *args) &#x21d2; <tt><span class='object_link'><a href="" title="Puppeteer::JSHandle (class)">Puppeteer::JSHandle</a></span></tt>
1088
-
1089
-
1090
-
1091
-
1092
-
1093
- </h3><div class="docstring">
1094
- <div class="discussion">
1095
-
1096
-
1097
- </div>
1098
- </div>
1099
- <div class="tags">
1100
- <p class="tag_title">Parameters:</p>
1101
- <ul class="param">
1102
-
1103
- <li>
1104
-
1105
- <span class='name'>page_function</span>
1106
-
1107
-
1108
- <span class='type'>(<tt>String</tt>)</span>
1109
-
1110
-
1111
-
1112
- </li>
1113
-
1114
- <li>
1115
-
1116
- <span class='name'>args</span>
1117
-
1118
-
1119
- <span class='type'>(<tt>Array&lt;*&gt;</tt>)</span>
1120
-
1121
-
1122
-
1123
- </li>
1124
-
1125
- </ul>
1126
-
1127
- <p class="tag_title">Returns:</p>
1128
- <ul class="return">
1129
-
1130
- <li>
1131
-
1132
-
1133
- <span class='type'>(<tt><span class='object_link'><a href="" title="Puppeteer::JSHandle (class)">Puppeteer::JSHandle</a></span></tt>)</span>
1134
-
1135
-
1136
-
1137
- </li>
1138
-
1139
- </ul>
1140
-
1141
- </div><table class="source_code">
1142
- <tr>
1143
- <td>
1144
- <pre class="lines">
1145
-
1146
-
1147
- 58
1148
- 59
1149
- 60</pre>
1150
- </td>
1151
- <td>
1152
- <pre class="code"><span class="info file"># File 'lib/puppeteer/js_handle.rb', line 58</span>
1153
-
1154
- <span class='kw'>def</span> <span class='id identifier rubyid_evaluate_handle'>evaluate_handle</span><span class='lparen'>(</span><span class='id identifier rubyid_page_function'>page_function</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
1155
- <span class='id identifier rubyid_execution_context'>execution_context</span><span class='period'>.</span><span class='id identifier rubyid_evaluate_handle'>evaluate_handle</span><span class='lparen'>(</span><span class='id identifier rubyid_page_function'>page_function</span><span class='comma'>,</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
1156
- <span class='kw'>end</span></pre>
1157
- </td>
1158
- </tr>
1159
- </table>
1160
- </div>
1161
-
1162
- <div class="method_details ">
1163
- <h3 class="signature " id="execution_context-instance_method">
1164
-
1165
- #<strong>execution_context</strong> &#x21d2; <tt><span class='object_link'><a href="ExecutionContext.html" title="Puppeteer::ExecutionContext (class)">Puppeteer::ExecutionContext</a></span></tt>
1166
-
1167
-
1168
-
1169
-
1170
-
1171
- </h3><div class="docstring">
1172
- <div class="discussion">
1173
-
1174
-
1175
- </div>
1176
- </div>
1177
- <div class="tags">
1178
-
1179
- <p class="tag_title">Returns:</p>
1180
- <ul class="return">
1181
-
1182
- <li>
1183
-
1184
-
1185
- <span class='type'>(<tt><span class='object_link'><a href="ExecutionContext.html" title="Puppeteer::ExecutionContext (class)">Puppeteer::ExecutionContext</a></span></tt>)</span>
1186
-
1187
-
1188
-
1189
- </li>
1190
-
1191
- </ul>
1192
-
1193
- </div><table class="source_code">
1194
- <tr>
1195
- <td>
1196
- <pre class="lines">
1197
-
1198
-
1199
- 39
1200
- 40
1201
- 41</pre>
1202
- </td>
1203
- <td>
1204
- <pre class="code"><span class="info file"># File 'lib/puppeteer/js_handle.rb', line 39</span>
1205
-
1206
- <span class='kw'>def</span> <span class='id identifier rubyid_execution_context'>execution_context</span>
1207
- <span class='ivar'>@context</span>
1208
- <span class='kw'>end</span></pre>
1209
- </td>
1210
- </tr>
1211
- </table>
1212
- </div>
1213
-
1214
- <div class="method_details ">
1215
- <h3 class="signature " id="json_value-instance_method">
1216
-
1217
- #<strong>json_value</strong> &#x21d2; <tt>Object</tt>
1218
-
1219
-
1220
-
1221
-
1222
-
1223
- </h3><table class="source_code">
1224
- <tr>
1225
- <td>
1226
- <pre class="lines">
1227
-
1228
-
1229
- 98
1230
- 99
1231
- 100
1232
- 101
1233
- 102
1234
- 103
1235
- 104
1236
- 105
1237
- 106
1238
- 107
1239
- 108
1240
- 109
1241
- 110
1242
- 111
1243
- 112
1244
- 113
1245
- 114</pre>
1246
- </td>
1247
- <td>
1248
- <pre class="code"><span class="info file"># File 'lib/puppeteer/js_handle.rb', line 98</span>
1249
-
1250
- <span class='kw'>def</span> <span class='id identifier rubyid_json_value'>json_value</span>
1251
- <span class='comment'># original logic was:
1252
- </span> <span class='comment'># if (this._remoteObject.objectId) {
1253
- </span> <span class='comment'># const response = await this._client.send(&#39;Runtime.callFunctionOn&#39;, {
1254
- </span> <span class='comment'># functionDeclaration: &#39;function() { return this; }&#39;,
1255
- </span> <span class='comment'># objectId: this._remoteObject.objectId,
1256
- </span> <span class='comment'># returnByValue: true,
1257
- </span> <span class='comment'># awaitPromise: true,
1258
- </span> <span class='comment'># });
1259
- </span> <span class='comment'># return helper.valueFromRemoteObject(response.result);
1260
- </span> <span class='comment'># }
1261
- </span> <span class='comment'># return helper.valueFromRemoteObject(this._remoteObject);
1262
- </span> <span class='comment'>#
1263
- </span> <span class='comment'># However it would be better that RemoteObject is responsible for
1264
- </span> <span class='comment'># the logic `if (this._remoteObject.objectId) { ... }`.
1265
- </span> <span class='ivar'>@remote_object</span><span class='period'>.</span><span class='id identifier rubyid_evaluate_self'>evaluate_self</span><span class='lparen'>(</span><span class='ivar'>@client</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='ivar'>@remote_object</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span>
1266
- <span class='kw'>end</span></pre>
1267
- </td>
1268
- </tr>
1269
- </table>
1270
- </div>
1271
-
1272
- <div class="method_details ">
1273
- <h3 class="signature " id="properties-instance_method">
1274
-
1275
- #<strong>properties</strong> &#x21d2; <tt>Hash&lt;String, <span class='object_link'><a href="" title="Puppeteer::JSHandle (class)">JSHandle</a></span>&gt;</tt>
1276
-
1277
-
1278
-
1279
-
1280
-
1281
- </h3><div class="docstring">
1282
- <div class="discussion">
1283
-
1284
- <p>getProperties in JavaScript.</p>
1285
-
1286
-
1287
- </div>
1288
- </div>
1289
- <div class="tags">
1290
-
1291
- <p class="tag_title">Returns:</p>
1292
- <ul class="return">
1293
-
1294
- <li>
1295
-
1296
-
1297
- <span class='type'>(<tt>Hash&lt;String, <span class='object_link'><a href="" title="Puppeteer::JSHandle (class)">JSHandle</a></span>&gt;</tt>)</span>
1298
-
1299
-
1300
-
1301
- </li>
1302
-
1303
- </ul>
1304
-
1305
- </div><table class="source_code">
1306
- <tr>
1307
- <td>
1308
- <pre class="lines">
1309
-
1310
-
1311
- 87
1312
- 88
1313
- 89
1314
- 90
1315
- 91
1316
- 92
1317
- 93
1318
- 94
1319
- 95
1320
- 96</pre>
1321
- </td>
1322
- <td>
1323
- <pre class="code"><span class="info file"># File 'lib/puppeteer/js_handle.rb', line 87</span>
1324
-
1325
- <span class='kw'>def</span> <span class='id identifier rubyid_properties'>properties</span>
1326
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@remote_object</span><span class='period'>.</span><span class='id identifier rubyid_properties'>properties</span><span class='lparen'>(</span><span class='ivar'>@client</span><span class='rparen'>)</span>
1327
- <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>result</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_prop'>prop</span><span class='comma'>,</span> <span class='id identifier rubyid_h'>h</span><span class='op'>|</span>
1328
- <span class='kw'>next</span> <span class='kw'>unless</span> <span class='id identifier rubyid_prop'>prop</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>enumerable</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
1329
- <span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='id identifier rubyid_prop'>prop</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>name</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Puppeteer::JSHandle (class)">JSHandle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_create'><span class='object_link'><a href="#create-class_method" title="Puppeteer::JSHandle.create (method)">create</a></span></span><span class='lparen'>(</span>
1330
- <span class='label'>context:</span> <span class='ivar'>@context</span><span class='comma'>,</span>
1331
- <span class='label'>remote_object:</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="RemoteObject.html" title="Puppeteer::RemoteObject (class)">RemoteObject</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="RemoteObject.html#initialize-instance_method" title="Puppeteer::RemoteObject#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_prop'>prop</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>value</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='comma'>,</span>
1332
- <span class='rparen'>)</span>
1333
- <span class='kw'>end</span>
1334
- <span class='kw'>end</span></pre>
1335
- </td>
1336
- </tr>
1337
- </table>
1338
- </div>
1339
-
1340
- </div>
1341
-
1342
- </div>
1343
-
1344
- <div id="footer">
1345
- Generated on Fri Jun 12 12:38:34 2020 by
1346
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1347
- 0.9.24 (ruby-2.6.3).
1348
- </div>
1349
-
1350
- </div>
1351
- </body>
1352
- </html>