Updating BreezeWiki hosts + fixing dupe counts

pull/161/head^2
Kevin Payravi 2023-06-27 03:12:42 -05:00
parent 1a89177d44
commit 950ab269aa
4 changed files with 35 additions and 16 deletions

View File

@ -44,10 +44,13 @@ if (chrome.declarativeNetRequest) {
'*://antifandom.com/*',
'*://bw.projectsegfau.lt/*',
'*://breeze.hostux.net/*',
'*://breeze.777.tf/*',
'*://breezewiki.pussthecat.org/*',
'*://bw.vern.cc/*',
'*://breezewiki.esmailelbob.xyz/*'
'*://breezewiki.esmailelbob.xyz/*',
'*://bw.artemislena.eu/*',
'*://bw.hamstro.dev/*',
'*://nerd.whatever.social/*',
'*://breeze.nohost.network/*'
],
types: [
'main_frame'
@ -94,12 +97,10 @@ function updateDeclarativeRule() {
chrome.storage.local.get(function (localStorage) {
chrome.storage.sync.get(function (syncStorage) {
const storage = { ...syncStorage, ...localStorage };
console.log(storage);
const headerValue = JSON.stringify({
'power': storage.power ?? 'on',
'breezewiki': storage.breezewiki ?? 'off'
});
console.log(headerValue);
chrome.declarativeNetRequest.updateDynamicRules({
removeRuleIds: [1],
addRules: [
@ -122,10 +123,13 @@ function updateDeclarativeRule() {
"antifandom.com",
"bw.projectsegfau.lt",
"breeze.hostux.net",
"breeze.777.tf",
"breezewiki.pussthecat.org",
"bw.vern.cc",
"breezewiki.esmailelbob.xyz"
"breezewiki.esmailelbob.xyz",
'bw.artemislena.eu',
'bw.hamstro.dev',
'nerd.whatever.social',
'breeze.nohost.network'
],
"resourceTypes": [
"main_frame"
@ -147,7 +151,9 @@ function redirectToBreezeWiki(storage, eventInfo, url) {
} else {
chrome.tabs.update(eventInfo.tabId, { url: host + '/' + subdomain });
}
chrome.storage.sync.set({ 'countBreezeWiki': (storage.countBreezeWiki ?? 0) + 1 });
if (eventInfo.frameId === 0) {
chrome.storage.sync.set({ 'countBreezeWiki': (storage.countBreezeWiki ?? 0) + 1 });
}
if ((storage.notifications ?? 'on') === 'on') {
// Notify that user is being redirected to BreezeWiki
let notifID = 'independent-wiki-redirector-notification-' + Math.floor(Math.random() * 1E16);
@ -309,8 +315,11 @@ async function main(eventInfo, eventName) {
// Perform redirect:
chrome.tabs.update(eventInfo.tabId, { url: newURL });
// Increase global redirect count:
chrome.storage.sync.set({ 'countRedirects': (storage.countRedirects ?? 0) + 1 });
if (eventInfo.frameId === 0) {
chrome.storage.sync.set({ 'countRedirects': (storage.countRedirects ?? 0) + 1 });
}
// Notify if enabled
if ((storage.notifications ?? 'on') === 'on') {

View File

@ -1,7 +1,7 @@
const searchEngineRegex = /www\.google\.|duckduckgo\.com|www\.bing\.com|search\.brave\.com/;
const fandomRegex = /\.fandom\.com$/;
const fextraRegex = /\.fextralife\.com$/;
const breezeWikiRegex = /breeze\.777\.tf$|breeze\.hostux\.net$|bw\.projectsegfau\.lt$|antifandom\.com$|breezewiki\.pussthecat\.org$|bw\.vern\.cc$|breezewiki\.esmailelbob\.xyz$|bw\.artemislena\.eu$/;
const breezeWikiRegex = /breezewiki\.com$|breeze\.hostux\.net$|bw\.projectsegfau\.lt$|antifandom\.com$|breezewiki\.pussthecat\.org$|bw\.vern\.cc$|breezewiki\.esmailelbob\.xyz$|bw\.artemislena\.eu$|bw\.hamstro\.dev$|nerd\.whatever\.social$|breeze\.nohost\.network$/;
const currentURL = new URL(document.location);
// Create object prototypes for getting and setting attributes:

View File

@ -12,11 +12,13 @@
"https://antifandom.com/*",
"https://bw.projectsegfau.lt/*",
"https://breeze.hostux.net/*",
"https://breeze.777.tf/*",
"https://breezewiki.pussthecat.org/*",
"https://bw.vern.cc/*",
"https://breezewiki.esmailelbob.xyz/*",
"https://bw.artemislena.eu/*"
"https://bw.artemislena.eu/*",
"https://bw.hamstro.dev/*",
"https://nerd.whatever.social/*",
"https://breeze.nohost.network/*"
],
"icons": {
"16": "images/logo-16.png",
@ -59,11 +61,13 @@
"https://antifandom.com/*",
"https://bw.projectsegfau.lt/*",
"https://breeze.hostux.net/*",
"https://breeze.777.tf/*",
"https://breezewiki.pussthecat.org/*",
"https://bw.vern.cc/*",
"https://breezewiki.esmailelbob.xyz/*",
"https://bw.artemislena.eu/*",
"https://bw.hamstro.dev/*",
"https://nerd.whatever.social/*",
"https://breeze.nohost.network/*",
"https://*.duckduckgo.com/*",
"https://*.bing.com/search*",
"https://search.brave.com/search*",

View File

@ -43,11 +43,13 @@
"https://antifandom.com/*",
"https://bw.projectsegfau.lt/*",
"https://breeze.hostux.net/*",
"https://breeze.777.tf/*",
"https://breezewiki.pussthecat.org/*",
"https://bw.vern.cc/*",
"https://breezewiki.esmailelbob.xyz/*",
"https://bw.artemislena.eu/*",
"https://bw.hamstro.dev/*",
"https://nerd.whatever.social/*",
"https://breeze.nohost.network/*",
"https://*.duckduckgo.com/*",
"https://www.bing.com/*",
"https://search.brave.com/*",
@ -256,11 +258,13 @@
"https://antifandom.com/*",
"https://bw.projectsegfau.lt/*",
"https://breeze.hostux.net/*",
"https://breeze.777.tf/*",
"https://breezewiki.pussthecat.org/*",
"https://bw.vern.cc/*",
"https://breezewiki.esmailelbob.xyz/*",
"https://bw.artemislena.eu/*",
"https://bw.hamstro.dev/*",
"https://nerd.whatever.social/*",
"https://breeze.nohost.network/*",
"https://*.duckduckgo.com/*",
"https://*.bing.com/search*",
"https://search.brave.com/search*",
@ -466,11 +470,13 @@
"https://antifandom.com/*",
"https://bw.projectsegfau.lt/*",
"https://breeze.hostux.net/*",
"https://breeze.777.tf/*",
"https://breezewiki.pussthecat.org/*",
"https://bw.vern.cc/*",
"https://breezewiki.esmailelbob.xyz/*",
"https://bw.artemislena.eu/*"
"https://bw.artemislena.eu/*",
"https://bw.hamstro.dev/*",
"https://nerd.whatever.social/*",
"https://breeze.nohost.network/*"
],
"manifest_version": 3
}