From e1e6fef1e025a24c6be6c87474c1c3d9fd53c92b Mon Sep 17 00:00:00 2001 From: "adamlui@protonmail.com" Date: Thu, 9 May 2024 06:18:41 -0700 Subject: [PATCH] Added `chatgpt.getFooterDiv()` + alias --- chatgpt.js | 2 ++ docs/USERGUIDE.md | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/chatgpt.js b/chatgpt.js index c2d733870..7cd863857 100644 --- a/chatgpt.js +++ b/chatgpt.js @@ -858,6 +858,7 @@ const chatgpt = { // eslint-disable-line no-redeclare return svg.parentNode.parentNode; }}, + getFooterDiv: function() { return document.querySelector('main form').parentNode.parentNode.nextElementSibling; }, getHeaderDiv: function() { return document.querySelector('main .sticky'); }, getLastPrompt: function() { return chatgpt.getChatData('active', 'msg', 'user', 'latest'); }, getLastResponse: function() { return chatgpt.getChatData('active', 'msg', 'chatgpt', 'latest'); }, @@ -1878,6 +1879,7 @@ const functionAliases = [ ['detectLanguage', 'getLanguage'], ['executeCode', 'codeExecute'], ['exportChat', 'chatExport', 'export'], + ['getFooterDiv', 'getFooter'], ['getHeaderDiv', 'getHeader'], ['getLastPrompt', 'getLastQuery', 'getMyLastMsg', 'getMyLastQuery'], ['getTextarea', 'getTextArea', 'getChatbox', 'getChatBox'], diff --git a/docs/USERGUIDE.md b/docs/USERGUIDE.md index c10970cc5..e19e50a01 100644 --- a/docs/USERGUIDE.md +++ b/docs/USERGUIDE.md @@ -73,6 +73,7 @@ - [DOM related](#dom-related) - [getChatBox](#getchatbox) - [getContinueGeneratingButton](#getcontinuegeneratingbutton) + - [getFooterDiv](#getfooterdiv) - [getHeaderDiv](#getheaderdiv) - [getNewChatLink](#getnewchatlink) - [getRegenerateButton](#getregeneratebutton) @@ -1082,6 +1083,17 @@ const continueBtn = chatgpt.getContinueGeneratingButton(); continueBtn.click(); ``` +### getFooterDiv + +Returns the footer div as an HTML element. + +Example code: + +```js +const footerDiv = chatgpt.getFooterDiv(); +footerDiv.style.padding = '15px'; // make the footer taller +``` + ### getHeaderDiv Returns the header div as an HTML element.