o
    ҷh                    @  sv  d dl mZ ddlmZmZ d dlmZ d dlZd dlZddl	m
Z
 ddl	mZ ddl	mZ dd	l	mZ dd
l	mZ ddl	mZ G dd deZeG dd dZeG dd dZeG dd dZeG dd dZG dd deZG dd dejZeG dd dZeG dd dZG dd dejZeG d d! d!ZeG d"d# d#ZeG d$d% d%ZeG d&d' d'ZeG d(d) d)Z eG d*d+ d+Z!eG d,d- d-Z"G d.d/ d/ejZ#G d0d1 d1ejZ$eG d2d3 d3Z%eG d4d5 d5Z&G d6d7 d7ejZ'dQd<d=Z(	dRdSdAdBZ)dTdDdEZ*				dUdVdNdOZ+	dRdWdPdQZ,dTdRdSZ-dTdTdUZ.dTdVdWZ/		dXdYd[d\Z0dZd_d`Z1dTdadbZ2dTdcddZ3d[dfdgZ4d\didjZ5d]dldmZ6d^dodpZ7d_drdsZ8d`dudvZ9dadxdyZ:dTdzd{Z;dbd}d~Z<dcddZ=	dRddddZ>				dUdeddZ?dfddZ@																dgdhddZA		dXdiddZBdjddZCdjddZDdkddZE		dXdlddZFdmddZGdmddZH								dndodd̈́ZIdpdd҄ZJdqddՄZKdrdd؄ZLdsddۄZM	dRdtdd߄ZN			dudvddZOdmddZP	dRdwddZQ					dxdyddZRdTddZSdTddZTdTddZUdzddZVdTddZWdmddZXd{ddZYdTdd ZZ	dRd|ddZ[dTddZ\dmddZ]ed	eG d
d dZ^edeG dd dZ_edeG dd dZ`edeG dd dZaedeG dd dZbedeG dd dZcedeG dd dZdedeG dd  d Zeed!eG d"d# d#Zfed$eG d%d& d&Zged'eG d(d) d)Zhed*eG d+d, d,Zied-eG d.d/ d/Zjed0eG d1d2 d2Zked3eG d4d5 d5Zled6eG d7d8 d8Zmed9eG d:d; d;Zned<eG d=d> d>Zoed?eG d@dA dAZpedBeG dCdD dDZqedEeG dFdG dGZredHeG dIdJ dJZsedKeG dLdM dMZtedNeG dOdP dPZudS (}      )annotations   )event_classT_JSON_DICT)	dataclassN)debugger)dom)	emulation)io)network)runtimec                      8   e Zd ZdZdddZedddZ fd	d
Z  ZS )FrameIdz"
    Unique frame identifier.
    returnstrc                 C     | S N selfr   r   ^/var/www/html/venv/lib/python3.10/site-packages/selenium/webdriver/common/devtools/v85/page.pyto_json      zFrameId.to_jsonjsonc                 C     | |S r   r   clsr   r   r   r   	from_json      zFrameId.from_jsonc                      d t  S )NzFrameId({})formatsuper__repr__r   	__class__r   r   r#         zFrameId.__repr__r   r   )r   r   r   r   	__name__
__module____qualname____doc__r   classmethodr   r#   __classcell__r   r   r$   r   r          
r   c                   @  s~   e Zd ZU dZded< ded< ded< ded< ded	< d
Zded< d
Zded< d
Zded< d
Zded< dd Z	e
dd Zd
S )Framez2
    Information about the Frame on the page.
    r   id_network.LoaderId	loader_idr   urlsecurity_origin	mime_typeNtyping.Optional[str]	parent_idnameurl_fragmentunreachable_urlc                 C  s   t  }| j |d< | j |d< | j|d< | j|d< | j|d< | jd ur*| j|d< | jd ur4| j|d< | j	d ur>| j	|d< | j
d urH| j
|d	< |S )
NidloaderIdr4   securityOriginmimeTypeparentIdr9   urlFragmentunreachableUrl)dictr1   r   r3   r4   r5   r6   r8   r9   r:   r;   r   r   r   r   r   r   C   s   










zFrame.to_jsonc                 C  s   | t |d tj|d t|d t|d t|d d|v r't|d nd d|v r2t|d nd d|v r=t|d nd d	|v rJt|d	 d
	S d d
	S )Nr<   r=   r4   r>   r?   r@   r9   rA   rB   )	r1   r3   r4   r5   r6   r8   r9   r:   r;   )r   r   r   LoaderIdr   r   r   r   r   r   T   s   


	zFrame.from_json)r)   r*   r+   r,   __annotations__r8   r9   r:   r;   r   r-   r   r   r   r   r   r0   #   s   
 r0   c                   @  sn   e Zd ZU dZded< ded< ded< dZded	< dZd
ed< dZded< dZded< dd Z	e
dd ZdS )FrameResourcez5
    Information about the Resource on the page.
    r   r4   znetwork.ResourceTypetype_r6   N'typing.Optional[network.TimeSinceEpoch]last_modifiedtyping.Optional[float]content_sizetyping.Optional[bool]failedcanceledc                 C  s   t  }| j|d< | j |d< | j|d< | jd ur | j |d< | jd ur*| j|d< | jd ur4| j|d< | jd ur>| j|d< |S )Nr4   typer?   lastModifiedcontentSizerN   rO   )	rC   r4   rH   r   r6   rJ   rL   rN   rO   rD   r   r   r   r   }   s   








zFrameResource.to_jsonc              
   C  s   | t |d tj|d t |d d|v rtj|d nd d|v r)t|d nd d|v r4t|d nd d|v rAt|d dS d dS )	Nr4   rP   r?   rQ   rR   rN   rO   )r4   rH   r6   rJ   rL   rN   rO   )r   r   ResourceTyper   TimeSinceEpochfloatboolr   r   r   r   r      s   

zFrameResource.from_json)r)   r*   r+   r,   rF   rJ   rL   rN   rO   r   r-   r   r   r   r   r   rG   c   s   
 rG   c                   @  sB   e Zd ZU dZded< ded< dZded< d	d
 Zedd ZdS )FrameResourceTreezR
    Information about the Frame hierarchy along with their cached resources.
    r0   frameztyping.List[FrameResource]	resourcesNz/typing.Optional[typing.List[FrameResourceTree]]child_framesc                 C  sJ   t  }| j |d< dd | jD |d< | jd ur#dd | jD |d< |S )NrX   c                 S     g | ]}|  qS r   r   .0ir   r   r   
<listcomp>       z-FrameResourceTree.to_json.<locals>.<listcomp>rY   c                 S  r[   r   r\   r]   r   r   r   r`      ra   childFrames)rC   rX   r   rY   rZ   rD   r   r   r   r      s   
zFrameResourceTree.to_jsonc                 C  sD   | t |d dd |d D d|v rdd |d D dS d dS )NrX   c                 S     g | ]}t |qS r   )rG   r   r]   r   r   r   r`          z/FrameResourceTree.from_json.<locals>.<listcomp>rY   rb   c                 S  rc   r   rW   r   r]   r   r   r   r`      rd   )rX   rY   rZ   r0   r   r   r   r   r   r      s   zFrameResourceTree.from_json	r)   r*   r+   r,   rF   rZ   r   r-   r   r   r   r   r   rW      s   
 rW   c                   @  s:   e Zd ZU dZded< dZded< dd Zed	d
 ZdS )	FrameTreez0
    Information about the Frame hierarchy.
    r0   rX   Nz'typing.Optional[typing.List[FrameTree]]rZ   c                 C  s6   t  }| j |d< | jd urdd | jD |d< |S )NrX   c                 S  r[   r   r\   r]   r   r   r   r`      ra   z%FrameTree.to_json.<locals>.<listcomp>rb   )rC   rX   r   rZ   rD   r   r   r   r      s
   
