PowerShell Studio V5.4.145 64 bit
Win 7 (64)
Hi,
I'm trying to use an embedded webBrowser in my project so that I can use an intranet site to trigger tasks in my PowerShell (Studio) GUI. I've been using the WebBrowser Navigating and WebBrowser Navigated events and then parsing things such innerHtml / innerText etc. Unfortunately, in this particular situation, the Navigating and Navigated triggers occur at the wrong time (before the data that I want is presented by the website). So, is there a way that I can get the website author to send a trigger to the PowerShell GUI at the right time?
I've been experimenting myself with a webpage that adds and removes controls and attempts to resize the browser, but I don't seem to be able to get a trigger.
Any suggestions greatfully received.
Thanks
Embedded webBrowser triggers
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Embedded webBrowser triggers
[TOPIC MOVED TO POWERSHELL GUIS FORUM BY MODERATOR]
You will need to use the DocumentCompleted event handler. This event is called after the page is completed loaded.
You will need to use the DocumentCompleted event handler. This event is called after the page is completed loaded.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Embedded webBrowser triggers
Hi,
Thanks for the reply. Unfortunately, the DocumentCompleted event handler doesn't trigger at the required point either. I think because the webpage is largely JavaScript based the user interaction doesn't generate those triggers. It would be great if a trigger could be initiated from JavaScript (even if it involved creating an invisble control, resizing the page or something) but I don't know if that's possible. I tried a simple webpage which did those things, but I couldn't seem to get a trigger. I'm not a web / JS coder though.
Thanks for the reply. Unfortunately, the DocumentCompleted event handler doesn't trigger at the required point either. I think because the webpage is largely JavaScript based the user interaction doesn't generate those triggers. It would be great if a trigger could be initiated from JavaScript (even if it involved creating an invisble control, resizing the page or something) but I don't know if that's possible. I tried a simple webpage which did those things, but I couldn't seem to get a trigger. I'm not a web / JS coder though.
Re: Embedded webBrowser triggers
Ajax pages will not load as expected into a browser control. if the pages require interaction then there is little that you can do. In some cases you can call "Click" on a control but most modern web sites do not allow this because the main page intercepts only actual clicks generated by a mouse and all programmatic "Clicks" are thrown away.