Skip to content

Commit

Permalink
修复部分功能失效的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xcanwin committed May 3, 2024
1 parent 84cb074 commit ccb7bf0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions KeepChatGPT.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name KeepChatGPT
// @description 这是一款提高ChatGPT的数据安全能力和效率的插件。并且免费共享大量创新功能,如:自动刷新、保持活跃、数据安全、取消审计、克隆对话、言无不尽、净化页面、展示大屏、展示全屏、拦截跟踪、日新月异等。让我们的AI体验无比安全、顺畅、丝滑、高效、简洁。
// @version 24.7
// @version 24.8
// @author xcanwin
// @namespace https://github.com/xcanwin/KeepChatGPT/
// @supportURL https://github.com/xcanwin/KeepChatGPT/
Expand Down Expand Up @@ -868,7 +868,7 @@
/*净化页面*/
.kpurifypage {
main .text-token-text-primary .font-medium /*首页的LOGO下方的问候语*/,
form.stretch .grow .bottom-full /*首页的快捷提示词*/,
form.w-full .grow .bottom-full /*首页的快捷提示词*/,
main form .text-token-text-secondary /*输入框上方标签*/,
main div.text-center>span /*输入框底部标签*/,
nav.flex .mb-4 /*侧边栏的游客模式的登录提醒*/
Expand Down Expand Up @@ -917,7 +917,7 @@ nav div.pt-3\\.5 {
.flex.text-base .lg\\:w-\\[calc\\(100\\%-115px\\)\\] {
width: calc(100% - 72px);
}
form.stretch {
form.w-full {
max-width: 85%;
}
}
Expand Down Expand Up @@ -1181,8 +1181,8 @@ nav.flex .transition-all {
if (avatarDiv) {
const contentSelector = ".max-w-full .text-message";
const content = $(contentSelector, findParent(avatarDiv, "main div.text-base", 2)).innerText.trim();
$("form.stretch textarea").value = "";
$("form.stretch textarea").focus();
$("form.w-full textarea").value = "";
$("form.w-full textarea").focus();
document.execCommand('insertText', false, content);
}
};
Expand All @@ -1205,7 +1205,7 @@ nav.flex .transition-all {

const speakCompletely = function() {
if (gv("k_speakcompletely", false) === true) {
const continue_svg_selector = `form.stretch .justify-center polygon[points="11 19 2 12 11 5 11 19"]:not(.ct_clicked)`;
const continue_svg_selector = `form.w-full .justify-center polygon[points="11 19 2 12 11 5 11 19"]:not(.ct_clicked)`;
if ($(continue_svg_selector)) {
setTimeout(function() {
findParent($(continue_svg_selector), `button`).click();
Expand All @@ -1217,19 +1217,19 @@ nav.flex .transition-all {

const dataSec = function() {
if (gv("k_datasecblocklist", datasec_blocklist_default)) {
$("form.stretch textarea")?.addEventListener('input', dataSec.listen_input);
$("form.w-full textarea")?.addEventListener('input', dataSec.listen_input);
} else {
$("form.stretch textarea")?.removeEventListener('input', dataSec.listen_input);
$("form.w-full textarea")?.removeEventListener('input', dataSec.listen_input);
}
};

dataSec.listen_input = function(event) {
let ms = [];
gv("k_datasecblocklist", datasec_blocklist_default).split(`\n`).forEach(e => {
if (e) {
const m = $("form.stretch textarea").value.match(e);
const m = $("form.w-full textarea").value.match(e);
if (m && m[0]) {
$("form.stretch textarea").value = $("form.stretch textarea").value.replaceAll(m[0], ``);
$("form.w-full textarea").value = $("form.w-full textarea").value.replaceAll(m[0], ``);
ms.push(m[0]);
}
}
Expand Down

0 comments on commit ccb7bf0

Please sign in to comment.