This repository was archived by the owner on Nov 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ let engine ;
2+
3+ if ( window . browser !== undefined ) {
4+ engine = browser ;
5+ } else {
6+ engine = chrome ;
7+ }
8+
19function addButton ( ) {
210 const sidebar = document . querySelector ( ".window-sidebar" )
311 const button = document . createElement ( 'span' ) ;
@@ -29,7 +37,7 @@ const mappings = {
2937
3038function onClick ( ) {
3139 let trelloApiKey = "afadffe77f745496f80ebb4bf460c615"
32- browser . storage . local . get ( ) . then ( result => {
40+ engine . storage . local . get ( ) . then ( result => {
3341 const trelloToken = result . trello
3442 const togglToken = result . toggl
3543
@@ -136,9 +144,11 @@ function onClick() {
136144 } )
137145 } )
138146
139- window . addEventListener ( "pushstate" , function ( ) {
140- if ( window . location . pathname . startsWith ( "/c/" ) ) {
141- addButton ( )
142- }
143- } )
147+
144148}
149+
150+ window . addEventListener ( "pushstate" , function ( ) {
151+ if ( window . location . pathname . startsWith ( "/c/" ) ) {
152+ addButton ( )
153+ }
154+ } )
Original file line number Diff line number Diff line change 1+ let engine ;
2+
3+ if ( window . browser !== undefined ) {
4+ engine = browser ;
5+ } else {
6+ engine = chrome ;
7+ }
8+
19const trelloTextField = document . querySelector ( "#trello_token" )
210const togglTextField = document . querySelector ( "#toggl_token" )
311
412trelloTextField . addEventListener ( "input" , onChange )
513togglTextField . addEventListener ( "input" , onChange )
614
715function onChange ( ) {
8- browser . storage . local . set ( {
16+ engine . storage . local . set ( {
917 "trello" : trelloTextField . value ,
1018 "toggl" : togglTextField . value
1119 } )
1220 console . log ( `set trello token to ${ togglTextField . value } ` )
1321 console . log ( `set toggl token to ${ togglTextField . value } ` )
1422}
1523
16- browser . storage . local . get ( ) . then ( result => {
24+ engine . storage . local . get ( ) . then ( result => {
1725 trelloTextField . value = result [ "trello" ]
1826 togglTextField . value = result [ "toggl" ]
1927} )
You can’t perform that action at this time.
0 commit comments