mirror of
https://gitee.com/bitdance-team/chrome-extension
synced 2025-01-25 12:40:26 +08:00
修复截图完毕后没有取消注入脚本问题;翻译和截图按钮点击后关闭popup
This commit is contained in:
parent
6d6ccc6f34
commit
dcd8d152cc
@ -61,10 +61,10 @@ var capture = (force) => {
|
|||||||
chrome.runtime.sendMessage({
|
chrome.runtime.sendMessage({
|
||||||
message: 'capture', senderId: "screenshot", area: selection, dpr: devicePixelRatio
|
message: 'capture', senderId: "screenshot", area: selection, dpr: devicePixelRatio
|
||||||
}, (res) => {
|
}, (res) => {
|
||||||
console.log("capture回调结果:", res)
|
|
||||||
return // 变通
|
|
||||||
overlay(false)
|
overlay(false)
|
||||||
selection = null
|
selection = null
|
||||||
|
console.log("capture回调结果:", res)
|
||||||
|
return // 变通
|
||||||
save(res.image, config.format, config.save)
|
save(res.image, config.format, config.save)
|
||||||
})
|
})
|
||||||
}, 50)
|
}, 50)
|
||||||
|
@ -85,6 +85,7 @@ $(function() {
|
|||||||
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
|
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
|
||||||
chrome.extension.getBackgroundPage().takeScreenshot(tabs[0]);
|
chrome.extension.getBackgroundPage().takeScreenshot(tabs[0]);
|
||||||
})
|
})
|
||||||
|
window.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 番茄钟
|
// 番茄钟
|
||||||
|
@ -95,6 +95,6 @@ document.getElementById("weatherSite").onclick = function() {
|
|||||||
document.getElementById("transform").onclick = function () {
|
document.getElementById("transform").onclick = function () {
|
||||||
console.log(chrome.extension.getBackgroundPage())
|
console.log(chrome.extension.getBackgroundPage())
|
||||||
chrome.extension.getBackgroundPage().tranBit()
|
chrome.extension.getBackgroundPage().tranBit()
|
||||||
|
window.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
//翻译end
|
//翻译end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user