Plugin的生命周期

【Plugin的生命周期】

The life cycle of a plug-in, unlike that of an application, is completely controlled by the web page that calls it. This section gives you an overview of the way that plug-ins operate in the browser.

When Gecko starts, it looks for plugin modules in particular places on the system. 

When the user opens a page that contains embedded data of a media type that invokes a plug-in, the browser responds with the following sequence of actions:

  • check for a plug-in with a matching MIME type
  • load the plug-in code into memory
  • initialize the plug-in
  • create a new instance of the plug-in

Gecko can load multiple instances of the same plug-in on a single page, or in several open windows at the same time. If you are browsing a page that has several embedded RealAudio clips, for example, the browser will create as many instances of the RealPlayer plug-in as are needed (though of course playing several RealAudio files at the same time would seldom be a good idea). When the user leaves the page or closes the window, the plug-in instance is deleted. When the last instance of a plug-in is deleted, the plug-in code is unloaded from memory. A plug-in consumes no resources other than disk space when it is not loaded. 

原文地址:https://www.cnblogs.com/tekkaman/p/2557005.html