WIP, custom API Modes

This commit is contained in:
josc146
2024-08-06 21:27:07 +08:00
parent a398bfd9ae
commit 08f2c54683
5 changed files with 40 additions and 19 deletions
+7 -1
View File
@@ -16,6 +16,7 @@ import {
createElementAtPosition,
cropText,
endsWithQuestionMark,
getApiModesStringArrayFromConfig,
getClientPosition,
getPossibleElementByQuerySelector,
} from '../utils'
@@ -354,7 +355,12 @@ async function prepareForForegroundRequests() {
const userConfig = await getUserConfig()
if (!chatgptWebModelKeys.some((model) => userConfig.activeApiModes.includes(model))) return
if (
!chatgptWebModelKeys.some((model) =>
getApiModesStringArrayFromConfig(userConfig, true).includes(model),
)
)
return
if (location.pathname === '/') {
const input = document.querySelector('#prompt-textarea')