TamperMonkeyRouter

Router for TamperMonkey scripts

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/468396/1203270/TamperMonkeyRouter.js

Аўтар
Howardzhangdqs
Версія
0.1
Створаны
11.06.2023
Абноўлены
11.06.2023
Памер
2.1 КБ
Ліцэнзія
WTFPL

TamperMonkey Router

Usage:

// Wildcard matching path
window.TamperMonkeyRouter("*/zh-CN/*", () => { console.log("Chinese") });
window.TamperMonkeyRouter("*/zh-??/*", () => { console.log("Chinese (CN/TW/HK/etc)") });

// Regular expression matching path
window.TamperMonkeyRouter(/\/zh-CN\//, () => {console.log("Chinese")});
window.TamperMonkeyRouter(/\/zh-..\//, () => {console.log("Chinese (CN/TW/HK/etc)")});