au3WebDriver icon indicating copy to clipboard operation
au3WebDriver copied to clipboard

Shadowroot / Javascript question

Open Danp2 opened this issue 2 years ago • 8 comments

Today a Zul user on AutoIt forum asked for support here: https://www.autoitscript.com/forum/topic/205553-webdriver-udf-help-support-iii/?do=findComment&comment=1505239

it uses shadow roots. I have made some analysis and I comes to sucha a nice JS

document.querySelector("body > print-preview-app").shadowRoot.querySelector("#sidebar").shadowRoot.querySelector("print-preview-button-strip").shadowRoot.querySelector("div > cr-button.action-button")

image

Currently I wonder if this javascript snippet

document.querySelector("body > print-preview-app").shadowRoot.querySelector("#sidebar").shadowRoot.querySelector("print-preview-button-strip").shadowRoot.querySelector("div > cr-button.action-button")

will be handy in any way ?

_Originally posted by @mlipok in https://github.com/Danp2/au3WebDriver/issues/26

Danp2 avatar Jul 28 '22 19:07 Danp2

@mlipok Moved your comments here so that I can keep the other issue from becoming "over loaded". Hope you don't mind. 😃

Danp2 avatar Jul 28 '22 19:07 Danp2

You can assign this to me.

mlipok avatar Aug 24 '22 22:08 mlipok

@mlipok This appears related to #358. Can this one be closed?

Danp2 avatar Mar 03 '23 13:03 Danp2

Currently I wonder if this javascript snippet

document.querySelector("body > print-preview-app").shadowRoot.querySelector("#sidebar").shadowRoot.querySelector("print-preview-button-strip").shadowRoot.querySelector("div > cr-button.action-button")

will be handy in any way ?

I still wonder what you think about such JS usage in relation to using shadowRoot especially that ASAIK this is not possible with frames, especially to use JS to interact with nested frames from the main document level.

mlipok avatar Mar 03 '23 14:03 mlipok

@mlipok This appears related to #358. Can this one be closed?

lets stick them separate.

#325 is about _WD_ElementOptionSelect usage #353 is about JS usage

mlipok avatar Mar 03 '23 14:03 mlipok

some reading

https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot https://stackoverflow.com/a/34119775/5314940

mlipok avatar Mar 14 '23 13:03 mlipok

https://www.autoitscript.com/forum/topic/208640-webdriver-udf-help-support-iv/?do=findComment&comment=1515550

wondering if such readyState checking is possible:

document.querySelector("body > print-preview-app").shadowRoot.querySelector("#sidebar").shadowRoot.document.readyState

mlipok avatar Mar 23 '23 10:03 mlipok

wondering if such readyState checking is possible:

document.querySelector("body > print-preview-app").shadowRoot.querySelector("#sidebar").shadowRoot.document.readyState

hm... I rethink this case and I think it was not related. But maybe I'm wrong .

mlipok avatar Mar 23 '23 11:03 mlipok