isomorfeus-puppetmaster 0.5.2 → 0.5.3
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/lib/isomorfeus/puppetmaster/driver/puppeteer.rb +3 -3
- data/lib/isomorfeus/puppetmaster/driver/puppeteer_document.rb +30 -30
- data/lib/isomorfeus/puppetmaster/driver/puppeteer_node.rb +4 -4
- data/lib/isomorfeus/puppetmaster/node.rb +3 -3
- data/lib/isomorfeus/puppetmaster/server.rb +1 -1
- data/lib/isomorfeus/puppetmaster/version.rb +1 -1
- data/lib/isomorfeus/puppetmaster.rb +2 -2
- data/node_modules/.package-lock.json +3 -3
- data/node_modules/puppeteer-core/CHANGELOG.md +35 -0
- data/node_modules/puppeteer-core/README.md +13 -13
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/AriaQueryHandler.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/AriaQueryHandler.js +5 -5
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/AriaQueryHandler.js.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Browser.d.ts +18 -2
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Browser.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Browser.js +7 -2
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Browser.js.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.d.ts +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Coverage.d.ts +18 -2
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Coverage.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Coverage.js +10 -3
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Coverage.js.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.d.ts +1 -0
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.js +10 -6
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.js.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DeviceDescriptors.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DeviceDescriptors.js +120 -0
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DeviceDescriptors.js.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EvalTypes.d.ts +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EvalTypes.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FrameManager.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FrameManager.js +2 -2
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/FrameManager.js.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/JSHandle.d.ts +24 -2
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/JSHandle.js +33 -9
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/JSHandle.js.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkManager.d.ts +1 -0
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkManager.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkManager.js +5 -0
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkManager.js.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/PDFOptions.d.ts +5 -0
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/PDFOptions.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/PDFOptions.js.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.d.ts +18 -2
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.js +66 -5
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.js.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Tracing.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Tracing.js +8 -2
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Tracing.js.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/assert.d.ts +1 -0
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/assert.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/assert.js +6 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/common/assert.js.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/global.d.ts +17 -0
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/global.d.ts.map +1 -0
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/global.js +3 -0
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/global.js.map +1 -0
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.js +9 -10
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.js.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/LaunchOptions.d.ts +2 -2
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/NodeWebSocketTransport.js +7 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/install.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/install.js +17 -3
- data/node_modules/puppeteer-core/lib/cjs/puppeteer/node/install.js.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/AriaQueryHandler.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/AriaQueryHandler.js +5 -5
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/AriaQueryHandler.js.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Browser.d.ts +18 -2
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Browser.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Browser.js +7 -2
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Browser.js.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.d.ts +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Connection.js +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Coverage.d.ts +18 -2
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Coverage.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Coverage.js +10 -3
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Coverage.js.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DOMWorld.d.ts +1 -0
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DOMWorld.js +10 -6
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DOMWorld.js.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DeviceDescriptors.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DeviceDescriptors.js +120 -0
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/DeviceDescriptors.js.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EvalTypes.d.ts +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/EvalTypes.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/FrameManager.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/FrameManager.js +2 -2
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/FrameManager.js.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.d.ts +24 -2
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.js +33 -9
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.js.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkManager.d.ts +1 -0
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkManager.js +5 -0
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/NetworkManager.js.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/PDFOptions.d.ts +5 -0
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/PDFOptions.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/PDFOptions.js.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Page.d.ts +18 -2
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Page.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Page.js +67 -6
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Page.js.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Tracing.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Tracing.js +8 -2
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/Tracing.js.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/assert.d.ts +1 -0
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/assert.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/assert.js +4 -0
- data/node_modules/puppeteer-core/lib/esm/puppeteer/common/assert.js.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/global.d.ts +17 -0
- data/node_modules/puppeteer-core/lib/esm/puppeteer/global.d.ts.map +1 -0
- data/node_modules/puppeteer-core/lib/esm/puppeteer/global.js +2 -0
- data/node_modules/puppeteer-core/lib/esm/puppeteer/global.js.map +1 -0
- data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserFetcher.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserFetcher.js +9 -10
- data/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserFetcher.js.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/node/LaunchOptions.d.ts +2 -2
- data/node_modules/puppeteer-core/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/node/NodeWebSocketTransport.js +7 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/node/install.d.ts.map +1 -1
- data/node_modules/puppeteer-core/lib/esm/puppeteer/node/install.js +17 -3
- data/node_modules/puppeteer-core/lib/esm/puppeteer/node/install.js.map +1 -1
- data/node_modules/puppeteer-core/lib/types.d.ts +109 -12
- data/node_modules/puppeteer-core/package.json +5 -4
- data/package.json +1 -1
- metadata +32 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 17a526afb0b53cc31f7290cf80be5c698010786ff9210911c9d39e36af67108c
|
|
4
|
+
data.tar.gz: be017f23bc6e371d739068640f9a684752abe2c48706628f16e1683d6b7ca0c0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d679044de354362f4c0898b98139a72f6bbc88e24a53f8402a219e27af635351abdb996c76f9d4d7a3efb775c034a26be3f30d31911cf0f1793aee8982b912fa
|
|
7
|
+
data.tar.gz: 7217aa2e0b9d5a093d96b48f92ce42abf65bfd1e55f7a21142f6afb092777bbc56c51781e325a8549cdd638c5eacbb40d6d14cf3358f42e70981915525007c72
|
|
@@ -252,12 +252,12 @@ module Isomorfeus
|
|
|
252
252
|
def launch_line
|
|
253
253
|
string_options = []
|
|
254
254
|
options = @options.dup
|
|
255
|
-
string_options << "ignoreHTTPSErrors: #{options.delete(:ignore_https_errors)}" if options.
|
|
256
|
-
string_options << "executablePath: '#{options.delete(:executable_path)}'" if options.
|
|
255
|
+
string_options << "ignoreHTTPSErrors: #{options.delete(:ignore_https_errors)}" if options.key?(:ignore_https_errors)
|
|
256
|
+
string_options << "executablePath: '#{options.delete(:executable_path)}'" if options.key?(:executable_path)
|
|
257
257
|
options.each do |option, value|
|
|
258
258
|
string_options << "#{option.to_s.camelize(:lower)}: #{value}"
|
|
259
259
|
end
|
|
260
|
-
string_options << "userDataDir: '#{Dir.mktmpdir}'" unless @options.
|
|
260
|
+
string_options << "userDataDir: '#{Dir.mktmpdir}'" unless @options.key?(:user_data_dir)
|
|
261
261
|
string_options << "defaultViewport: { width: #{@width}, height: #{@height} }"
|
|
262
262
|
string_options << "pipe: true"
|
|
263
263
|
# string_options << "args: ['--disable-popup-blocking']"
|
|
@@ -4,7 +4,7 @@ module Isomorfeus
|
|
|
4
4
|
module PuppeteerDocument
|
|
5
5
|
def document_accept_alert(document, **options, &block)
|
|
6
6
|
# TODO maybe wrap in mutex
|
|
7
|
-
text = options.
|
|
7
|
+
text = options.key?(:text) ? "`#{options[:text]}`" : 'null'
|
|
8
8
|
@context.exec <<~JAVASCRIPT
|
|
9
9
|
ModalText = #{text};
|
|
10
10
|
AllPageHandles[#{document.handle}].on('dialog', DialogAcceptHandler);
|
|
@@ -19,12 +19,12 @@ module Isomorfeus
|
|
|
19
19
|
ModalText = null;
|
|
20
20
|
AllPageHandles[#{document.handle}].removeListener('dialog', DialogAcceptHandler);
|
|
21
21
|
JAVASCRIPT
|
|
22
|
-
raise Isomorfeus::Puppetmaster::NoModalError if options.
|
|
22
|
+
raise Isomorfeus::Puppetmaster::NoModalError if options.key?(:text) && !matched
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def document_accept_confirm(document, **options, &block)
|
|
26
26
|
# TODO maybe wrap in mutex
|
|
27
|
-
text = options.
|
|
27
|
+
text = options.key?(:text) ? "`#{options[:text]}`" : 'null'
|
|
28
28
|
@context.exec <<~JAVASCRIPT
|
|
29
29
|
ModalText = #{text};
|
|
30
30
|
AllPageHandles[#{document.handle}].on('dialog', DialogAcceptHandler);
|
|
@@ -39,12 +39,12 @@ module Isomorfeus
|
|
|
39
39
|
ModalText = null;
|
|
40
40
|
AllPageHandles[#{document.handle}].removeListener('dialog', DialogAcceptHandler);
|
|
41
41
|
JAVASCRIPT
|
|
42
|
-
raise Isomorfeus::Puppetmaster::NoModalError if options.
|
|
42
|
+
raise Isomorfeus::Puppetmaster::NoModalError if options.key?(:text) && !matched
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def document_accept_leave_page(document, **options, &block)
|
|
46
46
|
# TODO maybe wrap in mutex
|
|
47
|
-
text = options.
|
|
47
|
+
text = options.key?(:text) ? "`#{options[:text]}`" : 'null'
|
|
48
48
|
@context.exec <<~JAVASCRIPT
|
|
49
49
|
ModalText = #{text};
|
|
50
50
|
AllPageHandles[#{document.handle}].on('dialog', DialogAcceptHandler);
|
|
@@ -59,12 +59,12 @@ module Isomorfeus
|
|
|
59
59
|
ModalText = null;
|
|
60
60
|
AllPageHandles[#{document.handle}].removeListener('dialog', DialogAcceptHandler);
|
|
61
61
|
JAVASCRIPT
|
|
62
|
-
raise Isomorfeus::Puppetmaster::NoModalError if options.
|
|
62
|
+
raise Isomorfeus::Puppetmaster::NoModalError if options.key?(:text) && !matched
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def document_accept_prompt(document, **options, &block)
|
|
66
66
|
# TODO maybe wrap in mutex
|
|
67
|
-
text = options.
|
|
67
|
+
text = options.key?(:text) ? "`#{options[:text]}`" : 'null'
|
|
68
68
|
@context.exec <<~JAVASCRIPT
|
|
69
69
|
ModalText = #{text};
|
|
70
70
|
AllPageHandles[#{document.handle}].on('dialog', DialogAcceptHandler);
|
|
@@ -79,7 +79,7 @@ module Isomorfeus
|
|
|
79
79
|
ModalText = null;
|
|
80
80
|
AllPageHandles[#{document.handle}].removeListener('dialog', DialogAcceptHandler);
|
|
81
81
|
JAVASCRIPT
|
|
82
|
-
raise Isomorfeus::Puppetmaster::NoModalError if options.
|
|
82
|
+
raise Isomorfeus::Puppetmaster::NoModalError if options.key?(:text) && !matched
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
def document_all_text(document)
|
|
@@ -197,7 +197,7 @@ module Isomorfeus
|
|
|
197
197
|
|
|
198
198
|
def document_dismiss_confirm(document, **options, &block)
|
|
199
199
|
# TODO
|
|
200
|
-
text = options.
|
|
200
|
+
text = options.key?(:text) ? "`#{options[:text]}`" : 'null'
|
|
201
201
|
@context.exec <<~JAVASCRIPT
|
|
202
202
|
ModalText = #{text};
|
|
203
203
|
AllPageHandles[#{document.handle}].on('dialog', DialogDismissHandler);
|
|
@@ -212,12 +212,12 @@ module Isomorfeus
|
|
|
212
212
|
ModalText = null;
|
|
213
213
|
AllPageHandles[#{document.handle}].removeListener('dialog', DialogDismissHandler);
|
|
214
214
|
JAVASCRIPT
|
|
215
|
-
raise Isomorfeus::Puppetmaster::ModalNotFound if options.
|
|
215
|
+
raise Isomorfeus::Puppetmaster::ModalNotFound if options.key?(:text) && !matched
|
|
216
216
|
end
|
|
217
217
|
|
|
218
218
|
def document_dismiss_leave_page(document, **options, &block)
|
|
219
219
|
# TODO
|
|
220
|
-
text = options.
|
|
220
|
+
text = options.key?(:text) ? "`#{options[:text]}`" : 'null'
|
|
221
221
|
@context.exec <<~JAVASCRIPT
|
|
222
222
|
ModalText = #{text};
|
|
223
223
|
AllPageHandles[#{document.handle}].on('dialog', DialogDismissHandler);
|
|
@@ -232,12 +232,12 @@ module Isomorfeus
|
|
|
232
232
|
ModalText = null;
|
|
233
233
|
AllPageHandles[#{document.handle}].removeListener('dialog', DialogDismissHandler);
|
|
234
234
|
JAVASCRIPT
|
|
235
|
-
raise Isomorfeus::Puppetmaster::ModalNotFound if options.
|
|
235
|
+
raise Isomorfeus::Puppetmaster::ModalNotFound if options.key?(:text) && !matched
|
|
236
236
|
end
|
|
237
237
|
|
|
238
238
|
def document_dismiss_prompt(document, **options, &block)
|
|
239
239
|
# TODO
|
|
240
|
-
text = options.
|
|
240
|
+
text = options.key?(:text) ? "`#{options[:text]}`" : 'null'
|
|
241
241
|
@context.exec <<~JAVASCRIPT
|
|
242
242
|
ModalText = #{text};
|
|
243
243
|
AllPageHandles[#{document.handle}].on('dialog', DialogDismissHandler);
|
|
@@ -252,7 +252,7 @@ module Isomorfeus
|
|
|
252
252
|
ModalText = null;
|
|
253
253
|
AllPageHandles[#{document.handle}].removeListener('dialog', DialogDismissHandler);
|
|
254
254
|
JAVASCRIPT
|
|
255
|
-
raise Isomorfeus::Puppetmaster::ModalNotFound if options.
|
|
255
|
+
raise Isomorfeus::Puppetmaster::ModalNotFound if options.key?(:text) && !matched
|
|
256
256
|
end
|
|
257
257
|
|
|
258
258
|
def document_dispatch_event(document, name, event_type = nil, **options)
|
|
@@ -649,12 +649,12 @@ module Isomorfeus
|
|
|
649
649
|
# todo
|
|
650
650
|
# https://pptr.dev/#?product=Puppeteer&version=v1.12.2&show=api-pagescreenshotoptions
|
|
651
651
|
final_options = ["encoding: 'base64'"]
|
|
652
|
-
if options.
|
|
652
|
+
if options.key?(:format)
|
|
653
653
|
options[:format] = 'jpeg' if options[:format].to_s.downcase == 'jpg'
|
|
654
654
|
final_options << "type: '#{options.delete(:format).to_s.downcase}'"
|
|
655
655
|
end
|
|
656
|
-
final_options << "quality: #{options.delete(:quality)}" if options.
|
|
657
|
-
final_options << "fullPage: #{options.delete(:full)}" if options.
|
|
656
|
+
final_options << "quality: #{options.delete(:quality)}" if options.key?(:quality)
|
|
657
|
+
final_options << "fullPage: #{options.delete(:full)}" if options.key?(:full)
|
|
658
658
|
options.each do |k,v|
|
|
659
659
|
final_options << "#{k.to_s.camelize(:lower)}: #{v}"
|
|
660
660
|
end
|
|
@@ -715,12 +715,12 @@ module Isomorfeus
|
|
|
715
715
|
# https://pptr.dev/#?product=Puppeteer&version=v1.12.2&show=api-pagepdfoptions
|
|
716
716
|
absolute_path = File.absolute_path(path)
|
|
717
717
|
final_options = ["path: '#{absolute_path}'"]
|
|
718
|
-
final_options << "format: '#{options.delete(:format)}'" if options.
|
|
719
|
-
final_options << "headerTemplate: `#{options.delete(:header_template)}`" if options.
|
|
720
|
-
final_options << "footerTemplate: `#{options.delete(:footer_template)}`" if options.
|
|
721
|
-
final_options << "pageRanges: '#{options.delete(:page_ranges)}'" if options.
|
|
722
|
-
final_options << "width: '#{options.delete(:width)}'" if options.
|
|
723
|
-
final_options << "height: '#{options.delete(:height)}'" if options.
|
|
718
|
+
final_options << "format: '#{options.delete(:format)}'" if options.key?(:format)
|
|
719
|
+
final_options << "headerTemplate: `#{options.delete(:header_template)}`" if options.key?(:header_template)
|
|
720
|
+
final_options << "footerTemplate: `#{options.delete(:footer_template)}`" if options.key?(:footer_template)
|
|
721
|
+
final_options << "pageRanges: '#{options.delete(:page_ranges)}'" if options.key?(:page_ranges)
|
|
722
|
+
final_options << "width: '#{options.delete(:width)}'" if options.key?(:width)
|
|
723
|
+
final_options << "height: '#{options.delete(:height)}'" if options.key?(:height)
|
|
724
724
|
options.each do |k,v|
|
|
725
725
|
final_options << "#{k.to_s.camelize(:lower)}: #{v}"
|
|
726
726
|
end
|
|
@@ -732,12 +732,12 @@ module Isomorfeus
|
|
|
732
732
|
# https://pptr.dev/#?product=Puppeteer&version=v1.12.2&show=api-pagescreenshotoptions
|
|
733
733
|
absolute_path = File.absolute_path(path)
|
|
734
734
|
final_options = ["path: '#{absolute_path}'"]
|
|
735
|
-
if options.
|
|
735
|
+
if options.key?(:format)
|
|
736
736
|
options[:format] = 'jpeg' if options[:format].to_s.downcase == 'jpg'
|
|
737
737
|
final_options << "type: '#{options.delete(:format).to_s.downcase}'"
|
|
738
738
|
end
|
|
739
|
-
final_options << "quality: #{options.delete(:quality)}" if options.
|
|
740
|
-
final_options << "fullPage: #{options.delete(:full)}" if options.
|
|
739
|
+
final_options << "quality: #{options.delete(:quality)}" if options.key?(:quality)
|
|
740
|
+
final_options << "fullPage: #{options.delete(:full)}" if options.key?(:full)
|
|
741
741
|
options.each do |k,v|
|
|
742
742
|
final_options << "#{k.to_s.camelize(:lower)}: #{v}"
|
|
743
743
|
end
|
|
@@ -772,10 +772,10 @@ module Isomorfeus
|
|
|
772
772
|
end
|
|
773
773
|
options[:domain] ||= URI.parse(uri).host
|
|
774
774
|
final_options = []
|
|
775
|
-
final_options << "expires: #{options.delete(:expires).to_i}" if options.
|
|
776
|
-
final_options << "httpOnly: #{options.delete(:http_only)}" if options.
|
|
777
|
-
final_options << "secure: #{options.delete(:secure)}" if options.
|
|
778
|
-
final_options << "sameSite: '#{options.delete(:same_site)}'" if options.
|
|
775
|
+
final_options << "expires: #{options.delete(:expires).to_i}" if options.key?(:expires)
|
|
776
|
+
final_options << "httpOnly: #{options.delete(:http_only)}" if options.key?(:http_only)
|
|
777
|
+
final_options << "secure: #{options.delete(:secure)}" if options.key?(:secure)
|
|
778
|
+
final_options << "sameSite: '#{options.delete(:same_site)}'" if options.key?(:same_site)
|
|
779
779
|
options.each do |k,v|
|
|
780
780
|
final_options << "#{k}: '#{v}'"
|
|
781
781
|
end
|
|
@@ -437,11 +437,11 @@ module Isomorfeus
|
|
|
437
437
|
def node_render_base64(node, **options)
|
|
438
438
|
# https://pptr.dev/#?product=Puppeteer&version=v1.12.2&show=api-pagescreenshotoptions
|
|
439
439
|
final_options = ["encoding: 'base64'"]
|
|
440
|
-
if options.
|
|
440
|
+
if options.key?(:format)
|
|
441
441
|
options[:format] = 'jpeg' if options[:format].to_s.downcase == 'jpg'
|
|
442
442
|
final_options << "type: '#{options.delete(:format).to_s.downcase}'"
|
|
443
443
|
end
|
|
444
|
-
final_options << "quality: #{options.delete(:quality)}" if options.
|
|
444
|
+
final_options << "quality: #{options.delete(:quality)}" if options.key?(:quality)
|
|
445
445
|
box = await "LastResult = await AllElementHandles[#{node.handle}].boundingBox();"
|
|
446
446
|
final_options << "clip: {x: #{box['x']}, y: #{box['y']}, width: #{box['width']}, height: #{box['height']}}"
|
|
447
447
|
options.each { |k,v| final_options << "#{k.to_s.camelize(:lower)}: #{v}" }
|
|
@@ -493,11 +493,11 @@ module Isomorfeus
|
|
|
493
493
|
# https://pptr.dev/#?product=Puppeteer&version=v1.12.2&show=api-pagescreenshotoptions
|
|
494
494
|
absolute_path = File.absolute_path(path)
|
|
495
495
|
final_options = ["path: '#{absolute_path}'"]
|
|
496
|
-
if options.
|
|
496
|
+
if options.key?(:format)
|
|
497
497
|
options[:format] = 'jpeg' if options[:format].to_s.downcase == 'jpg'
|
|
498
498
|
final_options << "type: '#{options.delete(:format).to_s.downcase}'"
|
|
499
499
|
end
|
|
500
|
-
final_options << "quality: #{options.delete(:quality)}" if options.
|
|
500
|
+
final_options << "quality: #{options.delete(:quality)}" if options.key?(:quality)
|
|
501
501
|
box = await "LastResult = await AllElementHandles[#{node.handle}].boundingBox();"
|
|
502
502
|
final_options << "clip: {x: #{box['x']}, y: #{box['y']}, width: #{box['width']}, height: #{box['height']}}"
|
|
503
503
|
options.each { |k,v| final_options << "#{k.to_s.camelize(:lower)}: #{v}" }
|
|
@@ -189,20 +189,20 @@ module Isomorfeus
|
|
|
189
189
|
def has_css?(selector, **options)
|
|
190
190
|
res = find_all(selector)
|
|
191
191
|
return false unless res
|
|
192
|
-
return false if options.
|
|
192
|
+
return false if options.key?(:count) && options[:count] != res.size
|
|
193
193
|
return true
|
|
194
194
|
end
|
|
195
195
|
|
|
196
196
|
def has_text?(text, **options)
|
|
197
197
|
count = visible_text.scan(/#{text}/).size
|
|
198
|
-
return false if options.
|
|
198
|
+
return false if options.key?(:count) && options[:count] != count
|
|
199
199
|
count > 0
|
|
200
200
|
end
|
|
201
201
|
|
|
202
202
|
def has_xpath?(query, **options)
|
|
203
203
|
res = find_all_xpath(query)
|
|
204
204
|
return false unless res
|
|
205
|
-
return false if options.
|
|
205
|
+
return false if options.key?(:count) && options[:count] != res.size
|
|
206
206
|
return true
|
|
207
207
|
end
|
|
208
208
|
|
|
@@ -74,7 +74,7 @@ module Isomorfeus
|
|
|
74
74
|
end
|
|
75
75
|
if response.code == '200'
|
|
76
76
|
result_hash = Oj.load(response.body)
|
|
77
|
-
if result_hash.
|
|
77
|
+
if result_hash.key?('error')
|
|
78
78
|
error = RuntimeError.new(result_hash['error'])
|
|
79
79
|
error.set_backtrace(result_hash['backtrace'])
|
|
80
80
|
raise error
|
|
@@ -19,7 +19,7 @@ module Isomorfeus
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def driver=(drvr)
|
|
22
|
-
raise "#{drvr}: no such driver registered! Available drivers: #{drivers.keys.join(', ')}." unless drivers.
|
|
22
|
+
raise "#{drvr}: no such driver registered! Available drivers: #{drivers.keys.join(', ')}." unless drivers.key?(drvr)
|
|
23
23
|
@driver = drvr
|
|
24
24
|
end
|
|
25
25
|
|
|
@@ -52,7 +52,7 @@ module Isomorfeus
|
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def server=(name)
|
|
55
|
-
raise "#{name}: no such server registered! Available drivers: #{servers.keys.join(', ')}." unless servers.
|
|
55
|
+
raise "#{name}: no such server registered! Available drivers: #{servers.keys.join(', ')}." unless servers.key?(name)
|
|
56
56
|
name, options = *name if name.is_a? Array
|
|
57
57
|
@server = if name.respond_to? :call
|
|
58
58
|
name
|
|
@@ -416,9 +416,9 @@
|
|
|
416
416
|
}
|
|
417
417
|
},
|
|
418
418
|
"node_modules/puppeteer-core": {
|
|
419
|
-
"version": "10.
|
|
420
|
-
"resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-10.
|
|
421
|
-
"integrity": "sha512-
|
|
419
|
+
"version": "10.4.0",
|
|
420
|
+
"resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-10.4.0.tgz",
|
|
421
|
+
"integrity": "sha512-KU8zyb7AIOqNjLCN3wkrFXxh+EVaG+zrs2P03ATNjc3iwSxHsu5/EvZiREpQ/IJiT9xfQbDVgKcsvRuzLCxglQ==",
|
|
422
422
|
"dependencies": {
|
|
423
423
|
"debug": "4.3.1",
|
|
424
424
|
"devtools-protocol": "0.0.901419",
|
|
@@ -2,6 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [10.4.0](https://github.com/puppeteer/puppeteer/compare/v10.2.0...v10.4.0) (2021-09-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add webp to screenshot options ([#7565](https://github.com/puppeteer/puppeteer/issues/7565)) ([43a9268](https://github.com/puppeteer/puppeteer/commit/43a926832505a57922016907a264165676424557))
|
|
11
|
+
* **page:** expose page.client() ([#7582](https://github.com/puppeteer/puppeteer/issues/7582)) ([99ca842](https://github.com/puppeteer/puppeteer/commit/99ca842124a1edef5e66426621885141a9feaca5))
|
|
12
|
+
* **page:** mark page.client() as internal ([#7585](https://github.com/puppeteer/puppeteer/issues/7585)) ([8451951](https://github.com/puppeteer/puppeteer/commit/84519514831f304f9076ca235fe474f797616b2c))
|
|
13
|
+
* add ability to specify offsets for JSHandle.click ([#7573](https://github.com/puppeteer/puppeteer/issues/7573)) ([2b5c001](https://github.com/puppeteer/puppeteer/commit/2b5c0019dc3744196c5858edeaa901dff9973ef5))
|
|
14
|
+
* add durableStorage to allowed permissions ([#5295](https://github.com/puppeteer/puppeteer/issues/5295)) ([eda5171](https://github.com/puppeteer/puppeteer/commit/eda51712790b9260626dc53cfb58a72805c45582))
|
|
15
|
+
* add id option to addScriptTag ([#5477](https://github.com/puppeteer/puppeteer/issues/5477)) ([300be5d](https://github.com/puppeteer/puppeteer/commit/300be5d167b6e7e532e725fdb86966081a5d0093))
|
|
16
|
+
* add more Android models to DeviceDescriptors ([#7210](https://github.com/puppeteer/puppeteer/issues/7210)) ([b5020dc](https://github.com/puppeteer/puppeteer/commit/b5020dc04121b265c77662237dfb177d6de06053)), closes [/github.com/aerokube/moon-deploy/blob/master/moon-local.yaml#L199](https://github.com/puppeteer//github.com/aerokube/moon-deploy/blob/master/moon-local.yaml/issues/L199)
|
|
17
|
+
* add proxy and bypass list parameters to createIncognitoBrowserContext ([#7516](https://github.com/puppeteer/puppeteer/issues/7516)) ([8e45a1c](https://github.com/puppeteer/puppeteer/commit/8e45a1c882207cc36e87be2a917b661eb841c4bf)), closes [#678](https://github.com/puppeteer/puppeteer/issues/678)
|
|
18
|
+
* add threshold to Page.isIntersectingViewport ([#6497](https://github.com/puppeteer/puppeteer/issues/6497)) ([54c4318](https://github.com/puppeteer/puppeteer/commit/54c43180161c3c512e4698e7f2e85ce3c6f0ab50))
|
|
19
|
+
* add unit test support for bisect ([#7553](https://github.com/puppeteer/puppeteer/issues/7553)) ([a0b1f6b](https://github.com/puppeteer/puppeteer/commit/a0b1f6b401abae2fbc5a8987061644adfaa7b482))
|
|
20
|
+
* add User-Agent with Puppeteer version to WebSocket request ([#5614](https://github.com/puppeteer/puppeteer/issues/5614)) ([6a2bf0a](https://github.com/puppeteer/puppeteer/commit/6a2bf0aabaa4df72c7838f5a6cd742e8f9c72be6))
|
|
21
|
+
* extend husky checks ([#7574](https://github.com/puppeteer/puppeteer/issues/7574)) ([7316086](https://github.com/puppeteer/puppeteer/commit/73160869417275200be19bd37372b6218dbc5f63))
|
|
22
|
+
* **api:** implement `Page.waitForNetworkIdle()` ([#5140](https://github.com/puppeteer/puppeteer/issues/5140)) ([3c6029c](https://github.com/puppeteer/puppeteer/commit/3c6029c702291ca7ef637b66e78d72e03156fe58))
|
|
23
|
+
* **coverage:** option for raw V8 script coverage ([#6454](https://github.com/puppeteer/puppeteer/issues/6454)) ([cb4470a](https://github.com/puppeteer/puppeteer/commit/cb4470a6d9b0a7f73836458bb3d5779eb85ac5f2))
|
|
24
|
+
* support timeout for page.pdf() call ([#7508](https://github.com/puppeteer/puppeteer/issues/7508)) ([f90af66](https://github.com/puppeteer/puppeteer/commit/f90af6639d801e764bdb479b9543b7f8f2b926df))
|
|
25
|
+
* **typescript:** allow using puppeteer without dom lib ([#6998](https://github.com/puppeteer/puppeteer/issues/6998)) ([723052d](https://github.com/puppeteer/puppeteer/commit/723052d5bb3c3d1d3908508467512bea4d8fdc80)), closes [#6989](https://github.com/puppeteer/puppeteer/issues/6989)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **docs:** deploy includes website documentation ([#7469](https://github.com/puppeteer/puppeteer/issues/7469)) ([6fde41c](https://github.com/puppeteer/puppeteer/commit/6fde41c6b6657986df1bbce3f2e0f7aa499f2be4))
|
|
31
|
+
* **docs:** names in version 9.1.1 ([#7517](https://github.com/puppeteer/puppeteer/issues/7517)) ([44b22bb](https://github.com/puppeteer/puppeteer/commit/44b22bbc2629e3c75c1494b299a66790b371fb0a))
|
|
32
|
+
* **frame:** fix Frame.waitFor's XPath pattern detection ([#5184](https://github.com/puppeteer/puppeteer/issues/5184)) ([caa2b73](https://github.com/puppeteer/puppeteer/commit/caa2b732fe58f32ec03f2a9fa8568f20188203c5))
|
|
33
|
+
* **install:** respect environment proxy config when downloading Firef… ([#6577](https://github.com/puppeteer/puppeteer/issues/6577)) ([9399c97](https://github.com/puppeteer/puppeteer/commit/9399c9786fba4e45e1c5485ddbb197d2d4f1735f)), closes [#6573](https://github.com/puppeteer/puppeteer/issues/6573)
|
|
34
|
+
* added names in V9.1.1 ([#7547](https://github.com/puppeteer/puppeteer/issues/7547)) ([d132b8b](https://github.com/puppeteer/puppeteer/commit/d132b8b041696e6d5b9a99d0be1acf1cf943efef))
|
|
35
|
+
* **test:** tweak waitForNetworkIdle delay in test between downloads ([#7564](https://github.com/puppeteer/puppeteer/issues/7564)) ([a21b737](https://github.com/puppeteer/puppeteer/commit/a21b7376e7feaf23066d67948d52480516f42496))
|
|
36
|
+
* **types:** allow evaluate functions to take a readonly array as an argument ([#7072](https://github.com/puppeteer/puppeteer/issues/7072)) ([491614c](https://github.com/puppeteer/puppeteer/commit/491614c7f8cfa50b902d0275064e611c2a48c3b2))
|
|
37
|
+
* update firefox prefs documentation link ([#7539](https://github.com/puppeteer/puppeteer/issues/7539)) ([2aec355](https://github.com/puppeteer/puppeteer/commit/2aec35553bc6e0305f40837bb3665ddbd02aa889))
|
|
38
|
+
* use non-deprecated tracing categories api ([#7413](https://github.com/puppeteer/puppeteer/issues/7413)) ([040a0e5](https://github.com/puppeteer/puppeteer/commit/040a0e561b4f623f7929130b90be129f94ebb642))
|
|
39
|
+
|
|
5
40
|
## [10.2.0](https://github.com/puppeteer/puppeteer/compare/v10.1.0...v10.2.0) (2021-08-04)
|
|
6
41
|
|
|
7
42
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<img src="https://user-images.githubusercontent.com/10379601/29446482-04f7036a-841f-11e7-9872-91d1fc2ea683.png" height="200" align="right">
|
|
10
10
|
|
|
11
|
-
###### [API](https://github.com/puppeteer/puppeteer/blob/v10.
|
|
11
|
+
###### [API](https://github.com/puppeteer/puppeteer/blob/v10.4.0/docs/api.md) | [FAQ](#faq) | [Contributing](https://github.com/puppeteer/puppeteer/blob/main/CONTRIBUTING.md) | [Troubleshooting](https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md)
|
|
12
12
|
|
|
13
13
|
> Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the [DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/). Puppeteer runs [headless](https://developers.google.com/web/updates/2017/04/headless-chrome) by default, but can be configured to run full (non-headless) Chrome or Chromium.
|
|
14
14
|
|
|
@@ -26,7 +26,7 @@ Most things that you can do manually in the browser can be done using Puppeteer!
|
|
|
26
26
|
- Test Chrome Extensions.
|
|
27
27
|
<!-- [END usecases] -->
|
|
28
28
|
|
|
29
|
-
Give it a spin: https://try-puppeteer.appspot.com/
|
|
29
|
+
Give it a spin: [https://try-puppeteer.appspot.com/](https://try-puppeteer.appspot.com/)
|
|
30
30
|
|
|
31
31
|
<!-- [START getstarted] -->
|
|
32
32
|
|
|
@@ -41,7 +41,7 @@ npm i puppeteer
|
|
|
41
41
|
# or "yarn add puppeteer"
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
Note: When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API. To skip the download, download into another path, or download a different browser, see [Environment variables](https://github.com/puppeteer/puppeteer/blob/v10.
|
|
44
|
+
Note: When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API. To skip the download, download into another path, or download a different browser, see [Environment variables](https://github.com/puppeteer/puppeteer/blob/v10.4.0/docs/api.md#environment-variables).
|
|
45
45
|
|
|
46
46
|
### puppeteer-core
|
|
47
47
|
|
|
@@ -66,7 +66,7 @@ Note: Prior to v1.18.1, Puppeteer required at least Node v6.4.0. Versions from v
|
|
|
66
66
|
Node 8.9.0+. Starting from v3.0.0 Puppeteer starts to rely on Node 10.18.1+. All examples below use async/await which is only supported in Node v7.6.0 or greater.
|
|
67
67
|
|
|
68
68
|
Puppeteer will be familiar to people using other browser testing frameworks. You create an instance
|
|
69
|
-
of `Browser`, open pages, and then manipulate them with [Puppeteer's API](https://github.com/puppeteer/puppeteer/blob/v10.
|
|
69
|
+
of `Browser`, open pages, and then manipulate them with [Puppeteer's API](https://github.com/puppeteer/puppeteer/blob/v10.4.0/docs/api.md#).
|
|
70
70
|
|
|
71
71
|
**Example** - navigating to https://example.com and saving a screenshot as _example.png_:
|
|
72
72
|
|
|
@@ -91,7 +91,7 @@ Execute script on the command line
|
|
|
91
91
|
node example.js
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
Puppeteer sets an initial page size to 800×600px, which defines the screenshot size. The page size can be customized with [`Page.setViewport()`](https://github.com/puppeteer/puppeteer/blob/v10.
|
|
94
|
+
Puppeteer sets an initial page size to 800×600px, which defines the screenshot size. The page size can be customized with [`Page.setViewport()`](https://github.com/puppeteer/puppeteer/blob/v10.4.0/docs/api.md#pagesetviewportviewport).
|
|
95
95
|
|
|
96
96
|
**Example** - create a PDF.
|
|
97
97
|
|
|
@@ -118,7 +118,7 @@ Execute script on the command line
|
|
|
118
118
|
node hn.js
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
See [`Page.pdf()`](https://github.com/puppeteer/puppeteer/blob/v10.
|
|
121
|
+
See [`Page.pdf()`](https://github.com/puppeteer/puppeteer/blob/v10.4.0/docs/api.md#pagepdfoptions) for more information about creating pdfs.
|
|
122
122
|
|
|
123
123
|
**Example** - evaluate script in the context of the page
|
|
124
124
|
|
|
@@ -153,7 +153,7 @@ Execute script on the command line
|
|
|
153
153
|
node get-dimensions.js
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
-
See [`Page.evaluate()`](https://github.com/puppeteer/puppeteer/blob/v10.
|
|
156
|
+
See [`Page.evaluate()`](https://github.com/puppeteer/puppeteer/blob/v10.4.0/docs/api.md#pageevaluatepagefunction-args) for more information on `evaluate` and related methods like `evaluateOnNewDocument` and `exposeFunction`.
|
|
157
157
|
|
|
158
158
|
<!-- [END getstarted] -->
|
|
159
159
|
|
|
@@ -163,7 +163,7 @@ See [`Page.evaluate()`](https://github.com/puppeteer/puppeteer/blob/v10.2.0/docs
|
|
|
163
163
|
|
|
164
164
|
**1. Uses Headless mode**
|
|
165
165
|
|
|
166
|
-
Puppeteer launches Chromium in [headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome). To launch a full version of Chromium, set the [`headless` option](https://github.com/puppeteer/puppeteer/blob/v10.
|
|
166
|
+
Puppeteer launches Chromium in [headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome). To launch a full version of Chromium, set the [`headless` option](https://github.com/puppeteer/puppeteer/blob/v10.4.0/docs/api.md#puppeteerlaunchoptions) when launching a browser:
|
|
167
167
|
|
|
168
168
|
```js
|
|
169
169
|
const browser = await puppeteer.launch({ headless: false }); // default is true
|
|
@@ -179,9 +179,9 @@ pass in the executable's path when creating a `Browser` instance:
|
|
|
179
179
|
const browser = await puppeteer.launch({ executablePath: '/path/to/Chrome' });
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
-
You can also use Puppeteer with Firefox Nightly (experimental support). See [`Puppeteer.launch()`](https://github.com/puppeteer/puppeteer/blob/v10.
|
|
182
|
+
You can also use Puppeteer with Firefox Nightly (experimental support). See [`Puppeteer.launch()`](https://github.com/puppeteer/puppeteer/blob/v10.4.0/docs/api.md#puppeteerlaunchoptions) for more information.
|
|
183
183
|
|
|
184
|
-
See [`this article`](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for a description of the differences between Chromium and Chrome. [`This article`](https://chromium.googlesource.com/chromium/src/+/
|
|
184
|
+
See [`this article`](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for a description of the differences between Chromium and Chrome. [`This article`](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/chromium_browser_vs_google_chrome.md) describes some differences for Linux users.
|
|
185
185
|
|
|
186
186
|
**3. Creates a fresh user profile**
|
|
187
187
|
|
|
@@ -191,7 +191,7 @@ Puppeteer creates its own browser user profile which it **cleans up on every run
|
|
|
191
191
|
|
|
192
192
|
## Resources
|
|
193
193
|
|
|
194
|
-
- [API Documentation](https://github.com/puppeteer/puppeteer/blob/v10.
|
|
194
|
+
- [API Documentation](https://github.com/puppeteer/puppeteer/blob/v10.4.0/docs/api.md)
|
|
195
195
|
- [Examples](https://github.com/puppeteer/puppeteer/tree/main/examples/)
|
|
196
196
|
- [Community list of Puppeteer resources](https://github.com/transitive-bullshit/awesome-puppeteer)
|
|
197
197
|
|
|
@@ -333,7 +333,7 @@ See [Contributing](https://github.com/puppeteer/puppeteer/blob/main/CONTRIBUTING
|
|
|
333
333
|
|
|
334
334
|
Official Firefox support is currently experimental. The ongoing collaboration with Mozilla aims to support common end-to-end testing use cases, for which developers expect cross-browser coverage. The Puppeteer team needs input from users to stabilize Firefox support and to bring missing APIs to our attention.
|
|
335
335
|
|
|
336
|
-
From Puppeteer v2.1.0 onwards you can specify [`puppeteer.launch({product: 'firefox'})`](https://github.com/puppeteer/puppeteer/blob/v10.
|
|
336
|
+
From Puppeteer v2.1.0 onwards you can specify [`puppeteer.launch({product: 'firefox'})`](https://github.com/puppeteer/puppeteer/blob/v10.4.0/docs/api.md#puppeteerlaunchoptions) to run your Puppeteer scripts in Firefox Nightly, without any additional custom patches. While [an older experiment](https://www.npmjs.com/package/puppeteer-firefox) required a patched version of Firefox, [the current approach](https://wiki.mozilla.org/Remote) works with “stock” Firefox.
|
|
337
337
|
|
|
338
338
|
We will continue to collaborate with other browser vendors to bring Puppeteer support to browsers such as Safari.
|
|
339
339
|
This effort includes exploration of a standard for executing cross-browser commands (instead of relying on the non-standard DevTools Protocol used by Chrome).
|
|
@@ -433,7 +433,7 @@ await page.evaluate(() => {
|
|
|
433
433
|
|
|
434
434
|
You may find that Puppeteer does not behave as expected when controlling pages that incorporate audio and video. (For example, [video playback/screenshots is likely to fail](https://github.com/puppeteer/puppeteer/issues/291).) There are two reasons for this:
|
|
435
435
|
|
|
436
|
-
- Puppeteer is bundled with Chromium — not Chrome — and so by default, it inherits all of [Chromium's media-related limitations](https://www.chromium.org/audio-video). This means that Puppeteer does not support licensed formats such as AAC or H.264. (However, it is possible to force Puppeteer to use a separately-installed version Chrome instead of Chromium via the [`executablePath` option to `puppeteer.launch`](https://github.com/puppeteer/puppeteer/blob/v10.
|
|
436
|
+
- Puppeteer is bundled with Chromium — not Chrome — and so by default, it inherits all of [Chromium's media-related limitations](https://www.chromium.org/audio-video). This means that Puppeteer does not support licensed formats such as AAC or H.264. (However, it is possible to force Puppeteer to use a separately-installed version Chrome instead of Chromium via the [`executablePath` option to `puppeteer.launch`](https://github.com/puppeteer/puppeteer/blob/v10.4.0/docs/api.md#puppeteerlaunchoptions). You should only use this configuration if you need an official release of Chrome that supports these media formats.)
|
|
437
437
|
- Since Puppeteer (in all configurations) controls a desktop version of Chromium/Chrome, features that are only supported by the mobile version of Chrome are not supported. This means that Puppeteer [does not support HTTP Live Streaming (HLS)](https://caniuse.com/#feat=http-live-streaming).
|
|
438
438
|
|
|
439
439
|
#### Q: I am having trouble installing / running Puppeteer in my test environment. Where should I look for help?
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AriaQueryHandler.d.ts","sourceRoot":"","sources":["../../../../src/common/AriaQueryHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"AriaQueryHandler.d.ts","sourceRoot":"","sources":["../../../../src/common/AriaQueryHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAoHzD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,oBAKzB,CAAC"}
|
|
@@ -25,20 +25,20 @@ async function queryAXTree(client, element, accessibleName, role) {
|
|
|
25
25
|
const filteredNodes = nodes.filter((node) => node.role.value !== 'StaticText');
|
|
26
26
|
return filteredNodes;
|
|
27
27
|
}
|
|
28
|
+
const normalizeValue = (value) => value.replace(/ +/g, ' ').trim();
|
|
29
|
+
const knownAttributes = new Set(['name', 'role']);
|
|
30
|
+
const attributeRegexp = /\[\s*(?<attribute>\w+)\s*=\s*"(?<value>\\.|[^"\\]*)"\s*\]/g;
|
|
28
31
|
function parseAriaSelector(selector) {
|
|
29
|
-
const normalize = (value) => value.replace(/ +/g, ' ').trim();
|
|
30
|
-
const knownAttributes = new Set(['name', 'role']);
|
|
31
32
|
const queryOptions = {};
|
|
32
|
-
const attributeRegexp = /\[\s*(?<attribute>\w+)\s*=\s*"(?<value>\\.|[^"\\]*)"\s*\]/g;
|
|
33
33
|
const defaultName = selector.replace(attributeRegexp, (_, attribute, value) => {
|
|
34
34
|
attribute = attribute.trim();
|
|
35
35
|
if (!knownAttributes.has(attribute))
|
|
36
36
|
throw new Error(`Unknown aria attribute "${attribute}" in selector`);
|
|
37
|
-
queryOptions[attribute] =
|
|
37
|
+
queryOptions[attribute] = normalizeValue(value);
|
|
38
38
|
return '';
|
|
39
39
|
});
|
|
40
40
|
if (defaultName && !queryOptions.name)
|
|
41
|
-
queryOptions.name =
|
|
41
|
+
queryOptions.name = normalizeValue(defaultName);
|
|
42
42
|
return queryOptions;
|
|
43
43
|
}
|
|
44
44
|
const queryOne = async (element, selector) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AriaQueryHandler.js","sourceRoot":"","sources":["../../../../src/common/AriaQueryHandler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAQH,KAAK,UAAU,WAAW,CACxB,MAAkB,EAClB,OAAsB,EACtB,cAAuB,EACvB,IAAa;IAEb,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IA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|
|
@@ -21,6 +21,22 @@ import { Protocol } from 'devtools-protocol';
|
|
|
21
21
|
import { Page } from './Page.js';
|
|
22
22
|
import { ChildProcess } from 'child_process';
|
|
23
23
|
import { Viewport } from './PuppeteerViewport.js';
|
|
24
|
+
/**
|
|
25
|
+
* BrowserContext options.
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export interface BrowserContextOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Proxy server with optional port to use for all requests.
|
|
32
|
+
* Username and password can be set in `Page.authenticate`.
|
|
33
|
+
*/
|
|
34
|
+
proxyServer?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Bypass the proxy for the given semi-colon-separated list of hosts.
|
|
37
|
+
*/
|
|
38
|
+
proxyBypassList?: string[];
|
|
39
|
+
}
|
|
24
40
|
/**
|
|
25
41
|
* @internal
|
|
26
42
|
*/
|
|
@@ -32,7 +48,7 @@ export declare type TargetFilterCallback = (target: Protocol.Target.TargetInfo)
|
|
|
32
48
|
/**
|
|
33
49
|
* @public
|
|
34
50
|
*/
|
|
35
|
-
export declare type Permission = 'geolocation' | 'midi' | 'notifications' | 'camera' | 'microphone' | 'background-sync' | 'ambient-light-sensor' | 'accelerometer' | 'gyroscope' | 'magnetometer' | 'accessibility-events' | 'clipboard-read' | 'clipboard-write' | 'payment-handler' | 'idle-detection' | 'midi-sysex';
|
|
51
|
+
export declare type Permission = 'geolocation' | 'midi' | 'notifications' | 'camera' | 'microphone' | 'background-sync' | 'ambient-light-sensor' | 'accelerometer' | 'gyroscope' | 'magnetometer' | 'accessibility-events' | 'clipboard-read' | 'clipboard-write' | 'payment-handler' | 'persistent-storage' | 'idle-detection' | 'midi-sysex';
|
|
36
52
|
/**
|
|
37
53
|
* @public
|
|
38
54
|
*/
|
|
@@ -177,7 +193,7 @@ export declare class Browser extends EventEmitter {
|
|
|
177
193
|
* })();
|
|
178
194
|
* ```
|
|
179
195
|
*/
|
|
180
|
-
createIncognitoBrowserContext(): Promise<BrowserContext>;
|
|
196
|
+
createIncognitoBrowserContext(options?: BrowserContextOptions): Promise<BrowserContext>;
|
|
181
197
|
/**
|
|
182
198
|
* Returns an array of all open browser contexts. In a newly created browser, this will
|
|
183
199
|
* return a single instance of {@link BrowserContext}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Browser.d.ts","sourceRoot":"","sources":["../../../../src/common/Browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAA2B,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD;;GAEG;AACH,oBAAY,oBAAoB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAE9D;;GAEG;AACH,oBAAY,oBAAoB,GAAG,CACjC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,KAC/B,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Browser.d.ts","sourceRoot":"","sources":["../../../../src/common/Browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAA2B,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,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AE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAO,GACjC,OAAO,CAAC,MAAM,CAAC;IAOlB;;;;;;OAMG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAS9B;;;;;;OAMG;IACH,WAAW,IAAI,OAAO;IAItB;;;;;;;;;;OAUG;IACG,mBAAmB,CACvB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,UAAU,EAAE,GACxB,OAAO,CAAC,IAAI,CAAC;IAehB;;;;;;;;;;OAUG;IACG,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAM/C;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;;;;;OAMG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAI7B"}
|
|
@@ -38,6 +38,7 @@ const WEB_PERMISSION_TO_PROTOCOL_PERMISSION = new Map([
|
|
|
38
38
|
['clipboard-read', 'clipboardReadWrite'],
|
|
39
39
|
['clipboard-write', 'clipboardReadWrite'],
|
|
40
40
|
['payment-handler', 'paymentHandler'],
|
|
41
|
+
['persistent-storage', 'durableStorage'],
|
|
41
42
|
['idle-detection', 'idleDetection'],
|
|
42
43
|
// chrome-specific permissions we have.
|
|
43
44
|
['midi-sysex', 'midiSysex'],
|
|
@@ -141,8 +142,12 @@ class Browser extends EventEmitter_js_1.EventEmitter {
|
|
|
141
142
|
* })();
|
|
142
143
|
* ```
|
|
143
144
|
*/
|
|
144
|
-
async createIncognitoBrowserContext() {
|
|
145
|
-
const {
|
|
145
|
+
async createIncognitoBrowserContext(options = {}) {
|
|
146
|
+
const { proxyServer = '', proxyBypassList = [] } = options;
|
|
147
|
+
const { browserContextId } = await this._connection.send('Target.createBrowserContext', {
|
|
148
|
+
proxyServer,
|
|
149
|
+
proxyBypassList: proxyBypassList && proxyBypassList.join(','),
|
|
150
|
+
});
|
|
146
151
|
const context = new BrowserContext(this._connection, this, browserContextId);
|
|
147
152
|
this._contexts.set(browserContextId, context);
|
|
148
153
|
return context;
|