3/17/2013

The Old Reader的全屏模式Bookmarklet

Google Reader要关了,The Old Reader是个不错的替代品。但是没有全屏模式这一点我有点小不爽。所以自己DIY了一个Bookmarklet凑合用着。 

update:HeiNotes指出了这个脚本不能适用于https的theoldreader,已经改正 http://www.heinotes.com/2013/03/HTTPS-The-Old-Reader-Fullscreen.html


JavaScript 代码:

javascript:(function(){var v=new RegExp('theoldreader.com');if(!v.test(document.URL)){alert('The script can only work in theoldreader.com!');}else{a=document.getElementById('main');b=document.getElementById('sidebar');c=document.getElementsByClassName('subscribe-fixed-top');d=document.getElementsByClassName('navbar-fixed-top');e=document.getElementsByClassName('container-fluid');if(typeof top == 'undefined'){var top='';}if('none' != b.style.display){top=window.getComputedStyle(e[0],null).getPropertyValue('top');e[0].style.top='5px';left=a.style.left;width=a.style.width;b.style.display='none';c[0].style.display='none';d[0].style.display='none';a.style.left='-25px';a.style.width='99%';}else{b.style.display='block';c[0].style.display='block';d[0].style.display='block';e[0].style.top=top;a.style.left=left;a.style.width=width;}return;}})();

直接复制再粘贴到收藏夹栏里即可。或者直接拖动下面一句文字:


下面是代码的简短注释:

//a means main body that display the real entities.
//b means the sidebar on the left.
//c means the add subscription button.
//d means the header in the top
//e means the container of the main(a), the sidebar(b) and the ADD BUTTON(c).

仅在Chrome和IE 10上测试通过。