Skip to content

Instantly share code, notes, and snippets.

@masterflitzer
Last active November 29, 2023 15:41
Show Gist options
  • Save masterflitzer/894efc4ddd91ac8c8fadb7fc54b4e3b3 to your computer and use it in GitHub Desktop.
Save masterflitzer/894efc4ddd91ac8c8fadb7fc54b4e3b3 to your computer and use it in GitHub Desktop.
Make ChatGPT window wider

ChatGPT Wide

  • Open a chat on ChatGPT
  • Create a bookmark in your browser and paste javascript: followed by the minified code into the URL input field (Bookmarklet)
  • Alternatively: Open the browser DevTools (F12) and paste the code into the console

Minify

terser --compress --mangle --output chatgpt-wide.min.js chatgpt-wide.js
(() => {
const maxWidthClassSubstring = "max-w-";
const elements = Array.from(
document.querySelectorAll(`[class*=${maxWidthClassSubstring}]`)
);
const classes = new Set(
elements
.map((x) => Array.from(x.classList))
.flat()
.filter((x) => x.includes(maxWidthClassSubstring))
);
for (const e of elements) {
for (const c of classes) {
e.classList.remove(c);
}
}
for (const form of document.querySelectorAll("form")) {
form.style.paddingInline = "1rem";
}
})();
(()=>{const o="max-w-",e=Array.from(document.querySelectorAll(`[class*=${o}]`)),r=new Set(e.map((o=>Array.from(o.classList))).flat().filter((e=>e.includes(o))));for(const o of e)for(const e of r)o.classList.remove(e);for(const o of document.querySelectorAll("form"))o.style.paddingInline="1rem"})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment