Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ChromeOption '--safebrowsing-disable-download-protection' doesn't disables the download warning in Chrome version 67.x

I am trying to use Selenium webdriver to automate some of the work. My automation includes downloading some .msg outlook email file from the web attached by somebody else. Downloading the .msg file prompted a warning from Chrome saying "This type of file can harm the computer...". Using the ChromeOptions to add argument --safebrowsing-disable-download-protection does not work, the download still prompted the warning with the argument added into the chrome options, any help will be appreciated.

Code trial:

from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--safebrowsing-disable-download-protection')
driver = webdriver.Chrome(chrome_options=chrome_options)

printing the chrome_options.arguments shows that the '--safebrowsing-disable-download-protection' is added into the arguments, but when I started to download the .msg files using Selenium, I still receive the same warning.

Something to note, when i manually run chrome.exe via cmd using the '--safebrowsing-disable-download-protection', downloading without warning works.

like image 328
ReverseEngineer Avatar asked Jul 18 '18 14:07

ReverseEngineer


1 Answers

As per your code trials as you are trying to implement --safebrowsing-disable-download-protection through ChromeOptions() but it is worth to mention the following points:

  • As per Remove kSbDisableDownloadProtection flag to make download safebrowsing protect a default behavior --safebrowsing-disable-download-protection is supposed to be cleaned up as a command flag to make download safebrowsing protect a default behavior.
  • The fix was dependent on Replace safe browsing DB and update protocol with Pver4 which was marked as fixed as no issues have been reported since full launch.
  • Subsequently Remove kSbDisableDownloadProtection flag to make download safebrowsing protect a default behavior was also marked as fixed.
  • The fix Enable PVer4 by default for desktop platforms establishes the fact that the ChromeOption --safebrowsing-disable-download-protection is no more effective.

Conclusion

As per the points mentioned above the ChromeOption --safebrowsing-disable-download-protection is no more an effective/valid ChromeOption and should be handled by PVer4 by default for desktop platforms.

like image 99
undetected Selenium Avatar answered Sep 28 '22 12:09

undetected Selenium