KeepChatGPT
KeepChatGPT copied to clipboard
能否阻止本地显示的文本被删除?
就是AI的输出内容触发警告时,可以阻止已经输出到页面上的内容被删除。
用gpt4.0写的油猴,右下角有一个浮动的按钮,不用的时候关掉就行了。 KeepChatGPT也需要保持开启,不然会收到警告邮件。 用于临时应付一下,还是要等大佬更新插件
// ==UserScript==
// @name 防止chatGPT把已输出的内容删掉(beta)
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Log changes to div with class result-streaming
// @author You
// @match https://chat.openai.com/*
// @icon https://chat.openai.com/favicon.ico
// @grant none
// ==/UserScript==
(function() {
'use strict';
let isEnabled = true;
// 创建美观的浮动开关
const switchContainer = document.createElement('div');
switchContainer.style.position = 'fixed';
switchContainer.style.bottom = '20px';
switchContainer.style.right = '20px';
switchContainer.style.zIndex = '9999';
switchContainer.style.backgroundColor = '#f1f1f1';
switchContainer.style.border = '1px solid #ccc';
switchContainer.style.borderRadius = '12px';
switchContainer.style.padding = '10px';
switchContainer.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.1)';
switchContainer.style.cursor = 'pointer';
switchContainer.style.userSelect = 'none';
const switchLabel = document.createElement('label');
switchLabel.innerHTML = 'Enable Feature: ';
switchLabel.style.marginRight = '10px';
switchLabel.style.fontFamily = 'Arial, sans-serif';
switchLabel.style.cursor = 'pointer';
const switchInput = document.createElement('input');
switchInput.type = 'checkbox';
switchInput.checked = isEnabled;
switchContainer.addEventListener('click', function() {
isEnabled = !isEnabled;
switchInput.checked = isEnabled;
});
switchContainer.appendChild(switchLabel);
switchContainer.appendChild(switchInput);
document.body.appendChild(switchContainer);
function handleMutations(mutations) {
if (!isEnabled) return;
for (const mutation of mutations) {
if (mutation.type === 'childList') {
mutation.removedNodes.forEach((node) => {
if (node.nodeType === Node.ELEMENT_NODE) {
if (node.matches('div.result-streaming')) {
console.log('Attempt to delete div.result-streaming detected. Reverting.');
mutation.target.appendChild(node);
}
}
});
}
}
}
const bodyObserver = new MutationObserver(handleMutations);
const config = { childList: true, subtree: true };
bodyObserver.observe(document.body, config);
})();
What does this script do?
用gpt4.0写的油猴,右下角有一个浮动的按钮,不用的时候关掉就行了。 KeepChatGPT也需要保持开启,不然会收到警告邮件。 用于临时应付一下,还是要等大佬更新插件
// ==UserScript== // @name 防止chatGPT把已输出的内容删掉(beta) // @namespace http://tampermonkey.net/ // @version 0.2 // @description Log changes to div with class result-streaming // @author You // @match https://chat.openai.com/* // @icon https://chat.openai.com/favicon.ico // @grant none // ==/UserScript== (function() { 'use strict'; let isEnabled = true; // 创建美观的浮动开关 const switchContainer = document.createElement('div'); switchContainer.style.position = 'fixed'; switchContainer.style.bottom = '20px'; switchContainer.style.right = '20px'; switchContainer.style.zIndex = '9999'; switchContainer.style.backgroundColor = '#f1f1f1'; switchContainer.style.border = '1px solid #ccc'; switchContainer.style.borderRadius = '12px'; switchContainer.style.padding = '10px'; switchContainer.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.1)'; switchContainer.style.cursor = 'pointer'; switchContainer.style.userSelect = 'none'; const switchLabel = document.createElement('label'); switchLabel.innerHTML = 'Enable Feature: '; switchLabel.style.marginRight = '10px'; switchLabel.style.fontFamily = 'Arial, sans-serif'; switchLabel.style.cursor = 'pointer'; const switchInput = document.createElement('input'); switchInput.type = 'checkbox'; switchInput.checked = isEnabled; switchContainer.addEventListener('click', function() { isEnabled = !isEnabled; switchInput.checked = isEnabled; }); switchContainer.appendChild(switchLabel); switchContainer.appendChild(switchInput); document.body.appendChild(switchContainer); function handleMutations(mutations) { if (!isEnabled) return; for (const mutation of mutations) { if (mutation.type === 'childList') { mutation.removedNodes.forEach((node) => { if (node.nodeType === Node.ELEMENT_NODE) { if (node.matches('div.result-streaming')) { console.log('Attempt to delete div.result-streaming detected. Reverting.'); mutation.target.appendChild(node); } } }); } } } const bodyObserver = new MutationObserver(handleMutations); const config = { childList: true, subtree: true }; bodyObserver.observe(document.body, config); })();
谢谢!
What does this script do?
this is Tampermonkey script
I know, but does this fix the cancel audit function or still no?
改了一点点,阻止 最近输入 的显示被删除,不过内部的实际内容已经被清空
if (node.matches('div.result-streaming') || node.className === 'empty:hidden') {
console.log(`Attempt to delete ${node.tagName}.${node.className} detected. Reverting.`);