This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
// --- Selectors for ChatGPT --- | |
const targetTextAreaSelector = "#prompt-textarea"; // contenteditable div | |
const sendButtonSelector = "#composer-submit-button"; | |
// A relatively positioned ancestor of the textarea, suitable for placing controls | |
const controlsParentSelector = "div.relative.flex.w-full.items-end.px-3.py-3"; | |
// --- End Selectors --- | |
const pasteButtonId = "chatgpt-custom-paste-button"; | |
const pasteAndSendSwitchId = "chatgpt-paste-and-send-switch"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 样式定义 | |
const STYLES = { | |
screenshotBtn: ` | |
.screenshot-btn { | |
position: fixed; | |
bottom: 20px; | |
right: 20px; | |
padding: 10px 20px; | |
background-color: #ff9800; | |
color: white; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
// --- 配置 --- | |
const SEEK_STEP = 5; // 每次快进/快退的秒数 | |
const SPEED_STEP = 0.25; // 每次速度调整的幅度 | |
const MIN_SPEED = 0.5; // 最小播放速度 | |
const MAX_SPEED = 4.0; // 最大播放速度 | |
const CHECK_INTERVAL = 500; // 每隔多少毫秒检查一次播放器是否加载 (0.5秒) | |
const MAX_CHECKS = 20; // 最多检查多少次 (10秒) | |
// --- 配置结束 --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
// 目标文本输入区域的选择器 | |
const targetTextAreaSelector = 'div.ql-editor[contenteditable="true"]'; | |
const pasteButtonId = "arc-custom-paste-button"; | |
const pasteAndSendSwitchId = "arc-paste-and-send-switch"; | |
const controlsWrapperId = "arc-custom-controls-wrapper"; | |
const sendButtonSelector = "a.style__send-btn___ZsLmU"; // 发送按钮的选择器 | |
function addPasteButton() { | |
const targetTextArea = document.querySelector(targetTextAreaSelector); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener("DOMContentLoaded", function () { | |
// 检查是否在 ChatGPT 页面 | |
if (window.location.href.includes("chat.openai.com") || window.location.href.includes("chatgpt.com")) { | |
// 添加按钮样式 | |
const style = document.createElement("style"); | |
style.textContent = ` | |
.paste-format-btn { | |
position: fixed; | |
left: 20px; | |
bottom: 20px; |