zFrameTree.to_jsonc                 C  s4   | t |d d|v rdd |d D dS d dS )NrX   rb   c                 S  rc   r   rh   r   r]   r   r   r   r`      rd   z'FrameTree.from_json.<locals>.<listcomp>)rX   rZ   rf   r   r   r   r   r      s   zFrameTree.from_jsonrg   r   r   r   r   rh      s   
 rh   c                      r   )ScriptIdentifierz#
    Unique script identifier.
    r   r   c                 C  r   r   r   r   r   r   r   r      r   zScriptIdentifier.to_jsonr   c                 C  r   r   r   r   r   r   r   r      r   zScriptIdentifier.from_jsonc                   r   )NzScriptIdentifier({})r    r   r$   r   r   r#      r&   zScriptIdentifier.__repr__r'   )r   r   r   rj   r(   r   r   r$   r   rj      r/   rj   c                   @  sX   e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdd Zedd ZdS )TransitionTypez
    Transition type.
    linktypedaddress_barauto_bookmarkauto_subframemanual_subframe	generatedauto_toplevelform_submitreloadkeywordkeyword_generatedotherc                 C     | j S r   valuer   r   r   r   r         zTransitionType.to_jsonc                 C  r   r   r   r   r   r   r   r      r   zTransitionType.from_jsonN)r)   r*   r+   r,   LINKTYPEDADDRESS_BARAUTO_BOOKMARKAUTO_SUBFRAMEMANUAL_SUBFRAME	GENERATEDAUTO_TOPLEVELFORM_SUBMITRELOADKEYWORDKEYWORD_GENERATEDOTHERr   r-   r   r   r   r   r   rk      s$    rk   c                   @  sN   e Zd ZU dZded< ded< ded< ded< ded	< d
d Zedd ZdS )NavigationEntryz#
    Navigation history entry.
    intr1   r   r4   user_typed_urltitlerk   transition_typec                 C  s@   t  }| j|d< | j|d< | j|d< | j|d< | j |d< |S )Nr<   r4   userTypedURLr   transitionType)rC   r1   r4   r   r   r   r   rD   r   r   r   r     s   



zNavigationEntry.to_jsonc              	   C  s<   | t |d t|d t|d t|d t|d dS )Nr<   r4   r   r   r   )r1   r4   r   r   r   )r   r   rk   r   r   r   r   r   r     s   



zNavigationEntry.from_jsonNr)   r*   r+   r,   rF   r   r-   r   r   r   r   r   r         
 	r   c                   @  sb   e Zd ZU dZded< ded< ded< ded< ded< ded< d	Zd
ed< dd Zedd Zd	S )ScreencastFrameMetadataz$
    Screencast frame metadata.
    rU   
offset_toppage_scale_factordevice_widthdevice_heightscroll_offset_xscroll_offset_yNrI   	timestampc                 C  s^   t  }| j|d< | j|d< | j|d< | j|d< | j|d< | j|d< | jd ur-| j |d< |S )N	offsetToppageScaleFactordeviceWidthdeviceHeightscrollOffsetXscrollOffsetYr   )	rC   r   r   r   r   r   r   r   r   rD   r   r   r   r   =  s   






zScreencastFrameMetadata.to_jsonc                 C  sb   | t |d t |d t |d t |d t |d t |d d|v r-tj|d dS d dS )	Nr   r   r   r   r   r   r   )r   r   r   r   r   r   r   )rU   r   rT   r   r   r   r   r   r   I  s   





z!ScreencastFrameMetadata.from_json)	r)   r*   r+   r,   rF   r   r   r-   r   r   r   r   r   r   #  s   
 r   c                   @  s4   e Zd ZdZdZdZdZdZdd Ze	dd	 Z
d
S )
DialogTypez!
    Javascript dialog type.
    alertconfirmpromptbeforeunloadc                 C  ry   r   rz   r   r   r   r   r   _  r|   zDialogType.to_jsonc                 C  r   r   r   r   r   r   r   r   b  r   zDialogType.from_jsonN)r)   r*   r+   r,   ALERTCONFIRMPROMPTBEFOREUNLOADr   r-   r   r   r   r   r   r   V  s    r   c                   @  sF   e Zd ZU dZded< ded< ded< ded< dd	 Zed
d ZdS )AppManifestErrorz*
    Error while paring app manifest.
    r   messager   criticallinecolumnc                 C  2   t  }| j|d< | j|d< | j|d< | j|d< |S )Nr   r   r   r   )rC   r   r   r   r   rD   r   r   r   r   x     



zAppManifestError.to_jsonc                 C  s0   | t |d t|d t|d t|d dS )Nr   r   r   r   )r   r   r   r   )r   r   r   r   r   r   r        



zAppManifestError.from_jsonNr   r   r   r   r   r   g     
 r   c                   @  s.   e Zd ZU dZded< dd Zedd ZdS )	AppManifestParsedPropertiesz)
    Parsed app manifest properties.
    r   scopec                 C  s   t  }| j|d< |S )Nr   )rC   r   rD   r   r   r   r     s   
z#AppManifestParsedProperties.to_jsonc                 C     | t |d dS )Nr   )r   r   r   r   r   r   r        
z%AppManifestParsedProperties.from_jsonNr   r   r   r   r   r     s   
 r   c                   @  sF   e Zd ZU dZded< ded< ded< ded< dd Zed	d
 ZdS )LayoutViewportz2
    Layout viewport position and dimensions.
    r   page_xpage_yclient_widthclient_heightc                 C  r   )NpageXpageYclientWidthclientHeight)rC   r   r   r   r   rD   r   r   r   r     r   zLayoutViewport.to_jsonc                 C  s0   | t |d t |d t |d t |d dS )Nr   r   r   r   )r   r   r   r   r   r   r   r   r   r     r   zLayoutViewport.from_jsonNr   r   r   r   r   r     r   r   c                   @  sj   e Zd ZU dZded< ded< ded< ded< ded< ded< ded	< d
Zded< dd Zedd Zd
S )VisualViewportz:
    Visual viewport position, dimensions, and scale.
    rU   offset_xoffset_yr   r   r   r   scaleNrK   zoomc                 C  sd   t  }| j|d< | j|d< | j|d< | j|d< | j|d< | j|d< | j|d< | jd ur0| j|d< |S )	NoffsetXoffsetYr   r   r   r   r   r   )	rC   r   r   r   r   r   r   r   r   rD   r   r   r   r     s   








zVisualViewport.to_jsonc                 C  sh   | t |d t |d t |d t |d t |d t |d t |d d|v r0t |d d	S d d	S )
Nr   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   rU   r   r   r   r   r     s   






zVisualViewport.from_json)	r)   r*   r+   r,   rF   r   r   r-   r   r   r   r   r   r     s   
 r   c                   @  sN   e Zd ZU dZded< ded< ded< ded< ded< dd	 Zed
d ZdS )Viewportz,
    Viewport for capturing screenshot.
    rU   xywidthheightr   c                 C  s<   t  }| j|d< | j|d< | j|d< | j|d< | j|d< |S )Nr   r   r   r   r   )rC   r   r   r   r   r   rD   r   r   r   r     s   




zViewport.to_jsonc                 C  s:   | t |d t |d t |d t |d t |d dS )Nr   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r     s   




zViewport.from_jsonNr   r   r   r   r   r     r   r   c                   @  sz   e Zd ZU dZdZded< dZded< dZded< dZded< dZ	ded< dZ
ded	< dZded
< dd Zedd ZdS )FontFamiliesz+
    Generic font families collection.
    Nr7   standardfixedserif
sans_serifcursivefantasy
pictographc                 C  s   t  }| jd ur| j|d< | jd ur| j|d< | jd ur!| j|d< | jd ur+| j|d< | jd ur5| j|d< | jd ur?| j|d< | jd urI| j|d< |S )Nr   r   r   	sansSerifr   r   r   )rC   r   r   r   r   r   r   r   rD   r   r   r   r   ;  s    













zFontFamilies.to_jsonc              
   C  s   | d|v rt |d nd d|v rt |d nd d|v r!t |d nd d|v r,t |d nd d|v r7t |d nd d|v rBt |d nd d|v rOt |d dS d dS )	Nr   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   M  s   zFontFamilies.from_json)r)   r*   r+   r,   r   rF   r   r   r   r   r   r   r   r-   r   r   r   r   r   r   !  s   
 r   c                   @  s>   e Zd ZU dZdZded< dZded< dd Zedd	 Z	dS )
	FontSizesz
    Default font sizes.
    Ntyping.Optional[int]r   r   c                 C  s2   t  }| jd ur| j|d< | jd ur| j|d< |S )Nr   r   )rC   r   r   rD   r   r   r   r   e  r   zFontSizes.to_jsonc                 C  s8   | d|v rt |d nd d|v rt |d dS d dS )Nr   r   )r   r   r   r   r   r   r   r   m  s   zFontSizes.from_json)
r)   r*   r+   r,   r   rF   r   r   r-   r   r   r   r   r   r   Z  s   
 r   c                   @  s@   e Zd ZdZdZdZdZdZdZdZ	dZ
d	d
 Zedd ZdS )ClientNavigationReasonformSubmissionGetformSubmissionPosthttpHeaderRefreshscriptInitiatedmetaTagRefreshpageBlockInterstitialru   anchorClickc                 C  ry   r   rz   r   r   r   r   r     r|   zClientNavigationReason.to_jsonc                 C  r   r   r   r   r   r   r   r     r   z ClientNavigationReason.from_jsonN)r)   r*   r+   FORM_SUBMISSION_GETFORM_SUBMISSION_POSTHTTP_HEADER_REFRESHSCRIPT_INITIATEDMETA_TAG_REFRESHPAGE_BLOCK_INTERSTITIALr   ANCHOR_CLICKr   r-   r   r   r   r   r   r   u  s    r   c                   @  s0   e Zd ZdZdZdZdZdd Zedd Z	d	S )
ClientNavigationDisposition
currentTabnewTab	newWindowdownloadc                 C  ry   r   rz   r   r   r   r   r     r|   z#ClientNavigationDisposition.to_jsonc                 C  r   r   r   r   r   r   r   r     r   z%ClientNavigationDisposition.from_jsonN)
r)   r*   r+   CURRENT_TABNEW_TAB
NEW_WINDOWDOWNLOADr   r-   r   r   r   r   r   r     s    r   c                   @  s2   e Zd ZU ded< ded< dd Zedd ZdS )	InstallabilityErrorArgumentr   r9   r{   c                 C  s   t  }| j|d< | j|d< |S )Nr9   r{   )rC   r9   r{   rD   r   r   r   r     s   

z#InstallabilityErrorArgument.to_jsonc                 C     | t |d t |d dS )Nr9   r{   )r9   r{   r   r   r   r   r   r        

z%InstallabilityErrorArgument.from_jsonN)r)   r*   r+   rF   r   r-   r   r   r   r   r   r     s   
 r   c                   @  s6   e Zd ZU dZded< ded< dd Zedd	 Zd
S )InstallabilityErrorz"
    The installability error
    r   error_idz(typing.List[InstallabilityErrorArgument]error_argumentsc                 C  s(   t  }| j|d< dd | jD |d< |S )NerrorIdc                 S  r[   r   r\   r]   r   r   r   r`     ra   z/InstallabilityError.to_json.<locals>.<listcomp>errorArguments)rC   r   r   rD   r   r   r   r     s   
