Netscape Plug-Ins

Extending Netscape's ability to handle additional file formats.
Design Issues

The SDK documentation advises against “blocking” any API call. The browser will not be responsive to user input while the API calls are executing. Therefore, these functions should complete in a reasonably short period of time. If a plug-in needs to perform time-consuming processing, a number of techniques can be employed. The best technique to use depends on a number of factors, including the nature of the plug-in as well as personal preference.

One popular technique is for the plug-in to create a completely separate “companion process”. This solution can be quite robust. A catastrophic failure in the companion process will likely not affect the browser. However, elaborate interprocess communication mechanisms may be needed to provide synchronization between the browser and the companion process. This technique is most appropriate if the processing is only loosely connected to the browser. It is also often the easiest technique for converting a helper application into a plug-in.

Alternatively, the plug-in could use time-slices within the browser to accomplish its processing. The plug-in can use the NPP_WriteReady function to limit the data transfer rate from the browser. With the data rate limited, the plug-in can perform the processing within the NPP_Write function without degrading browser performance. For example, a streaming video plug-in might limit the data transfer rate to the frame rate. Each time the browser invokes the NPP_Write function, the plug-in would need to process only one frame's worth of data before returning control to the browser. This technique is most appropriate for streaming plug-ins.

The X event processing loop can also provide processing time-slices. The X event processing loop acts much like the scheduler in a cooperative multitasking operating system. It can be commanded to perform small processing tasks during idle times, or after specific time intervals via the XtAppAddWorkProc and XtAppAddTimeOut functions, respectively. This technique is most appropriate for plug-ins with interactive graphics, especially animation.

Finally, the plug-in could create a separate, asynchronous thread within the process. Thread programming can be difficult. Many UNIX libraries, especially graphics libraries, are not thread-safe. The plug-in designer must use care to avoid reentrancy problems. This technique should be reserved for situations where none of the previous techniques can be used.

Plug-ins can be difficult to debug. The browser does not load the plug-in until just before executing the plug-in functions. This does not leave much opportunity for a debugger to set breakpoints. It may be necessary to resort to using printf. One technique for using a debugger is to insert an artificial delay in a convenient location, such as at the beginning of NPP_Initialize. The delay can give a debugger time to “attach” to the browser. Once the debugger is attached, breakpoints can be set within the plug-in.

Conclusion

Netscape plug-ins can enhance the web surfing experience. After all, it is much more fun to experience creative multimedia than it is to see dull gray rectangles. Linux plug-ins are available for many commonly used MIME types; some require compiling, others are available as shared libraries, simplifying installation. Implementing plug-ins for unsupported MIME types is well within the capabilities of an experienced Linux programmer and can be fun. The source code for the UNIX MIDI plug-in (UMP) is available on the UMP download page (see Resources 4). This source code can be used as a starting point for other plug-in projects. I glossed over cross-platform development, LiveConnect support and printing issues. For more information on these topics or any plug-in topic, feel free to contact me.

Resources

Larry Hoff works for Brookhaven National Lab, where he develops embedded software for particle accelerator control. He can be reached at hoff@bnl.gov.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

bit of my feeling

H N Sridharan's picture

Hii

i am Sridharan. your article is very informative.

i am only looking for free software,

netscape navigator/netscape 9.0.0.6 gives an error for reliancemoney.com .... like "you must have IE6 and above with 128 bit data encription".

i am inetersted to run reliancemoney,com on netscape which was running properly as long as netscape6.0 was revised.

now as per the latest version of netscape and its dependent browsers how to run reliancemoney.com..... I am looking for a free plugin software for netscape.

my confidence level for your reply is 100%

my fine regards for you and wishes are that you develop in this technolgy for name and fame

H N Sridharan
mitraanugraha@hotmail.com

Some doubts

Roshan Kumar's picture

U did not explain how to install Plug -ins in the system.

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState