c#检查谷歌浏览器扩展程序 [英] c# check google chrome extension

查看:212
本文介绍了c#检查谷歌浏览器扩展程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在谷歌找不到任何相关的问题/解决方案,在这里试试我的运气。

我想检查用户是否已经安装了Chrome扩展程序。在这里,我有2个想法。



1.使用后面的代码直接检查他们的chrome扩展,我不确定它是否可能。如果您有任何代码,请与我们分享:)



i cannot find any related question/solution at google, trying my luck here.
i want to check either user already install the chrome extension or not. here by i got 2 ideas.

1. Use code behind directly check their chrome's extension, which i not sure it's possible or not. if any of you have the code, please share with us :)

System.Web.HttpBrowserCapabilities browser = Request.Browser;
if (browser.Browser == "chrome")
  {
    //check for extension, if not found, alert user; if found, ignore.
  }





2.使用javascript提醒消息用户。

确定将用户重定向到下载页面。

取消关闭对话框。通过这样做,用户会感到烦恼,因为即使用户已经安装了扩展程序,每次用户加载页面时都会显示该消息。



2-1。从2号想法中提升。系统存储已安装扩展的IP地址。如果在数据库中找不到ip地址,则显示对话框。问题是,哪个阶段应该系统存储ip地址?用户在对话框中按确定按钮后立即?用户手动更新字段?还是饼干? (我之前从未使用过cookies)。



请注意:)



2. Use javascript to alert the message to user.
"OK" to redirect the user to the download page.
"Cancel" to close the dialog box. By doing this, user will get annoying, because the message will appear everytime user load the page even they already install the extension.

2-1. enhance from idea No. 2. System store the ip address which already install the extension. if the ip address is not found inside the database, dialog box shown. problem is, which phase should system store the ip address? right after user press the "OK" button at dialog box? user manually update the field? or cookies? (i never used cookies before).

Please advice :)

推荐答案

有些可能在Firefox中使用Javascript扩展。

请参阅:

[CP]使用JavaScript检测Firefox扩展 [ ^ ]

[SO]网站可以检测正在使用的浏览器扩展程序吗? [ ^ ]

我不知道其他浏览器允许检测到一些(绝对不是全部)扩展



干杯,

Edo
It is possible for some extensions, using Javascript, in Firefox.
See:
[CP] Detecting a Firefox Extension Using JavaScript[^]
[SO] Can a Website detect what browser extensions are being used?[^]
I don't know of other browser allowing detection of some (and definitely not all) extensions

Cheers,
Edo


这篇关于c#检查谷歌浏览器扩展程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