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

Author
Howardzhangdqs
Version
0.1
Created
2023-06-11
Updated
2023-06-11
License
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)")});