aboutsummaryrefslogtreecommitdiffhomepage
path: root/background.js
diff options
context:
space:
mode:
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() {