-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
It looks like BabelExt is missing functions for handling userscripts the way GreaseMonkey did.
The way I see it, this could best be accomplished, in an appropriately DIY fashion, by providing:
- A function that takes a string (or something that implements its interface like Node's Buffer), finds the first metadata block (or all? pretty sure successive blocks are ignored), and returns a JS Object with the "
@keys" converted to properties of the object, with strings as values (or arrays of strings when there is more than one instance of a key such as@require). This function can then be used by eg. a build script that reads all files, then outputs a "userscripts.json" that will be read in at runtime to determine which scripts to include. - A function for reading the extension's files (per the above note about using a "userscripts.json").
- A function that takes an object with keys of userscript filenames, and values of the parsed metadata block objects, and then loads the userscripts based on their metadata. This includes per-browser functions (which could be surfaced to the BabelExt API) that add a script (from the extension or from the Internet via
@require) in a new context (eg. XPCNativeWrapper in FF, with access tounsafeWindow) either before or after pageload. It can also insert https://github.com/honestbleeps/BabelExt/blob/master/lib/extension.js#L44-51 and/or extension API functions based on@grant.
Metadata
Metadata
Assignees
Labels
No labels