產生 "oops, an error occurred!" 的起因為 chatgpt 使用的 Javascript 缺失 (最新版的 chrome 沒此問題)
即缺少 toSorted().
修正方法為預先插入取代的 Javascript 程式碼
以下為使用自動插入 JS
1. 安裝 Resource Override 插件
代碼: 選擇全部
https://chromewebstore.google.com/detail/resource-override/pkoacgokdfckfpndoffpifphamojphii
Add Tab Group
Tab URL: " *chatgpt.com/* "
Add Rule: Inject File
Name: " ArrayPrototypeToSorted.js "
File Type: " JS "
Inject into: " Head "
3. 編輯程式碼 (Edit File/Save & Close)
代碼: 選擇全部
//copy this (ArrayPrototypeToSorted.js) . ini
if (!Array.prototype.toSorted) {
Array.prototype.toSorted = function(compareFn) {
compareFn = compareFn || ((a, b) => String(a).localeCompare(b));
const arrayCopy = [...this];
return arrayCopy.sort(compareFn);
};
}
//copy this (ArrayPrototypeToSorted.js) . end
代碼: 選擇全部
-- In Google Chrome install the extension: " https://chromewebstore.google.com/detail/resource-override/pkoacgokdfckfpndoffpifphamojphii " (Resource Override) and configure the following -- :
1 - [Open: Resource Override] :
2 - [Press Button: Add Tab Group] :
Tab URL: " *chatgpt.com/* "
3 - [Press Button: Add Rule > Press Button: Inject File] :
Name: " ArrayPrototypeToSorted.js "
File Type: " JS "
Inject into: " Head "
4 - [Press Button: Edit File] :
//copy this (ArrayPrototypeToSorted.js) . ini
if (!Array.prototype.toSorted) {
Array.prototype.toSorted = function(compareFn) {
compareFn = compareFn || ((a, b) => String(a).localeCompare(b));
const arrayCopy = [...this];
return arrayCopy.sort(compareFn);
};
}
//copy this (ArrayPrototypeToSorted.js) . end
[Press Button: Save & Close] .
-- On page load: "*chatgpt.com/*" ; This will add the missing functionality. --