« XUL Reference home
reserved
Type: string
This attribute applies to a command element.
Setting this attribute to "true" indicates that the command is reserved for Chrome code and is not available for use in the content. This means that, to execute these commands, key events won't be passed to content, and event listeners registered for them in content will not be executed.
Currently, the content still receives these key events, even though it can't override them. In future releases, it won't receive them. See bug 1173061 for details.

Example

Here, the command to open a new browser window is reserved:

<command id="cmd_newNavigator" oncommand="OpenBrowserWindow()" reserved="true"/>

If the keyboard shortcut for that is accel-t, then this code will not work as expected, as compared to when it is run from web content:

document.addEventListener("keydown", handleKey, true);

function handleKey(event) {
  // Listen for the "New Tab" shortcut
  if (event.metaKey && (event.key == "t")) {
      // Log a message
      console.log("intercepted accel-t");
      // Prevent the default browser action
      event.preventDefault();
      event.stopPropagation();
  }
}

Currently, this event handler as coded above runs and logs the message, but the default behavior persists. In future releases, the event handler will never be called for the given keyboard shortcut.