updated browser-scripts-builder
This commit is contained in:
65
dist/optifine-download-links.user.js
vendored
65
dist/optifine-download-links.user.js
vendored
@@ -8,55 +8,56 @@
|
|||||||
// @supportURL https://git.zomo.dev/zomo/browser-scripts/issues
|
// @supportURL https://git.zomo.dev/zomo/browser-scripts/issues
|
||||||
// @homepageURL https://git.zomo.dev/zomo/browser-scripts
|
// @homepageURL https://git.zomo.dev/zomo/browser-scripts
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
var onhover = false;
|
var onhover = false
|
||||||
async function getDownload(href) {
|
async function getDownload(href) {
|
||||||
let resp = await fetch(href);
|
let resp = await fetch(href)
|
||||||
let text = await resp.text();
|
let text = await resp.text()
|
||||||
let match = text.match(/<a href=['"](downloadx.*?)['"]/i);
|
let match = text.match(/<a href=['"](downloadx.*?)['"]/i)
|
||||||
if (match) {
|
if (match) {
|
||||||
return match[1];
|
return match[1]
|
||||||
}
|
}
|
||||||
return null;
|
return null
|
||||||
}
|
}
|
||||||
function attachFetchDownloadLink(a, depth = 0) {
|
function attachFetchDownloadLink(a, depth = 0) {
|
||||||
function run() {
|
function run() {
|
||||||
a.innerText = "Loading";
|
a.innerText = 'Loading'
|
||||||
let url = new URL(a.href);
|
let url = new URL(a.href)
|
||||||
if (url.pathname === "/adloadx") {
|
if (url.pathname === '/adloadx') {
|
||||||
getDownload(a.href).then((downloadUrl) => {
|
getDownload(a.href).then(downloadUrl => {
|
||||||
if (downloadUrl) {
|
if (downloadUrl) {
|
||||||
a.href = downloadUrl;
|
a.href = downloadUrl
|
||||||
a.innerText = "Download";
|
a.innerText = 'Download'
|
||||||
} else {
|
} else {
|
||||||
a.innerText = "Failed";
|
a.innerText = 'Failed'
|
||||||
if (onhover)
|
if (onhover) attachFetchDownloadLink(a, ++depth)
|
||||||
attachFetchDownloadLink(a, ++depth);
|
|
||||||
else
|
else
|
||||||
setTimeout(() => attachFetchDownloadLink(a, ++depth), 1e3);
|
setTimeout(
|
||||||
|
() => attachFetchDownloadLink(a, ++depth),
|
||||||
|
1e3
|
||||||
|
)
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (depth > 5)
|
if (depth > 5) return
|
||||||
return;
|
|
||||||
if (onhover) {
|
if (onhover) {
|
||||||
a.addEventListener("mouseover", run, { once: true });
|
a.addEventListener('mouseover', run, { once: true })
|
||||||
} else {
|
} else {
|
||||||
run();
|
run()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addEventListener("load", () => {
|
addEventListener('load', () => {
|
||||||
document.querySelectorAll("a").forEach((a) => {
|
document.querySelectorAll('a').forEach(a => {
|
||||||
let href = new URL(a.href);
|
let href = new URL(a.href)
|
||||||
if (href.hostname === "adfoc.us") {
|
if (href.hostname === 'adfoc.us') {
|
||||||
let params = href.searchParams;
|
let params = href.searchParams
|
||||||
if (params.has("url")) {
|
if (params.has('url')) {
|
||||||
let url = params.get("url")?.replace("http://", "https://");
|
let url = params.get('url')?.replace('http://', 'https://')
|
||||||
if (url) {
|
if (url) {
|
||||||
a.href = url;
|
a.href = url
|
||||||
attachFetchDownloadLink(a);
|
attachFetchDownloadLink(a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|||||||
20
dist/twitch-click-mute.user.js
vendored
20
dist/twitch-click-mute.user.js
vendored
@@ -8,14 +8,18 @@
|
|||||||
// @supportURL https://git.zomo.dev/zomo/browser-scripts/issues
|
// @supportURL https://git.zomo.dev/zomo/browser-scripts/issues
|
||||||
// @homepageURL https://git.zomo.dev/zomo/browser-scripts
|
// @homepageURL https://git.zomo.dev/zomo/browser-scripts
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
addEventListener("load", () => {
|
addEventListener('load', () => {
|
||||||
document.body.addEventListener("click", (e) => {
|
document.body.addEventListener('click', e => {
|
||||||
let target = e.target;
|
let target = e.target
|
||||||
if (target && target.getAttribute("data-a-target") === "player-overlay-click-handler") {
|
if (
|
||||||
let video = document.querySelector("video");
|
target &&
|
||||||
|
target.getAttribute('data-a-target') ===
|
||||||
|
'player-overlay-click-handler'
|
||||||
|
) {
|
||||||
|
let video = document.querySelector('video')
|
||||||
if (video) {
|
if (video) {
|
||||||
video.muted = !video.muted;
|
video.muted = !video.muted
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|||||||
6
pnpm-lock.yaml
generated
6
pnpm-lock.yaml
generated
@@ -9,7 +9,7 @@ specifiers:
|
|||||||
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@types/greasemonkey': 4.0.3
|
'@types/greasemonkey': 4.0.3
|
||||||
browser-scripts-builder: git.zomo.dev/zomo/browser-scripts-builder/57f75997398f9685504bbb1eb5f24ab99394ac3b
|
browser-scripts-builder: git.zomo.dev/zomo/browser-scripts-builder/e8de01b48a8c3f4314ad8e08d19b7535d4c41f2a
|
||||||
eslint: 8.17.0
|
eslint: 8.17.0
|
||||||
prettier: 2.6.2
|
prettier: 2.6.2
|
||||||
typescript: 4.7.3
|
typescript: 4.7.3
|
||||||
@@ -818,8 +818,8 @@ packages:
|
|||||||
resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=}
|
resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
git.zomo.dev/zomo/browser-scripts-builder/57f75997398f9685504bbb1eb5f24ab99394ac3b:
|
git.zomo.dev/zomo/browser-scripts-builder/e8de01b48a8c3f4314ad8e08d19b7535d4c41f2a:
|
||||||
resolution: {commit: 57f75997398f9685504bbb1eb5f24ab99394ac3b, repo: ssh://git@git.zomo.dev/zomo/browser-scripts-builder.git, type: git}
|
resolution: {commit: e8de01b48a8c3f4314ad8e08d19b7535d4c41f2a, repo: ssh://git@git.zomo.dev/zomo/browser-scripts-builder.git, type: git}
|
||||||
name: browser-scripts-builder
|
name: browser-scripts-builder
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|||||||
Reference in New Issue
Block a user