You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@senssoft.apache.org by rf...@apache.org on 2017/09/18 17:28:21 UTC
[16/21] incubator-senssoft-useralejs git commit: Updated to properly
pass messages to tabs
Updated to properly pass messages to tabs
Project: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/commit/a31e5138
Tree: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/tree/a31e5138
Diff: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/diff/a31e5138
Branch: refs/heads/SENSSOFT-192
Commit: a31e51389f6b8433986103f59baf4bd2e10ec55a
Parents: e69812c
Author: Rob Foley <ro...@gmail.com>
Authored: Wed Sep 13 14:40:21 2017 -0700
Committer: Rob Foley <ro...@gmail.com>
Committed: Wed Sep 13 14:40:21 2017 -0700
----------------------------------------------------------------------
src/UserALEWebExtension/background.js | 12 ++++++++----
src/UserALEWebExtension/content.js | 4 ----
src/UserALEWebExtension/options.js | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/blob/a31e5138/src/UserALEWebExtension/background.js
----------------------------------------------------------------------
diff --git a/src/UserALEWebExtension/background.js b/src/UserALEWebExtension/background.js
index a8e3ddd..307ed07 100644
--- a/src/UserALEWebExtension/background.js
+++ b/src/UserALEWebExtension/background.js
@@ -12,15 +12,19 @@ import * as MessageTypes from './messageTypes.js';
// to have if-conditions all over the place.
var browser = browser || chrome;
-
-function onError(error) {
- console.log(error);
+
+function dispatchTabMessage(message) {
+ browser.tabs.query({}, function (tabs) {
+ tabs.forEach(function (tab) {
+ browser.tabs.sendMessage(tab.id, message);
+ });
+ });
}
browser.runtime.onMessage.addListener(function (message) {
switch (message.type) {
case MessageTypes.CONFIG_CHANGE:
- console.log('got config ', message.payload);
+ dispatchTabMessage(message);
break;
default:
console.log('got unknown message type ', message);
http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/blob/a31e5138/src/UserALEWebExtension/content.js
----------------------------------------------------------------------
diff --git a/src/UserALEWebExtension/content.js b/src/UserALEWebExtension/content.js
index 3bf2fda..1749144 100644
--- a/src/UserALEWebExtension/content.js
+++ b/src/UserALEWebExtension/content.js
@@ -32,10 +32,6 @@ function storeCallback(item) {
toolVersion: item.toolVersion
});
}
-
-function onError(error) {
- console.log(error);
-}
function injectScript(config) {
options(config);
http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/blob/a31e5138/src/UserALEWebExtension/options.js
----------------------------------------------------------------------
diff --git a/src/UserALEWebExtension/options.js b/src/UserALEWebExtension/options.js
index 78edc23..0f101cb 100644
--- a/src/UserALEWebExtension/options.js
+++ b/src/UserALEWebExtension/options.js
@@ -47,4 +47,4 @@ document.addEventListener("submit", function() {
saveOptions();
});
- /* eslint-enable */
+/* eslint-enable */