webview questions

Post Reply
User avatar
Silvio.Falconi
Posts: 7235
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 16 times

webview questions

Post by Silvio.Falconi »

I wish ask

if I can no show the menu when I click on html as

Image

I can use the command

Code: Select all | Expand

:InjectJavascript( "document.addEventListener('contextmenu', function(e) { if (e.target.tagName !== 'A') { e.preventDefault(); } });" )
and seems run ok obviously it is set so that if the mouse clicks on a link it executes it without problems


For ugrade html
is there a comand or I must call allways the command oApp():oDashboard:SetHtml( Html() )
or I can simulate ctrl+R ? as there is on menu ?
I can use f5 or

Code: Select all | Expand

:InjectJavascript( "document.addEventListener('keydown', function(e) { if (e.key === 'F5') { e.preventDefault(); window.location.reload(); } }); function refreshPage() { window.location.reload(); } document.addEventListener('DOMContentLoaded', function() { var refreshAreas = document.getElementsByClassName('refresh-area'); for (var i = 0; i < refreshAreas.length; i++) { refreshAreas[i].addEventListener('click', function() { refreshPage(); }); } });" )
any suggestions ?

SetUserAgent( cUserAgent )

How use this ? is there a sample test ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
cnavarro
Posts: 6605
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Has thanked: 6 times
Been thanked: 8 times

Re: webview questions

Post by cnavarro »

SetUserAgent

Look this topic
viewtopic.php?p=278605#p278605
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
Silvio.Falconi
Posts: 7235
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 16 times

Re: webview questions

Post by Silvio.Falconi »

cnavarro wrote: Mon Mar 31, 2025 12:13 am SetUserAgent

Look this topic
viewtopic.php?p=278605#p278605
Cris ¿qué debería hacer este agente? ¿Cual es su función?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
cnavarro
Posts: 6605
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Has thanked: 6 times
Been thanked: 8 times

Re: webview questions

Post by cnavarro »

Silvio, te remito a la documentacion oficial, pero en algunos casos es muy util
https://developer.mozilla.org/en-US/doc ... User-Agent
El User-Agent es un encabezado HTTP que los navegadores (u otros clientes HTTP) envían al servidor web para identificar el dispositivo, sistema operativo, navegador y versión que está realizando la solicitud. Este encabezado permite que el servidor adapte su respuesta según las capacidades del cliente.
Gracias al encabezado que se envia con el user-agent puedes determinar el comportamiento de la aplicacion, son muchas las utilidades que tiene.
The User-Agent is an HTTP header that browsers (or other HTTP clients) send to the web server to identify the device, operating system, browser, and version making the request. This header allows the server to tailor its response based on the client's capabilities.
Thanks to the header sent with the user-agent, you can determine the application's behavior, and it has many uses.
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Post Reply