disable nofitivation but allow to popup.

master
Max 2023-09-01 13:02:39 +08:00 committed by GitHub
parent 7d7d693a2c
commit 9bc7b62c88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -380,6 +380,8 @@ def get_chrome_options(webdriver_path, adblock_plus_enable, browser="chrome", he
chrome_options.add_argument('--lang=zh-TW') chrome_options.add_argument('--lang=zh-TW')
chrome_options.add_argument('--disable-web-security') chrome_options.add_argument('--disable-web-security')
chrome_options.add_argument("--no-sandbox"); chrome_options.add_argument("--no-sandbox");
chrome_options.add_argument("--disable-popup-blocking")
chrome_options.add_argument("--disable-notifications")
# for navigator.webdriver # for navigator.webdriver
chrome_options.add_experimental_option("excludeSwitches", ['enable-automation']) chrome_options.add_experimental_option("excludeSwitches", ['enable-automation'])
@ -543,6 +545,8 @@ def get_uc_options(uc, config_dict, webdriver_path):
options.add_argument('--lang=zh-TW') options.add_argument('--lang=zh-TW')
options.add_argument('--disable-web-security') options.add_argument('--disable-web-security')
options.add_argument("--no-sandbox"); options.add_argument("--no-sandbox");
options.add_argument("--disable-popup-blocking")
options.add_argument("--disable-notifications")
options.add_argument("--password-store=basic") options.add_argument("--password-store=basic")
options.add_experimental_option("prefs", {"credentials_enable_service": False, "profile.password_manager_enabled": False, "translate":{"enabled": False}}) options.add_experimental_option("prefs", {"credentials_enable_service": False, "profile.password_manager_enabled": False, "translate":{"enabled": False}})