{"id":82,"date":"2009-04-23T12:45:10","date_gmt":"2009-04-23T12:45:10","guid":{"rendered":"http:\/\/www.weeklywhinge.com\/?p=82"},"modified":"2009-06-30T16:30:13","modified_gmt":"2009-06-30T16:30:13","slug":"internet-explorer-is-feeling-insecure","status":"publish","type":"post","link":"https:\/\/www.weeklywhinge.com\/?p=82","title":{"rendered":"Internet Explorer: this page contains both secure and nonsecure items"},"content":{"rendered":"<p>So the web is full of people asking about this symptom and I hit it myself. Seemingly randomly (but consistently) IE will complain about nonsecure items in the page, with this warning message:<\/p>\n<p>\u00c2\u00a0<\/p>\n<div id=\"attachment_83\" style=\"width: 338px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.weeklywhinge.com\/wp-content\/uploads\/2009\/04\/unsecure2.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-83\" class=\"size-full wp-image-83\" title=\"Unsecure\" src=\"http:\/\/www.weeklywhinge.com\/wp-content\/uploads\/2009\/04\/unsecure2.gif\" alt=\"This page contains both secure and nonsecure items. \\n\\nDo you want to display the nonsecure items?\" width=\"328\" height=\"147\" srcset=\"https:\/\/www.weeklywhinge.com\/wp-content\/uploads\/2009\/04\/unsecure2.gif 328w, https:\/\/www.weeklywhinge.com\/wp-content\/uploads\/2009\/04\/unsecure2-300x134.gif 300w\" sizes=\"auto, (max-width: 328px) 100vw, 328px\" \/><\/a><p id=\"caption-attachment-83\" class=\"wp-caption-text\">The error message from IE7<\/p><\/div>\n<p>The usual response to this is that you&#8217;re loading images (or other media) from a non-SSL connection (hence &#8220;non-secure&#8221; items); there are also some mentions of IE not being happy about IFRAMEs without SRC= attributes (the browser assigns &#8220;about:blank&#8221; as a default SRC, which &#8211; being non-secure &#8211; flips the error); however none of these things applied in my case.<\/p>\n<p>\u00c2\u00a0<\/p>\n<p>I discovered that if I turned off javascript the error disappeared, which suggested my script was problematic, but I still couldn&#8217;t find anything in the scripts which was loading any non-secure items.<\/p>\n<p>\u00c2\u00a0<\/p>\n<p>In the end after much messing around it turns out that the offending script was setting object.style.background to a relative path, eg\u00c2\u00a0<\/p>\n<blockquote><p><span style=\"font-family: -webkit-monospace;\"><strong>myObj.style.background=&#8221;url(\/images\/mybackground.gif)&#8221;;<\/strong><\/span><\/p><\/blockquote>\n<p>Even though this will correctly resolve to an https:\/\/ address (assuming the root of the document is https:\/\/) IE can&#8217;t figure this out and moans.<\/p>\n<p>\u00c2\u00a0<\/p>\n<p>Simply adding the full path to the background solved my problem.<\/p>\n<p>\u00c2\u00a0<\/p>\n<p>This <em>doesn&#8217;t<\/em>\u00c2\u00a0apply to CSS <em>files<\/em>\u00c2\u00a0setting backgrounds &#8211; you can happily have relative paths in these and all will be well.\u00c2\u00a0<\/p>\n<p>\u00c2\u00a0<\/p>\n<p>Of course I then wondered why I hadn&#8217;t found that on the web and figured you might be looking for it too &#8211; so here it is \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So the web is full of people asking about this symptom and I hit it myself. Seemingly randomly (but consistently) IE will complain about nonsecure items in the page, with this warning message: \u00c2\u00a0 The usual response to this is that you&#8217;re loading images (or other media) from a non-SSL connection (hence &#8220;non-secure&#8221; items); there [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,7],"tags":[42,40,43,55,41],"class_list":["post-82","post","type-post","status-publish","format-standard","hentry","category-tech","category-webdev","tag-error","tag-fix","tag-internet-explorer","tag-nonsecure-items","tag-warning"],"_links":{"self":[{"href":"https:\/\/www.weeklywhinge.com\/index.php?rest_route=\/wp\/v2\/posts\/82","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weeklywhinge.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weeklywhinge.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weeklywhinge.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weeklywhinge.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=82"}],"version-history":[{"count":10,"href":"https:\/\/www.weeklywhinge.com\/index.php?rest_route=\/wp\/v2\/posts\/82\/revisions"}],"predecessor-version":[{"id":107,"href":"https:\/\/www.weeklywhinge.com\/index.php?rest_route=\/wp\/v2\/posts\/82\/revisions\/107"}],"wp:attachment":[{"href":"https:\/\/www.weeklywhinge.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=82"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weeklywhinge.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=82"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weeklywhinge.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}