@@ -26,8 +26,9 @@ const form = document.querySelector('form');
26
26
const markupLanguageEl = document . querySelector ( '#markupLanguage' ) ;
27
27
const selectionFormatEl = document . querySelector ( '#selectionFormat' ) ;
28
28
const copyTabsWindowsEl = document . querySelector ( '#copyTabsWindows' ) ;
29
- const notepadAppendOrInsertEl = document . querySelector ( '#notepadAppendOrInsert' ) ;
30
29
const createTextFragmentEl = document . querySelector ( '#createTextFragment' ) ;
30
+ const notepadAppendOrInsertEl = document . querySelector ( '#notepadAppendOrInsert' ) ;
31
+ const notepadStorageLocationEl = document . querySelector ( '#notepadStorageLocation' ) ;
31
32
const extractMainContentEl = document . querySelector ( '#extractMainContent' ) ;
32
33
const omitNavEl = document . querySelector ( '#omitNav' ) ;
33
34
const omitFooterEl = document . querySelector ( '#omitFooter' ) ;
@@ -50,8 +51,15 @@ const resetButton = document.querySelector('#reset');
50
51
initAutosave ( 'markupLanguage' , markupLanguageEl , 'value' ) ;
51
52
initAutosave ( 'selectionFormat' , selectionFormatEl , 'value' ) ;
52
53
initAutosave ( 'copyTabsWindows' , copyTabsWindowsEl , 'value' ) ;
53
- initAutosave ( 'notepadAppendOrInsert' , notepadAppendOrInsertEl , 'value' ) ;
54
54
initAutosave ( 'createTextFragment' , createTextFragmentEl , 'checked' ) ;
55
+ initAutosave ( 'notepadAppendOrInsert' , notepadAppendOrInsertEl , 'value' ) ;
56
+ initAutosave ( 'notepadStorageLocation' , notepadStorageLocationEl , 'value' , ( ) => {
57
+ browser . runtime . sendMessage ( {
58
+ destination : 'sidebar' ,
59
+ category : 'notepadStorageLocation' ,
60
+ notepadStorageLocation : notepadStorageLocationEl . value ,
61
+ } ) ;
62
+ } ) ;
55
63
initAutosave ( 'extractMainContent' , extractMainContentEl , 'checked' ) ;
56
64
initAutosave ( 'omitNav' , omitNavEl , 'checked' ) ;
57
65
initAutosave ( 'omitFooter' , omitFooterEl , 'checked' ) ;
@@ -69,7 +77,7 @@ initAutosave('jsonDestination', jsonDestinationEl, 'value', () => {
69
77
browser . runtime . sendMessage ( {
70
78
destination : 'background' ,
71
79
category : 'jsonDestination' ,
72
- jsonDestination : jsonDestinationEl . value
80
+ jsonDestination : jsonDestinationEl . value ,
73
81
} ) ;
74
82
} ) ;
75
83
@@ -98,8 +106,9 @@ async function loadSettings() {
98
106
markupLanguageEl . value = await getSetting ( 'markupLanguage' ) ;
99
107
selectionFormatEl . value = await getSetting ( 'selectionFormat' ) ;
100
108
copyTabsWindowsEl . value = await getSetting ( 'copyTabsWindows' ) ;
101
- notepadAppendOrInsertEl . value = await getSetting ( 'notepadAppendOrInsert' ) ;
102
109
createTextFragmentEl . checked = await getSetting ( 'createTextFragment' ) ;
110
+ notepadAppendOrInsertEl . value = await getSetting ( 'notepadAppendOrInsert' ) ;
111
+ notepadStorageLocationEl . value = await getSetting ( 'notepadStorageLocation' ) ;
103
112
extractMainContentEl . checked = await getSetting ( 'extractMainContent' ) ;
104
113
omitNavEl . checked = await getSetting ( 'omitNav' ) ;
105
114
omitFooterEl . checked = await getSetting ( 'omitFooter' ) ;
0 commit comments