您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
ChatGPT switch The default is GPT4
当前为
// ==UserScript== // @name ChatGPT is GPT4 by default(PLUS only available) // @name:zh-CN ChatGPT默认为GPT4(仅PLUS可用) // @description ChatGPT switch The default is GPT4 // @description:zh-cn ChatGPT switch The default is GPT4 // @version 0.1.0 // @icon https://chat.openai.com/favicon.ico // @match https://chat.openai.com/* // @namespace https://greasyforks.org/zh-CN/scripts/464284-chatgpt-is-gpt4-by-default-plus-only-available // @license MIT // ==/UserScript== (function () { 'use strict'; const BUTTONS_GROUPS = ['Default (GPT-3.5)', 'Legacy (GPT-3.5)', 'GPT-4'] const DEFAULT_MODEL = 'GPT-4'; const BUTTON_INFOS = BUTTONS_GROUPS.filter((buttonText) => buttonText !== DEFAULT_MODEL).map((buttonText) => `Model${buttonText}`); const clickListItemByTextContent = (textContent) => { const listItems = document.getElementsByTagName('li'); for (let listItem of listItems) { if (listItem.textContent === textContent) { listItem.click(); return; } } }; const switchModel = (model = DEFAULT_MODEL) => { setTimeout(() => clickListItemByTextContent(model), 0); }; const callback = (mutationRecords) => { for (const mutationRecord of mutationRecords) { if (mutationRecord.addedNodes.length) { for (const addedNode of mutationRecord.addedNodes) { if (addedNode.nodeType === Node.ELEMENT_NODE) { const buttons = addedNode.querySelectorAll('button'); for (let button of buttons) { if (BUTTON_INFOS.includes(button.textContent)) { button.click(); switchModel(); return; } } } } } } }; const observer = new MutationObserver(callback); observer.observe(document.getElementById('__next'), { childList: true, subtree: true, }); })();