From 15699e77728ebab8b71cb4bd0e95dfe3de0eeba8 Mon Sep 17 00:00:00 2001 From: Raiquen Guidotti Date: Fri, 17 May 2024 15:03:19 +0200 Subject: [PATCH] Add x.com to all ulrs query/filters (#71) * added x.com to urls filters/query * update to v0.3.4 --- manifest.json | 2 +- src/service_workers/background.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manifest.json b/manifest.json index 51149fa..af72d91 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "Cleaner Twitter", "description": "Make Twitter UI cleaner by removing annoying pieces.", - "version": "0.3.3", + "version": "0.3.4", "action": { "default_popup": "popup/popup.html", "default_icon": { diff --git a/src/service_workers/background.js b/src/service_workers/background.js index 0d603a0..ecdf8cc 100644 --- a/src/service_workers/background.js +++ b/src/service_workers/background.js @@ -4,11 +4,11 @@ import { updateDefaultCSSRules } from "../utils/defaultRulesUpdate.js"; chrome.webNavigation.onCommitted.addListener(async () => { await updateDefaultCSSRules() }, - { url: [{ urlMatches: 'https://*.twitter.com/*' }] + { url: [{ urlMatches: 'https://*.twitter.com/*' }, { urlMatches: 'https://*.x.com/*' }] }) chrome.runtime.onInstalled.addListener(async () => { - const openTwitterTabs = await chrome.tabs.query({ url: 'https://*.twitter.com/*' }) + const openTwitterTabs = await chrome.tabs.query({ url: ['https://*.twitter.com/*', 'https://*.x.com/*'] }) const versionInStorage = await chrome.storage.sync.get('version') const foundVersionInStorage = Object.keys(versionInStorage).length === 1 @@ -100,7 +100,7 @@ function getRulesThatChangedState(oldValue, newValue) { * @param {message} messageObj - The message to send. */ async function sendMessageToTwitterTabs(messageObj) { - const tabs = await chrome.tabs.query({ url: 'https://*.twitter.com/*' }) + const tabs = await chrome.tabs.query({ url: ['https://*.twitter.com/*', 'https://*.x.com/*'] }) tabs.forEach(async tab => { await chrome.tabs.sendMessage(tab.id, { [messageObj.name]: messageObj.active,