简体   繁体   中英

Detecting a browser addon using JavaScript or C#?

We are writing a website in C#, and we need to detect if the client's browser has a certain (custom developed) add-on installed.

We have figured out a way how to do it when the client is using Firefox or Internet Explorer. How can we do the same with Safari and Chrome?

Since addons have permission to modify DOM
using the add-on you can inject some javascript variable(eg var IsMyAddonNameInstalled = 'true' ) into the DOM when your website is requested from browser
and then pass it to server using AJAX request or hidden input field .

PS: This will work on all browsers

You can add your Addon name to User-Agent variable of your browser (by modyfing this value in browser settings store, open about:config in URL for Firefox). Then you can read it back from Request object.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM