wreq 1.3.2.1 → 1.3.2.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/Cargo.lock +40 -52
- data/Cargo.toml +11 -8
- data/README.md +12 -5
- data/VERSION +1 -1
- data/crates/README.md +5 -0
- data/crates/wreq-util/Cargo.toml +1 -0
- data/crates/wreq-util/src/emulate/macros.rs +31 -197
- data/crates/wreq-util/src/emulate/profile/chromium/chrome.rs +731 -0
- data/crates/wreq-util/src/emulate/profile/chromium/edge.rs +418 -0
- data/crates/wreq-util/src/emulate/profile/chromium/header.rs +74 -0
- data/crates/wreq-util/src/emulate/profile/chromium/http2.rs +59 -0
- data/crates/wreq-util/src/emulate/profile/chromium/opera.rs +312 -0
- data/crates/wreq-util/src/emulate/profile/{chrome → chromium}/tls.rs +146 -137
- data/crates/wreq-util/src/emulate/profile/chromium.rs +9 -0
- data/crates/wreq-util/src/emulate/profile/firefox/header.rs +48 -54
- data/crates/wreq-util/src/emulate/profile/firefox/http2.rs +92 -102
- data/crates/wreq-util/src/emulate/profile/firefox/tls.rs +155 -146
- data/crates/wreq-util/src/emulate/profile/firefox.rs +312 -440
- data/crates/wreq-util/src/emulate/profile.rs +5 -7
- data/crates/wreq-util/src/emulate.rs +34 -1
- data/crates/wreq-util/tests/client.rs +187 -46
- data/crates/wreq-util/tests/emulate_chrome.rs +17 -0
- data/crates/wreq-util/tests/emulate_firefox.rs +15 -0
- data/crates/wreq-util/tests/emulate_opera.rs +24 -0
- data/lib/wreq_ruby/emulate.rb +28 -0
- data/src/emulate.rs +28 -5
- data/test/emulation_client_hello_test.rb +142 -0
- data/test/emulation_test.rb +21 -104
- data/wreq.gemspec +1 -1
- metadata +11 -10
- data/crates/wreq-util/src/emulate/profile/chrome/header.rs +0 -116
- data/crates/wreq-util/src/emulate/profile/chrome/http2.rs +0 -65
- data/crates/wreq-util/src/emulate/profile/chrome.rs +0 -2269
- data/crates/wreq-util/src/emulate/profile/opera/header.rs +0 -29
- data/crates/wreq-util/src/emulate/profile/opera/http2.rs +0 -50
- data/crates/wreq-util/src/emulate/profile/opera/tls.rs +0 -103
- data/crates/wreq-util/src/emulate/profile/opera.rs +0 -299
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
//! Emulation for different browsers.
|
|
2
2
|
|
|
3
|
-
pub mod
|
|
3
|
+
pub(super) mod chromium;
|
|
4
4
|
pub mod firefox;
|
|
5
5
|
pub mod okhttp;
|
|
6
|
-
pub mod opera;
|
|
7
6
|
pub mod safari;
|
|
8
7
|
|
|
8
|
+
pub use chromium::{chrome, opera};
|
|
9
|
+
|
|
9
10
|
use typed_builder::TypedBuilder;
|
|
10
11
|
#[cfg(feature = "emulation-compression")]
|
|
11
12
|
use wreq::header::ACCEPT_ENCODING;
|
|
12
13
|
use wreq::{
|
|
13
14
|
Group,
|
|
14
|
-
header::{ACCEPT, ACCEPT_LANGUAGE, HeaderMap,
|
|
15
|
-
http2::{
|
|
16
|
-
Http2Options, Priorities, Priority, PseudoId, PseudoOrder, SettingId, SettingsOrder,
|
|
17
|
-
StreamDependency, StreamId,
|
|
18
|
-
},
|
|
15
|
+
header::{ACCEPT, ACCEPT_LANGUAGE, HeaderMap, HeaderValue, USER_AGENT},
|
|
16
|
+
http2::{Http2Options, PseudoId, PseudoOrder, SettingId, SettingsOrder},
|
|
19
17
|
tls::{
|
|
20
18
|
AlpnProtocol, AlpsProtocol, EchGrease, EchGreaseAead, ExtensionType, KeyShare, Tls13Cipher,
|
|
21
19
|
TlsOptions, TlsVersion, compress::CertificateCompressor,
|
|
@@ -3,7 +3,12 @@ mod macros;
|
|
|
3
3
|
pub mod compress;
|
|
4
4
|
pub mod profile;
|
|
5
5
|
|
|
6
|
-
use profile::{
|
|
6
|
+
use profile::{
|
|
7
|
+
chromium::{chrome::*, edge::*, opera::*},
|
|
8
|
+
firefox::*,
|
|
9
|
+
okhttp::*,
|
|
10
|
+
safari::*,
|
|
11
|
+
};
|
|
7
12
|
#[cfg(feature = "emulation-serde")]
|
|
8
13
|
use serde::{Deserialize, Serialize};
|
|
9
14
|
use typed_builder::TypedBuilder;
|
|
@@ -68,6 +73,7 @@ define_enum!(
|
|
|
68
73
|
Chrome155 => ("chrome_155", v155::emulation),
|
|
69
74
|
Chrome156 => ("chrome_156", v156::emulation),
|
|
70
75
|
Chrome157 => ("chrome_157", v157::emulation),
|
|
76
|
+
Chrome158 => ("chrome_158", v158::emulation),
|
|
71
77
|
|
|
72
78
|
// Edge versions
|
|
73
79
|
Edge101 => ("edge_101", edge101::emulation),
|
|
@@ -89,6 +95,16 @@ define_enum!(
|
|
|
89
95
|
Edge146 => ("edge_146", edge146::emulation),
|
|
90
96
|
Edge147 => ("edge_147", edge147::emulation),
|
|
91
97
|
Edge148 => ("edge_148", edge148::emulation),
|
|
98
|
+
Edge149 => ("edge_149", edge149::emulation),
|
|
99
|
+
Edge150 => ("edge_150", edge150::emulation),
|
|
100
|
+
Edge151 => ("edge_151", edge151::emulation),
|
|
101
|
+
Edge152 => ("edge_152", edge152::emulation),
|
|
102
|
+
Edge153 => ("edge_153", edge153::emulation),
|
|
103
|
+
Edge154 => ("edge_154", edge154::emulation),
|
|
104
|
+
Edge155 => ("edge_155", edge155::emulation),
|
|
105
|
+
Edge156 => ("edge_156", edge156::emulation),
|
|
106
|
+
Edge157 => ("edge_157", edge157::emulation),
|
|
107
|
+
Edge158 => ("edge_158", edge158::emulation),
|
|
92
108
|
|
|
93
109
|
// Opera versions
|
|
94
110
|
Opera116 => ("opera_116", opera116::emulation),
|
|
@@ -107,6 +123,15 @@ define_enum!(
|
|
|
107
123
|
Opera129 => ("opera_129", opera129::emulation),
|
|
108
124
|
Opera130 => ("opera_130", opera130::emulation),
|
|
109
125
|
Opera131 => ("opera_131", opera131::emulation),
|
|
126
|
+
Opera132 => ("opera_132", opera132::emulation),
|
|
127
|
+
Opera133 => ("opera_133", opera133::emulation),
|
|
128
|
+
Opera134 => ("opera_134", opera134::emulation),
|
|
129
|
+
Opera135 => ("opera_135", opera135::emulation),
|
|
130
|
+
Opera136 => ("opera_136", opera136::emulation),
|
|
131
|
+
Opera137 => ("opera_137", opera137::emulation),
|
|
132
|
+
Opera138 => ("opera_138", opera138::emulation),
|
|
133
|
+
Opera139 => ("opera_139", opera139::emulation),
|
|
134
|
+
Opera140 => ("opera_140", opera140::emulation),
|
|
110
135
|
|
|
111
136
|
// Firefox versions
|
|
112
137
|
Firefox109 => ("firefox_109", ff109::emulation),
|
|
@@ -130,6 +155,14 @@ define_enum!(
|
|
|
130
155
|
Firefox150 => ("firefox_150", ff150::emulation),
|
|
131
156
|
Firefox151 => ("firefox_151", ff151::emulation),
|
|
132
157
|
Firefox152 => ("firefox_152", ff152::emulation),
|
|
158
|
+
Firefox153 => ("firefox_153", ff153::emulation),
|
|
159
|
+
Firefox154 => ("firefox_154", ff154::emulation),
|
|
160
|
+
Firefox155 => ("firefox_155", ff155::emulation),
|
|
161
|
+
Firefox156 => ("firefox_156", ff156::emulation),
|
|
162
|
+
Firefox157 => ("firefox_157", ff157::emulation),
|
|
163
|
+
Firefox158 => ("firefox_158", ff158::emulation),
|
|
164
|
+
Firefox159 => ("firefox_159", ff159::emulation),
|
|
165
|
+
Firefox160 => ("firefox_160", ff160::emulation),
|
|
133
166
|
|
|
134
167
|
// Safari versions
|
|
135
168
|
SafariIos17_2 => ("safari_ios_17.2", safari_ios_17_2::emulation),
|
|
@@ -66,9 +66,6 @@ fn check_header_order<'a>(
|
|
|
66
66
|
previous = Some(position);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
assert!(request.contains("\r\nupgrade-insecure-requests: 1\r\n"));
|
|
70
|
-
assert!(request.contains("\r\nsec-fetch-user: ?1\r\n"));
|
|
71
|
-
|
|
72
69
|
stream
|
|
73
70
|
.write_all(b"HTTP/1.1 200 OK\r\ncontent-length: 0\r\nconnection: close\r\n\r\n")
|
|
74
71
|
.await
|
|
@@ -76,64 +73,105 @@ fn check_header_order<'a>(
|
|
|
76
73
|
})
|
|
77
74
|
}
|
|
78
75
|
|
|
79
|
-
async fn assert_emulation_headers(
|
|
76
|
+
async fn assert_emulation_headers(
|
|
77
|
+
emulation: impl wreq::IntoEmulation,
|
|
78
|
+
expected: &'static [&'static str],
|
|
79
|
+
) {
|
|
80
80
|
let server = server::low_level_with_response(move |request, stream| {
|
|
81
81
|
check_header_order(request, stream, expected)
|
|
82
82
|
});
|
|
83
|
-
|
|
84
|
-
.emulation(
|
|
83
|
+
Client::builder()
|
|
84
|
+
.emulation(emulation)
|
|
85
|
+
.no_proxy()
|
|
85
86
|
.build()
|
|
86
87
|
.expect("client")
|
|
87
88
|
.get(format!("http://{}/headers", server.addr()))
|
|
88
89
|
.send()
|
|
89
90
|
.await
|
|
90
91
|
.expect("request");
|
|
91
|
-
|
|
92
|
-
assert_eq!(response.status(), wreq::StatusCode::OK);
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
#[tokio::test]
|
|
96
|
-
async fn
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
async fn test_edge158_mobile_headers() {
|
|
96
|
+
for (platform, platform_hint, user_agent) in [
|
|
97
|
+
(
|
|
98
|
+
Platform::Android,
|
|
99
|
+
"\"Android\"",
|
|
100
|
+
"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/158.0.0.0 Mobile Safari/537.36 EdgA/158.0.0.0",
|
|
101
|
+
),
|
|
102
|
+
(
|
|
103
|
+
Platform::IOS,
|
|
104
|
+
"\"iOS\"",
|
|
105
|
+
"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 EdgiOS/158.0.0.0 Mobile/15E148 Safari/605.1.15",
|
|
106
|
+
),
|
|
107
|
+
] {
|
|
108
|
+
let server = server::http(move |request| async move {
|
|
109
|
+
let headers = request.headers();
|
|
110
|
+
assert_eq!(headers["user-agent"], user_agent);
|
|
111
|
+
assert_eq!(headers["sec-ch-ua-platform"], platform_hint);
|
|
112
|
+
assert_eq!(headers["sec-ch-ua-mobile"], "?1");
|
|
113
|
+
if platform == Platform::Android {
|
|
114
|
+
assert!(!headers["accept"].to_str().unwrap().contains("image/jxl"));
|
|
115
|
+
}
|
|
116
|
+
http::Response::default()
|
|
117
|
+
});
|
|
99
118
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
119
|
+
Client::builder()
|
|
120
|
+
.emulation(
|
|
121
|
+
Emulation::builder()
|
|
122
|
+
.profile(Emulation::Edge158)
|
|
123
|
+
.platform(platform)
|
|
124
|
+
.build(),
|
|
104
125
|
)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
let url = format!("http://{}/ua", server.addr());
|
|
116
|
-
let res = Client::builder()
|
|
117
|
-
.emulation(
|
|
118
|
-
Emulation::builder()
|
|
119
|
-
.profile(Emulation::Chrome151)
|
|
120
|
-
.platform(Platform::Linux)
|
|
121
|
-
.http2(true)
|
|
122
|
-
.build(),
|
|
123
|
-
)
|
|
124
|
-
.build()
|
|
125
|
-
.expect("Unable to build client")
|
|
126
|
-
.get(&url)
|
|
127
|
-
.send()
|
|
128
|
-
.await
|
|
129
|
-
.expect("request");
|
|
130
|
-
|
|
131
|
-
assert_eq!(res.status(), wreq::StatusCode::OK);
|
|
126
|
+
.no_proxy()
|
|
127
|
+
.build()
|
|
128
|
+
.unwrap()
|
|
129
|
+
.get(format!("http://{}/", server.addr()))
|
|
130
|
+
.send()
|
|
131
|
+
.await
|
|
132
|
+
.unwrap();
|
|
133
|
+
}
|
|
132
134
|
}
|
|
133
135
|
|
|
134
136
|
#[tokio::test]
|
|
135
|
-
async fn
|
|
136
|
-
|
|
137
|
+
async fn test_linux_navigation_emulation_headers() {
|
|
138
|
+
let linux = |profile| {
|
|
139
|
+
Emulation::builder()
|
|
140
|
+
.profile(profile)
|
|
141
|
+
.platform(Platform::Linux)
|
|
142
|
+
.build()
|
|
143
|
+
};
|
|
144
|
+
assert_emulation_headers(linux(Profile::Chrome152), CHROMIUM_HEADER_ORDER).await;
|
|
145
|
+
|
|
146
|
+
let server = server::http(|request| async move {
|
|
147
|
+
assert_eq!(request.version(), http::Version::HTTP_2);
|
|
148
|
+
let mut response = http::Response::default();
|
|
149
|
+
response
|
|
150
|
+
.headers_mut()
|
|
151
|
+
.insert("user-agent", request.headers()["user-agent"].clone());
|
|
152
|
+
response
|
|
153
|
+
});
|
|
154
|
+
let client = Client::builder()
|
|
155
|
+
.http2_only()
|
|
156
|
+
.no_proxy()
|
|
157
|
+
.build()
|
|
158
|
+
.expect("client");
|
|
159
|
+
for (profile, major) in [
|
|
160
|
+
(Profile::Firefox150, 150),
|
|
161
|
+
(Profile::Firefox151, 151),
|
|
162
|
+
(Profile::Firefox152, 152),
|
|
163
|
+
] {
|
|
164
|
+
let response = client
|
|
165
|
+
.get(format!("http://{}/headers", server.addr()))
|
|
166
|
+
.emulation(linux(profile))
|
|
167
|
+
.send()
|
|
168
|
+
.await
|
|
169
|
+
.expect("request");
|
|
170
|
+
let expected = format!(
|
|
171
|
+
"Mozilla/5.0 (X11; Linux x86_64; rv:{major}.0) Gecko/20100101 Firefox/{major}.0"
|
|
172
|
+
);
|
|
173
|
+
assert_eq!(response.headers()["user-agent"], expected, "{profile:?}");
|
|
174
|
+
}
|
|
137
175
|
}
|
|
138
176
|
|
|
139
177
|
#[tokio::test]
|
|
@@ -142,6 +180,109 @@ async fn test_firefox_default_header_order() {
|
|
|
142
180
|
}
|
|
143
181
|
|
|
144
182
|
#[tokio::test]
|
|
145
|
-
async fn
|
|
146
|
-
|
|
183
|
+
async fn test_firefox_mobile_headers() {
|
|
184
|
+
let server = server::http(|request| async move {
|
|
185
|
+
let mut response = http::Response::default();
|
|
186
|
+
for name in ["user-agent", "accept-language"] {
|
|
187
|
+
response
|
|
188
|
+
.headers_mut()
|
|
189
|
+
.insert(name, request.headers()[name].clone());
|
|
190
|
+
}
|
|
191
|
+
response
|
|
192
|
+
});
|
|
193
|
+
let client = Client::builder()
|
|
194
|
+
.http2_only()
|
|
195
|
+
.no_proxy()
|
|
196
|
+
.build()
|
|
197
|
+
.expect("client");
|
|
198
|
+
|
|
199
|
+
for (profile, platform, user_agent, language) in [
|
|
200
|
+
(
|
|
201
|
+
Profile::Firefox160,
|
|
202
|
+
Platform::Android,
|
|
203
|
+
"Mozilla/5.0 (Android 16; Mobile; rv:160.0) Gecko/160.0 Firefox/160.0",
|
|
204
|
+
"en-US",
|
|
205
|
+
),
|
|
206
|
+
(
|
|
207
|
+
Profile::Firefox153,
|
|
208
|
+
Platform::IOS,
|
|
209
|
+
"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/153.3 Mobile/15E148 Safari/604.1",
|
|
210
|
+
"en-US,en;q=0.9",
|
|
211
|
+
),
|
|
212
|
+
] {
|
|
213
|
+
let response = client
|
|
214
|
+
.get(format!("http://{}/headers", server.addr()))
|
|
215
|
+
.emulation(
|
|
216
|
+
Emulation::builder()
|
|
217
|
+
.profile(profile)
|
|
218
|
+
.platform(platform)
|
|
219
|
+
.build(),
|
|
220
|
+
)
|
|
221
|
+
.send()
|
|
222
|
+
.await
|
|
223
|
+
.expect("request");
|
|
224
|
+
assert_eq!(response.headers()["user-agent"], user_agent, "{profile:?}");
|
|
225
|
+
assert_eq!(
|
|
226
|
+
response.headers()["accept-language"],
|
|
227
|
+
language,
|
|
228
|
+
"{profile:?}"
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
#[tokio::test]
|
|
234
|
+
async fn test_opera_linux_headers() {
|
|
235
|
+
for (profile, expected_user_agent) in [
|
|
236
|
+
(
|
|
237
|
+
Emulation::Opera138,
|
|
238
|
+
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36 OPR/138.0.0.0",
|
|
239
|
+
),
|
|
240
|
+
(
|
|
241
|
+
Emulation::Opera139,
|
|
242
|
+
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36 OPR/139.0.0.0",
|
|
243
|
+
),
|
|
244
|
+
(
|
|
245
|
+
Emulation::Opera140,
|
|
246
|
+
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/157.0.0.0 Safari/537.36 OPR/140.0.0.0",
|
|
247
|
+
),
|
|
248
|
+
] {
|
|
249
|
+
let server = server::http(move |request| async move {
|
|
250
|
+
assert_eq!(request.version(), http::Version::HTTP_2);
|
|
251
|
+
assert_eq!(
|
|
252
|
+
request.headers()["user-agent"],
|
|
253
|
+
expected_user_agent,
|
|
254
|
+
"{profile:?}"
|
|
255
|
+
);
|
|
256
|
+
assert_eq!(
|
|
257
|
+
request.headers()["sec-ch-ua-platform"],
|
|
258
|
+
"\"Linux\"",
|
|
259
|
+
"{profile:?}"
|
|
260
|
+
);
|
|
261
|
+
if profile == Profile::Opera140 {
|
|
262
|
+
assert!(
|
|
263
|
+
request.headers()["accept"]
|
|
264
|
+
.to_str()
|
|
265
|
+
.unwrap()
|
|
266
|
+
.contains("image/jxl,image/avif")
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
http::Response::default()
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
Client::builder()
|
|
273
|
+
.emulation(
|
|
274
|
+
Emulation::builder()
|
|
275
|
+
.profile(profile)
|
|
276
|
+
.platform(Platform::Linux)
|
|
277
|
+
.build(),
|
|
278
|
+
)
|
|
279
|
+
.http2_only()
|
|
280
|
+
.no_proxy()
|
|
281
|
+
.build()
|
|
282
|
+
.expect("client")
|
|
283
|
+
.get(format!("http://{}/", server.addr()))
|
|
284
|
+
.send()
|
|
285
|
+
.await
|
|
286
|
+
.expect("request");
|
|
287
|
+
}
|
|
147
288
|
}
|
|
@@ -335,3 +335,20 @@ test_emulation!(
|
|
|
335
335
|
],
|
|
336
336
|
"52d84b11737d980aef856699f885ca86"
|
|
337
337
|
);
|
|
338
|
+
|
|
339
|
+
test_emulation!(
|
|
340
|
+
test_chrome158,
|
|
341
|
+
Emulation::Chrome158,
|
|
342
|
+
[
|
|
343
|
+
"t13d1517h2_8daaf6152771_cb7bf5808d99",
|
|
344
|
+
"t13d1518h2_8daaf6152771_e2d80978ab2e"
|
|
345
|
+
],
|
|
346
|
+
"52d84b11737d980aef856699f885ca86"
|
|
347
|
+
);
|
|
348
|
+
|
|
349
|
+
test_emulation!(
|
|
350
|
+
test_edge158,
|
|
351
|
+
Emulation::Edge158,
|
|
352
|
+
["t13d1516h2_8daaf6152771_806a8c22fdea"],
|
|
353
|
+
"52d84b11737d980aef856699f885ca86"
|
|
354
|
+
);
|
|
@@ -112,6 +112,13 @@ test_emulation!(
|
|
|
112
112
|
"6ea73faa8fc5aac76bded7bd238f6433"
|
|
113
113
|
);
|
|
114
114
|
|
|
115
|
+
test_emulation!(
|
|
116
|
+
test_firefox_160,
|
|
117
|
+
Emulation::Firefox160,
|
|
118
|
+
["t13d1517h2_8daaf6152771_3cbfd9057e0d"],
|
|
119
|
+
"6ea73faa8fc5aac76bded7bd238f6433"
|
|
120
|
+
);
|
|
121
|
+
|
|
115
122
|
/// Firefox 147 changed the generated `Accept-Language` q-value: the list used to divide 1.0
|
|
116
123
|
/// across its entries, giving `q=0.5` for two, and now decrements by 0.1 per entry, giving
|
|
117
124
|
/// `q=0.9`. See Bugzilla 2000765, landed in mozilla-firefox 0e050ae5116d.
|
|
@@ -147,6 +154,14 @@ fn firefox_accept_language_matches_the_profile_version() {
|
|
|
147
154
|
("Firefox150", Emulation::Firefox150),
|
|
148
155
|
("Firefox151", Emulation::Firefox151),
|
|
149
156
|
("Firefox152", Emulation::Firefox152),
|
|
157
|
+
("Firefox153", Emulation::Firefox153),
|
|
158
|
+
("Firefox154", Emulation::Firefox154),
|
|
159
|
+
("Firefox155", Emulation::Firefox155),
|
|
160
|
+
("Firefox156", Emulation::Firefox156),
|
|
161
|
+
("Firefox157", Emulation::Firefox157),
|
|
162
|
+
("Firefox158", Emulation::Firefox158),
|
|
163
|
+
("Firefox159", Emulation::Firefox159),
|
|
164
|
+
("Firefox160", Emulation::Firefox160),
|
|
150
165
|
];
|
|
151
166
|
|
|
152
167
|
fn accept_language(profile: Profile) -> String {
|
|
@@ -111,3 +111,27 @@ test_emulation!(
|
|
|
111
111
|
["t13d1516h2_8daaf6152771_02713d6af862"],
|
|
112
112
|
"52d84b11737d980aef856699f885ca86"
|
|
113
113
|
);
|
|
114
|
+
|
|
115
|
+
test_emulation!(
|
|
116
|
+
test_opera132,
|
|
117
|
+
Emulation::Opera132,
|
|
118
|
+
["t13d1516h2_8daaf6152771_d8a2da3f94cd"],
|
|
119
|
+
"52d84b11737d980aef856699f885ca86"
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
test_emulation!(
|
|
123
|
+
test_opera134,
|
|
124
|
+
Emulation::Opera134,
|
|
125
|
+
["t13d1516h2_8daaf6152771_806a8c22fdea"],
|
|
126
|
+
"52d84b11737d980aef856699f885ca86"
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
test_emulation!(
|
|
130
|
+
test_opera140,
|
|
131
|
+
Emulation::Opera140,
|
|
132
|
+
[
|
|
133
|
+
"t13d1517h2_8daaf6152771_cb7bf5808d99",
|
|
134
|
+
"t13d1518h2_8daaf6152771_e2d80978ab2e"
|
|
135
|
+
],
|
|
136
|
+
"52d84b11737d980aef856699f885ca86"
|
|
137
|
+
);
|
data/lib/wreq_ruby/emulate.rb
CHANGED
|
@@ -69,6 +69,7 @@ module Wreq
|
|
|
69
69
|
Chrome155 = nil
|
|
70
70
|
Chrome156 = nil
|
|
71
71
|
Chrome157 = nil
|
|
72
|
+
Chrome158 = nil
|
|
72
73
|
|
|
73
74
|
Edge101 = nil
|
|
74
75
|
Edge122 = nil
|
|
@@ -89,6 +90,16 @@ module Wreq
|
|
|
89
90
|
Edge146 = nil
|
|
90
91
|
Edge147 = nil
|
|
91
92
|
Edge148 = nil
|
|
93
|
+
Edge149 = nil
|
|
94
|
+
Edge150 = nil
|
|
95
|
+
Edge151 = nil
|
|
96
|
+
Edge152 = nil
|
|
97
|
+
Edge153 = nil
|
|
98
|
+
Edge154 = nil
|
|
99
|
+
Edge155 = nil
|
|
100
|
+
Edge156 = nil
|
|
101
|
+
Edge157 = nil
|
|
102
|
+
Edge158 = nil
|
|
92
103
|
|
|
93
104
|
Firefox109 = nil
|
|
94
105
|
Firefox117 = nil
|
|
@@ -111,6 +122,14 @@ module Wreq
|
|
|
111
122
|
Firefox150 = nil
|
|
112
123
|
Firefox151 = nil
|
|
113
124
|
Firefox152 = nil
|
|
125
|
+
Firefox153 = nil
|
|
126
|
+
Firefox154 = nil
|
|
127
|
+
Firefox155 = nil
|
|
128
|
+
Firefox156 = nil
|
|
129
|
+
Firefox157 = nil
|
|
130
|
+
Firefox158 = nil
|
|
131
|
+
Firefox159 = nil
|
|
132
|
+
Firefox160 = nil
|
|
114
133
|
|
|
115
134
|
SafariIos17_2 = nil
|
|
116
135
|
SafariIos17_4_1 = nil
|
|
@@ -167,6 +186,15 @@ module Wreq
|
|
|
167
186
|
Opera129 = nil
|
|
168
187
|
Opera130 = nil
|
|
169
188
|
Opera131 = nil
|
|
189
|
+
Opera132 = nil
|
|
190
|
+
Opera133 = nil
|
|
191
|
+
Opera134 = nil
|
|
192
|
+
Opera135 = nil
|
|
193
|
+
Opera136 = nil
|
|
194
|
+
Opera137 = nil
|
|
195
|
+
Opera138 = nil
|
|
196
|
+
Opera139 = nil
|
|
197
|
+
Opera140 = nil
|
|
170
198
|
end
|
|
171
199
|
|
|
172
200
|
unless method_defined?(:to_s)
|
data/src/emulate.rs
CHANGED
|
@@ -95,7 +95,7 @@ define_ruby_enum!(
|
|
|
95
95
|
Chrome155,
|
|
96
96
|
Chrome156,
|
|
97
97
|
Chrome157,
|
|
98
|
-
|
|
98
|
+
Chrome158,
|
|
99
99
|
Edge101,
|
|
100
100
|
Edge122,
|
|
101
101
|
Edge127,
|
|
@@ -115,7 +115,16 @@ define_ruby_enum!(
|
|
|
115
115
|
Edge146,
|
|
116
116
|
Edge147,
|
|
117
117
|
Edge148,
|
|
118
|
-
|
|
118
|
+
Edge149,
|
|
119
|
+
Edge150,
|
|
120
|
+
Edge151,
|
|
121
|
+
Edge152,
|
|
122
|
+
Edge153,
|
|
123
|
+
Edge154,
|
|
124
|
+
Edge155,
|
|
125
|
+
Edge156,
|
|
126
|
+
Edge157,
|
|
127
|
+
Edge158,
|
|
119
128
|
Firefox109,
|
|
120
129
|
Firefox117,
|
|
121
130
|
Firefox128,
|
|
@@ -137,7 +146,14 @@ define_ruby_enum!(
|
|
|
137
146
|
Firefox150,
|
|
138
147
|
Firefox151,
|
|
139
148
|
Firefox152,
|
|
140
|
-
|
|
149
|
+
Firefox153,
|
|
150
|
+
Firefox154,
|
|
151
|
+
Firefox155,
|
|
152
|
+
Firefox156,
|
|
153
|
+
Firefox157,
|
|
154
|
+
Firefox158,
|
|
155
|
+
Firefox159,
|
|
156
|
+
Firefox160,
|
|
141
157
|
SafariIos17_2,
|
|
142
158
|
SafariIos17_4_1,
|
|
143
159
|
SafariIos16_5,
|
|
@@ -167,7 +183,6 @@ define_ruby_enum!(
|
|
|
167
183
|
SafariIos26_2,
|
|
168
184
|
SafariIPad26,
|
|
169
185
|
SafariIpad26_2,
|
|
170
|
-
|
|
171
186
|
OkHttp3_9,
|
|
172
187
|
OkHttp3_11,
|
|
173
188
|
OkHttp3_13,
|
|
@@ -176,7 +191,6 @@ define_ruby_enum!(
|
|
|
176
191
|
OkHttp4_10,
|
|
177
192
|
OkHttp4_12,
|
|
178
193
|
OkHttp5,
|
|
179
|
-
|
|
180
194
|
Opera116,
|
|
181
195
|
Opera117,
|
|
182
196
|
Opera118,
|
|
@@ -193,6 +207,15 @@ define_ruby_enum!(
|
|
|
193
207
|
Opera129,
|
|
194
208
|
Opera130,
|
|
195
209
|
Opera131,
|
|
210
|
+
Opera132,
|
|
211
|
+
Opera133,
|
|
212
|
+
Opera134,
|
|
213
|
+
Opera135,
|
|
214
|
+
Opera136,
|
|
215
|
+
Opera137,
|
|
216
|
+
Opera138,
|
|
217
|
+
Opera139,
|
|
218
|
+
Opera140,
|
|
196
219
|
);
|
|
197
220
|
|
|
198
221
|
// Defines constant registration, `into_ffi`/`from_ffi`, and handlers for
|