From a3eae49337c6c163635b52dbe4323fcde5a889c9 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Fri, 10 Nov 2023 18:53:28 +0800 Subject: [PATCH] :sparkles: Adapt to new chatgpt --- src-tauri/src/inject/event.js | 6 +----- src-tauri/src/inject/style.js | 19 +++++++++---------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src-tauri/src/inject/event.js b/src-tauri/src/inject/event.js index dbea191..051b1a5 100644 --- a/src-tauri/src/inject/event.js +++ b/src-tauri/src/inject/event.js @@ -58,10 +58,6 @@ function externalTargetLink() { return ['zbook.lol'].indexOf(location.hostname) > -1; } -function externalSelfLink() { - return ['chat.openai.com'].indexOf(location.hostname) > -1; -} - document.addEventListener('DOMContentLoaded', () => { const tauri = window.__TAURI__; const appWindow = tauri.window.appWindow; @@ -170,7 +166,7 @@ document.addEventListener('DOMContentLoaded', () => { // case: download from dataURL -> convert dataURL -> } else if (url.startsWith('data:')) { downloadFromDataUri(url, filename); - } else if (isDownloadLink(url) || externalSelfLink()) { + } else if (isDownloadLink(url) || anchorEle.hostname !== window.location.host) { handleExternalLink(e, url); } }, true); diff --git a/src-tauri/src/inject/style.js b/src-tauri/src/inject/style.js index 5baccf8..8000afa 100644 --- a/src-tauri/src/inject/style.js +++ b/src-tauri/src/inject/style.js @@ -92,11 +92,20 @@ window.addEventListener('DOMContentLoaded', _event => { padding-top: 30px; } + #__next>div>div>.flex.h-screen.w-full.flex-col.items-center { + padding-top: 20px; + } + #__next .absolute .px-3.pt-2.pb-3.text-center { visibility: hidden; padding-bottom: 4px; } + #__next .h-full.w-full .text-center.text-xs.text-gray-600>span { + visibility: hidden; + height: 15px; + } + #__next > div.overflow-hidden.w-full.h-full.relative.flex > div.dark.hidden.flex-shrink-0.bg-gray-900.md\\:flex.md\\:w-\\[260px\\].md\\:flex-col > div > div > nav { width: 100%; } @@ -339,21 +348,11 @@ window.addEventListener('DOMContentLoaded', _event => { padding-top: 20px; } - #__next .overflow-hidden.w-full main.relative.h-full.w-full.flex-1{ - padding-bottom: 82px; - } - #__next > div.overflow-hidden.w-full.h-full main.relative.h-full.w-full.flex-1 > .flex-1.overflow-hidden .h-32.md\\:h-48.flex-shrink-0{ height: 0px; } } - @media (max-width:565px){ - #__next .overflow-hidden.w-full main.relative.h-full.w-full.flex-1{ - padding-bottom: 98px; - } - } - #__next .prose ol li p { margin: 0; display: inline;