diff options
author | ManeraKai <manerakai@protonmail.com> | 2022-04-13 20:21:51 +0300 |
---|---|---|
committer | ManeraKai <manerakai@protonmail.com> | 2022-04-13 20:21:51 +0300 |
commit | 7123f7fe27189671277c58ce6bf27c65329926e5 (patch) | |
tree | 110ddcfbfbd0b58013e7f3532a2a15c0afe77456 /src | |
parent | Added Nitter settings #138 (diff) | |
parent | I2P support for search, Imgur and Wikipedia (#189) (diff) | |
download | libredirect-7123f7fe27189671277c58ce6bf27c65329926e5.zip |
Merge branch 'master' of https://github.com/libredirect/libredirect
Diffstat (limited to 'src')
27 files changed, 536 insertions, 131 deletions
diff --git a/src/assets/javascripts/helpers/imgur.js b/src/assets/javascripts/helpers/imgur.js index c8c65159..3884d5dc 100644 --- a/src/assets/javascripts/helpers/imgur.js +++ b/src/assets/javascripts/helpers/imgur.js @@ -2,24 +2,22 @@ window.browser = window.browser || window.chrome; import commonHelper from './common.js' -const targets = [ - /^https?:\/{2}([im]\.)?imgur\.com(\/|$)/ -]; +const targets = /^https?:\/{2}([im]\.)?imgur\.com(\/|$)/ let redirects = { "rimgo": { "normal": [], - "tor": [] + "tor": [], + "i2p": [] } } - const getRedirects = () => redirects; - const getCustomRedirects = function () { return { "rimgo": { "normal": [...rimgoNormalRedirectsChecks, ...rimgoNormalCustomRedirects], - "tor": [...rimgoTorRedirectsChecks, ...rimgoTorCustomRedirects] + "tor": [...rimgoTorRedirectsChecks, ...rimgoTorCustomRedirects], + "i2p": [...rimgoI2pRedirectsChecks, ...rimgoI2pCustomRedirects] }, }; }; @@ -36,11 +34,33 @@ function setRedirects(val) { setRimgoNormalRedirectsChecks(rimgoNormalRedirectsChecks); for (const item of rimgoTorRedirectsChecks) - if (!redirects.rimgo.normal.includes(item)) { + if (!redirects.rimgo.tor.includes(item)) { var index = rimgoTorRedirectsChecks.indexOf(item); if (index !== -1) rimgoTorRedirectsChecks.splice(index, 1); } setRimgoTorRedirectsChecks(rimgoTorRedirectsChecks); + + for (const item of rimgoI2pRedirectsChecks) + if (!redirects.rimgo.i2p.includes(item)) { + var index = rimgoI2pRedirectsChecks.indexOf(item); + if (index !== -1) rimgoI2pRedirectsChecks.splice(index, 1); + } + setRimgoI2pRedirectsChecks(rimgoI2pRedirectsChecks); +} + +let disable; +const getDisable = () => disable; +function setDisable(val) { + disable = val; + browser.storage.local.set({ disableImgur: disable }) +} + +let protocol; +const getProtocol = () => protocol; +function setProtocol(val) { + protocol = val; + browser.storage.local.set({ imgurProtocol: val }) + console.log("imgurProtocol: ", val) } let rimgoNormalRedirectsChecks; @@ -59,6 +79,14 @@ function setRimgoTorRedirectsChecks(val) { console.log("rimgoTorRedirectsChecks: ", val) } +let rimgoI2pRedirectsChecks; +const getRimgoI2pRedirectsChecks = () => rimgoI2pRedirectsChecks; +function setRimgoI2pRedirectsChecks(val) { + rimgoI2pRedirectsChecks = val; + browser.storage.local.set({ rimgoI2pRedirectsChecks }) + console.log("rimgoI2pRedirectsChecks: ", val) +} + let rimgoNormalCustomRedirects = []; const getRimgoNormalCustomRedirects = () => rimgoNormalCustomRedirects; function setRimgoNormalCustomRedirects(val) { @@ -75,19 +103,12 @@ function setRimgoTorCustomRedirects(val) { console.log("rimgoTorCustomRedirects: ", val) } -let disable; -const getDisable = () => disable; -function setDisable(val) { - disable = val; - browser.storage.local.set({ disableImgur: disable }) -} - -let protocol; -const getProtocol = () => protocol; -function setProtocol(val) { - protocol = val; - browser.storage.local.set({ imgurProtocol: val }) - console.log("imgurProtocol: ", val) +let rimgoI2pCustomRedirects = []; +const getRimgoI2pCustomRedirects = () => rimgoI2pCustomRedirects; +function setRimgoI2pCustomRedirects(val) { + rimgoI2pCustomRedirects = val; + browser.storage.local.set({ rimgoI2pCustomRedirects }) + console.log("rimgoI2pCustomRedirects: ", val) } function isImgur(url, initiator) { @@ -121,6 +142,7 @@ function redirect(url, type) { let instancesList; if (protocol == 'normal') instancesList = [...rimgoNormalRedirectsChecks, ...rimgoNormalCustomRedirects]; if (protocol == 'tor') instancesList = [...rimgoTorRedirectsChecks, ...rimgoTorCustomRedirects]; + if (protocol == 'i2p') instancesList = [...rimgoI2pRedirectsChecks, ...rimgoI2pCustomRedirects]; if (instancesList.length === 0) return null; let randomInstance = commonHelper.getRandomInstance(instancesList) @@ -133,15 +155,18 @@ function switchInstance(url) { let imgurList = [ ...redirects.rimgo.normal, ...redirects.rimgo.tor, + ...redirects.rimgo.i2p, ...rimgoNormalCustomRedirects, ...rimgoTorCustomRedirects, + ...rimgoI2pCustomRedirects, ]; if (!imgurList.includes(protocolHost)) return null; let instancesList; if (protocol == 'normal') instancesList = [...rimgoNormalCustomRedirects, ...rimgoNormalRedirectsChecks]; else if (protocol == 'tor') instancesList = [...rimgoTorCustomRedirects, ...rimgoTorRedirectsChecks]; + else if (protocol == 'i2p') instancesList = [...rimgoI2pCustomRedirects, ...rimgoI2pRedirectsChecks]; console.log("instancesList", instancesList); let index = instancesList.indexOf(protocolHost); @@ -168,6 +193,8 @@ async function init() { "rimgoNormalCustomRedirects", "rimgoTorRedirectsChecks", "rimgoTorCustomRedirects", + "rimgoI2pRedirectsChecks", + "rimgoI2pCustomRedirects", "imgurProtocol", ], @@ -185,6 +212,9 @@ async function init() { rimgoTorRedirectsChecks = r.rimgoTorRedirectsChecks ?? [...redirects.rimgo.tor]; rimgoTorCustomRedirects = r.rimgoTorCustomRedirects ?? []; + rimgoI2pRedirectsChecks = r.rimgoI2pRedirectsChecks ?? [...redirects.rimgo.i2p]; + rimgoI2pCustomRedirects = r.rimgoI2pCustomRedirects ?? []; + resolve(); } ) @@ -207,11 +237,15 @@ export default { setRimgoNormalRedirectsChecks, getRimgoTorRedirectsChecks, setRimgoTorRedirectsChecks, + getRimgoI2pRedirectsChecks, + setRimgoI2pRedirectsChecks, getRimgoNormalCustomRedirects, setRimgoNormalCustomRedirects, getRimgoTorCustomRedirects, setRimgoTorCustomRedirects, + getRimgoI2pCustomRedirects, + setRimgoI2pCustomRedirects, redirect, isImgur, diff --git a/src/assets/javascripts/helpers/search.js b/src/assets/javascripts/helpers/search.js index 26939ade..1a805864 100644 --- a/src/assets/javascripts/helpers/search.js +++ b/src/assets/javascripts/helpers/search.js @@ -20,7 +20,8 @@ let redirects = { }, "whoogle": { "normal": [], - "tor": [] + "tor": [], + "i2p": [] }, "startpage": { "normal": "https://www.startpage.com", @@ -33,14 +34,17 @@ const getCustomRedirects = () => { "searx": { "normal": [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects], "tor": [...searxTorRedirectsChecks, ...searxTorCustomRedirects], + "i2p": [...searxI2pRedirectsChecks, ...searxI2pCustomRedirects] }, "searxng": { "normal": [...searxngNormalRedirectsChecks, ...searxngNormalCustomRedirects], "tor": [...searxngTorRedirectsChecks, ...searxngTorCustomRedirects], + "i2p": [...searxngI2pRedirectsChecks, ...searxngI2pCustomRedirects] }, "whoogle": { "normal": [...whoogleNormalRedirectsChecks, ...whoogleNormalCustomRedirects], - "normal": [...whoogleTorRedirectsChecks, ...whoogleTorCustomRedirects] + "tor": [...whoogleTorRedirectsChecks, ...whoogleTorCustomRedirects], + "i2p": [...whoogleI2pRedirectsChecks, ...whoogleI2pCustomRedirects] } }; }; @@ -60,6 +64,12 @@ function setSearxRedirects(val) { if (index !== -1) searxTorRedirectsChecks.splice(index, 1); } setSearxTorRedirectsChecks(searxTorRedirectsChecks); + + for (const item of searxI2pRedirectsChecks) if (!redirects.searx.i2p.includes(item)) { + var index = searxI2pRedirectsChecks.indexOf(item); + if (index !== -1) searxI2pRedirectsChecks.splice(index, 1); + } + setSearxI2pRedirectsChecks(searxI2pRedirectsChecks); } function setSearxngRedirects(val) { @@ -77,6 +87,12 @@ function setSearxngRedirects(val) { if (index !== -1) searxngTorRedirectsChecks.splice(index, 1); } setSearxngTorRedirectsChecks(searxngTorRedirectsChecks); + + for (const item of searxngI2pRedirectsChecks) if (!redirects.searxng.i2p.includes(item)) { + var index = searxngI2pRedirectsChecks.indexOf(item); + if (index !== -1) searxngI2pRedirectsChecks.splice(index, 1); + } + setSearxngI2pRedirectsChecks(searxngI2pRedirectsChecks); } function setWhoogleRedirects(val) { @@ -94,6 +110,12 @@ function setWhoogleRedirects(val) { if (index !== -1) whoogleTorRedirectsChecks.splice(index, 1); } setWhoogleTorRedirectsChecks(whoogleTorRedirectsChecks); + + for (const item of whoogleI2pRedirectsChecks) if (!redirects.whoogle.i2p.includes(item)) { + var index = whoogleI2pRedirectsChecks.indexOf(item); + if (index !== -1) whoogleI2pRedirectsChecks.splice(index, 1); + } + setWhoogleI2pRedirectsChecks(whoogleI2pRedirectsChecks); } let whoogleNormalRedirectsChecks; @@ -104,6 +126,14 @@ function setWhoogleNormalRedirectsChecks(val) { console.log("whoogleNormalRedirectsChecks: ", val) } +let whoogleI2pRedirectsChecks; +const getWhoogleI2pRedirectsChecks = () => whoogleI2pRedirectsChecks; +function setWhoogleI2pRedirectsChecks(val) { + whoogleI2pRedirectsChecks = val; + browser.storage.local.set({ whoogleI2pRedirectsChecks }) + console.log("whoogleI2pRedirectsChecks: ", val) +} + let whoogleTorRedirectsChecks; const getWhoogleTorRedirectsChecks = () => whoogleTorRedirectsChecks; function setWhoogleTorRedirectsChecks(val) { @@ -120,6 +150,14 @@ function setWhoogleNormalCustomRedirects(val) { console.log("whoogleNormalCustomRedirects: ", val) } +let whoogleI2pCustomRedirects = []; +const getWhoogleI2pCustomRedirects = () => whoogleI2pCustomRedirects; +function setWhoogleI2pCustomRedirects(val) { + whoogleI2pCustomRedirects = val; + browser.storage.local.set({ whoogleI2pCustomRedirects }) + console.log("whoogleI2pCustomRedirects: ", val) +} + let whoogleTorCustomRedirects = []; const getWhoogleTorCustomRedirects = () => whoogleTorCustomRedirects; function setWhoogleTorCustomRedirects(val) { @@ -136,6 +174,14 @@ function setSearxNormalRedirectsChecks(val) { console.log("searxNormalRedirectsChecks: ", val) } +let searxI2pRedirectsChecks; +const getSearxI2pRedirectsChecks = () => searxI2pRedirectsChecks; +function setSearxI2pRedirectsChecks(val) { + searxI2pRedirectsChecks = val; + browser.storage.local.set({ searxI2pRedirectsChecks }) + console.log("searxI2pRedirectsChecks: ", val) +} + let searxTorRedirectsChecks; const getSearxTorRedirectsChecks = () => searxTorRedirectsChecks; function setSearxTorRedirectsChecks(val) { @@ -152,6 +198,14 @@ function setSearxNormalCustomRedirects(val) { console.log("searxNormalCustomRedirects: ", val) } +let searxI2pCustomRedirects = []; +const getSearxI2pCustomRedirects = () => searxI2pCustomRedirects; +function setSearxI2pCustomRedirects(val) { + searxI2pCustomRedirects = val; + browser.storage.local.set({ searxI2pCustomRedirects }) + console.log("searxI2pCustomRedirects: ", val) +} + let searxTorCustomRedirects = []; const getSearxTorCustomRedirects = () => searxTorCustomRedirects; function setSearxTorCustomRedirects(val) { @@ -168,6 +222,14 @@ function setSearxngNormalRedirectsChecks(val) { console.log("searxngNormalRedirectsChecks: ", val) } +let searxngI2pRedirectsChecks; +const getSearxngI2pRedirectsChecks = () => searxngI2pRedirectsChecks; +function setSearxngI2pRedirectsChecks(val) { + searxngI2pRedirectsChecks = val; + browser.storage.local.set({ searxngI2pRedirectsChecks }) + console.log("searxngI2pRedirectsChecks: ", val) +} + let searxngTorRedirectsChecks; const getSearxngTorRedirectsChecks = () => searxngTorRedirectsChecks; function setSearxngTorRedirectsChecks(val) { @@ -184,6 +246,14 @@ function setSearxngNormalCustomRedirects(val) { console.log("searxngNormalCustomRedirects: ", val) } +let searxngI2pCustomRedirects = []; +const getSearxngI2pCustomRedirects = () => searxngI2pCustomRedirects; +function setSearxngI2pCustomRedirects(val) { + searxngI2pCustomRedirects = val; + browser.storage.local.set({ searxngI2pCustomRedirects }) + console.log("searxngI2pCustomRedirects: ", val) +} + let searxngTorCustomRedirects = []; const getSearxngTorCustomRedirects = () => searxngTorCustomRedirects; function setSearxngTorCustomRedirects(val) { @@ -223,8 +293,8 @@ function initSearxCookies() { if (theme == 'light') themeValue = 'logicodev'; if (theme == 'dark') themeValue = 'logicodev-dark'; if (applyThemeToSites && themeValue) { - let allInstances = [...redirects.searx.normal, ...redirects.searx.tor, ...searxNormalCustomRedirects, ...searxTorCustomRedirects] - let checkedInstances = [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects, ...searxTorRedirectsChecks, ...searxTorCustomRedirects] + let allInstances = [...redirects.searx.normal, ...redirects.searx.tor, ...redirects.searx.i2p, ...searxNormalCustomRedirects, ...searxTorCustomRedirects, ...searxI2pCustomRedirects]; + let checkedInstances = [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects, ...searxTorRedirectsChecks, ...searxTorCustomRedirects, ...searxI2pRedirectsChecks, ...searxI2pCustomRedirects]; for (const instanceUrl of allInstances) if (!checkedInstances.includes(instanceUrl)) { browser.cookies.remove({ @@ -256,8 +326,8 @@ function initSearxngCookies() { if (theme == 'light') themeValue = 'logicodev'; if (theme == 'dark') themeValue = 'logicodev-dark'; if (applyThemeToSites && themeValue) { - let allInstances = [...redirects.searxng.normal, ...redirects.searxng.tor, ...searxngNormalCustomRedirects, ...searxngTorCustomRedirects] - let checkedInstances = [...searxngNormalRedirectsChecks, ...searxngNormalCustomRedirects, ...searxngTorRedirectsChecks, ...searxngTorCustomRedirects] + let allInstances = [...redirects.searxng.normal, ...redirects.searxng.tor, ...redirects.searxng.i2p, ...searxngNormalCustomRedirects, ...searxngTorCustomRedirects, ...searxngI2pCustomRedirects]; + let checkedInstances = [...searxngNormalRedirectsChecks, ...searxngNormalCustomRedirects, ...searxngTorRedirectsChecks, ...searxngTorCustomRedirects, ...searxngI2pRedirectsChecks, ...searxngI2pCustomRedirects]; for (const instanceUrl of allInstances) if (!checkedInstances.includes(instanceUrl)) { browser.cookies.remove({ @@ -285,7 +355,7 @@ function initSearxngCookies() { } function initWhoogleCookies() { - let checkedInstances = [...whoogleNormalRedirectsChecks, ...whoogleNormalCustomRedirects, ...whoogleTorRedirectsChecks, ...whoogleTorCustomRedirects] + let checkedInstances = [...whoogleNormalRedirectsChecks, ...whoogleNormalCustomRedirects, ...whoogleTorRedirectsChecks, ...whoogleTorCustomRedirects, ...whoogleI2pRedirectsChecks, ...whoogleI2pCustomRedirects]; // for (const item of checkedInstances) { let request = new XMLHttpRequest(); @@ -336,6 +406,7 @@ function redirect(url) { let instancesList; if (protocol == 'normal') instancesList = [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects]; else if (protocol == 'tor') instancesList = [...searxTorRedirectsChecks, ...searxTorCustomRedirects]; + else if (protocol == 'i2p') instancesList = [...searxI2pRedirectsChecks, ...searxI2pCustomRedirects]; if (instancesList.length === 0) return null; randomInstance = commonHelper.getRandomInstance(instancesList) path = "/"; @@ -344,6 +415,7 @@ function redirect(url) { let instancesList; if (protocol == 'normal') instancesList = [...searxngNormalRedirectsChecks, ...searxngNormalCustomRedirects]; else if (protocol == 'tor') instancesList = [...searxngTorRedirectsChecks, ...searxngTorCustomRedirects]; + else if (protocol == 'i2p') instancesList = [...searxngI2pRedirectsChecks, ...searxngI2pCustomRedirects]; if (instancesList.length === 0) return null; randomInstance = commonHelper.getRandomInstance(instancesList) path = "/"; @@ -352,6 +424,7 @@ function redirect(url) { let instancesList if (protocol == 'normal') instancesList = [...whoogleNormalRedirectsChecks, ...whoogleNormalCustomRedirects]; if (protocol == 'tor') instancesList = [...whoogleTorRedirectsChecks, ...whoogleTorCustomRedirects]; + if (protocol == 'i2p') instancesList = [...whoogleI2pRedirectsChecks, ...whoogleI2pCustomRedirects]; if (instancesList.length === 0) return null; randomInstance = commonHelper.getRandomInstance(instancesList) path = "/search"; @@ -374,21 +447,27 @@ function switchInstance(url) { let searchList = [ ...redirects.searx.normal, ...redirects.searx.tor, + ...redirects.searx.i2p, ...searxNormalCustomRedirects, ...searxTorCustomRedirects, + ...searxI2pCustomRedirects, ...redirects.searx.normal, ...redirects.searxng.tor, + ...redirects.searxng.i2p, ...searxngNormalCustomRedirects, ...searxngTorCustomRedirects, + ...searxngI2pCustomRedirects, ...redirects.whoogle.normal, ...redirects.whoogle.tor, + ...redirects.whoogle.i2p, ...whoogleNormalCustomRedirects, ...whoogleTorCustomRedirects, + ...whoogleI2pCustomRedirects, ] if (!searchList.includes(protocolHost)) return null; @@ -397,14 +476,17 @@ function switchInstance(url) { if (frontend == 'searx') { if (protocol == 'normal') instancesList = [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects]; else if (protocol == 'tor') instancesList = [...searxTorRedirectsChecks, ...searxTorCustomRedirects]; + else if (protocol == 'i2p') instancesList = [...searxI2pRedirectsChecks, ...searxI2pCustomRedirects]; } else if (frontend == 'searxng') { if (protocol == 'normal') instancesList = [...searxngNormalRedirectsChecks, ...searxngNormalCustomRedirects]; else if (protocol == 'tor') instancesList = [...searxngTorRedirectsChecks, ...searxngTorCustomRedirects]; + else if (protocol == 'i2p') instancesList = [...searxngI2pRedirectsChecks, ...searxngI2pCustomRedirects]; } else if (frontend == 'whoogle') { if (protocol == 'normal') instancesList = [...whoogleNormalRedirectsChecks, ...whoogleNormalCustomRedirects]; else if (protocol == 'tor') instancesList = [...whoogleTorRedirectsChecks, ...whoogleTorCustomRedirects]; + else if (protocol == 'i2p') instancesList = [...whoogleI2pRedirectsChecks, ...whoogleI2pCustomRedirects]; } console.log("instancesList", instancesList); @@ -432,18 +514,27 @@ async function init() { "whoogleTorRedirectsChecks", "whoogleTorCustomRedirects", + + "whoogleI2pRedirectsChecks", + "whoogleI2pCustomRedirects", "searxNormalRedirectsChecks", "searxNormalCustomRedirects", "searxTorRedirectsChecks", "searxTorCustomRedirects", + + "searxI2pRedirectsChecks", + "searxI2pCustomRedirects", "searxngNormalRedirectsChecks", "searxngNormalCustomRedirects", "searxngTorRedirectsChecks", "searxngTorCustomRedirects", + + "searxngI2pRedirectsChecks", + "searxngI2pCustomRedirects", "theme", "applyThemeToSites", @@ -471,18 +562,27 @@ async function init() { whoogleTorRedirectsChecks = r.whoogleTorRedirectsChecks ?? [...redirects.whoogle.tor]; whoogleTorCustomRedirects = r.whoogleTorCustomRedirects ?? []; + whoogleI2pRedirectsChecks = r.whoogleI2pRedirectsChecks ?? [...redirects.whoogle.i2p]; + whoogleI2pCustomRedirects = r.whoogleI2pCustomRedirects ?? []; + searxNormalRedirectsChecks = r.searxNormalRedirectsChecks ?? [...redirects.searx.normal]; searxNormalCustomRedirects = r.searxNormalCustomRedirects ?? []; searxTorRedirectsChecks = r.searxTorRedirectsChecks ?? [...redirects.searx.tor]; searxTorCustomRedirects = r.searxTorCustomRedirects ?? []; + + searxI2pRedirectsChecks = r.searxI2pRedirectsChecks ?? [...redirects.searx.i2p]; + searxI2pCustomRedirects = r.searxI2pCustomRedirects ?? []; searxngNormalRedirectsChecks = r.searxngNormalRedirectsChecks ?? [...redirects.searxng.normal]; searxngNormalCustomRedirects = r.searxngNormalCustomRedirects ?? []; searxngTorRedirectsChecks = r.searxngTorRedirectsChecks ?? [...redirects.searxng.tor]; searxngTorCustomRedirects = r.searxngTorCustomRedirects ?? []; - + + searxngI2pRedirectsChecks = r.searxngI2pRedirectsChecks ?? [...redirects.searxng.i2p]; + searxngI2pCustomRedirects = r.searxngI2pCustomRedirects ?? []; + initSearxCookies() initSearxngCookies() // initWhoogleCookies() @@ -519,6 +619,11 @@ export default { getWhoogleTorCustomRedirects, setWhoogleTorCustomRedirects, + getWhoogleI2pRedirectsChecks, + setWhoogleI2pRedirectsChecks, + getWhoogleI2pCustomRedirects, + setWhoogleI2pCustomRedirects, + getSearxNormalRedirectsChecks, setSearxNormalRedirectsChecks, getSearxNormalCustomRedirects, @@ -529,6 +634,11 @@ export default { getSearxTorCustomRedirects, setSearxTorCustomRedirects, + getSearxI2pRedirectsChecks, + setSearxI2pRedirectsChecks, + getSearxI2pCustomRedirects, + setSearxI2pCustomRedirects, + getSearxngNormalRedirectsChecks, setSearxngNormalRedirectsChecks, getSearxngNormalCustomRedirects, @@ -539,6 +649,11 @@ export default { getSearxngTorCustomRedirects, setSearxngTorCustomRedirects, + getSearxngI2pRedirectsChecks, + setSearxngI2pRedirectsChecks, + getSearxngI2pCustomRedirects, + setSearxngI2pCustomRedirects, + getProtocol, setProtocol, diff --git a/src/assets/javascripts/helpers/wikipedia.js b/src/assets/javascripts/helpers/wikipedia.js index 9e41f119..1973eb26 100644 --- a/src/assets/javascripts/helpers/wikipedia.js +++ b/src/assets/javascripts/helpers/wikipedia.js @@ -6,15 +6,9 @@ const targets = /^https?:\/{2}([a-z]{1,}\.|)wikipedia\.org/ let redirects = { "wikiless": { - "normal": [ - "https://wikiless.org", - "https://wikiless.alefvanoon.xyz", - "https://wikiless.sethforprivacy.com", - "https://wiki.604kph.xyz" - ], - "tor": [ - "http://dj2tbh2nqfxyfmvq33cjmhuw7nb6am7thzd3zsjvizeqf374fixbrxyd.onion" - ] + "normal": [], + "tor": [], + "i2p": [] } }; const getRedirects = () => redirects; @@ -22,7 +16,8 @@ const getCustomRedirects = function () { return { "wikiless": { "normal": [...wikilessNormalRedirectsChecks, ...wikilessNormalCustomRedirects], - "tor": [...wikilessTorRedirectsChecks, ...wikilessTorCustomRedirects] + "tor": [...wikilessTorRedirectsChecks, ...wikilessTorCustomRedirects], + "i2p": [...wikilessI2pRedirectsChecks, ...wikilessI2pCustomRedirects] }, }; }; @@ -39,11 +34,18 @@ function setRedirects(val) { setWikilessNormalRedirectsChecks(wikilessNormalRedirectsChecks); for (const item of wikilessTorRedirectsChecks) - if (!redirects.wikiless.normal.includes(item)) { + if (!redirects.wikiless.tor.includes(item)) { var index = wikilessTorRedirectsChecks.indexOf(item); if (index !== -1) wikilessTorRedirectsChecks.splice(index, 1); } setWikilessTorRedirectsChecks(wikilessTorRedirectsChecks); + + for (const item of wikilessI2pRedirectsChecks) + if (!redirects.wikiless.i2p.includes(item)) { + var index = wikilessI2pRedirectsChecks.indexOf(item); + if (index !== -1) wikilessI2pRedirectsChecks.splice(index, 1); + } + setWikilessI2pRedirectsChecks(wikilessI2pRedirectsChecks); } let disable; @@ -61,7 +63,6 @@ function setProtocol(val) { console.log("wikipediaProtocol: ", val) } - let wikilessNormalRedirectsChecks; const getWikilessNormalRedirectsChecks = () => wikilessNormalRedirectsChecks; function setWikilessNormalRedirectsChecks(val) { @@ -78,6 +79,13 @@ function setWikilessTorRedirectsChecks(val) { console.log("wikilessTorRedirectsChecks: ", val) } +let wikilessI2pRedirectsChecks; +const getWikilessI2pRedirectsChecks = () => wikilessI2pRedirectsChecks; +function setWikilessI2pRedirectsChecks(val) { + wikilessI2pRedirectsChecks = val; + browser.storage.local.set({ wikilessI2pRedirectsChecks }) + console.log("wikilessI2pRedirectsChecks: ", val) +} let wikilessNormalCustomRedirects = []; const getWikilessNormalCustomRedirects = () => wikilessNormalCustomRedirects; @@ -95,6 +103,14 @@ function setWikilessTorCustomRedirects(val) { console.log("wikilessTorCustomRedirects: ", val) } +let wikilessI2pCustomRedirects = []; +const getWikilessI2pCustomRedirects = () => wikilessI2pCustomRedirects; +function setWikilessI2pCustomRedirects(val) { + wikilessI2pCustomRedirects = val; + browser.storage.local.set({ wikilessI2pCustomRedirects }) + console.log("wikilessI2pCustomRedirects: ", val) +} + let theme; let applyThemeToSites; function initWikilessCookies() { @@ -102,8 +118,8 @@ function initWikilessCookies() { if (theme == 'light') themeValue = 'white'; if (theme == 'dark') themeValue = 'dark'; if (applyThemeToSites && themeValue) { - let allInstances = [...redirects.wikiless.normal, ...redirects.wikiless.tor, ...wikilessNormalCustomRedirects, ...wikilessTorCustomRedirects] - let checkedInstances = [...wikilessNormalRedirectsChecks, ...wikilessNormalCustomRedirects, ...wikilessTorRedirectsChecks, ...wikilessTorCustomRedirects] + let allInstances = [...redirects.wikiless.normal, ...redirects.wikiless.tor, ...redirects.wikiless.i2p, ...wikilessNormalCustomRedirects, ...wikilessTorCustomRedirects, ...wikilessI2pCustomRedirects] + let checkedInstances = [...wikilessNormalRedirectsChecks, ...wikilessNormalCustomRedirects, ...wikilessTorRedirectsChecks, ...wikilessTorCustomRedirects, ...wikilessI2pRedirectsChecks, ...wikilessI2pCustomRedirects] for (const instanceUrl of allInstances) if (!checkedInstances.includes(instanceUrl)) browser.cookies.remove({ @@ -135,6 +151,7 @@ function redirect(url) { let instancesList; if (protocol == 'normal') instancesList = [...wikilessNormalRedirectsChecks, ...wikilessNormalCustomRedirects]; else if (protocol == 'tor') instancesList = [...wikilessTorRedirectsChecks, ...wikilessTorCustomRedirects]; + else if (protocol == 'i2p') instancesList = [...wikilessI2pRedirectsChecks, ...wikilessI2pCustomRedirects]; if (instancesList.length === 0) return null; let randomInstance = commonHelper.getRandomInstance(instancesList) @@ -162,15 +179,18 @@ function switchInstance(url) { let wikipediaList = [ ...redirects.wikiless.normal, ...redirects.wikiless.tor, + ...redirects.wikiless.i2p, ...wikilessNormalCustomRedirects, ...wikilessTorCustomRedirects, + ...wikilessI2pCustomRedirects ] if (!wikipediaList.includes(protocolHost)) return null; let instancesList; if (protocol == 'normal') instancesList = [...wikilessNormalCustomRedirects, ...wikilessNormalRedirectsChecks]; else if (protocol == 'tor') instancesList = [...wikilessTorCustomRedirects, ...wikilessTorRedirectsChecks]; + else if (protocol == 'i2p') instancesList = [...wikilessI2pCustomRedirects, ...wikilessI2pRedirectsChecks]; console.log("instancesList", instancesList); let index = instancesList.indexOf(protocolHost); @@ -192,8 +212,10 @@ async function init() { "wikipediaRedirects", "wikilessNormalRedirectsChecks", "wikilessTorRedirectsChecks", + "wikilessI2pRedirectsChecks", "wikilessNormalCustomRedirects", "wikilessTorCustomRedirects", + "wikilessI2pCustomRedirects", "wikipediaProtocol", "theme", @@ -213,6 +235,9 @@ async function init() { wikilessTorRedirectsChecks = r.wikilessTorRedirectsChecks ?? [...redirects.wikiless.tor]; wikilessTorCustomRedirects = r.wikilessTorCustomRedirects ?? []; + wikilessI2pRedirectsChecks = r.wikilessI2pRedirectsChecks ?? [...redirects.wikiless.i2p]; + wikilessI2pCustomRedirects = r.wikilessI2pCustomRedirects ?? []; + theme = r.theme ?? 'DEFAULT'; applyThemeToSites = r.applyThemeToSites ?? false; @@ -240,11 +265,15 @@ export default { setWikilessNormalRedirectsChecks, getWikilessTorRedirectsChecks, setWikilessTorRedirectsChecks, + getWikilessI2pRedirectsChecks, + setWikilessI2pRedirectsChecks, getWikilessNormalCustomRedirects, setWikilessNormalCustomRedirects, getWikilessTorCustomRedirects, setWikilessTorCustomRedirects, + getWikilessI2pCustomRedirects, + setWikilessI2pCustomRedirects, initWikilessCookies, diff --git a/src/assets/javascripts/localise.js b/src/assets/javascripts/localise.js index 7c24d6c7..752a6dd3 100644 --- a/src/assets/javascripts/localise.js +++ b/src/assets/javascripts/localise.js @@ -36,4 +36,4 @@ localisePage(); export default { localisePage -} \ No newline at end of file +} diff --git a/src/instances/data.json b/src/instances/data.json index c189a898..c8c57edb 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -35,7 +35,8 @@ }, "proxiTok": { "normal": [ - "https://proxitok.herokuapp.com" + "https://proxitok.herokuapp.com", + "https://proxitok.pussthecat.org/" ], "tor": [] }, @@ -441,7 +442,8 @@ "https://whoogle.esmailelbob.xyz", "https://whoogle.lunar.icu" ], - "tor": [] + "tor": [], + "i2p": [] }, "rimgo": { "normal": [ @@ -452,14 +454,16 @@ "https://rimgo.bus-hit.me", "https://rimgo.esmailelbob.xyz", "https://rimgo.lunar.icu", - "https://i.actionsack.com", - "https://xazdnfgtzmcbcxhmcbbvr4uodd6jtn4fdiayasghywdn227xsmoa.b32.i2p" + "https://i.actionsack.com" ], "tor": [ "http://l4d4owboqr6xcmd6lf64gbegel62kbudu3x3jnldz2mx6mhn3bsv3zyd.onion", "http://jx3dpcwedpzu2mh54obk5gvl64i2ln7pt5mrzd75s4jnndkqwzaim7ad.onion", "http://rimgo.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", "http://be7udfhmnzqyt7cxysg6c4pbawarvaofjjywp35nhd5qamewdfxl6sid.onion" + ], + "i2p": [ + "http://xazdnfgtzmcbcxhmcbbvr4uodd6jtn4fdiayasghywdn227xsmoa.b32.i2p" ] }, "peertube": [ @@ -632,7 +636,6 @@ "https://peertube.noussommes.org", "https://exode.me", "https://megatube.lilomoino.fr", - "https://zapping.no-ip.info", "https://video.anartist.org", "https://peertube.home.x0r.fr", "https://peertube.marud.fr", @@ -679,7 +682,6 @@ "https://video.firehawk-systems.com", "https://tube.otter.sh", "https://replay.jres.org", - "https://videonaute.fr", "https://peertube.lagob.fr", "https://peertube.gcaillaut.fr", "https://peertube.hellsite.net", @@ -690,7 +692,6 @@ "https://nattyvideo.com", "https://video.zarchbox.ovh", "https://video-vision.elemsys.com", - "https://videos.ysarris.xyz", "https://video.sgiath.dev", "https://videos.b4tech.org", "https://video.off-investigation.fr", @@ -851,7 +852,6 @@ "https://pony.tube", "https://peertube.umeahackerspace.se", "https://tube.okcinfo.news", - "https://stream.conesphere.cloud", "https://www.rocaguinarda.tv", "https://videos.wirtube.de", "https://tube.tinfoil-hat.net", @@ -1143,7 +1143,6 @@ "https://tube-creteil.beta.education.fr", "https://tube.saumon.io", "https://tube-paris.beta.education.fr", - "https://videos.judrey.eu", "https://theater.ethernia.net", "https://watch.tubelab.video", "https://lastbreach.tv", diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index 0d4c9a67..d0c325c2 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -231,8 +231,14 @@ tmpList = r.text.strip().split('\n') whoogleList = {} whoogleList['normal'] = [] whoogleList['tor'] = [] +whoogleList['i2p'] = [] for item in tmpList: - whoogleList['normal'].append(item) + if item.endswith('.onion'): + whoogleList['tor'].append(item) + elif item.endswith('.i2p'): + whoogleList['i2p'].append(item) + else: + whoogleList['normal'].append(item) mightyList['whoogle'] = whoogleList print(Fore.GREEN + 'fetched ' + Style.RESET_ALL + 'Whoogle') @@ -243,10 +249,12 @@ rJson = json.loads(r.text) rimgoList = {} rimgoList['normal'] = [] rimgoList['tor'] = [] - +rimgoList['i2p'] = [] for item in rJson: if item.endswith('.onion'): rimgoList['tor'].append('http://' + item) + elif item.endswith('.i2p'): + rimgoList['i2p'].append('http://' + item) else: rimgoList['normal'].append('https://' + item) mightyList['rimgo'] = rimgoList diff --git a/src/pages/options/imgur/imgur.html b/src/pages/options/imgur/imgur.html index a769bd06..b00c7d71 100644 --- a/src/pages/options/imgur/imgur.html +++ b/src/pages/options/imgur/imgur.html @@ -139,6 +139,7 @@ <select id="protocol"> <option value="normal" data-localise="__MSG_normal__">Normal</option> <option value="tor" data-localise="__MSG_tor__">Tor</option> + <option value="i2p" data-localise="__MSG_i2p__">I2P</option> </select> </div> @@ -167,6 +168,7 @@ </form> <div class="checklist custom-checklist"></div> </div> + <div class="tor"> <div class="some-block option-block"> <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4> @@ -178,7 +180,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://rimgo.com" type="url" /> + <input class="custom-instance" placeholder="http://rimgo.onion" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -190,13 +192,37 @@ </form> <div class="checklist custom-checklist"></div> </div> + + <div class="i2p"> + <div class="some-block option-block"> + <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4> + </div> + <div class="checklist checklist"></div> + <hr> + <div class="some-block option-block"> + <h4 data-localise="__MSG_customInstances__">Custom Instances</h4> + </div> + <form class="custom-instance-form"> + <div class="some-block option-block"> + <input class="custom-instance" placeholder="http://rimgo.i2p" type="url" /> + <button type="submit" class="add add-instance"> + <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" + fill="currentColor"> + <path d="M0 0h24v24H0V0z" fill="none" /> + <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> + </svg> + </button> + </div> + </form> + <div class="checklist custom-checklist"></div> + </div> + </div> </section> - <script type="module" src="../init.js"></script> <script type="module" src="./imgur.js"></script> <script type="module" src="../../../assets/javascripts/localise.js"></script> </body> -</html> \ No newline at end of file +</html> diff --git a/src/pages/options/imgur/imgur.js b/src/pages/options/imgur/imgur.js index 9742bfd2..26a7d417 100644 --- a/src/pages/options/imgur/imgur.js +++ b/src/pages/options/imgur/imgur.js @@ -18,13 +18,21 @@ protocolElement.addEventListener("change", function changeProtocolSettings(protocol) { let normalDiv = document.getElementsByClassName("normal")[0]; let torDiv = document.getElementsByClassName("tor")[0]; + let i2pDiv = document.getElementsByClassName("i2p")[0]; if (protocol == 'normal') { - normalDiv.style.display = 'block'; - torDiv.style.display = 'none'; + normalDiv.style.display = 'block'; + torDiv.style.display = 'none'; + i2pDiv.style.display = 'none'; } else if (protocol == 'tor') { - normalDiv.style.display = 'none'; - torDiv.style.display = 'block'; + normalDiv.style.display = 'none'; + torDiv.style.display = 'block'; + i2pDiv.style.display = 'none'; + } + else if (protocol == 'i2p') { + normalDiv.style.display = 'none'; + torDiv.style.display = 'none'; + i2pDiv.style.display = 'block'; } } @@ -32,6 +40,7 @@ imgurHelper.init().then(() => { disableImgurElement.checked = !imgurHelper.getDisable(); let protocol = imgurHelper.getProtocol(); + console.log('protocol', protocol); protocolElement.value = protocol; changeProtocolSettings(protocol); @@ -56,4 +65,15 @@ imgurHelper.init().then(() => { imgurHelper.getRimgoTorCustomRedirects, imgurHelper.setRimgoTorCustomRedirects ); -}); \ No newline at end of file + + commonHelper.processDefaultCustomInstances( + 'rimgo', + 'i2p', + imgurHelper, + document, + imgurHelper.getRimgoI2pRedirectsChecks, + imgurHelper.setRimgoI2pRedirectsChecks, + imgurHelper.getRimgoI2pCustomRedirects, + imgurHelper.setRimgoI2pCustomRedirects + ); +}); diff --git a/src/pages/options/instagram/instagram.html b/src/pages/options/instagram/instagram.html index baf5166f..ced087b9 100644 --- a/src/pages/options/instagram/instagram.html +++ b/src/pages/options/instagram/instagram.html @@ -171,7 +171,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://bibliogram.com" type="url" /> + <input class="custom-instance" placeholder="http://bibliogram.onion" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -191,4 +191,4 @@ <script type="module" src="../../../assets/javascripts/localise.js"></script> </body> -</html> \ No newline at end of file +</html> diff --git a/src/pages/options/lbry/lbry.html b/src/pages/options/lbry/lbry.html index 40000076..4f7332dc 100644 --- a/src/pages/options/lbry/lbry.html +++ b/src/pages/options/lbry/lbry.html @@ -179,7 +179,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://librarian.com" type="url" /> + <input class="custom-instance" placeholder="http://librarian.onion" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -200,4 +200,4 @@ <script type="module" src="../../../assets/javascripts/localise.js"></script> </body> -</html> \ No newline at end of file +</html> diff --git a/src/pages/options/medium/medium.html b/src/pages/options/medium/medium.html index fde374eb..54dbba88 100644 --- a/src/pages/options/medium/medium.html +++ b/src/pages/options/medium/medium.html @@ -180,7 +180,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://scribe.com" type="url" /> + <input class="custom-instance" placeholder="http://scribe.onion" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -201,4 +201,4 @@ <script type="module" src="../../../assets/javascripts/localise.js"></script> </body> -</html> \ No newline at end of file +</html> diff --git a/src/pages/options/peertube/peertube.html b/src/pages/options/peertube/peertube.html index c4190498..f8258bfa 100644 --- a/src/pages/options/peertube/peertube.html +++ b/src/pages/options/peertube/peertube.html @@ -179,7 +179,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://simpleertube.com" type="url" /> + <input class="custom-instance" placeholder="http://simpleertube.onion" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -199,4 +199,4 @@ <script type="module" src="../../../assets/javascripts/localise.js"></script> </body> -</html> \ No newline at end of file +</html> diff --git a/src/pages/options/pixiv/pixiv.html b/src/pages/options/pixiv/pixiv.html index 9ce7c1d8..775844d8 100644 --- a/src/pages/options/pixiv/pixiv.html +++ b/src/pages/options/pixiv/pixiv.html @@ -168,7 +168,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://pixiv.moe" type="url" /> + <input class="custom-instance" placeholder="https://pixivMoe.com" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -191,7 +191,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://pixivMoe.com" type="url" /> + <input class="custom-instance" placeholder="http://pixivMoe.onion" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -212,4 +212,4 @@ <script type="module" src="../../../assets/javascripts/localise.js"></script> </body> -</html> \ No newline at end of file +</html> diff --git a/src/pages/options/reddit/reddit.html b/src/pages/options/reddit/reddit.html index 820294b2..805cb567 100644 --- a/src/pages/options/reddit/reddit.html +++ b/src/pages/options/reddit/reddit.html @@ -199,7 +199,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://libreddit.com" type="url" /> + <input class="custom-instance" placeholder="http://libreddit.onion" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -252,7 +252,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://teddit.com" type="url" /> + <input class="custom-instance" placeholder="http://teddit.onion" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> diff --git a/src/pages/options/reddit/reddit.js b/src/pages/options/reddit/reddit.js index 2645ed41..fea1c08b 100644 --- a/src/pages/options/reddit/reddit.js +++ b/src/pages/options/reddit/reddit.js @@ -126,4 +126,4 @@ redditHelper.init().then(() => { redditHelper.setTedditTorCustomRedirects ); -}) \ No newline at end of file +}) diff --git a/src/pages/options/search/search.html b/src/pages/options/search/search.html index a5f26ab3..a5d2a3ca 100644 --- a/src/pages/options/search/search.html +++ b/src/pages/options/search/search.html @@ -150,6 +150,7 @@ <select id="protocol"> <option value="normal" data-localise="__MSG_normal__">Normal</option> <option value="tor" data-localise="__MSG_tor__">Tor</option> + <option value="i2p" data-localise="__MSG_i2p__">I2P</option> </select> </div> </div> @@ -210,6 +211,30 @@ </form> <div class="checklist custom-checklist"></div> </div> + <div class="i2p"> + <div class="some-block option-block"> + <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4> + </div> + <div class="checklist checklist"> + </div> + <hr> + <div class="some-block option-block"> + <h4 data-localise="__MSG_customInstances__">Custom Instances</h4> + </div> + <form class="custom-instance-form"> + <div class="some-block option-block"> + <input class="custom-instance" placeholder="https://searx.com" type="url" /> + <button type="submit" class="add add-instance"> + <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" + fill="currentColor"> + <path d="M0 0h24v24H0V0z" fill="none" /> + <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> + </svg> + </button> + </div> + </form> + <div class="checklist custom-checklist"></div> + </div> </div> <div id="searxng"> @@ -262,6 +287,30 @@ </form> <div class="checklist custom-checklist"></div> </div> + <div class="i2p"> + <div class="some-block option-block"> + <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4> + </div> + <div class="checklist checklist"> + </div> + <hr> + <div class="some-block option-block"> + <h4 data-localise="__MSG_customInstances__">Custom Instances</h4> + </div> + <form class="custom-instance-form"> + <div class="some-block option-block"> + <input class="custom-instance" placeholder="https://searxng.com" type="url" /> + <button type="submit" class="add add-instance"> + <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" + fill="currentColor"> + <path d="M0 0h24v24H0V0z" fill="none" /> + <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> + </svg> + </button> + </div> + </form> + <div class="checklist custom-checklist"></div> + </div> </div> <div id="whoogle"> @@ -314,6 +363,30 @@ </form> <div class="checklist custom-checklist"></div> </div> + <div class="i2p"> + <div class="some-block option-block"> + <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4> + </div> + <div class="checklist checklist"> + </div> + <hr> + <div class="some-block option-block"> + <h4 data-localise="__MSG_customInstances__">Custom Instances</h4> + </div> + <form class="custom-instance-form"> + <div class="some-block option-block"> + <input class="custom-instance" placeholder="https://whoogle.com" type="url" /> + <button type="submit" class="add add-instance"> + <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" + fill="currentColor"> + <path d="M0 0h24v24H0V0z" fill="none" /> + <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> + </svg> + </button> + </div> + </form> + <div class="checklist custom-checklist"></div> + </div> </div> </section> @@ -324,4 +397,5 @@ <script type="module" src="../../../assets/javascripts/localise.js"></script> </body> -</html> \ No newline at end of file +</html> + diff --git a/src/pages/options/search/search.js b/src/pages/options/search/search.js index d96665e9..0eeac5ed 100644 --- a/src/pages/options/search/search.js +++ b/src/pages/options/search/search.js @@ -63,12 +63,15 @@ protocolElement.addEventListener("change", function changeProtocolSettings(protocol) { let normalsearxDiv = searxDivElement.getElementsByClassName("normal")[0]; let torsearxDiv = searxDivElement.getElementsByClassName("tor")[0]; + let i2psearxDiv = searxDivElement.getElementsByClassName("i2p")[0]; let normalsearxngDiv = searxngDivElement.getElementsByClassName("normal")[0]; let torsearxngDiv = searxngDivElement.getElementsByClassName("tor")[0]; + let i2psearxngDiv = searxngDivElement.getElementsByClassName("i2p")[0]; let normalwhoogleDiv = whoogleDivElement.getElementsByClassName("normal")[0]; let torwhoogleDiv = whoogleDivElement.getElementsByClassName("tor")[0]; + let i2pwhoogleDiv = whoogleDivElement.getElementsByClassName("i2p")[0]; if (protocol == 'normal') { normalsearxDiv.style.display = 'block'; @@ -77,6 +80,9 @@ function changeProtocolSettings(protocol) { torsearxDiv.style.display = 'none'; torsearxngDiv.style.display = 'none'; torwhoogleDiv.style.display = 'none'; + i2psearxDiv.style.display = 'none'; + i2psearxngDiv.style.display = 'none'; + i2pwhoogleDiv.style.display = 'none'; } else if (protocol == 'tor') { normalsearxDiv.style.display = 'none'; @@ -85,6 +91,20 @@ function changeProtocolSettings(protocol) { torsearxDiv.style.display = 'block'; torsearxngDiv.style.display = 'block'; torwhoogleDiv.style.display = 'block'; + i2psearxDiv.style.display = 'none'; + i2psearxngDiv.style.display = 'none'; + i2pwhoogleDiv.style.display = 'none'; + } + else if (protocol == 'i2p') { + normalsearxDiv.style.display = 'none'; + normalsearxngDiv.style.display = 'none'; + normalwhoogleDiv.style.display = 'none'; + torsearxDiv.style.display = 'none'; + torsearxngDiv.style.display = 'none'; + torwhoogleDiv.style.display = 'none'; + i2psearxDiv.style.display = 'block'; + i2psearxngDiv.style.display = 'block'; + i2pwhoogleDiv.style.display = 'block'; } } @@ -121,6 +141,17 @@ searchHelper.init().then(() => { ); commonHelper.processDefaultCustomInstances( + 'searx', + 'i2p', + searchHelper, + document, + searchHelper.getSearxI2pRedirectsChecks, + searchHelper.setSearxI2pRedirectsChecks, + searchHelper.getSearxI2pCustomRedirects, + searchHelper.setSearxI2pCustomRedirects + ); + + commonHelper.processDefaultCustomInstances( 'searxng', 'normal', searchHelper, @@ -143,6 +174,17 @@ searchHelper.init().then(() => { ); commonHelper.processDefaultCustomInstances( + 'searxng', + 'i2p', + searchHelper, + document, + searchHelper.getSearxngI2pRedirectsChecks, + searchHelper.setSearxngI2pRedirectsChecks, + searchHelper.getSearxngI2pCustomRedirects, + searchHelper.setSearxngI2pCustomRedirects + ); + + commonHelper.processDefaultCustomInstances( 'whoogle', 'normal', searchHelper, @@ -163,4 +205,15 @@ searchHelper.init().then(() => { searchHelper.getWhoogleTorCustomRedirects, searchHelper.setWhoogleTorCustomRedirects ); -}); \ No newline at end of file + + commonHelper.processDefaultCustomInstances( + 'whoogle', + 'i2p', + searchHelper, + document, + searchHelper.getWhoogleI2pRedirectsChecks, + searchHelper.setWhoogleI2pRedirectsChecks, + searchHelper.getWhoogleI2pCustomRedirects, + searchHelper.setWhoogleI2pCustomRedirects + ); +}); diff --git a/src/pages/options/sendTargets/sendTargets.html b/src/pages/options/sendTargets/sendTargets.html index 7da5d1fa..786b310b 100644 --- a/src/pages/options/sendTargets/sendTargets.html +++ b/src/pages/options/sendTargets/sendTargets.html @@ -178,7 +178,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://send.com" type="url" /> + <input class="custom-instance" placeholder="http://send.onion" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -199,4 +199,4 @@ <script type="module" src="../../../assets/javascripts/localise.js"></script> </body> -</html> \ No newline at end of file +</html> diff --git a/src/pages/options/spotify/spotify.html b/src/pages/options/spotify/spotify.html index 731e7d5a..353d777d 100644 --- a/src/pages/options/spotify/spotify.html +++ b/src/pages/options/spotify/spotify.html @@ -178,7 +178,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://soju.com" type="url" /> + <input class="custom-instance" placeholder="http://soju.onion" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -198,4 +198,4 @@ <script type="module" src="../../../assets/javascripts/localise.js"></script> </body> -</html> \ No newline at end of file +</html> diff --git a/src/pages/options/tiktok/tiktok.html b/src/pages/options/tiktok/tiktok.html index 8136ccd0..11a7f607 100644 --- a/src/pages/options/tiktok/tiktok.html +++ b/src/pages/options/tiktok/tiktok.html @@ -179,7 +179,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://proxiTok.com" type="url" /> + <input class="custom-instance" placeholder="http://proxiTok.onion" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -200,4 +200,4 @@ <script type="module" src="../../../assets/javascripts/localise.js"></script> </body> -</html> \ No newline at end of file +</html> diff --git a/src/pages/options/translate/translate.html b/src/pages/options/translate/translate.html index 3116a0ac..d71060b4 100644 --- a/src/pages/options/translate/translate.html +++ b/src/pages/options/translate/translate.html @@ -430,7 +430,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://simplyTranslate.com" type="url" /> + <input class="custom-instance" placeholder="http://simplyTranslate.onion" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -481,7 +481,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://lingva.com" type="url" /> + <input class="custom-instance" placeholder="http://lingva.onion" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -502,4 +502,4 @@ <script type="module" src="../../../assets/javascripts/localise.js"></script> </body> -</html> \ No newline at end of file +</html> diff --git a/src/pages/options/twitter/twitter.html b/src/pages/options/twitter/twitter.html index efb0f44d..4add30ae 100644 --- a/src/pages/options/twitter/twitter.html +++ b/src/pages/options/twitter/twitter.html @@ -289,7 +289,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://nitter.com" type="url" /> + <input class="custom-instance" placeholder="http://nitter.onion" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -311,4 +311,4 @@ <script type="module" src="../../../assets/javascripts/localise.js"></script> </body> -</html> \ No newline at end of file +</html> diff --git a/src/pages/options/wikipedia/wikipedia.html b/src/pages/options/wikipedia/wikipedia.html index 728f2b10..b0f2e064 100644 --- a/src/pages/options/wikipedia/wikipedia.html +++ b/src/pages/options/wikipedia/wikipedia.html @@ -138,6 +138,7 @@ <select id="protocol"> <option value="normal" data-localise="__MSG_normal__">Normal</option> <option value="tor" data-localise="__MSG_tor__">Tor</option> + <option value="i2p" data-localise="__MSG_i2p__">I2P</option> </select> </div> @@ -180,7 +181,7 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://wikiless.com" type="url" /> + <input class="custom-instance" placeholder="http://wikiless.onion" type="url" /> <button type="submit" class="add add-instance"> <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> @@ -191,8 +192,33 @@ </div> </form> <div class="checklist custom-checklist"></div> + </div> + <div class="i2p"> + <div class="some-block option-block"> + <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4> + </div> + <div class="checklist checklist"> + </div> + <hr> + <div class="some-block option-block"> + <h4 data-localise="__MSG_customInstances__">Custom Instances</h4> + </div> + <form class="custom-instance-form"> + <div class="some-block option-block"> + <input class="custom-instance" placeholder="http://wikiless.i2p" type="url" /> + <button type="submit" class="add add-instance"> + <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" + fill="currentColor"> + <path d="M0 0h24v24H0V0z" fill="none" /> + <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> + </svg> + </button> + </div> + </form> + <div class="checklist custom-checklist"></div> </div> + </div> </section> @@ -201,4 +227,4 @@ <script type="module" src="../../../assets/javascripts/localise.js"></script> </body> -</html> \ No newline at end of file +</html> diff --git a/src/pages/options/wikipedia/wikipedia.js b/src/pages/options/wikipedia/wikipedia.js index 1cad27a3..a2dafbfe 100644 --- a/src/pages/options/wikipedia/wikipedia.js +++ b/src/pages/options/wikipedia/wikipedia.js @@ -18,13 +18,21 @@ protocolElement.addEventListener("change", function changeProtocolSettings(protocol) { let normalDiv = document.getElementsByClassName("normal")[0]; let torDiv = document.getElementsByClassName("tor")[0]; + let i2pDiv = document.getElementsByClassName("i2p")[0]; if (protocol == 'normal') { normalDiv.style.display = 'block'; torDiv.style.display = 'none'; + i2pDiv.style.display = 'none'; } else if (protocol == 'tor') { normalDiv.style.display = 'none'; torDiv.style.display = 'block'; + i2pDiv.style.display = 'none'; + } + else if (protocol == 'i2p') { + normalDiv.style.display = 'none'; + torDiv.style.display = 'none'; + i2pDiv.style.display = 'block'; } } @@ -57,4 +65,15 @@ wikipediaHelper.init().then(() => { wikipediaHelper.getWikilessTorCustomRedirects, wikipediaHelper.setWikilessTorCustomRedirects ) -}) \ No newline at end of file + + commonHelper.processDefaultCustomInstances( + 'wikiless', + 'i2p', + wikipediaHelper, + document, + wikipediaHelper.getWikilessI2pRedirectsChecks, + wikipediaHelper.setWikilessI2pRedirectsChecks, + wikipediaHelper.getWikilessI2pCustomRedirects, + wikipediaHelper.setWikilessI2pCustomRedirects + ) +}) diff --git a/src/pages/options/youtube/youtube.html b/src/pages/options/youtube/youtube.html index 95ebb7d4..e29fefbe 100644 --- a/src/pages/options/youtube/youtube.html +++ b/src/pages/options/youtube/youtube.html @@ -15,7 +15,7 @@ <section class="links"> <div class="title"> - <svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" + <svg xmlns="https://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor"> <path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z" /> @@ -75,7 +75,7 @@ <div class="title"> <!-- https://markentier.tech/posts/2020/10/medium-icon-svg/ --> - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor"> + <svg xmlns="https://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor"> <circle cx="500" cy="500" r="500" /> <ellipse ry="475" rx="250" cy="501" cx="1296" /> <ellipse cx="1682" cy="502" rx="88" ry="424" /> @@ -94,7 +94,7 @@ </div> <div class="title"> - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"> + <svg xmlns="https://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"> <path d="M0 0h24v24H0V0z" fill="none" /> <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" /> @@ -103,7 +103,7 @@ </div> <div class="title"> - <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"> + <svg xmlns="https://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"> <path d="M0 0h24v24H0V0z" fill="none" /> <path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z" /> @@ -112,7 +112,7 @@ </div> <div class="title"> - <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"> + <svg xmlns="https://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"> <path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" /> </svg> @@ -120,7 +120,7 @@ </div> <div class="title"> - <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"> + <svg xmlns="https://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"> <path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z" /> </svg> @@ -746,7 +746,7 @@ <div class="some-block option-block"> <input class="custom-instance" placeholder="https://invidious.com" type="url" /> <button type="submit" class="add" class="add-instance"> - <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" + <svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> <path d="M0 0h24v24H0V0z" fill="none" /> <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> @@ -769,9 +769,9 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://invidious.com" type="url" /> + <input class="custom-instance" placeholder="http://invidious.onion" type="url" /> <button type="submit" class="add" class="add-instance"> - <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" + <svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> <path d="M0 0h24v24H0V0z" fill="none" /> <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> @@ -1134,7 +1134,7 @@ <div class="some-block option-block"> <input class="custom-instance" placeholder="https://piped.com" type="url" /> <button type="submit" class="add" class="add-instance"> - <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" + <svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> <path d="M0 0h24v24H0V0z" fill="none" /> <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> @@ -1157,9 +1157,9 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://piped.com" type="url" /> + <input class="custom-instance" placeholder="http://piped.onion" type="url" /> <button type="submit" class="add" class="add-instance"> - <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" + <svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> <path d="M0 0h24v24H0V0z" fill="none" /> <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> @@ -1262,9 +1262,9 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://material.com" type="url" /> + <input class="custom-instance" placeholder="https://pipedMaterial.com" type="url" /> <button type="submit" class="add" class="add-instance"> - <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" + <svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> <path d="M0 0h24v24H0V0z" fill="none" /> <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> @@ -1286,9 +1286,9 @@ </div> <form class="custom-instance-form"> <div class="some-block option-block"> - <input class="custom-instance" placeholder="https://pipedMaterial.com" type="url" /> + <input class="custom-instance" placeholder="http://pipedMaterial.onion" type="url" /> <button type="submit" class="add" class="add-instance"> - <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" + <svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> <path d="M0 0h24v24H0V0z" fill="none" /> <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> @@ -1311,4 +1311,4 @@ <script type="module" src="../../../assets/javascripts/localise.js"></script> </body> -</html> \ No newline at end of file +</html> diff --git a/src/pages/options/youtubeMusic/youtubeMusic.html b/src/pages/options/youtubeMusic/youtubeMusic.html index d2cc4906..abe04b09 100644 --- a/src/pages/options/youtubeMusic/youtubeMusic.html +++ b/src/pages/options/youtubeMusic/youtubeMusic.html @@ -136,32 +136,34 @@ <hr> - <div id="normal"> - <div class="some-block option-block"> - <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4> - </div> - <div class="checklist" id="beatbump-normal-checklist"></div> - <hr> - <div class="some-block option-block"> - <h4 data-localise="__MSG_customInstances__">Custom Instances</h4> - </div> - <form id="custom-beatbump-normal-instance-form"> + <div id="beatbump"> + <div class="normal"> + <div class="some-block option-block"> + <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4> + </div> + <div class="checklist checklist"></div> + <hr> <div class="some-block option-block"> - <input id="beatbump-normal-custom-instance" placeholder="https://beatbump.com" type="url" /> - <button type="submit" class="add" id="beatbump-normal-add-instance"> - <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> - <path d="M0 0h24v24H0V0z" fill="none" /> - <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> - </svg> - </button> + <h4 data-localise="__MSG_customInstances__">Custom Instances</h4> </div> - </form> - <div class="checklist" id="beatbump-normal-custom-checklist"></div> + <form class="custom-instance-form"> + <div class="some-block option-block"> + <input class="custom-instance" placeholder="https://beatbump.com" type="url" /> + <button type="submit" class="add add-instance"> + <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" + fill="currentColor"> + <path d="M0 0h24v24H0V0z" fill="none" /> + <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> + </svg> + </button> + </div> + </form> + <div class="checklist custom-checklist"></div> + </div> </div> - </section> <script type="module" src="../init.js"></script> diff --git a/src/pages/options/youtubeMusic/youtubeMusic.js b/src/pages/options/youtubeMusic/youtubeMusic.js index 5ae354d8..597458d3 100644 --- a/src/pages/options/youtubeMusic/youtubeMusic.js +++ b/src/pages/options/youtubeMusic/youtubeMusic.js @@ -19,4 +19,4 @@ youtubeMusicHelper.init().then(() => { youtubeMusicHelper.getBeatbumpNormalCustomRedirects, youtubeMusicHelper.setBeatbumpNormalCustomRedirects ) -}); \ No newline at end of file +}); |