1 Star 0 Fork 0

张顺 / qingshu

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
popup.js 909 Bytes
一键复制 编辑 原始数据 按行查看 历史
安岩 提交于 2022-06-09 00:00 . first commit
chrome.storage.sync.get('imgArr', function(data) {
data.imgArr && data.imgArr.forEach(item => {
var imgWrap = $("<div class='img-box'></div>")
var img = $("<img src='" + item + "' alt='" + item + "' />")
imgWrap.append(img);
$('#content').append(imgWrap);
$('.empty').hide();
})
});
$('#activeBtn').click(function(element) {
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
chrome.tabs.sendMessage(tabs[0].id, "activeBtn", function(response) {
console.log(response);
});
});
});
// $('#pop').on("click",
// function() {
// window.postMessage({ type: "FROM_PAGE", text: "Hello from the webpage!" }, "*");
// }, false);
// $('#go-to-options').on('click',function() {
// if (chrome.runtime.openOptionsPage) {
// chrome.runtime.openOptionsPage();
// } else {
// window.open(chrome.runtime.getURL('options.html'));
// }
// });
1
https://gitee.com/zhangshunlin/qingshu.git
git@gitee.com:zhangshunlin/qingshu.git
zhangshunlin
qingshu
qingshu
master

搜索帮助