Page 1 of 1

WebViewGadget and certificates

Posted: Wed Feb 14, 2024 10:06 am
by AndyMK
Hi, is there a way to bypass a certificate error warning when opening a page hosted on a local server?

Re: Webviewgaget and certificates

Posted: Wed Feb 14, 2024 10:34 am
by AndyMK

Code: Select all

OpenWindow(0, 100, 100, 400, 400, "Hello", #PB_Window_SystemMenu)

WebViewGadget(0, 0, 0, 400, 400)
SetGadgetText(0, "https://192.168.1.1")

WebViewExecuteScript(0, ~"document.querySelector('#details-button').click()");
Delay(500)
WebViewExecuteScript(0, ~"var proceedLink = document.getElementById('proceed-link');");
WebViewExecuteScript(0, ~"proceedLink.click();");

Repeat 
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
This works and takes me to a login page. Is there a way to avoid the Delay(500) ?

Re: Webviewgaget and certificates

Posted: Wed Feb 14, 2024 10:52 am
by AndyMK
Once the login page is loaded,

Code: Select all

WebViewExecuteScript(0, ~"document.getElementById('username').value = 'test';")
does not fill the field although the same command works from the dev tools in the browser. Do i need to detect when the page is fully loaded?