|
220 | 220 | // @description:zu *NGOKUPHEPHA* susa ukusetha kabusha ingxoxo yemizuzu eyi-10 + amaphutha enethiwekhi ahlala njalo + Ukuhlolwa kwe-Cloudflare ku-ChatGPT.
|
221 | 221 | // @author Adam Lui
|
222 | 222 | // @namespace https://github.com/adamlui
|
223 |
| -// @version 2025.4.12 |
| 223 | +// @version 2025.4.12.1 |
224 | 224 | // @license MIT
|
225 | 225 | // @icon https://assets.chatgptautorefresh.com/images/icons/openai/black/icon48.png?v=f11a0a8
|
226 | 226 | // @icon64 https://assets.chatgptautorefresh.com/images/icons/openai/black/icon64.png?v=f11a0a8
|
|
289 | 289 |
|
290 | 290 | // Init APP data
|
291 | 291 | const app = {
|
292 |
| - name: 'ChatGPT Auto Refresh', version: GM_info.script.version, symbol: '↻', slug: 'chatgpt-auto-refresh', |
293 |
| - configKeyPrefix: 'chatGPTautoRefresh', chatgptJSver: /chatgpt\.js@([\d.]+)/.exec(GM_info.scriptMetaStr)[1], |
294 |
| - author: { name: 'Adam Lui', url: 'https://github.com/adamlui' }, |
295 |
| - urls: { |
296 |
| - assetHost: 'https://cdn.jsdelivr.net/gh/adamlui/chatgpt-auto-refresh@latest/assets', |
297 |
| - chatgptJS: 'https://chatgpt.js.org', |
298 |
| - contributors: 'https://docs.chatgptautorefresh.com/#-contributors', |
299 |
| - discuss: 'https://github.com/adamlui/chatgpt-auto-refresh/discussions', |
300 |
| - donate: { |
301 |
| - cashApp: 'https://cash.app/$adamlui', |
302 |
| - gitHub: 'https://github.com/sponsors/adamlui', |
303 |
| - payPal: 'https://paypal.me/adamlui' |
304 |
| - }, |
305 |
| - gitHub: 'https://github.com/adamlui/chatgpt-auto-refresh', |
306 |
| - relatedExtensions: 'https://github.com/adamlui/ai-web-extensions', |
307 |
| - support: 'https://support.chatgptautorefresh.com', |
308 |
| - update: 'https://gm.chatgptautorefresh.com' |
309 |
| - }, |
310 |
| - latestResourceCommitHash: '81b69a6' // for cached messages.json + navicon in toggles.sidebar.insert() |
| 292 | + version: GM_info.script.version, chatgptJSver: /chatgpt\.js@([\d.]+)/.exec(GM_info.scriptMetaStr)[1], urls: {}, |
| 293 | + latestResourceCommitHash: 'a221fe9' // for cached app.json + messages.json + navicon in toggles.sidebar.insert() |
311 | 294 | }
|
| 295 | + app.urls.resourceHost = `https://cdn.jsdelivr.net/gh/adamlui/chatgpt-auto-refresh@${app.latestResourceCommitHash}` |
| 296 | + const remoteAppData = await new Promise(resolve => xhr({ |
| 297 | + method: 'GET', url: `${app.urls.resourceHost}/assets/data/app.json`, |
| 298 | + onload: resp => resolve(JSON.parse(resp.responseText)) |
| 299 | + })) |
| 300 | + Object.assign(app, { ...remoteAppData, urls: { ...app.urls, ...remoteAppData.urls }}) |
312 | 301 | app.urls.assetHost = app.urls.assetHost.replace('@latest', `@${app.latestResourceCommitHash}`)
|
313 |
| - app.urls.resourceHost = app.urls.assetHost.replace('/assets', '') |
314 | 302 | app.msgs = {
|
315 | 303 | appName: app.name,
|
316 | 304 | appAuthor: app.author.name,
|
|
494 | 482 |
|
495 | 483 | function updateCheck() {
|
496 | 484 | xhr({
|
497 |
| - method: 'GET', url: app.urls.update + '?t=' + Date.now(), |
| 485 | + method: 'GET', url: `${app.urls.update.gm}?t=${Date.now()}`, |
498 | 486 | headers: { 'Cache-Control': 'no-cache' },
|
499 | 487 | onload: resp => {
|
500 | 488 |
|
|
766 | 754 | + `${app.urls.gitHub}/commits/main/greasemonkey/${app.slug}.user.js`
|
767 | 755 | + `">${app.msgs.link_viewChanges}</a>`,
|
768 | 756 | function update() { // button
|
769 |
| - modals.safeWinOpen(`${app.urls.update}?t=${Date.now()}`) |
| 757 | + modals.safeWinOpen(`${app.urls.update.gm}?t=${Date.now()}`) |
770 | 758 | }, '', modals.update.width
|
771 | 759 | )
|
772 | 760 |
|
|
0 commit comments