aboutsummaryrefslogtreecommitdiff
path: root/files/th/archive/add-ons
diff options
context:
space:
mode:
Diffstat (limited to 'files/th/archive/add-ons')
-rw-r--r--files/th/archive/add-ons/deploying_a_plugin_as_an_extension/index.html82
-rw-r--r--files/th/archive/add-ons/index.html11
2 files changed, 93 insertions, 0 deletions
diff --git a/files/th/archive/add-ons/deploying_a_plugin_as_an_extension/index.html b/files/th/archive/add-ons/deploying_a_plugin_as_an_extension/index.html
new file mode 100644
index 0000000000..99cb34be71
--- /dev/null
+++ b/files/th/archive/add-ons/deploying_a_plugin_as_an_extension/index.html
@@ -0,0 +1,82 @@
+---
+title: Deploying a Plugin as an Extension
+slug: Archive/Add-ons/Deploying_a_Plugin_as_an_Extension
+tags:
+ - Plugins
+ - add-on
+translation_of: Archive/Add-ons/Deploying_a_Plugin_as_an_Extension
+---
+<p>One of the new features available in Firefox 1.5 is the ability to place browser plugins in a Firefox extension. This feature is particularly useful for vendors who wish to deploy the plugin even if Firefox is not currently installed, or who want to use the automatic extension update mechanism to update their plugin to a newer version.</p>
+
+<p>Historically, most people have chosen to use an install.js script to install a plugin. When this method is used, you can choose to either place the plugin into the plugins directory, or, on Windows, place it into your own directory and modify the Windows registry to let Firefox know where to find the plugin. The downside to this method is that once the plugin is installed, it might be difficult for users to upgrade, uninstall, or disable the plugin.</p>
+
+<p>With Firefox 1.5, you can use the built-in extension mechanism to make a plugin available to your users. This allows the plugin to be treated like other Firefox extensions; it can be upgraded, disabled, or uninstalled using the Firefox user interface.</p>
+
+<p>In this article, we will create an extension for the Rhapsody Player Engine. Normally, this plugin is installed in a local directory, and a registry item is used to let Firefox know about the plugin.</p>
+
+<p>First, let's take a look at the structure of the XPI file used for a browser plugin.</p>
+
+<pre class="eval">RhapsodyPlayerEngine_Inst_Win.xpi
+ install.rdf
+ plugins/
+ license.rtf
+ nprhapengine.dll
+</pre>
+
+<p>The important file here is the <code>install.rdf file</code>. This contains information about our extension; all extensions have one. Here's what a basic <code>install.rdf file</code> looks like:</p>
+
+<pre class="eval">&lt;RDF xmlns="<span class="nowiki">http://www.w3.org/1999/02/22-rdf-syntax-ns#</span>"
+ xmlns:em="<span class="nowiki">http://www.mozilla.org/2004/em-rdf#</span>"&gt;
+ &lt;Description about="<span class="nowiki">urn:mozilla:install-manifest</span>"&gt;
+ &lt;em:id&gt;<span class="nowiki">RhapsodyPlayerEngine@rhapsody.com</span>&lt;/em:id&gt;
+ &lt;em:name&gt;Rhapsody Player Engine&lt;/em:name&gt;
+ &lt;em:version&gt;1.0.0.487&lt;/em:version&gt;
+
+ &lt;em:targetApplication&gt;
+ &lt;Description&gt;
+ &lt;em:id&gt;{ec8030f7-c20a-464f-9b0e-13a3a9e97384}&lt;/em:id&gt;
+ &lt;em:minVersion&gt;1.5&lt;/em:minVersion&gt;
+ &lt;em:maxVersion&gt;1.5.0.*&lt;/em:maxVersion&gt;
+ &lt;/Description&gt;
+ &lt;/em:targetApplication&gt;
+
+ &lt;/Description&gt;
+&lt;/RDF&gt;
+</pre>
+
+<p>You can get more detailed information about this file at <a href="/en/Install_Manifests" title="en/Install_Manifests">install.rdf</a>.</p>
+
+<p>We'll cover the basics.</p>
+
+<p>The <code>id</code> specifies a unique ID that uniquely identifes this extension of the form. If you have written extensions for Firefox in the past, you'll notice that we no longer require the use of GUIDs as extension IDs.</p>
+
+<p>The <code>name</code> specifies the name of the extension that appears in the extension manager.</p>
+
+<p>The <code>version</code> is used for version checking when we are updating extensions.</p>
+
+<p>The <code>targetApplication</code> section specifies that platform we want to work on (that ID is for Firefox). It also specifies what versions of Firefox we want to work with.</p>
+
+<p>Now that we have an <code>install.rdf file</code>, we can actually package the XPI. Simply use the ZIP utility to create the XPI file. Make sure you keep the directory structure!</p>
+
+<p>Now we can open the XPI in Firefox and it will get installed. You'll have to restart Firefox so the plugin will be available.</p>
+
+<p>After restarting Firefox, the extension manager will include an entry for the Rhapsody Player Engine. Because it is an extension, we can disable/enable it, as well as uninstall it.</p>
+
+<p>You'll notice that one thing we did not do is provide a mechanism for updating the plugin, as discussed at the beginning of this article. Let's cover that now.</p>
+
+<p>One of the additional things that can be placed in the install.rdf is called an <code>updateURL</code>. For example:</p>
+
+<pre class="eval">&lt;em:updateURL&gt;&lt;<span class="nowiki">http://www.rhapsody.com/update.rdf</span>&gt;&lt;/em:updateURL&gt;
+</pre>
+
+<p>This URL specifies <a href="/en/Extension_Versioning%2c_Update_and_Compatibility#Update_RDF_Format" title="en/Extension_Versioning%2c_Update_and_Compatibility#Update_RDF_Format">an RDF file that can be used</a> to tell Firefox that there are updates available for your extension. This RDF file can be updated to indicate that an update to our extension/plugin is available.</p>
+
+<p>Finally, if you want to package plugins for multiple platforms into a single extension, you can do that as well. There are two ways to do this.</p>
+
+<p>First, you can simply put all the files in the plugins directory. Firefox will load the correct plugins based on the platform, simply because the plugins for other platforms won't load.</p>
+
+<p>If your plugin is for Windows, don't forget add to version resources to your plugin's DLL. Also, supply MIMEType and FileExtents, without these your plugin won't work.</p>
+
+<p>Michael Kaply<br>
+ Firefox Advocate<br>
+ <a class="link-mailto" href="mailto:mkaply@us.ibm.com" rel="freelink">mkaply@us.ibm.com</a></p>
diff --git a/files/th/archive/add-ons/index.html b/files/th/archive/add-ons/index.html
new file mode 100644
index 0000000000..9c0f942944
--- /dev/null
+++ b/files/th/archive/add-ons/index.html
@@ -0,0 +1,11 @@
+---
+title: Add-ons
+slug: Archive/Add-ons
+tags:
+ - NeedsTranslation
+ - TopicStub
+translation_of: Archive/Add-ons
+---
+<p>Archived add-ons documentation.</p>
+
+<p>{{SubpagesWithSummaries}}</p>