Compare commits
No commits in common. "development" and "251ab898f7b1e1dcbe8bab4223d8f3b3dafdd517" have entirely different histories.
developmen
...
251ab898f7
|
@ -1 +1 @@
|
||||||
/web-ext-artifacts
|
*.xpi
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
# This file was created by https://github.com/mozilla/web-ext
|
|
||||||
# Your auto-generated extension ID for addons.mozilla.org is:
|
|
||||||
tubeproxy@netflux.io
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
read -p "Enter Mozilla API secret: " secret
|
|
||||||
web-ext sign --ignore-files bin/ --api-key=user:16805942:907 --api-secret="$secret"
|
|
|
@ -1,4 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
web-ext run --verbose
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
zip out.zip hook.js manifest.json
|
||||||
|
mv out.zip out.xpi
|
42
hook.js
42
hook.js
|
@ -1,34 +1,24 @@
|
||||||
// Based on: https://github.com/metiis/invidious-redirect/blob/master/makehook.js
|
// Based on: https://github.com/metiis/invidious-redirect/blob/master/makehook.js
|
||||||
|
|
||||||
function checkRedirect() {
|
const dest = "tube.netflux.io";
|
||||||
const dest = "tube.netflux.io";
|
let href = window.location.href;
|
||||||
let href = window.location.href;
|
|
||||||
|
|
||||||
// do not redirect Youtube consent page
|
if (href.includes("m.youtube.com")) {
|
||||||
if (href.includes("consent.youtube.com")) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (href.includes("m.youtube.com")) {
|
|
||||||
href = href.replace("m.youtube.com", dest);
|
href = href.replace("m.youtube.com", dest);
|
||||||
} else if (href.includes("www.youtube.com")) {
|
} else if (href.includes("www.youtube.com")) {
|
||||||
href = href.replace("www.youtube.com", dest);
|
href = href.replace("www.youtube.com", dest);
|
||||||
} else if (href.includes("youtu.be")) {
|
} else if (href.includes("youtu.be")) {
|
||||||
href = href.replace("youtu.be/", dest + "/watch?v=");
|
href = href.replace("youtu.be/", dest + "/watch?v=");
|
||||||
}
|
|
||||||
|
|
||||||
if (href.includes("/results?q")) {
|
|
||||||
href = href.replace("/results?q", "/search?q");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (href.includes("/results?search_query")) {
|
|
||||||
href = href.replace("/results?search_query", "/search?q");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(confirm("Redirect to " + href + "?")) {
|
|
||||||
window.location.href = href;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checkRedirect()
|
if (href.includes("/results?q")) {
|
||||||
|
href = href.replace("/results?q", "/search?q");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (href.includes("/results?search_query")) {
|
||||||
|
href = href.replace("/results?search_query", "/search?q");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(confirm("Redirect to " + href + "?")) {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"author": "Rob Watson",
|
"author": "Rob Watson",
|
||||||
"homepage_url": "https://git.netflux.io/rob/tubeproxy",
|
"homepage_url": "https://git.netflux.io/rob/tubeproxy",
|
||||||
"version": "0.1.1",
|
"version": "0.1",
|
||||||
"name": "tubeproxy",
|
"name": "tubeproxy",
|
||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue