// ==UserScript==
// @name ChatGPT Widescreen Mode 🖥️
// @name:af ChatGPT Widescreen Modus 🖥️
// @name:ar ChatGPT وضع شاشة عريضة 🖥️
// @name:az ChatGPT Geniş Ekran Rejimi 🖥️
// @name:be ChatGPT Рэжым шырокага экрана 🖥️
// @name:bg ChatGPT Широкоекранен режим 🖥️
// @name:bn ChatGPT উইডস্ক্রিন মোড 🖥️
// @name:bo ChatGPT རྒྱུ་ཆེན་གཞི་བསྒྲུབ་ རྒྱལ་བཤད། 🖥️
// @name:bs ChatGPT Režim širokog ekrana 🖥️
// @name:ca ChatGPT Mode de pantalla ampla 🖥️
// @name:ckb ChatGPT دەستکاری چوارچێوەی ڕووکاری 🖥️
// @name:cs ChatGPT Režim širokoúhlé obrazovky 🖥️
// @name:cy ChatGPT Mod Sgrin Lled 🖥️
// @name:da ChatGPT Bredformat-tilstand 🖥️
// @name:de ChatGPT Breitbildmodus 🖥️
// @name:dv ChatGPT ވިސްނުވެއް މޯޑި 🖥️
// @name:dz ChatGPT འབྲེལ་བ་གཞུང་ལས་སྤྱི་ཚོགས་གླེང་། 🖥️
// @name:el ChatGPT Λειτουργία ευρείας οθόνης 🖥️
// @name:eo ChatGPT Larĝekrana reĝimo 🖥️
// @name:es ChatGPT Modo de pantalla panorámica 🖥️
// @name:et ChatGPT Laiarakenduse režiim 🖥️
// @name:eu ChatGPT Pantaila Zabalaren Modua 🖥️
// @name:fa ChatGPT حالت تلویزیونی 🖥️
// @name:fi ChatGPT Laajakuva-tila 🖥️
// @name:fo ChatGPT Búðarformaður háttur 🖥️
// @name:fr ChatGPT Mode Écran Large 🖥️
// @name:fr-CA ChatGPT Mode Écran Large 🖥️
// @name:gd ChatGPT Dreach-sgrìn Leud 🖥️
// @name:gl ChatGPT Modo de pantalla ancha 🖥️
// @name:gu ChatGPT પ્રશાંત સ્ક્રીન મોડ 🖥️
// @name:he ChatGPT מצב מסך רחב 🖥️
// @name:hi ChatGPT चहचटजीपटी वाइडस्क्रीन मोड 🖥️
// @name:hr ChatGPT Način širokog zaslona 🖥️
// @name:ht ChatGPT Mod Fomat Gwo 🖥️
// @name:hu ChatGPT Szélesvásznú mód 🖥️
// @name:hy ChatGPT լայնէկրանանշանի ռեժիմ 🖥️
// @name:id ChatGPT Mode Layar Lebar 🖥️
// @name:is ChatGPT Breiðskjásstilling 🖥️
// @name:it ChatGPT Modalità schermo panoramica 🖥️
// @name:ja ChatGPT ワイドスクリーンモード 🖥️
// @name:jv ChatGPT Mode Layar Lebar 🖥️
// @name:ka ChatGPT ფანტსარიშის რეჟიმი 🖥️
// @name:kab ChatGPT Amezwaru n Tikliwin Isellalen 🖥️
// @name:kk ChatGPT Көлеңкескен түрі 🖥️
// @name:km ChatGPT របៀបបង្អស្សមួយធ្វើដំបូង 🖥️
// @name:kn ChatGPT ChatGPT ವೈಡ್ಸ್ಕ್ರೀನ್ ಮೋಡ್ 🖥️
// @name:ko ChatGPT 와이드 스크린 모드 🖥️
// @name:ku ChatGPT Moda Pêlên Dirêj 🖥️
// @name:ky ChatGPT Жогорку Экрандык Режим 🖥️
// @name:la ChatGPT Modus Latus Plenus 🖥️
// @name:lb ChatGPT Breitbild-Modus 🖥️
// @name:lo ChatGPT ຮູບແບບໂປຣຟອນໃຫຍ່ 🖥️
// @name:lt ChatGPT Išplėstojo ekrano režimas 🖥️
// @name:lv ChatGPT Plašā ekrāna režīms 🖥️
// @name:mg ChatGPT Tarehimarika tamin'ny Widescreen 🖥️
// @name:mi ChatGPT Āhua Whātika ā-Raupapa 🖥️
// @name:mk ChatGPT Режим на широк екран 🖥️
// @name:ml ChatGPT വൈഡ്സ്ക്രീൻ മോഡ് 🖥️
// @name:mn ChatGPT Жинхэнэ Экранны Арга 🖥️
// @name:ms ChatGPT Mod Skrin Lebar 🖥️
// @name:mt ChatGPT Modalità Widescreen 🖥️
// @name:my ChatGPT အများနှုန်းကျော်ဘုံ 🖥️
// @name:ne ChatGPT विस्तृत प्राण्डविक पद्धति 🖥️
// @name:nl ChatGPT Breedbeeldmodus 🖥️
// @name:no ChatGPT Bredskjermmodus 🖥️
// @name:ny ChatGPT Mawonekedwe Wathandiza 🖥️
// @name:pa ChatGPT ਵਾਇਡਸਕ੍ਰੀਨ ਮੋਡ 🖥️
// @name:pl ChatGPT Tryb szerokoekranowy 🖥️
// @name:ps ChatGPT د ډیسپلې موډ 🖥️
// @name:pt ChatGPT Modo Tela Larga 🖥️
// @name:pt-BR ChatGPT Modo Tela Larga 🖥️
// @name:ro ChatGPT Mod ecran lat 🖥️
// @name:ru ChatGPT Режим широкоформатного экрана 🖥️
// @name:rw ChatGPT Ibindi by'umuhondo bw'ishusho 🖥️
// @name:sg ChatGPT Mode Écran Large 🖥️
// @name:si ChatGPT විශේෂාංග පෙළක්ෂාව 🖥️
// @name:sk ChatGPT Režim širokouhlého displeja 🖥️
// @name:sl ChatGPT Način širokega zaslona 🖥️
// @name:sm ChatGPT Laititi Fuamatala 🖥️
// @name:sn ChatGPT Zvimwe Zvitsva Mode 🖥️
// @name:so ChatGPT hab Widescreen Mode 🖥️
// @name:sr ChatGPT Режим широког екрана 🖥️
// @name:sv ChatGPT Bredbildsläge 🖥️
// @name:sw ChatGPT Njia ya Skrini Panoramio 🖥️
// @name:ta ChatGPT விரிவான திரை முறை 🖥️
// @name:te ChatGPT ChatGPT వైడ్ స్క్రీన్ మోడ్ 🖥️
// @name:tg ChatGPT Возачи Режаи Дисплеи Барнома 🖥️
// @name:th ChatGPT โหมดหน้าจอแบบเต็มจอ 🖥️
// @name:ti ቻትጂፒቲ ዋይድስክሪን ሞድ 🖥️
// @name:tk ChatGPT Giň Ekran Tertibi 🖥️
// @name:tn ChatGPT Nyemba Yemba Mzizo 🖥️
// @name:to ChatGPT Moli ʻo e Ngaahi Fatongi ʻo Haʻaneesi 🖥️
// @name:tr ChatGPT Geniş Ekran Modu 🖥️
// @name:uk ChatGPT Режим широкого екрана 🖥️
// @name:ur ChatGPT وائڈ اسکرین موڈ 🖥️
// @name:uz ChatGPT Keng ekranga rejim 🖥️
// @name:vi ChatGPT Chế độ Màn hình Rộng 🖥️
// @name:xh ChatGPT Indlela ye-Widescreen Mode 🖥️
// @name:yi ChatGPT ווידעסקרעען מאָדע 🖥️
// @name:zh ChatGPT 宽屏模式 🖥️
// @name:zh-CN ChatGPT 宽屏模式 🖥️
// @name:zh-HK ChatGPT 寬螢幕模 🖥️
// @name:zh-SG ChatGPT 宽屏模式 🖥️
// @name:zh-TW ChatGPT 寬螢幕模 🖥️
// @name:zu ChatGPT Isimo sokudlalwa emkhumbini 🖥️
// @description Adds Widescreen + Fullscreen modes to chatgpt.com + perplexity.ai + poe.com for enhanced viewing + reduced scrolling
// @description:af Voeg Widescreen + Volledige skermmodusse by chatgpt.com + perplexity.ai + poe.com vir verbeterde kyk + verminderde skrol
// @description:am የራስ መጠን በ chatgpt.com + perplexity.ai + poe.com ውስጥ የተከፈተውን ወደ ትንቢት ማድረግ + ድምፅ እንዲታትና
// @description:ar إضافة وضعي الشاشة العريضة + الشاشة الكاملة إلى chatgpt.com + perplexity.ai + poe.com لتحسين العرض + تقليل التمرير
// @description:az chatgpt.com + perplexity.ai + poe.com üçün Geniş Ekran + Tam Ekran rejimləri əlavə etmək, görüntünü yaxşılaşdırmaq + səlahətən keçirməni azaltmaq
// @description:be Дадае рэжымы шырокага экрана + поўнага экрана да chatgpt.com + perplexity.ai + poe.com для паляпшэнага прагляду + змяншэння скролінгу
// @description:bem Ena Mode ya Widescreen + ya Fullscreen ku chatgpt.com + perplexity.ai + poe.com pa kuongeza kulandila + ukukonda scrolling
// @description:bg Добавя режими на Широк екран + Пълен екран към chatgpt.com + perplexity.ai + poe.com за подобрено гледане + намалено плъзгане
// @description:bn এক্স এগ্রিসিভ দেখার জন্য chatgpt.com + perplexity.ai + poe.com-এ ওয়াইডস্ক্রিন + ফুলস্ক্রিন মোড যুক্ত করে + স্ক্রলিং হ্রাস করে
// @description:bo བཅའ་དྲུག་རྒྱུས་པ་+ བདེ་ཆེན་རྒྱུས་པ་འདི་chatgpt.com + perplexity.ai + poe.com་ནང་ལས་བསྒྲགས་བཞག་བའི་ལྷག་པ་ཞིག་ཁམས་པའི་བརྟག་ཞིབ་བཅོ་སྒྲིག་འདུག
// @description:bs Dodaje Widescreen + Fullscreen režime chatgpt.com + perplexity.ai + poe.com-u za poboljšani prikaz + smanjenje klizanja
// @description:ca Afegeix els modes de pantalla ampla + pantalla completa a chatgpt.com + perplexity.ai + poe.com per a una visualització millorada + reducció de desplaçament
// @description:ceb Gidugang ang Mga Modo sa Widescreen + Fullscreen sa chatgpt.com + perplexity.ai + poe.com alang sa labaw nga pagtan-aw + paggamot sa pag-scroll
// @description:ckb Mode Widescreen + Mode Fullscreen bo chatgpt.com + perplexity.ai + poe.com zêde bike ji bo nêzîkbûna başkirinê + kam kirina birevandinê
// @description:cs Přidává režimy Widescreen + Fullscreen do chatgpt.com + perplexity.ai + poe.com pro zlepšené zobrazení + snížení posouvání
// @description:cy Ychwanega dulliau Sgrin Llydan + Sgrin Lawn i chatgpt.com + perplexity.ai + poe.com ar gyfer gwylio well + lleihau sgrolio
// @description:da Tilføjer Widescreen + Fuldscreen-tilstande til chatgpt.com + perplexity.ai + poe.com for forbedret visning + reduceret rulning
// @description:de Fügt Widescreen + Vollbildmodus zu chatgpt.com + perplexity.ai + poe.com für verbesserte Ansicht + reduziertes Scrollen hinzu
// @description:dv chatgpt.com + perplexity.ai + poe.com ބޮޓޮބޭސީ + ފަންވައިދާ މޯޑިއުލްއަޤް ހެދުމަށް ކަނޑުގެންނަވަން + ރުސަބް ބެންކުރުމަށްވެއްޖެ
// @description:dz chatgpt.com + perplexity.ai + poe.com སྒྲུབ་ཐབས་ + མིང་དཔྱད་ཆེས་དང་པ་ཡོངས་ཀྱི་ལྷག་པ་ཁྱབ་ལ་ཉོ་གར་བཞག་པ་དང་བདེན་པས་ཆེད་པ་དང་ཚིག་རྐྱང་ལ་མགོ་ནི་
// @description:el Προσθέτει λειτουργίες Widescreen + Fullscreen στο chatgpt.com + perplexity.ai + poe.com για βελτιωμένη προβολή + μείωση της κύλισης
// @description:eo Aldonas larĝekranajn + plenekranajn reĝimojn al chatgpt.com + perplexity.ai + poe.com por plibonigita vidado + malpliigo de ŝovado
// @description:es Agrega modos de pantalla panorámica + pantalla completa a chatgpt.com + perplexity.ai + poe.com para una visualización mejorada + desplazamiento reducido
// @description:et Lisab chatgpt.com + perplexity.ai + poe.com-le Widescreen + Täisekraani režiimid parema vaatamise ja vähenenud kerimisega
// @description:eu Gehitu Widescreen + Pantaila oso moduak chatgpt.com + perplexity.ai + poe.com-ra ikusmen hobetu + mugimendua gutxituz
// @description:fa اضافه کردن حالت های واید اسکرین + تمام صفحه به chatgpt.com + perplexity.ai + poe.com برای مشاهده بهتر + کاهش اسکرول
// @description:fi Lisää Widescreen + Koko näytön tilat chatgpt.com + perplexity.ai + poe.com:hen paremman katselun + vähentyneen vierityksen ansiosta
// @description:fo Leggur til Widescreen + Fullscreen hamrar á chatgpt.com + perplexity.ai + poe.com fyri bætta sýning + minnka skúvsetan
// @description:fr Ajoute les modes écran large + plein écran à chatgpt.com + perplexity.ai + poe.com pour une meilleure visualisation + un défilement réduit
// @description:fr-CA Ajoute les modes écran large + plein écran à chatgpt.com + perplexity.ai + poe.com pour une meilleure visualisation + un défilement réduit
// @description:gd Cuir gnèithean Leudachaidh + Faidhlichean sàbhaladh sgrùdair gu chatgpt.com + perplexity.ai + poe.com airson sealladh air àrdachadh + sgroladh lag
// @description:gl Engade os modos de pantalla panorámica + pantalla completa a chatgpt.com + perplexity.ai + poe.com para unha visualización mellorada + desprazamento reducido
// @description:gu એન્હાનો જોડાણ કરો વાઈડસ્ક્રીન + ફુલસ્ક્રીન મોડ તેમજ chatgpt.com + perplexity.ai + poe.com માટે સુધારેલ જોઈન્ટ પ્રદર્શન + કમેલી સ્ક્રોલિંગ માટે
// @description:haw Kālele i nā Ao Waiwai + Ao Piha i loko o chatgpt.com + perplexity.ai + poe.com no ka ho'ohana'ana ikaika + ka'u hā'ule 'ana
// @description:he מוסיף מצבי מסך מורחב + מסך מלא ל־chatgpt.com + perplexity.ai + poe.com לשיפור תצוגה + הפחתת גלילה
// @description:hi बढ़िया दृश्य + कम स्क्रोलिंग के लिए chatgpt.com + perplexity.ai + poe.com में वाइडस्क्रीन + फुलस्क्रीन मोड जोड़ता है
// @description:hr Dodaje Widescreen + Fullscreen načine na chatgpt.com + perplexity.ai + poe.com za poboljšani prikaz + smanjenje klizanja
// @description:ht Ajoute modes Widescreen + Fullscreen nan chatgpt.com + perplexity.ai + poe.com pou amelyore gade + redui defileman
// @description:hu Hozzáadja a Widescreen + Teljes képernyő módokat a chatgpt.com + perplexity.ai + poe.com-hoz jobb megtekintés + görgetés csökkentése érdekében
// @description:hy Ավելացնում է Widescreen + Fullscreen ռեժիմները chatgpt.com + perplexity.ai + poe.com-ում բարելավված դիտումի համար + սահմանափակումը
// @description:id Menambahkan mode Widescreen + Layar Penuh ke chatgpt.com + perplexity.ai + poe.com untuk penampilan yang lebih baik + pengurangan pengguliran
// @description:is Bætir við Widescreen + Fullskjárshamra í chatgpt.com + perplexity.ai + poe.com til að bæta sýn + draga úr skruni
// @description:it Aggiunge le modalità Widescreen + Schermo intero a chatgpt.com + perplexity.ai + poe.com per una visualizzazione migliorata + riduzione dello scorrimento
// @description:ja chatgpt.com + perplexity.ai + poe.comの表示を向上するために、ワイドスクリーン+フルスクリーンモードを追加します
// @description:jv Nambahi Modus Widescreen + Fullscreen menyang chatgpt.com + perplexity.ai + poe.com kanggo tampilan sing ditingkatake + ngecilake scrolling
// @description:ka დაამატებს Widescreen + Fullscreen რეჟიმებს chatgpt.com + perplexity.ai + poe.com-ში გაუმჯობესებული ნახვა + გამოკლებული გადადების მიზნით
// @description:kk chatgpt.com + perplexity.ai + poe.com-ге Widescreen + Fullscreen режимдерін қосу арқылы көрініс үздіктемелеу + скроллауды кеміту
// @description:km បន្ថែមរបៀប Widescreen + Fullscreen ទៅក្នុង chatgpt.com + perplexity.ai + poe.com សម្រាប់ការមើលឡើងប្រហែលជាក្រុមហ៊ុន + ការរងចាំខ្លួនឯងប៉ុណ្ណោះ
// @description:kn ಅಭ್ಯಾಸಕ್ರಮದ ದೃಷ್ಟಿಗೆ ಅನುಗುಣವಾಗಿ Widescreen + Fullscreen ಮೋಡ್ಗಳನ್ನು chatgpt.com + perplexity.ai + poe.comಗೆ ಸೇರಿಸುತ್ತದೆ
// @description:ko chatgpt.com + perplexity.ai + poe.com에 와이드스크린 + 전체화면 모드를 추가하여 개선된 화면 표시 + 스크롤 감소
// @description:ku Dihênîne modên Widescreen + Fullscreenê bo chatgpt.com + perplexity.ai + poe.comê ji bo pêşînkirina nîşandina + kêmkirina kayanînê
// @description:ky chatgpt.com + perplexity.ai + poe.com-го Widescreen + Fullscreen режимдору кошо аркылуу жакшы көрүнүштү + скроллоо жоготуу
// @description:la TV + Fullscreen modos addit chatgpt.com + perplexity.ai + poe.com ad augendam viewing + reducta scrolling
// @description:lb Füügt Widescreen + Fullscreen Modi dem chatgpt.com + perplexity.ai + poe.com bäi fir verbessert Visioun + reduzéiert Scrollen
// @description:lo ເພີ່ມຮູບແບບ Widescreen + Fullscreen ໃຫ້ໄດ້ຮຽນ chatgpt.com + perplexity.ai + poe.com ສຳເລັດຂອງການສະແດງອ້າງວ່າງ + ການປະເມີດໃຫ້ນ້ໍາຂາຍຫນ້າ
// @description:lt Prideda Widescreen + Fullscreen režimus į chatgpt.com + perplexity.ai + poe.com, siekiant pagerinti peržiūrą ir sumažinti slinkimą
// @description:lv Pievieno Widescreen + Fullscreen režīmus chatgpt.com + perplexity.ai + poe.com, lai uzlabotu skatīšanos + samazinātu ritināšanu
// @description:mg Mametraka ny fomba Widescreen + Fullscreen amin'ny chatgpt.com + perplexity.ai + poe.com mba handresy ny fandefasana + famindrampoana ny firotsahana
// @description:mi Ka whakarite ana i ngā āhuatanga Widescreen + Fullscreen ki te chatgpt.com + perplexity.ai + poe.com mō te whakaatu whakapai ake + te whakaiti i te whakararuraru
// @description:mk Додава режими на Widescreen + Fullscreen во chatgpt.com + perplexity.ai + poe.com за подобрување на приказот + намалување на скролирањето
// @description:ml വായ്ഡ്സ്ക്രീൻ + പൂർണ്ണസ്ക്രീൻ മോഡുകൾ ചേർക്കുന്നു chatgpt.com + perplexity.ai + poe.com-യിൽ മിക്കവാറും കാഴ്ചപ്പാട് + കുറവ് തിരിക്കൽ ചെയ്യുന്നതിന്
// @description:mn Widescreen + Fullscreen горимуудыг chatgpt.com + perplexity.ai + poe.com рүү нэмэх нь дэлгэцэнд хувцаслан + гүйлгээний эвдрэлдээ хянахыг оруулна
// @description:mr व्हाइडस्क्रीन + फुलस्क्रीन मोड्स चे chatgpt.com + perplexity.ai + poe.comमध्ये जोडले जातात व पाहणी वाढविण्यासाठी स्क्रोलिंग कमी करतात
// @description:ms Menambah mod Widescreen + Layar Penuh ke chatgpt.com + perplexity.ai + poe.com untuk tampilan yang lebih baik + pengurangan penatalan
// @description:mt Jiddoqq modes Widescreen + Fullscreen għal chatgpt.com + perplexity.ai + poe.com għall-viżwalizzazzjoni miġġielda + qasam it-telf
// @description:my ပိုမိုကောင်းမွန်သောကြည့်ရှုရန်အတွက် chatgpt.com + perplexity.ai + poe.com တွင် Widescreen + မျက်နှာပြင်အပြည့်မုဒ်များကို ထည့်သွင်းထားသည်။
// @description:ne सुधारिएको दृश्य + कम स्क्रोलिंगका लागि वाइडस्क्रिन + फुलस्क्रिन मोडहरूलाई chatgpt.com + perplexity.ai + poe.comमा थप्दछ
// @description:nl Voegt Widescreen + Fullscreen modi toe aan chatgpt.com + perplexity.ai + poe.com voor verbeterde weergave + verminderd scrollen
// @description:no Legger til Widescreen + Fullskjerm-moduser i chatgpt.com + perplexity.ai + poe.com for forbedret visning + redusert rulling
// @description:ny Ndiwonetsa zolengedwa + Zomwe zosowa ndi chatgpt.com + perplexity.ai + poe.com kwa kudzaza kuona + kuchotsa kupinda
// @description:pa ਵਿਸਤ੍ਰਿਤ ਦੇਖਣ ਲਈ chatgpt.com + perplexity.ai + poe.com ਵਿੱਚ ਵਾਈਡਸਕ੍ਰੀਨ + ਫੁੱਲਸਕ੍ਰੀਨ ਮੋਡ ਸ਼ਾਮਲ ਕਰਦਾ ਹੈ + ਘਟੀ ਹੋਈ ਸਕ੍ਰੌਲਿੰਗ
// @description:pl Dodaje tryby Widescreen + Fullscreen do chatgpt.com + perplexity.ai + poe.com dla lepszej widoczności + zmniejszonego przewijania
// @description:ps ځانګړې + ټولې پرده په chatgpt.com + perplexity.ai + poe.com کې اضافه کړي لپاره لاسرسی ترلاسه کړي + کوښښول په کمته
// @description:pt Adiciona modos Widescreen + Tela cheia ao chatgpt.com + perplexity.ai + poe.com para visualização aprimorada + rolagem reduzida
// @description:pt-BR Adiciona modos Widescreen + Tela cheia ao chatgpt.com + perplexity.ai + poe.com para visualização aprimorada + rolagem reduzida
// @description:ro Adaugă modurile Widescreen + Ecran complet la chatgpt.com + perplexity.ai + poe.com pentru vizualizare îmbunătățită + defilare redusă
// @description:ru Добавляет режимы Widescreen + Fullscreen в chatgpt.com + perplexity.ai + poe.com для улучшенного просмотра + сокращенной прокрутки
// @description:rw Ongeraho Mugari Mugari + Byuzuye Mugaragaza kuri chatgpt.com + perplexity.ai + poe.com kugirango ubone kureba neza + kugabanya umuzingo
// @description:sg Ajoute les modes écran large + plein écran à chatgpt.com + perplexity.ai + poe.com pour une meilleure visualisation + un défilement réduit
// @description:si chatgpt.com + perplexity.ai + poe.com සඳහා Widescreen + Fullscreen ප්රදර්ශනයක් එක් කරයි තවත් පෙන්වන්නේ දැන් සිතූවාසිකාරක්ෂක විසින් සහ කෙසේදැයි ඇති අගයන් හුස්ම ක්රියාවලියකි
// @description:sk Pridáva Widescreen + Fullscreen režimy do chatgpt.com + perplexity.ai + poe.com pre vylepšené zobrazenie + zníženie posúvania
// @description:sl Dodaja Widescreen + Fullscreen načine v chatgpt.com + perplexity.ai + poe.com za izboljšan prikaz + zmanjšano premikanje
// @description:sm Faamauina Widescreen + Fullscreen faavae i le chatgpt.com + perplexity.ai + poe.com mo le faailoga faapea le mafaufau + le auina faavaivai
// @description:sn Ongorora Mutaundi wa Widescreen + Fullscreen muchatgpt.com + perplexity.ai + poe.com kutora dzokubvumidzwa + kusha kusweropfuura
// @description:so Wax ka beddelaa Hababka Widescreen + Fullscreen ee chatgpt.com + perplexity.ai + poe.com si aad u fiirsato + si aad u yaraato garaabinta
// @description:sq Shton modalitete Widescreen + Fullscreen në chatgpt.com + perplexity.ai + poe.com për pamje të përmirësuar + ulje të skrollimit
// @description:sr Додаје режиме широког екрана + целог екрана на chatgpt.com + perplexity.ai + poe.com за побољшано гледање + смањено померање
// @description:st E ngolisitsoe mokhabo Widescreen + Fullscreen ho chatgpt.com + perplexity.ai + poe.com bakeng sa mofuta ona le ho fokotsa liphalantere
// @description:sv Lägger till Widescreen + Fullscreen-lägen i chatgpt.com + perplexity.ai + poe.com för förbättrad visning + minskad scrollning
// @description:sw Inaongeza modes Widescreen + Fullscreen kwenye chatgpt.com + perplexity.ai + poe.com kwa kuimarisha kuonyesha + kupunguza kusokota
// @description:ta chatgpt.com + perplexity.ai + poe.com க்கு அகலத்திரை + முழுத்திரை முறைகளைச் சேர்க்கிறது + மேம்படுத்தப்பட்ட பார்வைக்கு + குறைக்கப்பட்ட ஸ்க்ரோலிங்
// @description:te Widescreen + Fullscreen మోడ్లను chatgpt.com + perplexity.ai + poe.comకి చేర్చుకోవడంతో చంపుకునే వీక్షణ కనిపించడానికి స్క్రోల్ తక్కువగా మార్చండి
// @description:tg Маводиҳои Widescreen + Fullscreen-ро ба chatgpt.com + perplexity.ai + poe.com илова мекунад, барои кӯҳнашудаи намоиш + кам кардани скроллаш
// @description:th เพิ่มโหมดจอแบบ Widescreen + Fullscreen ใน chatgpt.com + perplexity.ai + poe.com สำหรับการดูที่ดีขึ้น + การเลื่อนลดลง
// @description:ti ንዝለዓለ ምርኣይ + ምጉዳል ምዝዋር ኣብ chatgpt.com + perplexity.ai + poe.com Widescreen + Fullscreen modes ይውስኽ
// @description:tk Giňeldilen görmek + peseltmek üçin chatgpt.com + perplexity.ai + poe.com-ä giň ekran + Doly ekran reesimlerini goşýar
// @description:tl Nagdaragdag ng mga mode ng Widescreen + Fullscreen sa chatgpt.com + perplexity.ai + poe.com para sa pinabuting pagtingin + pinaikling pag-scroll
// @description:tn Inowedzera Widescreen + Fullscreen modes kuchatgpt.com + perplexity.ai + poe.com yekuwedzera kutarisa + kuderedzwa kupuruzira
// @description:to Hoʻohui i ka Widescreen + Fullscreen modes i chatgpt.com + perplexity.ai + poe.com no ka hoʻonui ʻia ʻana o ka nānā ʻana + hoʻemi i ka ʻōwili ʻana
// @description:tr Geliştirilmiş görüntüleme + azaltılmış kaydırma için chatgpt.com + perplexity.ai + poe.com'ye Widescreen + Fullscreen modları ekler
// @description:tt chatgpt.com + perplexity.ai + poe.com-га Widescreen + Fullscreen рәжимләрен өстәәдегезгә, күрүләштеңләри үткәргә + скроллауны буянтартарга
// @description:ug chatgpt.com + perplexity.ai + poe.comغا Widescreen + Fullscreen كۆرۈنمە پەسەند قىلىش+يىتىپ ئاجرا قىلىش مۆچىيى
// @description:uk Додає режими Widescreen + Fullscreen до chatgpt.com + perplexity.ai + poe.com для поліпшеного перегляду + зменшення прокрутки
// @description:ur ترقی یافتہ دیکھائی کے لئے chatgpt.com + perplexity.ai + poe.com میں وائڈ اسکرین + پوری اسکرین موڈز شامل کرتا ہے
// @description:uz chatgpt.com + perplexity.ai + poe.com-ga Widescreen + Fullscreen rejimlarini qo'shadi, ko'rishni yaxshilash + aylantirishni kamaytirish uchun
// @description:vi Thêm chế độ Widescreen + Fullscreen vào chatgpt.com + perplexity.ai + poe.com để cải thiện hiển thị + giảm cuộn trang
// @description:wo Bëgg na ñiis-ñiis Widescreen + Fullscreen ci chatgpt.com + perplexity.ai + poe.com buñ leen waxtu dib lu jàmm + ñaari jëm
// @description:xh Enza izimvo Widescreen + Fullscreen kwakuhlanganiselelwa kwichatgpt.com + perplexity.ai + poe.com ukuze kube khona okukhulu + kokucima kwesithombe
// @description:yi מוסיף Widescreen + Fullscreen מאָדעס צו chatgpt.com + perplexity.ai + poe.com פֿאַר ימפּרוווד וויוינג + רידוסט סקראָללינג
// @description:yo Fi àwọn ohun ọrọ Widescreen + Fullscreen si chatgpt.com + perplexity.ai + poe.com fun iwọle aiyewo + iwọle ififunwọle
// @description:zh 向 chatgpt.com + perplexity.ai + poe.com 添加宽屏 + 全屏模式以增强查看效果 + 减少滚动
// @description:zh-CN 向 chatgpt.com + perplexity.ai + poe.com 添加宽屏 + 全屏模式以增强查看效果 + 减少滚动
// @description:zh-HK 向 chatgpt.com + perplexity.ai + poe.com 添加寬屏 + 全屏模式以增強查看效果 + 減少滾動
// @description:zh-SG 向 chatgpt.com + perplexity.ai + poe.com 添加宽屏 + 全屏模式以增强查看效果 + 减少滚动
// @description:zh-TW 向 chatgpt.com + perplexity.ai + poe.com 添加寬屏 + 全屏模式以增強查看效果 + 減少滾動
// @description:zu Yengeza Isikrini Esibanzi + Izindlela Zesikrini Esigcwele ku-chatgpt.com + perplexity.ai + poe.com ukuze uthole ukubuka okuthuthukisiwe + okuncishisiwe ukuskrola
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2024.12.22
// @license MIT
// @icon https://media.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon48.png?9a393be
// @icon64 https://media.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon64.png?9a393be
// @compatible chrome
// @compatible firefox
// @compatible edge
// @compatible opera
// @compatible brave
// @compatible vivaldi
// @compatible librewolf
// @compatible ghost
// @compatible qq
// @match *://chatgpt.com/*
// @match *://chat.openai.com/*
// @match *://*.perplexity.ai/*
// @match *://poe.com/*
// @connect cdn.jsdelivr.net
// @connect update.greasyfork.org
// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.4.0/dist/chatgpt.min.js#sha256-LfB3mqeB6Xiq2BDub1tn3BtvEiMcaWEp+I094MFpA+Q=
// @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@50fc700ea40e796015a0ccbcf6097ec43aa4c654/chrome/extension/components/modals.js#sha256-f5d0jrL7XuKohKZMypvZcX0A61U11w0dM8HZazw3B/8=
// @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@15c2d82616f95eebfcb7ed98bf63fbbbfa19cc71/chrome/extension/lib/dom.js#sha256-q8/Xm3k9wcj0qWmIkrDSa3rowIyjjIzG44Q2bZkHfF0=
// @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@7fa71708a5e8587e322c222640e75ad78e94925e/chrome/extension/lib/settings.js#sha256-+eJZpeHRSC3tGzlY5ytQwjIkW1OFAx+ooxEpFdX9tc8=
// @resource brsCSS https://assets.aiwebextensions.com/styles/rising-stars/dist/black.min.css?v=0cde30f9ae3ce99ae998141f6e7a36de9b0cc2e7#sha256-4nbm81/JSas4wmxFIdliBBzoEEHRZ057TpzNX1PoQIs=
// @resource wrsCSS https://assets.aiwebextensions.com/styles/rising-stars/dist/white.min.css?v=0cde30f9ae3ce99ae998141f6e7a36de9b0cc2e7#sha256-pW8xWWV6tm8Q6Ms+HWZv6+QzzTLJPyL1DyE18ywpVaE=
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_registerMenuCommand
// @grant GM_unregisterMenuCommand
// @grant GM_getResourceText
// @grant GM_xmlhttpRequest
// @grant GM.xmlHttpRequest
// @noframes
// @homepageURL https://www.chatgptwidescreen.com
// @supportURL https://support.chatgptwidescreen.com
// @contributionURL https://github.com/sponsors/adamlui
// ==/UserScript==
// Documentation: https://docs.chatgptwidescreen.com
// NOTE: This script relies on the powerful chatgpt.js library @ https://chatgpt.js.org
// © 2023–2024 KudoAI & contributors under the MIT license.
(async () => {
// Init ENV context
const env = {
browser: {
language: chatgpt.getUserLanguage(), isFF: chatgpt.browser.isFirefox(), isMobile: chatgpt.browser.isMobile()
},
scriptManager: {
name: (() => { try { return GM_info.scriptHandler } catch (err) { return 'unknown' }})(),
version: (() => { try { return GM_info.version } catch (err) { return 'unknown' }})()
},
site: /([^.]+)\.[^.]+$/.exec(location.hostname)[1]
}
env.browser.isPortrait = env.browser.isMobile && (window.innerWidth < window.innerHeight)
env.scheme = getScheme()
const xhr = typeof GM != 'undefined' && GM.xmlHttpRequest || GM_xmlhttpRequest
// Init APP data
const app = {
version: GM_info.script.version, configKeyPrefix: `${env.site} Widescreen`,
chatgptJSver: /chatgpt\.js@([\d.]+)/.exec(GM_info.scriptMetaStr)[1], urls: {},
latestAssetCommitHash: 'e1c7f06' // for cached app.json + messages.json
}
app.urls.assetHost = `https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@${app.latestAssetCommitHash}`
const remoteAppData = await new Promise(resolve => xhr({
method: 'GET', url: `${app.urls.assetHost}/data/app.json`,
onload: resp => resolve(JSON.parse(resp.responseText))
}))
Object.assign(app, { ...remoteAppData, urls: { ...app.urls, ...remoteAppData.urls }})
app.urls.update = app.urls.greasyFork.replace('https://', 'https://update.')
.replace(/(\d+)-?([a-z-]*)$/i, (_, id, name) => `${id}/${ name || 'script' }.meta.js`)
app.msgs = {
appName: app.name,
appAuthor: app.author.name,
appDesc: 'Adds Widescreen + Fullscreen modes to ChatGPT for enhanced viewing + reduced scrolling',
menuLabel_fullerWins: 'Fuller Windows',
menuLabel_tallerChatbox: 'Taller Chatbox',
menuLabel_widerChatbox: 'Wider Chatbox',
menuLabel_newChatBtn: 'New Chat Button',
menuLabel_hiddenHeader: 'Hidden Header',
menuLabel_hiddenFooter: 'Hidden Footer',
menuLabel_btnAnimations: 'Button Animations',
menuLabel_modeNotifs: 'Mode Notifications',
menuLabel_about: 'About',
menuLabel_donate: 'Please send a donation',
menuLabel_disabled: 'Disabled (extension installed)',
about_version: 'Version',
about_poweredBy: 'Powered by',
about_openSourceCode: 'Open source code',
mode_wideScreen: 'Wide screen',
mode_fullWindow: 'Full-window',
mode_fullScreen: 'Full screen',
tooltip_wideScreenON: 'Wide screen',
tooltip_wideScreenOFF: 'Exit wide screen',
tooltip_fullWindowON: 'Full-window mode',
tooltip_fullWindowOFF: 'Exit full window',
tooltip_fullScreenON: 'Full screen',
tooltip_fullScreenOFF: 'Exit full screen',
tooltip_newChat: 'New chat',
helptip_fullerWins: 'Also activate Wide Screen when activating Full-Window',
helptip_tallerChatbox: 'Expand the chatbox vertically',
helptip_widerChatbox: 'Expand the chatbox horizontally in Wide Screen mode',
helptip_newChatBtn: 'Show New Chat button in chatbox',
helptip_hiddenFooter: 'Hide site footer',
helptip_hiddenHeader: 'Hide site header',
helptip_btnAnimations: 'Animate chatbar buttons on hover',
helptip_modeNotifs: 'Show notifications when toggling modes/settings',
alert_choosePlatform: 'Choose a platform',
alert_updateAvail: 'Update available',
alert_newerVer: 'An update to',
alert_isAvail: 'is available',
alert_upToDate: 'Up-to-date',
alert_isUpToDate: 'is up-to-date',
alert_showYourSupport: 'Show your support',
alert_isOSS: 'is open-source software built & maintained for free through 100% volunteer efforts',
alert_despiteAffliction: 'Despite being severely afflicted by',
alert_longCOVID: 'long COVID',
alert_since2020: 'since 2020',
alert_byDonatingResults: 'by donating, you help me to continue improving, fixing bugs, adding new features, and making the software even better',
alert_yourContrib: 'Your contribution',
alert_noMatterSize: 'no matter the size',
alert_directlySupports: 'directly supports my unpaid efforts to ensure this project remains free and open for all to use',
alert_tyForSupport: 'Thank you for your support',
alert_author: 'author',
alert_pressF11: 'Press F11 to exit full screen',
alert_f11reason: 'F11 was used to enter full screen, and due to browser security reasons, the same key must be used to exit it',
btnLabel_moreAIextensions: 'More AI Extensions',
btnLabel_rateUs: 'Rate Us',
btnLabel_getSupport: 'Get Support',
btnLabel_checkForUpdates: 'Check for Updates',
btnLabel_update: 'Update',
btnLabel_dismiss: 'Dismiss',
link_viewChanges: 'View changes',
state_on: 'on',
state_off: 'off'
}
// LOCALIZE app.msgs for non-English users
if (!env.browser.language.startsWith('en')) {
const localizedMsgs = await new Promise(resolve => {
const msgHostDir = app.urls.assetHost + '/chrome/extension/_locales/',
msgLocaleDir = ( env.browser.language ? env.browser.language.replace('-', '_') : 'en' ) + '/'
let msgHref = msgHostDir + msgLocaleDir + 'messages.json', msgXHRtries = 0
function fetchMsgs() { xhr({ method: 'GET', url: msgHref, onload: handleMsgs })}
function handleMsgs(resp) {
try { // to return localized messages.json
const msgs = JSON.parse(resp.responseText), flatMsgs = {}
for (const key in msgs) // remove need to ref nested keys
if (typeof msgs[key] == 'object' && 'message' in msgs[key])
flatMsgs[key] = msgs[key].message
resolve(flatMsgs)
} catch (err) { // if bad response
msgXHRtries++ ; if (msgXHRtries == 3) return resolve({}) // try original/region-stripped/EN only
msgHref = env.browser.language.includes('-') && msgXHRtries == 1 ? // if regional lang on 1st try...
msgHref.replace(/([^_]+_[^_]+)_[^/]*(\/.*)/, '$1$2') // ...strip region before retrying
: ( msgHostDir + 'en/messages.json' ) // else use default English messages
fetchMsgs()
}
}
fetchMsgs()
})
Object.assign(app.msgs, localizedMsgs)
}
// Init SITE profiles
const sites = Object.assign(Object.create(null), await new Promise(resolve => xhr({
method: 'GET', url: `${app.urls.assetHost}/data/sites.json`,
onload: resp => resolve(JSON.parse(resp.responseText))
})))
sites.openai = { ...sites.chatgpt } // shallow copy to cover old domain
// Export DEPENDENCIES to imported resources
dom.dependencies.import({ env }) // for env.scheme
modals.dependencies.import({ app, env, updateCheck }) // for app data + env.scheme + update callback in modals.about
settings.dependencies.import({ app }) // for app.msgs + app.configKeyPrefix refs
// Init SETTINGS
settings.load(sites[env.site].availFeatures)
// Define MENU functions
const menu = {
ids: [], state: {
symbols: ['❌', '✔️'], separator: env.scriptManager.name == 'Tampermonkey' ? ' — ' : ': ',
words: [app.msgs.state_off.toUpperCase(), app.msgs.state_on.toUpperCase()]
},
register() {
const tooltipsSupported = env.scriptManager.name == 'Tampermonkey'
&& parseInt(env.scriptManager.version.split('.')[0]) >= 5
// Show "Disabled (extension installed)"
if (env.extensionInstalled)
GM_registerMenuCommand(`${menu.state.symbols[0]} ${app.msgs.menuLabel_disabled}`,
() => modals.open('about'), tooltipsSupported ? { title: ' ' } : undefined )
// ...or add settings toggles
else Object.keys(settings.controls).forEach(key => {
if (sites[env.site].availFeatures.includes(key)) {
const settingIsEnabled = config[key] ^ key.includes('Disabled')
const menuLabel = `${ settings.controls[key].symbol || menu.state.symbols[+settingIsEnabled] } `
+ settings.controls[key].label
+ menu.state.separator + menu.state.words[+settingIsEnabled]
menu.ids.push(GM_registerMenuCommand(menuLabel, () => {
settings.save(key, !config[key]) ; sync.configToUI({ updatedKey: key })
notify(`${settings.controls[key].label}: ${
menu.state.words[+(key.includes('Disabled') ^ config[key])]}`)
}, tooltipsSupported ? { title: settings.controls[key].helptip || ' ' } : undefined))
}
})
// Add About entry
const aboutLabel = `💡 ${app.msgs.menuLabel_about} ${app.msgs.appName}`
menu.ids.push(GM_registerMenuCommand(aboutLabel, () => modals.open('about'),
tooltipsSupported ? { title: ' ' } : undefined ))
// Add Donate entry
if (!env.extensionInstalled) {
const donateLabel = `💖 ${app.msgs.menuLabel_donate}`
menu.ids.push(GM_registerMenuCommand(donateLabel, () => modals.open('donate'),
tooltipsSupported ? { title: ' ' } : undefined ))
}
},
refresh() {
if (typeof GM_unregisterMenuCommand == 'undefined') return
for (const id of menu.ids) { GM_unregisterMenuCommand(id) } menu.register()
}
}
function updateCheck() {
xhr({
method: 'GET', url: app.urls.update + '?t=' + Date.now(),
headers: { 'Cache-Control': 'no-cache' },
onload: resp => {
// Compare versions, alert if update found
app.latestVer = /@version +(.*)/.exec(resp.responseText)[1]
for (let i = 0 ; i < 4 ; i++) { // loop thru subver's
const currentSubVer = parseInt(app.version.split('.')[i], 10) || 0,
latestSubVer = parseInt(app.latestVer.split('.')[i], 10) || 0
if (currentSubVer > latestSubVer) break // out of comparison since not outdated
else if (latestSubVer > currentSubVer) // if outdated
return modals.open('update', 'available')
}
// Alert to no update found, nav back to About
modals.open('update', 'unavailable')
}})
}
// Define FEEDBACK functions
function notify(msg, pos = '', notifDuration = '', shadow = '') {
if (config.notifDisabled && !msg.includes(app.msgs.menuLabel_modeNotifs)) return
// Strip state word to append colored one later
const foundState = menu.state.words.find(word => msg.includes(word))
if (foundState) msg = msg.replace(foundState, '')
// Show notification
chatgpt.notify(`${app.symbol} ${msg}`, pos, notifDuration, shadow || env.scheme == 'dark' ? '' : 'shadow')
const notif = document.querySelector('.chatgpt-notif:last-child')
// Append styled state word
if (foundState) {
const styledStateSpan = dom.create.elem('span')
styledStateSpan.style.cssText = `color: ${
foundState == menu.state.words[0] ? '#ef4848 ; text-shadow: rgba(255, 169, 225, 0.44) 2px 1px 5px'
: '#5cef48 ; text-shadow: rgba(255, 250, 169, 0.38) 2px 1px 5px' }`
styledStateSpan.append(foundState) ; notif.append(styledStateSpan)
}
}
// Define CHATBAR functions
const chatbar = {
get() {
let chatbar = document.querySelector(sites[env.site].selectors.input)
const parentLvls = /chatgpt|openai/.test(env.site) ? 3 : 2
for (let i = 0 ; i < parentLvls ; i++) chatbar = chatbar?.parentNode
return chatbar
},
tweak() {
if (!/chatgpt|openai/.test(env.site)) return
const chatbarDiv = chatbar.get() ; if (!chatbarDiv) return
const inputArea = chatbarDiv.querySelector(sites[env.site].selectors.input) ; if (!inputArea) return
if (chatgpt.canvasIsOpen()) inputArea.parentNode.style.width = '100%'
else if (!env.tallChatbar) { // narrow it to not clash w/ buttons
const widths = { chatbar: chatbarDiv.getBoundingClientRect().width }
const visibleBtnTypes = [...btns.getVisibleTypes(), 'send']
visibleBtnTypes.forEach(type =>
widths[type] = btns[type]?.getBoundingClientRect().width
|| document.querySelector(`${sites[env.site].selectors.btns.send}, ${
sites[env.site].selectors.btns.stop}`)?.getBoundingClientRect().width || 0 )
const totalBtnWidths = visibleBtnTypes.reduce((sum, btnType) => sum + widths[btnType], 0)
inputArea.parentNode.style.width = `${ // expand to close gap w/ buttons
widths.chatbar - totalBtnWidths -( env.browser.isFF ? 60 : 43 )}px`
inputArea.style.width = '100%' // rid h-scrollbar
}
}
}
// Define BUTTON props/functions
const btns = {
types: [ 'fullScreen', 'fullWindow', 'wideScreen', 'newChat' ], // right-to-left
class: `${app.name.replace(/ /g, '-').toLowerCase()}-btn`,
svgElems: {
fullScreen: {
off: [
dom.create.svgElem('path', { stroke: 'none', d: 'm10,16 2,0 0,-4 4,0 0,-2 L 10,10 l 0,6 0,0 z' }),
dom.create.svgElem('path', { stroke: 'none', d: 'm20,10 0,2 4,0 0,4 2,0 L 26,10 l -6,0 0,0 z' }),
dom.create.svgElem('path', { stroke: 'none', d: 'm24,24 -4,0 0,2 L 26,26 l 0,-6 -2,0 0,4 0,0 z' }),
dom.create.svgElem('path',
{ stroke: 'none', d: 'M 12,20 10,20 10,26 l 6,0 0,-2 -4,0 0,-4 0,0 z' }) ],
on: [
dom.create.svgElem('path', { stroke: 'none', d: 'm14,14-4,0 0,2 6,0 0,-6 -2,0 0,4 0,0 z' }),
dom.create.svgElem('path', { stroke: 'none', d: 'm22,14 0,-4 -2,0 0,6 6,0 0,-2 -4,0 0,0 z' }),
dom.create.svgElem('path', { stroke: 'none', d: 'm20,26 2,0 0,-4 4,0 0,-2 -6,0 0,6 0,0 z' }),
dom.create.svgElem('path', { stroke: 'none', d: 'm10,22 4,0 0,4 2,0 0,-6 -6,0 0,2 0,0 z' }) ]
},
fullWin: [
dom.create.svgElem('rect',
{ fill: 'none', x: '3', y: '3', width: '17', height: '17', rx: '2', ry: '2' }),
dom.create.svgElem('line', { x1: '9', y1: '3', x2: '9', y2: '21' })
],
newChat: [ dom.create.svgElem('path', { stroke: 'none', d: 'M22,13h-4v4h-2v-4h-4v-2h4V7h2v4h4V13z' }) ],
wideScreen: {
off: [
dom.create.svgElem('path', { stroke: 'none', 'fill-rule': 'evenodd',
d: 'm28,11 0,14 -20,0 0,-14 z m-18,2 16,0 0,10 -16,0 0,-10 z' }) ],
on: [
dom.create.svgElem('path', { stroke: 'none', 'fill-rule': 'evenodd',
d: 'm26,13 0,10 -16,0 0,-10 z m-14,2 12,0 0,6 -12,0 0,-6 z' }) ]
}
},
create() {
if (/chatgpt|openai/.test(env.site) && chatbar.get()?.nextElementSibling && !env.tallChatbar)
env.tallChatbar = true
const validBtnTypes = this.types.filter(type =>
!(type == 'fullWindow' && !sites[env.site].hasSidebar)
&& !(type == 'wideScreen' && chatgpt.canvasIsOpen()))
const bOffset = env.site == 'poe' ? 1.1 : env.site == 'perplexity' ? -13 : env.tallChatbar ? 31 : -8.85
const rOffset = env.site == 'poe' ? -6.5 : env.site == 'perplexity' ? -4 : env.tallChatbar ? 48 : -0.25
validBtnTypes.forEach(async (btnType, idx) => {
this[btnType] = dom.create.elem('div')
this[btnType].id = btnType + '-btn' // for toggle.tooltip()
this[btnType].className = this.class // for update.style.tweaks()
Object.assign(this[btnType].style, {
position: env.tallChatbar ? 'absolute' : 'relative', cursor: 'pointer',
right: `${ rOffset + idx * bOffset }px` // position left of prev button
})
if (env.tallChatbar) this[btnType].style.bottom = '8.85px'
else this[btnType].style.top = `${ /chatgpt|openai/.test(env.site) ? -3.25
: env.site == 'poe' ? ( btnType == 'newChat' ? 0.25 : 3 ) : 0 }px`
if (/chatgpt|openai|perplexity/.test(env.site)) { // assign classes + tweak styles
const btnSelectors = sites[env.site].selectors.btns
const rightBtnSelector = `${btnSelectors.send}, ${btnSelectors.voice}`
const rightBtn = await new Promise(resolve => {
const rightBtn = document.querySelector(rightBtnSelector)
if (rightBtn) resolve(rightBtn)
else new MutationObserver((_, obs) => {
const rightBtn = document.querySelector(rightBtnSelector)
if (rightBtn) { obs.disconnect() ; resolve(rightBtn) }
}).observe(document.body, { childList: true, subtree: true })
})
this[btnType].classList.add(...(rightBtn?.classList || []))
Object.assign(btns[btnType].style, { // remove dark mode overlay
backgroundColor: 'transparent', borderColor: 'transparent' })
}
// Add hover/click listeners
this[btnType].onmouseover = this[btnType].onmouseout = toggle.tooltip
this[btnType].onclick = () => {
if (btnType == 'newChat') {
document.querySelector(sites[env.site].selectors.btns.newChat)?.click()
tooltipDiv.style.opacity = 0
} else toggle.mode(btnType)
}
})
},
insert() {
if (this.status?.startsWith('insert') || document.getElementById('fullScreen-btn')) return
this.status = 'inserting' ; if (!this.wideScreen) this.create()
// Init elems
const chatbarDiv = chatbar.get() ; if (!chatbarDiv) return
const btnTypesToInsert = this.types.slice().reverse() // to left-to-right for insertion order
.filter(type => !(type == 'fullWindow' && !sites[env.site].hasSidebar)
&& !(type == 'wideScreen' && chatgpt.canvasIsOpen()))
const parentToInsertInto = /chatgpt|openai/.test(env.site) ? chatbarDiv.nextElementSibling || chatbarDiv
: chatbarDiv.lastChild // (Perplexity Pro spam toggle or Poe Mic/Send btns) parent
const elemToInsertBefore = /chatgpt|openai/.test(env.site) ? parentToInsertInto.lastChild
: parentToInsertInto.firstChild // Pro spam toggle or Poe Mic btn
// Insert buttons
btnTypesToInsert.forEach(btnType => {
this.update.svg(btnType) // update icon
parentToInsertInto.insertBefore(this[btnType], elemToInsertBefore)
})
parentToInsertInto.insertBefore(tooltipDiv, elemToInsertBefore) // add tooltips
setTimeout(() => chatbar.tweak(), 1) ; this.update.color()
this.status = 'inserted'
},
remove() {
if (!chatbar.get() || !document.getElementById('fullScreen-btn')) return
this.types.forEach(type => this[type]?.remove()) ; tooltipDiv?.remove()
this.status = 'missing' // ensure next btns.insert() doesn't return early
},
update: {
color() {
btns.color = (
/chatgpt|openai/.test(env.site) ? (
document.querySelector('.dark.bg-black') || env.scheme == 'dark' ? 'white' : '#202123' )
: env.site == 'perplexity' ? (
document.documentElement.dataset.colorScheme == 'dark' ?
'oklch(var(--dark-text-color-100)/var(--tw-text-opacity))'
: 'oklch(var(--text-color-100)/var(--tw-text-opacity))' )
: 'currentColor' )
if (btns.wideScreen?.style.fill != btns.color)
btns.types.forEach(type => {
if (btns[type]) btns[type].style.fill = btns[type].style.stroke = btns.color })
},
svg(mode, state = '') {
if (!btns.wideScreen) btns.create()
// Pick appropriate button/elements
const [btn, ONelems, OFFelems] = (
mode == 'fullScreen' ? [btns.fullScreen, btns.svgElems.fullScreen.on, btns.svgElems.fullScreen.off]
: mode == 'fullWindow' ? [btns.fullWindow, btns.svgElems.fullWin, btns.svgElems.fullWin]
: mode == 'wideScreen' ? [btns.wideScreen, btns.svgElems.wideScreen.on, btns.svgElems.wideScreen.off]
: [btns.newChat, btns.svgElems.newChat, btns.svgElems.newChat])
if (!btn) return
// Set SVG attributes
const btnSVG = btn?.querySelector('svg') || dom.create.svgElem('svg')
if (mode == 'fullWindow') { // stylize full-window button
btnSVG.setAttribute('stroke-width', '2')
const btnSize = /chatgpt|openai/.test(env.site) ? 17 : 18
btnSVG.setAttribute('height', btnSize) ; btnSVG.setAttribute('width', btnSize)
}
btnSVG.setAttribute('viewBox', (
mode == 'newChat' ? '11 6 ' : mode == 'fullWindow' ? '-2 -0.5 ' : '8 8 ' )
+ ( mode == 'newChat' ? '13 13' : mode == 'fullWindow' ? '24 24' : '20 20' )
)
btnSVG.style.pointerEvents = 'none' // prevent triggering tooltips twice
btnSVG.style.height = btnSVG.style.width = ( // override button resizing
/chatgpt|openai/.test(env.site) ? '1.3rem' : 18 )
// Update SVG elements
btnSVG.textContent = ''
const svgElems = config[mode] || state.toLowerCase() == 'on' ? ONelems : OFFelems
svgElems.forEach(elem => btnSVG.append(elem))
// Update SVG
if (!btn.contains(btnSVG)) btn.append(btnSVG)
}
},
getVisibleTypes() { // used in update.tooltip() + chatbar.tweak() for horizontal math
return this.types.filter(type =>
!(type == 'fullWindow' && !sites[env.site].hasSidebar)
&& !(type == 'wideScreen' && chatgpt.canvasIsOpen())
&& !(type == 'newChat' && config.ncbDisabled))
}
}
// Define UPDATE functions
const update = {
style: {
chatbar() {
chatbarStyle.innerText = (
/chatgpt|openai/.test(env.site) ? ( config.widerChatbox ? ''
: `main form { max-width: ${chatbar.nativeWidth}px !important ; margin: auto }` )
: env.site == 'poe' ? ( config.widerChatbox && config.wideScreen ?
'[class^=ChatPageMainFooter_footerInner] { width: 98% ; margin-right: 15px }' : '' )
: '' )
},
tweaks() {
tweaksStyle.innerText = (
( /chatgpt|openai/.test(env.site) ? (
( '[id$=-btn]:hover { opacity: 100% !important }' ) // prevent chatbar btn dim on hover
+ 'main { overflow: clip !important }' // prevent h-scrollbar...
// ...on sync.mode('fullWindow) => delayed chatbar.tweak()
) : env.site == 'perplexity' ?
`.${btns.class} { transition: none }` : '' )) // prevent chatbar btn animation on hover-off
+ ( config.tcbDisabled == false ? tcbStyle : '' ) // expand text input vertically
+ ( config.hiddenHeader ? hhStyle : '' ) // hide header
+ ( config.hiddenFooter ? hfStyle : '' ) // hide footer
+ `#newChat-btn { display: ${ config.ncbDisabled == true ? 'none' : 'flex' }}`
+ ( !config.btnAnimationsDisabled ? // zoom chatbar buttons on hover
( `.${btns.class}:hover {`
+ `transform: scale(${ env.site == 'poe' ? 1.15 : 1.285}) ;`
+ 'transition: transform 0.15s ease }' ) : ''
)
},
wideScreen() {
wideScreenStyle.innerText = (
/chatgpt|openai/.test(env.site) ? (
'.text-base { max-width: 100% !important }' // widen outer container
+ ( !env.tallChatbar ? '.text-base:nth-of-type(2) { max-width: 97% !important }' : '' )
) : env.site == 'perplexity' ? (
`${sites.perplexity.selectors.header} ~ div,` // outer container
+ `${sites.perplexity.selectors.header} ~ div > div` // inner container
+ '{ max-width: 100% }' // ...widen them
+ '.col-span-8 { width: 154% }' // widen inner-left container
+ '.col-span-4 { width: 13.5% ; position: absolute ; right: 0 }' // narrow right-bar
) : env.site == 'poe' ? (
'[class*=ChatMessagesView] { width: 100% !important }' // widen outer container
+ '[class^=Message] { max-width: 100% !important }' ) // widen speech bubbles
: '' )
}
},
tooltip(btnType) { // text & position
const visibleBtnTypes = btns.getVisibleTypes()
const ctrAddend = ( env.site == 'perplexity' ? ( location.pathname == '/' ? 94 : 105 )
: env.site == 'poe' ? 35 : 13 ) +25
const spreadFactor = env.site == 'perplexity' ? 26.5 : env.site == 'poe' ? 28 : 30.55
const iniRoffset = spreadFactor * ( visibleBtnTypes.indexOf(btnType) +1 ) + ctrAddend
+ ( env.tallChatbar ? -2 : 4 )
tooltipDiv.innerText = app.msgs['tooltip_' + btnType + (
!/full|wide/i.test(btnType) ? '' : (config[btnType] ? 'OFF' : 'ON'))]
tooltipDiv.style.right = `${ // x-pos
iniRoffset - tooltipDiv.getBoundingClientRect().width /2 }px`
tooltipDiv.style.bottom = ( // y-pos
env.site == 'perplexity' ? ( location.pathname != '/' ? '58px' :
( document.querySelector(sites.perplexity.selectors.btns.settings) ? 'revert-layer' : '50.5vh' ))
: '50px' )
}
}
// Define TOGGLE functions
const toggle = {
mode(mode, state = '') {
switch (state.toUpperCase()) {
case 'ON' : activateMode(mode) ; break
case 'OFF' : deactivateMode(mode) ; break
default : ( mode == 'wideScreen' ? document.head.contains(wideScreenStyle)
: mode == 'fullWindow' ? isFullWin() : chatgpt.isFullScreen() ) ? deactivateMode(mode)
: activateMode(mode)
}
function activateMode(mode) {
if (mode == 'wideScreen') { document.head.append(wideScreenStyle) ; sync.mode('wideScreen') }
else if (mode == 'fullWindow') {
const sidebarToggle = document.querySelector(sites[env.site].selectors.btns.sidebarToggle)
if (sidebarToggle) sidebarToggle.click()
else { document.head.append(fullWinStyle) ; sync.mode('fullWindow') }
} else if (mode == 'fullScreen') document.documentElement.requestFullscreen()
}
function deactivateMode(mode) {
if (mode == 'wideScreen') {
wideScreenStyle.remove() ; sync.mode('wideScreen')
} else if (mode == 'fullWindow') {
const sidebarToggle = document.querySelector(sites[env.site].selectors.btns.sidebarToggle)
if (sidebarToggle) sidebarToggle.click()
else { fullWinStyle.remove() ; sync.mode('fullWindow') }
} else if (mode == 'fullScreen') {
if (config.f11) modals.alert(app.msgs.alert_pressF11, `${app.msgs.alert_f11reason}.`)
else document.exitFullscreen().catch(
err => console.error(app.symbol + ' » Failed to exit fullscreen', err))
}
}
},
tooltip(event) {
update.tooltip(event.currentTarget.id.replace(/-btn$/, ''))
tooltipDiv.style.opacity = event.type == 'mouseover' ? 1 : 0
}
}
// Define SYNC functions
const sync = {
fullerWin() {
if (config.fullWindow && config.fullerWindows && !config.wideScreen) { // activate fuller windows
document.head.append(wideScreenStyle) ; btns.update.svg('wideScreen', 'on')
} else if (!config.fullWindow) { // de-activate fuller windows
fullWinStyle.remove() // to remove style too so sidebar shows
if (!config.wideScreen) { // disable widescreen if result of fuller window
wideScreenStyle.remove() ; btns.update.svg('wideScreen', 'off')
}}
},
mode(mode) { // setting + icon + tooltip + chatbar
const state = ( mode == 'wideScreen' ? !!document.getElementById('wideScreen-mode')
: mode == 'fullWindow' ? isFullWin()
: chatgpt.isFullScreen() )
settings.save(mode, state) ; btns.update.svg(mode) ; update.tooltip(mode)
if (mode == 'fullWindow') sync.fullerWin()
if (/chatgpt|openai/.test(env.site)) setTimeout(() => chatbar.tweak(), // update inner width
mode == 'fullWindow' && ( config.wideScreen || config.fullerWindows )
&& config.widerChatbox ? 111 : 0) // delay if toggled to/from active WCB to avoid wrong width
else if (env.site == 'poe' && config.widerChatbox) update.style.chatbar() // sync WCB
notify(`${app.msgs[`mode_${mode}`]} ${app.msgs[`state_${ state ? 'on' : 'off' }`].toUpperCase()}`)
config.modeSynced = true ; setTimeout(() => config.modeSynced = false, 100) // prevent repetition
},
configToUI() { // from toolbar menu toggles
sync.fullerWin() // sync FW
update.style.tweaks() // sync TCB/NCB/HH/HF/BA
update.style.chatbar() // sync WCB
chatbar.tweak() // update chatgpt.com chatbar inner width
menu.refresh() // to update state symbol/suffix
}
}
// Define UI functions
function getScheme() {
const rootElem = document.documentElement
return env.site == 'perplexity' ? rootElem.dataset.colorScheme : rootElem.className
|| (window.matchMedia?.('(prefers-color-scheme: dark)')?.matches ? 'dark' : 'light')
}
function isFullWin() {
return env.site == 'poe' ? !!document.getElementById('fullWindow-mode')
: !sites[env.site].hasSidebar // false if sidebar non-existent
|| /\d+/.exec(getComputedStyle(document.querySelector(
sites[env.site].selectors.sidebar))?.width || '')[0] < 100
}
chatgpt.canvasIsOpen = function() {
return document.querySelector('section.popover')?.getBoundingClientRect().top == 0 }
// Run MAIN routine
// Create browser TOOLBAR MENU or DISABLE SCRIPT if extension installed
env.extensionInstalled = await Promise.race([
new Promise(resolve => {
(function checkExtensionInstalled() {
if (document.documentElement.hasAttribute('chatgpt-widescreen-extension-installed')) resolve(true)
else setTimeout(checkExtensionInstalled, 200)
})()
}), new Promise(resolve => setTimeout(() => resolve(false), 1500))])
menu.register() ; if (env.extensionInstalled) return
// Init UI props
if (/chatgpt|openai/.test(env.site)) {
sites[env.site].hasSidebar = await Promise.race([
dom.elemIsLoaded(sites[env.site].selectors.btns.sidebarToggle), // true if sidebar toggle loads
dom.elemIsLoaded(sites[env.site].selectors.btns.login).then(() => false), // false if login button loads
new Promise(resolve => setTimeout(() => resolve(null), 3000)) // null if 3s passed
])
}
// Init FULL-MODE states
config.fullScreen = chatgpt.isFullScreen()
if (sites[env.site].selectors.btns.sidebarToggle) // site has native FW state
config.fullWindow = isFullWin() // ...so match it
else settings.load('fullWindow') // otherwise load CWM's saved state
// Stylize ALERTS
if (!document.getElementById('chatgpt-alert-override-style')) {
const chatgptAlertStyle = dom.create.style()
chatgptAlertStyle.id = 'chatgpt-alert-override-style'
chatgptAlertStyle.innerText = (
( env.scheme == 'dark' ? '.chatgpt-modal > div { border: 1px solid white }' : '' )
)
document.head.append(chatgptAlertStyle)
}
// Create/stylize TOOLTIP div
const tooltipDiv = dom.create.elem('div', { class: 'cwm-tooltip' })
document.head.append(dom.create.style('.cwm-tooltip {'
+ 'background-color: rgba(0, 0, 0, 0.71) ; padding: 5px ; border-radius: 6px ; border: 1px solid #d9d9e3 ;'
+ 'font-size: 0.85rem ; color: white ;' // font style
+ 'box-shadow: 4px 6px 16px 0 rgb(0 0 0 / 38%) ;' // drop shadow
+ 'position: absolute ; bottom: 58px ; opacity: 0 ; transition: opacity 0.1s ; z-index: 9999 ;' // visibility
+ '-webkit-user-select: none ; -moz-user-select: none ; -ms-user-select: none ; user-select: none }'
))
// Create/apply general style TWEAKS
const tweaksStyle = dom.create.style()
const tcbStyle = ( // heighten chatbox
/chatgpt|openai/.test(env.site) ? `div[class*=prose]:has(${sites[env.site].selectors.input})`
: sites[env.site].selectors.input )
+ '{ max-height: 68vh }'
const hhStyle = sites[env.site].selectors.header + '{ display: none !important }' // hide header
+ ( /chatgpt|openai/.test(env.site) ? 'main { padding-top: 12px }' : '' ) // increase top-padding
const hfStyle = sites[env.site].selectors.footer + '{ display: none }' // hide footer
update.style.tweaks() ; document.head.append(tweaksStyle);
// Add STARS styles
['brs', 'wrs'].forEach(cssType => document.head.append(dom.create.style(GM_getResourceText(`${cssType}CSS`))))
// Create WIDESCREEN style
const wideScreenStyle = dom.create.style()
wideScreenStyle.id = 'wideScreen-mode' // for sync.mode()
if (!chatbar.get()) await dom.elemIsLoaded(sites[env.site].selectors.input)
if (/chatgpt|openai/.test(env.site)) // store native chatbar width for Wider Chatbox style
chatbar.nativeWidth = /\d+/.exec(getComputedStyle(document.querySelector('main form')).width)[0]
update.style.wideScreen()
// Create FULL-WINDOW style
const fullWinStyle = dom.create.style()
fullWinStyle.id = 'fullWindow-mode' // for sync.mode()
fullWinStyle.innerText = sites[env.site].selectors.sidebar + '{ display: none }'
// Create/append CHATBAR style
const chatbarStyle = dom.create.style()
update.style.chatbar() ; document.head.append(chatbarStyle)
// Insert BUTTONS
btns.insert()
// Restore PREV SESSION's state
if (config.wideScreen) toggle.mode('wideScreen', 'ON')
if (config.fullWindow && sites[env.site].hasSidebar) {
if (sites[env.site].selectors.btns.sidebarToggle) // site has own FW config
sync.mode('fullWindow') // ...so sync w/ it
else toggle.mode('fullWindow', 'on') // otherwise self-toggle
}
// Monitor NODE CHANGES to maintain button visibility + update colors
let isTempChat = false, canvasWasOpen = chatgpt.canvasIsOpen()
new MutationObserver(() => {
// Maintain button visibility on nav
if (!document.getElementById('fullScreen-btn') && chatbar.get() && btns.status != 'inserting') {
btns.status = 'missing' ; btns.insert() }
// Maintain button colors + Widescreen button visibility on snowflake chatgpt.com
if (/chatgpt|openai/.test(env.site)) {
// Update button colors on temp chat toggle
const chatbarIsBlack = !!document.querySelector('div[class*=bg-black]:not([id$=-btn])')
if (chatbarIsBlack != isTempChat) { btns.update.color() ; isTempChat = chatbarIsBlack }
// Add/remove Widescreen button on Canvas mode toggle
if (canvasWasOpen ^ chatgpt.canvasIsOpen()) {
btns.remove() ; btns.create() // again for new h-offsets
btns.insert() ; chatbar.tweak() ; canvasWasOpen = !canvasWasOpen
}
}
}).observe(document[env.site == 'poe' ? 'head' : 'body'], { attributes: true, subtree: true })
// Monitor SCHEME PREF changes to update sidebar toggle + modal colors
new MutationObserver(handleSchemePrefChange).observe( // for site scheme pref changes
document.documentElement, { attributes: true, attributeFilter: ['class', 'data-color-scheme'] })
window.matchMedia('(prefers-color-scheme: dark)').addEventListener( // for browser/system scheme pref changes
'change', () => requestAnimationFrame(handleSchemePrefChange))
function handleSchemePrefChange() {
const displayedScheme = getScheme()
if (env.scheme != displayedScheme) { env.scheme = displayedScheme ; modals.stylize() ; btns.update.color() }
}
// Monitor SIDEBAR to update full-window setting
if (sites[env.site].selectors.btns.sidebarToggle && sites[env.site].hasSidebar) {
const sidebarObserver = new MutationObserver(async () => {
await new Promise(resolve => setTimeout(resolve, env.site == 'perplexity' ? 500 : 0))
if ((config.fullWindow ^ isFullWin()) && !config.modeSynced) sync.mode('fullWindow')
})
setTimeout(() => { // delay half-sec before observing to avoid repeated toggles from node observer
let obsTarget = document.querySelector(sites[env.site].selectors.sidebar)
if (env.site == 'perplexity') obsTarget = obsTarget.parentNode
sidebarObserver.observe(obsTarget, { attributes: true })
}, 500)
}
// Add RESIZE LISTENER to update full screen setting/button + disable F11 flag
window.addEventListener('resize', () => {
const fullScreenState = chatgpt.isFullScreen()
if (config.fullScreen && !fullScreenState) { // exiting full screen
sync.mode('fullScreen') ; config.f11 = false }
else if (!config.fullScreen && fullScreenState) // entering full screen
sync.mode('fullScreen')
if (/chatgpt|openai/.test(env.site)) chatbar.tweak() // update ChatGPT chatbar inner width
})
// Add KEY LISTENER to enable flag on F11 + stop generating text on ESC
document.addEventListener('keydown', event => {
if ((event.key == 'F11' || event.keyCode == 122) && !config.fullScreen) config.f11 = true
else if ((event.key.startsWith('Esc') || event.keyCode == 27) && !chatgpt.isIdle()) chatgpt.stop()
})
})()