File tree Expand file tree Collapse file tree
content-scripts/send-prompt-content-script/chatbots Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,20 +11,35 @@ import {
1111
1212export const chatgpt : Chatbot = {
1313 wait_until_ready : async ( ) => {
14- await new Promise ( ( resolve ) => {
15- const check_for_element = ( ) => {
16- if (
17- document . querySelector (
18- 'span[data-testid="blocking-initial-modals-done"]'
19- )
20- ) {
21- resolve ( null )
22- } else {
23- setTimeout ( check_for_element , 100 )
14+ const url = new URL ( window . location . href )
15+ if ( url . pathname == '/' ) {
16+ await new Promise ( ( resolve ) => {
17+ const check_for_element = ( ) => {
18+ if (
19+ document . querySelector (
20+ 'span[data-testid="blocking-initial-modals-done"]'
21+ )
22+ ) {
23+ resolve ( null )
24+ } else {
25+ setTimeout ( check_for_element , 100 )
26+ }
2427 }
25- }
26- check_for_element ( )
27- } )
28+ check_for_element ( )
29+ } )
30+ } else {
31+ // User used custom path url for a "project"
32+ await new Promise ( ( resolve ) => {
33+ const check_for_element = ( ) => {
34+ if ( document . querySelector ( 'textarea' ) ) {
35+ resolve ( null )
36+ } else {
37+ setTimeout ( check_for_element , 100 )
38+ }
39+ }
40+ check_for_element ( )
41+ } )
42+ }
2843 } ,
2944 set_options : async ( options ?: string [ ] ) => {
3045 if ( ! options ) return
Original file line number Diff line number Diff line change @@ -10,6 +10,20 @@ import {
1010
1111export const perplexity : Chatbot = {
1212 wait_until_ready : async ( ) => {
13+ const url = new URL ( window . location . href )
14+ if ( url . pathname != '/' ) {
15+ // User used custom path url for a "space"
16+ await new Promise ( ( resolve ) => {
17+ const check_for_element = ( ) => {
18+ if ( document . querySelector ( 'div[contenteditable="true"]' ) ) {
19+ resolve ( null )
20+ } else {
21+ setTimeout ( check_for_element , 100 )
22+ }
23+ }
24+ check_for_element ( )
25+ } )
26+ }
1327 await new Promise ( ( resolve ) => setTimeout ( resolve , 500 ) )
1428 if ( window . innerWidth <= 768 ) {
1529 ; ( document . querySelector ( '[contenteditable="true"]' ) as any ) ?. click ( )
Original file line number Diff line number Diff line change 2525 {
2626 "matches" : [
2727 " https://aistudio.google.com/prompts/new_chat" ,
28- " https://chatgpt.com/" ,
28+ " https://chatgpt.com/* " ,
2929 " https://claude.ai/new" ,
3030 " https://copilot.microsoft.com/" ,
3131 " https://chat.deepseek.com/" ,
You can’t perform that action at this time.
0 commit comments