Skip to content

camelo365:Oops,an error occurred!Try again #3561

Description

@camelo365

{
"registration_country": null,
"require_cookie_consent": false,
"terms_of_use": null,
"cookie_consent": null,
"age_verification": null
}
{
"registration_country": "DE",
"require_cookie_consent": false,
"terms_of_use": {
"is_required": false,
"display": null
},
"cookie_consent": {
"is_required": false
},
"age_verification": {
"is_required": false
}
}
// s.terms_of_use.is_required <- crashed
s?.terms_of_use?.is_required // fixed
function eb(y) {
var et = (0,
ed.H)().isPluginsAvailable
, en = (0,
ef.NL)();
return (0,
eh.a)({
queryKey: ["plugins", Y.sort().join("") ]'
queryFn:eg,
initialData: function() {
var et = null === (ef = en.getQueryData(em.Z))
,ei = null === (eh = en.getQueryData(ep.V))
,ea = []
,eu = !0
,ec = !1
,ed = void 0;
try {
for (var ef, eh, eg, ey = function() {
var Y, en = eg.value, eo = null !== (Y
return Y.id === en
})) && void 0 !== Y ? Y : null == ei ?
return Y.id === en
});
if (null){


// ==UserScript==
// @name ChatGPT Fix
// @namespace http://tampermonkey.net/
// @Version 0.1
// @description Fix ChatGPT issue
// @author Laurent Warin
// @match https://chat.openai.com/*
// @grant none
// ==/UserScript==

(function() {
'use strict';

// Function to modify the server's response
function modifyServerResponse(originalResponse) {
    let modifiedResponse = originalResponse;
    // Check and modify modifiedResponse as needed
    // For example, check if certain properties are null and replace them
    if (modifiedResponse.terms_of_use === null) {
        modifiedResponse.terms_of_use = { is_required: false };
    }
    return modifiedResponse;
}

// Intercept XHR requests
XMLHttpRequest.prototype.realSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.send = function(value) {
    this.addEventListener('load', function() {
        if (this.responseURL === "https://chat.openai.com/backend-api/compliance") {
            let response = JSON.parse(this.responseText);
            let modified = modifyServerResponse(response);
            Object.defineProperty(this, 'responseText', { writable: true });
            this.responseText = JSON.stringify(modified);
        }
    });
    this.realSend(value);
};

})();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions