WebViewGadget and certificates

Just starting out? Need help? Post your questions and find answers here.
AndyMK
Enthusiast
Enthusiast
Posts: 582
Joined: Wed Jul 12, 2006 4:38 pm
Location: UK

WebViewGadget and certificates

Post by AndyMK »

Hi, is there a way to bypass a certificate error warning when opening a page hosted on a local server?
Last edited by AndyMK on Wed Feb 14, 2024 3:16 pm, edited 2 times in total.
AndyMK
Enthusiast
Enthusiast
Posts: 582
Joined: Wed Jul 12, 2006 4:38 pm
Location: UK

Re: Webviewgaget and certificates

Post 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) ?
AndyMK
Enthusiast
Enthusiast
Posts: 582
Joined: Wed Jul 12, 2006 4:38 pm
Location: UK

Re: Webviewgaget and certificates

Post 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?
Post Reply