From ae778d2901d710c329e449962429994ba466d865 Mon Sep 17 00:00:00 2001 From: codebicycle Date: Tue, 3 Oct 2017 19:14:37 +0300 Subject: [PATCH] Replace chrome.extension with chrome.runtime The messaging APIs in `extension` module are deprecated in favor of the equivalent APIs in the `runtime` module. Sources: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/extension https://developer.chrome.com/extensions/extension#methods --- inject.js | 6 +++--- popup.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inject.js b/inject.js index 1ce2118..f9d50d3 100644 --- a/inject.js +++ b/inject.js @@ -1,4 +1,4 @@ -chrome.extension.sendMessage({}, function(response) { +chrome.runtime.sendMessage({}, function(response) { var tc = { settings: { speed: 1.0, // default 1x @@ -117,7 +117,7 @@ chrome.extension.sendMessage({}, function(response) { var shadow = wrapper.createShadowRoot(); var shadowTemplate = `
@@ -213,7 +213,7 @@ chrome.extension.sendMessage({}, function(response) { defineVideoController(); } else { var link = document.createElement('link'); - link.href = chrome.extension.getURL('inject.css'); + link.href = chrome.runtime.getURL('inject.css'); link.type = 'text/css'; link.rel = 'stylesheet'; document.head.appendChild(link); diff --git a/popup.js b/popup.js index 13d16b1..a60b107 100644 --- a/popup.js +++ b/popup.js @@ -1,6 +1,6 @@ document.addEventListener('DOMContentLoaded', function () { document.querySelector('#config').addEventListener('click', function() { - window.open(chrome.extension.getURL("options.html")); + window.open(chrome.runtime.getURL("options.html")); }); document.querySelector('#about').addEventListener('click', function() {