From c105d93ae0ec4b39687562f1d99e3a613bd1c71c Mon Sep 17 00:00:00 2001 From: chocolateboy Date: Tue, 18 Apr 2017 21:16:41 +0100 Subject: [PATCH] Provide userscript metadata that works The default userscript metadata doesn't work, and doesn't raise an error. Add a copy 'n' pasteable stanza that works so the library can be used without diving into the source code. * `GM_addStyle` is needed for the default mode (iframe). * `GM_registerMenuCommand` is needed for the suggested `menuCommand: true` option. * GitHub shouldn't be used as a CDN. * GreasyFork requires 3rd party libraries served from GitHub mirror CDNs to have either a commit hash or a tag. In the absence of any MonkeyConfig tags/releases, use the former. --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f270529..3a9c98d 100755 --- a/README.md +++ b/README.md @@ -9,12 +9,18 @@ Usage Example ------------- Tell your user script to use MonkeyConfig by placing a `@require` directive in -the metadata section: +the metadata section alongside the `@grant` permissions it requires: ```javascript // ==UserScript== // @name AwesomeScript -// @require https://raw.github.com/odyniec/MonkeyConfig/master/monkeyconfig.js +// @description My awesome userscript +// @require https://cdn.rawgit.com/odyniec/MonkeyConfig/51456c3a36b9b6febe61d1351de16466c90695d2/monkeyconfig.js +// @grant GM_getValue +// @grant GM_setValue +// @grant GM_addStyle +// @grant GM_registerMenuCommand +// ==/UserScript== ``` Then, call `MonkeyConfig()` to construct your configuration object: