Skip to content

Commit 69f0264

Browse files
authored
Merge pull request #87 from kayqueGovetri/FIX/smart-screen-protection
2 parents 26376d7 + c2322a7 commit 69f0264

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

botcity/web/browsers/edge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def default_options(headless=False, download_folder_path=None, user_data_dir=Non
4444
edge_options.add_argument("--disable-syncdisable-translate")
4545
edge_options.add_argument("--metrics-recording-only")
4646
edge_options.add_argument("--safebrowsing-disable-auto-update")
47-
47+
edge_options.add_argument("--disable-features=msSmartScreenProtection")
4848
edge_options.add_argument("--disable-blink-features=AutomationControlled")
4949

5050
# Disable banner for Browser being remote-controlled

tests/test_browser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,3 +294,9 @@ def test_print_pdf(web: WebBot, tmp_folder):
294294

295295
assert os.path.exists(pdf)
296296
os.remove(pdf)
297+
298+
299+
def test_disable_smart_screen(web: WebBot):
300+
web.browse('https://nav.smartscreen.msft.net/other/malware.html')
301+
h1 = web.find_element(by=By.XPATH, selector='/html/body/div/h1')
302+
assert h1.text.lower() == 'this is a demonstration malware website'

0 commit comments

Comments
 (0)