feat: add entry for Independent Panel and Keyboard Shortcuts

This commit is contained in:
josc146
2023-04-02 21:34:58 +08:00
parent 60b479729a
commit 5fbbd5d825
12 changed files with 93 additions and 7 deletions
+3 -1
View File
@@ -241,7 +241,9 @@ async function prepareForRightClickMenu() {
if (data.itemId in toolsConfig) {
prompt = await toolsConfig[data.itemId].genPrompt(data.selectionText)
} else if (data.itemId in menuConfig) {
prompt = await menuConfig[data.itemId].genPrompt()
const menuItem = menuConfig[data.itemId]
if (!menuItem.genPrompt) return
else prompt = await menuItem.genPrompt()
if (prompt) prompt = cropText(`Reply in ${await getPreferredLanguage()}.\n` + prompt)
}
+8
View File
@@ -1,4 +1,6 @@
import { getCoreContentText } from '../../utils/get-core-content-text'
import { openUrl } from '../../utils/open-url'
import Browser from 'webextension-polyfill'
export const config = {
newChat: {
@@ -13,4 +15,10 @@ export const config = {
return `The following is the text content of a web page, analyze the core content and summarize:\n${getCoreContentText()}`
},
},
openConversationPage: {
label: 'Open Conversation Page',
action: async () => {
openUrl(Browser.runtime.getURL('IndependentPanel.html'))
},
},
}