From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/theme_packaging/index.html | 108 +++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 files/zh-cn/theme_packaging/index.html (limited to 'files/zh-cn/theme_packaging') diff --git a/files/zh-cn/theme_packaging/index.html b/files/zh-cn/theme_packaging/index.html new file mode 100644 index 0000000000..643abe0119 --- /dev/null +++ b/files/zh-cn/theme_packaging/index.html @@ -0,0 +1,108 @@ +--- +title: Theme Packaging +slug: Theme_Packaging +tags: + - Themes + - Toolkit API +translation_of: Mozilla/Thunderbird/Thunderbird_extensions/Theme_Packaging +--- +

 

+

This document describes how to package themes for Firefox and Thunderbird.

+
+

Note: This article is out of date, in that it still talks about the contents.rdf file, which has been deprecated since Gecko 1.8, and is no longer supported starting with Gecko 1.9.2. You must use the chrome.manifest method for registering chrome to be forward compatible. It would be greatly appreciated if someone with theming experience could work on an update to this article.

+
+

Pre-requisites

+

Making a theme for Firefox or Thunderbird requires knowledge of Cascading Stylesheets (CSS), probably XBL, and some graphic design and aesthetic skill (...or maybe not). This document describes only how Themes are packaged in order to be shown in Firefox's Themes window.

+

Theme File Layout

+

Firefox/Thunderbird themes are packaged in a JAR file with the following structure:

+
theme.jar:
+  install.rdf
+  contents.rdf
+  preview.png
+  icon.png
+  browser/files
+  global/files
+  mozapps/files
+  communicator/files
+  ...
+
+
+ +

install.rdf

+

Your install.rdf manifest will look something like this:

+
<?xml version="1.0"?>
+
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+
+  <Description about="urn:mozilla:install-manifest">
+    <em:type>4</em:type>more properties
+  </Description>
+</RDF>
+
+

Required install.rdf Properties

+

Your install.rdf file must have the following properties. See the install.rdf Reference for more information:

+ +

Optional install.rdf Properties

+ +

Note that if your theme will be made available on the http://addons.mozilla.org website, it should not include an updateURL.

+

Sample install.rdf File

+
<?xml version="1.0"?>
+
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+
+  <Description about="urn:mozilla:install-manifest">
+    <em:id>{18b64b56-d42f-428d-a88c-baa413bc413f}</em:id>
+    <em:version>1.0</em:version>
+    <em:type>4</em:type>
+
+    <!-- Target Application this extension can install into,
+         with minimum and maximum supported versions. -->
+    <em:targetApplication>
+      <Description>
+        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
+        <em:minVersion>0.8</em:minVersion>
+        <em:maxVersion>0.9</em:maxVersion>
+      </Description>
+    </em:targetApplication>
+
+    <!-- Front End MetaData -->
+    <em:name>New Theme 1</em:name>
+    <em:description>A test theme for Firefox</em:description>
+    <em:creator>Ben Goodger</em:creator>
+    <em:contributor>John Doe</em:contributor>
+    <em:homepageURL>http://www.bengoodger.com/</em:homepageURL>
+
+    <!-- Front End Integration Hooks (used by Theme Manager)-->
+    <em:internalName>newtheme1</em:internalName>
+  </Description>
+</RDF>
+
+

The following are some common target application GUIDs that you can use in your targetApplication properties:

+
Firefox      {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+Thunderbird  {3550f703-e582-4d05-9a08-453d09bdfdc6}
+Sunbird      {718e30fb-e89b-41dd-9da7-e25a45638b28}
+
+

Official References for Toolkit API

+
+ {{page("/en-US/docs/Toolkit_API/Official_References")}}
+
+  
-- cgit v1.2.3-54-g00ecf