How can I manage websites settings in electron

∥☆過路亽.° 提交于 2021-01-29 04:11:03

问题


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:

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.

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?

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)

来源:https://stackoverflow.com/questions/61075597/how-can-i-manage-websites-settings-in-electron

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!