简体   繁体   English

用JS打开浏览器安全信息?

[英]Open browser security info with JS?

When I'm on https, the browser shows a secure icon in the address bar. 当我使用https时,浏览器会在地址栏中显示一个安全图标。 I can usually (depending on browser) click on this to see more info in a native popup. 我通常可以(取决于浏览器)点击此链接以查看原生弹出窗口中的更多信息。

See chromes implementation here: https://www.dropbox.com/s/0w62tc6oaj63knp/Screenshot%202015-12-30%2014.01.53.png?dl=0 请参阅此处的chromes实现: https ://www.dropbox.com/s/0w62tc6oaj63knp/Scr​​eenshot%202015-12-30%2014.01.53.png?dl =0

Other browsers implement equivalent features. 其他浏览器实现等效功能。

I want to draw attention to the security of my site, by showing a picture of this icon by my "Buy" CTA, and something that says "Check for this secure icon in your browser". 我希望通过我的“购买”CTA显示此图标的图片以及“在浏览器中检查此安全图标”的内容,引起对我网站安全性的关注。 I want the more info section (as in the screenshot) to expand when my icon is clicked. 我希望在点击我的图标时展开更多信息部分(如屏幕截图所示)。

Is this possible? 这可能吗?

Apologies if question has already been answered, I tried to search but not sure if this info box has a name, so not sure what to search for. 抱歉,如果问题已经得到解答,我试图搜索但不确定此信息框是否有名称,因此不确定要搜索什么。

Thanks, David 谢谢,大卫

No it's not possible, sorry. 不,这不可能,抱歉。

Browsers let Javascript to interact with their core to certain level, but that's about it. 浏览器允许Javascript与其核心进行某种程度的交互,但这就是它。 window object provides many functions to interact with browser but opening "Site's Info popup" is not provided. window对象提供了许多与浏览器交互的功能,但未提供打开“站点信息弹出窗口”。

You can read about Mozilla and Chrome extensions and see they interact with the browser through JavaScript, but this is only inside extensions, signed scripts and scripts located on user's hard drives. 您可以阅读有关Mozilla和Chrome扩展程序的信息,并看到它们通过JavaScript与浏览器进行交互,但这只是位于用户硬盘驱动器上的扩展,签名脚本和脚本内部。

So if your application needs access to something the browser should ask the user its self or you could instruct the user on how to do this. 因此,如果您的应用程序需要访问某些内容,浏览器应该询问用户自己,或者您可以指示用户如何执行此操作。

I Hope it helps. 我希望它有所帮助。 :( :(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Safari浏览器中的JS window.open方法 - JS window.open method in Safari browser 如何在实习生js中打开新的浏览器窗口? - How to open new browser window in intern js? 我只想打开1个信息窗口-Google Maps API JS - I only want 1 info window open - Google Maps API JS 是否可以使用JS打开具有所需内容类型的浏览器窗口? - Is it possible to open a browser Window with desired content type using JS? 在JS中打开一个新窗口,但浏览器会自动自动向下滚动到底部 - Open a new window in JS but the browser is scrolled straight down to the bottom automatically 有什么方法可以使用node js从其他计算机打开浏览器吗? - Is there any way to open a browser from different machine using node js? Angular js $ window.open无法在移动浏览器的.success中工作 - Angular js $window.open not working in .success for mobile browser Node.js:如果使用 Pupeteer 打开,则关闭浏览器 - Node.js: close browser if its open using Pupeteer 如何使service-worker.js在浏览器上执行? - How to make a service-worker.js to excecute on browser open? JS库收集浏览器端的性能信息(如YSlow或FireBug“ Net”?) - JS library to collect browser-side performance info (Like YSlow or FireBug “Net”?)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM