Skip to content

Instantly share code, notes, and snippets.

View Sasquire's full-sized avatar
💭
Alive

Sasquire

💭
Alive
View GitHub Profile

Browserify Prepend-Text

This tool prepends a piece of text to the result of a browserify bundle. it is useful for making userscripts with browserify because the header information is a piece of text at the top of the script.

How to use

const browserify = require('browserify');
const apply_header = require('./prepend_text.js');

Userscript GM_* Polyfill Functions

Because some userscript managers keep using the old GM_* functions and some insist on the new async functions, there is an issue when building scripts for both of these. This helper script fixes that by adding a polyfill for the asynchronous functions.

How to use

const GM = require('./gm_functions.js');

GM.setValue('username', 'My name!')