Skip to content

Commit f3c1ab6

Browse files
committed
Update the UC Mode patcher
1 parent bad65f1 commit f3c1ab6

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

seleniumbase/undetected/patcher.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ def gen_random_cdc():
178178
def is_binary_patched(self, executable_path=None):
179179
executable_path = executable_path or self.executable_path
180180
with io.open(executable_path, "rb") as fh:
181-
if b"window.cdc_adoQpoasnfa76pfcZLmcfl_" in fh.read():
181+
if re.search(
182+
b"window.cdc_adoQpoasnfa76pfcZLmcfl_"
183+
b"(Array|Promise|Symbol|Object|Proxy)",
184+
fh.read()
185+
):
182186
return False
183187
return True
184188

@@ -198,21 +202,18 @@ def gen_call_function_js_cache_name(match):
198202
with io.open(self.executable_path, "r+b") as fh:
199203
file_bin = fh.read()
200204
file_bin = re.sub(
201-
b"window\\.cdc_[a-zA-Z0-9]{22}_(Array|Promise|Symbol)"
202-
b" = window\\.(Array|Promise|Symbol);",
205+
b"window\\.cdc_[a-zA-Z0-9]{22}_"
206+
b"(Array|Promise|Symbol|Object|Proxy)"
207+
b" = window\\.(Array|Promise|Symbol|Object|Proxy);",
203208
gen_js_whitespaces,
204209
file_bin,
205210
)
206211
file_bin = re.sub(
207-
b"window\\.cdc_[a-zA-Z0-9]{22}_(Array|Promise|Symbol) \\|\\|",
212+
b"window\\.cdc_[a-zA-Z0-9]{22}_"
213+
b"(Array|Promise|Symbol|Object|Proxy) \\|\\|",
208214
gen_js_whitespaces,
209215
file_bin,
210216
)
211-
file_bin = re.sub(
212-
b"window\\.cdc_[a-zA-Z0-9]{22}_(Array|Promise|Symbol)",
213-
b"window\\.ccd_adoQpoasnaf67pfcZLmcfl_(Array|Promise|Symbol)",
214-
file_bin,
215-
)
216217
file_bin = re.sub(
217218
b"'\\$cdc_[a-zA-Z0-9]{22}_';",
218219
gen_call_function_js_cache_name,

0 commit comments

Comments
 (0)