# Run-time Model

Plug-ins are dynamic code modules that are associated with one or more MIME types. When Netscape Navigator starts, it enumerates the available plug-ins in a platform-specific manner, reads one or more string resources out of each plug-in file to determine the MIME types for that plug-in, and registers each plug-in for its MIME types.

When Navigator encounters data of a MIME type registered for a plug-in (either embedded in an HTML page or in a separate file), it loads the plug-in code into memory (if it hasn't been loaded already) and creates a new instance of the plug-in. Netscape calls the plug-in API function NPP_Initialize when the plug-in code is first loaded, and the function NPP_New when the instance is created. There may be multiple instances of the same plug-in if there are multiple embedded objects on a single page, or if several Netscape windows are open with each displaying the same data type.

A plug-in instance is deleted when a user leaves the instance's page or closes the instance's window; Netscape will call the function NPP_Destroy to inform the plug-in that the instance is being deleted. When the last instance of a plug-in is deleted, the plug-in code is unloaded from memory and Netscape calls the function NPP_Shutdown. Plug-ins consume no resources (other than disk space) if not referenced.