您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork镜像 is available in English.
Toggle temporary chat mode on chaptgpt with double shift key press without reloading
当前为
// ==UserScript== // @name ChatGPT Temporary Chat Toggle without reloading the web // @namespace http://tampermonkey.net/ // @version 0.2 // @description Toggle temporary chat mode on chaptgpt with double shift key press without reloading // @author 小红书 :沉浸式学法语😈 小红书id : 590862748 // @match https://chatgpt.com/* // @license MIT // @grant none // ==/UserScript== (function() { 'use strict'; var lastShiftTime = 0; var shiftTimeout = 500; var shiftPressedOnce = false; document.addEventListener('keydown', function(e) { if (e.key === 'Shift') { var currentTime = new Date().getTime(); if (shiftPressedOnce && (currentTime - lastShiftTime) < shiftTimeout) { shiftPressedOnce = false; lastShiftTime = 0; toggleTemporaryChat(); } else { shiftPressedOnce = true; lastShiftTime = currentTime; setTimeout(function() { shiftPressedOnce = false; }, shiftTimeout); } } }); function toggleTemporaryChat() { var url = new URL(window.location.href); var params = new URLSearchParams(url.search); if (params.get('temporary-chat') === 'true') { // we are in tempo chat mode, remove the parameter params.delete('temporary-chat'); history.replaceState(null, '', url.pathname + '?' + params.toString() + url.hash); // dispatch a custom event triggerUrlChange(); } else { params.set('temporary-chat', 'true'); history.replaceState(null, '', url.pathname + '?' + params.toString() + url.hash); triggerUrlChange(); } } function triggerUrlChange() { // some SPAs listen to the popstate event window.dispatchEvent(new PopStateEvent('popstate', { state: history.state })); } })(); // ==Copyright== // Copyright © 2024 by 沉浸式学法语😈 (小红书 ID: 590862748). All rights reserved. // This script is the intellectual property of the author. Unauthorized copying, modification, // or redistribution of this script, in whole or in part, is strictly prohibited without explicit // prior written permission from the author. // For inquiries, contact the author through their 小红书 ID: 590862748. // ==End of Copyright==