From 97b4d91ec9ca808427e27c3187e133877d5e5661 Mon Sep 17 00:00:00 2001 From: eight Date: Tue, 12 Sep 2017 18:58:39 +0800 Subject: [PATCH] Fix: communicate -> runtimeSend --- content/install-user-css.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/install-user-css.js b/content/install-user-css.js index 05273e31..46755129 100644 --- a/content/install-user-css.js +++ b/content/install-user-css.js @@ -10,7 +10,7 @@ function install(style) { reason: 'install', updateUrl: location.href }); - return communicate(request) + return runtimeSend(request) .then(result => { $$('.warning') .forEach(el => el.remove()); @@ -23,7 +23,7 @@ function install(style) { }); } -function communicate(request) { +function runtimeSend(request) { return new Promise((resolve, reject) => { chrome.runtime.sendMessage(request, result => { if (result.status === 'error') { @@ -114,7 +114,7 @@ function initLiveReload(sourceLoader) { let installed; const watcher = sourceLoader.watch(source => { $('.code').textContent = source; - return communicate({ + return runtimeSend({ method: 'saveUsercss', id: installed.id, source: source @@ -230,7 +230,7 @@ function createSourceLoader() { } function initUsercssInstall() { - pendingResource = communicate({ + pendingResource = runtimeSend({ method: 'injectContent', files: [ '/js/dom.js', @@ -244,7 +244,7 @@ function initUsercssInstall() { const sourceLoader = createSourceLoader(); sourceLoader.load() .then(() => - communicate({ + runtimeSend({ method: 'filterUsercss', source: sourceLoader.source(), checkDup: true