From 93e68293996322496c7cec8b6c1c7905def99de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Lui=20=E5=88=98=E5=B1=95=E9=B9=8F?= Date: Thu, 12 Sep 2024 14:22:57 -0700 Subject: [PATCH] Updated `chatgpt.getNewChatButton()` to work in Logged Out session --- chatgpt.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/chatgpt.js b/chatgpt.js index cd6dbcfe8..f26325ab2 100644 --- a/chatgpt.js +++ b/chatgpt.js @@ -891,10 +891,8 @@ const chatgpt = { // eslint-disable-line no-redeclare getLastResponse() { return chatgpt.getChatData('active', 'msg', 'chatgpt', 'latest'); }, getNewChatButton() { - for (const navBtnSVG of document.querySelectorAll('nav button svg')) - if (navBtnSVG.querySelector('path[d^="M15.6729"], ' // pencil-on-pad icon - + 'path[d^="M3.06957"]')) // refresh icon if temp chat - return navBtnSVG.parentNode; + return document.querySelector('button:has([d*="M15.6729"],' // pencil-on-pad icon + + '[d^="M3.06957"])'); // refresh icon if temp chat }, getNewChatLink() { return document.querySelector('nav a[href="/"]'); },