zInstallabilityError.to_jsonc                 C  s"   | t |d dd |d D dS )Nr   c                 S  rc   r   )r   r   r]   r   r   r   r`     rd   z1InstallabilityError.from_json.<locals>.<listcomp>r   )r   r   r   r   r   r   r   r     s   
zInstallabilityError.from_jsonNr   r   r   r   r   r     s   
 r   c                   @  sD   e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
d Zedd ZdS )ReferrerPolicyz7
    The referring-policy used for the navigation.
    
noReferrernoReferrerWhenDowngradeoriginoriginWhenCrossOrigin
sameOriginstrictOriginstrictOriginWhenCrossOrigin	unsafeUrlc                 C  ry   r   rz   r   r   r   r   r     r|   zReferrerPolicy.to_jsonc                 C  r   r   r   r   r   r   r   r     r   zReferrerPolicy.from_jsonN)r)   r*   r+   r,   NO_REFERRERNO_REFERRER_WHEN_DOWNGRADEORIGINORIGIN_WHEN_CROSS_ORIGINSAME_ORIGINSTRICT_ORIGINSTRICT_ORIGIN_WHEN_CROSS_ORIGIN
UNSAFE_URLr   r-   r   r   r   r   r   r     s    r   script_sourcer   r   <typing.Generator[T_JSON_DICT, T_JSON_DICT, ScriptIdentifier]c                 c  s.    t  }| |d< d|d}|V }t|d S )z
    Deprecated, please use addScriptToEvaluateOnNewDocument instead.

    **EXPERIMENTAL**

    :param script_source:
    :returns: Identifier of the added script.
    scriptSourcezPage.addScriptToEvaluateOnLoadmethodparams
identifierrC   rj   r   )r  r  cmd_dictr   r   r   r   add_script_to_evaluate_on_load  s   r  source
world_namer7   c                 c  s>    t  }| |d< |dur||d< d|d}|V }t|d S )a  
    Evaluates given script in every frame upon creation (before loading frame's scripts).

    :param source:
    :param world_name: **(EXPERIMENTAL)** *(Optional)* If specified, creates an isolated world with the given name and evaluates given script in it. This world name will be used as the ExecutionContextDescription::name when the corresponding event is emitted.
    :returns: Identifier of the added script.
    r  N	worldNamez%Page.addScriptToEvaluateOnNewDocumentr  r  r  )r  r  r  r  r   r   r   r   &add_script_to_evaluate_on_new_document  s   r  0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]c                  c      ddi} | V }dS )z/
    Brings page to front (activates tab).
    r  zPage.bringToFrontNr   r  r   r   r   r   bring_to_front     
