Disabling ieretrofit.js on Blogger

做~自己de王妃 提交于 2019-12-19 11:57:41

问题


this script is giving me trouble in IE 9. From what I heard it was used to get rounded corners working on old IE versions. Now I don't need it anymore... And worse, it is forcing me to keep a <META content=IE=EmulateIE7 http-equiv=X-UA-Compatible> tag or the scripts messes my opaque windows. It seems to be included automatically with the <b:include data='blog' name='all-head-content'/> tag. Anyone knows how to prevent it from being loaded?


回答1:


I've finally figured this one out.

By replacing

<b:include data='blog' name='all-head-content'/>

With

<meta expr:content='&quot;text/html; charset=&quot; + data:blog.encoding' http-equiv='Content-Type'/>
<meta content='true' name='MSSmartTagsPreventParsing'/>
<meta content='blogger' name='generator'/>
<link expr:href='data:blog.homepageUrl + &quot;favicon.ico&quot;' rel='icon' type='image/x-icon'/>
<link expr:href='data:blog.url' rel='canonical'/>
<data:blog.feedLinks/>  
<b:if cond='data:blog.url == data:blog.homepageUrl'>
   <link href='http://www.blogger.com/openid-server.g' rel='openid.server'/>
</b:if>

Everything works as expected.

At least for my blog this produces the same header output than before (minus the two IE specific scripts and a third global script which I'm not sure about). I've run diff to be sure.

Update 1

If you want the non IE specific script, just add this after the Content-Type tag:

<script type='text/javascript'>(function() { var a=window;function c(b){this.t={};this.tick=function(b,i,d){d=d!=void 0?d:(new Date).getTime();this.t[b]=[d,i]};this.tick(&quot;start&quot;,null,b)}var e=new c;a.jstiming={Timer:c,load:e};try{var g=null;a.chrome&amp;&amp;a.chrome.csi&amp;&amp;(g=Math.floor(a.chrome.csi().pageT));g==null&amp;&amp;a.gtbExternal&amp;&amp;(g=a.gtbExternal.pageT());g==null&amp;&amp;a.external&amp;&amp;(g=a.external.pageT);g&amp;&amp;(a.jstiming.pt=g)}catch(h){};a.tickAboveFold=function(b){var f=0;if(b.offsetParent){do f+=b.offsetTop;while(b=b.offsetParent)}b=f;b&lt;=750&amp;&amp;a.jstiming.load.tick(&quot;aft&quot;)};var j=!1;function k(){j||(j=!0,a.jstiming.load.tick(&quot;firstScrollTime&quot;))}a.addEventListener?a.addEventListener(&quot;scroll&quot;,k,!1):a.attachEvent(&quot;onscroll&quot;,k);
 })();</script>

Update 2

This also removes the generated <link rel="image_src">. I just hardcoded an image.



来源:https://stackoverflow.com/questions/5774618/disabling-ieretrofit-js-on-blogger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!