Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name ChatGPT Continue button
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match https://chat.openai.com/
- // @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- // Your code here...
- // Create the button element
- const button = document.createElement("button");
- button.textContent = "Continue";
- button.id = "request-code-btn";
- button.style.padding = "2px";
- button.style.border = "none";
- button.style.borderRadius = "20px";
- button.style.color = "#fff";
- button.style.backgroundColor = "#6e6e80";
- button.style.fontSize = "10px";
- button.style.fontWeight = "150";
- button.style.marginBottom = "10px";
- button.style.width = "80px";
- // Add an event listener to the button
- button.addEventListener("click", function() {
- const textarea = document.querySelector('textarea[tabindex="0"]');
- if (!textarea.value.trim()) {
- textarea.value = "Continue";
- }
- const clickElement = document.querySelector('.absolute.p-1.rounded-md.text-gray-500.bottom-1.5.md\\:bottom-2.5.hover\\:bg-gray-100.enabled\\:dark\\:hover\\:text-gray-400.dark\\:hover\\:bg-gray-900.disabled\\:hover\\:bg-transparent.dark\\:disabled\\:hover\\:bg-transparent.right-1.md\\:right-2.disabled\\:opacity-40');
- clickElement.click();
- const textareaValue = textarea.value;
- const textareaParent = textarea.parentNode.parentNode;
- const nextTextarea = textareaParent.nextSibling.querySelector('textarea');
- nextTextarea.value = textareaValue;
- const newOption = document.createElement('option');
- newOption.value = textareaValue;
- const select = document.querySelector('.form-control.py-1');
- select.appendChild(newOption);
- textarea.value = '';
- if (textareaValue) {
- textarea.value = '';
- }
- const insertBeforeElement = document.querySelector('.flex.flex-col.w-full.py-2.flex-grow.md\\:py-3.md\\:pl-4.relative.border.border-black\\/10.bg-white.dark\\:border-gray-900\\/50');
- const container = insertBeforeElement.parentNode;
- container.insertBefore(button, insertBeforeElement);
- });
- // Insert the button before an element with the class ".flex.flex-col.w-full.py-2.flex-grow.md\:py-3.md\:pl-4.relative.border.border-black\/10.bg-white.dark\:border-gray-900\/50"
- const insertBeforeElement = document.querySelector('.flex.flex-col.w-full.py-2.flex-grow.md\\:py-3.md\\:pl-4.relative.border.border-black\\/10.bg-white.dark\\:border-gray-900\\/50');
- const container = insertBeforeElement.parentNode;
- container.insertBefore(button, insertBeforeElement);
- })();
Advertisement
Add Comment
Please, Sign In to add comment