You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flagon.apache.org by jk...@apache.org on 2024/02/08 16:21:57 UTC

(flagon-useralejs) branch test updated (36b5bb3 -> a761d67)

This is an automated email from the ASF dual-hosted git repository.

jky pushed a change to branch test
in repository https://gitbox.apache.org/repos/asf/flagon-useralejs.git


    from 36b5bb3  Merge pull request #409 from UMD-ARLIS/feat/tabId
     new 92e8a5d  Adds url whitelist regex to ext options
     new e9a99af  Updates from feedback
     new a761d67  Fix rebase issues

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 build/UserALEWebExtension/background.js    | 63 ++++++++++++++++++++++++++----
 build/UserALEWebExtension/content.js       |  4 +-
 build/UserALEWebExtension/options.js       | 19 +++++----
 build/UserALEWebExtension/optionsPage.html |  4 ++
 src/UserALEWebExtension/background.js      | 57 ++++++++++++++++++++-------
 src/UserALEWebExtension/content.js         |  2 +-
 src/UserALEWebExtension/options.js         | 14 +++++--
 src/UserALEWebExtension/optionsPage.html   |  4 ++
 8 files changed, 130 insertions(+), 37 deletions(-)


(flagon-useralejs) 03/03: Fix rebase issues

Posted by jk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jky pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/flagon-useralejs.git

commit a761d672a7f51e5994c8bbda4a058778dc45682b
Author: Jason Young <ja...@protonmail.com>
AuthorDate: Thu Feb 8 11:21:51 2024 -0500

    Fix rebase issues
---
 build/UserALEWebExtension/background.js | 39 +++++++++++++++++++--------------
 src/UserALEWebExtension/background.js   | 15 -------------
 2 files changed, 22 insertions(+), 32 deletions(-)

diff --git a/build/UserALEWebExtension/background.js b/build/UserALEWebExtension/background.js
index 7628b4c..15301ba 100644
--- a/build/UserALEWebExtension/background.js
+++ b/build/UserALEWebExtension/background.js
@@ -1106,21 +1106,21 @@ function log(customLog) {
   }
 }
 
-/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-    * this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-    * the License.  You may obtain a copy of the License at
-*
-*   http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+    * this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+    * the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
 */
 
 
