Scripts released in this forum requires the installation of the
More Scripts plugin, please read the More Scripts plugin topic for more details.
The More Scripts plugin provides a convenient way to use and share scripts. With the format described below, scripts can be published in forum posts without uploading any document. And Users can click "Copy to clipboard" to select the script, and select "Manage Scripts..." in the More Scripts plugin's menu to install the script.
Meta Section
Scripts should contain a meta section similar to the Greasemonkey or IE7Pro or Chrome userscripts:
Copy to clipboard
Code:
// ==UserScript==
// @name No Script Error
// @author abc@home
// @version 1.0.0
// @description Catch Scripting Errors
// @description0x0804 拦截脚本运行错误
// @filename NoScriptError.user.js
// @run-at document-start
// @injectframes 1
// ==/UserScript=="==UserScript==" - start of script Meta section, must be provided
"==/UserScript==" - end of script Meta section, must be provided
"name" - name of script, must be provided
"author" - script author
"version" - script version
"description" - description which will be shown if no relevant local language description is found, it is suggested to use English so most users could understand
"description0x0XXX" - description in local languages, eg description0x0804 for simplified Chinese. The local language description will be shown if a user is using that language in Maxthon. A script can contain any number of local lanugage descriptions.
"filename" - script file name, if not provided the More Scripts plugin will derive a name from the script name
"run-at" - if specified to "document-start", the script will be run when the web page starts, if not the script will be run when the web page is loaded
"injectframes" - if specified to "1", the script will be run also in frames if any
Script API
Scripts support all maxthon plugin commands for button type plugin, for details please refer to
Maxthon Script Plugin Commands
In addition scripts support the following API (GM_xxx being corresponding greasemonkey API,PRO_xxx being corresponding IE7Pro API):
MS_xmlhttpRequest2 (GM_xmlhttpRequest) *
MS_xmlhttpRequest (PRO_xmlhttpRequest) *
MS_addStyle (GM_addStyle/PRO_addStyle)
MS_setValue (GM_setValue/PRO_setValue) *
MS_getValue (GM_getValue/PRO_getValue) *
MS_deleteValue (GM_deleteValue) *
MS_listValues (GM_listValues) *
MS_openInTab (GM_openInTab/PRO_openInTab) *
MS_showModelessDialog (PRO_showModelessDialog) *
MS_getLang (PRO_getLang)
MS_log (GM_log/PRO_log)
MS_registerMenuCommand (GM_registerMenuCommand/PRO_registerMenuCommand) *
Commands with asterisk are restricted to use in script only, ie the commands won't work in web page, Maxthon plugin, or Simple Collector. To debug a script, use the "Test" button in the "Manage Scripts..." dialog of the More Scripts plugin
Code Interference
Note that the forum would convert certain codes to bb code and/or html, and could make a script unuseable. The most often found problem is [i ], which will be converted to italics. Script author could add a space to prevent this or use a different character say "j". There are also problems with html codes <xxx> where & lt; and & gt; may be necessary. So after posting a script, it is necessary for the author to install the script himself to make sure the installed script is exact to the original script.
Respect others work
Posting of any compatible Greasemonkey or IE7pro userscripts, or porting of any userscripts, bookmarklet or existing plugins are welcome. Please quote the source and/or credit the original author.