r  format_qualityr   cliptyping.Optional[Viewport]from_surfacerM   /typing.Generator[T_JSON_DICT, T_JSON_DICT, str]c                 c  sh    t  }| dur| |d< |dur||d< |dur| |d< |dur&||d< d|d}|V }t|d S )	a  
    Capture page screenshot.

    :param format_: *(Optional)* Image compression format (defaults to png).
    :param quality: *(Optional)* Compression quality from range [0..100] (jpeg only).
    :param clip: *(Optional)* Capture the screenshot of a given region only.
    :param from_surface: **(EXPERIMENTAL)** *(Optional)* Capture the screenshot from the surface, rather than the view. Defaults to true.
    :returns: Base64-encoded image data.
    Nr!   r  r   fromSurfacezPage.captureScreenshotr  data)rC   r   r   )r  r  r   r"  r  r  r   r   r   r   capture_screenshot  s   r&  c                 c  s4    t  }| dur| |d< d|d}|V }t|d S )a"  
    Returns a snapshot of the page as a string. For MHTML format, the serialization includes
    iframes, shadow DOM, external resources, and element-inline styles.

    **EXPERIMENTAL**

    :param format_: *(Optional)* Format (defaults to mhtml).
    :returns: Serialized page data.
    Nr!   zPage.captureSnapshotr  r%  )rC   r   )r  r  r  r   r   r   r   capture_snapshot/  s   r'  c                  c  r  )zE
    Clears the overridden device metrics.

    **EXPERIMENTAL**
    r  zPage.clearDeviceMetricsOverrideNr   r  r   r   r   clear_device_metrics_overrideF     
r(  c                  c  r  )zI
    Clears the overridden Device Orientation.

    **EXPERIMENTAL**
    r  z#Page.clearDeviceOrientationOverrideNr   r  r   r   r   !clear_device_orientation_overrideR  r)  r*  c                  c  r  )z?
    Clears the overridden Geolocation Position and Error.
    r  zPage.clearGeolocationOverrideNr   r  r   r   r   clear_geolocation_override^  r  r+  frame_idgrant_univeral_accessFtyping.Generator[T_JSON_DICT, T_JSON_DICT, runtime.ExecutionContextId]c                 c  sT    t  }|  |d< |dur||d< |dur||d< d|d}|V }tj|d S )a  
    Creates an isolated world for the given frame.

    :param frame_id: Id of the frame in which the isolated world should be created.
    :param world_name: *(Optional)* An optional name which is reported in the Execution Context.
    :param grant_univeral_access: *(Optional)* Whether or not universal access should be granted to the isolated world. This is a powerful option, use with caution.
    :returns: Execution context of the isolated world.
    frameIdNr  grantUniveralAccesszPage.createIsolatedWorldr  executionContextId)rC   r   r   ExecutionContextIdr   )r,  r  r-  r  r  r   r   r   r   create_isolated_worldh  s   r3  cookie_namer4   c                 c  ,    t  }| |d< ||d< d|d}|V }dS )z
    Deletes browser cookie with given name, domain and path.

    **EXPERIMENTAL**

    :param cookie_name: Name of the cookie to remove.
    :param url: URL to match cooke domain and path.
    
cookieNamer4   zPage.deleteCookier  NrC   )r4  r4   r  r  r   r   r   r   delete_cookie  s   
r8  c                  c  r  )z-
    Disables page domain notifications.
    r  zPage.disableNr   r  r   r   r   disable  r  r9  c                  c  r  )z,
    Enables page domain notifications.
    r  zPage.enableNr   r  r   r   r   enable  r  r:  typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[str, typing.List[AppManifestError], typing.Optional[str], typing.Optional[AppManifestParsedProperties]]]c                  c  s^    ddi} | V }t |d dd |d D d|v rt |d ndd	|v r,t|d	 fS dfS )
z


    :returns: A tuple with the following items:

        0. **url** - Manifest location.
        1. **errors** - 
        2. **data** - *(Optional)* Manifest content.
        3. **parsed** - *(Optional)* Parsed manifest properties
    r  zPage.getAppManifestr4   c                 S  rc   r   )r   r   r]   r   r   r   r`     rd   z$get_app_manifest.<locals>.<listcomp>errorsr%  Nparsed)r   r   r   r  r   r   r   get_app_manifest  s   
r>  Ltyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[InstallabilityError]]c                  c  "    ddi} | V }dd |d D S ),


    **EXPERIMENTAL**

    :returns: 
    r  zPage.getInstallabilityErrorsc                 S  rc   r   )r   r   r]   r   r   r   r`     rd   z-get_installability_errors.<locals>.<listcomp>installabilityErrorsr   r  r   r   r   get_installability_errors  s
   	rC  @typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Optional[str]]c                  c  s(    ddi} | V }d|v rt |d S dS )rA  r  zPage.getManifestIconsprimaryIconNr   r  r   r   r   get_manifest_icons  s
   	rF  Gtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[network.Cookie]]c                  c  r@  )z
    Returns all browser cookies. Depending on the backend support, will return detailed cookie
    information in the ``cookies`` field.

    **EXPERIMENTAL**

    :returns: Array of cookie objects.
    r  zPage.getCookiesc                 S     g | ]}t j|qS r   )r   Cookier   r]   r   r   r   r`         zget_cookies.<locals>.<listcomp>cookiesr   r  r   r   r   get_cookies  s
   
rL  5typing.Generator[T_JSON_DICT, T_JSON_DICT, FrameTree]c                  c      ddi} | V }t |d S )z\
    Returns present frame tree structure.

    :returns: Present frame tree structure.
    r  zPage.getFrameTree	frameTreeri   r  r   r   r   get_frame_tree  s
   rP  btyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[LayoutViewport, VisualViewport, dom.Rect]]c                  c  s:    ddi} | V }t |d t|d tj|d fS )aY  
    Returns metrics relating to the layouting of the page, such as viewport bounds/scale.

    :returns: A tuple with the following items:

        0. **layoutViewport** - Metrics relating to the layout viewport.
        1. **visualViewport** - Metrics relating to the visual viewport.
        2. **contentSize** - Size of scrollable area.
    r  zPage.getLayoutMetricslayoutViewportvisualViewportrR   )r   r   r   r   Rectr  r   r   r   get_layout_metrics  s   rU  [typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[int, typing.List[NavigationEntry]]]c                  c  s.    ddi} | V }t |d dd |d D fS )z
    Returns navigation history for the current page.

    :returns: A tuple with the following items:

        0. **currentIndex** - Index of the current navigation history entry.
        1. **entries** - Array of navigation history entries.
    r  zPage.getNavigationHistorycurrentIndexc                 S  rc   r   )r   r   r]   r   r   r   r`   #  rd   z*get_navigation_history.<locals>.<listcomp>entriesr   r  r   r   r   get_navigation_history  s   

rY  c                  c  r  )z9
    Resets navigation history for the current page.
    r  zPage.resetNavigationHistoryNr   r  r   r   r   reset_navigation_history'  r  rZ  Ctyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[str, bool]]c                 c  sD    t  }|  |d< ||d< d|d}|V }t|d t|d fS )aT  
    Returns content of the given resource.

    **EXPERIMENTAL**

    :param frame_id: Frame id to get resource for.
    :param url: URL of the resource to get content for.
    :returns: A tuple with the following items:

        0. **content** - Resource content.
        1. **base64Encoded** - True, if content was served as base64.
    r/  r4   zPage.getResourceContentr  contentbase64Encoded)rC   r   r   rV   )r,  r4   r  r  r   r   r   r   get_resource_content1  s   

