aboutsummaryrefslogtreecommitdiffhomepage
path: root/background.js
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@google.com>2019-05-09 16:34:32 -0400
committerGravatar Benjamin Barenblat <bbaren@google.com>2019-05-09 16:34:32 -0400
commit1277f853696c26dba7960462ee49c5d9d39eab47 (patch)
treea6729619754afc4839298c175727ff31984f2dc4 /background.js
parentdcf999ad1f5c048adaf504ac2515bb814adb4b09 (diff)
Add option to go directly to the latest capturev1.1.0
Diffstat (limited to 'background.js')
-rw-r--r--background.js10
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() {