diff options
author | Benjamin Barenblat <bbaren@google.com> | 2019-05-09 16:34:32 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@google.com> | 2019-05-09 16:34:32 -0400 |
commit | 1277f853696c26dba7960462ee49c5d9d39eab47 (patch) | |
tree | a6729619754afc4839298c175727ff31984f2dc4 /background.js | |
parent | dcf999ad1f5c048adaf504ac2515bb814adb4b09 (diff) |
Add option to go directly to the latest capturev1.1.0
Diffstat (limited to 'background.js')
-rw-r--r-- | background.js | 10 |
1 files changed, 9 insertions, 1 deletions
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() { |