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 <[email protected]> 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); }