r^  =typing.Generator[T_JSON_DICT, T_JSON_DICT, FrameResourceTree]c                  c  rN  )z
    Returns present frame / resource tree structure.

    **EXPERIMENTAL**

    :returns: Present frame / resource tree structure.
    r  zPage.getResourceTreerO  re   r  r   r   r   get_resource_treeO  s
   	r`  acceptrV   prompt_textc                 c  4    t  }| |d< |dur||d< d|d}|V }dS )a,  
    Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).

    :param accept: Whether to accept or dismiss the dialog.
    :param prompt_text: *(Optional)* The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog.
    ra  N
promptTextzPage.handleJavaScriptDialogr  r7  )ra  rb  r  r  r   r   r   r   handle_java_script_dialog^  s   

re  referrerr   typing.Optional[TransitionType]typing.Optional[FrameId]referrer_policytyping.Optional[ReferrerPolicy]ztyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[FrameId, typing.Optional[network.LoaderId], typing.Optional[str]]]c                 c  s    t  }| |d< |dur||d< |dur| |d< |dur$| |d< |dur.| |d< d|d}|V }t|d d	|v rHtj|d	 ndd
|v rTt|d
 fS dfS )a  
    Navigates current page to the given URL.

    :param url: URL to navigate the page to.
    :param referrer: *(Optional)* Referrer URL.
    :param transition_type: *(Optional)* Intended transition type.
    :param frame_id: *(Optional)* Frame id to navigate, if not specified navigates the top frame.
    :param referrer_policy: **(EXPERIMENTAL)** *(Optional)* Referrer-policy used for the navigation.
    :returns: A tuple with the following items:

        0. **frameId** - Frame id that has navigated (or failed to navigate)
        1. **loaderId** - *(Optional)* Loader identifier.
        2. **errorText** - *(Optional)* User friendly error message, present if and only if navigation has failed.
    r4   Nrf  r   r/  referrerPolicyzPage.navigater  r=   	errorText)rC   r   r   r   r   rE   r   )r4   rf  r   r,  ri  r  r  r   r   r   r   navigates  s*   rn  entry_idr   c                 c  $    t  }| |d< d|d}|V }dS )zy
    Navigates current page to the given history entry.

    :param entry_id: Unique id of the entry to navigate to.
    entryIdzPage.navigateToHistoryEntryr  Nr7  )ro  r  r  r   r   r   r   navigate_to_history_entry  s   
rr  	landscapedisplay_header_footerprint_backgroundr   rK   paper_widthpaper_height
margin_topmargin_bottommargin_leftmargin_rightpage_rangesignore_invalid_page_rangesheader_templatefooter_templateprefer_css_page_sizetransfer_mode_typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[str, typing.Optional[io.StreamHandle]]]c                 c  sB   t  }| dur| |d< |dur||d< |dur||d< |dur$||d< |dur,||d< |dur4||d< |dur<||d< |durD||d	< |durL||d
< |	durT|	|d< |
dur\|
|d< |durd||d< |durl||d< |durt||d< |dur|||d< |dur||d< d|d}|V }t|d d|v rtj|d fS dfS )a  
    Print page as PDF.

    :param landscape: *(Optional)* Paper orientation. Defaults to false.
    :param display_header_footer: *(Optional)* Display header and footer. Defaults to false.
    :param print_background: *(Optional)* Print background graphics. Defaults to false.
    :param scale: *(Optional)* Scale of the webpage rendering. Defaults to 1.
    :param paper_width: *(Optional)* Paper width in inches. Defaults to 8.5 inches.
    :param paper_height: *(Optional)* Paper height in inches. Defaults to 11 inches.
    :param margin_top: *(Optional)* Top margin in inches. Defaults to 1cm (~0.4 inches).
    :param margin_bottom: *(Optional)* Bottom margin in inches. Defaults to 1cm (~0.4 inches).
    :param margin_left: *(Optional)* Left margin in inches. Defaults to 1cm (~0.4 inches).
    :param margin_right: *(Optional)* Right margin in inches. Defaults to 1cm (~0.4 inches).
    :param page_ranges: *(Optional)* Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
    :param ignore_invalid_page_ranges: *(Optional)* Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.
    :param header_template: *(Optional)* HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: - ```date````: formatted print date - ````title````: document title - ````url````: document location - ````pageNumber````: current page number - ````totalPages````: total pages in the document  For example, ````<span class=title></span>```` would generate span containing the title.
    :param footer_template: *(Optional)* HTML template for the print footer. Should use the same format as the ````headerTemplate````.
    :param prefer_css_page_size: *(Optional)* Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
    :param transfer_mode: **(EXPERIMENTAL)** *(Optional)* return as stream
    :returns: A tuple with the following items:

        0. **data** - Base64-encoded pdf data. Empty if `` returnAsStream` is specified.
        1. **stream** - *(Optional)* A handle of the stream that holds resulting PDF data.
    Nrs  displayHeaderFooterprintBackgroundr   
paperWidthpaperHeight	marginTopmarginBottom
marginLeftmarginRight
pageRangesignoreInvalidPageRangesheaderTemplatefooterTemplatepreferCSSPageSizetransferModezPage.printToPDFr  r%  stream)rC   r   r
   StreamHandler   )rs  rt  ru  r   rv  rw  rx  ry  rz  r{  r|  r}  r~  r  r  r  r  r  r   r   r   r   print_to_pdf  sV   *
r  ignore_cachescript_to_evaluate_on_loadc                 c  s<    t  }| dur| |d< |dur||d< d|d}|V }dS )an  
    Reloads given page optionally ignoring the cache.

    :param ignore_cache: *(Optional)* If true, browser cache is ignored (as if the user pressed Shift+refresh).
    :param script_to_evaluate_on_load: *(Optional)* If set, the script will be injected into all frames of the inspected page after reload. Argument will be ignored if reloading dataURL origin.
    NignoreCachescriptToEvaluateOnLoadzPage.reloadr  r7  )r  r  r  r  r   r   r   r   ru     s   

ru   r  c                 c  (    t  }|  |d< d|d}|V }dS )z{
    Deprecated, please use removeScriptToEvaluateOnNewDocument instead.

    **EXPERIMENTAL**

    :param identifier:
    r  z!Page.removeScriptToEvaluateOnLoadr  NrC   r   r  r  r  r   r   r   r   !remove_script_to_evaluate_on_load     

r  c                 c  r  )zE
    Removes given script from the list.

    :param identifier:
    r  z(Page.removeScriptToEvaluateOnNewDocumentr  Nr  r  r   r   r   )remove_script_to_evaluate_on_new_document.  s   
r  
session_idc                 c  rp  )z
    Acknowledges that a screencast frame has been received by the frontend.

    **EXPERIMENTAL**

    :param session_id: Frame number.
    	sessionIdzPage.screencastFrameAckr  Nr7  )r  r  r  r   r   r   r   screencast_frame_ack?     

r  querycase_sensitiveis_regexMtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[debugger.SearchMatch]]c                 c  sf    t  }|  |d< ||d< ||d< |dur||d< |dur"||d< d|d}|V }d	d
 |d D S )a  
    Searches for given string in resource content.

    **EXPERIMENTAL**

    :param frame_id: Frame id for resource to search in.
    :param url: URL of the resource to search in.
    :param query: String to search for.
    :param case_sensitive: *(Optional)* If true, search is case sensitive.
    :param is_regex: *(Optional)* If true, treats string parameter as regex.
    :returns: List of search matches.
    r/  r4   r  NcaseSensitiveisRegexzPage.searchInResourcer  c                 S  rH  r   )r   SearchMatchr   r]   r   r   r   r`   r  rJ  z&search_in_resource.<locals>.<listcomp>resultr  )r,  r4   r  r  r  r  r  r   r   r   r   search_in_resourceR  s   r  enabledc                 c  rp  )z
    Enable Chrome's experimental ad filter on all sites.

    **EXPERIMENTAL**

    :param enabled: Whether to block ads.
    r  zPage.setAdBlockingEnabledr  Nr7  r  r  r  r   r   r   r   set_ad_blocking_enabledu  r  r  c                 c  rp  )z
    Enable page Content Security Policy by-passing.

    **EXPERIMENTAL**

    :param enabled: Whether to bypass page CSP.
    r  zPage.setBypassCSPr  Nr7  r  r   r   r   set_bypass_csp  r  r  r   r   device_scale_factorrU   mobilescreen_widthscreen_height
