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의 본문에 추가합니다. 하지만 내가 원하는 것은 popup body에 이미지를 추가하는 것이다. chrome.tabs.create ({url : "newtab.html")를 사용하여 새 탭을 열고 캡처 한 이미지를이 newtab.html에 추가하려고한다. 'newtab.html'은 이미 경로 폴더에 있음). 사전크롬 확장 - 새 탭에서 캡처 된 스크린 샷 열기