Menu

config.xml

mmartz

config.xml is a file in the Scripts directory that lists your installed script filenames as well as metadata such as their @name, @namespace, @description, @include, @exclude and enabled status.

The contents of the file may look like the following:

<UserScriptConfig>
  <Script
    basedir="hello_world"
    checkRemoteUpdates="1"
    dependhash="0000000000000000000000000000000000000000"
    description="JavaScript alert box saying Hello, world"
    enabled="true"
    filename="hello_world.user.js"
    installTime="0000000000000"
    modified="0000000000000"
    name="Hello, World"
    namespace="http://localhost.localdomain"
    runAt="document-end"
    updateMetaStatus="ok"
    uuid="00000000-0000-0000-0000-000000000000"
    version="0.0.0"
    installurl="https://www.example.org/helloWorld.user.js"
    updateurl="https://www.example.org/helloWorld.user.js"
    icon="icon.png"
  >
    <Grant>none</Grant>
    <Include>https://www.example.org/*</Include>
    <Match>https://www.example.net/*</Match>
    <Exclude>/^https:\/\/www.\.example\.com\/.*/</Exclude>
  </Script>
</UserScriptConfig>

When a script is installed/updated, the metadata is written to config.xml. The Metadata Block inside the actual script is then effectively ignored - include and exclude rules are read from this file when applying scripts to URLs, and changes in the management interface are written to it. When script injection rules are modified in the management interface or directly edited, config.xml is modified to reflect the changes. Changes in the management interface do not modify the actual user script files.

The config.xml determines script order. The first <Script>...</Script> entry represents the first script in the script manager and the first script to execute. The second entry is the second script, and so on through the last Script element in the file.


Related

Wiki: Greasemonkey_Manual:Managing_Scripts
Wiki: Metadata_Block
Wiki: Script_injection_rules
Wiki: Scripts_directory