最近更新至 Firefox 115.15 esr,无法再使用 Firefox 访问 ChatGPT 或 DALL-E。使用 Edge 或 Chrome 等其他浏览器时未报告任何问题。检查 Firefox 中的控制台,Content-Security-Policy 和 Intl.Segmenter 似乎存在问题。
这似乎是用户的常见问题,但我已经想出了一个解决方法脚本!
此脚本是 Tampermonkey 用户脚本,应通过 Tampermonkey 或 Greasemonkey 等用户脚本管理器添加。这些扩展允许您在特定网站上运行自定义脚本。以下是在 Firefox 中设置的方法:(PS:我使用的是 Tampermonkey,而不是 Greasemonkey) 在 Firefox 中安装脚本的步骤:
**Install the Tampermonkey extension:**
Go to the Tampermonkey page on Mozilla Add-ons.
Click on Add to Firefox to install the extension.
**Open Tampermonkey Dashboard:**
Once Tampermonkey is installed, you’ll see its icon (a black square with eyes) in the toolbar.
Click on the icon and select Dashboard.
**Create a New Script:**
In the Tampermonkey dashboard, click on the + (Create a new script) button.
This will open the script editor.
**Paste the Script:**
Remove the default text in the script editor.
Paste the following javascript...
// ==UserScript==
// @name Intl.Segmenter Polyfill for ChatGPT
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Fix missing Intl.Segmenter in Firefox ESR
// @match chatgpt.com
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
if (typeof Intl.Segmenter === 'undefined') {
Intl.Segmenter = function() {
return {
segment: (input) => [{segment: input || 'fallback'}]
};
};
}
})();
**Save the Script:**
After pasting the script, click the File menu (top-left) and choose Save.
The script is now active and should run on chatgpt.com.