|
3 | 3 | // @description A Greasemonkey template to start using chatgpt.js like a boss
|
4 | 4 | // @author chatgpt.js
|
5 | 5 | // @namespace https://chatgpt.js.org
|
6 |
| -// @version 2024.12.6 |
| 6 | +// @version 2024.12.12 |
7 | 7 | // @license MIT
|
8 | 8 | // @icon https://cdn.jsdelivr.net/gh/KudoAI/[email protected]/starters/greasemonkey/media/images/icons/robot/icon48.png
|
9 | 9 | // @icon64 https://cdn.jsdelivr.net/gh/KudoAI/[email protected]/starters/greasemonkey/media/images/icons/robot/icon64.png
|
|
22 | 22 | (async () => {
|
23 | 23 |
|
24 | 24 | // Init config
|
25 |
| - const config = { prefix: 'chatgptScript' }; loadSetting('skipAlert'); |
| 25 | + const config = { prefix: 'chatgptScript' } ; loadSetting('skipAlert') |
26 | 26 |
|
27 | 27 | // Print chatgpt.js methods
|
28 |
| - await chatgpt.isLoaded(); chatgpt.printAllFunctions(); // to console |
| 28 | + await chatgpt.isLoaded() ; chatgpt.printAllFunctions() // to console |
29 | 29 |
|
30 | 30 | // Show alert
|
31 |
| - if (!config.skipAlert) { |
| 31 | + if (!config.skipAlert) |
32 | 32 | chatgpt.alert('≫ ChatGPT script loaded! 🚀', // title
|
33 | 33 | 'Success! Press Ctrl+Shift+' // msg
|
34 | 34 | + ( navigator.userAgent.indexOf('Firefox') > -1 ? 'K' : 'J' )
|
35 | 35 | + ' to view all chatgpt.js functions.',
|
36 | 36 | function getHelp() { // button
|
37 |
| - window.open('https://github.kudoai.com/chatgpt.js-greasemonkey-starter/issues', '_blank', 'noopener'); }, |
| 37 | + window.open('https://github.kudoai.com/chatgpt.js-greasemonkey-starter/issues', '_blank', 'noopener') }, |
38 | 38 | function dontShowAgain() { // checkbox
|
39 |
| - saveSetting('skipAlert', !config.skipAlert); }); |
40 |
| - } |
| 39 | + saveSetting('skipAlert', !config.skipAlert) } |
| 40 | + ) |
41 | 41 |
|
42 | 42 | // Your code here...
|
43 | 43 | // Your code here...
|
|
47 | 47 | // Your code here...
|
48 | 48 |
|
49 | 49 | // Define HELPER functions
|
50 |
| - function loadSetting(...keys) { keys.forEach(key => { config[key] = GM_getValue(config.prefix + '_' + key, false); });} |
51 |
| - function saveSetting(key, value) { GM_setValue(config.prefix + '_' + key, value); config[key] = value; } |
| 50 | + function loadSetting(...keys) { keys.forEach(key => config[key] = GM_getValue(config.prefix + '_' + key, false)) } |
| 51 | + function saveSetting(key, value) { GM_setValue(config.prefix + '_' + key, value) ; config[key] = value } |
52 | 52 |
|
53 | 53 | })();
|
0 commit comments