position_x
position_ydont_set_visible_sizescreen_orientation,typing.Optional[emulation.ScreenOrientation]viewportc                 c  s    t  }| |d< ||d< ||d< ||d< |dur||d< |dur$||d< |dur,||d< |dur4||d	< |dur<||d
< |	durD|	|d< |
durN|
 |d< |durX| |d< d|d}|V }dS )a  
    Overrides the values of device screen dimensions (window.screen.width, window.screen.height,
    window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media
    query results).

    **EXPERIMENTAL**

    :param width: Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
    :param height: Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
    :param device_scale_factor: Overriding device scale factor value. 0 disables the override.
    :param mobile: Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
    :param scale: *(Optional)* Scale to apply to resulting view image.
    :param screen_width: *(Optional)* Overriding screen width value in pixels (minimum 0, maximum 10000000).
    :param screen_height: *(Optional)* Overriding screen height value in pixels (minimum 0, maximum 10000000).
    :param position_x: *(Optional)* Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
    :param position_y: *(Optional)* Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
    :param dont_set_visible_size: *(Optional)* Do not set visible view size, rely upon explicit setVisibleSize call.
    :param screen_orientation: *(Optional)* Screen orientation override.
    :param viewport: *(Optional)* The viewport dimensions and scale. If not set, the override is cleared.
    r   r   deviceScaleFactorr  Nr   screenWidthscreenHeight	positionX	positionYdontSetVisibleSizescreenOrientationr  zPage.setDeviceMetricsOverrider  r  )r   r   r  r  r   r  r  r  r  r  r  r  r  r  r   r   r   r   set_device_metrics_override  s4   "
r  alphabetagammac                 c  s4    t  }| |d< ||d< ||d< d|d}|V }dS )z
    Overrides the Device Orientation.

    **EXPERIMENTAL**

    :param alpha: Mock alpha
    :param beta: Mock beta
    :param gamma: Mock gamma
    r  r  r  z!Page.setDeviceOrientationOverrider  Nr7  )r  r  r  r  r  r   r   r   r   set_device_orientation_override  s   
r  font_familiesc                 c  r  )z
    Set generic font families.

    **EXPERIMENTAL**

    :param font_families: Specifies font families to set. If a font family is not specified, it won't be changed.
    fontFamilieszPage.setFontFamiliesr  Nr  )r  r  r  r   r   r   r   set_font_families  r  r  
font_sizesc                 c  r  )z
    Set default font sizes.

    **EXPERIMENTAL**

    :param font_sizes: Specifies font sizes to set. If a font size is not specified, it won't be changed.
    	fontSizeszPage.setFontSizesr  Nr  )r  r  r  r   r   r   r   set_font_sizes  r  r  htmlc                 c  s0    t  }|  |d< ||d< d|d}|V }dS )z
    Sets given markup as the document's HTML.

    :param frame_id: Frame id to set HTML for.
    :param html: HTML content to set.
    r/  r  zPage.setDocumentContentr  Nr  )r,  r  r  r  r   r   r   r   set_document_content  s   

r  behaviordownload_pathc                 c  rc  )aT  
    Set the behavior when downloading a file.

    **EXPERIMENTAL**

    :param behavior: Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny).
    :param download_path: *(Optional)* The default path to save downloaded files to. This is requred if behavior is set to 'allow'
    r  NdownloadPathzPage.setDownloadBehaviorr  r7  )r  r  r  r  r   r   r   r   set_download_behavior,     
r  latitude	longitudeaccuracyc                 c  sL    t  }| dur| |d< |dur||d< |dur||d< d|d}|V }dS )a  
    Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position
    unavailable.

    :param latitude: *(Optional)* Mock latitude
    :param longitude: *(Optional)* Mock longitude
    :param accuracy: *(Optional)* Mock accuracy
    Nr  r  r  zPage.setGeolocationOverrider  r7  )r  r  r  r  r  r   r   r   r   set_geolocation_overrideC  s   
r  c                 c  rp  )z
    Controls whether page will emit lifecycle events.

    **EXPERIMENTAL**

    :param enabled: If true, starts emitting lifecycle events.
    r  zPage.setLifecycleEventsEnabledr  Nr7  r  r   r   r   set_lifecycle_events_enabled^  r  r  configurationc                 c  rc  )a   
    Toggles mouse event-based touch event emulation.

    **EXPERIMENTAL**

    :param enabled: Whether the touch event emulation should be enabled.
    :param configuration: *(Optional)* Touch/gesture events configuration. Default: current platform.
    r  Nr  zPage.setTouchEmulationEnabledr  r7  )r  r  r  r  r   r   r   r   set_touch_emulation_enabledq  r  r  	max_width
max_heightevery_nth_framec                 c  sl    t  }| dur| |d< |dur||d< |dur||d< |dur$||d< |dur,||d< d|d}|V }dS )	a  
    Starts sending each frame using the ``screencastFrame`` event.

    **EXPERIMENTAL**

    :param format_: *(Optional)* Image compression format.
    :param quality: *(Optional)* Compression quality from range [0..100].
    :param max_width: *(Optional)* Maximum screenshot width.
    :param max_height: *(Optional)* Maximum screenshot height.
    :param every_nth_frame: *(Optional)* Send every n-th frame.
    Nr!   r  maxWidth	maxHeighteveryNthFramezPage.startScreencastr  r7  )r  r  r  r  r  r  r  r   r   r   r   start_screencast  s    
r  c                  c  r  )zK
    Force the page stop all navigations and pending resource fetches.
    r  zPage.stopLoadingNr   r  r   r   r   stop_loading  r  r  c                  c  r  )zW
    Crashes renderer on the IO thread, generates minidumps.

    **EXPERIMENTAL**
    r  z
Page.crashNr   r  r   r   r   crash  r)  r  c                  c  r  )z\
    Tries to close page, running its beforeunload hooks, if any.

    **EXPERIMENTAL**
    r  z
Page.closeNr   r  r   r   r   close  r)  r  statec                 c  rp  )z
    Tries to update the web lifecycle state of the page.
    It will transition the page to the given state according to:
    https://github.com/WICG/web-lifecycle/

    **EXPERIMENTAL**

    :param state: Target lifecycle state
    r  zPage.setWebLifecycleStater  Nr7  )r  r  r  r   r   r   r   set_web_lifecycle_state     
r  c                  c  r  )zT
    Stops sending each frame in the ``screencastFrame``.

    **EXPERIMENTAL**
    r  zPage.stopScreencastNr   r  r   r   r   stop_screencast  r)  r  c                 c  rp  )z{
    Forces compilation cache to be generated for every subresource script.

    **EXPERIMENTAL**

    :param enabled:
    r  zPage.setProduceCompilationCacher  Nr7  r  r   r   r   set_produce_compilation_cache  r  r  r%  c                 c  r5  )z
    Seeds compilation cache for given url. Compilation cache does not survive
    cross-process navigation.

    **EXPERIMENTAL**

    :param url:
    :param data: Base64-encoded data
    r4   r%  zPage.addCompilationCacher  Nr7  )r4   r%  r  r  r   r   r   r   add_compilation_cache  s   
