diff --git a/src/background/index.mjs b/src/background/index.mjs index d887be2..102c2ce 100644 --- a/src/background/index.mjs +++ b/src/background/index.mjs @@ -15,6 +15,7 @@ import { isUsingApiKey, } from '../config/index.mjs' import { isSafari } from '../utils/is-safari' +import { isFirefox } from '../utils/is-firefox' const KEY_ACCESS_TOKEN = 'accessToken' const cache = new ExpiryMap(10 * 1000) @@ -112,7 +113,7 @@ Browser.contextMenus.removeAll().then(() => { id: menuId + 'new', parentId: menuId, title: 'New Chat', - contexts: ['selection'], + contexts: [isFirefox() ? 'all' : 'selection'], }) for (const index in defaultConfig.selectionTools) { const key = defaultConfig.selectionTools[index] diff --git a/src/utils/index.mjs b/src/utils/index.mjs index 5027d34..3884b7c 100644 --- a/src/utils/index.mjs +++ b/src/utils/index.mjs @@ -5,6 +5,7 @@ export * from './fetch-sse' export * from './get-conversation-pairs' export * from './get-possible-element-by-query-selector' export * from './init-session' +export * from './is-firefox.mjs' export * from './is-mobile' export * from './is-safari' export * from './limited-fetch' diff --git a/src/utils/is-firefox.mjs b/src/utils/is-firefox.mjs new file mode 100644 index 0000000..cea42bc --- /dev/null +++ b/src/utils/is-firefox.mjs @@ -0,0 +1,3 @@ +export function isFirefox() { + return navigator.userAgent.includes('Firefox') +}