Phage

A userscript and userstyle injector for a post-safariextz world

GitHub Project

Phage is a simple Safari App Extension that injects userscripts and userstyles into web content.

All userscripts and userstyles are simple js and css files in the file system and can be edited with any regular text editor.

Userscripts and userstyles are organized into bundles, which are directories containing multiple script and stylesheet files. They allow for logical grouping of associated userscripts and userstyles.

All bundles are then loaded from the bundles directory—to visit it, click on in the Phage app.

Writing Userscripts and Userstyles

Userscripts use a basic version of the Greasemonkey metadata format as follows:

// ==UserScript==
// @match https://example.com/**/*
// @require https://example.com/required-script.js
// ==/UserScript==

Currently, only @match and @require are supported. Other Greasemonkey tags will be ignored.

Userstyles use the @document (or @-moz-document) format. Unlike other userstyle plugins, any CSS rules outside of a @document rule will be ignored.

/* userstyle example */
@document url-prefix(https://example.com/prefix) {
    ... write your styles here ...
}

Supported selectors: