dota2太平洋打不开出现failed to load overlay localization file

Copyright & 2004-. You may not copy and distribute the work in full.
Football Manager, the Sports Interactive logo and generated in-game images are & Sports Interactive. The SEGA logo is && of SEGA Corporation. .
Handcrafted in Symi, Hellas. Page created in 0.043 seconds.
Disclaimer
This site is not endorsed by Sports Interactive or SEGA and is intended for entertainment purposes only. The views expressed on this site are the views of the individual contributors and not those of Sports Interactive or SEGA. The official Football Manager site can be found at
and the official forums can be found at .
Sports Interactive, the Sports Interactive logo, in-game generated images and any other Football Manager related items are registered trademarks and/or copyright material owned by Sports Interactive, or their respective trademark and copyright holders.
SEGA and the SEGA logo are either registered trademarks or trademarks of SEGA Corporation. Football Manager, Sports Interactive and the Sports Interactive logo are either registered trademarks or trademarks of Sports Interactive Limited. All rights reserved.DOTA2启动的时候 跳出来failed to load overlay localization file_百度知道
按默认排序
我今天在网吧遇到过!!!重启了两次就好了。你试试
其他类似问题
dota2的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁Building an extension
Introduction
This tutorial will take you through the steps required to build a very basic
- one which adds a status bar panel to the Firefox browser containing the text "Hello, World!".
Note: The extension created by this tutorial won't work in Firefox versions that don't have a static status bar (that is, Firefox 4 and up). You can find a more up-to-date tutorial in the
tutorial .
Since Firefox 4 (and other Mozilla 2 based applications) there are two types of extensions:
Traditional, classic, or XUL extensions are more powerful, but more complicated to build and require a restart to install.
Restartless, or
do not require a restart to install but are more limited than traditional extensions. The
can be used to build restartless extensions with ease.
This article explains how to build a traditional extension for Firefox. For information on bootstrapped or restartless extensions, see .
For a tutorial on building an extension for Thunderbird, see
Quick Start
similar to what you can generate with the Extension Wizard is explained line-by-line in .
Setting Up the Development Environment
Extensions are packaged and distributed in ZIP files or , with the XPI file extension.
An example of the content within a typical XPI file:
my_extension.xpi:
//Equal to a folder named my_extension/
//General information about your extension
//Registers your content with the engine
/chrome/content/
//Contents of your extension such as XUL and JavaScript files
//Default Icons of the extension
/chrome/locale/*
//Building an Extension#
//Building an Extension#
/plugins/*
We'll want to create a file structure similar to the one above for our tutorial, so let's begin by creating a folder for your extension somewhere on your hard disk (e.g. C:\extensions\my_extension\ or ~/extensions/my_extension/). Inside your new extension folder, create another folder called chrome, and inside the chrome folder create a folder called content.
Inside the root directory of your extension folder, create two new empty text files, called chrome.manifest and install.rdf. In the chrome/content directory, create a new empty text file called sample.xul.
You should end up with this directory structure:
install.rdf
chrome.manifest
sample.xul
Please read the additional information about setting up your development environment in the article .
Gecko 1.9.2 note
Starting in Gecko 1.9.2 (Firefox 3.6), you can also simply include an icon, named icon.png, in the base directory of the add-on. This allows your add-on's icon to be displayed even when the add-on is disabled, or if the manifest is missing an iconURL entry.
Create the Install Manifest
Open the file called
that you created at the top of your extension's folder hierarchy and put this inside:
&?xml version="1.0"?&
&RDF xmlns="http://www.w3.org/-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#"&
&Description about="urn:mozilla:install-manifest"&
&em:id&&/em:id&
&em:version&1.0&/em:version&
&em:type&2&/em:type&
&!-- Target Application this extension can install into,
with minimum and maximum supported versions. --&
&em:targetApplication&
&Description&
&em:id&{eca-464f-9b0e-13a3a9e97384}&/em:id&
&em:minVersion&1.5&/em:minVersion&
&em:maxVersion&4.0.*&/em:maxVersion&
&/Description&
&/em:targetApplication&
&!-- Front End MetaData --&
&em:name&sample&/em:name&
&em:description&A test extension&/em:description&
&em:creator&Your Name Here&/em:creator&
&em:homepageURL&/&/em:homepageURL&
&/Description&
– the ID of the extension. This is a value you come up with to identify your extension in email address format (note that it should not be your email). Make it unique. You could also use a GUID. NOTE: This parameter MUST be in the format of an email address, although it does NOT have to be a valid email address. (example@example.example)
Specify &em:type&2&/em:type& – the 2 declares that it is installing an extension. If you were to install a theme it would be 4 (see
for other type codes).
{eca-464f-9b0e-13a3a9e97384} – Firefox's application ID.
1.5 – the exact version number of the earliest version of Firefox you're saying this extension will work with. Never use a * in a minV it almost certainly will not do what you expect it to.
4.0.* – the maximum version of Firefox you're saying this extension will work with. In this case, "4.0.*" indicates that the extension works with Firefox 4.0 and any subsequent 4.0.x release. This number needs to be less than or equal to an . By default, Firefox 10 and later do not enforce the constraint against maxVersion (although starting in Firefox 11, very old maxVersion values are still enforced). You can force the application to do it by using the &em:strictCompatibility&.
Note: If you get a message that the install.rdf is malformed, it is helpful to load it into Firefox using the File-&Open File command and it will report XML errors to you.
Extensions designed to work with Firefox 2.0.0.x at the latest should set the maximum version to "2.0.0.*". Extensions designed to work with Firefox 1.5.0.x at the latest should set the maximum version to "1.5.0.*".
for a complete listing of the required and optional properties.
Save the file.
Extending the Browser with XUL
Firefox's user interface is written in XUL and JavaScript.
is an XML grammar that provides user interface widgets like buttons, menus, toolbars, trees, etc. User actions are bound to functionality using JavaScript.
To extend the browser, we modify parts of the browser UI by adding or modifying widgets. We add widgets by inserting new XUL DOM elements into the browser window and modify them by using script and attaching event handlers.
The browser is implemented in a XUL file called browser.xul ($FIREFOX_INSTALL_DIR/chrome/browser.jar contains content/browser/browser.xul). In browser.xul we can find the status bar, which looks something like this:
&statusbar id="status-bar"&
... &statusbarpanel&s ...
&/statusbar&
&statusbar id="status-bar"& is a "merge point" for a XUL Overlay.
XUL Overlays
are a way of attaching other UI widgets to a XUL document at runtime. A XUL Overlay is a .xul file that specifies XUL fragments to insert at specific merge points within a "master" document. These fragments can specify widgets to be inserted, removed, or modified.
Example XUL Overlay Document
&?xml version="1.0"?&
&overlay id="sample"
&statusbar id="status-bar"&
&statusbarpanel id="my-panel" label="Hello, World"
&/statusbar&
&/overlay&
The &statusbar& called status-bar specifies the "merge point" within the browser window that we want to attach to.
The &statusbarpanel& child is a new widget that we want to insert within the merge point.
Take this sample code above and save it into your file called sample.xul inside the chrome/content folder you created.
For more information about merging widgets and modifying the user interface using Overlays, see below.
Chrome URIs
XUL files are part of "" - bundles of user interface components which are loaded via chrome:// URIs. Rather than load the browser from disk using a file:// URI (since the location of Firefox on the system can change from platform to platform and system to system), Mozilla developers came up with a solution for creating URIs to XUL content that the installed application knows about.
The browser window is: . Try typing this URL into the location bar in Firefox!
Chrome URIs consist of several components:
First, the URI scheme (chrome) which tells Firefox's networking library that this is a Chrome URI. It indicates that the content of the URI should be handled as a (chrome). Compare (chrome) to (http) which tells Firefox to treat the URI as a web page.
Second, a package name (in the example above, browser) which identifies the bundle of user interface components. This should be as unique to your application as possible to avoid collisions between extensions.
Third, the type of data being requested. There are three types: content (XUL, JavaScript, XBL bindings, etc. that form the structure and behavior of an application UI), locale (DTD, .properties files etc that contain strings for the UI's ), and skin (CSS and images that form the
of the UI).
Finally, the path of a file to load.
loads the file bar.png from the foo theme's skin section.
When you load content using a Chrome URI, Firefox uses the Chrome Registry to translate these URIs into the actual source files on disk (or in JAR packages).
Create a Chrome Manifest
For more information on Chrome Manifests and the properties they support, see the
Reference.
Open the file called chrome.manifest that you created alongside the chrome directory at the root of your extension's source folder hierarchy.
Add in this code:
chrome/content/
(Don't forget the trailing slash, "/"! Without it, the package won't be registered.)
This specifies the:
type of material within a chrome package
name of the chrome package (make sure you use all lowercase characters for the package name ("sample") as Firefox/Thunderbird doesn't support mixed/camel case in version 2 and earlier - )
location of the chrome packages' files
So, this line says that for a chrome package sample, we can find its content files at the location chrome/content which is a path relative to the location of chrome.manifest.
Note that content, locale, and skin files must be kept inside folders called content, locale, and skin within your chrome subdirectory.
Save the file. When you launch Firefox with your extension (later in this tutorial), this will register the chrome package.
Register an Overlay
You need Firefox to merge your overlay with the browser window whenever it displays one. So add this line to your chrome.manifest file:
This tells Firefox to merge sample.xul into browser.xul when browser.xul loads.
First, we need to tell Firefox about your extension. During the development phase for Firefox versions 2.0 and higher, you can point Firefox to the folder where you are developing the extension, and it'll load it up every time you restart Firefox.
Locate your
and beneath it the profile you want to work with (e.g., Firefox/Profiles/&profile_id&.default/).
Open the extensions/ folder, creating it if need be.
Create a new text file and put the full path to your development folder inside (e.g., C:\extensions\my_extension\ or ~/extensions/my_extension/). Windows users should retain the OS slash direction, and everyone should remember to include a closing slash and remove any trailing spaces.
Save the file with the id of your extension as its name (e.g., ). No file extension.
Now you should be ready to test your extension!
Start Firefox. Firefox will detect the text link to your extension directory and install the Extension. When the browser window appears you should see the text "Hello, World!" on the right side of the status bar panel.
You can now go back and make changes to the .xul file, close and restart Firefox, and they should appear.
Now that your extension works, you can
it for deployment and installation.
Zip up the contents of your extension's folder (not the extension folder itself), and rename the zip file to have a .xpi extension. In Windows XP, you can do this easily by selecting all the files and subfolders in your extension folder, right click and choose "Send To -& Compressed (Zipped) Folder". A .zip file will be created for you. Just rename it and you're done!
On Mac OS X, you can right-click on the contents of the extension's folder and choose "Create Archive of..." to make the zip file. However, since Mac OS X adds hidden files to folders in order to track file metadata, you should instead use the Terminal, delete the hidden files (whose names begin with a period), and then use the zip command on the command line to create the zip file.
On Linux, you would likewise use the command-line zip tool.
If you have the 'Extension Builder' extension installed, it can compile the .xpi file for you (Tools -& Extension Developer -& Extension Builder). Merely navigate to the directory where your extension is (install.rdf, etc.), and hit the Build Extension button. This extension has a slew of tools to make development easier.
Now upload the .xpi file to your server, making sure it's served as application/x-xpinstall. You can link to it and allow people to download and install it. For the purposes of just testing our .xpi file we can just drag it into the extensions window via Tools -& Extensions in Firefox 1.5.0.x, or Tools -& Add-ons in later versions.
Installing from a web page
There are a variety of ways you can install extensions from web pages, including direct linking to the XPI files and using the InstallTrigger object. Extension and web authors are encouraged to use the
to install XPIs, as it provides the best experience to users.
Using addons.mozilla.org
Mozilla Add-ons is a distribution site where you can host your extension for free. Your extension will be hosted on Mozilla's mirror network to guarantee your download even though it might be very popular. Mozilla's site also provides users easier installation, and will automatically make your newer versions available to users of your existing versions when you upload them. In addition Mozilla Add-ons allows users to comment and provide feedback on your extension. It is highly recommended that you use Mozilla Add-ons to distribute your extensions!
to create an account and begin distributing your extensions!
Note: Your Extension will be passed faster and downloaded more if you have a good description and some screenshots of the extension in action.
Installing Extensions Using a Separate Installer
It's possible to install an extension in a special directory and it will be installed the next time the application starts. The extension will be available to any profile. See
for more information.
On Windows, information about extensions can be added to the registry, and the extensions will automatically be picked up the next time the application starts. This allows application installers to easily add integration hooks as extensions. See
for more information.
More on XUL Overlays
In addition to appending UI widgets to the merge point, you can use XUL fragments within Overlays to:
Modify attributes on the merge point, e.g., &statusbar id="status-bar" hidden="true" /& (hides the status bar)
Remove the merge point from the master document, e.g., &statusbar id="status-bar" removeelement="true" /&
Control the position of the inserted widgets:
&statusbarpanel position="1" ...
&statusbarpanel insertbefore="other-id" ...
&statusbarpanel insertafter="other-id" ...
Creating New User Interface Components
You can create your own windows and dialog boxes as separate .xul files, provide functionality by implementing user actions in .js files, using DOM methods to manipulate UI widgets. You can use style rules in .css files to attach images, set colors, etc.
documentation for more resources for XUL developers.
Defaults Files
Defaults files that you use to seed a user's profile with should be placed in defaults/ under the root of your extension's folder hierarchy. Default preferences .js files should be stored in defaults/preferences/ - when you place them here they will be automatically loaded by Firefox's preferences system when it starts so that you can access them using the .
An example default preference file:
pref("extensions.sample.username", "Joe"); //a string pref
pref("extensions.sample.sort", 2); //an int pref
pref("extensions.sample.showAdvanced", true); //a boolean pref
XPCOM Components
Firefox supports
components in extensions. You can create your own components easily in JavaScript or in C++ (using the ).
Place all of your .js or .dll files in the components/ directory - they are automatically registered the first time Firefox runs after your extension is installed.
For more information see ,
Application Command Line
One of the possible uses of custom XPCOM components is adding a command line handler to Firefox or Thunderbird. You can use this technique to run your extension as an application:
firefox.exe -myapp
for details.
Localization
To support more than one language, you should separate strings from your content using
and . It is much easier to do this while you are developing your extension, rather than come back and do it later!
Localization information is stored in the locale directory for the extension. For example, to add a locale to our sample extension, create two directories nested as "locale/en-US" in chrome (where the "content" directory is located) and add the following line to the chrome.manifest file:
locale sample en-US chrome/locale/en-US/
To create localizable attribute values in XUL, you can place the values in a .dtd file (sample.dtd for our sample extension). This file should be placed in the locale directory and looks like this:
my-panel.label
"Hello, World"&
And then include it at the top of your XUL document (but underneath the "&?xml version"1.0"?&") like so:
&?xml version="1.0"?&
&!DOCTYPE window SYSTEM "chrome://packagename/locale/filename.dtd"&
where window is the
value of the root element of the XUL document, and the value of the SYSTEM property is the chrome URI to the entity file.
For our sample extension, replace window with overlay (root element), packagename with sample, and filename.dtd with sample.dtd.
To use the entities, modify your XUL to look like this:
&statusbarpanel id="my-panel" label="&my-panel."
The Chrome Registry will make sure the entity file is loaded from the localization bundle corresponding to the selected locale.
For strings that you use in script, create a .properties file, a text file that has a string on each line in this format:
and then use / or the
tag to load the values into script.
Understanding the Browser
to inspect the browser window or any other XUL window you want to extend.
Note: DOM Inspector is not part of the Standard Firefox installation. Since Firefox 3 Beta 4, the DOM Inspector has been available from
as a standalone extension. For earlier versions, you must reinstall with the Custom install path and choose DOM Inspector (or Developer Tools in Firefox 1.5) if there is not a "DOM Inspector" item in your browser's Tools menu.
Use the point-and-click node finder button at the top left of the DOM Inspector's toolbar to click on a node in the XUL window visually to select it. When you do this, the DOM inspector's DOM hierarchy tree view will jump to the node you clicked on.
Use the DOM Inspector's right side panel to discover merge points with ids that you can use to insert your elements from overlays. If you cannot discover an element with an id that you can merge into, you may need to attach a script in your overlay and insert your elements when the load event fires on the master XUL window.
Debugging Extensions
Analytical Tools for Debugging
- inspect attributes, DOM structure, CSS style rules that are in effect (e.g., find out why your style rules don't seem to be working for an element - an invaluable tool!)
- set breakpoints in JavaScript and inspect call stacks
Components.stack.caller& in JavaScript - access a function's call stack
printf debugging
Use ("string") (see
this requires a bit of configuration to work properly)
to log to the JavaScript console
Advanced debugging
Run a debug Firefox build and set breakpoints in Firefox itself, or your C++ components. For the experienced developer, this is often the fastest way to diagnose a problem. See
for more information.
for more helpful tips.
Document Tags and Contributors
Contributors to this page: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Last updated by:
Mar 24, :44 PM
Mozilla Developer Network and individual contributors Content is available under
Other languages:
English (US)
Nederlands
Português (do Brasil)
Ti?ng Vi?t
中文 (简体)

我要回帖

更多关于 dota2吧 的文章

 

随机推荐