TemporaryGPT

Whenever you initially load onto the ChatGPT website, it will redirect you onto the temporry chat unless you are opening a specifc chat or the image library. Also closes the sidebr, but only on the initial load so that it doesn't stop you from interacting with the website.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name        TemporaryGPT
// @namespace   Violentmonkey Scripts
// @match       https://chatgpt.com/*
// @grant       none
// @version     1.0
// @author      MUmarShahbaz
// @license     MIT
// @description Whenever you initially load onto the ChatGPT website, it will redirect you onto the temporry chat unless you are opening a specifc chat or the image library. Also closes the sidebr, but only on the initial load so that it doesn't stop you from interacting with the website.
// ==/UserScript==

function enable_temp(current_url) {
    if (current_url.includes('chatgpt')) {
        if (!current_url.includes('library') && !current_url.includes('c/') && !current_url.includes('temporary-chat=true')) {
            if (!current_url.includes('?')) current_url = current_url.concat('?');
            location.href = current_url.match(/^https:\/\/chatgpt.com\/?\?.+$/) ? current_url.concat('&temporary-chat=true') : current_url.concat('temporary-chat=true');
        }
    }
}

enable_temp(location.href);

function close_sidebar() {
    const sidebar_toggler = document.querySelector('[data-testid="close-sidebar-button"]');
    if (sidebar_toggler) sidebar_toggler.click();
}

if (location.href.includes('temporary-chat=true')) {
    if (document.readyState === "loading") {
        document.addEventListener('DOMContentLoaded', close_sidebar);
    } else {
        const sidebar_closer = setInterval(() => {
            if (document.querySelector('[data-testid="close-sidebar-button"]')) {
                close_sidebar();
                clearInterval(sidebar_closer);
            }
        }, 500);
    }
}