Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
54 views

Javascript and Browser Plugins

This document discusses browser plugins and JavaScript interactions. It covers: 1) What plugins are and how they are registered via MIME types like Flash, PDFs, and Java applets. Browsers show installed plugins on about:plugins. 2) How to include plugins in web pages using <object>, <embed>, and <applet> tags along with attributes like type, data, and codebase. 3) How JavaScript can access and control plugins by calling plugin methods, accessing properties, and vice versa through interfaces like ExternalInterface which allow bidirectional communication.

Uploaded by

Andrei Ursuleanu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Javascript and Browser Plugins

This document discusses browser plugins and JavaScript interactions. It covers: 1) What plugins are and how they are registered via MIME types like Flash, PDFs, and Java applets. Browsers show installed plugins on about:plugins. 2) How to include plugins in web pages using <object>, <embed>, and <applet> tags along with attributes like type, data, and codebase. 3) How JavaScript can access and control plugins by calling plugin methods, accessing properties, and vice versa through interfaces like ExternalInterface which allow bidirectional communication.

Uploaded by

Andrei Ursuleanu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 5

JavaScript and Browser Plugins

Plugin Generalities

What is a plugin ?

What are MIME types ? (also Content-Type)


Plugins are registered for handling specific MIME types

(e.g. application/x-shockwave-flash application/pdf application/x-java-applet) navigator.mimeTypes and enabledPlugin

There are lots of browser plugins for almost any kind of application: Adobe Flash, Java Applets, QuickTime, Windows Media Player, Adobe Acrobat, Silverlight about:plugins and Manage Add-ons

Plugin Usage

General usage through <object> tag


Deprecated usage through <embed>, <applet>

Combining object and embed: <object ..><embed ..></embed></object>


InternetExplorer and ActiveXObject: type vs. classid Object tag attributes: type, data, codebase, classid,
codetype, archive

Object inner parameters: <param name= value= /> Embed attributes: type, src, pluginspace

Applet attributes: code, codebase, archive


Common HTML attributes and specific attributes

Plugin Scriptability

MAYSCRIPT attribute: accessing JavaScript from plugin

Plugins can call and use JavaScript functions and objects: netscape.javascript.JSObject.getWindow() fscommand(command, args)

JavaScript can access public plugin members or even instantiate plugin types and classes:

var javaVersion = Packages.java.lang.System.getProperty(java.version);

JavaScript can control FlashPlayer with methods: IsPlaying, Play, StopPlay, Rewind
Flash8+ exports methods with
ExternalInterface.addCallback()

and calls JavaScript with ExternalInterface.call()

Homework
Create an HTML page that uses a plugin (Flash / Applet) and interact with it from JavaScript by calling methods / properties

You might also like