From 1277f853696c26dba7960462ee49c5d9d39eab47 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Thu, 9 May 2019 16:34:32 -0400 Subject: Add option to go directly to the latest capture --- background.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'background.js') diff --git a/background.js b/background.js index 6beab65..4494843 100644 --- a/background.js +++ b/background.js @@ -13,7 +13,15 @@ // the License. chrome.pageAction.onClicked.addListener(function(tab) { - chrome.tabs.update(null, {url: 'https://web.archive.org/web/*/' + tab.url}); + chrome.storage.sync.get({ + clickBehavior: 'search', + }, function(items) { + let waybackStem = 'https://web.archive.org/web/*/'; + if (items.clickBehavior == 'direct') { + waybackStem = 'https://web.archive.org/web/'; + } + chrome.tabs.update(null, {url: waybackStem + tab.url}); + }); }); chrome.runtime.onInstalled.addListener(function() { -- cgit v1.2.3