From 2e5b9729813015b28b273b5ad0c8c663808b9591 Mon Sep 17 00:00:00 2001 From: 0x676e67 Date: Wed, 27 May 2026 13:33:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(emulate):=20Add=20Chrome/Edge=20148?= =?UTF-8?q?=EF=BC=8COpera=20131=EF=BC=8CSafari=2026-2/4,=20Firefox=20150-1?= =?UTF-8?q?51?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 28 ++++++++++++++-------------- README.md | 2 +- lib/wreq_ruby/emulate.rb | 12 ++++++++++++ src/emulate.rs | 15 +++++++++++++++ 4 files changed, 42 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d49fce7..1ed14e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -254,9 +254,9 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" dependencies = [ "proc-macro2", "quote", @@ -265,9 +265,9 @@ dependencies = [ [[package]] name = "either" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] name = "encoding_rs" @@ -444,9 +444,9 @@ dependencies = [ [[package]] name = "http" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +checksum = "8be7462df143984c4598a256ef469b251d7d7f9e271135073e78fc535414f3d0" dependencies = [ "bytes", "itoa", @@ -717,9 +717,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.8.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8" [[package]] name = "mime" @@ -1010,9 +1010,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.149" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" dependencies = [ "itoa", "memchr", @@ -1287,9 +1287,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.10" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68d6fdd9f81c2819c9a8b0e0cd91660e7746a8e6ea2ba7c6b2b057985f6bcb51" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" dependencies = [ "async-compression", "bitflags", @@ -1481,7 +1481,7 @@ checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "wreq" version = "6.0.0-rc.28" -source = "git+https://github.com/0x676e67/wreq#e8781fba28269e91ed4480189c56fbeb6743aeb3" +source = "git+https://github.com/0x676e67/wreq#28b29c018b1b2f26cdd09c9d4158110186b6f7f9" dependencies = [ "btls", "btls-sys", @@ -1574,7 +1574,7 @@ dependencies = [ [[package]] name = "wreq-util" version = "3.0.0-rc.10" -source = "git+https://github.com/0x676e67/wreq-util#a568b26f3d3a44380ef59c07308ae7a4ad965fc9" +source = "git+https://github.com/0x676e67/wreq-util#2453a53d99e079f38be942fb6cd570c3cd6fdc9d" dependencies = [ "brotli", "flate2", diff --git a/README.md b/README.md index 4ca68ad..746007d 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ require "wreq" # Build a client client = Wreq::Client.new(emulation: Wreq::Emulation.new( - profile: Wreq::Profile::Chrome147, + profile: Wreq::Profile::Chrome148, platform: Wreq::Platform::MacOS, http2: true, headers: true diff --git a/lib/wreq_ruby/emulate.rb b/lib/wreq_ruby/emulate.rb index 36fa06d..6f9bb95 100644 --- a/lib/wreq_ruby/emulate.rb +++ b/lib/wreq_ruby/emulate.rb @@ -56,6 +56,8 @@ class Profile Chrome145 = nil Chrome146 = nil Chrome147 = nil + Chrome148 = nil + Edge101 = nil Edge122 = nil Edge127 = nil @@ -74,6 +76,8 @@ class Profile Edge145 = nil Edge146 = nil Edge147 = nil + Edge148 = nil + Firefox109 = nil Firefox117 = nil Firefox128 = nil @@ -92,6 +96,9 @@ class Profile Firefox147 = nil Firefox148 = nil Firefox149 = nil + Firefox150 = nil + Firefox151 = nil + SafariIos17_2 = nil SafariIos17_4_1 = nil SafariIos16_5 = nil @@ -115,10 +122,13 @@ class Profile Safari26 = nil Safari26_1 = nil Safari26_2 = nil + Safari26_3 = nil + Safari26_4 = nil SafariIos26 = nil SafariIos26_2 = nil SafariIPad26 = nil SafariIpad26_2 = nil + OkHttp3_9 = nil OkHttp3_11 = nil OkHttp3_13 = nil @@ -127,6 +137,7 @@ class Profile OkHttp4_10 = nil OkHttp4_12 = nil OkHttp5 = nil + Opera116 = nil Opera117 = nil Opera118 = nil @@ -142,6 +153,7 @@ class Profile Opera128 = nil Opera129 = nil Opera130 = nil + Opera131 = nils end unless method_defined?(:to_s) diff --git a/src/emulate.rs b/src/emulate.rs index 1e03399..74ac079 100644 --- a/src/emulate.rs +++ b/src/emulate.rs @@ -48,6 +48,7 @@ define_ruby_enum!( Chrome145, Chrome146, Chrome147, + Chrome148, Edge101, Edge122, @@ -67,6 +68,7 @@ define_ruby_enum!( Edge145, Edge146, Edge147, + Edge148, Firefox109, Firefox117, @@ -86,6 +88,8 @@ define_ruby_enum!( Firefox147, Firefox148, Firefox149, + Firefox150, + Firefox151, SafariIos17_2, SafariIos17_4_1, @@ -110,6 +114,8 @@ define_ruby_enum!( Safari26, Safari26_1, Safari26_2, + Safari26_3, + Safari26_4, SafariIos26, SafariIos26_2, SafariIPad26, @@ -139,6 +145,7 @@ define_ruby_enum!( Opera128, Opera129, Opera130, + Opera131, ); define_ruby_enum!( @@ -253,6 +260,8 @@ pub fn include(ruby: &Ruby, gem_module: &RModule) -> Result<(), Error> { profile.const_set("Chrome145", Profile::Chrome145)?; profile.const_set("Chrome146", Profile::Chrome146)?; profile.const_set("Chrome147", Profile::Chrome147)?; + profile.const_set("Chrome148", Profile::Chrome148)?; + profile.const_set("Edge101", Profile::Edge101)?; profile.const_set("Edge122", Profile::Edge122)?; profile.const_set("Edge127", Profile::Edge127)?; @@ -271,6 +280,7 @@ pub fn include(ruby: &Ruby, gem_module: &RModule) -> Result<(), Error> { profile.const_set("Edge145", Profile::Edge145)?; profile.const_set("Edge146", Profile::Edge146)?; profile.const_set("Edge147", Profile::Edge147)?; + profile.const_set("Edge148", Profile::Edge148)?; profile.const_set("Firefox109", Profile::Firefox109)?; profile.const_set("Firefox117", Profile::Firefox117)?; @@ -290,6 +300,8 @@ pub fn include(ruby: &Ruby, gem_module: &RModule) -> Result<(), Error> { profile.const_set("Firefox147", Profile::Firefox147)?; profile.const_set("Firefox148", Profile::Firefox148)?; profile.const_set("Firefox149", Profile::Firefox149)?; + profile.const_set("Firefox150", Profile::Firefox150)?; + profile.const_set("Firefox151", Profile::Firefox151)?; profile.const_set("SafariIos17_2", Profile::SafariIos17_2)?; profile.const_set("SafariIos17_4_1", Profile::SafariIos17_4_1)?; @@ -314,6 +326,8 @@ pub fn include(ruby: &Ruby, gem_module: &RModule) -> Result<(), Error> { profile.const_set("Safari26", Profile::Safari26)?; profile.const_set("Safari26_1", Profile::Safari26_1)?; profile.const_set("Safari26_2", Profile::Safari26_2)?; + profile.const_set("Safari26_3", Profile::Safari26_3)?; + profile.const_set("Safari26_4", Profile::Safari26_4)?; profile.const_set("SafariIos26", Profile::SafariIos26)?; profile.const_set("SafariIos26_2", Profile::SafariIos26_2)?; profile.const_set("SafariIPad26", Profile::SafariIPad26)?; @@ -343,6 +357,7 @@ pub fn include(ruby: &Ruby, gem_module: &RModule) -> Result<(), Error> { profile.const_set("Opera128", Profile::Opera128)?; profile.const_set("Opera129", Profile::Opera129)?; profile.const_set("Opera130", Profile::Opera130)?; + profile.const_set("Opera131", Profile::Opera131)?; // Platform enum binding let platform = gem_module.define_class("Platform", ruby.class_object())?;