IE9 HTTPS security is compromised by my Greasemonkey script?

前端 未结 5 1029

I’ve got a Greasemonkey-for-IE script in IE9 that’s importing jQuery. But on secure pages it doesn’t work.

I’m getting:

SEC7111: HTTPS security is co         


        
5条回答
  •  被撕碎了的回忆
    2020-12-05 20:10

    You can eliminate the issue with simpler code by using a scheme-relative URL like this:

    var script = document.createElement("script");
    script.setAttribute("src", 
       "//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");
    

    This will use http:// on an http:// page and https:// on an https:// page...a much simpler way to solve the issue.

提交回复
热议问题