File tree Expand file tree Collapse file tree 4 files changed +11
-8
lines changed
Expand file tree Collapse file tree 4 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 2222 "matches" : [" https://notes.toolworks.dev/*" ]
2323 }],
2424 "host_permissions" : [
25- " https://notes.toolworks.dev/*" ,
26- " https://notes-sync.toolworks.dev/*"
25+ " https://notes.toolworks.dev/*"
2726 ],
2827 "action" : {
2928 "default_icon" : " icons/icon-96.png" ,
Original file line number Diff line number Diff line change 2222 "matches" : [" https://notes.toolworks.dev/*" ]
2323 }],
2424 "host_permissions" : [
25- " https://notes.toolworks.dev/*" ,
26- " https://notes-sync.toolworks.dev/*"
25+ " https://notes.toolworks.dev/*"
2726 ],
2827 "action" : {
2928 "default_icon" : " icons/icon-96.png" ,
Original file line number Diff line number Diff line change @@ -153,14 +153,18 @@ function renderNotes(notesToRender) {
153153 ` ;
154154
155155 noteElement . addEventListener ( 'click' , async ( ) => {
156- const url = new URL ( 'https://notes.toolworks.dev' ) ;
157- url . searchParams . set ( 'loadNote' , JSON . stringify ( {
156+ const noteData = {
158157 id : note . id ,
159158 title : note . title ,
160159 content : note . content ,
161160 created_at : note . created_at ,
162161 updated_at : note . updated_at
163- } ) ) ;
162+ } ;
163+
164+ const url = new URL ( 'https://notes.toolworks.dev' ) ;
165+
166+ const encodedNoteData = encodeURIComponent ( JSON . stringify ( noteData ) ) ;
167+ url . searchParams . set ( 'loadNote' , encodedNoteData ) ;
164168 url . searchParams . set ( 'autoload' , 'true' ) ;
165169
166170 chrome . tabs . create ( { url : url . toString ( ) } ) ;
Original file line number Diff line number Diff line change @@ -105,7 +105,8 @@ function App() {
105105
106106 if ( loadNoteParam && autoload === 'true' ) {
107107 try {
108- const noteToLoad = JSON . parse ( loadNoteParam ) ;
108+ const decodedNote = decodeURIComponent ( loadNoteParam ) ;
109+ const noteToLoad = JSON . parse ( decodedNote ) ;
109110 setSelectedNote ( noteToLoad ) ;
110111 setTitle ( noteToLoad . title ) ;
111112 setContent ( noteToLoad . content ) ;
You can’t perform that action at this time.
0 commit comments