dimanche 24 novembre 2019

How to prevent users marking text/images on HTML pages displayed with PS webbrowser object?

This is a way to prevent users marking text or images on a HTML webpage:

<script language="JavaScript1.2">
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>

If I display a webpage with Powershell,

$web = New-object System.Windows.Forms.webbrowser
$web.navigate("https://example.com/example.html")

I would the Javascript function (above) doesn't work.

How do I get the same result, that users cannot mark text or images on this webpage? (I can also use the existing PS script if there's a solution.)

Thank you for your help!




Aucun commentaire:

Enregistrer un commentaire