r  c                  c  r  )z@
    Clears seeded compilation cache.

    **EXPERIMENTAL**
    r  zPage.clearCompilationCacheNr   r  r   r   r   clear_compilation_cache  r)  r  r   groupc                 c  rc  )z
    Generates a report for testing.

    **EXPERIMENTAL**

    :param message: Message to be displayed in the report.
    :param group: *(Optional)* Specifies the endpoint group to deliver the report to.
    r   Nr  zPage.generateTestReportr  r7  )r   r  r  r  r   r   r   r   generate_test_report%  r  r  c                  c  r  )zt
    Pauses page execution. Can be resumed using generic Runtime.runIfWaitingForDebugger.

    **EXPERIMENTAL**
    r  zPage.waitForDebuggerNr   r  r   r   r   wait_for_debugger<  r)  r  c                 c  rp  )a  
    Intercept file chooser requests and transfer control to protocol clients.
    When file chooser interception is enabled, native file chooser dialog is not shown.
    Instead, a protocol event ``Page.fileChooserOpened`` is emitted.

    **EXPERIMENTAL**

    :param enabled:
    r  z"Page.setInterceptFileChooserDialogr  Nr7  r  r   r   r   !set_intercept_file_chooser_dialogH  r  r  zPage.domContentEventFiredc                   @  $   e Zd ZU ded< ed	ddZdS )
DomContentEventFirednetwork.MonotonicTimer   r   r   r   c                 C     | t j|d dS Nr   )r   r   MonotonicTimer   r   r   r   r   r   b     zDomContentEventFired.from_jsonN)r   r   r   r  r)   r*   r+   rF   r-   r   r   r   r   r   r  ]     
 r  zPage.fileChooserOpenedc                   @  8   e Zd ZU dZded< ded< ded< edddZdS )FileChooserOpenedzE
    Emitted only when ``page.interceptFileChooser`` is enabled.
    r   r,  zdom.BackendNodeIdbackend_node_idr   moder   r   r   c                 C  s,   | t |d tj|d t|d dS )Nr/  backendNodeIdr  )r,  r  r  )r   r   r   BackendNodeIdr   r   r   r   r   r   v  s
   
zFileChooserOpened.from_jsonN)r   r   r   r  r)   r*   r+   r,   rF   r-   r   r   r   r   r   r  i     
 r  zPage.frameAttachedc                   @  s8   e Zd ZU dZded< ded< ded< edd
dZdS )FrameAttachedz;
    Fired when frame has been attached to its parent.
    r   r,  parent_frame_idz#typing.Optional[runtime.StackTrace]stackr   r   r   c                 C  s>   | t |d t |d d|v rtj|d dS d dS )Nr/  parentFrameIdr  )r,  r  r  )r   r   r   
StackTracer   r   r   r   r     s   zFrameAttached.from_jsonN)r   r   r   r   r  r   r   r   r   r     r  r   z$Page.frameClearedScheduledNavigationc                   @  (   e Zd ZU dZded< ed
ddZd	S )FrameClearedScheduledNavigationz@
    Fired when frame no longer has a scheduled navigation.
    r   r,  r   r   r   c                 C     | t |d dS Nr/  )r,  r   r   r   r   r   r   r        z)FrameClearedScheduledNavigation.from_jsonN)r   r   r   r  r  r   r   r   r   r    
   
 r  zPage.frameDetachedc                   @  r  )FrameDetachedz=
    Fired when frame has been detached from its parent.
    r   r,  r   r   r   c                 C  r  r  r	  r   r   r   r   r     r
  zFrameDetached.from_jsonN)r   r   r   r  r  r   r   r   r   r    r  r  zPage.frameNavigatedc                   @  r  )FrameNavigatedzh
    Fired once navigation of the frame has completed. Frame is now associated with the new loader.
    r0   rX   r   r   r   c                 C  r  )NrX   )rX   rf   r   r   r   r   r     r
  zFrameNavigated.from_jsonN)r   r   r   r  r  r   r   r   r   r    r  r  zPage.frameResizedc                   @     e Zd ZdZedddZdS )	FrameResizedz
    **EXPERIMENTAL**


    r   r   r   c                 C     |  S r   r   r   r   r   r   r        zFrameResized.from_jsonN)r   r   r   r  r)   r*   r+   r,   r-   r   r   r   r   r   r    s    r  zPage.frameRequestedNavigationc                   @  @   e Zd ZU dZded< ded< ded< ded	< edddZdS )FrameRequestedNavigationz
    **EXPERIMENTAL**

    Fired when a renderer-initiated navigation is requested.
    Navigation may still be cancelled after the event is issued.
    r   r,  r   reasonr   r4   r   dispositionr   r   r   c                 C  s6   | t |d t|d t|d t|d dS )Nr/  r  r4   r  )r,  r  r4   r  )r   r   r   r   r   r   r   r   r   r     s   
z"FrameRequestedNavigation.from_jsonN)r   r   r   r  r  r   r   r   r   r    s   
 r  zPage.frameScheduledNavigationc                   @  r  )FrameScheduledNavigationz<
    Fired when frame schedules a potential navigation.
    r   r,  rU   delayr   r  r   r4   r   r   r   c                 C  s4   | t |d t|d t|d t|d dS )Nr/  r  r  r4   )r,  r  r  r4   )r   r   rU   r   r   r   r   r   r   r     s   

z"FrameScheduledNavigation.from_jsonN)r   r   r   r  r  r   r   r   r   r    s   
 r  zPage.frameStartedLoadingc                   @  r  )FrameStartedLoadingzE
    **EXPERIMENTAL**

    Fired when frame has started loading.
    r   r,  r   r   r   c                 C  r  r  r	  r   r   r   r   r     r
  zFrameStartedLoading.from_jsonN)r   r   r   r  r  r   r   r   r   r    
   
 r  zPage.frameStoppedLoadingc                   @  r  )FrameStoppedLoadingzE
    **EXPERIMENTAL**

    Fired when frame has stopped loading.
    r   r,  r   r   r   c                 C  r  r  r	  r   r   r   r   r   )  r
  zFrameStoppedLoading.from_jsonN)r   r   r   r  r  r   r   r   r   r    r  r  zPage.downloadWillBeginc                   @  s@   e Zd ZU dZded< ded< ded< ded< edddZdS )DownloadWillBeginzM
    **EXPERIMENTAL**

    Fired when page is about to start a download.
    r   r,  r   guidr4   suggested_filenamer   r   r   c                 C  s2   | t |d t|d t|d t|d dS )Nr/  r  r4   suggestedFilename)r,  r  r4   r  r   r   r   r   r   r   r   r   A  s   


zDownloadWillBegin.from_jsonN)r   r   r   r  r  r   r   r   r   r  0     
 r  zPage.downloadProgressc                   @  s@   e Zd ZU dZded< ded< ded< ded< edddZdS )DownloadProgresszc
    **EXPERIMENTAL**

    Fired when download makes progress. Last call has ``done`` == true.
    r   r  rU   total_bytesreceived_bytesr  r   r   r   c                 C  s0   | t |d t|d t|d t |d dS )Nr  
