|
235 | 235 | // @description:zu Thuthukisa iChatGPT ngemodi zesikrini ezibanzi/egcwele/ephezulu + imodi yokuvimbela i-spam. Futhi isebenza ku-perplexity.ai + poe.com!
|
236 | 236 | // @author Adam Lui
|
237 | 237 | // @namespace https://github.com/adamlui
|
238 |
| -// @version 2025.4.2 |
| 238 | +// @version 2025.4.4 |
239 | 239 | // @license MIT
|
240 | 240 | // @icon https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@844b16e/assets/images/icons/widescreen-robot-emoji/icon48.png
|
241 | 241 | // @icon64 https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@844b16e/assets/images/icons/widescreen-robot-emoji/icon64.png
|
|
258 | 258 | // @require https://cdn.jsdelivr.net/npm/json5@2.2.3/dist/index.min.js#sha256-S7ltnVPzgKyAGBlBG4wQhorJqYTehj5WQCrADCKJufE=
|
259 | 259 | // @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@5d3db9c/chromium/extension/lib/chatbar.js#sha256-KIIufXI7xyuVFSrj2NW0RQGloNEl80tzuBgxaOsCMB8=
|
260 | 260 | // @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@58c2d29/chromium/extension/lib/dom.js#sha256-WXPxvMnJU6LGvINaENBbmvGXTAcAlXlBkyGwIDGXiC4=
|
261 |
| -// @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@7ed283d/chromium/extension/lib/settings.js#sha256-XQWeorSHtTm0rLz9FCXtU2rSk8ds0Tgj11Pw7a4Tfz4= |
| 261 | +// @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@64cf12b/chromium/extension/lib/settings.js#sha256-ziqiWd1wvVZSmdEiIgSNZoCjpwkC2MQz1f+j8oxVCSk= |
262 | 262 | // @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@f9ebcb0/chromium/extension/lib/ui.js#sha256-Bg82hwdZyJAORV7B6Vg3uIxQ8qnJhCsU624NyjQrKcA=
|
263 |
| -// @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@580df55/chromium/extension/components/buttons.js#sha256-FVFZm8EPXN3HPg89qxbWlfWc6AOQMA1BXtg9kbyTPIQ= |
| 263 | +// @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@64cf12b/chromium/extension/components/buttons.js#sha256-eXxLKmtD3a44Tq6OQ2af1+RYHytldxHY89VEtK+9qVc= |
264 | 264 | // @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@d96f327/chromium/extension/components/icons.js#sha256-lrAx3C5E0gugnjUHqw/wLamG7aE9UTCfAJwM0WM8jjo=
|
265 | 265 | // @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@7c41d55/chromium/extension/components/modals.js#sha256-ETMRpzM8O1ymtxnc3dhYcogck069jEysN2PVqFeX74s=
|
266 | 266 | // @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@7ed283d/chromium/extension/components/tooltip.js#sha256-8ifKNrnKJ6b9oQ6aY7FM6SnqTYJ1IOUcvEbMHt8dVsA=
|
|
311 | 311 | version: GM_info.script.version, configKeyPrefix: `${env.site} Widescreen`,
|
312 | 312 | chatgptJSver: /chatgpt\.js@([\d.]+)/.exec(GM_info.scriptMetaStr)[1],
|
313 | 313 | urls: { update: 'https://gm.chatgptwidescreen.com' },
|
314 |
| - latestResourceCommitHash: '5307431' // for cached app.json + sites.json5 + messages.json |
| 314 | + latestResourceCommitHash: 'ea045a9' // for cached app.json + sites.json5 + messages.json |
315 | 315 | }
|
316 | 316 | app.urls.resourceHost = `https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@${app.latestResourceCommitHash}`
|
317 | 317 | const remoteAppData = await new Promise(resolve => xhr({
|
|
330 | 330 | menuLabel_hiddenHeader: 'Hidden Header',
|
331 | 331 | menuLabel_hiddenFooter: 'Hidden Footer',
|
332 | 332 | menuLabel_btnAnimations: 'Button Animations',
|
| 333 | + menuLabel_btnVisibility: 'Button Visibility', |
333 | 334 | menuLabel_modeNotifs: 'Mode Notifications',
|
334 | 335 | menuLabel_blockSpam: 'Spam Block',
|
335 | 336 | menuLabel_siteSettings: 'Site Settings',
|
|
359 | 360 | helptip_hiddenFooter: 'Hide site footer',
|
360 | 361 | helptip_hiddenHeader: 'Hide site header',
|
361 | 362 | helptip_btnAnimations: 'Animate chatbar buttons on hover',
|
| 363 | + helptip_btnVisibility: 'Show custom buttons in chatbar', |
362 | 364 | helptip_modeNotifs: 'Show notifications when toggling modes/settings',
|
363 | 365 | helptip_blockSpam: 'Hide spam banners from cluttering the page',
|
364 | 366 | helptip_enableDisable: 'Enable/disable',
|
|
808 | 810 | update.style.tweaks() // sync TCB/NCB/HH/HF/BA
|
809 | 811 | update.style.chatbar() // sync WCB
|
810 | 812 | chatbar.tweak() // update ChatGPT chatbar inner width or hack other sites' button positions
|
811 |
| - buttons.insert() // since .remove()'d when script disabled |
| 813 | + buttons[config.btnsVisible ? 'insert' : 'remove']() // update button visibility |
812 | 814 | if (options?.updatedKey == 'btnAnimationsDisabled' && !config.btnAnimationsDisabled) // apply/remove fx
|
813 | 815 | // ...to visually signal location + preview fx applied by Button Animations toggle-on
|
814 | 816 | buttons.animate()
|
|
892 | 894 | update.style.chatbar() ; document.head.append(chatbarStyle)
|
893 | 895 |
|
894 | 896 | // Insert BUTTONS
|
895 |
| - if (!config[`${env.site}Disabled`]) { |
| 897 | + if (!config[`${env.site}Disabled`] && config.btnsVisible) { |
896 | 898 | buttons.insert()
|
897 | 899 |
|
898 | 900 | // Restore PREV SESSION's state
|
|
909 | 911 | new MutationObserver(async () => {
|
910 | 912 |
|
911 | 913 | // Maintain button visibility on nav
|
912 |
| - if (config[`${env.site}Disabled`]) return |
| 914 | + if (config[`${env.site}Disabled`] || !buttons.visible) return |
913 | 915 | else if (!buttons.fullscreen?.isConnected && !chatgpt.canvasIsOpen()
|
914 | 916 | && await chatbar.get() && buttons.state.status != 'inserting'
|
915 | 917 | ) { buttons.state.status = 'missing' ; buttons.insert() }
|
|
0 commit comments