Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetDomWindow.frames #6

Open
p3rson101 opened this issue Sep 11, 2022 · 4 comments
Open

GetDomWindow.frames #6

p3rson101 opened this issue Sep 11, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@p3rson101
Copy link

When trying to access GetDOMWindow.frames.item(0) it states this is ambiguous since there is a property named the same is there anyway to update this so they are seperate names I am unable to get each frame due to this error.

@p3rson101
Copy link
Author

I’m trying to work around it but when I do the getDomDocument.getElementbyId(“iframeid”) and Assign to a DOMElement I can not get the document out of the element ? So that I can search the iframe document for specific ids.

@ITAgnesmeyer
Copy link
Owner

You're right, currently the frames property doesn't return a list of window items. You can only access an IFrame element by its ID. You cannot access the window object of the frame via this element. This will be implemented at a later date. However, you could use the webView1_FrameCreated event to pass your own objects to the frame and run your own scripts in the frame.
https://docs.microsoft.com/de-de/microsoft-edge/webview2/reference/win32/icorewebview2frame?view=webview2-1.0.1343.22#addhostobjecttoscriptwithorigins
https://docs.microsoft.com/de-de/microsoft-edge/webview2/reference/win32/icorewebview2frame2?view=webview2-1.0.1343.22#executescript

@ITAgnesmeyer ITAgnesmeyer added the enhancement New feature or request label Sep 12, 2022
@p3rson101
Copy link
Author

p3rson101 commented Sep 12, 2022

Ok would it be possible to get the src of the iframe and open a window using the src

@ITAgnesmeyer
Copy link
Owner

If you got the IFrame DOMElement you can call GetPorperty("srcdoc")
https://www.w3schools.com/tags/tag_iframe.asp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants