aboutsummaryrefslogtreecommitdiffhomepage
path: root/background.js
diff options
context:
space:
mode:
Diffstat (limited to 'background.js')
-rw-r--r--background.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/background.js b/background.js
index 30d924a..6beab65 100644
--- a/background.js
+++ b/background.js
@@ -12,6 +12,20 @@
// License for the specific language governing permissions and limitations under
// the License.
-chrome.browserAction.onClicked.addListener(function(tab) {
+chrome.pageAction.onClicked.addListener(function(tab) {
chrome.tabs.update(null, {url: 'https://web.archive.org/web/*/' + tab.url});
});
+
+chrome.runtime.onInstalled.addListener(function() {
+ chrome.declarativeContent.onPageChanged.removeRules(null, function() {
+ chrome.declarativeContent.onPageChanged.addRules([
+ {
+ conditions: [
+ new chrome.declarativeContent.PageStateMatcher(
+ {pageUrl: {schemes: ['ftp', 'http', 'https']}}),
+ ],
+ actions: [new chrome.declarativeContent.ShowPageAction()],
+ },
+ ]);
+ });
+});