8
chrome.tabs.query({
active: true,
currentWindow: true
},
function (tabs) {
chrome.tabs.captureVisibleTab(null
,{ format: "png"},
function (src) {
$('body').append("<img src='" + src + "'>" + tabs[0].url + "</img>");//appends captured image to the popup.html
}
);
});
此代码会将捕获的图像附加到popup.html的正文中。但我想要的是将图像附加到弹出的主体,我想用chrome.tabs.create({url:“newtab.html”)打开新标签,并将捕获的图像追加到这个newtab.html。 'newtab.html'已经在路径文件夹中)。Chrome浏览器扩展程序 - 在新标签页中打开捕获的屏幕截图
在此先感谢