简体   繁体   中英

How to remove the message Browser is under remote control from Firefox using Selenium

I want to remove this machine icon while running firefox using selenium using python3

火狐消息

Here is my code:-

from selenium import webdriver
from webdriver_manager.firefox import GeckoDriverManager
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
profile = webdriver.FirefoxProfile('C:\\Users\\you\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\64nrwj2y.default-release')
PROXY_HOST = "87.255.27.163"
PROXY_PORT = "3128"
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36'
profile.set_preference("general.useragent.override", user_agent)
profile.set_preference("network.proxy.type", 1)
profile.set_preference("network.proxy.http", PROXY_HOST)
profile.set_preference("network.proxy.http_port", int(PROXY_PORT))
profile.set_preference("dom.webdriver.enabled", False)
profile.set_preference('useAutomationExtension', False)
options=webdriver.firefox.options.Options()
profile.update_preferences()
desired = webdriver.DesiredCapabilities.FIREFOX
binary = FirefoxBinary('D:\\Mozilla Firefoxy\\firefox.exe')
driver = webdriver.Firefox(firefox_binary=binary, firefox_profile=profile, executable_path=GeckoDriverManager().install(), desired_capabilities=desired)
driver.get('https://stackoverflow.com')

But it keeps showing like this.

As per the Abstract section of WebDriver W3C Specification WebDriver is a remote control interface that enables introspection and control of user agents. It provides a platform independent and language neutral wire protocol as a way for out-of-process programs to remotely instruct the behavior of web browsers.

WebDriver provides us a set of interfaces to discover and manipulate DOM elements in web documents and to control the behavior of a user agent. It is primarily intended to allow to write tests that automate a user agent from a separate controlling process and also be used in such a way as to allow in-browser scripts to control a separate browser.

Further, in the Security section of the specification also mentions that it was suggested that user agents make an effort to visually distinguish a user agent session that is under control of WebDriver from those used for normal browsing sessions. This can be done through a browser chrome element such as a door hanger , colorful decoration of the OS window, or some widget element that is prevalent in the window so that it easy to identify automation windows.

This feature is implemented in through the Robot icon along with the tool tip which reads "Browser is under remote control"

浏览器被远程控制

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM