mardi 7 avril 2020

How can I manage websites settings in electron

I'm creating a browser using Electron. And it opens websites using webview.

<webview id="View" useragent="..." src="https://example.com/" plugins="" preload="file/dir/webview.js" webpreferences="..." enableremotemodule="false" allowpopups=""></webview>

Now I've got a question, how can I detect when a website is trying to request access to something using JS/Node? The explanation of my question:

enter image description here

Every website in chrome has its own settings, and they can be access by clicking Site settings in the page info window (look up in the picture) or by going to chrome://settings/content/siteDetails.

enter image description here And the website settings include whether it can or can't access the user location, use the microphone, use JavaScript, Senf Notifications, etc. How can I control those settings of websites in electron? enter image description here

And how can I detect when a website is trying to gain access to one of those permissions? (just like how Wexond does, Wexond is a browser that is built using Electron)




Aucun commentaire:

Enregistrer un commentaire