background preloader

Creating OpenSearch plugins for Firefox

Creating OpenSearch plugins for Firefox
Firefox supports the OpenSearch description format for search plugins. Plugins that use OpenSearch are compatible with Firefox, Internet Explorer, and Chrome. Because of this, they are the recommended format for use on the web. Firefox also supports additional features not included in OpenSearch, such as search suggestions and the SearchForm element. OpenSearch description files can be advertised as described in Autodiscovery of search plugins, and can be installed programmatically as described in Adding search engines from web pages. OpenSearch description fileEdit The XML file describing a search engine follows the basic template below. <OpenSearchDescription xmlns=" xmlns:moz=" engine full name and summary</Description><InputEncoding>UTF-8</InputEncoding><Image width="16" height="16" type="image/x-icon">data:image/x-icon;base64,AAABAAEAEBAAA ... ShortName Image

Themes Themes are skins for different Mozilla applications. They allow you to change the look and feel of the user interface and personalize it to your tastes. A theme can simply change the colors of the UI or it can change every piece of its appearance. The Theme documentation here is out of date, but we're hoping to get some help to update it soon. Document Tags and Contributors Contributors to this page:Kakurady, Sheppy, Chbok, Callek, wsmwk, Softwayer, vetal, Tsahi, fbender, GavinSharp, Gryllida, jkinkead, Banan, Jeroenvrp, Kataria, CP1, Sailfish, Versgui, Jorge.villalobos, CF, fscholz,, Nickolay, Kliu0x52, Shimono, KLB, Ivise301, ethertank, Cameron, Aconbere, Gandalf, Mgjbot, Dria, wbamberg

Participating in the Mozilla project If you're interested in helping to fix bugs and otherwise work on the code behind the Mozilla platform, this is the place to find the documentation that will point you in the right direction. Document Tags and Contributors Contributors to this page:Sheppy, Centinel, openjck, jenzed, Benjamin Smedberg, Pettay, inma_610, Husylvan, thiagofalves, themky,, phenix, Potappo, Johnatan Add-on Builder The Add-on Builder was a web-based development environment that allowed developers to create add-ons using the SDK APIs, but without needing to use the cfx command line tool. It was retired on April 1, 2014, and the "" domain now redirects to this page. If you have only used the SDK through the Builder, you already know most of what you need to know to develop using just the SDK. install the SDK locally get to know the cfx command line tool, with this introductory walkthrough and the detailed cfx reference get to know the package.json file used to configure attributes of your add-on

Plugins Plugins are shared libraries that users can install to display content that the application itself can't display natively. For example, the Adobe Reader plugin lets the user open PDF files directly inside the browser, and the QuickTime and RealPlayer plugins are used to play special format videos in a web page. Plugins are now a legacy technology. They are not available on most mobile devices. Mozilla encourages website developers to avoid using plugins wherever possible. If there are plugin features which are not available in the web platform, we encourage developers to post their use cases to project list, so that Mozilla can prioritize web platform work to make those use cases possible. Plugins are written using NPAPI, the cross-browser API for plugins. Plugins can be written completely from scratch using C APIs (usually in C or C++) or they may be built on a plugin framework such as Firebreath, JUCE, or QtBrowserPlugin. Writing a plugin for Mac OS X

Service Unavailable Modify and extend Mozilla applications Add-ons add new functionality to Gecko-based applications such as Firefox, SeaMonkey, and Thunderbird. There are two main types of add-on: Extensions add new features to the application, while Themes modify the application's user interface. Add-ons can greatly affect the behavior of the application that hosts them. We've developed a set of guidelines to help ensure that they provide a good experience to users. These guidelines apply for all sorts of add-ons, whether they are hosted at or not. Extensions Extensions add new functionality to Mozilla applications such as Firefox and Thunderbird. There are three different techniques you can use to build extensions: Add-on SDK-based extensions, manually bootstrapped restartless extensions, and legacy extensions. Add-on SDK extensions Extensions built using a set of high-level JavaScript APIs, which don't require a browser restart to install. WebExtensions Debugging Recommended practices

Detecting device orientation This is an experimental technologyBecause this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes. Summary Increasingly, web-enabled devices are capable of determining their orientation; that is, they can report data indicating changes to their orientation with relation to the pull of gravity. In particular, hand-held devices such as mobile phones can use this information to automatically rotate the display to remain upright, presenting a wide-screen view of the web content when the device is rotated so that its width is greater than its height. There are two JavaScript events that handle orientation information. The second event is the DeviceMotionEvent, which is sent when a change in acceleration was added. Processing orientation events Orientation values explained See also

Mobile Firefox OS Firefox OS is an open source mobile operating system which uses Linux and Mozilla's Gecko engine to run a user interface and set of applications written entirely in HTML, CSS and JavaScript. Read about how to install Firefox OS and how to develop apps for it. Firefox for Android Firefox for Android is Mozilla's mobile web browser for Android devices. It's recently been rewritten to use Android's native UI, making it faster, leaner and more responsive. Read about how to help create Firefox for Android, how to use its device APIs, and how to build mobile add-ons. Mobile web development Mobile devices have very different hardware characteristics from desktop or laptop computers, and many of the APIs used to work with them are still in the process of being standardized. Read about how to develop web sites that look good on mobile devices and take advantage of the new possibilities they offer. Document Tags and Contributors

Using geolocation The geolocation API allows the user to provide their location to web applications if they so desire. For privacy reasons, the user is asked for permission to report location information. The geolocation object The geolocation API is published through the navigator.geolocation object. If the object exists, geolocation services are available. if ("geolocation" in navigator) { } else { } Note: On Firefox 24 and older versions, "geolocation" in navigator always returned true even if the API was disabled. Getting the current position To obtain the user's current location, you can call the getCurrentPosition() method. Note: By default, getCurrentPosition() tries to answer as fast as possible with a low accuracy result. navigator.geolocation.getCurrentPosition(function(position) { do_something(position.coords.latitude, position.coords.longitude);}); The above example will cause the do_something() function to execute when the location is obtained. Watching the current position Fine tuning response