@@ -1165,6 +1165,7 @@ var urlWhitelist;
 function updateConfig(config) {
   urlWhitelist = new RegExp(config.pluginConfig.urlWhitelist);
   options(config.useraleConfig);
+  // TODO: tabs need a page load to apply this config change.
   dispatchTabMessage(config.useraleConfig);
 }
 function dispatchTabMessage(message) {
@@ -1187,12 +1188,16 @@ browser.storage.local.get(defaultConfig, function (res) {
   addCallbacks(filterUrl);
   updateConfig(res);
 });
-browser.runtime.onMessage.addListener(function (message) {
+browser.runtime.onMessage.addListener(function (message, sender, sendResponse) {
   switch (message.type) {
     // Handles logs rerouted from content and option scripts.
     case ADD_LOG:
+      var log$1 = message.payload;
+      if ("tab" in sender && "id" in sender.tab) {
+        log$1["tabId"] = sender.tab.id;
+      }
       // Apply url filter to logs generated outside the background page.
-      var log$1 = filterUrl(message.payload);
+      log$1 = filterUrl(log$1);
       if (log$1) {
         log(log$1);
       }
diff --git a/src/UserALEWebExtension/background.js b/src/UserALEWebExtension/background.js
index b095127..25652b5 100644
--- a/src/UserALEWebExtension/background.js
+++ b/src/UserALEWebExtension/background.js
@@ -69,31 +69,16 @@ browser.storage.local.get(defaultConfig, (res) => {
   updateConfig(res);
 });
 
-function filterUrl(log) {
-  if(urlWhitelist.test(log.pageUrl)) {
-    return log
-  }
-  return false;
-}
-
-browser.storage.local.get(defaultConfig, (res) => {
-  userale.addCallbacks({filterUrl:filterUrl});
-  updateConfig(res);
-});
-
 browser.runtime.onMessage.addListener(function (message, sender, sendResponse) {
   switch (message.type) {
     // Handles logs rerouted from content and option scripts.
     case MessageTypes.ADD_LOG:
-<<<<<<< HEAD
       let log = message.payload;
       if("tab" in sender && "id" in sender.tab) {
         log["tabId"] = sender.tab.id;
       }
       // Apply url filter to logs generated outside the background page.
       log = filterUrl(log);
-=======
->>>>>>> 9f626ab (Updates from feedback)
       if(log) {
         userale.log(log);
       }


(flagon-useralejs) 01/03: Adds url whitelist regex to ext options

Posted by jk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jky pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/flagon-useralejs.git

commit 92e8a5d7fed56aa296588ab03bb561f4e905fad0
Author: Jason Young <ja...@protonmail.com>
AuthorDate: Wed Feb 7 17:51:37 2024 -0500

    Adds url whitelist regex to ext options
---
 build/UserALEWebExtension/background.js    | 90 ++++++++++++++++++++++--------
 build/UserALEWebExtension/options.js       | 15 +++--
 build/UserALEWebExtension/optionsPage.html |  4 ++
 src/UserALEWebExtension/background.js      | 63 ++++++++++++++++-----
 src/UserALEWebExtension/options.js         | 12 +++-
 src/UserALEWebExtension/optionsPage.html   |  4 ++
 6 files changed, 145 insertions(+), 43 deletions(-)

diff --git a/build/UserALEWebExtension/background.js b/build/UserALEWebExtension/background.js
index 82a41c0..42a3550 100644
--- a/build/UserALEWebExtension/background.js
+++ b/build/UserALEWebExtension/background.js
@@ -428,6 +428,30 @@ var intervalCounter;
 var intervalLog;
 var cbHandlers = {};
 
+/**
+ * Adds named callbacks to be executed when logging.
+ * @param  {Object } newCallbacks An object containing named callback functions.
+ */
+function addCallbacks() {
+  for (var _len = arguments.length, newCallbacks = new Array(_len), _key = 0; _key < _len; _key++) {
+    newCallbacks[_key] = arguments[_key];
+  }
+  newCallbacks.forEach(function (source) {
+    var descriptors = Object.keys(source).reduce(function (descriptors, key) {
+      descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
+      return descriptors;
+    }, {});
+    Object.getOwnPropertySymbols(source).forEach(function (sym) {
+      var descriptor = Object.getOwnPropertyDescriptor(source, sym);
+      if (descriptor.enumerable) {
+        descriptors[sym] = descriptor;
+      }
+    });
+    Object.defineProperties(cbHandlers, descriptors);
+  });
+  return cbHandlers;
+}
+
 /**
  * Assigns the config and log container to be used by the logging functions.
  * @param  {Array} newLogs   Log container.
@@ -1082,21 +1106,21 @@ function log(customLog) {
   }
 }
 
-/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-    * this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-    * the License.  You may obtain a copy of the License at
-*
-*   http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+    * this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+    * the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
 */
 
 
@@ -1131,11 +1155,18 @@ var defaultConfig = {
     authHeader: null,
     toolName: 'useralePlugin',
     version: version
+  },
+  pluginConfig: {
+    // Default to a regex that will match no string
+    urlWhitelist: '(?!x)x'
   }
 };
-browser.storage.local.get(defaultConfig, function (res) {
-  options(res.useraleConfig);
-});
+var urlWhitelist;
+function updateConfig(config) {
+  urlWhitelist = new RegExp(config.pluginConfig.urlWhitelist);
+  options(config.useraleConfig);
+  dispatchTabMessage(config.useraleConfig);
+}
 function dispatchTabMessage(message) {
   browser.tabs.query({}, function (tabs) {
     tabs.forEach(function (tab) {
@@ -1143,20 +1174,33 @@ function dispatchTabMessage(message) {
     });
   });
 }
-browser.runtime.onMessage.addListener(function (message, sender, sendResponse) {
+function filterUrl(log) {
+  if (urlWhitelist.test(log.pageUrl)) {
+    return log;
+  }
+  return false;
+}
+browser.storage.local.get(defaultConfig, function (res) {
+  addCallbacks({
+    filterUrl: filterUrl
+  });
+  updateConfig(res);
+});
+browser.runtime.onMessage.addListener(function (message) {
   switch (message.type) {
     // Handles logs rerouted from content and option scripts 
     case ADD_LOG:
-      var log$1 = message.payload;
+      var var log$1 = filterUrl$1 = message.payload;
       if ("tab" in sender && "id" in sender.tab) {
         log$1["tabId"] = sender.tab.id;
       }
       log(log$1);
+      if (log$1) {
+        log(log$1);
+      }
       break;
     case CONFIG_CHANGE:
-      console.log(message);
-      options(message.payload);
-      dispatchTabMessage(message);
+      updateConfig(message.payload);
       break;
     default:
       console.log('got unknown message type ', message);
diff --git a/build/UserALEWebExtension/options.js b/build/UserALEWebExtension/options.js
index 8528ad8..628b79e 100644
--- a/build/UserALEWebExtension/options.js
+++ b/build/UserALEWebExtension/options.js
@@ -1142,13 +1142,17 @@ function setConfig() {
   if (config.userId && password) {
     config.authHeader = "Basic " + btoa("".concat(config.userId, ":").concat(password));
   }
-  browser.storage.local.set({
-    useraleConfig: config
-  }, function () {
+  var payload = {
+    useraleConfig: config,
+    pluginConfig: {
+      urlWhitelist: document.getElementById("filter").value
+    }
+  };
+  browser.storage.local.set(payload, function () {
     options(config);
     browser.runtime.sendMessage({
       type: CONFIG_CHANGE,
-      payload: config
+      payload: payload
     });
   });
 }
@@ -1161,6 +1165,9 @@ function getConfig() {
     document.getElementById("tool").value = config.toolName;
     document.getElementById("version").value = config.version;
   });
+  browser.storage.local.get("pluginConfig", function (res) {
+    document.getElementById("filter").value = res.pluginConfig.urlWhitelist;
+  });
 }
 document.addEventListener("DOMContentLoaded", getConfig);
 document.addEventListener("submit", setConfig);
diff --git a/build/UserALEWebExtension/optionsPage.html b/build/UserALEWebExtension/optionsPage.html
index ff92cf0..9a3f363 100644
--- a/build/UserALEWebExtension/optionsPage.html
+++ b/build/UserALEWebExtension/optionsPage.html
@@ -45,6 +45,10 @@
     <input id="version"/>
     <br/>
 
+    <label>URL whitelist regex:</label>
+    <input id="filter"/>
+    <br/>
+
     <div align="right">
     <button type="submit">Save</button>
     </div>
diff --git a/src/UserALEWebExtension/background.js b/src/UserALEWebExtension/background.js
index 9e70d06..8c33b3f 100644
--- a/src/UserALEWebExtension/background.js
+++ b/src/UserALEWebExtension/background.js
@@ -24,17 +24,27 @@ import * as userale from '../main.js';
 import { browser } from './globals.js';
 
 // Initalize userale plugin options
-const defaultConfig = {useraleConfig: {
-  url: 'http://localhost:8000',
-  userId: 'pluginUser',
-  authHeader: null,
-  toolName: 'useralePlugin',
-  version: userale.version,
-}};
+const defaultConfig = {
+  useraleConfig: {
+    url: 'http://localhost:8000',
+    userId: 'pluginUser',
+    authHeader: null,
+    toolName: 'useralePlugin',
+    version: userale.version,
+  },
+  pluginConfig: {
+    // Default to a regex that will match no string
+    urlWhitelist: '(?!x)x'
+  }
+};
 
-browser.storage.local.get(defaultConfig, (res) => {
-  userale.options(res.useraleConfig);
-});
+var urlWhitelist;
+
+function updateConfig(config) {
+  urlWhitelist = new RegExp(config.pluginConfig.urlWhitelist);
+  userale.options(config.useraleConfig);
+  dispatchTabMessage(config.useraleConfig);
+}
 
 function dispatchTabMessage(message) {
   browser.tabs.query({}, function (tabs) {
@@ -44,6 +54,30 @@ function dispatchTabMessage(message) {
   });
 }
 
+function filterUrl(log) {
+  if(urlWhitelist.test(log.pageUrl)) {
+    return log
+  }
+  return false;
+}
+
+browser.storage.local.get(defaultConfig, (res) => {
+  userale.addCallbacks({filterUrl:filterUrl});
+  updateConfig(res);
+});
+
+function filterUrl(log) {
+  if(urlWhitelist.test(log.pageUrl)) {
+    return log
+  }
+  return false;
+}
+
+browser.storage.local.get(defaultConfig, (res) => {
+  userale.addCallbacks({filterUrl:filterUrl});
+  updateConfig(res);
+});
+
 browser.runtime.onMessage.addListener(function (message, sender, sendResponse) {
   switch (message.type) {
     // Handles logs rerouted from content and option scripts 
@@ -52,13 +86,14 @@ browser.runtime.onMessage.addListener(function (message, sender, sendResponse) {
       if("tab" in sender && "id" in sender.tab) {
         log["tabId"] = sender.tab.id;
       }
-      userale.log(log);
+      log = filterUrl(log);
+      if(log) {
+        userale.log(log);
+      }
       break;
 
     case MessageTypes.CONFIG_CHANGE:
-      console.log(message);
-      userale.options(message.payload);
-      dispatchTabMessage(message);
+      updateConfig(message.payload);
       break;
 
     default:
diff --git a/src/UserALEWebExtension/options.js b/src/UserALEWebExtension/options.js
index b2ecbdb..53b5765 100644
--- a/src/UserALEWebExtension/options.js
+++ b/src/UserALEWebExtension/options.js
@@ -39,9 +39,14 @@ function setConfig() {
     config.authHeader = "Basic " + btoa(`${config.userId}:${password}`);
   }
 
-  browser.storage.local.set({useraleConfig: config}, () => {
+  let payload = {
+    useraleConfig: config,
+    pluginConfig: {urlWhitelist: document.getElementById("filter").value}
+  };
+
+  browser.storage.local.set(payload, () => {
     userale.options(config);
-    browser.runtime.sendMessage({ type: MessageTypes.CONFIG_CHANGE, payload: config });
+    browser.runtime.sendMessage({ type: MessageTypes.CONFIG_CHANGE, payload: payload });
   });
 }
 
@@ -55,6 +60,9 @@ function getConfig() {
     document.getElementById("tool").value = config.toolName;
     document.getElementById("version").value = config.version;
   });
+  browser.storage.local.get("pluginConfig", (res) => {
+    document.getElementById("filter").value = res.pluginConfig.urlWhitelist;
+  });
 }
 
 document.addEventListener("DOMContentLoaded", getConfig);
diff --git a/src/UserALEWebExtension/optionsPage.html b/src/UserALEWebExtension/optionsPage.html
index ff92cf0..9a3f363 100644
--- a/src/UserALEWebExtension/optionsPage.html
+++ b/src/UserALEWebExtension/optionsPage.html
@@ -45,6 +45,10 @@
     <input id="version"/>
     <br/>
 
+    <label>URL whitelist regex:</label>
+    <input id="filter"/>
+    <br/>
+
     <div align="right">
     <button type="submit">Save</button>
     </div>


(flagon-useralejs) 02/03: Updates from feedback

Posted by jk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jky pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/flagon-useralejs.git

commit e9a99af28aab0a29fb48eceb3b713ae47fc4b9c8
Author: Jason Young <ja...@protonmail.com>
AuthorDate: Thu Feb 8 10:46:20 2024 -0500

    Updates from feedback
---
 build/UserALEWebExtension/background.js | 16 +++++++---------
 build/UserALEWebExtension/content.js    |  4 +---
 build/UserALEWebExtension/options.js    |  4 +---
 src/UserALEWebExtension/background.js   | 11 +++++++++--
 src/UserALEWebExtension/content.js      |  2 +-
 src/UserALEWebExtension/options.js      |  4 ++--
 6 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/build/UserALEWebExtension/background.js b/build/UserALEWebExtension/background.js
index 42a3550..7628b4c 100644
--- a/build/UserALEWebExtension/background.js
+++ b/build/UserALEWebExtension/background.js
@@ -1174,6 +1174,8 @@ function dispatchTabMessage(message) {
     });
   });
 }
+
+// Filter out logs with urls that do not match the regex defined in extension options.
 function filterUrl(log) {
   if (urlWhitelist.test(log.pageUrl)) {
     return log;
@@ -1181,20 +1183,16 @@ function filterUrl(log) {
   return false;
 }
 browser.storage.local.get(defaultConfig, function (res) {
-  addCallbacks({
-    filterUrl: filterUrl
-  });
+  // Apply url filter to logs generated by the background page.
+  addCallbacks(filterUrl);
   updateConfig(res);
 });
 browser.runtime.onMessage.addListener(function (message) {
   switch (message.type) {
-    // Handles logs rerouted from content and option scripts 
+    // Handles logs rerouted from content and option scripts.
     case ADD_LOG:
-      var var log$1 = filterUrl$1 = message.payload;
-      if ("tab" in sender && "id" in sender.tab) {
-        log$1["tabId"] = sender.tab.id;
-      }
-      log(log$1);
+      // Apply url filter to logs generated outside the background page.
+      var log$1 = filterUrl(message.payload);
       if (log$1) {
         log(log$1);
       }
diff --git a/build/UserALEWebExtension/content.js b/build/UserALEWebExtension/content.js
index 2c158e6..fd9c5e1 100644
--- a/build/UserALEWebExtension/content.js
+++ b/build/UserALEWebExtension/content.js
@@ -1128,9 +1128,7 @@ function rerouteLog(log) {
 
 browser.storage.local.get("useraleConfig", function (res) {
   options(res.useraleConfig);
-  addCallbacks({
-    reroute: rerouteLog
-  });
+  addCallbacks(rerouteLog);
 });
 browser.runtime.onMessage.addListener(function (message) {
   if (message.type === CONFIG_CHANGE) {
diff --git a/build/UserALEWebExtension/options.js b/build/UserALEWebExtension/options.js
index 628b79e..330c831 100644
--- a/build/UserALEWebExtension/options.js
+++ b/build/UserALEWebExtension/options.js
@@ -1126,9 +1126,7 @@ function rerouteLog(log) {
 * limitations under the License.
 */
 
-addCallbacks({
-  reroute: rerouteLog
-});
+addCallbacks(rerouteLog);
 function setConfig() {
   var config = {
     url: document.getElementById("url").value,
diff --git a/src/UserALEWebExtension/background.js b/src/UserALEWebExtension/background.js
index 8c33b3f..b095127 100644
--- a/src/UserALEWebExtension/background.js
+++ b/src/UserALEWebExtension/background.js
@@ -43,6 +43,7 @@ var urlWhitelist;
 function updateConfig(config) {
   urlWhitelist = new RegExp(config.pluginConfig.urlWhitelist);
   userale.options(config.useraleConfig);
+  // TODO: tabs need a page load to apply this config change.
   dispatchTabMessage(config.useraleConfig);
 }
 
@@ -54,6 +55,7 @@ function dispatchTabMessage(message) {
   });
 }
 
+// Filter out logs with urls that do not match the regex defined in extension options.
 function filterUrl(log) {
   if(urlWhitelist.test(log.pageUrl)) {
     return log
@@ -62,7 +64,8 @@ function filterUrl(log) {
 }
 
 browser.storage.local.get(defaultConfig, (res) => {
-  userale.addCallbacks({filterUrl:filterUrl});
+  // Apply url filter to logs generated by the background page.
+  userale.addCallbacks(filterUrl);
   updateConfig(res);
 });
 
@@ -80,13 +83,17 @@ browser.storage.local.get(defaultConfig, (res) => {
 
 browser.runtime.onMessage.addListener(function (message, sender, sendResponse) {
   switch (message.type) {
-    // Handles logs rerouted from content and option scripts 
+    // Handles logs rerouted from content and option scripts.
     case MessageTypes.ADD_LOG:
+<<<<<<< HEAD
       let log = message.payload;
       if("tab" in sender && "id" in sender.tab) {
         log["tabId"] = sender.tab.id;
       }
+      // Apply url filter to logs generated outside the background page.
       log = filterUrl(log);
+=======
+>>>>>>> 9f626ab (Updates from feedback)
       if(log) {
         userale.log(log);
       }
diff --git a/src/UserALEWebExtension/content.js b/src/UserALEWebExtension/content.js
index 101882b..135a97d 100644
--- a/src/UserALEWebExtension/content.js
+++ b/src/UserALEWebExtension/content.js
@@ -23,7 +23,7 @@ import { rerouteLog, browser } from './globals.js';
 
 browser.storage.local.get("useraleConfig", (res) => {
   userale.options(res.useraleConfig);
-  userale.addCallbacks({reroute: rerouteLog});
+  userale.addCallbacks(rerouteLog);
 });
 
 browser.runtime.onMessage.addListener(function (message) {
diff --git a/src/UserALEWebExtension/options.js b/src/UserALEWebExtension/options.js
index 53b5765..8dc593e 100644
--- a/src/UserALEWebExtension/options.js
+++ b/src/UserALEWebExtension/options.js
@@ -20,7 +20,7 @@ import * as MessageTypes from './messageTypes.js';
 import * as userale from '../main.js'
 import { rerouteLog, browser } from './globals.js';
 
-userale.addCallbacks({reroute: rerouteLog});
+userale.addCallbacks(rerouteLog);
 
 // TODO: Warn users when setting credentials with unsecured connection.
 const mitmWarning = "Setting credentials with http will expose you to a MITM attack. Are you sure you want to continue?";
@@ -46,7 +46,7 @@ function setConfig() {
 
   browser.storage.local.set(payload, () => {
     userale.options(config);
-    browser.runtime.sendMessage({ type: MessageTypes.CONFIG_CHANGE, payload: payload });
+    browser.runtime.sendMessage({ type: MessageTypes.CONFIG_CHANGE, payload });
   });
 }