puppeteer-bidi 0.0.1.beta6 → 0.0.1.beta8
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/puppeteer/bidi/version.rb +1 -1
- data/lib/puppeteer/bidi.rb +36 -25
- data/sig/puppeteer/bidi.rbs +12 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 99f9e34d27a5f0584a932300114fadba924ec18e4c514785eda71ea51300f774
|
|
4
|
+
data.tar.gz: 79a6fa6dcfc232a324e793897d14494b9942f6e2701eeb4c84ecb95890e4f0b3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b0be91430d409b262fe9f3981a8c1e864f3d09247e7b1102fc0dfd621e963053fb262f3bd24c70d0810a823c5daa14c17279cc6623e911bc03d5a5f7103068a2
|
|
7
|
+
data.tar.gz: eb78b4ba569359a449ea32f71ef847780b9edca0339bc4ce487a3bcd76bd49b764cc04062edc4996a95d25fa362844d024e4705324602071233e972bfd231127
|
data/lib/puppeteer/bidi.rb
CHANGED
|
@@ -38,35 +38,46 @@ module Puppeteer
|
|
|
38
38
|
# @rbs headless: bool -- Run browser in headless mode
|
|
39
39
|
# @rbs args: Array[String]? -- Additional browser arguments
|
|
40
40
|
# @rbs timeout: Numeric? -- Launch timeout in seconds
|
|
41
|
-
# @rbs &block: (Browser ->
|
|
42
|
-
# @rbs return:
|
|
43
|
-
def self.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
41
|
+
# @rbs &block: (Browser) -> untyped -- Block to execute with the browser instance
|
|
42
|
+
# @rbs return: untyped
|
|
43
|
+
def self.launch_with_sync(executable_path: nil, user_data_dir: nil, headless: true, args: nil, timeout: nil, &block)
|
|
44
|
+
unless block
|
|
45
|
+
raise ArgumentError, 'Block is required for launch_with_sync'
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
Sync do
|
|
49
|
+
begin
|
|
50
|
+
browser = launch(
|
|
51
|
+
executable_path: executable_path,
|
|
52
|
+
user_data_dir: user_data_dir,
|
|
53
|
+
headless: headless,
|
|
54
|
+
args: args,
|
|
55
|
+
timeout: timeout
|
|
56
|
+
)
|
|
57
|
+
block.call(browser)
|
|
58
|
+
ensure
|
|
59
|
+
browser&.close
|
|
58
60
|
end
|
|
59
|
-
else
|
|
60
|
-
Browser.launch(
|
|
61
|
-
executable_path: executable_path,
|
|
62
|
-
user_data_dir: user_data_dir,
|
|
63
|
-
headless: headless,
|
|
64
|
-
args: args,
|
|
65
|
-
timeout: timeout
|
|
66
|
-
)
|
|
67
61
|
end
|
|
68
62
|
end
|
|
69
63
|
|
|
64
|
+
# Launch a new browser instance
|
|
65
|
+
# @rbs executable_path: String? -- Path to browser executable
|
|
66
|
+
# @rbs user_data_dir: String? -- Path to user data directory
|
|
67
|
+
# @rbs headless: bool -- Run browser in headless mode
|
|
68
|
+
# @rbs args: Array[String]? -- Additional browser arguments
|
|
69
|
+
# @rbs timeout: Numeric? -- Launch timeout in seconds
|
|
70
|
+
# @rbs return: Browser -- Browser instance (if no block given)
|
|
71
|
+
def self.launch(executable_path: nil, user_data_dir: nil, headless: true, args: nil, timeout: nil)
|
|
72
|
+
Browser.launch(
|
|
73
|
+
executable_path: executable_path,
|
|
74
|
+
user_data_dir: user_data_dir,
|
|
75
|
+
headless: headless,
|
|
76
|
+
args: args,
|
|
77
|
+
timeout: timeout
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
70
81
|
# Connect to an existing browser instance
|
|
71
82
|
# @rbs ws_endpoint: String -- WebSocket endpoint URL
|
|
72
83
|
# @rbs return: Browser -- Browser instance
|
data/sig/puppeteer/bidi.rbs
CHANGED
|
@@ -8,9 +8,18 @@ module Puppeteer
|
|
|
8
8
|
# @rbs headless: bool -- Run browser in headless mode
|
|
9
9
|
# @rbs args: Array[String]? -- Additional browser arguments
|
|
10
10
|
# @rbs timeout: Numeric? -- Launch timeout in seconds
|
|
11
|
-
# @rbs &block: (Browser ->
|
|
12
|
-
# @rbs return:
|
|
13
|
-
def self.
|
|
11
|
+
# @rbs &block: (Browser) -> untyped -- Block to execute with the browser instance
|
|
12
|
+
# @rbs return: untyped
|
|
13
|
+
def self.launch_with_sync: (?executable_path: String?, ?user_data_dir: String?, ?headless: bool, ?args: Array[String]?, ?timeout: Numeric?) { (Browser) -> untyped } -> untyped
|
|
14
|
+
|
|
15
|
+
# Launch a new browser instance
|
|
16
|
+
# @rbs executable_path: String? -- Path to browser executable
|
|
17
|
+
# @rbs user_data_dir: String? -- Path to user data directory
|
|
18
|
+
# @rbs headless: bool -- Run browser in headless mode
|
|
19
|
+
# @rbs args: Array[String]? -- Additional browser arguments
|
|
20
|
+
# @rbs timeout: Numeric? -- Launch timeout in seconds
|
|
21
|
+
# @rbs return: Browser -- Browser instance (if no block given)
|
|
22
|
+
def self.launch: (?executable_path: String?, ?user_data_dir: String?, ?headless: bool, ?args: Array[String]?, ?timeout: Numeric?) -> Browser
|
|
14
23
|
|
|
15
24
|
# Connect to an existing browser instance
|
|
16
25
|
# @rbs ws_endpoint: String -- WebSocket endpoint URL
|