puppeteer-ruby 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +0 -12
- data/.github/workflows/docs.yml +45 -0
- data/.github/workflows/reviewdog.yml +15 -0
- data/README.md +52 -1
- data/lib/puppeteer.rb +1 -1
- data/lib/puppeteer/browser.rb +17 -25
- data/lib/puppeteer/cdp_session.rb +3 -19
- data/lib/puppeteer/concurrent_ruby_utils.rb +6 -0
- data/lib/puppeteer/connection.rb +3 -15
- data/lib/puppeteer/define_async_method.rb +23 -0
- data/lib/puppeteer/dom_world.rb +6 -21
- data/lib/puppeteer/element_handle.rb +15 -44
- data/lib/puppeteer/emulation_manager.rb +2 -6
- data/lib/puppeteer/execution_context.rb +1 -6
- data/lib/puppeteer/frame.rb +30 -16
- data/lib/puppeteer/frame_manager.rb +7 -25
- data/lib/puppeteer/js_handle.rb +3 -12
- data/lib/puppeteer/keyboard.rb +6 -27
- data/lib/puppeteer/mouse.rb +5 -25
- data/lib/puppeteer/page.rb +39 -63
- data/lib/puppeteer/remote_object.rb +2 -5
- data/lib/puppeteer/touch_screen.rb +2 -7
- data/lib/puppeteer/version.rb +1 -1
- data/lib/puppeteer/wait_task.rb +2 -4
- data/puppeteer-ruby.gemspec +1 -1
- metadata +7 -103
- data/docs/Puppeteer.html +0 -2338
- data/docs/Puppeteer/AsyncAwaitBehavior.html +0 -105
- data/docs/Puppeteer/Browser.html +0 -2258
- data/docs/Puppeteer/BrowserContext.html +0 -809
- data/docs/Puppeteer/BrowserFetcher.html +0 -214
- data/docs/Puppeteer/BrowserRunner.html +0 -914
- data/docs/Puppeteer/BrowserRunner/BrowserProcess.html +0 -477
- data/docs/Puppeteer/CDPSession.html +0 -813
- data/docs/Puppeteer/CDPSession/Error.html +0 -124
- data/docs/Puppeteer/ConcurrentRubyUtils.html +0 -438
- data/docs/Puppeteer/Connection.html +0 -964
- data/docs/Puppeteer/Connection/MessageCallback.html +0 -434
- data/docs/Puppeteer/Connection/ProtocolError.html +0 -216
- data/docs/Puppeteer/Connection/RequestDebugPrinter.html +0 -217
- data/docs/Puppeteer/Connection/ResponseDebugPrinter.html +0 -244
- data/docs/Puppeteer/ConsoleMessage.html +0 -565
- data/docs/Puppeteer/ConsoleMessage/Location.html +0 -433
- data/docs/Puppeteer/DOMWorld.html +0 -2293
- data/docs/Puppeteer/DOMWorld/DetachedError.html +0 -124
- data/docs/Puppeteer/DOMWorld/DocumentEvaluationError.html +0 -124
- data/docs/Puppeteer/DebugPrint.html +0 -233
- data/docs/Puppeteer/Device.html +0 -470
- data/docs/Puppeteer/Devices.html +0 -139
- data/docs/Puppeteer/ElementHandle.html +0 -2542
- data/docs/Puppeteer/ElementHandle/BoundingBox.html +0 -507
- data/docs/Puppeteer/ElementHandle/BoxModel.html +0 -404
- data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +0 -206
- data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +0 -206
- data/docs/Puppeteer/ElementHandle/Point.html +0 -492
- data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +0 -124
- data/docs/Puppeteer/EmulationManager.html +0 -454
- data/docs/Puppeteer/EventCallbackable.html +0 -499
- data/docs/Puppeteer/EventCallbackable/EventListeners.html +0 -435
- data/docs/Puppeteer/ExecutionContext.html +0 -998
- data/docs/Puppeteer/ExecutionContext/EvaluationError.html +0 -124
- data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +0 -357
- data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +0 -389
- data/docs/Puppeteer/FileChooser.html +0 -455
- data/docs/Puppeteer/Frame.html +0 -3835
- data/docs/Puppeteer/FrameManager.html +0 -2410
- data/docs/Puppeteer/FrameManager/NavigationError.html +0 -124
- data/docs/Puppeteer/IfPresent.html +0 -222
- data/docs/Puppeteer/JSHandle.html +0 -1352
- data/docs/Puppeteer/Keyboard.html +0 -1557
- data/docs/Puppeteer/Keyboard/KeyDefinition.html +0 -831
- data/docs/Puppeteer/Keyboard/KeyDescription.html +0 -603
- data/docs/Puppeteer/Launcher.html +0 -237
- data/docs/Puppeteer/Launcher/Base.html +0 -385
- data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +0 -124
- data/docs/Puppeteer/Launcher/BrowserOptions.html +0 -441
- data/docs/Puppeteer/Launcher/Chrome.html +0 -674
- data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +0 -382
- data/docs/Puppeteer/Launcher/ChromeArgOptions.html +0 -531
- data/docs/Puppeteer/Launcher/LaunchOptions.html +0 -893
- data/docs/Puppeteer/LifecycleWatcher.html +0 -834
- data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +0 -363
- data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +0 -206
- data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +0 -124
- data/docs/Puppeteer/Mouse.html +0 -1095
- data/docs/Puppeteer/Mouse/Button.html +0 -136
- data/docs/Puppeteer/NetworkManager.html +0 -901
- data/docs/Puppeteer/NetworkManager/Credentials.html +0 -385
- data/docs/Puppeteer/Page.html +0 -6173
- data/docs/Puppeteer/Page/FileChooserTimeoutError.html +0 -206
- data/docs/Puppeteer/Page/ScreenshotOptions.html +0 -845
- data/docs/Puppeteer/Page/ScriptTag.html +0 -555
- data/docs/Puppeteer/Page/StyleTag.html +0 -448
- data/docs/Puppeteer/Page/TargetCrashedError.html +0 -124
- data/docs/Puppeteer/RemoteObject.html +0 -1087
- data/docs/Puppeteer/Target.html +0 -1336
- data/docs/Puppeteer/Target/InitializeFailure.html +0 -124
- data/docs/Puppeteer/Target/TargetInfo.html +0 -729
- data/docs/Puppeteer/TimeoutError.html +0 -135
- data/docs/Puppeteer/TimeoutSettings.html +0 -496
- data/docs/Puppeteer/TouchScreen.html +0 -464
- data/docs/Puppeteer/Viewport.html +0 -837
- data/docs/Puppeteer/WaitTask.html +0 -637
- data/docs/Puppeteer/WaitTask/TerminatedError.html +0 -124
- data/docs/Puppeteer/WaitTask/TimeoutError.html +0 -206
- data/docs/Puppeteer/WebSocket.html +0 -673
- data/docs/Puppeteer/WebSocket/DriverImpl.html +0 -412
- data/docs/Puppeteer/WebSocket/TransportError.html +0 -124
- data/docs/Puppeteer/WebSocketTransport.html +0 -600
- data/docs/Puppeteer/WebSocktTransportError.html +0 -124
- data/docs/_index.html +0 -816
- data/docs/class_list.html +0 -51
- data/docs/css/common.css +0 -1
- data/docs/css/full_list.css +0 -58
- data/docs/css/style.css +0 -496
- data/docs/file.README.html +0 -125
- data/docs/file_list.html +0 -56
- data/docs/frames.html +0 -17
- data/docs/index.html +0 -125
- data/docs/js/app.js +0 -314
- data/docs/js/full_list.js +0 -216
- data/docs/js/jquery.js +0 -4
- data/docs/method_list.html +0 -4123
- data/docs/top-level-namespace.html +0 -126
- data/lib/puppeteer/async_await_behavior.rb +0 -38
data/lib/puppeteer/mouse.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
class Puppeteer::Mouse
|
|
2
|
-
using Puppeteer::
|
|
2
|
+
using Puppeteer::DefineAsyncMethod
|
|
3
3
|
|
|
4
4
|
module Button
|
|
5
5
|
NONE = 'none'
|
|
@@ -44,13 +44,7 @@ class Puppeteer::Mouse
|
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
# @param y [number]
|
|
49
|
-
# @param steps [number]
|
|
50
|
-
# @return [Future]
|
|
51
|
-
async def async_move(x, y, steps: nil)
|
|
52
|
-
move(x, y, steps: steps)
|
|
53
|
-
end
|
|
47
|
+
define_async_method :async_move
|
|
54
48
|
|
|
55
49
|
# @param x [number]
|
|
56
50
|
# @param y [number]
|
|
@@ -70,13 +64,7 @@ class Puppeteer::Mouse
|
|
|
70
64
|
up(button: button, click_count: click_count)
|
|
71
65
|
end
|
|
72
66
|
|
|
73
|
-
|
|
74
|
-
# @param y [number]
|
|
75
|
-
# @param {!{delay?: number, button?: "left"|"right"|"middle", clickCount?: number}=} options
|
|
76
|
-
# @return [Future]
|
|
77
|
-
async def async_click(x, y, delay: nil, button: nil, click_count: nil)
|
|
78
|
-
click(x, y, delay: delay, button: button, click_count: click_count)
|
|
79
|
-
end
|
|
67
|
+
define_async_method :async_click
|
|
80
68
|
|
|
81
69
|
# @param {!{button?: "left"|"right"|"middle", clickCount?: number}=} options
|
|
82
70
|
def down(button: nil, click_count: nil)
|
|
@@ -91,11 +79,7 @@ class Puppeteer::Mouse
|
|
|
91
79
|
)
|
|
92
80
|
end
|
|
93
81
|
|
|
94
|
-
|
|
95
|
-
# @return [Future]
|
|
96
|
-
async def async_down(button: nil, click_count: nil)
|
|
97
|
-
down(button: button, click_count: click_count)
|
|
98
|
-
end
|
|
82
|
+
define_async_method :async_down
|
|
99
83
|
|
|
100
84
|
# @param {!{button?: "left"|"right"|"middle", clickCount?: number}=} options
|
|
101
85
|
def up(button: nil, click_count: nil)
|
|
@@ -110,9 +94,5 @@ class Puppeteer::Mouse
|
|
|
110
94
|
)
|
|
111
95
|
end
|
|
112
96
|
|
|
113
|
-
|
|
114
|
-
# @return [Future]
|
|
115
|
-
async def async_up(button: nil, click_count: nil)
|
|
116
|
-
up(button: button, click_count: click_count)
|
|
117
|
-
end
|
|
97
|
+
define_async_method :async_up
|
|
118
98
|
end
|
data/lib/puppeteer/page.rb
CHANGED
|
@@ -5,7 +5,7 @@ require_relative './page/screenshot_options'
|
|
|
5
5
|
class Puppeteer::Page
|
|
6
6
|
include Puppeteer::EventCallbackable
|
|
7
7
|
include Puppeteer::IfPresent
|
|
8
|
-
using Puppeteer::
|
|
8
|
+
using Puppeteer::DefineAsyncMethod
|
|
9
9
|
|
|
10
10
|
# @param {!Puppeteer.CDPSession} client
|
|
11
11
|
# @param {!Puppeteer.Target} target
|
|
@@ -205,12 +205,7 @@ class Puppeteer::Page
|
|
|
205
205
|
end
|
|
206
206
|
end
|
|
207
207
|
|
|
208
|
-
|
|
209
|
-
# @return [Future<Puppeteer::FileChooser>]
|
|
210
|
-
async def async_wait_for_file_chooser(timeout: nil)
|
|
211
|
-
wait_for_file_chooser(timeout: timeout)
|
|
212
|
-
end
|
|
213
|
-
|
|
208
|
+
define_async_method :async_wait_for_file_chooser
|
|
214
209
|
|
|
215
210
|
# /**
|
|
216
211
|
# * @param {!{longitude: number, latitude: number, accuracy: (number|undefined)}} options
|
|
@@ -305,6 +300,8 @@ class Puppeteer::Page
|
|
|
305
300
|
main_frame.S(selector)
|
|
306
301
|
end
|
|
307
302
|
|
|
303
|
+
define_async_method :async_S
|
|
304
|
+
|
|
308
305
|
# `$$()` in JavaScript. $ is not allowed to use as a method name in Ruby.
|
|
309
306
|
# @param {string} selector
|
|
310
307
|
# @return {!Promise<!Array<!Puppeteer.ElementHandle>>}
|
|
@@ -312,6 +309,8 @@ class Puppeteer::Page
|
|
|
312
309
|
main_frame.SS(selector)
|
|
313
310
|
end
|
|
314
311
|
|
|
312
|
+
define_async_method :async_SS
|
|
313
|
+
|
|
315
314
|
# @param {Function|string} pageFunction
|
|
316
315
|
# @param {!Array<*>} args
|
|
317
316
|
# @return {!Promise<!Puppeteer.JSHandle>}
|
|
@@ -320,6 +319,8 @@ class Puppeteer::Page
|
|
|
320
319
|
context.evaluate_handle(page_function, *args)
|
|
321
320
|
end
|
|
322
321
|
|
|
322
|
+
define_async_method :async_evaluate_handle
|
|
323
|
+
|
|
323
324
|
# @param {!Puppeteer.JSHandle} prototypeHandle
|
|
324
325
|
# @return {!Promise<!Puppeteer.JSHandle>}
|
|
325
326
|
def query_objects(prototype_handle)
|
|
@@ -335,13 +336,7 @@ class Puppeteer::Page
|
|
|
335
336
|
main_frame.Seval(selector, page_function, *args)
|
|
336
337
|
end
|
|
337
338
|
|
|
338
|
-
|
|
339
|
-
# @param selector [String]
|
|
340
|
-
# @param page_function [String]
|
|
341
|
-
# @return [Future]
|
|
342
|
-
async def async_Seval(selector, page_function, *args)
|
|
343
|
-
Seval(selector, page_function, *args)
|
|
344
|
-
end
|
|
339
|
+
define_async_method :async_Seval
|
|
345
340
|
|
|
346
341
|
# `$$eval()` in JavaScript. $ is not allowed to use as a method name in Ruby.
|
|
347
342
|
# @param selector [String]
|
|
@@ -351,13 +346,7 @@ class Puppeteer::Page
|
|
|
351
346
|
main_frame.SSeval(selector, page_function, *args)
|
|
352
347
|
end
|
|
353
348
|
|
|
354
|
-
|
|
355
|
-
# @param selector [String]
|
|
356
|
-
# @param page_function [String]
|
|
357
|
-
# @return [Future]
|
|
358
|
-
async def async_SSeval(selector, page_function, *args)
|
|
359
|
-
SSeval(selector, page_function, *args)
|
|
360
|
-
end
|
|
349
|
+
define_async_method :async_SSeval
|
|
361
350
|
|
|
362
351
|
# `$x()` in JavaScript. $ is not allowed to use as a method name in Ruby.
|
|
363
352
|
# @param {string} expression
|
|
@@ -366,6 +355,8 @@ class Puppeteer::Page
|
|
|
366
355
|
main_frame.Sx(expression)
|
|
367
356
|
end
|
|
368
357
|
|
|
358
|
+
define_async_method :async_Sx
|
|
359
|
+
|
|
369
360
|
# /**
|
|
370
361
|
# * @param {!Array<string>} urls
|
|
371
362
|
# * @return {!Promise<!Array<Network.Cookie>>}
|
|
@@ -693,12 +684,7 @@ class Puppeteer::Page
|
|
|
693
684
|
main_frame.send(:wait_for_navigation, timeout: timeout, wait_until: wait_until)
|
|
694
685
|
end
|
|
695
686
|
|
|
696
|
-
|
|
697
|
-
# @param wait_until [string|nil] 'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2'
|
|
698
|
-
# @return [Future]
|
|
699
|
-
async def async_wait_for_navigation(timeout: nil, wait_until: nil)
|
|
700
|
-
wait_for_navigation(timeout: timeout, wait_until: wait_until)
|
|
701
|
-
end
|
|
687
|
+
define_async_method :async_wait_for_navigation
|
|
702
688
|
|
|
703
689
|
# /**
|
|
704
690
|
# * @param {(string|Function)} urlOrPredicate
|
|
@@ -831,6 +817,8 @@ class Puppeteer::Page
|
|
|
831
817
|
main_frame.evaluate(page_function, *args)
|
|
832
818
|
end
|
|
833
819
|
|
|
820
|
+
define_async_method :async_evaluate
|
|
821
|
+
|
|
834
822
|
# /**
|
|
835
823
|
# * @param {Function|string} pageFunction
|
|
836
824
|
# * @param {!Array<*>} args
|
|
@@ -982,16 +970,18 @@ class Puppeteer::Page
|
|
|
982
970
|
# return await helper.readProtocolStream(this._client, result.stream, path);
|
|
983
971
|
# }
|
|
984
972
|
|
|
985
|
-
# @param
|
|
986
|
-
def close
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
973
|
+
# @param run_before_unload [Boolean]
|
|
974
|
+
def close(run_before_unload: false)
|
|
975
|
+
unless @client.connection
|
|
976
|
+
raise 'Protocol error: Connection closed. Most likely the page has been closed.'
|
|
977
|
+
end
|
|
978
|
+
|
|
979
|
+
if run_before_unload
|
|
980
|
+
@client.send_message('Page.close')
|
|
981
|
+
else
|
|
982
|
+
@client.connection.send_message('Target.closeTarget', targetId: @target.target_id)
|
|
983
|
+
await @target.is_closed_promise
|
|
984
|
+
end
|
|
995
985
|
end
|
|
996
986
|
|
|
997
987
|
# @return [boolean]
|
|
@@ -1009,20 +999,15 @@ class Puppeteer::Page
|
|
|
1009
999
|
main_frame.click(selector, delay: delay, button: button, click_count: click_count)
|
|
1010
1000
|
end
|
|
1011
1001
|
|
|
1012
|
-
|
|
1013
|
-
# @param delay [Number]
|
|
1014
|
-
# @param button [String] "left"|"right"|"middle"
|
|
1015
|
-
# @param click_count [Number]
|
|
1016
|
-
# @return [Future]
|
|
1017
|
-
async def async_click(selector, delay: nil, button: nil, click_count: nil)
|
|
1018
|
-
click(selector, delay: delay, button: button, click_count: click_count)
|
|
1019
|
-
end
|
|
1002
|
+
define_async_method :async_click
|
|
1020
1003
|
|
|
1021
1004
|
# @param {string} selector
|
|
1022
1005
|
def focus(selector)
|
|
1023
1006
|
main_frame.focus(selector)
|
|
1024
1007
|
end
|
|
1025
1008
|
|
|
1009
|
+
define_async_method :async_focus
|
|
1010
|
+
|
|
1026
1011
|
# @param {string} selector
|
|
1027
1012
|
def hover(selector)
|
|
1028
1013
|
main_frame.hover(selector)
|
|
@@ -1035,15 +1020,14 @@ class Puppeteer::Page
|
|
|
1035
1020
|
main_frame.select(selector, *values)
|
|
1036
1021
|
end
|
|
1037
1022
|
|
|
1023
|
+
define_async_method :async_select
|
|
1024
|
+
|
|
1038
1025
|
# @param selector [String]
|
|
1039
1026
|
def tap(selector)
|
|
1040
1027
|
main_frame.tap(selector)
|
|
1041
1028
|
end
|
|
1042
1029
|
|
|
1043
|
-
|
|
1044
|
-
async def async_tap(selector)
|
|
1045
|
-
tap(selector)
|
|
1046
|
-
end
|
|
1030
|
+
define_async_method :async_tap
|
|
1047
1031
|
|
|
1048
1032
|
# @param selector [String]
|
|
1049
1033
|
# @param text [String]
|
|
@@ -1052,6 +1036,8 @@ class Puppeteer::Page
|
|
|
1052
1036
|
main_frame.type_text(selector, text, delay: delay)
|
|
1053
1037
|
end
|
|
1054
1038
|
|
|
1039
|
+
define_async_method :async_type_text
|
|
1040
|
+
|
|
1055
1041
|
# /**
|
|
1056
1042
|
# * @param {(string|number|Function)} selectorOrFunctionOrTimeout
|
|
1057
1043
|
# * @param {!{visible?: boolean, hidden?: boolean, timeout?: number, polling?: string|number}=} options
|
|
@@ -1070,13 +1056,7 @@ class Puppeteer::Page
|
|
|
1070
1056
|
main_frame.wait_for_selector(selector, visible: visible, hidden: hidden, timeout: timeout)
|
|
1071
1057
|
end
|
|
1072
1058
|
|
|
1073
|
-
|
|
1074
|
-
# @param visible [Boolean] Wait for element visible (not 'display: none' nor 'visibility: hidden') on true. default to false.
|
|
1075
|
-
# @param hidden [Boolean] Wait for element invisible ('display: none' nor 'visibility: hidden') on true. default to false.
|
|
1076
|
-
# @param timeout [Integer]
|
|
1077
|
-
async def async_wait_for_selector(selector, visible: nil, hidden: nil, timeout: nil)
|
|
1078
|
-
wait_for_selector(selector, visible: visible, hidden: hidden, timeout: timeout)
|
|
1079
|
-
end
|
|
1059
|
+
define_async_method :async_wait_for_selector
|
|
1080
1060
|
|
|
1081
1061
|
# @param xpath [String]
|
|
1082
1062
|
# @param visible [Boolean] Wait for element visible (not 'display: none' nor 'visibility: hidden') on true. default to false.
|
|
@@ -1086,13 +1066,7 @@ class Puppeteer::Page
|
|
|
1086
1066
|
main_frame.wait_for_xpath(xpath, visible: visible, hidden: hidden, timeout: timeout)
|
|
1087
1067
|
end
|
|
1088
1068
|
|
|
1089
|
-
|
|
1090
|
-
# @param visible [Boolean] Wait for element visible (not 'display: none' nor 'visibility: hidden') on true. default to false.
|
|
1091
|
-
# @param hidden [Boolean] Wait for element invisible ('display: none' nor 'visibility: hidden') on true. default to false.
|
|
1092
|
-
# @param timeout [Integer]
|
|
1093
|
-
async def async_wait_for_xpath(xpath, visible: nil, hidden: nil, timeout: nil)
|
|
1094
|
-
wait_for_xpath(xpath, visible: visible, hidden: hidden, timeout: timeout)
|
|
1095
|
-
end
|
|
1069
|
+
define_async_method :async_wait_for_xpath
|
|
1096
1070
|
|
|
1097
1071
|
# @param {Function|string} pageFunction
|
|
1098
1072
|
# @param {!{polling?: string|number, timeout?: number}=} options
|
|
@@ -1101,4 +1075,6 @@ class Puppeteer::Page
|
|
|
1101
1075
|
def wait_for_function(page_function, options = {}, *args)
|
|
1102
1076
|
main_frame.wait_for_function(page_function, options, *args)
|
|
1103
1077
|
end
|
|
1078
|
+
|
|
1079
|
+
define_async_method :async_wait_for_function
|
|
1104
1080
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# providing #valueFromRemoteObject, #releaseObject
|
|
2
2
|
class Puppeteer::RemoteObject
|
|
3
3
|
include Puppeteer::DebugPrint
|
|
4
|
-
using Puppeteer::
|
|
4
|
+
using Puppeteer::DefineAsyncMethod
|
|
5
5
|
|
|
6
6
|
# @param payload [Hash]
|
|
7
7
|
def initialize(payload)
|
|
@@ -111,10 +111,7 @@ class Puppeteer::RemoteObject
|
|
|
111
111
|
nil
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
async def async_release(client)
|
|
116
|
-
release(client)
|
|
117
|
-
end
|
|
114
|
+
define_async_method :async_release
|
|
118
115
|
|
|
119
116
|
def converted_arg
|
|
120
117
|
# ported logic from ExecutionContext#convertArgument
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
class Puppeteer::TouchScreen
|
|
2
|
-
using Puppeteer::
|
|
2
|
+
using Puppeteer::DefineAsyncMethod
|
|
3
3
|
|
|
4
4
|
# @param {Puppeteer.CDPSession} client
|
|
5
5
|
# @param keyboard [Puppeteer::Keyboard]
|
|
@@ -34,10 +34,5 @@ class Puppeteer::TouchScreen
|
|
|
34
34
|
)
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
# @param y [number]
|
|
39
|
-
# @return [Future]
|
|
40
|
-
async def async_tap(x, y)
|
|
41
|
-
tap(x, y)
|
|
42
|
-
end
|
|
37
|
+
define_async_method :async_tap
|
|
43
38
|
end
|
data/lib/puppeteer/version.rb
CHANGED
data/lib/puppeteer/wait_task.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
class Puppeteer::WaitTask
|
|
2
|
-
using Puppeteer::
|
|
2
|
+
using Puppeteer::DefineAsyncMethod
|
|
3
3
|
|
|
4
4
|
class TerminatedError < StandardError; end
|
|
5
5
|
|
|
@@ -106,9 +106,7 @@ class Puppeteer::WaitTask
|
|
|
106
106
|
@dom_world._wait_tasks.delete(self)
|
|
107
107
|
end
|
|
108
108
|
|
|
109
|
-
private
|
|
110
|
-
rerun
|
|
111
|
-
end
|
|
109
|
+
private define_async_method :async_rerun
|
|
112
110
|
|
|
113
111
|
WAIT_FOR_PREDICATE_PAGE_FUNCTION = <<~JAVASCRIPT
|
|
114
112
|
async function _(predicateBody, polling, timeout, ...args) {
|
data/puppeteer-ruby.gemspec
CHANGED
|
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
|
26
26
|
spec.add_development_dependency 'rake', '~> 10.0'
|
|
27
27
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
28
28
|
spec.add_development_dependency 'rspec_junit_formatter' # for CircleCI.
|
|
29
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
|
29
|
+
spec.add_development_dependency 'rubocop', '~> 0.86.0'
|
|
30
30
|
spec.add_development_dependency 'rubocop-rspec'
|
|
31
31
|
spec.add_development_dependency 'yard'
|
|
32
32
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: puppeteer-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- YusukeIwaki
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-06-
|
|
11
|
+
date: 2020-06-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: concurrent-ruby
|
|
@@ -128,14 +128,14 @@ dependencies:
|
|
|
128
128
|
requirements:
|
|
129
129
|
- - "~>"
|
|
130
130
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: 0.
|
|
131
|
+
version: 0.86.0
|
|
132
132
|
type: :development
|
|
133
133
|
prerelease: false
|
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
|
136
136
|
- - "~>"
|
|
137
137
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: 0.
|
|
138
|
+
version: 0.86.0
|
|
139
139
|
- !ruby/object:Gem::Dependency
|
|
140
140
|
name: rubocop-rspec
|
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -173,6 +173,8 @@ extra_rdoc_files: []
|
|
|
173
173
|
files:
|
|
174
174
|
- ".circleci/config.yml"
|
|
175
175
|
- ".github/stale.yml"
|
|
176
|
+
- ".github/workflows/docs.yml"
|
|
177
|
+
- ".github/workflows/reviewdog.yml"
|
|
176
178
|
- ".gitignore"
|
|
177
179
|
- ".rspec"
|
|
178
180
|
- ".rubocop.yml"
|
|
@@ -182,106 +184,7 @@ files:
|
|
|
182
184
|
- Rakefile
|
|
183
185
|
- bin/console
|
|
184
186
|
- bin/setup
|
|
185
|
-
- docs/Puppeteer.html
|
|
186
|
-
- docs/Puppeteer/AsyncAwaitBehavior.html
|
|
187
|
-
- docs/Puppeteer/Browser.html
|
|
188
|
-
- docs/Puppeteer/BrowserContext.html
|
|
189
|
-
- docs/Puppeteer/BrowserFetcher.html
|
|
190
|
-
- docs/Puppeteer/BrowserRunner.html
|
|
191
|
-
- docs/Puppeteer/BrowserRunner/BrowserProcess.html
|
|
192
|
-
- docs/Puppeteer/CDPSession.html
|
|
193
|
-
- docs/Puppeteer/CDPSession/Error.html
|
|
194
|
-
- docs/Puppeteer/ConcurrentRubyUtils.html
|
|
195
|
-
- docs/Puppeteer/Connection.html
|
|
196
|
-
- docs/Puppeteer/Connection/MessageCallback.html
|
|
197
|
-
- docs/Puppeteer/Connection/ProtocolError.html
|
|
198
|
-
- docs/Puppeteer/Connection/RequestDebugPrinter.html
|
|
199
|
-
- docs/Puppeteer/Connection/ResponseDebugPrinter.html
|
|
200
|
-
- docs/Puppeteer/ConsoleMessage.html
|
|
201
|
-
- docs/Puppeteer/ConsoleMessage/Location.html
|
|
202
|
-
- docs/Puppeteer/DOMWorld.html
|
|
203
|
-
- docs/Puppeteer/DOMWorld/DetachedError.html
|
|
204
|
-
- docs/Puppeteer/DOMWorld/DocumentEvaluationError.html
|
|
205
|
-
- docs/Puppeteer/DebugPrint.html
|
|
206
|
-
- docs/Puppeteer/Device.html
|
|
207
|
-
- docs/Puppeteer/Devices.html
|
|
208
|
-
- docs/Puppeteer/ElementHandle.html
|
|
209
|
-
- docs/Puppeteer/ElementHandle/BoundingBox.html
|
|
210
|
-
- docs/Puppeteer/ElementHandle/BoxModel.html
|
|
211
|
-
- docs/Puppeteer/ElementHandle/ElementNotFoundError.html
|
|
212
|
-
- docs/Puppeteer/ElementHandle/ElementNotVisibleError.html
|
|
213
|
-
- docs/Puppeteer/ElementHandle/Point.html
|
|
214
|
-
- docs/Puppeteer/ElementHandle/ScrollIntoViewError.html
|
|
215
|
-
- docs/Puppeteer/EmulationManager.html
|
|
216
|
-
- docs/Puppeteer/EventCallbackable.html
|
|
217
|
-
- docs/Puppeteer/EventCallbackable/EventListeners.html
|
|
218
|
-
- docs/Puppeteer/ExecutionContext.html
|
|
219
|
-
- docs/Puppeteer/ExecutionContext/EvaluationError.html
|
|
220
|
-
- docs/Puppeteer/ExecutionContext/JavaScriptExpression.html
|
|
221
|
-
- docs/Puppeteer/ExecutionContext/JavaScriptFunction.html
|
|
222
|
-
- docs/Puppeteer/FileChooser.html
|
|
223
|
-
- docs/Puppeteer/Frame.html
|
|
224
|
-
- docs/Puppeteer/FrameManager.html
|
|
225
|
-
- docs/Puppeteer/FrameManager/NavigationError.html
|
|
226
|
-
- docs/Puppeteer/IfPresent.html
|
|
227
|
-
- docs/Puppeteer/JSHandle.html
|
|
228
|
-
- docs/Puppeteer/Keyboard.html
|
|
229
|
-
- docs/Puppeteer/Keyboard/KeyDefinition.html
|
|
230
|
-
- docs/Puppeteer/Keyboard/KeyDescription.html
|
|
231
|
-
- docs/Puppeteer/Launcher.html
|
|
232
|
-
- docs/Puppeteer/Launcher/Base.html
|
|
233
|
-
- docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html
|
|
234
|
-
- docs/Puppeteer/Launcher/BrowserOptions.html
|
|
235
|
-
- docs/Puppeteer/Launcher/Chrome.html
|
|
236
|
-
- docs/Puppeteer/Launcher/Chrome/DefaultArgs.html
|
|
237
|
-
- docs/Puppeteer/Launcher/ChromeArgOptions.html
|
|
238
|
-
- docs/Puppeteer/Launcher/LaunchOptions.html
|
|
239
|
-
- docs/Puppeteer/LifecycleWatcher.html
|
|
240
|
-
- docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html
|
|
241
|
-
- docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html
|
|
242
|
-
- docs/Puppeteer/LifecycleWatcher/TerminatedError.html
|
|
243
|
-
- docs/Puppeteer/Mouse.html
|
|
244
|
-
- docs/Puppeteer/Mouse/Button.html
|
|
245
|
-
- docs/Puppeteer/NetworkManager.html
|
|
246
|
-
- docs/Puppeteer/NetworkManager/Credentials.html
|
|
247
|
-
- docs/Puppeteer/Page.html
|
|
248
|
-
- docs/Puppeteer/Page/FileChooserTimeoutError.html
|
|
249
|
-
- docs/Puppeteer/Page/ScreenshotOptions.html
|
|
250
|
-
- docs/Puppeteer/Page/ScriptTag.html
|
|
251
|
-
- docs/Puppeteer/Page/StyleTag.html
|
|
252
|
-
- docs/Puppeteer/Page/TargetCrashedError.html
|
|
253
|
-
- docs/Puppeteer/RemoteObject.html
|
|
254
|
-
- docs/Puppeteer/Target.html
|
|
255
|
-
- docs/Puppeteer/Target/InitializeFailure.html
|
|
256
|
-
- docs/Puppeteer/Target/TargetInfo.html
|
|
257
|
-
- docs/Puppeteer/TimeoutError.html
|
|
258
|
-
- docs/Puppeteer/TimeoutSettings.html
|
|
259
|
-
- docs/Puppeteer/TouchScreen.html
|
|
260
|
-
- docs/Puppeteer/Viewport.html
|
|
261
|
-
- docs/Puppeteer/WaitTask.html
|
|
262
|
-
- docs/Puppeteer/WaitTask/TerminatedError.html
|
|
263
|
-
- docs/Puppeteer/WaitTask/TimeoutError.html
|
|
264
|
-
- docs/Puppeteer/WebSocket.html
|
|
265
|
-
- docs/Puppeteer/WebSocket/DriverImpl.html
|
|
266
|
-
- docs/Puppeteer/WebSocket/TransportError.html
|
|
267
|
-
- docs/Puppeteer/WebSocketTransport.html
|
|
268
|
-
- docs/Puppeteer/WebSocktTransportError.html
|
|
269
|
-
- docs/_index.html
|
|
270
|
-
- docs/class_list.html
|
|
271
|
-
- docs/css/common.css
|
|
272
|
-
- docs/css/full_list.css
|
|
273
|
-
- docs/css/style.css
|
|
274
|
-
- docs/file.README.html
|
|
275
|
-
- docs/file_list.html
|
|
276
|
-
- docs/frames.html
|
|
277
|
-
- docs/index.html
|
|
278
|
-
- docs/js/app.js
|
|
279
|
-
- docs/js/full_list.js
|
|
280
|
-
- docs/js/jquery.js
|
|
281
|
-
- docs/method_list.html
|
|
282
|
-
- docs/top-level-namespace.html
|
|
283
187
|
- lib/puppeteer.rb
|
|
284
|
-
- lib/puppeteer/async_await_behavior.rb
|
|
285
188
|
- lib/puppeteer/browser.rb
|
|
286
189
|
- lib/puppeteer/browser_context.rb
|
|
287
190
|
- lib/puppeteer/browser_fetcher.rb
|
|
@@ -291,6 +194,7 @@ files:
|
|
|
291
194
|
- lib/puppeteer/connection.rb
|
|
292
195
|
- lib/puppeteer/console_message.rb
|
|
293
196
|
- lib/puppeteer/debug_print.rb
|
|
197
|
+
- lib/puppeteer/define_async_method.rb
|
|
294
198
|
- lib/puppeteer/device.rb
|
|
295
199
|
- lib/puppeteer/devices.rb
|
|
296
200
|
- lib/puppeteer/dom_world.rb
|