File tree Expand file tree Collapse file tree 1 file changed +0
-4
lines changed Expand file tree Collapse file tree 1 file changed +0
-4
lines changed Original file line number Diff line number Diff line change 1- console . log ( 'menu opened' )
21const toggleSwitch = document . getElementById ( 'toggle' )
32const locationArea = document . getElementById ( 'location' )
43// this doesn't work: browser.tabs.getCurrent().then(...
54browser . tabs . query ( { "active" : true , "currentWindow" : true , "windowType" : "normal" } ) . then (
65 tabs => tabs [ 0 ]
76) . then (
87 tab => {
9- console . log ( 'tab' , tab )
108 const relevantURL = tab . url . split ( '?' ) [ 0 ] . split ( '#' ) [ 0 ]
119 locationArea . innerText = relevantURL
1210 browser . storage . local . get ( 'granted' ) . then ( result => {
1311 let granted = result . granted
1412 const enabled = ! ! ~ granted . indexOf ( relevantURL )
15- console . log ( 'enabled =' , enabled )
1613 toggleSwitch . checked = enabled
1714 toggleSwitch . addEventListener ( 'change' , ( e ) => {
18- console . log ( 'changing' , relevantURL , enabled , e . target . checked )
1915 if ( e . target . checked ) {
2016 granted . push ( relevantURL )
2117 } else {
You can’t perform that action at this time.
0 commit comments