Skip to content

Commit 7ed2859

Browse files
committed
Use URIR and not URIT in subsequent query for fallback aggregator
Re:#367
1 parent aeacb6a commit 7ed2859

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

mink-plugin/content.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,11 @@ function getMementos (uri) {
440440

441441
setTimeout(animatePageActionIcon, 500)
442442

443-
log('in getMementos, sending "fetchTimeMap" message')
443+
log(`in getMementos, sending "fetchTimeMap" message to service worker using ${timemapLocation}`)
444444
chrome.runtime.sendMessage({
445445
method: 'fetchTimeMap',
446-
value: timemapLocation
446+
value: timemapLocation,
447+
urir: uri
447448
})
448449
}
449450

mink-plugin/mink.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ chrome.runtime.onMessage.addListener(
193193
// memento_datetime: window.localStorage.getItem('memento_datetime')
194194
// })
195195
} else if (request.method === 'fetchTimeMap') {
196-
fetchTimeMap(request.value, sender.tab.id)
196+
fetchTimeMap(request.value, sender.tab.id, request.urir)
197197
} else if (request.method === 'notify') {
198198
chrome.notifications.create(
199199
'id1', {
@@ -298,7 +298,7 @@ class ZeroMementos extends Error {
298298
this.name = this.constructor.name
299299
}
300300
}
301-
async function fetchTimeMap (uri, tabid) {
301+
async function fetchTimeMap (uri, tabid, urir) {
302302
log(`Fetching TimeMap for ${uri} in tab ${tabid}`)
303303

304304
fetch(uri)
@@ -342,10 +342,10 @@ async function fetchTimeMap (uri, tabid) {
342342
} else if (err instanceof SyntaxError) {
343343
logWithTrace("JSON parsing failed, switch up the aggregator")
344344
log(`Previous aggregator endpoint: ${uri}`)
345+
// TODO: obtain URI-R here (don't parse it from URI-T) to send as a param
345346
chrome.tabs.sendMessage(tabid, {
346347
method: 'tryNextAggregator',
347-
uri: uri
348-
}, startAgainWithNewAggregatorTempFunctionName)
348+
uri: urir})
349349
}
350350
})
351351
/*
@@ -360,9 +360,6 @@ async function fetchTimeMap (uri, tabid) {
360360
*/
361361
}
362362

363-
function startAgainWithNewAggregatorTempFunctionName () {
364-
console.log('repeating query logic with a new aggregator')
365-
}
366363

367364
function setBadgeText (value, tabid) {
368365
let badgeValue = value

0 commit comments

Comments
 (0)