コミットを比較
10 コミット
ccf253dff1
...
f711ed843e
作成者 | SHA1 | 日付 |
---|---|---|
守矢諏訪子 | f711ed843e | |
ManeraKai | d813226928 | |
ManeraKai | 7ff510a1f1 | |
ManeraKai | 2edc497f2a | |
ManeraKai | f035e800ac | |
ManeraKai | 649e83b77f | |
ManeraKai | f93de9220c | |
ManeraKai | b26f510616 | |
Glen Lowland | a659c520f0 | |
ManeraKai | 286ebd9e94 |
|
@ -1,32 +0,0 @@
|
|||
---
|
||||
name: "Report a bug"
|
||||
about: "Is libredirect not behaving as expected? Report a bug so that it can be fixed as soon as possible."
|
||||
labels:
|
||||
- "Kind: Bug"
|
||||
---
|
||||
|
||||
## What happened?
|
||||
|
||||
## What did you expect to happen?
|
||||
|
||||
## Steps to reproduce:
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
<!-- and so on -->
|
||||
|
||||
## Debug information:
|
||||
|
||||
Browser and version number:
|
||||
Libredirect version:
|
||||
|
||||
## Screenshots/Videos
|
||||
|
||||
<!--Just drag and drop any screenshots or videos you have of the issue below-->
|
||||
|
||||
<br>
|
||||
<!--Put an "x" between the brackets to confirm-->
|
||||
|
||||
- [ ] I have checked on codeberg and github and can confirm this issue is not a duplicate.
|
|
@ -1,15 +0,0 @@
|
|||
---
|
||||
name: "Suggest a new feature"
|
||||
about: "Is there something missing that you want to see in libredirect? Suggest a feature so it will exist in a future release."
|
||||
labels:
|
||||
- "Kind: Feature"
|
||||
---
|
||||
|
||||
## Describe your current issue/inconvenience
|
||||
|
||||
## Explain how this new feature will solve this
|
||||
|
||||
<br>
|
||||
<!--Put an "x" between the brackets to confirm-->
|
||||
|
||||
- [ ] I have checked on codeberg and github and can confirm this issue is not a duplicate.
|
|
@ -3,7 +3,7 @@
|
|||
- LibRedirect does not collect any Personal Information of any kind.
|
||||
- LibRedirect doesn't embed any kind of analytics in its code.
|
||||
- All aspects of the url redirections work locally, except OpenStreetMap (OSM) reverse geocoding, done via the [OSM Nomantim API](https://nominatim.org/release-docs/develop/api/Overview/).
|
||||
- When you visit your settings page and go to ex YouTube, it will connect to this [repository](https://github.com/libredirect/instances) and specifically [this](https://raw.githubusercontent.com/libredirect/instances/main/data.json) and [this](https://raw.githubusercontent.com/libredirect/instances/main/blacklist.json) url to get the latest public instances list for it.
|
||||
- When you visit your settings page and go to ex YouTube, it will connect to this [repository](https://gitler.moe/suwako/libreredirect-instances) and specifically [this](https://gitler.moe/suwako/libreredirect-instances/raw/branch/main/data.json) and [this](https://gitler.moe/suwako/libreredirect-instances/raw/branch/main/blacklist.json) url to get the latest public instances list for it.
|
||||
|
||||
## Future Changes
|
||||
|
||||
|
|
59
README.md
|
@ -1,51 +1,24 @@
|
|||
<img src="./img/libredirect_full.svg" height="50"/>
|
||||
# Libre Redirect
|
||||
|
||||
A browser extension that redirects YouTube, Twitter, TikTok... requests to alternative privacy friendly frontends and backends.
|
||||
[検閲が大嫌い](https://github.com/libredirect/browser_extension/issues/693)。\
|
||||
だからLibRedirectをフォークしました。
|
||||
|
||||
<a href="https://addons.mozilla.org/firefox/addon/libredirect/">
|
||||
<img src ="./img/badge-amo.png" height=60 >
|
||||
</a>
|
||||
|
||||
<a href="https://libredirect.github.io/download_chromium.html">
|
||||
<img src ="./img/badge-chromium.png" height=60 >
|
||||
</a>
|
||||
|
||||
## Translate
|
||||
<a href="https://hosted.weblate.org/projects/libredirect/extension">
|
||||
<img src ="./img/weblate.svg">
|
||||
</a>
|
||||
|
||||
## Development
|
||||
Install [Node.js](https://nodejs.org/)
|
||||
## 開発
|
||||
```bash
|
||||
git clone https://github.com/libredirect/browser_extension
|
||||
cd browser_extension
|
||||
npm install
|
||||
npm run html # Generates html using Pug
|
||||
npm run start # Runs in firefox in debug mode using Web-ext
|
||||
git clone https://gitler.moe/suwako/libreredirect
|
||||
cd libreredirect
|
||||
npm i
|
||||
npm run html
|
||||
npm run start
|
||||
```
|
||||
### Build and Run on Chromium manually
|
||||
1. Open `chrome://extensions`
|
||||
2. Enable `dev mode`
|
||||
3. Select `load unpacked extension`
|
||||
4. Select `src` folder
|
||||
|
||||
### Build a zip package for Firefox
|
||||
### Chromium向けビルドと実行
|
||||
1. `chrome://extensions`にアクセスして
|
||||
2. `デベロッパー モード`を有効にして
|
||||
3. `パッケージ化されていない拡張機能を読み込む`をクリックして
|
||||
4. `src`フォルダーを開いて
|
||||
|
||||
### Firefox向けZIPパッケージを創作
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
### Install the zip package on Firefox (temporarily)
|
||||
3. Type in the address bar: `about:debugging#/runtime/this-firefox`
|
||||
4. Press `Load Temporary Add-on...`
|
||||
5. Select `libredirect-VERSION.zip` from `web-ext-artifacts` folder
|
||||
|
||||
### Install the zip package on Firefox ESR, Developer Edition, Nightly
|
||||
3. Type in the address bar: `about:config`
|
||||
4. Set `xpinstall.signatures.required` to `false`
|
||||
5. Type in the address bar: `about:addons`
|
||||
6. Click on the gear shaped `settings` button and select `Install Add-on From File...`
|
||||
7. Select `libredirect-VERSION.zip` from `web-ext-artifacts` folder
|
||||
|
||||
---
|
||||
|
||||
Forked from [Privacy Redirect](https://github.com/SimonBrazell/privacy-redirect)
|
||||
|
|
15
package.json
|
@ -1,27 +1,26 @@
|
|||
{
|
||||
"name": "libredirect",
|
||||
"description": "Redirects YouTube, Twitter, TikTok and more to privacy friendly frontends.",
|
||||
"name": "libreredirect",
|
||||
"description": "Redirects YouTube, Twitter, TikTok and more to privacy friendly frontends without censor.",
|
||||
"engines": {
|
||||
"node": ">=16.13.1",
|
||||
"npm": ">=8.1.2"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "web-ext run",
|
||||
"start_ar": "web-ext run --firefox=/home/esmail/Downloads/ar/firefox/firefox --pref font.language.group=ar",
|
||||
"build": "web-ext build",
|
||||
"test": "web-ext lint",
|
||||
"html": "pug --basedir ./ --obj ./src/config.json src/pages/options/index.pug --out src/pages/options/ && pug --basedir ./ --obj ./src/config.json src/pages/popup/popup.pug --out src/pages/popup/"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/libredirect/libredirect.git"
|
||||
"url": "git+https://gitler.moe/suwako/libreredirect.git"
|
||||
},
|
||||
"author": "LibRedirect",
|
||||
"author": "suwako",
|
||||
"license": "GPL-3.0-only",
|
||||
"bugs": {
|
||||
"url": "https://github.com/libredirect/libredirect/issues"
|
||||
"url": "https://gitler.moe/suwako/libreredirect/issues"
|
||||
},
|
||||
"homepage": "https://libredirect.github.io",
|
||||
"homepage": "https://076.moe/libreredirect",
|
||||
"devDependencies": {
|
||||
"web-ext": "^7.2.0",
|
||||
"pug-cli": "^1.0.0-alpha6"
|
||||
|
@ -35,4 +34,4 @@
|
|||
"overwriteDest": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "extension name"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "Nome da Extensão"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extensionName": {
|
||||
"message": "LibRedirect",
|
||||
"message": "Libre Redirect",
|
||||
"description": "name of the extension"
|
||||
},
|
||||
"extensionDescription": {
|
||||
|
|
変更前 幅: | 高さ: | サイズ: 3.5 KiB 変更後 幅: | 高さ: | サイズ: 3.5 KiB |
変更前 幅: | 高さ: | サイズ: 530 B 変更後 幅: | 高さ: | サイズ: 530 B |
変更前 幅: | 高さ: | サイズ: 971 B 変更後 幅: | 高さ: | サイズ: 971 B |
変更前 幅: | 高さ: | サイズ: 1.4 KiB 変更後 幅: | 高さ: | サイズ: 1.4 KiB |
変更前 幅: | 高さ: | サイズ: 42 KiB 変更後 幅: | 高さ: | サイズ: 42 KiB |
|
@ -10,7 +10,7 @@
|
|||
inkscape:export-xdpi="78.019997"
|
||||
inkscape:export-ydpi="78.019997"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20, custom)"
|
||||
sodipodi:docname="libredirect.svg"
|
||||
sodipodi:docname="libreredirect.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
変更前 幅: | 高さ: | サイズ: 5.0 KiB 変更後 幅: | 高さ: | サイズ: 5.0 KiB |
変更後 幅: | 高さ: | サイズ: 8.5 KiB |
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
class="gUZ GjR U9O kVc"
|
||||
height="32"
|
||||
width="32"
|
||||
viewBox="0 0 24 24"
|
||||
aria-label="Pinterest"
|
||||
role="img"
|
||||
version="1.1"
|
||||
id="svg4"
|
||||
sodipodi:docname="pintrest-icon.svg"
|
||||
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs8" />
|
||||
<sodipodi:namedview
|
||||
id="namedview6"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
showgrid="false"
|
||||
inkscape:zoom="24.3125"
|
||||
inkscape:cx="10.858612"
|
||||
inkscape:cy="16"
|
||||
inkscape:window-width="1888"
|
||||
inkscape:window-height="1060"
|
||||
inkscape:window-x="32"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg4" />
|
||||
<path
|
||||
d="M0 12c0 5.123 3.211 9.497 7.73 11.218-.11-.937-.227-2.482.025-3.566.217-.932 1.401-5.938 1.401-5.938s-.357-.715-.357-1.774c0-1.66.962-2.9 2.161-2.9 1.02 0 1.512.765 1.512 1.682 0 1.025-.653 2.557-.99 3.978-.281 1.189.597 2.159 1.769 2.159 2.123 0 3.756-2.239 3.756-5.471 0-2.861-2.056-4.86-4.991-4.86-3.398 0-5.393 2.549-5.393 5.184 0 1.027.395 2.127.889 2.726a.36.36 0 0 1 .083.343c-.091.378-.293 1.189-.332 1.355-.053.218-.173.265-.4.159-1.492-.694-2.424-2.875-2.424-4.627 0-3.769 2.737-7.229 7.892-7.229 4.144 0 7.365 2.953 7.365 6.899 0 4.117-2.595 7.431-6.199 7.431-1.211 0-2.348-.63-2.738-1.373 0 0-.599 2.282-.744 2.84-.282 1.084-1.064 2.456-1.549 3.235C9.584 23.815 10.77 24 12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12"
|
||||
id="path2"
|
||||
style="fill:#e60023;fill-opacity:1" />
|
||||
</svg>
|
変更後 幅: | 高さ: | サイズ: 1.9 KiB |
変更後 幅: | 高さ: | サイズ: 6.8 KiB |
|
@ -9,7 +9,6 @@ function init() {
|
|||
return new Promise(async resolve => {
|
||||
options = await utils.getOptions()
|
||||
config = await utils.getConfig()
|
||||
// await sendEnabledFrontends()
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
|
@ -17,19 +16,6 @@ function init() {
|
|||
init()
|
||||
browser.storage.onChanged.addListener(init)
|
||||
|
||||
function sendEnabledFrontends() {
|
||||
let enabledFrontends = []
|
||||
if (options) {
|
||||
for (const service in config.services) {
|
||||
if (!options[service].enabled) continue
|
||||
enabledFrontends.push(options[service].frontend)
|
||||
}
|
||||
var port = browser.runtime.connectNative("org.libredirect.stdin_parser");
|
||||
port.postMessage(JSON.stringify(enabledFrontends));
|
||||
port.disconnect()
|
||||
}
|
||||
}
|
||||
|
||||
function all(service, frontend, options, config) {
|
||||
let instances = []
|
||||
if (!frontend) {
|
||||
|
@ -60,6 +46,8 @@ function regexArray(service, url, config, frontend) {
|
|||
|
||||
async function redirectAsync(url, type, initiator, forceRedirection) {
|
||||
await init()
|
||||
console.log(url.hostname)
|
||||
console.log(url.pathname)
|
||||
return redirect(url, type, initiator, forceRedirection)
|
||||
}
|
||||
|
||||
|
@ -88,7 +76,7 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
|
||||
let instanceList = options[frontend]
|
||||
if (instanceList === undefined) break
|
||||
if (instanceList.length === 0) return
|
||||
if (instanceList.length === 0) return null
|
||||
|
||||
if (
|
||||
initiator
|
||||
|
@ -100,7 +88,6 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
if (config.services[service].frontends[frontend].localhost && options[service].instance == "localhost") {
|
||||
randomInstance = `http://${frontend}.localhost:8080`
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
|
@ -123,7 +110,6 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
if (!frontend) return
|
||||
|
||||
switch (frontend) {
|
||||
// This is where all instance-specific code must be ran to convert the service url to one that can be understood by the frontend.
|
||||
case "beatbump": {
|
||||
return `${randomInstance}${url.pathname}${url.search}`
|
||||
.replace("/watch?v=", "/listen?id=")
|
||||
|
@ -169,7 +155,6 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
return `${randomInstance}/pic${url.pathname}${search}`
|
||||
}
|
||||
}
|
||||
|
||||
if (url.pathname.split("/").includes("tweets")) return `${randomInstance}${url.pathname.replace("/tweets", "")}${search}`
|
||||
if (url.host == "t.co") return `${randomInstance}/t.co${url.pathname}`
|
||||
return `${randomInstance}${url.pathname}${search}#m`
|
||||
|
@ -180,19 +165,7 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
case "freetube": {
|
||||
return `freetube://https://youtu.be${url.pathname}${url.search}`.replace(/watch\?v=/, "")
|
||||
}
|
||||
case "invidious":
|
||||
case "piped":
|
||||
case "pipedMaterial":
|
||||
case "cloudtube": {
|
||||
if (url.pathname.startsWith("/live_chat")) {
|
||||
return null;
|
||||
}
|
||||
return `${randomInstance}${url.pathname}${url.search}`;
|
||||
}
|
||||
case "poketube": {
|
||||
if (url.pathname.startsWith("/live_chat")) {
|
||||
return null;
|
||||
}
|
||||
if (url.pathname.startsWith('/channel')) {
|
||||
const reg = /\/channel\/(.*)\/?$/.exec(url.pathname)
|
||||
if (reg) {
|
||||
|
@ -200,11 +173,10 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
return `${randomInstance}/channel?id=${id}${url.search}`
|
||||
}
|
||||
}
|
||||
if (/\/@[a-z]+\//.exec(url.pathname)) {
|
||||
return randomInstance
|
||||
}
|
||||
if (/\/@[a-z]+\//.exec(url.pathname)) return randomInstance
|
||||
return `${randomInstance}${url.pathname}${url.search}`
|
||||
}
|
||||
case "libMedium":
|
||||
case "scribe": {
|
||||
const regex = url.hostname.match(/^(link|cdn-images-\d+|.*)\.medium\.com/)
|
||||
if (regex && regex.length > 1) {
|
||||
|
@ -239,7 +211,7 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
return randomInstance
|
||||
}
|
||||
case "osm": {
|
||||
if (initiator && initiator.host === "earth.google.com") return
|
||||
if (initiator && initiator.host === "earth.google.com") return randomInstance
|
||||
const travelModes = {
|
||||
driving: "fossgis_osrm_car",
|
||||
walking: "fossgis_osrm_foot",
|
||||
|
@ -249,13 +221,6 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
|
||||
function addressToLatLng(address) {
|
||||
const xmlhttp = new XMLHttpRequest()
|
||||
xmlhttp.timeout = 5000
|
||||
http.ontimeout = () => {
|
||||
return
|
||||
}
|
||||
http.onerror = () => {
|
||||
return
|
||||
}
|
||||
xmlhttp.send()
|
||||
http.onreadystatechange = () => {
|
||||
if (xmlhttp.status === 200) {
|
||||
|
@ -279,8 +244,6 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
if (url.pathname.includes("/embed")) {
|
||||
// Handle Google Maps Embed API
|
||||
// https://www.google.com/maps/embed/v1/place?key=AIzaSyD4iE2xVSpkLLOXoyqT-RuPwURN3ddScAI&q=Eiffel+Tower,Paris+France
|
||||
//console.log("embed life")
|
||||
|
||||
let query = ""
|
||||
if (url.searchParams.has("q")) query = url.searchParams.get("q")
|
||||
else if (url.searchParams.has("query")) query = url.searchParams.has("query")
|
||||
|
@ -316,16 +279,12 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
} else if (url.pathname.includes("data=") && url.pathname.match(dataLatLngRegex)) {
|
||||
// Get marker from data attribute
|
||||
// https://www.google.com/maps/place/41%C2%B001'58.2%22N+40%C2%B029'18.2%22E/@41.032833,40.4862063,17z/data=!3m1!4b1!4m6!3m5!1s0x0:0xf64286eaf72fc49d!7e2!8m2!3d41.0328329!4d40.4883948
|
||||
//console.log("data life")
|
||||
|
||||
let [, mlat, mlon] = url.pathname.match(dataLatLngRegex)
|
||||
|
||||
return `${randomInstance}/search?query=${mlat}%2C${mlon}`
|
||||
} else if (url.searchParams.has("ll")) {
|
||||
// Get marker from ll param
|
||||
// https://maps.google.com/?ll=38.882147,-76.99017
|
||||
//console.log("ll life")
|
||||
|
||||
const [mlat, mlon] = url.searchParams.get("ll").split(",")
|
||||
|
||||
return `${randomInstance}/search?query=${mlat}%2C${mlon}`
|
||||
|
@ -357,7 +316,7 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
return `${randomInstance}/${mapCentre}&${prefsEncoded}`
|
||||
}
|
||||
case "facil": {
|
||||
if (initiator && initiator.host === "earth.google.com") return
|
||||
if (initiator && initiator.host === "earth.google.com") return randomInstance
|
||||
const travelModes = {
|
||||
driving: "car",
|
||||
walking: "pedestrian",
|
||||
|
@ -397,36 +356,25 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
} else if (url.pathname.includes("data=") && url.pathname.match(dataLatLngRegex)) {
|
||||
// Get marker from data attribute
|
||||
// https://www.google.com/maps/place/41%C2%B001'58.2%22N+40%C2%B029'18.2%22E/@41.032833,40.4862063,17z/data=!3m1!4b1!4m6!3m5!1s0x0:0xf64286eaf72fc49d!7e2!8m2!3d41.0328329!4d40.4883948
|
||||
//console.log("data life")
|
||||
|
||||
let [, mlat, mlon] = url.pathname.match(dataLatLngRegex)
|
||||
|
||||
return `${randomInstance}/#q=${mlat}%2C${mlon}`
|
||||
} else if (url.searchParams.has("ll")) {
|
||||
// Get marker from ll param
|
||||
// https://maps.google.com/?ll=38.882147,-76.99017
|
||||
//console.log("ll life")
|
||||
|
||||
const [mlat, mlon] = url.searchParams.get("ll").split(",")
|
||||
|
||||
return `${randomInstance}/#q=${mlat}%2C${mlon}`
|
||||
} else if (url.searchParams.has("viewpoint")) {
|
||||
// Get marker from viewpoint param.
|
||||
// Get marker from viewpoint param
|
||||
// https://www.google.com/maps/@?api=1&map_action=pano&viewpoint=48.857832,2.295226&heading=-45&pitch=38&fov=80
|
||||
//console.log("viewpoint life")
|
||||
|
||||
const [mlat, mlon] = url.searchParams.get("viewpoint").split(",")
|
||||
|
||||
return `${randomInstance}/#q=${mlat}%2C${mlon}`
|
||||
} else {
|
||||
// Use query as search if present.
|
||||
//console.log("normal life")
|
||||
|
||||
let query
|
||||
if (url.searchParams.has("q")) query = url.searchParams.get("q")
|
||||
else if (url.searchParams.has("query")) query = url.searchParams.get("query")
|
||||
else if (url.pathname.match(placeRegex)) query = url.pathname.match(placeRegex)[1]
|
||||
|
||||
if (query) return `${randomInstance}/${mapCentre}/Mpnk/${query}`
|
||||
}
|
||||
}
|
||||
|
@ -479,7 +427,7 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
case "neuters": {
|
||||
const p = url.pathname
|
||||
if (p.startsWith('/article/') || p.startsWith('/pf/') || p.startsWith('/arc/') || p.startsWith('/resizer/')) {
|
||||
return null
|
||||
return randomInstance
|
||||
}
|
||||
return `${randomInstance}${p}`
|
||||
}
|
||||
|
@ -489,11 +437,11 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
}
|
||||
}
|
||||
case "ruralDictionary": {
|
||||
if (!url.pathname.includes('/define.php') && !url.pathname.includes('/random.php') && url.pathname != '/') return
|
||||
if (!url.pathname.includes('/define.php') && !url.pathname.includes('/random.php') && url.pathname != '/') return randomInstance
|
||||
return `${randomInstance}${url.pathname}${url.search}`
|
||||
}
|
||||
case "anonymousOverflow": {
|
||||
if (!url.pathname.startsWith('/questions') && url.pathname != '/') return
|
||||
if (!url.pathname.startsWith('/questions') && url.pathname != '/') return randomInstance
|
||||
if (url.hostname == "stackoverflow.com") {
|
||||
const threadID = /\/(\d+)\/?$/.exec(url.pathname)
|
||||
if (threadID) return `${randomInstance}/questions/${threadID[1]}${url.search}`
|
||||
|
@ -506,33 +454,21 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
}
|
||||
}
|
||||
case "biblioReads": {
|
||||
if (!url.pathname.startsWith('/book/show/') && url.pathname != '/') return
|
||||
if (!url.pathname.startsWith('/book/show/') && url.pathname != '/') return randomInstance
|
||||
return `${randomInstance}${url.pathname}${url.search}`
|
||||
}
|
||||
case "wikiless": {
|
||||
let GETArguments = []
|
||||
if (url.search.length > 0) {
|
||||
let search = url.search.substring(1) //get rid of '?'
|
||||
let argstrings = search.split("&")
|
||||
for (let i = 0; i < argstrings.length; i++) {
|
||||
let args = argstrings[i].split("=")
|
||||
GETArguments.push([args[0], args[1]])
|
||||
}
|
||||
}
|
||||
|
||||
let link = `${randomInstance}${url.pathname}`
|
||||
let urlSplit = url.host.split(".")
|
||||
if (urlSplit[0] != "wikipedia" && urlSplit[0] != "www") {
|
||||
if (urlSplit[0] == "m") GETArguments.push(["mobileaction", "toggle_view_mobile"])
|
||||
else GETArguments.push(["lang", urlSplit[0]])
|
||||
if (urlSplit[1] == "m") GETArguments.push(["mobileaction", "toggle_view_mobile"])
|
||||
let hostSplit = url.host.split(".")
|
||||
if (hostSplit[0] != "wikipedia" && hostSplit[0] != "www") {
|
||||
// wikiless doesn't have mobile view support yet
|
||||
if (hostSplit[0] == "m") url.searchParams.append("mobileaction", "toggle_view_mobile")
|
||||
else url.searchParams.append("lang", hostSplit[0])
|
||||
if (hostSplit[1] == "m") url.searchParams.append("mobileaction", "toggle_view_mobile")
|
||||
}
|
||||
for (let i = 0; i < GETArguments.length; i++) link += (i == 0 ? "?" : "&") + GETArguments[i][0] + "=" + GETArguments[i][1]
|
||||
return link + url.hash
|
||||
return `${randomInstance}${url.pathname}${GETArguments.toString()}${url.hash}`
|
||||
}
|
||||
case "proxiTok": {
|
||||
if (url.pathname.startsWith('/email')) return
|
||||
if (url.pathname.startsWith('/email')) return randomInstance
|
||||
return `${randomInstance}${url.pathname}${url.search}`
|
||||
}
|
||||
case "waybackClassic": {
|
||||
|
@ -599,6 +535,49 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
}
|
||||
}
|
||||
}
|
||||
case "binternet": {
|
||||
if (url.hostname == "i.pinimg.com") return `${randomInstance}/image_proxy.php?url=${url.href}`
|
||||
return randomInstance
|
||||
}
|
||||
case "spliti": {
|
||||
if (url.hostname == "news.mixi.jp") {
|
||||
if (url.search) {
|
||||
let nid = url.search.split("?")[1].split("&")
|
||||
let mid
|
||||
nid.forEach(x => {
|
||||
if (x.startsWith("id=")) nid = x.split("=")[1]
|
||||
if (x.startsWith("media_id=")) mid = x.split("=")[1]
|
||||
})
|
||||
if (url.pathname.startsWith('/view_news.pl') && url.pathname != '/') return `${randomInstance}/?url=view_news.pl?id=${nid}&media_id=${mid}`
|
||||
if (url.pathname.startsWith('/list_news_category.pl') && url.pathname != '/') return `${randomInstance}/?url=list_news_category.pl?id=${nid}`
|
||||
}
|
||||
return randomInstance
|
||||
}
|
||||
}
|
||||
case "vixip": {
|
||||
if (url.hostname == "pixiv.net" || url.hostname == "www.pixiv.net") {
|
||||
let path = url.pathname
|
||||
if (url.pathname.startsWith('/en')) path = path.splice(3)
|
||||
console.log(path)
|
||||
if (path.startsWith('/users')) {
|
||||
const illustid = /\/(\d+)\/?$/.exec(url.pathname)[1]
|
||||
if (path.includes('/illusts')) return `${randomInstance}/users/illusts/?id=${illustid}`
|
||||
if (path.includes('/manga')) return `${randomInstance}/users/manga/?id=${illustid}`
|
||||
return `${randomInstance}/users/?id=${illustid}`
|
||||
}
|
||||
|
||||
if (path.startsWith('/artworks')) {
|
||||
const illustid = /\/(\d+)\/?$/.exec(url.pathname)[1]
|
||||
return `${randomInstance}/artworks/?id=${illustid}`
|
||||
}
|
||||
|
||||
if (path.startsWith('/tags')) {
|
||||
const q = path.split("/")[2]
|
||||
return `${randomInstance}/search/?q=${q}`
|
||||
}
|
||||
return randomInstance
|
||||
}
|
||||
}
|
||||
default: {
|
||||
return `${randomInstance}${url.pathname}${url.search}`
|
||||
}
|
||||
|
@ -675,6 +654,8 @@ function reverse(url) {
|
|||
case "twitter":
|
||||
case "reddit":
|
||||
case "imdb":
|
||||
case "snopes":
|
||||
case "urbanDictionary":
|
||||
case "quora":
|
||||
case "medium":
|
||||
resolve(config.services[service].url + url.pathname + url.search)
|
||||
|
@ -698,14 +679,16 @@ function reverse(url) {
|
|||
}
|
||||
|
||||
const defaultInstances = {
|
||||
'invidious': ['https://inv.vern.cc'],
|
||||
'invidious': ['https://youtube.owacon.moe'],
|
||||
'piped': ['https://pipedapi-libre.kavin.rocks'],
|
||||
'pipedMaterial': ['https://piped-material.xn--17b.net'],
|
||||
'cloudtube': ['https://tube.cadence.moe'],
|
||||
'poketube': ['https://poketube.fun'],
|
||||
'proxiTok': ['https://proxitok.pabloferreiro.es'],
|
||||
'send': ['https://send.vis.ee'],
|
||||
'nitter': ['https://nitter.net'],
|
||||
'nitter': ['https://twitter.owacon.moe'],
|
||||
'spliti': ['https://mixi.owacon.moe'],
|
||||
'vixip': ['https://pixiv.owacon.moe'],
|
||||
'libreddit': ['https://libreddit.spike.codes'],
|
||||
'teddit': ['https://teddit.net'],
|
||||
'scribe': ['https://scribe.rip'],
|
||||
|
@ -735,7 +718,8 @@ const defaultInstances = {
|
|||
"tent": ['https://tent.sny.sh'],
|
||||
"wolfreeAlpha": ['https://gqq.gitlab.io', 'https://uqq.gitlab.io'],
|
||||
"libreSpeed": ['https://librespeed.org'],
|
||||
'jitsi': ['https://meet.jit.si', 'https://8x8.vc']
|
||||
'jitsi': ['https://meet.jit.si', 'https://8x8.vc'],
|
||||
'binternet': ['https://binternet.ahwx.org']
|
||||
}
|
||||
|
||||
function initDefaults() {
|
||||
|
|
|
@ -35,16 +35,13 @@ function getOptions() {
|
|||
function getBlacklist(options) {
|
||||
return new Promise(resolve => {
|
||||
let url
|
||||
if (options.fetchInstances == 'github') {
|
||||
url = 'https://raw.githubusercontent.com/libredirect/instances/main/blacklist.json'
|
||||
}
|
||||
else if (options.fetchInstances == 'codeberg') {
|
||||
url = 'https://codeberg.org/LibRedirect/instances/raw/branch/main/blacklist.json'
|
||||
}
|
||||
else {
|
||||
resolve('disabled')
|
||||
return
|
||||
}
|
||||
if (options.fetchInstances == 'gitler') {
|
||||
url = 'https://gitler.moe/suwako/libreredirect-instances/raw/branch/main/blacklist.json'
|
||||
}
|
||||
else {
|
||||
resolve('disabled')
|
||||
return
|
||||
}
|
||||
const http = new XMLHttpRequest()
|
||||
http.open("GET", url, true)
|
||||
http.onreadystatechange = () => {
|
||||
|
@ -68,16 +65,13 @@ function getBlacklist(options) {
|
|||
function getList(options) {
|
||||
return new Promise(resolve => {
|
||||
let url
|
||||
if (options.fetchInstances == 'github') {
|
||||
url = 'https://raw.githubusercontent.com/libredirect/instances/main/data.json'
|
||||
}
|
||||
else if (options.fetchInstances == 'codeberg') {
|
||||
url = 'https://codeberg.org/LibRedirect/instances/raw/branch/main/data.json'
|
||||
}
|
||||
else {
|
||||
resolve('disabled')
|
||||
return
|
||||
}
|
||||
if (options.fetchInstances == 'gitler') {
|
||||
url = 'https://gitler.moe/suwako/libreredirect-instances/raw/branch/main/blacklist.json'
|
||||
}
|
||||
else {
|
||||
resolve('disabled')
|
||||
return
|
||||
}
|
||||
const http = new XMLHttpRequest()
|
||||
http.open("GET", url, true)
|
||||
http.onreadystatechange = () => {
|
||||
|
|
105
src/config.json
|
@ -129,6 +129,57 @@
|
|||
"embeddable": false,
|
||||
"url": "https://music.youtube.com"
|
||||
},
|
||||
"mixi": {
|
||||
"frontends": {
|
||||
"spliti": {
|
||||
"name": "Spliti",
|
||||
"embeddable": false,
|
||||
"instanceList": true,
|
||||
"url": "https://gitler.moe/suwako/spliti",
|
||||
"localhost": true
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
"^https?:\\/{2}(news\\.|)mixi\\.jp(\\/|$)"
|
||||
],
|
||||
"name": "Mixi",
|
||||
"options": {
|
||||
"enabled": false,
|
||||
"redirectType": "main_frame",
|
||||
"unsupportedUrls": "bypass",
|
||||
"frontend": "spliti",
|
||||
"instance": "public"
|
||||
},
|
||||
"imageType": "png",
|
||||
"embeddable": true,
|
||||
"url": "https://news.mixi.jp"
|
||||
},
|
||||
"pixiv": {
|
||||
"frontends": {
|
||||
"vixip": {
|
||||
"name": "Vixip",
|
||||
"embeddable": false,
|
||||
"instanceList": true,
|
||||
"url": "https://gitler.moe/suwako/vixip",
|
||||
"localhost": true
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
"^https?:\\/{2}(www\\.|)pixiv\\.net(\\/|$)",
|
||||
"^https?:\\/{2}(www\\.|)pixiv\\.net(\\/en\\.|)(\\/|$)"
|
||||
],
|
||||
"name": "Pixiv",
|
||||
"options": {
|
||||
"enabled": false,
|
||||
"redirectType": "main_frame",
|
||||
"unsupportedUrls": "bypass",
|
||||
"frontend": "vixip",
|
||||
"instance": "public"
|
||||
},
|
||||
"imageType": "png",
|
||||
"embeddable": true,
|
||||
"url": "https://pixiv.net"
|
||||
},
|
||||
"twitter": {
|
||||
"frontends": {
|
||||
"nitter": {
|
||||
|
@ -347,6 +398,30 @@
|
|||
"embeddable": false,
|
||||
"url": "https://fandom.com"
|
||||
},
|
||||
"pinterest": {
|
||||
"name": "Pinterest",
|
||||
"frontends": {
|
||||
"binternet": {
|
||||
"name": "Binternet",
|
||||
"instanceList": true,
|
||||
"url": "https://github.com/Ahwxorg/Binternet",
|
||||
"embeddable": true
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
"^https?:\\/{2}i\\.pinimg\\.com",
|
||||
"^https?:\\/{2}(www\\.)?pinterest\\.com"
|
||||
],
|
||||
"options": {
|
||||
"enabled": false,
|
||||
"unsupportedUrls": "bypass",
|
||||
"redirectType": "main_frame",
|
||||
"frontend": "binternet"
|
||||
},
|
||||
"imageType": "svg",
|
||||
"embeddable": true,
|
||||
"url": "https://pinterest.com"
|
||||
},
|
||||
"lbry": {
|
||||
"frontends": {
|
||||
"lbryDesktop": {
|
||||
|
@ -396,7 +471,7 @@
|
|||
}
|
||||
},
|
||||
"targets": [
|
||||
"^https?:\\/{2}search\\.libredirect\\.invalid"
|
||||
"^https?:\\/{2}search\\.libreredirect\\.invalid"
|
||||
],
|
||||
"name": "Search",
|
||||
"options": {
|
||||
|
@ -407,7 +482,7 @@
|
|||
},
|
||||
"imageType": "svgMono",
|
||||
"embeddable": false,
|
||||
"url": "https://search.libredirect.invalid"
|
||||
"url": "https://search.libreredirect.invalid"
|
||||
},
|
||||
"translate": {
|
||||
"frontends": {
|
||||
|
@ -431,7 +506,7 @@
|
|||
},
|
||||
"targets": [
|
||||
"^https?:\\/{2}translate\\.google(\\.[a-z]{2,3}){1,2}\\/",
|
||||
"^https?:\\/{2}translate\\.libredirect\\.invalid"
|
||||
"^https?:\\/{2}translate\\.libreredirect\\.invalid"
|
||||
],
|
||||
"name": "Translate",
|
||||
"options": {
|
||||
|
@ -442,7 +517,7 @@
|
|||
},
|
||||
"imageType": "svgMono",
|
||||
"embeddable": false,
|
||||
"url": "https://translate.libredirect.invalid"
|
||||
"url": "https://translate.libreredirect.invalid"
|
||||
},
|
||||
"maps": {
|
||||
"frontends": {
|
||||
|
@ -458,7 +533,7 @@
|
|||
}
|
||||
},
|
||||
"targets": [
|
||||
"^https?:\\/{2}maps\\.libredirect\\.invalid",
|
||||
"^https?:\\/{2}maps\\.libreredirect\\.invalid",
|
||||
"^https?:\\/{2}(((www|maps)\\.)?(google\\.).*(\\/maps)|maps\\.(google\\.).*)"
|
||||
],
|
||||
"name": "Maps",
|
||||
|
@ -469,7 +544,7 @@
|
|||
},
|
||||
"imageType": "svgMono",
|
||||
"embeddable": false,
|
||||
"url": "https://maps.libredirect.invalid"
|
||||
"url": "https://maps.libreredirect.invalid"
|
||||
},
|
||||
"sendFiles": {
|
||||
"frontends": {
|
||||
|
@ -480,7 +555,7 @@
|
|||
}
|
||||
},
|
||||
"targets": [
|
||||
"^https?:\\/{2}send\\.libredirect\\.invalid",
|
||||
"^https?:\\/{2}send\\.libreredirect\\.invalid",
|
||||
"^https?:\\/{2}send\\.firefox\\.com\\/?$",
|
||||
"^https?:\\/{2}sendfiles\\.online\\/?$"
|
||||
],
|
||||
|
@ -492,7 +567,7 @@
|
|||
},
|
||||
"imageType": "svgMono",
|
||||
"embeddable": false,
|
||||
"url": "https://send.libredirect.invalid"
|
||||
"url": "https://send.libreredirect.invalid"
|
||||
},
|
||||
"textStorage": {
|
||||
"frontends": {
|
||||
|
@ -503,7 +578,7 @@
|
|||
}
|
||||
},
|
||||
"targets": [
|
||||
"^https?:\\/{2}paste\\.libredirect\\.invalid"
|
||||
"^https?:\\/{2}paste\\.libreredirect\\.invalid"
|
||||
],
|
||||
"name": "Paste Text",
|
||||
"options": {
|
||||
|
@ -513,7 +588,7 @@
|
|||
},
|
||||
"imageType": "svgMono",
|
||||
"embeddable": false,
|
||||
"url": "https://paste.libredirect.invalid"
|
||||
"url": "https://paste.libreredirect.invalid"
|
||||
},
|
||||
"reuters": {
|
||||
"frontends": {
|
||||
|
@ -785,7 +860,7 @@
|
|||
}
|
||||
},
|
||||
"targets": [
|
||||
"^https?:\\/{2}speedtest\\.libredirect\\.invalid\\/",
|
||||
"^https?:\\/{2}speedtest\\.libreredirect\\.invalid\\/",
|
||||
"^https?:\\/{2}(www\\.)?fast\\.com\\/$",
|
||||
"^https?:\\/{2}(www\\.)?speedtest\\.net\\/$"
|
||||
],
|
||||
|
@ -797,7 +872,7 @@
|
|||
},
|
||||
"imageType": "svgMono",
|
||||
"embeddable": false,
|
||||
"url": "https://speedtest.libredirect.invalid"
|
||||
"url": "https://speedtest.libreredirect.invalid"
|
||||
},
|
||||
"meet": {
|
||||
"name": "Meet",
|
||||
|
@ -809,7 +884,7 @@
|
|||
}
|
||||
},
|
||||
"targets": [
|
||||
"^https?:\\/{2}meet\\.libredirect\\.invalid\\/"
|
||||
"^https?:\\/{2}meet\\.libreredirect\\.invalid\\/"
|
||||
],
|
||||
"options": {
|
||||
"enabled": false,
|
||||
|
@ -818,7 +893,7 @@
|
|||
},
|
||||
"imageType": "svgMono",
|
||||
"embeddable": false,
|
||||
"url": "https://meet.libredirect.invalid"
|
||||
"url": "https://meet.libreredirect.invalid"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "__MSG_extensionName__",
|
||||
"description": "__MSG_extensionDescription__",
|
||||
"version": "2.6.1",
|
||||
"version": "2.6.2",
|
||||
"manifest_version": 2,
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
|
@ -14,10 +14,10 @@
|
|||
"persistent": true
|
||||
},
|
||||
"icons": {
|
||||
"16": "assets/images/libredirect-16.png",
|
||||
"32": "assets/images/libredirect-32.png",
|
||||
"48": "assets/images/libredirect-48.png",
|
||||
"128": "assets/images/libredirect-128.png"
|
||||
"16": "assets/images/libreredirect-16.png",
|
||||
"32": "assets/images/libreredirect-32.png",
|
||||
"48": "assets/images/libreredirect-48.png",
|
||||
"128": "assets/images/libreredirect-128.png"
|
||||
},
|
||||
"permissions": [
|
||||
"webRequest",
|
||||
|
@ -35,10 +35,10 @@
|
|||
"browser_style": false,
|
||||
"default_popup": "pages/popup/popup.html",
|
||||
"default_icon": {
|
||||
"16": "assets/images/libredirect-16.png",
|
||||
"32": "assets/images/libredirect-32.png",
|
||||
"48": "assets/images/libredirect-48.png",
|
||||
"128": "assets/images/libredirect-128.png"
|
||||
"16": "assets/images/libreredirect-16.png",
|
||||
"32": "assets/images/libreredirect-32.png",
|
||||
"48": "assets/images/libreredirect-48.png",
|
||||
"128": "assets/images/libreredirect-128.png"
|
||||
}
|
||||
},
|
||||
"options_ui": {
|
||||
|
@ -49,9 +49,9 @@
|
|||
"chrome_settings_overrides": {
|
||||
"search_provider": {
|
||||
"name": "__MSG_extensionName__",
|
||||
"keyword": "@libredirect",
|
||||
"keyword": "@libreredirect",
|
||||
"favicon_url": "https://raw.githubusercontent.com/libredirect/libredirect/master/src/assets/images/libredirect-16.png",
|
||||
"search_url": "https://search.libredirect.invalid/?q={searchTerms}",
|
||||
"search_url": "https://search.libreredirect.invalid/?q={searchTerms}",
|
||||
"encoding": "UTF-8",
|
||||
"is_default": false
|
||||
}
|
||||
|
@ -68,9 +68,21 @@
|
|||
"default": "Alt+Shift+C"
|
||||
},
|
||||
"description": "Copies the original link. Ex: Copies the original twitter link while in the nitter website"
|
||||
},
|
||||
"reverse": {
|
||||
"suggested_key": {
|
||||
"default": "Alt+Shift+O"
|
||||
},
|
||||
"description": "Redirect to the original link. Ex: Redirects to the original twitter link while in the nitter website"
|
||||
},
|
||||
"redirect": {
|
||||
"suggested_key": {
|
||||
"default": "Alt+Shift+R"
|
||||
},
|
||||
"description": "Redirect link. Ex: Redirects original twitter link to nitter"
|
||||
}
|
||||
},
|
||||
"default_locale": "en",
|
||||
"update_url": "https://raw.githubusercontent.com/libredirect/libredirect/master/src/updates/updates.xml",
|
||||
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAroWDSoSRZ1scj+eJRrvnhJbrqXTKnhQuxs6+AJg16sqr0bsMdFV+MSY4i4xnK+K5WOYkBliWXgUyk/wzicoAjOnSJddrL/Md4FuWHI2NVIkrlsLOrYkygi5OLqGPajRH/w8Cdmg7KzEpXe/OnYV0/qS8li8huEdTzdeLdhfbiVl1j3DOr4OJALQ7mPeeNFHFo/oVQ+OkSezWLezA5jUGfhtzPYV6u1TXzX7lCi8E/BbDbwkvvXOMcjXCv08kjdLOY2djCA2a6zr0xAb3q8DlexAMZ8vMof7AQRFtBKhLc9n9VFoipMMdBOVQQj/eIcRILBrmkcZNnJxFKiHNJ+NcZQIDAQAB"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ browser.webRequest.onBeforeRequest.addListener(
|
|||
let initiator
|
||||
try {
|
||||
if (details.originUrl) initiator = new URL(details.originUrl)
|
||||
else if (details.initiator) initiator = new URL(details.initiator)
|
||||
else if (details.initiator && details.initiator !== "null") initiator = new URL(details.initiator)
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ browser.webRequest.onBeforeRequest.addListener(
|
|||
}
|
||||
|
||||
if (!newUrl) {
|
||||
const match = url.href.match(/^https?:\/{2}.*\.libredirect\.invalid.*/)
|
||||
const match = url.href.match(/^https?:\/{2}.*\.libreredirect\.invalid.*/)
|
||||
if (match) {
|
||||
browser.tabs.update({
|
||||
url: browser.runtime.getURL(`/pages/messages/no_instance.html`)
|
||||
|
@ -97,6 +97,32 @@ browser.commands.onCommand.addListener(async command => {
|
|||
else if (command == "copyRaw") {
|
||||
servicesHelper.copyRaw(url)
|
||||
}
|
||||
else if (command == "redirect") {
|
||||
browser.tabs.query({ active: true, currentWindow: true }, async tabs => {
|
||||
if (tabs[0].url) {
|
||||
const url = new URL(tabs[0].url)
|
||||
const newUrl = servicesHelper.redirect(url, "main_frame", null, true)
|
||||
if (newUrl) {
|
||||
browser.tabs.update(tabs[0].id, { url: newUrl }, () => {
|
||||
tabIdRedirects[tabs[0].id] = true
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
else if (command == "reverse") {
|
||||
browser.tabs.query({ active: true, currentWindow: true }, async tabs => {
|
||||
if (tabs[0].url) {
|
||||
const url = new URL(tabs[0].url)
|
||||
const newUrl = await servicesHelper.reverse(url)
|
||||
if (newUrl) {
|
||||
browser.tabs.update(tabs[0].id, { url: newUrl }, () => {
|
||||
tabIdRedirects[tabs[0].id] = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -276,4 +302,4 @@ browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
|||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -238,9 +238,7 @@ function createList(frontend, networks, document, redirects, blacklist) {
|
|||
const content = sortedInstances
|
||||
.map(x => {
|
||||
const cloudflare = blacklist.cloudflare.includes(x) ?
|
||||
`<a target="_blank" href="https://libredirect.github.io/docs.html#instances">
|
||||
<span style="color:red;">cloudflare</span>
|
||||
</a>` : ""
|
||||
`<span style="color:red;">cloudflare</span>` : ""
|
||||
|
||||
const warnings = [cloudflare].join(" ")
|
||||
return `<div class="frontend">
|
||||
|
@ -316,4 +314,4 @@ async function ping(frontend) {
|
|||
}
|
||||
span.innerHTML = `<span style="color:${color};">${text}</span>`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ async function exportSettings() {
|
|||
options.version = browser.runtime.getManifest().version
|
||||
let resultString = JSON.stringify(options, null, " ")
|
||||
exportSettingsElement.href = "data:application/json;base64," + btoa(resultString)
|
||||
exportSettingsElement.download = `libredirect-settings-v${options.version}.json`
|
||||
exportSettingsElement.download = `libreredirect-settings-v${options.version}.json`
|
||||
return
|
||||
}
|
||||
exportSettings()
|
||||
|
|
|
@ -13,8 +13,7 @@ section(class="option-block" id="general_page")
|
|||
div(class="some-block option-block")
|
||||
h4 Fetch public instances
|
||||
select(id="fetch-instances")
|
||||
option(value="github") GitHub
|
||||
option(value="codeberg") Codeberg
|
||||
option(value="gitler") Gitler
|
||||
option(value="disable") Disable
|
||||
|
||||
div(class="some-block option-block")
|
||||
|
@ -61,4 +60,4 @@ section(class="option-block" id="general_page")
|
|||
path(d="M6,13c0-1.65,0.67-3.15,1.76-4.24L6.34,7.34C4.9,8.79,4,10.79,4,13c0,4.08,3.05,7.44,7,7.93v-2.02 C8.17,18.43,6,15.97,6,13z")
|
||||
x(data-localise="__MSG_resetSettings__") Reset Settings
|
||||
|
||||
script(type="module" src="./widgets/general.js")
|
||||
script(type="module" src="./widgets/general.js")
|
||||
|
|
|
@ -35,14 +35,14 @@ each val, service in services
|
|||
select(id=service+"-redirectType")
|
||||
|
||||
div(class="some-block option-block")
|
||||
h4 Unsupported paths handling
|
||||
h4 Unsupported iframes handling
|
||||
select(id=service+"-unsupportedUrls")
|
||||
option(value="bypass") bypass
|
||||
option(value="block") block
|
||||
|
||||
if (service == 'search')
|
||||
div(class="some-block option-block")
|
||||
h4 Set LibRedirect as Default Search Engine
|
||||
h4 Set Libre Redirect as Default Search Engine
|
||||
|
||||
|
||||
each val, frontend in services[service].frontends
|
||||
|
@ -72,4 +72,4 @@ each val, service in services
|
|||
div(class=network)
|
||||
div(class="checklist")
|
||||
if (network == 'clearnet')
|
||||
div(class="some-block option-block loading") Loading...
|
||||
div(class="some-block option-block loading") Loading...
|
||||
|
|
|
@ -128,7 +128,7 @@ section.links {
|
|||
flex-wrap: wrap;
|
||||
flex-direction: column;
|
||||
width: 300px;
|
||||
max-height: 750px;
|
||||
max-height: 800px;
|
||||
}
|
||||
|
||||
section.links div {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
head
|
||||
meta(charset="utf-8")
|
||||
meta(name="viewport" content="width=device-width, initial-scale=1")
|
||||
link(rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg")
|
||||
link(rel="icon" type="image/x-icon" href="../../../assets/images/libreredirect.svg")
|
||||
link(href="../stylesheets/styles.css" rel="stylesheet")
|
||||
title Settings
|
||||
script(type="module" src="./init.js")
|
||||
script(type="module" src="./init.js")
|
||||
|
|
|
@ -15,7 +15,7 @@ section(class="links" id="links")
|
|||
span=services[key].name
|
||||
|
||||
div(class="title")
|
||||
a(target="_blank" href="https://libredirect.github.io")
|
||||
a(target="_blank" href="https://gitler.moe/suwako/libreredirect")
|
||||
img(class='dark' src="/assets/images/about-icon.svg")
|
||||
img(class='light' src="/assets/images/about-icon-light.svg")
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
||||
<app appid='oladmjdebphlnjjcnomfhhbfdldiimaf'>
|
||||
<updatecheck codebase='https://github.com/libredirect/libredirect/releases/download/v2.6.1/libredirect-2.6.1.crx' version='2.6.1' />
|
||||
<updatecheck codebase='https://gitler.moe/suwako/libreredirect/releases/download/v2.6.2/libreredirect-2.6.2.crx' version='2.6.2' />
|
||||
</app>
|
||||
</gupdate>
|
||||
|
|