我正在使用Google Chrome扩展程序,我只想知道如何在变量中存储curent标签的说明和网址图片 .
我已经使用这些说明存储了网址和 Headers :
chrome.tabs.getSelected(null, function(tab) {
document.getElementById('currentLink').innerHTML = tab.url;
});
chrome.tabs.getSelected(null, function(tab) {
document.getElementById('currentTitle').innerHTML = tab.title;
});
但仍然无法存储来自balise meta的描述和url图片,如下所示:
<meta name="description" content="Le Monde.fr - 1er site d'information. Les articles du journal et toute l'actualité en continu : International, France, Société, Economie, Culture, Environnement, Blogs ...">
<meta property="og:image" content="http://s1.lemde.fr/medias/web/1.2.639/img/placeholder/opengraph.jpg">
2 回答
我为Mozilla Firefox做了同样的extesion ..我用这段代码存储变量
试试这个jQuery解决方案:
资料来源:Jquery: Get favicon with full path