Firefox ESR 无法正常打开 ChatGPT 页面
逗比去哪2
2024年09月22日 17:09
收录于文集
共10篇

前言

所使用的解决方案只针对当前 (2024/09/22) 使用 Firefox ESR 115.15.0 用户。不能保证能够适用于其他浏览器。

解决方案摘抄自

https://community.openai.com/t/chatgpt-has-stopped-working-in-firefox/664425/81

页面下方用户 @bobemoe 的评论

设备环境

Windows 11

Firefox 115.15.0 esr

问题描述

在排除网络原因的情况下,使用其他浏览器如 Google、Edge 等均能正常打开 chatgpt.com 并成功登录,而使用 Firefox ESR 打开则:

图1 - Firefox ESR

浏览器页面加载完成,但页面明显存在缺失元素,右上角登录元素等消失,所有元素均处于不可交互状态。

F12 查看控制台发现存在错误信息:

Uncaught TypeError: Intl.Segmenter is not a constructor

解决方案

解决方案已经在开头来源的链接中,将其中的主要内容摘抄如下:

浏览器安装 Tampermonkey:https://addons.mozilla.org/en-US/firefox/addon/tampermonkey

然后打开扩展 - 添加新脚本,将下列复制粘贴后保存:

代码块
JavaScript
自动换行
复制代码
// ==UserScript==
// @name        Intl.Segmenter Polyfill for ChatGPT
// @namespace   http://tampermonkey.net/
// @version     0.2
// @description Fix missing Intl.Segmenter in Firefox ESR
// @match       https://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'}]

           };

       };

   }

})();
复制成功

然后刷新页面即可。