您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add a float button to open ChatGPT window in any web page.
// ==UserScript== // @name ChatGPT Helper // @namespace http://tampermonkey.net/ // @version 0.3 // @description Add a float button to open ChatGPT window in any web page. // @author hua03 // @match https://www.google.com // @icon https://chat.openai.com/favicon-32x32.png // @grant none // @license MIT // ==/UserScript== (function () { // ChatGPT地址 const ChatGPTServer = 'https://chat.openai.com/'; // 交互窗口宽度 const windowWidth = 480; // 交互窗口高度 const windowHeight = 800; // 是否已经打开交互弹窗 let isOpenChatGPTHelperWindow = false; // 是否已经初始化弹窗 let isInitChatGPTHelperWindow = false; addChatButton(); // 打开或关闭弹窗 function toggleChatGPTHelperWindow() { if (!isInitChatGPTHelperWindow) { addChatGPTWidow() isInitChatGPTHelperWindow = true; isOpenChatGPTHelperWindow = true } else { if (isOpenChatGPTHelperWindow) { closeChatGPTWidow() isOpenChatGPTHelperWindow = false } else { openChatGPTWidow() isOpenChatGPTHelperWindow = true } } } /** * 添加ChatGPT按钮 */ function addChatButton() { const icon = document.createElement('img') icon.src = 'https://chat.openai.com/favicon-32x32.png' icon.style = `width: 32px; height:32px; position: fixed;right: 40px;bottom: 40px;z-index:999;cursor: pointer` icon.ondragstart = function () { return false } icon.onclick = toggleChatGPTHelperWindow document.body.appendChild(icon) } function addChatGPTWidow() { const iframe = document.createElement('iframe'); iframe.setAttribute('id', 'ChatGPTHelperWindow') iframe.src = ChatGPTServer; iframe.style = `display:block;width: ${windowWidth}px; height:${windowHeight}px; position: fixed;right: 40px;bottom: 90px;z-index:999;cursor: pointer;border: none;border-radius: 5px;`; document.body.appendChild(iframe); } function openChatGPTWidow() { const iframe = document.getElementById('ChatGPTHelperWindow') iframe.style = `${iframe.getAttribute('style')}; display:block;` } function closeChatGPTWidow() { const iframe = document.getElementById('ChatGPTHelperWindow') iframe.style = `${iframe.getAttribute('style')}; display:none;` } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址