totalBytesreceivedBytesr  )r  r#  r$  r  )r   rU   r   r   r   r   r   \  r   zDownloadProgress.from_jsonN)r   r   r   r"  r  r   r   r   r   r"  K  r!  r"  zPage.interstitialHiddenc                   @  r  )	InterstitialHiddenz1
    Fired when interstitial page was hidden
    r   r   r   c                 C  r  r   r   r   r   r   r   r   n  r  zInterstitialHidden.from_jsonN)r   r   r   r'  r  r   r   r   r   r'  f      r'  zPage.interstitialShownc                   @  r  )	InterstitialShownz0
    Fired when interstitial page was shown
    r   r   r   c                 C  r  r   r   r   r   r   r   r   }  r  zInterstitialShown.from_jsonN)r   r   r   r)  r  r   r   r   r   r)  u  r(  r)  zPage.javascriptDialogClosedc                   @  0   e Zd ZU dZded< ded< edd	d
ZdS )JavascriptDialogClosedzs
    Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been
    closed.
    rV   r  r   
user_inputr   r   r   c                 C  s   | t |d t|d dS )Nr  	userInput)r  r,  )rV   r   r   r   r   r   r     r   z JavascriptDialogClosed.from_jsonN)r   r   r   r+  r  r   r   r   r   r+    s   
 r+  zPage.javascriptDialogOpeningc                   @  sH   e Zd ZU dZded< ded< ded< ded< d	ed
< edddZdS )JavascriptDialogOpeningzt
    Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to
    open.
    r   r4   r   r   rH   rV   has_browser_handlerr7   default_promptr   r   r   c                 C  sL   | t |d t |d t|d t|d d|v r"t |d dS d dS )Nr4   r   rP   hasBrowserHandlerdefaultPrompt)r4   r   rH   r/  r0  )r   r   r   rV   r   r   r   r   r     s   


z!JavascriptDialogOpening.from_jsonN)r   r   r   r.  r  r   r   r   r   r.    s   
 r.  zPage.lifecycleEventc                   @  r  )LifecycleEventzY
    Fired for top level page lifecycle events such as navigation, load, paint, etc.
    r   r,  r2   r3   r   r9   r  r   r   r   r   c                 C  s:   | t |d tj|d t|d tj|d dS )Nr/  r=   r9   r   )r,  r3   r9   r   )r   r   r   rE   r   r  r   r   r   r   r     s   
zLifecycleEvent.from_jsonN)r   r   r   r3  r  r   r   r   r   r3    s   
 r3  zPage.loadEventFiredc                   @  r  )
LoadEventFiredr  r   r   r   r   c                 C  r  r  r  r   r   r   r   r     r  zLoadEventFired.from_jsonN)r   r   r   r4  r  r   r   r   r   r4    r  r4  zPage.navigatedWithinDocumentc                   @  r*  )NavigatedWithinDocumentz
    **EXPERIMENTAL**

    Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation.
    r   r,  r   r4   r   r   r   c                 C  s   | t |d t|d dS )Nr/  r4   )r,  r4   r   r   r   r   r   r     s   
z!NavigatedWithinDocument.from_jsonN)r   r   r   r5  r  r   r   r   r   r5       
 r5  zPage.screencastFramec                   @  r  )ScreencastFramez[
    **EXPERIMENTAL**

    Compressed image data requested by the ``startScreencast``.
    r   r%  r   metadatar   r  r   r   r   c                 C  s(   | t |d t|d t|d dS )Nr%  r8  r  )r%  r8  r  )r   r   r   r   r   r   r   r   r     s
   

zScreencastFrame.from_jsonN)r   r   r   r7  r  r   r   r   r   r7    s   
 r7  z Page.screencastVisibilityChangedc                   @  r  )ScreencastVisibilityChangedzk
    **EXPERIMENTAL**

    Fired when the page with currently enabled screencast was shown or hidden .
    rV   visibler   r   r   c                 C  r   )Nr:  )r:  )rV   r   r   r   r   r   	  r   z%ScreencastVisibilityChanged.from_jsonN)r   r   r   r9  r  r   r   r   r   r9  	  r  r9  zPage.windowOpenc                   @  s@   e Zd ZU dZded< ded< ded< ded< edddZdS )
WindowOpenzq
    Fired when a new window is going to be opened, via window.open(), link click, form submission,
    etc.
    r   r4   window_nameztyping.List[str]window_featuresrV   user_gesturer   r   r   c                 C  s6   | t |d t |d dd |d D t|d dS )Nr4   
windowNamec                 S  s   g | ]}t |qS r   r   r]   r   r   r   r`   .	  ra   z(WindowOpen.from_json.<locals>.<listcomp>windowFeaturesuserGesture)r4   r<  r=  r>  )r   rV   r   r   r   r   r   )	  s   


zWindowOpen.from_jsonN)r   r   r   r;  r  r   r   r   r   r;  	  s   
 r;  zPage.compilationCacheProducedc                   @  s0   e Zd ZU dZded< ded< eddd	Zd
S )CompilationCacheProducedz
    **EXPERIMENTAL**

    Issued for every compilation cache generated. Is only available
    if Page.setGenerateCompilationCache is enabled.
    r   r4   r%  r   r   r   c                 C  r   )Nr4   r%  )r4   r%  r   r   r   r   r   r   @	  r   z"CompilationCacheProduced.from_jsonN)r   r   r   rB  r  r   r   r   r   rB  3	  r6  rB  )r  r   r   r  r   )r  r   r  r7   r   r  )r   r  )NNNN)
r  r7   r  r   r   r!  r"  rM   r   r#  )r  r7   r   r#  )NN)r,  r   r  r7   r-  rM   r   r.  )r4  r   r4   r   r   r  )r   r;  )r   r?  )r   rD  )r   rG  )r   rM  )r   rQ  )r   rV  )r,  r   r4   r   r   r[  )r   r_  )ra  rV   rb  r7   r   r  )r4   r   rf  r7   r   rg  r,  rh  ri  rj  r   rk  )ro  r   r   r  )NNNNNNNNNNNNNNNN)"rs  rM   rt  rM   ru  rM   r   rK   rv  rK   rw  rK   rx  rK   ry  rK   rz  rK   r{  rK   r|  r7   r}  rM   r~  r7   r  r7   r  rM   r  r7   r   r  )r  rM   r  r7   r   r  )r  rj   r   r  )r  r   r   r  )r,  r   r4   r   r  r   r  rM   r  rM   r   r  )r  rV   r   r  )NNNNNNNN)r   r   r   r   r  rU   r  rV   r   rK   r  r   r  r   r  r   r  r   r  rM   r  r  r  r!  r   r  )r  rU   r  rU   r  rU   r   r  )r  r   r   r  )r  r   r   r  )r,  r   r  r   r   r  )r  r   r  r7   r   r  )NNN)r  rK   r  rK   r  rK   r   r  )r  rV   r  r7   r   r  )NNNNN)r  r7   r  r   r  r   r  r   r  r   r   r  )r  r   r   r  )r4   r   r%  r   r   r  )r   r   r  r7   r   r  )v
__future__r   utilr   r   dataclassesr   enumtyping r   r   r	   r
   r   r   r   r   r0   rG   rW   rh   rj   Enumrk   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r&  r'  r(  r*  r+  r3  r8  r9  r:  r>  rC  rF  rL  rP  rU  rY  rZ  r^  r`  re  rn  rr  r  ru   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r"  r'  r)  r+  r.  r3  r4  r5  r7  r9  r;  rB  r   r   r   r   <module>   s  ?5'2""7'8!


+W#>$


