@@ -81,113 +81,18 @@ document.addEventListener('DOMContentLoaded', () => {
8181
8282 // Helper function to get default selectors for a site
8383 function getDefaultSelectorsForSite ( site ) {
84- // This replicates the default selector structure from utils.js
85- const defaultSelectors = {
86- ChatGPT : {
87- containers : [ 'div.flex.w-full.flex-col:has(textarea)' ] ,
88- sendButtons : [
89- 'button[data-testid="send-button"]' ,
90- 'button.send-button-class' ,
91- 'button[type="submit"]'
92- ] ,
93- editors : [ 'div.ProseMirror#prompt-textarea' , 'div.ProseMirror' ] ,
94- buttonsContainerId : 'chatgpt-custom-buttons-container'
95- } ,
96- Claude : {
97- containers : [
98- 'div.flex.flex-col.bg-bg-000.rounded-2xl' ,
99- 'div.flex.flex-col.bg-bg-000.gap-1\\.5'
100- ] ,
101- sendButtons : [ 'button[aria-label="Send Message"]' ] ,
102- editors : [ 'div.ProseMirror[contenteditable="true"]' ] ,
103- buttonsContainerId : 'claude-custom-buttons-container'
104- } ,
105- Copilot : {
106- containers : [ 'div.shadow-composer-input' ] ,
107- sendButtons : [
108- 'button.rounded-submitButton[title="Submit message"]' ,
109- 'button[type="button"][title="Submit message"]'
110- ] ,
111- editors : [
112- 'div.shadow-composer-input textarea#userInput' ,
113- 'textarea#userInput[placeholder="Message Copilot"]'
114- ] ,
115- buttonsContainerId : 'copilot-custom-buttons-container'
116- } ,
117- DeepSeek : {
118- containers : [
119- 'div.dd442025' ,
120- '[class*="editorContainer"]'
121- ] ,
122- sendButtons : [
123- 'div.bf38813a [role="button"]' ,
124- 'button:has(svg)' ,
125- '[aria-label*="Send"]' ,
126- '[data-testid="send-button"]'
127- ] ,
128- editors : [
129- 'textarea#chat-input' ,
130- 'div.b13855df' ,
131- '[contenteditable="true"]'
132- ] ,
133- buttonsContainerId : 'deepseek-custom-buttons-container'
134- } ,
135- AIStudio : {
136- containers : [
137- 'section.chunk-editor-main' ,
138- 'footer' ,
139- 'ms-chunk-editor-menu' ,
140- 'body > app-root > div > div > div.layout-wrapper > div > span > ms-prompt-switcher > ms-chunk-editor > section > footer'
141- ] ,
142- sendButtons : [
143- 'button.run-button[type="submit"]' ,
144- 'button[aria-label="Run"]' ,
145- 'run-button button[type="submit"]' ,
146- 'footer > div.input-wrapper > div:nth-child(3) > run-button > button'
147- ] ,
148- editors : [
149- 'ms-autosize-textarea textarea[aria-label="User text input"]' ,
150- 'textarea.textarea.gmat-body-medium[aria-label="Type something"]' ,
151- 'footer > div.input-wrapper > div.text-wrapper > ms-chunk-input > section > ms-text-chunk > ms-autosize-textarea'
152- ] ,
153- buttonsContainerId : 'aistudio-custom-buttons-container'
154- } ,
155- Grok : {
156- containers : [
157- 'form.bottom-0.w-full.text-base.flex.flex-col.gap-2.items-center.justify-center.relative.z-10'
158- ] ,
159- sendButtons : [
160- 'form.bottom-0.w-full.text-base.flex.flex-col.gap-2.items-center.justify-center.relative.z-10 button[type="submit"].group'
161- ] ,
162- editors : [
163- 'textarea.w-full.bg-transparent.focus\\:outline-none.text-primary' ,
164- 'textarea.w-full.px-2.\\@\\[480px\\]\\/input\\:px-3.pt-5.mb-5.bg-transparent.focus\\:outline-none.text-primary.align-bottom'
165- ] ,
166- buttonsContainerId : 'grok-custom-buttons-container'
167- } ,
168- Gemini : {
169- containers : [
170- 'input-container' ,
171- 'main'
172- ] ,
173- sendButtons : [
174- 'button.send-button[aria-label="Send message"]' ,
175- 'button[aria-label="Send message"][aria-disabled="false"]'
176- ] ,
177- editors : [
178- 'div.ql-editor[contenteditable="true"]' ,
179- 'rich-textarea div.ql-editor'
180- ] ,
181- buttonsContainerId : 'gemini-custom-buttons-container'
182- }
183- } ;
184-
185- return defaultSelectors [ site ] || {
186- containers : [ ] ,
187- sendButtons : [ ] ,
188- editors : [ ] ,
189- buttonsContainerId : site . toLowerCase ( ) + '-custom-buttons-container'
190- } ;
84+ // Use the getDefaultSelectors method from utils.js
85+ if ( window . InjectionTargetsOnWebsite ) {
86+ return window . InjectionTargetsOnWebsite . getDefaultSelectors ( site ) ;
87+ } else {
88+ // Fallback if InjectionTargetsOnWebsite is not available
89+ return {
90+ containers : [ ] ,
91+ sendButtons : [ ] ,
92+ editors : [ ] ,
93+ buttonsContainerId : site . toLowerCase ( ) + '-custom-buttons-container'
94+ } ;
95+ }
19196 }
19297
19398 // Save the current selector configuration
0 commit comments