Skip to content

Commit

Permalink
修复克隆对话时将复制了ChatGPT头像字符串的bug,移除前后空行
Browse files Browse the repository at this point in the history
  • Loading branch information
xcanwin committed May 2, 2023
1 parent abe541c commit e483d92
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions KeepChatGPT.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name KeepChatGPT
// @description ChatGPT畅聊插件。解决所有报错,让我们的AI体验无比顺畅、丝滑、高效。持续更新的增强功能,如取消审计等。解决的报错如下: (1) NetworkError when attempting to fetch resource. (2) Something went wrong. If this issue persists please contact us through our help center at help.openai.com. (3) Conversation not found. (4) This content may violate our content policy.
// @version 11.4
// @version 11.5
// @author xcanwin
// @namespace https://github.com/xcanwin/KeepChatGPT/
// @supportURL https://github.com/xcanwin/KeepChatGPT/
Expand Down Expand Up @@ -669,10 +669,13 @@ nav {

const cloneChat = function() {
$$(".rounded-sm").forEach(function(e) {
if ($('text', this) && $('text', this).innerHTML === "ChatGPT") {
$('text', this).remove();
}
if (gv("k_clonechat", false) === true) {
e.style.cursor = "pointer";
e.onclick = function() {
const content = this.closest('div.text-base').innerText;
const content = this.closest('div.text-base').innerText.trim();
$("form.stretch textarea").value = "";
$("form.stretch textarea").focus();
document.execCommand('insertText', false, content);
Expand Down

0 comments on commit e483d92

Please sign in to comment.