mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-09-10 11:50:34 +08:00
feat: pdf and local file support
This commit is contained in:
@@ -180,15 +180,18 @@ function refreshMenu() {
|
||||
}
|
||||
|
||||
Browser.contextMenus.onClicked.addListener((info, tab) => {
|
||||
const message = {
|
||||
itemId: info.menuItemId.replace(menuId, ''),
|
||||
selectionText: info.selectionText,
|
||||
useMenuPosition: true,
|
||||
}
|
||||
console.debug('menu clicked', message)
|
||||
Browser.tabs.sendMessage(tab.id, {
|
||||
type: 'CREATE_CHAT',
|
||||
data: message,
|
||||
Browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => {
|
||||
const currentTab = tabs[0]
|
||||
const message = {
|
||||
itemId: info.menuItemId.replace(menuId, ''),
|
||||
selectionText: info.selectionText,
|
||||
useMenuPosition: tab.id === currentTab.id,
|
||||
}
|
||||
console.debug('menu clicked', message)
|
||||
Browser.tabs.sendMessage(currentTab.id, {
|
||||
type: 'CREATE_CHAT',
|
||||
data: message,
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
+3
-2
@@ -33,7 +33,8 @@
|
||||
{
|
||||
"matches": [
|
||||
"https://*/*",
|
||||
"http://*/*"
|
||||
"http://*/*",
|
||||
"file://*/*"
|
||||
],
|
||||
"js": [
|
||||
"shared.js",
|
||||
@@ -47,7 +48,7 @@
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"resources": [
|
||||
"*.png"
|
||||
"logo.png"
|
||||
],
|
||||
"matches": [
|
||||
"<all_urls>"
|
||||
|
||||
@@ -33,7 +33,8 @@
|
||||
{
|
||||
"matches": [
|
||||
"https://*/*",
|
||||
"http://*/*"
|
||||
"http://*/*",
|
||||
"file://*/*"
|
||||
],
|
||||
"js": [
|
||||
"shared.js",
|
||||
@@ -45,7 +46,7 @@
|
||||
}
|
||||
],
|
||||
"web_accessible_resources": [
|
||||
"*.png"
|
||||
"logo.png"
|
||||
],
|
||||
"commands": {
|
||||
"newChat": {
|
||||
|
||||
Reference in New Issue
Block a user