K-Meleon

Use this page to experiment with the wiki. (Just don't delete this text; otherwise people won't know the purpose of the page.)



Events

    OnActivateWindow
    OnCloseGroup
    OnCloseWindow
    OnInit
    OnLoad
    OnOpenWindow
    OnQuit
    OnSetup
    OnStartup
    OnWMAppExit

Events

The Macro Extension Plugin provides a variety of events.

Overview

Event Is triggered
ActivateWindow When a window gets the focus.
CloseGroup When a multi-layered window is closed.
CloseTab When a tab is closed.
CloseWindow When a window/layer is closed.
Init When the Default Configuration Files have been parsed.
Load When a document finished loading.
OpenTab When a tab is opened.
OpenWindow When a window/layer is opened.
Quit When the macro plugin (the browser) is being closed.
Setup When the User Configuration Files have been parsed.
Startup When the first window is opened.
WMAppExit When ID_APP_EXIT is called to terminate the application.

Not all of these events are supported by all versions of K-Meleon.

Event Handling

Whenever <event> is triggered, the Macro Extension Plugin will look for a macro named On<event> and execute it if found. The appropriate On<event> macros are provided by default.

To get your own code executed whenever <event> is triggered, simply add your code to the On<event> macro in your Macro Definition File (macros.cfg).

Since K-Meleon 1.1, the On<event> macros are located in the Main K-Meleon Macro Module (main.kmm). This module also provides global $On<event> variables which you should use in your own modules to get code executed whenever <event> is triggered:

           myMacro{
           # your On<event> code
           }
           $On<event>=$On<event>."myMacro;";

Since K-Meleon 1.1, the On<event> macros are executed in the context of the window that triggered the event. In previous versions, these macros were executed in the context of the currently active window (which is not necessarily the window that triggered the event).

Event Cascade

          Startup is always followed by Load or OpenWindow
          OpenWindow is always followed by Load
          Init, Setup and Quit are only fired once a session.
          ActivateWindow is usually fired multiple times when a browser window is focused

            Startup Order of Precedence
                 Init
                 Setup
                 Startup(1)

(1) When the browser is opening a group or folder at startup, the Load event is fired before Startup and Startup is fired multiple times (once for each opened layer).

            Shutdown Order of Precedence
                 CloseGroup or WMAppExit(1)
                 CloseWindow(2)
                 Quit

(1) WMAppExit seems currently not to be fired at all.

(2) CloseWindow is fired for each closed layer.

K-Meleon

(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.