zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
U
\±dñ
ã@s†ddlZddlZddlmZddlmZddlmZddlm    Z    ddl
m Z e  e ¡ZdZdZdZGdd    „d    e ƒZGd
d „d eƒZdS) éN)Úutils)ÚDesiredCapabilities)Ú FirefoxBinary)ÚCommand)ÚRemoteConnectionÚcsHeZdZd ‡fdd„    Zddd„Zdd„Zed    d
„ƒZed d „ƒZ‡Z    S)ÚExtensionConnectionNécsŠ||_||_|}t|ƒ}|js&tƒ|_|s.d}t ¡}||j_|j ¡|j ¡|jj    |j|dd|›d|›d}t
ƒj |dddS)Nz    127.0.0.1)Útimeoutzhttp://ú:z/hubT)Ú
keep_alive) ÚprofileÚbinaryÚintrrZ    free_portÚportZupdate_preferencesÚ add_extensionZlaunch_browserÚsuperÚ__init__)ÚselfÚhostZfirefox_profileZfirefox_binaryr
ÚHOSTÚPORTÚ_URL©Ú    __class__©úfd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/firefox/extension_connection.pyr"s
 
zExtensionConnection.__init__cCs4| tjd|i¡| ¡r0t d¡t d¡qdS)NÚ    sessionIdzwaiting to quité)ÚexecuterZQUITÚis_connectableÚLOGGERÚinfoÚtimeÚsleep)rrrrrÚquit8s
zExtensionConnection.quitcCs| tjdtji¡S)z7Connects to the extension and retrieves the session id.ZdesiredCapabilities)rrZ NEW_SESSIONrZFIREFOX)rrrrÚconnect>szExtensionConnection.connectcCs| t›d¡dS)z4Connects to an running browser and quit immediately.z/extensions/firefox/quitN)Ú_requestr©ÚclsrrrÚconnect_and_quitBsz$ExtensionConnection.connect_and_quitcCst |jj¡dS)z>Tries to connect to the extension but do not retrieve context.N)rr r rr(rrrr Gsz"ExtensionConnection.is_connectable)Nr    )N)
Ú__name__Ú
__module__Ú __qualname__rr%r&Ú classmethodr*r Ú __classcell__rrrrr!s
 
rc@seZdZdZdS)ÚExtensionConnectionErrorziAn internal error occurred int the extension.
 
    Might be caused by bad input or bugs in webdriver
    N)r+r,r-Ú__doc__rrrrr0Msr0)Úloggingr#Zselenium.webdriver.commonrZ.selenium.webdriver.common.desired_capabilitiesrZ)selenium.webdriver.firefox.firefox_binaryrZ!selenium.webdriver.remote.commandrZ+selenium.webdriver.remote.remote_connectionrÚ    getLoggerr+r!rrrrÚ    Exceptionr0rrrrÚ<module>s     
,