火狐升级到 23.0后就不在支持 window.sidebar.addPanel
如题,火狐升级到版本为23的时候将window.sidebar.addPanel,理由貌似是非标准,极少用,支持不全面;貌似还有安全漏洞;
以后再写加入收藏的写法要改了
function() {
if (window.sidebar && window.sidebar.addPanel) { // Mozilla Firefox Bookmark
window.sidebar.addPanel(document.title,window.location.href,'');
} else if(window.external && ('AddFavorite' in window.external)) { // IE Favorite
window.external.AddFavorite(location.href,document.title);
} else if(window.opera && window.print) { // Opera Hotlist
this.title=document.title;
return true;
} else { // webkit - safari/chrome
alert('Press ' + (navigator.userAgent.toLowerCase().indexOf('mac') != - 1 ? 'Command/Cmd' : 'CTRL') + ' + D to bookmark this page.');
}
}
否则在23里面会报错。