Skip to content

Commit e6cc1fe

Browse files
committed
feat: option to enable web mode history (#311)
1 parent 69b4c19 commit e6cc1fe

File tree

6 files changed

+22
-4
lines changed

6 files changed

+22
-4
lines changed

src/_locales/en/main.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,6 @@
112112
"API Params": "API Params",
113113
"API Url": "API Url",
114114
"Others": "Others",
115-
"API Modes": "API Modes"
115+
"API Modes": "API Modes",
116+
"Disable web mode history for better privacy protection, but it will result in unavailable conversations after a period of time": "Disable web mode history for better privacy protection, but it will result in unavailable conversations after a period of time"
116117
}

src/_locales/zh-hans/main.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,6 @@
112112
"API Params": "API参数",
113113
"API Url": "API地址",
114114
"Others": "其他",
115-
"API Modes": "API模式"
115+
"API Modes": "API模式",
116+
"Disable web mode history for better privacy protection, but it will result in unavailable conversations after a period of time": "禁用网页版模式历史记录以获得更好的隐私保护, 但会导致对话在一段时间后不可用"
116117
}

src/_locales/zh-hant/main.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,6 @@
112112
"API Params": "API參數",
113113
"API Url": "API網址",
114114
"Others": "其他",
115-
"API Modes": "API模式"
115+
"API Modes": "API模式",
116+
"Disable web mode history for better privacy protection, but it will result in unavailable conversations after a period of time": "禁用網頁版模式歷史記錄以獲得更好的隱私保護, 但會導致對話在壹段時間後不可用"
116117
}

src/config/index.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export const defaultConfig = {
109109
customChatGptWebApiUrl: 'https://chat.openai.com',
110110
customChatGptWebApiPath: '/backend-api/conversation',
111111
customOpenAiApiUrl: 'https://api.openai.com',
112+
disableWebModeHistory: true,
112113
siteRegex: 'match nothing',
113114
useSiteRegexOnly: false,
114115
inputQuery: '',

src/popup/sections/AdvancedPart.jsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,20 @@ function Others({ config, updateConfig }) {
116116

117117
return (
118118
<>
119+
<label>
120+
<input
121+
type="checkbox"
122+
checked={config.disableWebModeHistory}
123+
onChange={(e) => {
124+
const checked = e.target.checked
125+
updateConfig({ disableWebModeHistory: checked })
126+
}}
127+
/>
128+
{t(
129+
'Disable web mode history for better privacy protection, but it will result in unavailable conversations after a period of time',
130+
)}
131+
</label>
132+
<br />
119133
<label>
120134
{t('Custom Site Regex')}
121135
<input

src/services/apis/chatgpt-web.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export async function generateAnswersWithChatgptWebApi(port, question, session,
111111
parent_message_id: session.parentMessageId,
112112
timezone_offset_min: new Date().getTimezoneOffset(),
113113
variant_purpose: 'none',
114-
history_and_training_disabled: true,
114+
history_and_training_disabled: config.disableWebModeHistory,
115115
}),
116116
onMessage(message) {
117117
console.debug('sse message', message)

0 commit comments

Comments
 (0)