Compare commits
37 Commits
7e7f8bc892
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa25288f10 | ||
|
|
0426e2281a | ||
|
|
a56a8a7cec | ||
|
|
556d2d0b55 | ||
| 1c62e14eac | |||
| 2d6f757f77 | |||
| 9b499a2109 | |||
| 0903994c30 | |||
| 7b57162191 | |||
| 7caaec956f | |||
| 888687f2f5 | |||
| 567dabf661 | |||
| 3ae471de0f | |||
| 1e616dd256 | |||
| b16cd8b494 | |||
| 60b674e816 | |||
| 884e0aa2a1 | |||
| c7195d5f2c | |||
| 7c8dc85fd5 | |||
| 2f81cf532c | |||
| 2f7efcb401 | |||
| 3239443a6c | |||
| 6082836470 | |||
| 61f4b5db57 | |||
| 74aeff0f7c | |||
| 756ca5f66d | |||
| 6c65d3c586 | |||
| 1105ac2860 | |||
| 19cb660126 | |||
| 86b2918a6c | |||
| 6b0614e44d | |||
| c5627e318c | |||
| bfbc2cdbde | |||
| ffb2dd7062 | |||
| 66276486a0 | |||
| 29b70f62e0 | |||
| cf4043ee2a |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
error.log
|
||||||
@@ -1 +1,3 @@
|
|||||||
dist/*
|
dist/*
|
||||||
|
pnpm-lock.yaml
|
||||||
|
readme.md
|
||||||
13
dist/fuck-twitter.user.js
vendored
Normal file
13
dist/fuck-twitter.user.js
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
// ==UserScript==
|
||||||
|
// @name fuck twitter
|
||||||
|
// @namespace zomo.dev
|
||||||
|
// @match https://x.com/*
|
||||||
|
// @match https://twitter.com/*
|
||||||
|
// @version 1.1
|
||||||
|
// @description redir x.com and twitter.com -> xcancel.com
|
||||||
|
// @runat document-start
|
||||||
|
// @downloadURL https://git.zomo.dev/zomo/browser-scripts/raw/branch/main/dist/fuck-twitter.user.js
|
||||||
|
// @supportURL https://git.zomo.dev/zomo/browser-scripts/issues
|
||||||
|
// @homepageURL https://git.zomo.dev/zomo/browser-scripts
|
||||||
|
// ==/UserScript==
|
||||||
|
location.host = 'xcancel.com'
|
||||||
21
dist/hungergames-brantsteele-webp.user.js
vendored
Normal file
21
dist/hungergames-brantsteele-webp.user.js
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
// ==UserScript==
|
||||||
|
// @name Hunger Games BrantSteele WebP Support
|
||||||
|
// @namespace zomo.dev
|
||||||
|
// @match https://brantsteele.net/hungergames/edit.php
|
||||||
|
// @version 1.0
|
||||||
|
// @description fix the form validator to allow webp images
|
||||||
|
// @runat document-end
|
||||||
|
// @downloadURL https://git.zomo.dev/zomo/browser-scripts/raw/branch/main/dist/hungergames-brantsteele-webp.user.js
|
||||||
|
// @supportURL https://git.zomo.dev/zomo/browser-scripts/issues
|
||||||
|
// @homepageURL https://git.zomo.dev/zomo/browser-scripts
|
||||||
|
// ==/UserScript==
|
||||||
|
validateForm = Function(
|
||||||
|
validateForm
|
||||||
|
.toString()
|
||||||
|
.replace(/^function validateForm\(\)(.|\n)*?\{/, '')
|
||||||
|
.replace(/\}$/, '')
|
||||||
|
.replaceAll(
|
||||||
|
'var regexp = /(https?:\\/\\/.*\\.(?:png|jpg|gif|bmp|jpeg))$/i',
|
||||||
|
'var regexp = /(https?:\\/\\/.*\\.(?:png|jpg|gif|bmp|jpeg|webp))$/i'
|
||||||
|
)
|
||||||
|
)
|
||||||
72
dist/optifine-download-links.user.js
vendored
72
dist/optifine-download-links.user.js
vendored
@@ -4,60 +4,60 @@
|
|||||||
// @match https://optifine.net/*
|
// @match https://optifine.net/*
|
||||||
// @version 1.0
|
// @version 1.0
|
||||||
// @description automatically grab optifine links through the ads
|
// @description automatically grab optifine links through the ads
|
||||||
// @downloadURL https://git.zomo.dev/zomo/browser-scripts/raw/branch/main/dist/optifine-download-links.zomo.js
|
// @downloadURL https://git.zomo.dev/zomo/browser-scripts/raw/branch/main/dist/optifine-download-links.user.js
|
||||||
// @supportURL https://git.zomo.dev/zomo/browser-scripts/
|
// @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==
|
||||||
// scripts/optifine-download-links/main.ts
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|||||||
22
dist/twitch-clickable-video.user.js
vendored
Normal file
22
dist/twitch-clickable-video.user.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
// ==UserScript==
|
||||||
|
// @name Twitch Clickable Video
|
||||||
|
// @namespace zomo.dev
|
||||||
|
// @match https://www.twitch.tv/*
|
||||||
|
// @version 1.1
|
||||||
|
// @description hold Control key to be able to right click the video element
|
||||||
|
// @downloadURL https://git.zomo.dev/zomo/browser-scripts/raw/branch/main/dist/twitch-clickable-video.user.js
|
||||||
|
// @supportURL https://git.zomo.dev/zomo/browser-scripts/issues
|
||||||
|
// @homepageURL https://git.zomo.dev/zomo/browser-scripts
|
||||||
|
// ==/UserScript==
|
||||||
|
var Elems = `
|
||||||
|
.video-player__overlay,
|
||||||
|
.click-handler
|
||||||
|
`
|
||||||
|
var getElems = () => Array.from(document.querySelectorAll(Elems))
|
||||||
|
var elemsSet = () =>
|
||||||
|
getElems().forEach(elem => (elem.style.pointerEvents = 'none'))
|
||||||
|
var elemsClear = () =>
|
||||||
|
getElems().forEach(elem => (elem.style.pointerEvents = ''))
|
||||||
|
addEventListener('keydown', e => e.key === 'Control' && elemsSet())
|
||||||
|
addEventListener('keyup', e => e.key === 'Control' && elemsClear())
|
||||||
|
addEventListener('click', e => (e.ctrlKey ? elemsSet() : elemsClear()))
|
||||||
128
esbuild.mjs
128
esbuild.mjs
@@ -1,128 +0,0 @@
|
|||||||
import { build } from 'esbuild'
|
|
||||||
import {
|
|
||||||
lstatSync,
|
|
||||||
readdirSync,
|
|
||||||
readFileSync,
|
|
||||||
unlinkSync,
|
|
||||||
writeFileSync,
|
|
||||||
} from 'fs'
|
|
||||||
|
|
||||||
const BaseUrl = `https://git.zomo.dev/zomo/browser-scripts/`
|
|
||||||
const FileUrl = name =>
|
|
||||||
`https://git.zomo.dev/zomo/browser-scripts/raw/branch/main/dist/${name}.zomo.js`
|
|
||||||
|
|
||||||
function ValueNotEmpty(val) {
|
|
||||||
return (
|
|
||||||
val !== '' &&
|
|
||||||
val !== false &&
|
|
||||||
val !== [] &&
|
|
||||||
val !== undefined &&
|
|
||||||
val !== null
|
|
||||||
)
|
|
||||||
}
|
|
||||||
function padr(str, len) {
|
|
||||||
return str + ' '.repeat(len - str.length)
|
|
||||||
}
|
|
||||||
|
|
||||||
function MetadataArgs(name) {
|
|
||||||
var meta = {
|
|
||||||
name: name,
|
|
||||||
namespace: 'zomo.dev',
|
|
||||||
match: '',
|
|
||||||
excludematch: '',
|
|
||||||
version: '0.0.0',
|
|
||||||
description: '',
|
|
||||||
icon: '',
|
|
||||||
require: '',
|
|
||||||
resource: '',
|
|
||||||
runat: '',
|
|
||||||
noframes: false,
|
|
||||||
grant: '',
|
|
||||||
injectinto: '',
|
|
||||||
downloadURL: FileUrl(name),
|
|
||||||
supportURL: BaseUrl,
|
|
||||||
homepageURL: BaseUrl,
|
|
||||||
unwrap: false,
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
let args = JSON.parse(
|
|
||||||
readFileSync(`scripts/${name}/meta.json`).toString()
|
|
||||||
)
|
|
||||||
for (let key in meta) {
|
|
||||||
if (ValueNotEmpty(args[key])) {
|
|
||||||
meta[key] = args[key]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e)
|
|
||||||
console.log(
|
|
||||||
`scripts/${name}/meta.json not found, using default metadata`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const keyConversion = {
|
|
||||||
injectinto: 'inject-into',
|
|
||||||
excludematch: 'exclude-match',
|
|
||||||
}
|
|
||||||
|
|
||||||
return `// ==UserScript==
|
|
||||||
${Object.keys(meta)
|
|
||||||
.filter(key => ValueNotEmpty(meta[key]))
|
|
||||||
.map(key => {
|
|
||||||
let val = meta[key],
|
|
||||||
key_str = padr(key in keyConversion ? keyConversion[key] : key, 12)
|
|
||||||
if (typeof val === 'boolean') {
|
|
||||||
if (val) return `// @${key_str}`
|
|
||||||
} else if (typeof val === 'string') {
|
|
||||||
return `// @${key_str} ${val}`
|
|
||||||
} else if (Array.isArray(val)) {
|
|
||||||
return val.map(v => `// @${key_str} ${v}`).join('\n')
|
|
||||||
}
|
|
||||||
return ''
|
|
||||||
})
|
|
||||||
.filter(l => l.length)
|
|
||||||
.join('\n')}
|
|
||||||
// ==/UserScript==
|
|
||||||
`
|
|
||||||
}
|
|
||||||
|
|
||||||
async function compileProject(name) {
|
|
||||||
await build({
|
|
||||||
entryPoints: [`scripts/${name}/main.ts`],
|
|
||||||
outfile: `dist/${name}.user.js`,
|
|
||||||
|
|
||||||
target: 'esnext',
|
|
||||||
platform: 'node',
|
|
||||||
format: 'cjs',
|
|
||||||
|
|
||||||
watch: false,
|
|
||||||
bundle: true,
|
|
||||||
minify: false,
|
|
||||||
sourcemap: false,
|
|
||||||
|
|
||||||
define: {
|
|
||||||
UserScriptProjectName: `'${name}'`,
|
|
||||||
UserScriptFileUrl: `'${FileUrl(name)}'`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
//add UserScript header
|
|
||||||
let meta = MetadataArgs(name)
|
|
||||||
let content = readFileSync(`dist/${name}.user.js`).toString()
|
|
||||||
|
|
||||||
writeFileSync(`dist/${name}.user.js`, meta + content)
|
|
||||||
}
|
|
||||||
|
|
||||||
//delete compiled scripts
|
|
||||||
readdirSync('dist').forEach(file => unlinkSync(`dist/${file}`))
|
|
||||||
|
|
||||||
//compile scripts
|
|
||||||
readdirSync('scripts').forEach(name => {
|
|
||||||
if (
|
|
||||||
lstatSync(`scripts/${name}`).isDirectory() &&
|
|
||||||
lstatSync(`scripts/${name}/main.ts`).isFile()
|
|
||||||
) {
|
|
||||||
compileProject(name)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
16
package.json
16
package.json
@@ -5,7 +5,8 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prettier": "prettier --write .",
|
"prettier": "prettier --write .",
|
||||||
"build": "npm run prettier && node esbuild.mjs"
|
"build": "npm run prettier && bsbuild -pr -u https://git.zomo.dev/zomo/browser-scripts -b main",
|
||||||
|
"watch": "bsbuild -pr -w -u https://git.zomo.dev/zomo/browser-scripts -b main"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -13,11 +14,12 @@
|
|||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"devDependencies": {
|
||||||
"@types/greasemonkey": "^4.0.3",
|
"@types/greasemonkey": "^4.0.7",
|
||||||
"esbuild": "^0.14.42",
|
"@types/node": "^25.0.0",
|
||||||
"eslint": "^8.17.0",
|
"browser-scripts-builder": "git+ssh://git@git.zomo.dev:zomo/browser-scripts-builder.git",
|
||||||
"prettier": "^2.6.2",
|
"eslint": "^9.39.1",
|
||||||
"typescript": "^4.7.3"
|
"prettier": "^3.7.4",
|
||||||
|
"typescript": "^5.9.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1847
pnpm-lock.yaml
generated
1847
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
23
readme.md
23
readme.md
@@ -1 +1,24 @@
|
|||||||
# browser-scripts
|
# browser-scripts
|
||||||
|
|
||||||
|
Requires Violentmonkey (or Tampermonkey etc): [Chrome](https://chrome.google.com/webstore/detail/violentmonkey/jinjaccalgkegednnccohejagnlnfdag) / [Firefox](https://addons.mozilla.org/en-US/firefox/addon/violentmonkey/)
|
||||||
|
|
||||||
|
<!-- START INSTALL LINKS -->
|
||||||
|
## Installs
|
||||||
|
|
||||||
|
- [fuck twitter](https://git.zomo.dev/zomo/browser-scripts/raw/branch/main/dist/fuck-twitter.user.js)
|
||||||
|
- **zomo.dev** v1.1
|
||||||
|
- `https://x.com/*`,`https://twitter.com/*`
|
||||||
|
- redir x.com and twitter.com -> xcancel.com
|
||||||
|
- [Hunger Games BrantSteele WebP Support](https://git.zomo.dev/zomo/browser-scripts/raw/branch/main/dist/hungergames-brantsteele-webp.user.js)
|
||||||
|
- **zomo.dev** v1.0
|
||||||
|
- `https://brantsteele.net/hungergames/edit.php`
|
||||||
|
- fix the form validator to allow webp images
|
||||||
|
- [OptiFine Download Links](https://git.zomo.dev/zomo/browser-scripts/raw/branch/main/dist/optifine-download-links.user.js)
|
||||||
|
- **zomo.dev** v1.0
|
||||||
|
- `https://optifine.net/*`
|
||||||
|
- automatically grab optifine links through the ads
|
||||||
|
- [Twitch Clickable Video](https://git.zomo.dev/zomo/browser-scripts/raw/branch/main/dist/twitch-clickable-video.user.js)
|
||||||
|
- **zomo.dev** v1.1
|
||||||
|
- `https://www.twitch.tv/*`
|
||||||
|
- hold Control key to be able to right click the video element
|
||||||
|
<!-- END INSTALL LINKS -->
|
||||||
|
|||||||
1
scripts/fuck-twitter/main.ts
Normal file
1
scripts/fuck-twitter/main.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
location.host = 'xcancel.com'
|
||||||
9
scripts/fuck-twitter/meta.json
Normal file
9
scripts/fuck-twitter/meta.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://git.zomo.dev/zomo/browser-scripts-builder/raw/branch/main/meta.schema.json",
|
||||||
|
"name": "fuck twitter",
|
||||||
|
"description": "redir x.com and twitter.com -> xcancel.com",
|
||||||
|
"namespace": "zomo.dev",
|
||||||
|
"match": ["https://x.com/*", "https://twitter.com/*"],
|
||||||
|
"version": "1.1",
|
||||||
|
"runat": "document-start"
|
||||||
|
}
|
||||||
17
scripts/fuck-twitter/tsconfig.json
Normal file
17
scripts/fuck-twitter/tsconfig.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es2021",
|
||||||
|
"module": "commonjs",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"types": [
|
||||||
|
"../../node_modules/@types/greasemonkey",
|
||||||
|
"../../node_modules/browser-scripts-builder"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
12
scripts/hungergames-brantsteele-webp/main.ts
Normal file
12
scripts/hungergames-brantsteele-webp/main.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
declare var validateForm: Function
|
||||||
|
|
||||||
|
validateForm = Function(
|
||||||
|
validateForm
|
||||||
|
.toString()
|
||||||
|
.replace(/^function validateForm\(\)(.|\n)*?\{/, '')
|
||||||
|
.replace(/\}$/, '')
|
||||||
|
.replaceAll(
|
||||||
|
'var regexp = /(https?:\\/\\/.*\\.(?:png|jpg|gif|bmp|jpeg))$/i',
|
||||||
|
'var regexp = /(https?:\\/\\/.*\\.(?:png|jpg|gif|bmp|jpeg|webp))$/i'
|
||||||
|
)
|
||||||
|
)
|
||||||
9
scripts/hungergames-brantsteele-webp/meta.json
Normal file
9
scripts/hungergames-brantsteele-webp/meta.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://git.zomo.dev/zomo/browser-scripts-builder/raw/branch/main/meta.schema.json",
|
||||||
|
"name": "Hunger Games BrantSteele WebP Support",
|
||||||
|
"namespace": "zomo.dev",
|
||||||
|
"match": "https://brantsteele.net/hungergames/edit.php",
|
||||||
|
"version": "1.0",
|
||||||
|
"description": "fix the form validator to allow webp images",
|
||||||
|
"runat": "document-end"
|
||||||
|
}
|
||||||
17
scripts/hungergames-brantsteele-webp/tsconfig.json
Normal file
17
scripts/hungergames-brantsteele-webp/tsconfig.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es2021",
|
||||||
|
"module": "commonjs",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"types": [
|
||||||
|
"../../node_modules/@types/greasemonkey",
|
||||||
|
"../../node_modules/browser-scripts-builder"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
2
scripts/index.d.ts
vendored
2
scripts/index.d.ts
vendored
@@ -1,2 +0,0 @@
|
|||||||
declare const UserScriptProjectName: string
|
|
||||||
declare const UserScriptFileUrl: string
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"title": "UserScriptMeta",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"name": {
|
|
||||||
"description": "Script Name",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"namespace": {
|
|
||||||
"description": "Author namespace",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"match": {
|
|
||||||
"description": "",
|
|
||||||
"type": ["string", "array"],
|
|
||||||
"minItems": 1,
|
|
||||||
"uniqueItems": true
|
|
||||||
},
|
|
||||||
"excludematch": {
|
|
||||||
"description": "",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"version": {
|
|
||||||
"description": "",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"icon": {
|
|
||||||
"description": "",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"description": "",
|
|
||||||
"type": ["string", "array"],
|
|
||||||
"minItems": 1,
|
|
||||||
"uniqueItems": true
|
|
||||||
},
|
|
||||||
"resource": {
|
|
||||||
"description": "",
|
|
||||||
"type": ["string", "array"],
|
|
||||||
"minItems": 1,
|
|
||||||
"uniqueItems": true
|
|
||||||
},
|
|
||||||
"runat": {
|
|
||||||
"description": "",
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["document-start", "document-end", "document-idle"]
|
|
||||||
},
|
|
||||||
"noframes": {
|
|
||||||
"description": "",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"grant": {
|
|
||||||
"description": "",
|
|
||||||
"type": ["string", "array"],
|
|
||||||
"minItems": 1,
|
|
||||||
"uniqueItems": true
|
|
||||||
},
|
|
||||||
"injectinto": {
|
|
||||||
"description": "",
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["page", "content", "auto"]
|
|
||||||
},
|
|
||||||
"downloadURL": {
|
|
||||||
"description": "",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"supportURL": {
|
|
||||||
"description": "",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"homepageURL": {
|
|
||||||
"description": "",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"unwrap": {
|
|
||||||
"description": "",
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["name", "namespace", "version"]
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../meta.schema.json",
|
"$schema": "https://git.zomo.dev/zomo/browser-scripts-builder/raw/branch/main/meta.schema.json",
|
||||||
"name": "OptiFine Download Links",
|
"name": "OptiFine Download Links",
|
||||||
"namespace": "zomo.dev",
|
"namespace": "zomo.dev",
|
||||||
"match": "https://optifine.net/*",
|
"match": "https://optifine.net/*",
|
||||||
|
|||||||
@@ -8,6 +8,10 @@
|
|||||||
"strict": true,
|
"strict": true,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true
|
"noUnusedParameters": true,
|
||||||
|
"types": [
|
||||||
|
"../../node_modules/@types/greasemonkey",
|
||||||
|
"../../node_modules/browser-scripts-builder"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
15
scripts/twitch-clickable-video/main.ts
Normal file
15
scripts/twitch-clickable-video/main.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
const Elems = `
|
||||||
|
.video-player__overlay,
|
||||||
|
.click-handler
|
||||||
|
`
|
||||||
|
|
||||||
|
const getElems = () => Array.from(document.querySelectorAll<HTMLElement>(Elems))
|
||||||
|
|
||||||
|
const elemsSet = () =>
|
||||||
|
getElems().forEach(elem => (elem.style.pointerEvents = 'none'))
|
||||||
|
const elemsClear = () =>
|
||||||
|
getElems().forEach(elem => (elem.style.pointerEvents = ''))
|
||||||
|
|
||||||
|
addEventListener('keydown', e => e.key === 'Control' && elemsSet())
|
||||||
|
addEventListener('keyup', e => e.key === 'Control' && elemsClear())
|
||||||
|
addEventListener('click', e => (e.ctrlKey ? elemsSet() : elemsClear()))
|
||||||
8
scripts/twitch-clickable-video/meta.json
Normal file
8
scripts/twitch-clickable-video/meta.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://git.zomo.dev/zomo/browser-scripts-builder/raw/branch/main/meta.schema.json",
|
||||||
|
"name": "Twitch Clickable Video",
|
||||||
|
"namespace": "zomo.dev",
|
||||||
|
"match": "https://www.twitch.tv/*",
|
||||||
|
"version": "1.1",
|
||||||
|
"description": "hold Control key to be able to right click the video element"
|
||||||
|
}
|
||||||
17
scripts/twitch-clickable-video/tsconfig.json
Normal file
17
scripts/twitch-clickable-video/tsconfig.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es2020",
|
||||||
|
"module": "commonjs",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"types": [
|
||||||
|
"../../node_modules/@types/greasemonkey",
|
||||||
|
"../../node_modules/browser-scripts-builder"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user