Skip to content

Commit 09af18c

Browse files
committed
comments are better, rename, 1 funciton deleted as duplicate
1 parent 36a5b8e commit 09af18c

File tree

4 files changed

+24
-30
lines changed

4 files changed

+24
-30
lines changed

buttons-init.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,3 @@ window.MaxExtensionButtonsInit = {
9898
logConCgp('[init] Custom elements have been inserted into the DOM.');
9999
}
100100
};
101-
102-
/**
103-
* Checks whether the custom buttons modifications already exist in the DOM.
104-
* @returns {boolean} - True if modifications exist, false otherwise.
105-
*/
106-
function doCustomModificationsExist() {
107-
return document.getElementById(window.InjectionTargetsOnWebsite.selectors.buttonsContainerId) !== null;
108-
}

init.js

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
11
// init.js
2-
3-
// Version: 1.4
4-
2+
// Version: 1.5
53
//
64
// Documentation:
75
/**
8-
* This file serves as the main initializer for the ChatGPT Chrome extension.
9-
* It retrieves configuration data from the service worker and identifies
10-
* the active website, such as ChatGPT or Claude. Based on the site, it
11-
* loads the appropriate extension scripts and applies necessary settings.
12-
* The script also manages keyboard shortcuts to enhance user interaction.
13-
*
14-
* It monitors URL changes, especially in single-page applications, to
15-
* dynamically adapt to navigation events. Resiliency checks ensure that
16-
* custom modifications in the DOM are validated and reinitialized as needed.
17-
* Debouncing utilities are included to limit excessive function executions
18-
* and optimize performance. The initialization sequence starts automatically,
19-
* ensuring the extension runs smoothly across supported platforms.
6+
* This file serves as the main initializer for the OneClickPrompts extension.
7+
*
8+
* Overview:
9+
* - Retrieves configuration data from the service worker.
10+
* - Identifies the active website (e.g., ChatGPT or Claude) and loads
11+
* the appropriate extension scripts.
12+
* - Applies necessary settings and manages keyboard shortcuts to enhance
13+
* user interaction.
14+
* - Monitors URL changes in single-page applications and ensures resiliency
15+
* by validating and reinitializing custom modifications in the DOM.
16+
* - Uses debouncing to limit excessive function executions for performance.
2017
*
2118
* Usage:
22-
* Ensure `buttons.js` and `buttons-init.js` are loaded before this script to
23-
* enable button functionalities. The script starts the initialization process
24-
* automatically upon loading.
25-
*
19+
* - Ensure the following scripts are loaded (in order) before this file:
20+
* 1. buttons.js
21+
* 2. buttons-init.js
22+
* 3. button-injection.js
23+
* - The initialization process starts automatically upon script load.
24+
*
2625
* Dependencies:
27-
* This file is main script, it therefore depends on all other helper files that are content scripts. Popup page scripts are separate.
28-
*
26+
* - This is the main script, and it depends on all other helper files that are
27+
* used as content scripts.
28+
* - Popup page scripts are handled separately.
29+
*
2930
*/
31+
3032
//Instructions for AI: do not remove comments! MUST NOT REMOVE COMMENTS. This one too!
3133
// ALL CODE IN ALL FILES MUST USE logConCgp FOR LOGGING. NO CONSOLE LOGGING.
3234

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"buttons.js",
5454
"buttons-init.js",
5555
"interface.js",
56-
"button-injection.js",
56+
"buttons-injection.js",
5757
"init.js",
5858
"tests.js"
5959
]

0 commit comments

Comments
 (0)