File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
starters/chrome/extension Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1414 chrome . runtime . onMessage . addListener ( req => {
1515 if ( req . action == 'notify' ) notify ( req . msg , req . pos )
1616 else if ( req . action == 'alert' ) siteAlert ( req . title , req . msg , req . btns )
17- else if ( req . action == 'syncStorageToUI ' ) syncStorageToUI ( )
17+ else if ( req . action == 'syncconfigToUI ' ) syncconfigToUI ( )
1818 } )
1919
2020 // Init CONFIG
4848
4949 // Define SYNC function
5050
51- async function syncStorageToUI ( ) { // on toolbar popup toggles + ChatGPT tab activations
51+ async function syncconfigToUI ( ) { // on toolbar popup toggles + ChatGPT tab activations
5252 await settings . load ( 'extensionDisabled' , Object . keys ( settings . controls ) ) // load from Chrome storage to content.js config
5353 if ( config . extensionDisabled ) {
5454 // Remove all hacks
Original file line number Diff line number Diff line change 4343 } )
4444 } ,
4545
46- storageToUI ( options ) { return sendMsgToActiveTab ( 'syncConfigToUI' , options ) }
46+ configToUI ( options ) { return sendMsgToActiveTab ( 'syncConfigToUI' , options ) }
4747 }
4848
4949 // Run MAIN routine
9696 menuInput . onclick = menuSlider . onclick = event => // prevent double toggle
9797 event . stopImmediatePropagation ( )
9898 menuInput . onchange = ( ) => {
99- settings . save ( key , ! config [ key ] ) ; sync . storageToUI ( )
99+ settings . save ( key , ! config [ key ] ) ; sync . configToUI ( )
100100 notify ( `${ settings . controls [ key ] . label } ${ / d i s a b l e d | h i d d e n / i. test ( key ) != config [ key ] ? 'ON' : 'OFF' } ` )
101101 }
102102 } else if ( settings . controls [ key ] . type == 'prompt' ) {
Original file line number Diff line number Diff line change @@ -18,4 +18,4 @@ chrome.runtime.onInstalled.addListener(details => {
1818
1919// Sync settings to activated tabs
2020chrome . tabs . onActivated . addListener ( activeInfo =>
21- chrome . tabs . sendMessage ( activeInfo . tabId , { action : 'syncStorageToUI ' } ) )
21+ chrome . tabs . sendMessage ( activeInfo . tabId , { action : 'syncconfigToUI ' } ) )
You can’t perform that action at this time.
0 commit comments