Compare commits
35 Commits
5f7efc5bc5
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 | |||
| 7e7f8bc892 | |||
| 91d01ef900 |
3
.gitignore
vendored
3
.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 redir x.com and twitter.com -> bsky.app
|
||||
// @namespace zomo.dev
|
||||
// @match https://x.com/*
|
||||
// @match https://twitter.com/*
|
||||
// @version 1.0
|
||||
// @description fuck twitter
|
||||
// @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.href = 'https://bsky.app/'
|
||||
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'
|
||||
)
|
||||
)
|
||||
98
dist/optifine-download-links.user.js
vendored
98
dist/optifine-download-links.user.js
vendored
@@ -4,60 +4,60 @@
|
||||
// @match https://optifine.net/*
|
||||
// @version 1.0
|
||||
// @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
|
||||
// @supportURL https://git.zomo.dev/zomo/browser-scripts/
|
||||
// @homepageURL https://git.zomo.dev/zomo/browser-scripts/
|
||||
// @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/issues
|
||||
// @homepageURL https://git.zomo.dev/zomo/browser-scripts
|
||||
// ==/UserScript==
|
||||
// scripts/optifine-download-links/main.ts
|
||||
var onhover = false;
|
||||
var onhover = false
|
||||
async function getDownload(href) {
|
||||
let resp = await fetch(href);
|
||||
let text = await resp.text();
|
||||
let match = text.match(/<a href=['"](downloadx.*?)['"]/i);
|
||||
if (match) {
|
||||
return match[1];
|
||||
}
|
||||
return null;
|
||||
let resp = await fetch(href)
|
||||
let text = await resp.text()
|
||||
let match = text.match(/<a href=['"](downloadx.*?)['"]/i)
|
||||
if (match) {
|
||||
return match[1]
|
||||
}
|
||||
return null
|
||||
}
|
||||
function attachFetchDownloadLink(a, depth = 0) {
|
||||
function run() {
|
||||
a.innerText = "Loading";
|
||||
let url = new URL(a.href);
|
||||
if (url.pathname === "/adloadx") {
|
||||
getDownload(a.href).then((downloadUrl) => {
|
||||
if (downloadUrl) {
|
||||
a.href = downloadUrl;
|
||||
a.innerText = "Download";
|
||||
} else {
|
||||
a.innerText = "Failed";
|
||||
if (onhover)
|
||||
attachFetchDownloadLink(a, ++depth);
|
||||
else
|
||||
setTimeout(() => attachFetchDownloadLink(a, ++depth), 1e3);
|
||||
function run() {
|
||||
a.innerText = 'Loading'
|
||||
let url = new URL(a.href)
|
||||
if (url.pathname === '/adloadx') {
|
||||
getDownload(a.href).then(downloadUrl => {
|
||||
if (downloadUrl) {
|
||||
a.href = downloadUrl
|
||||
a.innerText = 'Download'
|
||||
} else {
|
||||
a.innerText = 'Failed'
|
||||
if (onhover) attachFetchDownloadLink(a, ++depth)
|
||||
else
|
||||
setTimeout(
|
||||
() => attachFetchDownloadLink(a, ++depth),
|
||||
1e3
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if (depth > 5)
|
||||
return;
|
||||
if (onhover) {
|
||||
a.addEventListener("mouseover", run, { once: true });
|
||||
} else {
|
||||
run();
|
||||
}
|
||||
if (depth > 5) return
|
||||
if (onhover) {
|
||||
a.addEventListener('mouseover', run, { once: true })
|
||||
} else {
|
||||
run()
|
||||
}
|
||||
}
|
||||
addEventListener("load", () => {
|
||||
document.querySelectorAll("a").forEach((a) => {
|
||||
let href = new URL(a.href);
|
||||
if (href.hostname === "adfoc.us") {
|
||||
let params = href.searchParams;
|
||||
if (params.has("url")) {
|
||||
let url = params.get("url")?.replace("http://", "https://");
|
||||
if (url) {
|
||||
a.href = url;
|
||||
attachFetchDownloadLink(a);
|
||||
addEventListener('load', () => {
|
||||
document.querySelectorAll('a').forEach(a => {
|
||||
let href = new URL(a.href)
|
||||
if (href.hostname === 'adfoc.us') {
|
||||
let params = href.searchParams
|
||||
if (params.has('url')) {
|
||||
let url = params.get('url')?.replace('http://', 'https://')
|
||||
if (url) {
|
||||
a.href = url
|
||||
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()))
|
||||
152
esbuild.mjs
152
esbuild.mjs
@@ -1,152 +0,0 @@
|
||||
import { build } from 'esbuild'
|
||||
// import commandLineArgs from 'command-line-args';
|
||||
|
||||
// const args = commandLineArgs([
|
||||
// { name: 'watch', alias: 'w', type: Boolean },
|
||||
// { name: 'bundle', alias: 'b', type: Boolean },
|
||||
// { name: 'minify', alias: 'm', type: Boolean },
|
||||
// { name: 'sourcemap', alias: 's', type: Boolean }
|
||||
// ]);
|
||||
|
||||
//build TS
|
||||
// build({
|
||||
// entryPoints: ['src/main.ts'],
|
||||
// outdir: 'dist',
|
||||
|
||||
// target: 'es2020',
|
||||
// platform: 'node',
|
||||
// format: 'cjs',
|
||||
|
||||
// watch: args.watch,
|
||||
// bundle: args.bundle,
|
||||
// minify: args.minify,
|
||||
// sourcemap: args.sourcemap
|
||||
// });
|
||||
|
||||
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)
|
||||
}
|
||||
})
|
||||
1587
package-lock.json
generated
Normal file
1587
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@@ -5,7 +5,8 @@
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"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": {
|
||||
"type": "git",
|
||||
@@ -13,10 +14,11 @@
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.14.42",
|
||||
"eslint": "^8.17.0",
|
||||
"prettier": "^2.6.2",
|
||||
"typescript": "^4.7.3"
|
||||
"devDependencies": {
|
||||
"@types/greasemonkey": "^4.0.4",
|
||||
"browser-scripts-builder": "git+ssh://git@git.zomo.dev:zomo/browser-scripts-builder.git",
|
||||
"eslint": "^8.38.0",
|
||||
"prettier": "^2.8.7",
|
||||
"typescript": "^5.0.4"
|
||||
}
|
||||
}
|
||||
|
||||
1970
pnpm-lock.yaml
generated
1970
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
19
readme.md
19
readme.md
@@ -1 +1,20 @@
|
||||
# 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
|
||||
|
||||
- [redir x.com and twitter.com -> bsky.app](https://git.zomo.dev/zomo/browser-scripts/raw/branch/main/dist/fuck-twitter.user.js)
|
||||
- zomo.dev 1.0
|
||||
- fuck twitter
|
||||
- [Hunger Games BrantSteele WebP Support](https://git.zomo.dev/zomo/browser-scripts/raw/branch/main/dist/hungergames-brantsteele-webp.user.js)
|
||||
- zomo.dev 1.0
|
||||
- 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 1.0
|
||||
- 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 1.1
|
||||
- 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.href = 'https://bsky.app/'
|
||||
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": "redir x.com and twitter.com -> bsky.app",
|
||||
"description": "fuck twitter",
|
||||
"namespace": "zomo.dev",
|
||||
"match": ["https://x.com/*", "https://twitter.com/*"],
|
||||
"version": "1.0",
|
||||
"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",
|
||||
"namespace": "zomo.dev",
|
||||
"match": "https://optifine.net/*",
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
"strict": true,
|
||||
"noImplicitReturns": 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