1
0
mirror of https://gitee.com/bitdance-team/chrome-extension synced 2025-10-08 00:45:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

翻译功能

This commit is contained in:
zhneglili
2022-02-09 16:05:30 +08:00
parent 7269396151
commit 6b715efced
5 changed files with 117 additions and 5 deletions

View File

@@ -48,3 +48,13 @@ chrome.contextMenus.create({
showNotification()
}
})
function tranBit(){
console.log("开始插入翻译页面")
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
console.log(tabs)
chrome.tabs.executeScript(tabs[0].id, { file:'./assets/js/translate/tran.js', runAt: 'document_start' })
chrome.tabs.insertCSS(tabs[0].id, { file:'./assets/css/tran.css', runAt: 'document_start' })
})
}