| 1 | | /** |
| 2 | | * ==VimperatorPlugin== |
| 3 | | * @name gmperator |
| 4 | | * @description Vimperator plugin for Greasemonkey |
| 5 | | * @author teramako teramako@gmail.com |
| 6 | | * @namespace http://d.hatena.ne.jp/teramako/ |
| 7 | | * @version 0.6c |
| 8 | | * ==/VimperatorPlugin== |
| 9 | | * |
| 10 | | * --------------------------- |
| 11 | | * Usage: |
| 12 | | * --------------------------- |
| 13 | | * {{{ |
| 14 | | * |
| 15 | | * :gmli[st] {filter} -> show user scripts matches {filter} |
| 16 | | * :gmli[st]! -> show all user scripts |
| 17 | | * :gmli[st] full -> same as :gmli[st]! |
| 18 | | * |
| 19 | | * :gmlo[ad] {name|filename} -> load the user script to the current page |
| 20 | | * but, don't dispatch load event |
| 21 | | * so maybe you should edit the scripts before load |
| 22 | | * :gmlo[ad]! {name|filename} -> force load the user script |
| 23 | | * |
| 24 | | * :gmset! -> toggle enable/disable Greasemonkey |
| 25 | | * :gmset! {filename} -> toogle enable/disable the script |
| 26 | | * :gmset {filename} {options} |
| 27 | | * {options}: |
| 28 | | * -n[ame] {value} -> change name to {value} |
| 29 | | * -i[nclude] {expr[,expr,...]} -> change includes to expr list ("," demiliter) |
| 30 | | * -e[xclude] {expr[,expr,...]} -> change excludes to expr list ("," demiliter) |
| 31 | | * |
| 32 | | * :gmcommand {command name} -> run Greasemonkey Command |
| 33 | | * |
| 34 | | * Caution: |
| 35 | | * The change is permanent, not only the session. |
| 36 | | * And cannot get back. |
| 37 | | * |
| 38 | | * e.g.) |
| 39 | | * :gmset! {filename} -n fooScriptName -i http://*,https://* -e http://example.com/* |
| 40 | | * toggle enable or disable, |
| 41 | | * name to "fooScriptName", |
| 42 | | * includes to "http://*" and "https://*", |
| 43 | | * and excludes to "http://example.com/*" |
| 44 | | * |
| 45 | | * --------------------------- |
| 46 | | * Autocommand |
| 47 | | * --------------------------- |
| 48 | | * Available events: |
| 49 | | * 'GMInjectedScript' -> when open either foreground or background |
| 50 | | * 'GMActiveScript' -> when TabSelect or open foreground |
| 51 | | * e.g.) |
| 52 | | * autocmd GMActiveScript scriptName\.user\.js$ :echo "scriptName is executing" |
| 53 | | * when any URL and scriptName.user.js is executing |
| 54 | | * |
| 55 | | * --------------------------- |
| 56 | | * Dialog |
| 57 | | * --------------------------- |
| 58 | | * :dialog userscriptmanager -> open Greasemonkey UserScript Manager |
| 59 | | * |
| 60 | | * }}} |
| 61 | | * --------------------------- |
| 62 | | * For plugin developer: |
| 63 | | * --------------------------- |
| 64 | | * {{{ |
| 65 | | * |
| 66 | | * you can access to the sandbox of Greasemonkey !!! |
| 67 | | * |
| 68 | | * liberator.plugins.gmperator => ( |
| 69 | | * allItem : return object of key : {panalID}, |
| 70 | | * value : {GmContainer} |
| 71 | | * {panelID} => @see gBrowser.mTags[].linkedPanel |
| 72 | | * currentPanel |
| 73 | | * currentContainer : return the current {GmContainer} object |
| 74 | | * currentSandbox : return the current sandbox object |
| 75 | | * gmScripts : return array of {userScripts} |
| 76 | | * {userScripts} => ( |
| 77 | | * filename : {String} |
| 78 | | * name : {String} |
| 79 | | * namespace : {String} |
| 80 | | * description: {String} |
| 81 | | * enabled : {Boolean} |
| 82 | | * includes : {String[]} |
| 83 | | * encludes : {String[]} |
| 84 | | * ) |
| 85 | | * ) |
| 86 | | * }}} |
| 87 | | */ |
| | 1 | var PLUGIN_INFO = |
| | 2 | <VimperatorPlugin> |
| | 3 | <name>{NAME}</name> |
| | 4 | <description>Vimperator plugin for Greasemonkey</description> |
| | 5 | <author mail="teramako@gmail.com" homepage="http://d.hatena.ne.jp/teramako/">teramako</author> |
| | 6 | <version>0.6c</version> |
| | 7 | <minVersion>2.0pre</minVersion> |
| | 8 | <maxVersion>2.0pre</maxVersion> |
| | 9 | <detail><![CDATA[ |
| | 10 | |
| | 11 | == Command == |
| | 12 | |
| | 13 | === gmlist === |
| | 14 | :gmli[st] {filter}: |
| | 15 | show user scripts matches {filter} |
| | 16 | :gmli[st]!: |
| | 17 | show all user scripts |
| | 18 | :gmli[st] full: |
| | 19 | same as :gmli[st]! |
| | 20 | |
| | 21 | === gmload === |
| | 22 | :gmlo[ad] {name|filename}: |
| | 23 | load the user script to the current page |
| | 24 | but, do not dispatch load event |
| | 25 | so maybe you should edit the scripts before load |
| | 26 | :gmlo[ad]! {name|filename}: |
| | 27 | force load the user script |
| | 28 | |
| | 29 | === gmset === |
| | 30 | :gmset!: |
| | 31 | toggle enable/disable Greasemonkey |
| | 32 | :gmset! {filename}: |
| | 33 | toggle enable/disable the script |
| | 34 | :gmset {filename} {options}: |
| | 35 | change the {filename} script attributes. |
| | 36 | {options}: |
| | 37 | -n[name] {value}: change name to {value} |
| | 38 | -i[nclude] {expr[,expr,...]}: change includes to expr list ("," demiliter) |
| | 39 | -e[xclude] {expr[,expr,...]}: change excludes to expr list ("," demiliter) |
| | 40 | Caution: |
| | 41 | This change is permanent, not only the session. |
| | 42 | And cannot get back. |
| | 43 | |
| | 44 | |
| | 45 | ==== example ==== |
| | 46 | :gmset! {filename} -n fooScriptName -i http://*,https://* -e http://example.com/*: |
| | 47 | - toggle enable or disable, |
| | 48 | - name to "fooScriptName", |
| | 49 | - includes to "http://*" and "https://*", |
| | 50 | - and excludes to "http://example.com/*" |
| | 51 | |
| | 52 | |
| | 53 | === gmcommand === |
| | 54 | :gmcommand {command name}: |
| | 55 | run Greasemonkey Command |
| | 56 | |
| | 57 | == AutoCommand == |
| | 58 | |
| | 59 | Available events |
| | 60 | |
| | 61 | GMInjectedScript: |
| | 62 | when open either foreground or background |
| | 63 | GMActiveScript: |
| | 64 | when TabSelect or open foreground |
| | 65 | example: |
| | 66 | autocmd GMActiveScript scriptName\.user\.js$ :echo "scriptName is executing" |
| | 67 | when any URL and scriptName.user.js is executing |
| | 68 | |
| | 69 | |
| | 70 | == Dialog == |
| | 71 | |
| | 72 | :dialog userscriptmanager: |
| | 73 | open Greasemonkey UserScript Manager |
| | 74 | |
| | 75 | == for JavaScripter == |
| | 76 | you can access to the sandbox of Greasemonkey !!! |
| | 77 | |
| | 78 | liberator.plugins.gmperator: |
| | 79 | allItem: |
| | 80 | return object of |
| | 81 | key: |
| | 82 | {panalID} |
| | 83 | value: |
| | 84 | {GmContainer} |
| | 85 | |
| | 86 | {panelID}: |
| | 87 | @see gBrowser.mTags[].linkedPanel |
| | 88 | |
| | 89 | currentPanel: |
| | 90 | currentContainer : |
| | 91 | return the current {GmContainer} object |
| | 92 | currentSandbox : |
| | 93 | return the current sandbox object |
| | 94 | gmScripts : |
| | 95 | return array of {userScripts} |
| | 96 | {userScripts} => (: |
| | 97 | - filename : {String} |
| | 98 | - name : {String} |
| | 99 | - namespace : {String} |
| | 100 | - description: {String} |
| | 101 | - enabled : {Boolean} |
| | 102 | - includes : {String[]} |
| | 103 | - encludes : {String[]} |
| | 104 | ) |
| | 105 | |
| | 106 | ]]></detail> |
| | 107 | </VimperatorPlugin>; |
| | 108 | |