2014-11-24 99 views

回答

1

你應該考慮爲chrome或firefox創建一個擴展。

然後,您可以使用JavaScript/jQuery來得到所有的DOM的鏈接,並將其添加:

$html.find('a').each(function(){ 
    bookmark($(this).attr("title"), $(this).attr("href")); 
}); 

function bookmark(title, href) { 
    if (window.sidebar && window.sidebar.addPanel) { // Mozilla Firefox Bookmark 
     window.sidebar.addPanel(title,href,''); 
    } else if(window.external && ('AddFavorite' in window.external)) { // IE Favorite 
     window.external.AddFavorite(href,title); 
    } else if(window.opera && window.print) { // Opera Hotlist 
     this.title=title; 
     return true; 
    } else { // webkit - safari/chrome 
     alert('Press ' + (navigator.userAgent.toLowerCase().indexOf('mac') != - 1 ? 'Command/Cmd' :  'CTRL') + ' + D to bookmark this page.'); 
     } 
    } 

書籤功能被採取從這裏:Bookmark Javascript not jquery for website

相關問題