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 22
22
"matches" : [" https://notes.toolworks.dev/*" ]
23
23
}],
24
24
"host_permissions" : [
25
- " https://notes.toolworks.dev/*" ,
26
- " https://notes-sync.toolworks.dev/*"
25
+ " https://notes.toolworks.dev/*"
27
26
],
28
27
"action" : {
29
28
"default_icon" : " icons/icon-96.png" ,
Original file line number Diff line number Diff line change 22
22
"matches" : [" https://notes.toolworks.dev/*" ]
23
23
}],
24
24
"host_permissions" : [
25
- " https://notes.toolworks.dev/*" ,
26
- " https://notes-sync.toolworks.dev/*"
25
+ " https://notes.toolworks.dev/*"
27
26
],
28
27
"action" : {
29
28
"default_icon" : " icons/icon-96.png" ,
Original file line number Diff line number Diff line change @@ -153,14 +153,18 @@ function renderNotes(notesToRender) {
153
153
` ;
154
154
155
155
noteElement . addEventListener ( 'click' , async ( ) => {
156
- const url = new URL ( 'https://notes.toolworks.dev' ) ;
157
- url . searchParams . set ( 'loadNote' , JSON . stringify ( {
156
+ const noteData = {
158
157
id : note . id ,
159
158
title : note . title ,
160
159
content : note . content ,
161
160
created_at : note . created_at ,
162
161
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 ) ;
164
168
url . searchParams . set ( 'autoload' , 'true' ) ;
165
169
166
170
chrome . tabs . create ( { url : url . toString ( ) } ) ;
Original file line number Diff line number Diff line change @@ -105,7 +105,8 @@ function App() {
105
105
106
106
if ( loadNoteParam && autoload === 'true' ) {
107
107
try {
108
- const noteToLoad = JSON . parse ( loadNoteParam ) ;
108
+ const decodedNote = decodeURIComponent ( loadNoteParam ) ;
109
+ const noteToLoad = JSON . parse ( decodedNote ) ;
109
110
setSelectedNote ( noteToLoad ) ;
110
111
setTitle ( noteToLoad . title ) ;
111
112
setContent ( noteToLoad . content ) ;
You can’t perform that action at this time.
0 commit comments