mirror of
https://gitee.com/bitdance-team/chrome-extension
synced 2025-10-08 00:45:13 +08:00
翻译功能
This commit is contained in:
@@ -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' })
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user