puppeteer-ruby 0.0.4 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +30 -0
- data/.rubocop.yml +4 -5
- data/README.md +3 -2
- data/docs/Puppeteer.html +2020 -0
- data/docs/Puppeteer/AsyncAwaitBehavior.html +105 -0
- data/docs/Puppeteer/Browser.html +2148 -0
- data/docs/Puppeteer/BrowserContext.html +809 -0
- data/docs/Puppeteer/BrowserFetcher.html +214 -0
- data/docs/Puppeteer/BrowserRunner.html +914 -0
- data/docs/Puppeteer/BrowserRunner/BrowserProcess.html +477 -0
- data/docs/Puppeteer/CDPSession.html +813 -0
- data/docs/Puppeteer/CDPSession/Error.html +124 -0
- data/docs/Puppeteer/ConcurrentRubyUtils.html +430 -0
- data/docs/Puppeteer/Connection.html +960 -0
- data/docs/Puppeteer/Connection/MessageCallback.html +434 -0
- data/docs/Puppeteer/Connection/ProtocolError.html +216 -0
- data/docs/Puppeteer/Connection/RequestDebugPrinter.html +217 -0
- data/docs/Puppeteer/Connection/ResponseDebugPrinter.html +244 -0
- data/docs/Puppeteer/ConsoleMessage.html +565 -0
- data/docs/Puppeteer/ConsoleMessage/Location.html +433 -0
- data/docs/Puppeteer/DOMWorld.html +2219 -0
- data/docs/Puppeteer/DOMWorld/DetachedError.html +124 -0
- data/docs/Puppeteer/DOMWorld/DocumentEvaluationError.html +124 -0
- data/docs/Puppeteer/DebugPrint.html +233 -0
- data/docs/Puppeteer/Device.html +470 -0
- data/docs/Puppeteer/Devices.html +139 -0
- data/docs/Puppeteer/ElementHandle.html +2542 -0
- data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +206 -0
- data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +206 -0
- data/docs/Puppeteer/ElementHandle/Point.html +492 -0
- data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +124 -0
- data/docs/Puppeteer/EmulationManager.html +454 -0
- data/docs/Puppeteer/EventCallbackable.html +433 -0
- data/docs/Puppeteer/EventCallbackable/EventListeners.html +435 -0
- data/docs/Puppeteer/ExecutionContext.html +998 -0
- data/docs/Puppeteer/ExecutionContext/EvaluationError.html +124 -0
- data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +357 -0
- data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +389 -0
- data/docs/Puppeteer/FileChooser.html +455 -0
- data/docs/Puppeteer/Frame.html +3677 -0
- data/docs/Puppeteer/FrameManager.html +2410 -0
- data/docs/Puppeteer/FrameManager/NavigationError.html +124 -0
- data/docs/Puppeteer/IfPresent.html +222 -0
- data/docs/Puppeteer/JSHandle.html +1352 -0
- data/docs/Puppeteer/Keyboard.html +1557 -0
- data/docs/Puppeteer/Keyboard/KeyDefinition.html +831 -0
- data/docs/Puppeteer/Keyboard/KeyDescription.html +603 -0
- data/docs/Puppeteer/Launcher.html +237 -0
- data/docs/Puppeteer/Launcher/Base.html +385 -0
- data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +124 -0
- data/docs/Puppeteer/Launcher/BrowserOptions.html +441 -0
- data/docs/Puppeteer/Launcher/Chrome.html +669 -0
- data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +382 -0
- data/docs/Puppeteer/Launcher/ChromeArgOptions.html +531 -0
- data/docs/Puppeteer/Launcher/LaunchOptions.html +893 -0
- data/docs/Puppeteer/LifecycleWatcher.html +834 -0
- data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +363 -0
- data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +206 -0
- data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +124 -0
- data/docs/Puppeteer/Mouse.html +1105 -0
- data/docs/Puppeteer/Mouse/Button.html +136 -0
- data/docs/Puppeteer/NetworkManager.html +901 -0
- data/docs/Puppeteer/NetworkManager/Credentials.html +385 -0
- data/docs/Puppeteer/Page.html +5970 -0
- data/docs/Puppeteer/Page/FileChooserTimeoutError.html +206 -0
- data/docs/Puppeteer/Page/ScreenshotOptions.html +845 -0
- data/docs/Puppeteer/Page/ScriptTag.html +555 -0
- data/docs/Puppeteer/Page/StyleTag.html +448 -0
- data/docs/Puppeteer/Page/TargetCrashedError.html +124 -0
- data/docs/Puppeteer/RemoteObject.html +1087 -0
- data/docs/Puppeteer/Target.html +1336 -0
- data/docs/Puppeteer/Target/InitializeFailure.html +124 -0
- data/docs/Puppeteer/Target/TargetInfo.html +729 -0
- data/docs/Puppeteer/TimeoutError.html +135 -0
- data/docs/Puppeteer/TimeoutSettings.html +496 -0
- data/docs/Puppeteer/TouchScreen.html +464 -0
- data/docs/Puppeteer/Viewport.html +837 -0
- data/docs/Puppeteer/WaitTask.html +637 -0
- data/docs/Puppeteer/WaitTask/TerminatedError.html +124 -0
- data/docs/Puppeteer/WaitTask/TimeoutError.html +206 -0
- data/docs/Puppeteer/WebSocket.html +673 -0
- data/docs/Puppeteer/WebSocket/DriverImpl.html +412 -0
- data/docs/Puppeteer/WebSocketTransport.html +600 -0
- data/docs/Puppeteer/WebSocktTransportError.html +124 -0
- data/docs/_index.html +823 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +496 -0
- data/docs/file.README.html +123 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +123 -0
- data/docs/js/app.js +314 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +4075 -0
- data/docs/top-level-namespace.html +126 -0
- data/lib/puppeteer.rb +16 -8
- data/lib/puppeteer/async_await_behavior.rb +6 -0
- data/lib/puppeteer/browser.rb +25 -6
- data/lib/puppeteer/browser_runner.rb +1 -1
- data/lib/puppeteer/cdp_session.rb +33 -11
- data/lib/puppeteer/connection.rb +1 -1
- data/lib/puppeteer/dom_world.rb +121 -104
- data/lib/puppeteer/element_handle.rb +186 -224
- data/lib/puppeteer/element_handle/bounding_box.rb +12 -0
- data/lib/puppeteer/element_handle/box_model.rb +19 -0
- data/lib/puppeteer/element_handle/point.rb +26 -0
- data/lib/puppeteer/errors.rb +1 -3
- data/lib/puppeteer/execution_context.rb +36 -17
- data/lib/puppeteer/file_chooser.rb +29 -0
- data/lib/puppeteer/frame.rb +17 -11
- data/lib/puppeteer/frame_manager.rb +1 -3
- data/lib/puppeteer/js_handle.rb +3 -2
- data/lib/puppeteer/launcher.rb +0 -1
- data/lib/puppeteer/launcher/chrome.rb +48 -2
- data/lib/puppeteer/lifecycle_watcher.rb +3 -3
- data/lib/puppeteer/page.rb +121 -68
- data/lib/puppeteer/remote_object.rb +15 -1
- data/lib/puppeteer/target.rb +24 -24
- data/lib/puppeteer/version.rb +1 -1
- data/lib/puppeteer/viewport.rb +18 -0
- data/lib/puppeteer/wait_task.rb +183 -1
- data/lib/puppeteer/web_socket.rb +3 -1
- data/lib/puppeteer/web_socket_transport.rb +1 -1
- data/puppeteer-ruby.gemspec +4 -1
- metadata +145 -4
@@ -52,7 +52,7 @@ class Puppeteer::RemoteObject
|
|
52
52
|
client.send_message('Runtime.getProperties', objectId: @object_id, ownProperties: true)
|
53
53
|
end
|
54
54
|
|
55
|
-
# used in ElementHandle#content_frame
|
55
|
+
# used in ElementHandle#content_frame, ElementHandle#upload_file
|
56
56
|
def node_info(client)
|
57
57
|
client.send_message('DOM.describeNode', objectId: @object_id)
|
58
58
|
end
|
@@ -62,6 +62,15 @@ class Puppeteer::RemoteObject
|
|
62
62
|
client.send_message('DOM.getContentQuads', objectId: @object_id)
|
63
63
|
end
|
64
64
|
|
65
|
+
# used in ElementHandle#_box_model
|
66
|
+
def box_model(client)
|
67
|
+
client.send_message('DOM.getBoxModel', objectId: @object_id)
|
68
|
+
rescue => err
|
69
|
+
debug_puts(err)
|
70
|
+
nil
|
71
|
+
end
|
72
|
+
|
73
|
+
|
65
74
|
# helper#valueFromRemoteObject
|
66
75
|
def value
|
67
76
|
if @unserializable_value
|
@@ -126,4 +135,9 @@ class Puppeteer::RemoteObject
|
|
126
135
|
{ value: value }
|
127
136
|
end
|
128
137
|
end
|
138
|
+
|
139
|
+
# used in ElementHandle#upload_file
|
140
|
+
def set_file_input_files(client, files, backend_node_id)
|
141
|
+
client.send_message('DOM.setFileInputFiles', objectId: @object_id, files: files, backendNodeId: backend_node_id)
|
142
|
+
end
|
129
143
|
end
|
data/lib/puppeteer/target.rb
CHANGED
@@ -33,47 +33,47 @@ class Puppeteer::Target
|
|
33
33
|
# this._pagePromise = null;
|
34
34
|
# /** @type {?Promise<!Worker>} */
|
35
35
|
# this._workerPromise = null;
|
36
|
-
@
|
37
|
-
|
36
|
+
@initialize_callback_promise = resolvable_future
|
37
|
+
@initialized_promise = @initialize_callback_promise.then do |success|
|
38
|
+
handle_initialized(success)
|
39
|
+
end
|
40
|
+
@is_closed_promise = resolvable_future
|
38
41
|
|
39
42
|
@is_initialized = @target_info.type != 'page' || !@target_info.url.empty?
|
40
43
|
|
41
44
|
if @is_initialized
|
42
|
-
|
45
|
+
@initialize_callback_promise.fulfill(true)
|
43
46
|
end
|
44
47
|
end
|
45
48
|
|
46
|
-
attr_reader :target_id, :initialized_promise
|
49
|
+
attr_reader :target_id, :initialized_promise, :is_closed_promise
|
50
|
+
|
51
|
+
def closed_callback
|
52
|
+
@is_closed_promise.fulfill(true)
|
53
|
+
end
|
47
54
|
|
48
55
|
class InitializeFailure < StandardError; end
|
49
56
|
|
50
|
-
def
|
57
|
+
def ignore_initialize_callback_promise
|
58
|
+
unless @initialize_callback_promise.fulfilled?
|
59
|
+
@initialize_callback_promise.fulfill(false)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
private def handle_initialized(success)
|
51
64
|
unless success
|
52
|
-
|
65
|
+
raise InitializeFailure.new('Failed to create target for page')
|
53
66
|
end
|
54
|
-
@on_initialize_succeeded&.call
|
55
|
-
@initialized_promise.fulfill(true)
|
56
67
|
opener_page = opener&.page
|
57
68
|
if opener_page.nil? || type != 'page'
|
58
|
-
return
|
69
|
+
return true
|
59
70
|
end
|
60
71
|
# if (!openerPage.listenerCount(Events.Page.Popup))
|
61
72
|
# return true;
|
62
73
|
popup_page = page
|
63
74
|
opener_page.emit_event('Events.Page.Popup', popup_page)
|
64
|
-
end
|
65
|
-
|
66
|
-
def on_initialize_succeeded(&block)
|
67
|
-
@on_initialize_succeeded = block
|
68
|
-
end
|
69
|
-
|
70
|
-
def handle_closed
|
71
|
-
@closed = true
|
72
|
-
@on_close&.call
|
73
|
-
end
|
74
75
|
|
75
|
-
|
76
|
-
@on_close = block
|
76
|
+
true
|
77
77
|
end
|
78
78
|
|
79
79
|
def initialized?
|
@@ -85,7 +85,7 @@ class Puppeteer::Target
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def page
|
88
|
-
if ['page', 'background_page'].include?(@target_info.type) && @page.nil?
|
88
|
+
if ['page', 'background_page', 'webview'].include?(@target_info.type) && @page.nil?
|
89
89
|
client = @session_factory.call
|
90
90
|
@page = Puppeteer::Page.create(client, self, @ignore_https_errors, @default_viewport, @screenshot_task_queue)
|
91
91
|
end
|
@@ -142,9 +142,9 @@ class Puppeteer::Target
|
|
142
142
|
def handle_target_info_changed(target_info)
|
143
143
|
@target_info = target_info
|
144
144
|
|
145
|
-
if !@is_initialized && (@target_info.type != 'page' ||
|
145
|
+
if !@is_initialized && (@target_info.type != 'page' || !@target_info.url.empty?)
|
146
146
|
@is_initialized = true
|
147
|
-
|
147
|
+
@initialize_callback_promise.fulfill(true)
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|
data/lib/puppeteer/version.rb
CHANGED
data/lib/puppeteer/viewport.rb
CHANGED
@@ -33,4 +33,22 @@ class Puppeteer::Viewport
|
|
33
33
|
def landscape?
|
34
34
|
@is_landscape
|
35
35
|
end
|
36
|
+
|
37
|
+
def merge(
|
38
|
+
width: nil,
|
39
|
+
height: nil,
|
40
|
+
device_scale_factor: nil,
|
41
|
+
is_mobile: nil,
|
42
|
+
has_touch: nil,
|
43
|
+
is_landscape: nil)
|
44
|
+
|
45
|
+
Puppeteer::Viewport.new(
|
46
|
+
width: width || @width,
|
47
|
+
height: height || @height,
|
48
|
+
device_scale_factor: device_scale_factor || @device_scale_factor,
|
49
|
+
is_mobile: is_mobile.nil? ? @is_mobile : is_mobile,
|
50
|
+
has_touch: has_touch.nil? ? @has_touch : has_touch,
|
51
|
+
is_landscape: is_landscape.nil? ? @is_landscape : is_landscape,
|
52
|
+
)
|
53
|
+
end
|
36
54
|
end
|
data/lib/puppeteer/wait_task.rb
CHANGED
@@ -1,6 +1,188 @@
|
|
1
1
|
class Puppeteer::WaitTask
|
2
|
+
using Puppeteer::AsyncAwaitBehavior
|
3
|
+
|
2
4
|
class TerminatedError < StandardError; end
|
3
5
|
|
4
|
-
|
6
|
+
class TimeoutError < StandardError
|
7
|
+
def initialize(title:, timeout:)
|
8
|
+
super("waiting for #{title} failed: timeout #{timeout}ms exceeded")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize(dom_world:, predicate_body:, title:, polling:, timeout:, args: [])
|
13
|
+
if polling.is_a?(String)
|
14
|
+
if polling != 'raf' && polling != 'mutation'
|
15
|
+
raise ArgumentError.new("Unknown polling option: #{polling}")
|
16
|
+
end
|
17
|
+
elsif polling.is_a?(Numeric)
|
18
|
+
unless polling.positive?
|
19
|
+
raise ArgumentError.new("Cannot poll with non-positive interval: #{polling}")
|
20
|
+
end
|
21
|
+
else
|
22
|
+
raise ArgumentError.new("Unknown polling options: #{polling}")
|
23
|
+
end
|
24
|
+
|
25
|
+
@dom_world = dom_world
|
26
|
+
@polling = polling
|
27
|
+
@timeout = timeout
|
28
|
+
@predicate_body = predicate_body
|
29
|
+
@args = args
|
30
|
+
@run_count = 0
|
31
|
+
@dom_world._wait_tasks.add(self)
|
32
|
+
@promise = resolvable_future
|
33
|
+
|
34
|
+
# Since page navigation requires us to re-install the pageScript, we should track
|
35
|
+
# timeout on our end.
|
36
|
+
if timeout
|
37
|
+
timeout_error = TimeoutError.new(title: title, timeout: timeout)
|
38
|
+
Concurrent::Promises.schedule(timeout / 1000.0) { terminate(timeout_error) unless @timeout_cleared }
|
39
|
+
end
|
40
|
+
async_rerun
|
41
|
+
end
|
42
|
+
|
43
|
+
# @return [Puppeteer::JSHandle]
|
44
|
+
def await_promise
|
45
|
+
@promise.value!
|
46
|
+
end
|
47
|
+
|
48
|
+
def terminate(error)
|
49
|
+
@terminated = true
|
50
|
+
@promise.reject(error)
|
51
|
+
cleanup
|
52
|
+
end
|
53
|
+
|
54
|
+
def rerun
|
55
|
+
run_count = (@run_count += 1)
|
56
|
+
begin
|
57
|
+
success = @dom_world.execution_context.evaluate_handle(
|
58
|
+
WAIT_FOR_PREDICATE_PAGE_FUNCTION,
|
59
|
+
@predicate_body,
|
60
|
+
@polling,
|
61
|
+
@timeout,
|
62
|
+
*@args,
|
63
|
+
)
|
64
|
+
rescue => err
|
65
|
+
error = err
|
66
|
+
end
|
67
|
+
|
68
|
+
if @terminated || run_count != @run_count
|
69
|
+
if success
|
70
|
+
success.dispose
|
71
|
+
end
|
72
|
+
return
|
73
|
+
end
|
74
|
+
|
75
|
+
# Ignore timeouts in pageScript - we track timeouts ourselves.
|
76
|
+
# If the frame's execution context has already changed, `frame.evaluate` will
|
77
|
+
# throw an error - ignore this predicate run altogether.
|
78
|
+
if !error && (@dom_world.evaluate("s => !s", success) rescue true)
|
79
|
+
success.dispose
|
80
|
+
return
|
81
|
+
end
|
82
|
+
|
83
|
+
# When the page is navigated, the promise is rejected.
|
84
|
+
# We will try again in the new execution context.
|
85
|
+
if error && error.message.include?('Execution context was destroyed')
|
86
|
+
return
|
87
|
+
end
|
88
|
+
|
89
|
+
# We could have tried to evaluate in a context which was already
|
90
|
+
# destroyed.
|
91
|
+
if error && error.message.include?('Cannot find context with specified id')
|
92
|
+
return
|
93
|
+
end
|
94
|
+
|
95
|
+
if error
|
96
|
+
@promise.reject(error)
|
97
|
+
else
|
98
|
+
@promise.fulfill(success)
|
99
|
+
end
|
100
|
+
|
101
|
+
cleanup
|
5
102
|
end
|
103
|
+
|
104
|
+
private def cleanup
|
105
|
+
@timeout_cleared = true
|
106
|
+
@dom_world._wait_tasks.delete(self)
|
107
|
+
end
|
108
|
+
|
109
|
+
private async def async_rerun
|
110
|
+
rerun
|
111
|
+
end
|
112
|
+
|
113
|
+
WAIT_FOR_PREDICATE_PAGE_FUNCTION = <<~JAVASCRIPT
|
114
|
+
async function _(predicateBody, polling, timeout, ...args) {
|
115
|
+
const predicate = new Function('...args', predicateBody);
|
116
|
+
let timedOut = false;
|
117
|
+
if (timeout)
|
118
|
+
setTimeout(() => (timedOut = true), timeout);
|
119
|
+
if (polling === 'raf')
|
120
|
+
return await pollRaf();
|
121
|
+
if (polling === 'mutation')
|
122
|
+
return await pollMutation();
|
123
|
+
if (typeof polling === 'number')
|
124
|
+
return await pollInterval(polling);
|
125
|
+
/**
|
126
|
+
* @return {!Promise<*>}
|
127
|
+
*/
|
128
|
+
function pollMutation() {
|
129
|
+
const success = predicate(...args);
|
130
|
+
if (success)
|
131
|
+
return Promise.resolve(success);
|
132
|
+
let fulfill;
|
133
|
+
const result = new Promise((x) => (fulfill = x));
|
134
|
+
const observer = new MutationObserver(() => {
|
135
|
+
if (timedOut) {
|
136
|
+
observer.disconnect();
|
137
|
+
fulfill();
|
138
|
+
}
|
139
|
+
const success = predicate(...args);
|
140
|
+
if (success) {
|
141
|
+
observer.disconnect();
|
142
|
+
fulfill(success);
|
143
|
+
}
|
144
|
+
});
|
145
|
+
observer.observe(document, {
|
146
|
+
childList: true,
|
147
|
+
subtree: true,
|
148
|
+
attributes: true,
|
149
|
+
});
|
150
|
+
return result;
|
151
|
+
}
|
152
|
+
function pollRaf() {
|
153
|
+
let fulfill;
|
154
|
+
const result = new Promise((x) => (fulfill = x));
|
155
|
+
onRaf();
|
156
|
+
return result;
|
157
|
+
function onRaf() {
|
158
|
+
if (timedOut) {
|
159
|
+
fulfill();
|
160
|
+
return;
|
161
|
+
}
|
162
|
+
const success = predicate(...args);
|
163
|
+
if (success)
|
164
|
+
fulfill(success);
|
165
|
+
else
|
166
|
+
requestAnimationFrame(onRaf);
|
167
|
+
}
|
168
|
+
}
|
169
|
+
function pollInterval(pollInterval) {
|
170
|
+
let fulfill;
|
171
|
+
const result = new Promise((x) => (fulfill = x));
|
172
|
+
onTimeout();
|
173
|
+
return result;
|
174
|
+
function onTimeout() {
|
175
|
+
if (timedOut) {
|
176
|
+
fulfill();
|
177
|
+
return;
|
178
|
+
}
|
179
|
+
const success = predicate(...args);
|
180
|
+
if (success)
|
181
|
+
fulfill(success);
|
182
|
+
else
|
183
|
+
setTimeout(onTimeout, pollInterval);
|
184
|
+
}
|
185
|
+
}
|
186
|
+
}
|
187
|
+
JAVASCRIPT
|
6
188
|
end
|
data/lib/puppeteer/web_socket.rb
CHANGED
@@ -43,6 +43,8 @@ class Puppeteer::WebSocket
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
+
class TransportError < StandardError; end
|
47
|
+
|
46
48
|
private def setup
|
47
49
|
@ready_state = STATE_CONNECTING
|
48
50
|
@driver.on(:open) do
|
@@ -55,7 +57,7 @@ class Puppeteer::WebSocket
|
|
55
57
|
end
|
56
58
|
@driver.on(:error) do |event|
|
57
59
|
if !handle_on_error(error_message: event.message)
|
58
|
-
raise
|
60
|
+
raise TransportError.new(event.message)
|
59
61
|
end
|
60
62
|
end
|
61
63
|
@driver.on(:message) do |event|
|
@@ -11,7 +11,7 @@ class Puppeteer::WebSocketTransport
|
|
11
11
|
promise.fulfill(Puppeteer::WebSocketTransport.new(ws))
|
12
12
|
end
|
13
13
|
ws.on_error do |error_message|
|
14
|
-
promise.reject(Puppeteer::
|
14
|
+
promise.reject(Puppeteer::WebSocket::TransportError.new(error_message))
|
15
15
|
end
|
16
16
|
promise.value!
|
17
17
|
end
|
data/puppeteer-ruby.gemspec
CHANGED
@@ -25,5 +25,8 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_development_dependency 'pry-byebug'
|
26
26
|
spec.add_development_dependency 'rake', '~> 10.0'
|
27
27
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
28
|
-
spec.add_development_dependency '
|
28
|
+
spec.add_development_dependency 'rspec_junit_formatter' # for CircleCI.
|
29
|
+
spec.add_development_dependency 'rubocop', '~> 0.82.0'
|
30
|
+
spec.add_development_dependency 'rubocop-rspec'
|
31
|
+
spec.add_development_dependency 'yard'
|
29
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.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YusukeIwaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -108,20 +108,62 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '3.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec_junit_formatter
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: rubocop
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
129
|
- - "~>"
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
131
|
+
version: 0.82.0
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
136
|
- - "~>"
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.
|
138
|
+
version: 0.82.0
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop-rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: yard
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
125
167
|
description:
|
126
168
|
email:
|
127
169
|
- q7w8e9w8q7w8e9@yahoo.co.jp
|
@@ -142,6 +184,101 @@ files:
|
|
142
184
|
- bin/console
|
143
185
|
- bin/setup
|
144
186
|
- docker-compose.yml
|
187
|
+
- docs/Puppeteer.html
|
188
|
+
- docs/Puppeteer/AsyncAwaitBehavior.html
|
189
|
+
- docs/Puppeteer/Browser.html
|
190
|
+
- docs/Puppeteer/BrowserContext.html
|
191
|
+
- docs/Puppeteer/BrowserFetcher.html
|
192
|
+
- docs/Puppeteer/BrowserRunner.html
|
193
|
+
- docs/Puppeteer/BrowserRunner/BrowserProcess.html
|
194
|
+
- docs/Puppeteer/CDPSession.html
|
195
|
+
- docs/Puppeteer/CDPSession/Error.html
|
196
|
+
- docs/Puppeteer/ConcurrentRubyUtils.html
|
197
|
+
- docs/Puppeteer/Connection.html
|
198
|
+
- docs/Puppeteer/Connection/MessageCallback.html
|
199
|
+
- docs/Puppeteer/Connection/ProtocolError.html
|
200
|
+
- docs/Puppeteer/Connection/RequestDebugPrinter.html
|
201
|
+
- docs/Puppeteer/Connection/ResponseDebugPrinter.html
|
202
|
+
- docs/Puppeteer/ConsoleMessage.html
|
203
|
+
- docs/Puppeteer/ConsoleMessage/Location.html
|
204
|
+
- docs/Puppeteer/DOMWorld.html
|
205
|
+
- docs/Puppeteer/DOMWorld/DetachedError.html
|
206
|
+
- docs/Puppeteer/DOMWorld/DocumentEvaluationError.html
|
207
|
+
- docs/Puppeteer/DebugPrint.html
|
208
|
+
- docs/Puppeteer/Device.html
|
209
|
+
- docs/Puppeteer/Devices.html
|
210
|
+
- docs/Puppeteer/ElementHandle.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/WebSocketTransport.html
|
267
|
+
- docs/Puppeteer/WebSocktTransportError.html
|
268
|
+
- docs/_index.html
|
269
|
+
- docs/class_list.html
|
270
|
+
- docs/css/common.css
|
271
|
+
- docs/css/full_list.css
|
272
|
+
- docs/css/style.css
|
273
|
+
- docs/file.README.html
|
274
|
+
- docs/file_list.html
|
275
|
+
- docs/frames.html
|
276
|
+
- docs/index.html
|
277
|
+
- docs/js/app.js
|
278
|
+
- docs/js/full_list.js
|
279
|
+
- docs/js/jquery.js
|
280
|
+
- docs/method_list.html
|
281
|
+
- docs/top-level-namespace.html
|
145
282
|
- lib/puppeteer.rb
|
146
283
|
- lib/puppeteer/async_await_behavior.rb
|
147
284
|
- lib/puppeteer/browser.rb
|
@@ -157,10 +294,14 @@ files:
|
|
157
294
|
- lib/puppeteer/devices.rb
|
158
295
|
- lib/puppeteer/dom_world.rb
|
159
296
|
- lib/puppeteer/element_handle.rb
|
297
|
+
- lib/puppeteer/element_handle/bounding_box.rb
|
298
|
+
- lib/puppeteer/element_handle/box_model.rb
|
299
|
+
- lib/puppeteer/element_handle/point.rb
|
160
300
|
- lib/puppeteer/emulation_manager.rb
|
161
301
|
- lib/puppeteer/errors.rb
|
162
302
|
- lib/puppeteer/event_callbackable.rb
|
163
303
|
- lib/puppeteer/execution_context.rb
|
304
|
+
- lib/puppeteer/file_chooser.rb
|
164
305
|
- lib/puppeteer/frame.rb
|
165
306
|
- lib/puppeteer/frame_manager.rb
|
166
307
|
- lib/puppeteer/if_present.rb
|