@@ -62,7 +62,7 @@ chrome.browserAction.onClicked.addListener(function (tab) {
62
62
} )
63
63
64
64
function setEnabledBasedOnURIInBlacklist ( cb ) {
65
- chrome . tabs . query ( { active : true } , function ( tab ) {
65
+ chrome . tabs . query ( { active : true } , function ( tab ) {
66
66
if ( debug ) {
67
67
console . log ( 'is URI in blacklist?' )
68
68
console . log ( tab )
@@ -91,9 +91,9 @@ function showMinkBadgeInfoBasedOnProcessingState (tabid) {
91
91
function setBadgeTextBasedOnBrowserActionState ( tabid ) {
92
92
// TODO: This should not rely on the badge count to detect zero mementos, as badges are no longer used for no mementos present
93
93
// - maybe rely on the title, since the icon's src path cannot be had.
94
- chrome . browserAction . getBadgeText ( { tabId : tabid } , function ( result ) {
94
+ chrome . browserAction . getBadgeText ( { tabId : tabid } , function ( result ) {
95
95
if ( ! result . length && ! Number . isInteger ( result ) && result !== maxBadgeDisplay ) {
96
- chrome . browserAction . getTitle ( { tabId : tabid } , function ( result ) {
96
+ chrome . browserAction . getTitle ( { tabId : tabid } , function ( result ) {
97
97
// Only set badge text if not viewing a memento
98
98
if ( result === browserActionTitleNoMementos ) {
99
99
displayMinkUI ( tabid )
@@ -117,7 +117,7 @@ function setBadgeTextBasedOnBrowserActionState (tabid) {
117
117
}
118
118
if ( debug ) { console . log ( 'u' ) }
119
119
120
- chrome . browserAction . getBadgeText ( { tabId : tabid } , function ( currentBadgeText ) {
120
+ chrome . browserAction . getBadgeText ( { tabId : tabid } , function ( currentBadgeText ) {
121
121
if ( currentBadgeText !== stillProcessingBadgeDisplay ) {
122
122
displayMinkUI ( tabid )
123
123
}
@@ -127,7 +127,7 @@ function setBadgeTextBasedOnBrowserActionState (tabid) {
127
127
128
128
function displayMinkUI ( tabId ) {
129
129
if ( debug ) { console . log ( 'Injecting displayMinkUI.js' ) }
130
- chrome . tabs . executeScript ( tabId , { code : 'var tmData = ' + JSON . stringify ( tmData ) + '; var tabId = ' + tabId + ';' } ,
130
+ chrome . tabs . executeScript ( tabId , { code : 'var tmData = ' + JSON . stringify ( tmData ) + '; var tabId = ' + tabId + ';' } ,
131
131
function ( ) {
132
132
chrome . tabs . executeScript ( tabId , {
133
133
// TODO: Account for data: URIs like the "connection unavailable" page.
@@ -150,7 +150,7 @@ chrome.runtime.onMessage.addListener(
150
150
window . localStorage . setItem ( 'mementos' , request . mementos )
151
151
window . localStorage . setItem ( 'memento_datetime' , request . memento_datetime )
152
152
153
- sendResponse ( { value : 'noise' } )
153
+ sendResponse ( { value : 'noise' } )
154
154
} else if ( request . method === 'findTMURI' ) {
155
155
if ( debug ) { console . log ( 'Got findTMURI' ) }
156
156
findTMURI ( request . timegate , sender . tab . id )
@@ -240,7 +240,7 @@ function fetchTimeMap (uri, tabid) {
240
240
// TODO: data.normalize()
241
241
const mems = data . mementos
242
242
delete data . mementos
243
- data . mementos = { list : mems }
243
+ data . mementos = { list : mems }
244
244
if ( debug ) { console . log ( data ) }
245
245
}
246
246
@@ -294,22 +294,22 @@ function setBadgeText (value, tabid) {
294
294
badgeValue = ''
295
295
}
296
296
297
- chrome . browserAction . setBadgeText ( { text : badgeValue + '' , tabId : tabid } )
298
- chrome . browserAction . setBadgeBackgroundColor ( { color : badgeColor , tabId : tabid } )
297
+ chrome . browserAction . setBadgeText ( { text : badgeValue + '' , tabId : tabid } )
298
+ chrome . browserAction . setBadgeBackgroundColor ( { color : badgeColor , tabId : tabid } )
299
299
}
300
300
301
301
function setBadgeTitle ( newTitle , tabid ) {
302
302
if ( debug ) { console . warn ( 'setting badge title' ) }
303
- chrome . browserAction . setTitle ( { title : newTitle , tabId : tabid } )
303
+ chrome . browserAction . setTitle ( { title : newTitle , tabId : tabid } )
304
304
}
305
305
306
306
function setBadgeIcon ( icons , tabid ) {
307
- chrome . browserAction . setIcon ( { tabId : tabid , path : icons } )
307
+ chrome . browserAction . setIcon ( { tabId : tabid , path : icons } )
308
308
}
309
309
310
310
function setBadge ( value , icon , tabid ) {
311
311
if ( value === '' ) {
312
- chrome . browserAction . getBadgeText ( { tabId : tabid } , function ( currentBadgeText ) {
312
+ chrome . browserAction . getBadgeText ( { tabId : tabid } , function ( currentBadgeText ) {
313
313
setBadgeText ( currentBadgeText + '' , tabid )
314
314
} )
315
315
} else {
@@ -319,9 +319,9 @@ function setBadge (value, icon, tabid) {
319
319
setBadgeIcon ( icon , tabid )
320
320
321
321
if ( JSON . stringify ( icon ) === JSON . stringify ( badgeImagesIsAMemento ) ) {
322
- chrome . browserAction . setTitle ( { title : browserActionTitleViewingMemento } )
322
+ chrome . browserAction . setTitle ( { title : browserActionTitleViewingMemento } )
323
323
} else {
324
- chrome . browserAction . setTitle ( { title : browserActionTitleNormal } )
324
+ chrome . browserAction . setTitle ( { title : browserActionTitleNormal } )
325
325
}
326
326
}
327
327
@@ -352,7 +352,7 @@ function startWatchingRequests () {
352
352
353
353
function stopWatchingRequests ( ) {
354
354
if ( debug ) { console . log ( 'stopWatchingRequests() executing' ) }
355
- chrome . storage . local . set ( { 'disabled' : true } , function ( ) {
355
+ chrome . storage . local . set ( { 'disabled' : true } , function ( ) {
356
356
chrome . contextMenus . update ( 'mink_stopStartWatching' , {
357
357
'title' : 'Restart Live-Archived Web Integration' ,
358
358
'onclick' : startWatchingRequests
@@ -434,7 +434,7 @@ chrome.webRequest.onCompleted.addListener(function (deets) {
434
434
} )
435
435
} )
436
436
} ,
437
- { urls : [ '*://twitter.com/*/status/*' ] , types : [ 'xmlhttprequest' ] } , [ 'responseHeaders' ] )
437
+ { urls : [ '*://twitter.com/*/status/*' ] , types : [ 'xmlhttprequest' ] } , [ 'responseHeaders' ] )
438
438
439
439
chrome . webRequest . onHeadersReceived . addListener ( function ( deets ) {
440
440
chrome . storage . local . get ( 'headers' , function ( items ) {
@@ -456,7 +456,7 @@ chrome.webRequest.onHeadersReceived.addListener(function (deets) {
456
456
}
457
457
458
458
data [ deets . url ] = deets . responseHeaders
459
- chrome . storage . local . set ( { 'headers' : data } , function ( ) {
459
+ chrome . storage . local . set ( { 'headers' : data } , function ( ) {
460
460
if ( chrome . runtime . lastError ) {
461
461
if ( debug ) { console . log ( 'There was an error last time we tried to store a memento ' + chrome . runtime . lastError . message ) }
462
462
if ( chrome . runtime . lastError . message . indexOf ( 'QUOTA_BYTES_PER_ITEM' ) > - 1 ) {
@@ -467,7 +467,7 @@ chrome.webRequest.onHeadersReceived.addListener(function (deets) {
467
467
} )
468
468
} )
469
469
} ,
470
- { urls : [ '<all_urls>' ] , types : [ 'main_frame' ] } , [ 'responseHeaders' , 'blocking' ] )
470
+ { urls : [ '<all_urls>' ] , types : [ 'main_frame' ] } , [ 'responseHeaders' , 'blocking' ] )
471
471
472
472
function createTimemapFromURI ( uri , tabId , accumulatedArrayOfTimemaps ) {
473
473
if ( debug ) {
@@ -517,7 +517,7 @@ function createTimemapFromURI (uri, tabId, accumulatedArrayOfTimemaps) {
517
517
// Send two messages first stop animation then display stored
518
518
// If use displayUIBasedOnContext the correctly gotten items wont be display
519
519
// Rather we will ask memgator.cs for mementos
520
- chrome . tabs . sendMessage ( tabId , { 'method' : 'stopAnimatingBrowserActionIcon' } )
520
+ chrome . tabs . sendMessage ( tabId , { 'method' : 'stopAnimatingBrowserActionIcon' } )
521
521
chrome . tabs . sendMessage ( tabId , {
522
522
'method' : 'displayUIStoredTM' ,
523
523
'data' : firstTm
@@ -534,7 +534,7 @@ function displayMementosMissingTM (mementos, urir, tabId) {
534
534
tm . original = urir
535
535
setTimemapInStorage ( tm , tm . original )
536
536
537
- chrome . tabs . sendMessage ( tabId , { 'method' : 'stopAnimatingBrowserActionIcon' } )
537
+ chrome . tabs . sendMessage ( tabId , { 'method' : 'stopAnimatingBrowserActionIcon' } )
538
538
chrome . tabs . sendMessage ( tabId , {
539
539
'method' : 'displayUIStoredTM' ,
540
540
'data' : tm
@@ -624,7 +624,7 @@ function setTimemapInStorageAndCall (tm, url, cb) {
624
624
console . log ( tms )
625
625
}
626
626
627
- chrome . storage . local . set ( { 'timemaps' : tms } , function ( ) {
627
+ chrome . storage . local . set ( { 'timemaps' : tms } , function ( ) {
628
628
chrome . storage . local . getBytesInUse ( 'timemaps' , function ( bytesUsed ) {
629
629
if ( debug ) {
630
630
console . log ( 'current bytes used:' + bytesUsed )
@@ -644,7 +644,7 @@ function setTimemapInStorageAndCall (tm, url, cb) {
644
644
console . log ( 'Re-setting chrome.storage.local with:' )
645
645
console . log ( tms )
646
646
}
647
- chrome . storage . local . set ( { 'timemaps' : tms } , function ( ) {
647
+ chrome . storage . local . set ( { 'timemaps' : tms } , function ( ) {
648
648
cb ( )
649
649
} )
650
650
}
@@ -688,7 +688,7 @@ function setTimemapInStorage (tm, url) {
688
688
console . log ( tms )
689
689
}
690
690
691
- chrome . storage . local . set ( { 'timemaps' : tms } , function ( ) {
691
+ chrome . storage . local . set ( { 'timemaps' : tms } , function ( ) {
692
692
chrome . storage . local . getBytesInUse ( 'timemaps' , function ( bytesUsed ) {
693
693
if ( debug ) { console . log ( 'current bytes used:' + bytesUsed ) }
694
694
} )
@@ -702,7 +702,7 @@ function setTimemapInStorage (tm, url) {
702
702
console . log ( 'Re-setting chrome.storage.local with:' )
703
703
console . log ( tms )
704
704
}
705
- chrome . storage . local . set ( { 'timemaps' : tms } , function ( ) { } )
705
+ chrome . storage . local . set ( { 'timemaps' : tms } , function ( ) { } )
706
706
}
707
707
}
708
708
} )
0 commit comments