简体   繁体   中英

Detect Firefox mixed content blocking with JavaScript or jQuery?

How do I detect Firefox's (or any browser's) mixed content blocking "feature" with JavaScript or jQuery?

More about Firefox's mixed content blocking: https://blog.mozilla.org/tanvi/2013/04/10/mixed-content-blocking-enabled-in-firefox-23/

The long story:

My company has a vendor that provides the online ordering part of our website. The online ordering is using https while our main website is using http. I was asked to restyle the vendor's online ordering pages to match the look and feel of our main site. Our vendor's online ordering pages have two iframes, one for the header and one for the footer. I updated the navigation links in the header and footer with target="_parent" and that works in all browsers except Firefox 23 because FF23 is blocking the links that point to http sources. My plan was to simply write a script to change the link target="_blank" and let Firefox users get pop-up windows instead. But now jQuery has removed the "jQuery.browser" feature in version 1.9 and says to try and use feature detection instead. So after a while googling I come here to humbly ask this question. Yes, I know I can just write plain JavaScript to detect browsers but I figure using feature detection in this case would be better.

You are mistaken as to the scope of mixed content blocking - it is present in virtually all current browsers, including:

You will need to restructure your site such that it does not load mixed content. In this case, this will probably require that you make your main website available over HTTPS.

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