Search completed in 1.22 seconds.
How to build custom form controls - Learn web development
for example, if you need to perform advanced styling on some controls such as the <select> element or if you want to provide custom behaviors, you may consider b
uilding your own controls.
... in this article, we will discuss how to b
uild a custom control.
... to that end, we will work with an example: reb
uilding the <select> element.
...And 27 more matches
Simple SeaMonkey build
you can b
uild a bleeding-edge, development version of seamonkey using the commands below.
... for complete information, see the b
uild documentation.
... b
uild prereq
uisites hardware req
uirements: the seamonkey b
uild process is both i/o- and cpu-intensive, and can take a long time to b
uild even on modern hardware.
...And 27 more matches
Obsolete Build Caveats and Tips
purpose of this page the mozilla b
uild process and code base have evolved considerably over the past few years.
... this has resulted in many caveats and tips being added to the mdn documentation for b
uilding older versions of the code base or dealing with older b
uild tools.
... these tips, while helpful, are jarring and superfluous to the majority of new mozilla b
uilders who are mainly interested in b
uilding the latest version of firefox.
...And 27 more matches
Template Builder Interface - Archive of obsolete content
if so, a template b
uilder will be created for the element and attached to the element.
... if the element is a <tree> element and has the flags attribute set to "dont-b
uild-content", a tree b
uilder will be created.
... otherwise, a content b
uilder will be created.
...And 26 more matches
Simple Instantbird build
this page covers the basic steps needed to b
uild a bleeding-edge, development version of instantbird.
... for additional, more detailed information, see the b
uild documentation.
... this should be kept in sync with simple thunderbird b
uild, you might want to take a look at that page too.
...And 26 more matches
Build instructions
use the b
uilding nss page for more recent information.
... numerous optional features of nss b
uilds are controlled through make variables.
...(for posix shells), variable=value; export variable gmake target1 target2 here are some (not all) of the make variables that affect nss b
uilds: b
uild_opt: if set to 1, means do optimized non-debug b
uild.
...And 26 more matches
requiredFeatures - SVG: Scalable Vector Graphics
the req
uiredfeatures attribute takes a list of feature strings, with the individual strings separated by white space.
...if a null string or empty string value is given to attribute req
uiredfeatures, the attribute is evaluate to false.
... req
uiredfeatures is often used in conjunction with the <switch> element.
...And 26 more matches
Building Trees - Archive of obsolete content
however, since templates are often used with trees—especially with large amounts of data—the template system supports a special b
uilder just for creating trees.
... rather than generate content for every row in the tree, the results are stored in a list inside the b
uilder.
... as a result, the b
uilder only has a few pieces of information to keep track of.
...And 23 more matches
Simple Sunbird build
b
uilding sunbird is no longer supported.
... you can give it a try, but its likely that the b
uild system will present you an error.
... instead it is suggested to b
uild thunderbird with lightning.
...And 22 more matches
menuitem - Archive of obsolete content
attributes acceltext, accesskey, allowevents, autocheck, checked, closemenu, command, crop, description, disabled, image, key, label, name, selected, tabindex, type, validate, value properties accessibletype, accesskey, command, control, crop, disabled, image, label, labelelement, parentcontainer, selected, tabindex, value style classes men
uitem-iconic, men
uitem-non-iconic examples <menulist> <menupopup> <men
uitem label="option 1" value="1"/> <men
uitem label="option 2" value="2"/> <men
uitem label="option 3" value="3"/> <men
uitem label="option 4" value="4"/> </menupopup> </menulist> attributes acceltext type: string text that appears beside the menu label to indicate the shortcut key ...
... note: if the checked attribute is set to true, and you persist its value via the persist attribute, mozilla will fail to persist its value when the men
uitem is unchecked because of bug 15232.
...do men
uitem.setattribute("checked", "false") instead of men
uitem.removeattribute("checked")) when the user unchecks the men
uitem, as a value of false will both correctly hide the checkmark and persist its hidden state.
...And 20 more matches
Tamarin Tracing Build Documentation - Archive of obsolete content
tamarin source versions the following instructions are for obtaining and b
uilding the tamarin tracing source code.
... for instructions on tamarin central, please see tamarin b
uild documentation supported platforms operating system processor status windows xp x86 supported, acceptance and performance tests automated in b
uildbot mac os x 10.4 x86 supported, acceptance and performance tests automated in b
uildbot linux - ubuntu 8.0.4 x86 supported, acceptance and performance tests automated in b
uildbot windows mobile (pocket pc 5.0) armv4t supported, acceptance and performance tests automated in b
uildbot raw image (no os) armv5 supported, acceptance and performance tests not done linux (nokia n810) armv5 supported, acceptance and performance tests not done current b
uild status the current tamarin tracing b
uild status can be found at tamarin tracing b
uild status getting the tamarin source the ...
...use the following command to create a copy of the tamarin repository: $ hg clone http://hg.mozilla.org/tamarin-tracing tamarin-tracing b
uilding tamarin b
uilding tamarin will create all the libraries for the avmplus and garbage collector (mmgc), and create a standalone executable, avmshell, for executing files in the abc file format.
...And 20 more matches
Index - Developer guides
found 43 pages: # page tags and summary 1 developer g
uides api, g
uide, landing, web these articles provide how-to information to help make use of specific web technologies and apis.
... 4 getting started ajax, api, advanced, javascript, webmechanics, xmlhttprequest this article g
uides you through the ajax basics and gives you some simple hands-on examples to get you started.
... 6 audio and video delivery audio, g
uide, html, html5, media, video whether we are dealing with pre-recorded audio files or live streams, the mechanism for making them available through the browser's <audio> and <video> elements remains pretty much the same.
...And 19 more matches
Web audio codec guide - Web media technologies
in this article, we look at audio codecs used on the web to compress and decompress audio, what their capabilities and use cases are, and offer g
uidance when choosing audio codecs to use for your content.
... codec name (short) full codec name container support aac advanced audio coding mp4, adts, 3gp alac apple lossless audio codec mp4, q
uicktime (mov) amr adaptive multi-rate 3gp flac free lossless audio codec mp4, ogg, flac g.711 pulse code modulation (pcm) of voice frequencies rtp / webrtc g.722 7 khz audio coding within 64 kbps (for telephony/voip) rtp / webrtc mp3 mpeg-1 audio layer iii mp4, adts, mpeg1, 3gp opus opus webm, mp4, ogg ...
... generally speaking, the most common reasons to choose lossless audio are because you req
uire archival-quality storage, or because the audio samples will be remixed and recompressed, and you wish to avoid the amplification of artifacts in the audio due to recompression.
...And 19 more matches
XUL accessibility guidelines - Archive of obsolete content
introduction welcome to the xul accessibility g
uidelines.
...accessibility is not difficult, but does req
uire a basic understanding of the different types of disabilities, commonly used assistive technologies, and special accessibility features b
uilt into the xul languages.
... most of all, accessibility req
uires a conscious effort on your part, and a desire to include everyone.
...And 18 more matches
Building NSS
introduction this page has detailed information on how to b
uild nss.
... because nss is a cross-platform library that b
uilds on many different platforms and has many options, it may be complex to b
uild.
... please read these instructions carefully before attempting to b
uild.
...And 18 more matches
Mozilla internal string guide
this g
uide documents the string classes which are visible to code within the mozilla codebase (code which is linked into libxul).
...every 16-bit class has an eq
uivalent 8-bit class: naming convention for wide and narrow string classes wide narrow nsastring nsacstring nsstring nscstring nsautostring nsautocstring etc...
... the string classes disting
uish, as part of the type hierarchy, between strings that must have a null-terminator at the end of their buffer (ns[c]string) and strings that are not req
uired to have a null-terminator (nsa[c]string).
...And 18 more matches
HTML attribute: required - HTML: Hypertext Markup Language
the boolean req
uired attribute which, if present, indicates that the user must specify a value for the input before the owning form can be submitted.
... the req
uired attribute is supported by text, search, url, tel, email, password, date, month, week, time, datetime-local, number, checkbox, radio, file, <input> types along with the <select> and <textarea> form control elements.
... if present on any of these input types and elements, the :req
uired pseudo class will match.
...And 18 more matches
ui/button/toggle - Archive of obsolete content
usage creating buttons to create a button you must give it an id, an icon, and a label: var { togglebutton } = req
uire("sdk/
ui/button/toggle"); var button = togglebutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onchange: function(state) { console.log(state.label + " checked state: " + state.checked); } }); by default, the button appears in the firefox toolbar: however, users can move it to the firefox menu...
...by default the badge's color is red, but you can set your own color using the badgecolor property, specified as a css <color> value: var { togglebutton } = req
uire("sdk/
ui/button/toggle"); var button = togglebutton({ id: "my-button1", label: "my button1", icon: "./icon-16.png", onchange: changed, badge: 0, badgecolor: "#00aaaa" }); function changed(state) { button.badge = state.badge + 1; if (state.checked) { button.badgecolor = "#aa00aa"; } else { button.badgecolor = "#00aaaa"; } } specifying multiple icons you can specify just one icon, or multiple icons in di...
...you can also add, or change, the listener afterwards: var { togglebutton } = req
uire("sdk/
ui/button/toggle"); var button = togglebutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: firstclick, onchange: firstchange }); function firstclick(state) { console.log("you clicked '" + state.label + "'"); button.removelistener("click", firstclick); button.on("click", subsequent...
...And 17 more matches
Tamarin Build System Documentation - Archive of obsolete content
where can i see the b
uild system status?
... the waterfall page is located at http://tamarin-b
uilds.mozilla.org/tamarin-redux/waterfall what b
uilds are displayed on the b
uild system status page?
... tamarin-redux mercurial b
uilds are displayed in the top 3 sections: compile, smoke, test sandbox b
uilds are displayed in next 3 sections: sandbox compile, sandbox smoke, sandbox test tamarin-central is considered a "sandbox" and will appear under sandbox phase what are the b
uild phases?
...And 17 more matches
NSS sources building testing
getting the source code of network security services (nss), how to b
uild it, and how to run its test s
uite.
... getting source code, and a q
uick overview the easiest way is to download archives of nss releases from mozilla's download server.
...the subdirectories dbm, security/dbm, security/coreconf, security/nss were part of the nss sources.) the nss directory contains the following important subdirectories: nss/coreconf contains knowledge for cross platform b
uilding.
...And 16 more matches
TLS Cipher Suite Discovery
instead, tls allows only certain well-defined combinations of those choices, known as cipher s
uites, defined in the ietf rfc standards.
... each cipher s
uite is represented by a 16-bit number.
... the number of well-defined cipher s
uites grows with time, and no tls implementation offers all known cipher s
uites at all times.
...And 16 more matches
UIEvent - Web APIs
the
uievent interface represents simple user interface events.
...
uievent derives from event.
... although the
uievent.init
uievent() method is kept for backward compatibility, you should create a
uievent object using the
uievent() constructor.
...And 16 more matches
Mozilla DOM Hacking Guide
seriously hacking on it req
uires excellent knowledge of c++ and xpcom, mozilla's own component model.
...since i am myself still learning how it works, don't expect this to be a complete reference q
uite yet.
...if you don't know xpcom yet, and would like to be able to read this document q
uickly, you can read the introduction to xpcom for the dom.
...And 15 more matches
XUL Migration Guide - Archive of obsolete content
this g
uide aims to help you migrate a xul-based add-on to the sdk.
... there's much more information on content scripts in the working with content scripts g
uide.
... using the supported apis the sdk provides a set of high level apis providing some basic user interface components and functionality commonly req
uired by add-ons.
...And 14 more matches
ui/button/action - Archive of obsolete content
usage creating buttons to create a button you must give it an id, an icon, and a label: var { actionbutton } = req
uire("sdk/
ui/button/action"); var button = actionbutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: function(state) { console.log("button '" + state.label + "' was clicked"); } }); by default, the button appears in the firefox toolbar: however, users can move it to the firefox menu panel using the toolbar customization feature: badged buttons new in firefox 36.
...by default the badge's color is red, but you can set your own color using the badgecolor property, specified as a css <color> value: var { togglebutton } = req
uire("sdk/
ui/button/toggle"); var button = togglebutton({ id: "my-button1", label: "my button1", icon: "./icon-16.png", onchange: changed, badge: 0, badgecolor: "#00aaaa" }); function changed(state) { button.badge = state.badge + 1; if (state.checked) { button.badgecolor = "#aa00aa"; } else { button.badgecolor = "#00aaaa"; } } specifying multiple icons you can specify just one icon, or multiple icons in different sizes.
...you can also add, or change, the listener afterwards: var { actionbutton } = req
uire("sdk/
ui/button/action"); var button = actionbutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: firstclick }); function firstclick(state) { console.log("you clicked '" + state.label + "'"); button.removelistener("click", firstclick); button.on("click", subsequentclicks); } function subseq...
...And 14 more matches
Building XULRunner with Python - Archive of obsolete content
this page describes how to b
uild and use xulrunner with the python extension on windows and while generally useful it is written based on experiences with accessibility projects.
...this gives access to python features and modules and b
uilds on mark hammond's pyxpcom work from active state.
... currently (mar 07) python is not enabled by default so a custom b
uild of mozilla is needed.
...And 14 more matches
nsIJumpListBuilder
widget/public/nsijumplistb
uilder.idlscriptable please add a summary to this article.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) jump lists are b
uilt and then applied.
...callers should begin the creation of a new jump list using initlistb
uild(), add sub lists using addlisttob
uild(), then commit the jump list using commitlistb
uild().
...And 14 more matches
ui/frame - Archive of obsolete content
="city" id="city-selector"></select> <span id="time" class="info-element"></span> <span id="weather" class="info-element"></span> <script type="text/javascript" src="city-info.js"></script> </body> </html> if we save this document as "city-info.html" under the add-on's "data" directory, we can create a frame hosting it and add the frame to a toolbar like this: var { frame } = req
uire("sdk/
ui/frame"); var { toolbar } = req
uire("sdk/
ui/toolbar"); var frame = new frame({ url: "./city-info.html" }); var toolbar = toolbar({ name: "city-info", title: "city info", items: [frame] }); the toolbar is positioned between the address bar and the content window.
... var { frame } = req
uire("sdk/
ui/frame"); var { toolbar } = req
uire("sdk/
ui/toolbar"); var frame = new frame({ url: "./city-info.html", onmessage: (e) => { console.log("new city: " + e.data); } }); var toolbar = toolbar({ name: "city-info", title: "city info", items: [frame] }); from add-on to all frames to send a message from the add-on code to all frames, attached to all open browser windows, you...
...you can specify the frame's url property as the targetorigin: frame.postmessage(message, frame.url); this add-on listens for a frame script to send the "city changed" message above, and in response, updates all frames across all browser windows with that city's current weather (it just reads this from a dictionary, where in a real case it might ask a web service): var { frame } = req
uire("sdk/
ui/frame"); var { toolbar } = req
uire("sdk/
ui/toolbar"); var weather = { "london" : "rainy", "toronto" : "snowy", "san francisco" : "foggy" } var frame = new frame({ url: "./city-info.html", onmessage: (e) => { updateweather(e.data); } }); var toolbar = toolbar({ name: "city-info", title: "city info", items: [frame] }); function updateweather(location) { frame.p...
...And 13 more matches
Archived Mozilla and build documentation - Archive of obsolete content
these articles are archived, obsolete documents about mozilla, gecko, and the process of b
uilding mozilla projects.
... automated testing tips and tricks automatic mozilla configurator ankh8 automatically handle failed asserts in debug b
uilds as of 2004-12-8, it is now possible to automatically handle failed asserts in debug b
uilds of mozilla for windows.
... b
uilding transformiix standalone calicalendarview an object implementing calicalendarview is generally intended to serve as a way of manipulating a set of dom nodes corresonding to a visual representation of calievent and calitodo objects.
...And 13 more matches
Downloading Nightly or Trunk Builds - Archive of obsolete content
so to figure out how to download a cutting edge or bleeding edge or 'beta' version of firefox, you need to look for a "b
uild" (which is developer-speak for the packaged files you can download) of 1.9.1 (the number of the underlying 'platform' called 'gecko' or 'mozilla' that firefox uses).
... so, if you are looking for the cutting edge firefox, you probably want a mozilla branch nightly b
uild, that is, look for a mozilla thing (not a firefox thing), not the breaky one on trunk, but the most recent branch, and b
uilt very fresh (last night!), so you can install it.
... trunk b
uild.
...And 12 more matches
Building accessible custom components in XUL - Archive of obsolete content
assistive technologies could only see the generic html markup used to b
uild the control; they had no way of knowing that a particular collection of div and span elements should be treated as a single cohesive control (such as a tab bar or a treeview).
... by implementing dhtml accessibility techniques, web developers can declare that generic html elements are really acting as specific g
ui controls (such as a treeitem within a treeview).
...however, it is less well-known that the same dhtml accessibility techniques can be applied to xul, mozilla's xml markup language for b
uilding user interfaces.
...And 12 more matches
JSAPI User Guide
hello world using the spidermonkey library to b
uild spidermonkey from source, see spidermonkey b
uild documentation.
... some systems (such as debian) provide spidermonkey as a preb
uilt package.
... b
uild it from source instead.
...And 12 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
fl
uid grids the best place to start is with fl
uid measurements for our application layout — essentially, this means using a combination of percentages and ems/rems to size your containers and text, not fixed widths such as pixels.
... the markup is very simple: <x-deck selected-index="0"> <x-card> … </x-card> <x-card> … </x-card> <x-card> … </x-card> </x-deck> note: these weird x- elements may be unfamiliar; they are part of brick, mozilla's
ui element library for mobile web apps.
...this is just a simple grid example, but you can apply this principle to more complex grid layouts as req
uired.
...And 12 more matches
NSS API Guidelines
nss api g
uidelines newsgroup: mozilla.dev.tech.crypto introduction this document describes how the nss code is organized, the libraries that get b
uilt from the nss sources, and g
uidelines for writing nss code.
... these g
uidelines will familiarize you with some of the ways things can be done in the nss code.
... some of the g
uidelines in this document, are more forward-looking than documentary.
...And 11 more matches
Generating GUIDs
g
uids are used in mozilla programming for identifying several types of entities, including xpcom interfaces (this type of g
uids is callled iid), components (cid), and legacy add-ons—like extensions and themes—that were created prior to firefox 1.5.
... warning: if you just want an id for your add-on, generating a g
uid is almost definitely not what you want to do.
... canonical form the common form of a g
uid is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, where each x stands for a hexadecimal digit.
...And 11 more matches
XPCOM array guide
this g
uide describes the available arrays as well as the enumerator classes that can be used to get to them.
... b
uilt in buffer?
... array g
uidelines here are a few simple rules which will keep your code clean and your developers happy: use typesafe arrays like nscomarray<t> nstarray<t> wherever possible.
...And 11 more matches
Mailnews and Mail code review requirements
mailnews and mail review rules patches affecting thunderbird user experience or interfaces note: it is recommended that when working on bugs that affect user experience or interfaces, that
ui-review is obtained at an early stage in the patch development process.
... getting early
ui-reviews this reduces the chance that work is rejected due to needing further user experience changes, and hence is aimed at saving time for the developer and reviewers.
... all patches that affect user experience or interfaces on thunderbird should have
ui-review on those patches in addition to the reviews req
uired below.
...And 11 more matches
Building Mozilla XForms - Archive of obsolete content
getting started things to know first: the xforms extension has a dependency on the schema-validation extension, so you need to b
uild both (that's done automatically) mozilla switched from cvs to mercurial starting with firefox 3.5.
... before you can start b
uilding the xforms extension, you should check your mozilla b
uild environment by doing a regular firefox b
uild.
... have a look at the b
uild instructions for detailed information for your platform.
...And 10 more matches
Android-specific test suites
there are several android-specific test s
uites that run on the firefox for android codebase: android-test ensures that the code passes unit tests.
... all of these s
uites req
uire a functioning b
uild of firefox for android — either a full b
uild or an artifact b
uild.
... all of the s
uites are configured by and invoked using gradle.
...And 10 more matches
NSPR build instructions
prereq
uisites on windows, the nspr b
uild system needs gnu make and a unix command-line utility s
uite such as mks toolkit, cygwin, and msys.
... the easiest way to get these tools is to install the mozillab
uild package.
... b
uilding nspr consists of three steps: run the configure script.
...And 10 more matches
Adding captions and subtitles to HTML5 video - Developer guides
in other articles we looked at how to b
uild a cross browser video player using the htmlmediaelement and window.fullscreen apis, and also at how to style the player.
... in addition to adding the <track> elements, we have also added a new button to control the subtitles menu that we will b
uild.
... browsers do vary as to what they support, so we will be attempting to bring a more unified
ui to each browser where possible.
...And 10 more matches
ui/toolbar - Archive of obsolete content
unlike a panel, a toolbar: does not overlap with any web content is persistent, remaining visible until the user chooses to close it is a fixed size, and appears in a fixed location usage creating and destroying toolbars you don't specify toolbar content directly: instead, you create other
ui components and supply them to the toolbar constructor.
... you can supply three sorts of
ui components: action buttons toggle buttons frames this add-on b
uilds part of the user interface for a music player using action buttons for the controls and a frame to display art and the currently playing song: var { actionbutton } = req
uire('sdk/
ui/button/action'); var { toolbar } = req
uire("sdk/
ui/toolbar"); var { frame } = req
uire("sdk/
ui/frame"); var previous = actionbutton({ id: "previous", label: "previous", icon: "./icons/previous.png" }); var next = actionbutton({ id: "next", label: "next", icon: "./icons/next.png" }); var play = actionbutton({ id: "play", label: "play", icon: "./icons/play.png" }); var frame = new frame({ url: "./frame-player.html" }); var toolbar = toolbar({ title: "player", items: [previous, ne...
...toolbars get a close button at the right-hand side, and users can show or hide the toolbar using the firefox "view/toolbars" menu, alongside b
uilt-in toolbars like the bookmarks toolbar.
...And 9 more matches
Building Menus With Templates - Archive of obsolete content
here is an example using an xml source: <button type="menu" datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"/> <action> <menupopup> <men
uitem uri="?" label="?name"/> </menupopup> </action> </template> </button> <button label="children" oncommand="alert(this.previoussibling.childnodes.length);"/> in this example, the datasources attribute has been placed on a menu-type button.
...the uri attribute has not been placed on the menupopup element which is the direct child of the action element but has instead been placed on the men
uitem element.
...the men
uitem elements however will be repeated for each result from the query.
...And 9 more matches
Developer guide
there are lots of ways to contribute to the mozilla project: coding, testing, improving the b
uild process and tools, or contributing to the documentation.
... this g
uide provides information that will not only help you get started as a mozilla contributor, but that you'll find useful to refer to even if you are already an experienced contributor.
... documentation topics getting started a step-by-step beginner's g
uide to getting involved with mozilla.
...And 9 more matches
How to build a binary XPCOM component using Visual Studio
this is a simple tutorial for b
uilding xpcom objects in c++ using visual studio.
... development setup the simplest way to get an xpcom component b
uilt is to use the gecko sdk.
... on windows, the sdk is b
uilt using a microsoft compiler, so you need to use one too.
...And 9 more matches
UInt64
as javascript doesn't currently include standard support for 64-bit integer values, js-ctypes offers the int64 and
uint64 objects to let you work with c functions and data that need (or may need) to use data represented using a 64-bit data type.
... you use the
uint64 object to create and manipulate 64-bit unsigned integers.
... note: it's important to note that the 64-bit integer objects created by
uint64 are not
uint64 objects; rather, they're opaque objects whose values you manipulate through the other methods on the
uint64 object.
...And 9 more matches
Firefox addons developer guide - Archive of obsolete content
there should be some introductory text on the table of contents page at https://developer.mozilla.org/en/firefox_addons_developer_g
uide obviously there are a number of fixme items in the content that need dealing with, but those are already known.
... these should use the previous, next, and prevnext templates to add q
uick routes to get from chapter to chapter.
... each chapter should be tagged appropriately, based on content, and every chapter should include the tag "firefox addons developer g
uide".
...And 8 more matches
Build your own function - Learn web development
previous overview: b
uilding blocks next with most of the essential theory dealt with in the previous article, this article provides practical experience.
... here you will get some practice b
uilding your own, custom function.
... prereq
uisites: basic computer literacy, a basic understanding of html and css, javascript first steps, functions — reusable blocks of code.
...And 8 more matches
Media type and format guide: image, audio, and video content - Web media technologies
this g
uide provides an overview of the media file types, codecs, and algorithms that may comprise media used on the web.
... references images image file type and format g
uide covers support of image file types and content formats across the major web browsers, as well as providing basic information about each type: benefits, limitations, and use cases of interest to web designers and developers.
... image file types for web designers fundamental information about the various image file types that may be useful for web designers, including best practices and use cases for each type, and g
uidelines for choosing the right image file format for specific types of content.
...And 8 more matches
XUL Coding Style Guidelines - Archive of obsolete content
it could contain xul specific element types for
ui controls, html4 markups for content data, and even javascript for user event handling.
... to make xul files easy to read and maintain, localization friendly, and portable across user agents, we need to have a set of coding style g
uidelines to ensure our objectives are achievable.
... the author has collected a set of g
uidelines from various sources listed in the references section.
...And 7 more matches
Building XULRunner - Archive of obsolete content
xulrunner is b
uilt using basically the same process as firefox or other applications.
... please read and follow the general b
uild documentation for instructions on how to get sources and set up b
uild prereq
uisites.
... by default, xulrunner is b
uilt with javaxpcom support; the b
uild system must be able to find an appropriate jdk on the system; see the instructions on b
uilding javaxpcom for more details.
...And 7 more matches
Building a Theme - Archive of obsolete content
introduction this tutorial will take you through the steps req
uired to b
uild a very basic theme - one which updates the background color of the toolbars in firefox.
... note: this tutorial is about b
uilding themes for firefox 29 and later.
... other tutorials exist for b
uilding themes for earlier versions of firefox.
...And 7 more matches
Accessibility/LiveRegionDevGuide
this developer's g
uide lays out general g
uidelines that assistive technology (at) developers can use in developing live region support.
... this g
uide was written from an atk/at-spi point of view as part of the orca live region support project.
...sometimes the very best g
uide for some developers is the code itself.
...And 7 more matches
How to build an XPCOM component in JavaScript
you can browse existing xpcom interfaces at various locations in the mozilla source code, or using xpcomviewer, a g
ui for browsing registered interfaces and components.
... if you don't find a s
uitable pre-existing interface, then you must define your own.
...here's the xpidl definition for our helloworld component: helloworld.idl #include "nsisupports.idl" [scriptable, u
uid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)] interface nsihelloworld : nsisupports { string hello(); }; note that you must generate a new u
uid for each xpcom component that you create.
...And 7 more matches
Getting Started Guide
don't worry; the getting started g
uide is short.
... xpcom basics: ownership and reference counting this is a q
uick refresher on some fundamental issues of xpcom.
...clients are expected to keep this reference count accurate by incrementing it when they acq
uire a reference to the interface, and decrementing it before they let go.
...And 7 more matches
Audio and Video Delivery - Developer guides
you can find compatibility information in the g
uide to media types and formats on the web.
...it's strongly recommended that you read the autoplay g
uide for media and web audio apis to learn how to use autoplay wisely..
... a q
uick example — first set up your audio and custom controls in html: <audio id="my-audio" src="http://jplayer.org/audio/mp3/miaow-01-tempered-song.mp3"></audio> <button id="my-control">play</button> add a bit of javascript to detect events to play and pause the audio: window.onload = function() { var myaudio = document.getelementbyid('my-audio'); var mycontrol = document.getelementbyid(...
...And 7 more matches
Building Hierarchical Trees - Archive of obsolete content
this works just like with recursive generation using the content b
uilder.
... each level of the tree is created using a successive iteration of the template b
uild process.
... if the items are containers, the tree b
uilder will mark the right rows as containers, so that they can be opened and closed with the small icon twisties on the left of the column.
...And 6 more matches
NSPR Contributor Guide
nspr wishes to document some g
uidelines for those who would contribute to nspr.
... these g
uidelines should help the contributor in crafting his contribution, increasing its likelihood for acceptance.
... general g
uidelines downward compatibility because many different applications, besides the mozilla client, use the nspr api, the api must remain downward compatible across even major releases.
...And 6 more matches
Build instructions for JSS 4.3.x
b
uild instructions for jss 4.3.x newsgroup: mozilla.dev.tech.crypto before b
uilding jss, you need to set up your system as follows: b
uild nspr/nss by following the nspr/nss b
uild instructions, to check that nss b
uilt correctly, run all.sh (in mozilla/security/nss/tests) and examine the results (in mozilla/test_results/security/computername.#/results.html.
... now you are ready to b
uild jss.
... unix setenv java_home /usr/local/jdk1.5.0 (or wherever your jdk is installed) windows set java_home=c:\programs\jdk1.5.0 (or wherever your jdk is installed) windows (cygnus) java_home=/cygdrive/c/programs/jdk1.5.0 (or wherever your jdk is installed) export java_home windows b
uild configurations winnt vs win95 as of nss 3.15.4, nspr/nss/jss b
uild generates a "win95" configuration by default on windows.
...And 6 more matches
Video player styling basics - Developer guides
in the previous cross browser video player article we described how to b
uild a cross-browser html5 video player using the media and fullscreen apis.
...:#666; } the video controls container itself also needs some styling so that it is set up the correct way: .controls { width:100%; height:8.0971659919028340080971659919028%; /* of figure's height */ position:relative; } the height of the .controls class is set to be (a very precise!) percentage of the enclosing <figure> element (this was worked out with experimentation based on the req
uired button height).
... its position is also specifically set to relative, which is req
uired for its responsiveness (more on that later).
...And 6 more matches
Quirks Mode and Standards Mode - HTML: Hypertext Markup Language
there are now three modes used by the layout engines in web browsers: q
uirks mode, almost standards mode, and full standards mode.
... in q
uirks mode, layout emulates nonstandard behavior in navigator 4 and internet explorer 5.
... this is essential in order to support websites that were b
uilt before the widespread adoption of web standards.
...And 6 more matches
ui/sidebar - Archive of obsolete content
you specify its content using html, css, and javascript, and the user can show or hide it in the same way they can show or hide the b
uilt-in sidebars.
...unlike modules such as panel, the content must be local, typically loaded from the add-on's data directory via a url constructed using self.data.url(): var sidebar = req
uire("sdk/
ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar', url: req
uire("sdk/self").data.url("sidebar.html") }); from firefox 34, you can use "./sidebar.html" as an alias for self.data.url("sidebar.html").
... so you can rewrite the above code like this: var sidebar = req
uire("sdk/
ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar', url: "./sidebar.html" }); you can include javascript and css from the html as you would with any web page, for example using <script> and <link> tags containing a path relative to the html file itself.
...And 5 more matches
Building Firefox with Rust code - Archive of obsolete content
please instead refer to the documentation found within the modern firefox b
uild system documentation; specifically, the section called including rust code in firefox.
...this page is a rough g
uide for people using rust in firefox.
... adding rust code we generally target stable rust, but sometimes issues temporarily req
uire a beta or custom toolchain b
uild.
...And 5 more matches
Proxy UI - Archive of obsolete content
camino configured in os (networking preferences) (recently added - some support for reading os and account settings.)
ui elements preferences panel overview the
ui is based on selecting a proxy mode, then filling out any additional needed information in "related"
ui.
...the preference changes selecting the proxy "mode" all product's proxy preference panels share a basic design: a radio button that selects the proxy mode, then "related proxy mode"
ui when needed.
... for the purposes of this document, "proxy mode" means both: whatever was selected in the
ui (as opposed to the value of the network.proxy.type.
...And 5 more matches
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
summary: when in q
uirks mode, gecko-based browsers will appear to ignore inheritance of font styles into tables from parent elements.
... find out why this happens and how to fix it in documents that have to remain in q
uirks mode.
...this represented a violation of css inheritance rules, and led many authors to create workarounds such as: <style type="text/css"> body, table, td {font-size: 11px;} </style> recreating legacy behavior to avoid "breaking" older pages that were authored with old-browser behaviors in mind, mozilla and related browsers will mimic old browsers when in "q
uirks" mode.
...And 5 more matches
The Firefox codebase: CSS Guidelines
this document contains g
uidelines defining how css inside the firefox codebase should be written, it is notably relevant for firefox front-end engineers.
...most of the time, the common component already follows the a11y/theme standards defined in this g
uide.
... the rtl-aware eq
uivalents of border-{top/bottom}-{left/right}-radius are border-{start/end}-{start/end}-radius when there is no special rtl-aware property available, use the pseudo :-moz-locale-dir(ltr|rtl) (for xul files) or :dir(ltr|rtl) (for html files).
...And 5 more matches
SVG Guidelines
this isn't to say that svg images are always slower than raster eq
uivalents.
... in fact it can be faster to send vector information from an svg to a user's gpu than it is to extract raster data from an eq
uivalent raster image.
... and even when an svg image is slower than a raster eq
uivalent, the difference is usually not noticable.
...And 5 more matches
XPCOM guide
these articles provide tutorials and usage documentation for xpcom, including how to use it in your own projects and how to b
uild xpcom components for your firefox add-ons and the like.
...this document attempts to help them do so, first by explaining the underlying concepts, and second by describing a number of common javascript patterns that cause leaks.creating xpcom componentsthis g
uide is about gecko, and about creating xpcom components for gecko-based applications.how to b
uild an xpcom component in javascriptif you are looking for add-on sdk solution for xpcom javascript components then check out platform/xpcom module first.inheriting from implementation classesgiven that idl interfaces map to abstract classes in c++, a common problem when dealing with idl is when you have a...
...however, it may be useful for c++ code in the mozilla platform to run tasks on another thread.mozilla internal string g
uidemost of the mozilla code uses a c++ class hierarchy to pass string data, rather than using raw pointers.
...And 5 more matches
Xptcall Porting Guide
lect/xptcall +--public // exported headers +--src // core source | \--md // platform specific parts | +--mac // mac ppc | +--unix // all unix | \--win32 // win32 | +--test // simple tests to get started \--tests // full tests via api porters are free to create subdirectories under the base md directory for their given platforms and to integrate into the b
uild system as appropriate for their platform.
...the invoke functionality req
uires the implementation of the following on each platform (from xptcall/public/xptcall.h): xptc_public_api(nsresult) ns_invokebyindex(nsisupports* that, pr
uint32 methodindex, pr
uint32 paramcount, nsxptcvariant* params); calling code is expected to supply an array of nsxptcvariant structs.
...the platform specific code then b
uilds a call frame and invokes the method indicated by the index methodindex on the xpcom interface that.
...And 5 more matches
Understanding the Web Content Accessibility Guidelines - Accessibility
this set of articles provides q
uick explanations to help you understand the steps that need to be taken to conform to the recommendations outlined in the w3c web content accessibility g
uidelines 2.0 or 2.1 (or just wcag, for the purposes of this writing).
... the wcag 2.0 and 2.1 provide a detailed set of g
uidelines for making web content more accessible to people with a wide variety of disabilities.
... it is comprehensive but incredibly detailed, and q
uite difficult to gain a rapid understanding of.
...And 5 more matches
:required - CSS: Cascading Style Sheets
the :req
uired css pseudo-class represents any <input>, <select>, or <textarea> element that has the req
uired attribute set on it.
... /* selects any req
uired <input> */ input:req
uired { border: 1px dashed red; } this pseudo-class is useful for highlighting fields that must have valid data before a form can be submitted.
... syntax :req
uired examples see :invalid for an example.
...And 5 more matches
Creating a cross-browser video player - Developer guides
the player controls themselves won't be styled beyond the basics req
uired to get them working; full styling of the player will be taken care of in a future article.
... once again the html is q
uite straightforward, using an unordered list with list-style-type:none set to enclose the controls, each of which is a list item with float:left.
... setup before dealing with the individual buttons, a number of initialisation calls are req
uired.
...And 5 more matches
externalResourcesRequired - SVG: Scalable Vector Graphics
the externalresourcesreq
uired attribute specifies whether referenced resources that are not part of the current document are req
uired for proper rendering of the given container or graphics element.
...in particular, if an element sets externalresourcesreq
uired="true", then all style sheets must be available since any style sheet might affect the rendering of that element.
... the externalresourcesreq
uired attribute is not inheritable (from a sense of attribute value inheritance), but if set on a container element, its value will apply to all elements within the container.
...And 5 more matches
Guides - Archive of obsolete content
contributor's g
uide getting started learn how to contribute to the sdk: getting the code, opening/taking a bug, filing a patch, getting reviews, and getting help.
... modules learn about the module system used by the sdk (which is based on the commonjs specification), how sandboxes and compartments can be used to improve security, and about the b
uilt-in sdk module loader, known as cuddlefish.
... testing the add-on sdk learn how to run the add-on sdk test s
uites.
...And 4 more matches
Building TransforMiiX standalone - Archive of obsolete content
we support b
uilding a standalone version of transformiix on windows, unix and os x.
... read the b
uild instructions for your platform to get the req
uirements, which are the same as for mozilla.
...add tx_exe=1 mk_add_options b
uild_modules="xpcom transformiix" ac_add_options --enable-standalone-modules="xpcom transformiix" to your .mozconfig, and use client.mk to pull as usual.
...And 4 more matches
Building up a basic demo with A-Frame - Game development
mozilla's a-frame framework provides a markup language allowing us to b
uild 3d vr landscapes using a system familiar to web developers, which follows game development coding principles; this is useful for q
uickly and successfully b
uilding prototypes and demos, without having to write a lot of javascript or glsl.
... this article explains how to get up and running with a-frame, and how to use it to b
uild up a simple demo.
... a-frame is b
uilt on top of webgl, and provides pre b
uilt components to use in applications — models, video players, skyboxes, geometries, controls, animations, cursors, etc.
...And 4 more matches
Self-hosted builtins in SpiderMonkey
since firefox 17, spidermonkey has the ability to self-host b
uilt-in functions in javascript.
... self-hosted functions by default are not constructors and do not have a prototype property, so that they meet the req
uirements for standard b
uilt-in functions as described in the ecmascript language specification 5.1, clause 15.
... otoh, self-hosted code doesn't have access to most of the c++-implemented b
uiltins.
...And 4 more matches
JS::ToUint32
syntax bool js::to
uint32(jscontext *cx, js::handlevalue v, int32_t *out); name type description cx jscontext * the context in which to perform the conversion.
... req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
...And 4 more matches
Detailed XPCOM hashtable guide
this is the long version of xpcom hashtable g
uide.
... inserting/removing: o(n): adding and removing items from a large array can be time-consuming o(1): adding and removing items from hashtables is a q
uick operation wasted space: none: arrays are packed structures, so there is no wasted space.
... nsdatahashtable/nsinterfacehashtable/nsclasshashtable - high-level c++ wrappers around pldhash; simplifies the common usage pattern mapping a simple keytype to a simple datatype; client does not need to declare or manage an entry class; nsdatahashtable datatype is a scalar such as pr
uint32; nsinterfacehashtable datatype is an interface; nsclasshashtable datatype is a class pointer owned by the hashtable.
...And 4 more matches
nsIUUIDGenerator
xpcom/base/nsiu
uidgenerator.idlscriptable this interface can be used to generate an id that can be considered globally unique, often referred to as a u
uid or g
uid.
... 1.0 66 introduced gecko 1.8.1 inherits from: nsisupports last changed in gecko 1.8.1 (firefox 2 / thunderbird 2 / seamonkey 1.1) implemented by @mozilla.org/u
uid-generator; as a service: var u
uidgenerator = components.classes["@mozilla.org/u
uid-generator;1"] .getservice(components.interfaces.nsiu
uidgenerator); method overview nsidptr generateu
uid(); void generateu
uidinplace(in nsnonconstidptr id); native code only!
... methods generateu
uid() obtains a new u
uid using appropriate platform-specific methods to obtain a nsid that can be considered to be globally unique.
...And 4 more matches
BlobBuilder - Web APIs
the blobb
uilder interface provides an easy way to construct blob objects.
... just create a blobb
uilder and append chunks of data to it by calling the append() method.
... when you're done b
uilding your blob, call getblob() to retrieve a blob containing the data you sent into the blob b
uilder.
...And 4 more matches
ByteLengthQueuingStrategy - Web APIs
the bytelengthque
uingstrategy interface of the the streams api provides a b
uilt-in byte length que
uing strategy that can be used when constructing streams.
... constructor bytelengthque
uingstrategy() creates a new bytelengthque
uingstrategy object instance.
... methods bytelengthque
uingstrategy.size() returns the given chunk’s bytelength property.
...And 4 more matches
CountQueuingStrategy - Web APIs
the countque
uingstrategy interface of the the streams api provides a b
uilt-in chunk counting que
uing strategy that can be used when constructing streams.
... constructor countque
uingstrategy() creates a new countque
uingstrategy object instance.
... methods countque
uingstrategy.size() returns 1.
...And 4 more matches
WebGL2RenderingContext.uniform[1234][uif][v]() - Web APIs
the webgl2renderingcontext.uniform[1234][
uif][v]() methods of the webgl api specify values of uniform variables.
...
ui stands for unsigned integer, i for integer, f for float, and v for vector.
...eq
uivalent regex: uniform[1234](u?i|f)v?
...And 4 more matches
Cross-browser audio basics - Developer guides
this article provides: a basic g
uide to creating a cross-browser html5 audio player with all the associated attributes, properties, and events explained a g
uide to custom controls created using the media api basic audio example the code below is an example of a basic audio implementation using html5: <audio controls> <source src="audiofile.mp3" type="audio/mpeg"> <source src="audiofile.ogg" type="audio/ogg"> <!-- fallback for non supporting browsers goes here --> <p>your browser does not support html5 audio, but you can still <a href="audiofile.mp3">download the music</a>.</p> </audio> note: you can also use an mp4 file instead of mp3.
... the controls attribute on the <audio> element is specified when we req
uire the browser to provide us with default playback controls.
...see the autoplay g
uide for media and web audio apis for details.
...And 4 more matches
Creating and triggering events - Developer guides
creating custom events events can be created with the event constructor as follows: const event = new event('b
uild'); // listen for the event.
... elem.addeventlistener('b
uild', function (e) { /* ...
... for example, the event could be created as follows: const event = new customevent('b
uild', { detail: elem.dataset.time }); this will then allow you to access the additional data in the event listener: function eventhandler(e) { console.log('the time is: ' + e.detail); } the old-fashioned way the older approach to creating events uses apis inspired by java.
...And 4 more matches
HTML5 - Developer guides
it is a new version of the language html, with new elements, attributes, and behaviors, and a larger set of technologies that allows the b
uilding of more diverse and powerful web sites and applications.
... html5 reference g
uide q
uick-reference html5 sheet containing markup generators, code examples and web developer tools.
... the g
uide is downloadable for ease of use and access.
...And 4 more matches
Developer guides
events developer g
uide events refer to two things: a design pattern used for the asynchronous handling of various incidents which occur in the lifetime of a web page; and the naming, characterization, and use of a large number of incidents of different types.
... ajax ajax is a term that defines a group of technologies allowing web applications to make q
uick, incremental updates to the user interface without reloading the entire browser page.
... g
uide to web apis a list of all web apis and what they do.
...And 4 more matches
<menuitem> - HTML: Hypertext Markup Language
the html <men
uitem> element represents a command that a user is able to invoke through a popup menu.
...(if specified, the type attribute of the <menu> element must be popup; if missing, the parent element of the <menu> must itself be a <menu> in the popup menu state.) permitted aria roles none dom interface htmlmen
uitemelement attributes this element includes the global attributes; in particular title can be used to describe the command, or provide usage hints.
...req
uired when a command attribute is not present.
...And 4 more matches
Image file type and format guide - Web media technologies
in this g
uide, we'll cover the image file types generally supported by web browsers, and provide insights that will help you select the most appropriate formats to use for your site's imagery.
... .pjpeg, .pjp chrome, edge, firefox, internet explorer, opera, safari png portable network graphics image/png .png chrome, edge, firefox, internet explorer, opera, safari svg scalable vector graphics image/svg+xml .svg chrome, edge, firefox, internet explorer, opera, safari tiff tagged image file format image/tiff .tif, .tiff none b
uilt-in; add-ons req
uired webp web picture format image/webp .webp chrome, edge, firefox, opera the abbreviation for each format links to a longer description of the format, its capabilities, and detailed browser compatibility information; including which versions introduced support and specific special features that may have been introduced later.
...it's particulary useful for photographs; applying lossy compression to content req
uiring sharpness, like diagrams or charts, can produce unsatisfactory results.
...And 4 more matches
ui - Archive of obsolete content
experimental provides access to button, toolbar, and sidebar
ui objects.
...this page just provides a q
uick overview.
...you give it an icon, a label, and a click handler: var
ui = req
uire("sdk/
ui"); var action_button =
ui.actionbutton({ id: "my-button", label: "action button!", icon: "./icon.png", onclick: function(state) { console.log("you clicked '" + state.label + "'"); } }); you can make a button standalone or add it to a toolbar.
...And 3 more matches
util/uuid - Archive of obsolete content
generate or parse u
uids.
... usage it exports a single function, u
uid().
... for more details about u
uid representations and what they are used for by the platform see the mdn documentation for jsid.
...And 3 more matches
Build - Archive of obsolete content
b
uilding prism is similar to b
uilding mccoy, but there are some differences which is why a separate b
uild documentation article.
... to b
uild prism, you must first b
uild the xulrunner tree, and then b
uild prism.
... make sure you have the req
uired b
uild prereq
uisites.
...And 3 more matches
menuitem.type - Archive of obsolete content
« xul reference home type type: one of the values below can be used to create checkable men
uitems or for radio button men
uitems.
... checkbox the men
uitem is checked.
... the checked attribute determines whether the men
uitem is checked or not.
...And 3 more matches
How to Quit a XUL Application - Archive of obsolete content
script can attempt to q
uit a xul application, or force the application to q
uit, using the nsiappstartup interface.
... <script> function q
uit (aforceq
uit) { var appstartup = components.classes['@mozilla.org/toolkit/app-startup;1'].
... getservice(components.interfaces.nsiappstartup); // eattemptq
uit will try to close each xul window, but the xul window can cancel the q
uit // process if there is unsaved data.
...And 3 more matches
Building up a basic demo with the PlayCanvas engine - Game development
b
uilt for modern browsers, playcanvas is a fully-featured 3d game engine with resource loading, an entity and component system, advanced graphics manipulation, collision and physics engine (b
uilt with ammo.js), audio, and facilities to handle control inputs from various devices (including gamepads).
... that's q
uite an impressive list of features — let's see some in action.
...if you have already worked through our b
uilding up a basic demo with three.js article (or you are familiar with other 3d libraries) you'll notice that playcanvas works on similar concepts: camera, light and objects.
...And 3 more matches
QUIC - MDN Web Docs Glossary: Definitions of Web-related terms
q
uick udp internet connection, or q
uic, is an experimental multiplexed transport protocol implemented on udp.
... as tcp is b
uilt into the kernel of many operating systems being able to experiment with changes, test them and implement modifications is an extremely slow process.
... the creation of q
uic allows developers to conduct experiments and try new things faster.
...And 3 more matches
CSS building blocks - Learn web development
get started prereq
uisites before starting this module, you should have: basic familiarity with using computers, and using the web passively (i.e.
... g
uides this module contains the following articles, which cover the most essential parts of the css language.
...in this g
uide, you will learn what it is and how to manage it.
...And 3 more matches
JavaScript building blocks - Learn web development
get started prereq
uisites before starting this module, you should have some familiarity with the basics of html and css, and you should have also worked through our previous module, javascript first steps.
... g
uides making decisions in your code — conditionals in any programming language, code needs to make decisions and carry out actions accordingly depending on different inputs.
... b
uild your own function with most of the essential theory dealt with previously, this article provides a practical experience.
...And 3 more matches
IME handling guide
when there is no composition, this is
uint32_max.
...otherwise,
uint32_max.
...
ui.imerawinputbackground
ui.imerawinputforeground
ui.imerawinputunderline
ui.imeselectedrawtextbackground
ui.imeselectedrawtextforeground
ui.imeselectedrawtextunderline
ui.imeconvertedtextbackground
ui.imeconvertedtextforeground
ui.imeconvertedtextunderline
ui.imeselectedconvertedtextbackground
ui.imeselectedconvertedtextforeground
ui.imeselectedconvertedtextunderline underline style ca...
...And 3 more matches
JSObjectOps.getRequiredSlot
the jsobjectops.getreq
uiredslot and setreq
uiredslot callbacks get and set a req
uired slot—one that should already have been allocated.
... syntax typedef jsval (*jsgetreq
uiredslotop)(jscontext *cx, jsobject *obj,
uint32 slot); typedef jsbool (*jssetreq
uiredslotop)(jscontext *cx, jsobject *obj,
uint32 slot, jsval v); name type description cx jscontext * the js context in which we access the slot.
... slot
uint32 the index of the slot to access.
...And 3 more matches
Secure Development Guidelines
ontains various state information instruction pointer (eip) points to register being executed; can’t be modified directly introduction: gaining control (2) eip is modified using call or jump instructions attacks usually rely on obtaining control over the eip otherwise the attacker can try to control memory pointed to by an existing function pointer a vulnerability is req
uired to modify the eip or sensitive memory saved return addr or function pointer get altered introduction: gaining control (3) common issues used to gain control buffer overflows format string bugs integer overflows/underflows writing secure code: input validation input validation most vulnerabilities are a result of un-validated input always perform input validation ...
...le permissions should be set correctly be sure not to make world-writable files sensitive files shouldn’t be world readable file i/o: file descriptors and handles could be a race if instances of fh are shared between threads fh inheritence: default in unix, needs to be set in windows int main(int argc, char **argv, char **envp) { int fd = open("/etc/shadow", o_rdwr); setre
uid(get
uid(), get
uid()); excve("/bin/sh", argv, envp); } s
uid root applications file i/o: file descriptors and handles potential overflows when using select fd_set struct, static length, holds a bitmask of fds manipulated with fd_set, fd_isset, fd_clr and fd_zero macros fd_set’s size depends on the operating system if the os allows opening more fds, then fd_set can hold could ov...
... most file name operations suffer from these race conditions, but not when performed on file descriptors file i/o: race conditions consider the following example int main(int argc, char **argv) { char *file = argv[1]; int fd; struct stat statbuf; stat(file, &statbuf); if (s_islink(statbuf.st_mode)) { bailout(“symbolic link”); } else if (statbuf.st_
uid != get
uid) { bailout(“you don’t own the file”); } fd = open(file, o_rdwr); write(fd, argv[2], strlen(argv[2])); } file i/o: race conditions previous example contains a race condition the file may change between the call top stat() and open() this opens the possibility of writing arbitrary content to any file race conditions occur when two separate execut...
...And 3 more matches
nsIXULBuilderListener
content/xul/templates/public/nsixulb
uilderlistener.idlscriptable this object is a listener that will be notified when a template b
uilder reb
uilds its content.
... inherits from: nsisupports last changed in gecko 1.7 method overview void didreb
uild(in nsixultemplateb
uilder ab
uilder); void willreb
uild(in nsixultemplateb
uilder ab
uilder); methods didreb
uild() called after a template b
uilder has reb
uilt its content.
... void didreb
uild( in nsixultemplateb
uilder ab
uilder ); parameters ab
uilder the template b
uilder that has reb
uilt the content.
...And 3 more matches
SVGExternalResourcesRequired - Web APIs
the svgexternalresourcesreq
uired interface defines an interface which applies to all elements where this element or one of its descendants can reference an external resource.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgexternalresourcesreq
uired" target="_top"><rect x="1" y="1" width="280" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="141" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgexternalresourcesreq
uired</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} warning: this interface was removed in the svg 2 specifi...
... properties svgexternalresourcesreq
uired.externalresourcesreq
uired corresponds to the externalresourcesreq
uired attribute of the given element.
...And 3 more matches
UIEvent() - Web APIs
the
uievent() constructor creates a new
uievent.
... syntax event = new
uievent(typearg [,
uieventinit]) values typearg is a domstring representing the name of the event.
...
uieventinit optional is a
uieventinit dictionary, having the following fields: detail: optional and defaulting to 0, of type long, that is a event-dependant value associated with the event.
...And 3 more matches
UIEvent.detail - Web APIs
the
uievent.detail read-only property, when non-zero, provides the current (or next, depending on the event) click count.
... for click or dblclick events,
uievent.detail is the current click count.
... for mousedown or mouseup events,
uievent.detail is 1 plus the current click count.
...And 3 more matches
Variable fonts guide - CSS: Cascading Style Sheets
the reason for this is that most typefaces have very specific designs for bolder weights and italics that often include completely different characters (lower-case 'a' and 'g' are often q
uite different in italics, for example).
... custom axes are in fact limitless: the typeface designer can define and scope any axis they like, and are just req
uired to give it a four-letter tag to identify it within the font file format itself.
...example code follows at the end of the g
uide.
...And 3 more matches
SyntaxError: function statement requires a name - JavaScript
the javascript exception "function statement req
uires a name" occurs when there is a function statement in the code that req
uires a name.
... message syntax error: expected identifier (edge) syntaxerror: function statement req
uires a name [firefox] syntaxerror: unexpected token ( [chrome] error type syntaxerror what went wrong?
... there is a function statement in the code that req
uires a name.
...And 3 more matches
Uint16Array() constructor - JavaScript
the
uint16array() typed array constructor creates an array of 16-bit unsigned integers in the platform byte order.
... syntax new
uint16array(); // new in es2017 new
uint16array(length); new
uint16array(typedarray); new
uint16array(object); new
uint16array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... description the
uint16array() typed array constructor creates an array of 16-bit unsigned integers in the platform byte order.
...And 3 more matches
requiredExtensions - SVG: Scalable Vector Graphics
the req
uiredextensions attribute defines a list of req
uired language extensions.
... usage notes value <list-of-extensions> default value none animatable no <list-of-extensions> the value is a list of references (iri references in svg 1, url references in svg 2) which identify the req
uired extensions, with the individual values separated by white space.
... req
uiredextensions is often used in conjunction with the <switch> element.
...And 3 more matches
ui/id - Archive of obsolete content
experimental create
ui component ids.
... making an id const { identify } = req
uire('sdk/
ui/id'); const thingy = class({ initialize: function(details) { let id = identify(this); } }); getting an id const { identify } = req
uire('sdk/
ui/id'); const { thingy } = req
uire('./thingy'); let thing = thingy(/* ...
... */); let thingid = identify(thing); defining id generator const { identify } = req
uire('sdk/
ui/id'); const thingy = class(/* ...
...And 2 more matches
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
b
uilding dom trees in most cases, dom trees should be b
uilt exclusively with dom creation methods.
...(["xul:hbox", {}, ["div", {}, ["a", { href: href, key: "link", onclick: function (event) { alert(event.target.href); } }, text], ["span", { class: "stuff" }, "stuff"]]], document, nodes)); alert(nodes.link); function addentrytopopup(menupopup, doc, chromewindow) { var newitem = doc.createelement("men
uitem"); newitem.setattribute("value", "testvalue"); newitem.setattribute("label", "another popup menu item"); menupopup.appendchild(newitem); }; var jsontemplatebtn = ["xul:toolbarbutton", { id: "mytestbutton", class: "toolbarbutton-1", type: "menu", label: "test button label", tooltiptext: "test button tooltip", ...
...'html:br', {}], ['html:input', {type:'checkbox', id:'mycheck'}], ['html:label', {for:'mycheck'}, 'here is text of label, click this text will check the box' ] ] ] ]; document.body.appendchild(jsontodom(json, document, {})); jquery templating for extensions which already use jquery, it is possible to use its b
uiltin dom b
uilding functions for templating, though care must be taken when passing non-static strings to methods such as .append() and .html().
...And 2 more matches
Popup Guide - Archive of obsolete content
in this g
uide, the term 'popup' refers to all types of popups, whereas the term 'menu' refers to a specific type of popup.
...it is useful when you wish to display some controls temporarily over the existing
ui.
... tooltips when the mouse is positioned over a
ui control, a tooltip provides a small box with descriptive help about that control.
...And 2 more matches
Building up a basic demo with PlayCanvas - Game development
engine vs editor the engine itself can be used as a standard library by including its javascript file directly in your html, so you can start coding right away; in addition the playcanvas toolset comes with an online editor that you can use to drag and drop components onto the scene — a great way to create games and other apps req
uiring scenes if you're more of a designer than a coder.
... playcanvas engine b
uilt for modern browsers, playcanvas is a fully-featured 3d game engine with resource loading, an entity and component system, advanced graphics manipulation, collision and physics engine (b
uilt with ammo.js), audio, and facilities to handle control inputs from various devices (including gamepads).
... that's q
uite an impressive list of features — let's see some in action, check out the b
uilding up a basic demo with playcanvas engine for details.
...And 2 more matches
Building up a basic demo with Three.js - Game development
three.js, as with any other 3d library, provides b
uilt-in helper functions to help you implement common 3d functionality more q
uickly.
... in this article we'll take you through the real basics of using three, including setting up a development environment, structuring the necessary html, the fundamental objects of three, and how to b
uild up a basic demo.
...for the camera z position) are unitless, and can be anything you deem s
uitable for your scene: milimeters, meters, feet, or miles.
...And 2 more matches
Beginner's guide to media queries - Learn web development
prereq
uisites: html basics (study introduction to html), and an idea of how css works (study css first steps and css b
uilding blocks.) objective: to understand how to use media queries, and the most common approach for using them to create responsive designs.
...this second approach is described as mobile first responsive design and is q
uite often the best approach to follow.
... the view for the very smallest devices is q
uite often a simple single column of content, much as it appears in normal flow.
...And 2 more matches
What software do I need to build a website? - Learn web development
prereq
uisites: you should already know the difference between webpages, websites, web servers, and search engines.
...as a result, you usually only need to acq
uire software for transferring files to your web server.
... those formats are not s
uitable for writing web pages.
...And 2 more matches
Building Firefox with Debug Symbols
by default, a release b
uild of firefox will not generate debug symbols s
uitable for debugging or post-processing into the breakpad symbol format.
... use the following mozconfig settings to do a b
uild with symbols: b
uilding firefox with symbols there is a single configure option to enable b
uilding with symbols on all platforms.
... this is enabled by default so unless you have explcitly disabled it your b
uild you should include symbols.
...And 2 more matches
Firefox UI considerations for web developers
top sites the top sites box lists a user-configurable number of rows of icons serving as q
uick links to sites the user commonly visits, or that the user has chosen to pin to the top sites list in order to have q
uick access to them.
... rich icons the high resolution icons—also known as rich icons—are specified by setting the rel attribute to one of: apple-touch-icon apple-touch-icon-precomposed fl
uid-icon the size of each icon is taken from the size attribute specified on the <link>, if it's provided.
... <link rel="apple-touch-icon" sizes="128x128" href="touch-icon-128x128.png"> <link rel="apple-touch-icon" sizes="46x46" href="touch-icon-46x46.png"> <link rel="apple-touch-icon" sizes="256x256" href="touch-icon-256x256.png"> <link rel="icon" href="favicon.ico"> in this code, the 128x128 pixel icon will be used by firefox, as it's the smallest icon which is larger than the 96-pixel size it req
uires.
...And 2 more matches
Build Metrics
"b
uild metrics" is a catch-all term for performance measures that are generated by the firefox b
uild system and tracked by perfherder.
... b
uild times amount of time it takes to b
uild firefox in automation on a specific platform / configuration.
... compiler warnings number of compiler warnings detected during a b
uild.
...And 2 more matches
JS::ToUint16
syntax bool js::to
uint16(jscontext *cx, js::handlevalue v,
uint16_t *out); name type description cx jscontext * the context in which to perform the conversion.
... req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
...And 2 more matches
JS::ToUint64
syntax bool js::to
uint64(jscontext *cx, js::handlevalue v,
uint64_t *out); name type description cx jscontext * the context in which to perform the conversion.
... req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
...And 2 more matches
XPCOM hashtable guide
this is the simplified version of the detailed xpcom hashtable g
uide.
... inserting/removing: o(n): adding and removing items from a large array can be time-consuming o(1): adding and removing items from hashtables is a q
uick operation wasted space: none: arrays are packed structures, so there is no wasted space.
... there are a number of b
uiltin hash keys available in nshashkeys.h, the more useful of which are listed below.
...And 2 more matches
XPCOM Stream Guide
stream listeners a stream listener is an object you b
uild to let you know when there is data in a stream ready for you to consume.
... seekable streams some streams are "seekable": they let you specify where in the stream you are reading from (instead of req
uiring it be from the beginning).
... nsmimeinputstream @mozilla.org/network/mime-input-stream;1 nsimimeinputstream .setdata(stream) similarly, there are complex output streams which b
uild from primitive output streams: complex output stream types type purpose native class contract id interface how to bind to a primitive output stream buffered store data in a buffer until the buffer is full or the stream closes.
...And 2 more matches
UI Tour - Firefox Developer Tools
this article is a q
uick tour of the main sections of the page inspector's user interface.
... it covers the three top-level components of the inspector's
ui: the "select element" button the html pane the css pane this g
uide is intentionally kept as short as possible.
... it links to various how to g
uides for the details of how to work with the inspector.
...And 2 more matches
Using the aria-required attribute - Accessibility
description the aria-req
uired attribute is used to indicate that user input is req
uired on an element before a form can be submitted.
... html5 now has the req
uired attribute, but aria-req
uired is still useful for user agents that do not yet support html5.
... value true or false (default: false) possible effects on user agents and assistive technology screen readers should announce the field as req
uired.
...And 2 more matches
Live streaming web audio and video - Developer guides
usually, we req
uire different formats and special server-side software to achieve this.
...it can also be used instead of the traditional progressive download method for audio and video on demand: there are several advantages to this: latency is generally lower so media will start playing more q
uickly adaptive streaming makes for better experiences on a variety of devices media is downloaded just in time which makes bandwidth usage more efficient streaming protocols while static media is usually served over http, there are several protocols for serving adaptive streams; let's take a look at the options.
... important: although the <audio> and <video> tags are protocol agnostic, no browser currently supports anything other than http without req
uiring plugins, although this looks set to change.
...And 2 more matches
Constraint validation - Developer guides
geunderflow constraint violation date, month, week a valid date datetime, datetime-local, time a valid date and time max range, number a valid number the value must be less than or equal to the value rangeoverflow constraint violation date, month, week a valid date datetime, datetime-local, time a valid date and time req
uired text, search, url, tel, email, password, date, datetime, datetime-local, month, week, time, number, checkbox, radio, file; also on the <select> and <textarea> elements none as it is a boolean attribute: its presence means true, its absence means false there must be a value (if set).
...d-12345 or 12345" ], nl : [ '^(nl-)?\\d{4}\\s*([a-rt-z][a-z]|s[bce-rt-z])$', "nederland zips must have exactly 4 digits, followed by 2 letters except sa, sd and ss" ] }; // read the country id var country = document.getelementbyid("country").value; // get the npa field var zipfield = document.getelementbyid("zip"); // b
uild the constraint checker var constraint = new regexp(constraints[country][0], ""); console.log(constraint); // check it!
... if (constraint.test(zipfield.value)) { // the zip follows the constraint, we use the constraintapi to tell it zipfield.setcustomvalidity(""); } else { // the zip doesn't follow the constraint, we use the constraintapi to // give a message about the format req
uired for this country zipfield.setcustomvalidity(constraints[country][1]); } } then we link it to the onchange event for the <select> and the oninput event for the <input>: window.onload = function () { document.getelementbyid("country").onchange = checkzip; document.getelementbyid("zip").oninput = checkzip; } you can see a live example of the postal code validation.
...And 2 more matches
Introduction to Web development - Developer guides
html elements reference g
uide — a comprehensive g
uide to html elements with details on how browsers support them css getting started with css — an absolute beginners g
uide to css covers basic concepts and fundamentals css reference g
uide — a complete g
uide to css with details on the level of gecko/firefox support for each.
... the w3c introduction to styling with css — a brief g
uide to styling web pages for beginners.
... javascript reference g
uide — a comprehensive, regularly updated g
uide to javascript for all levels of learning from beginner to advanced.
...And 2 more matches
Localizations and character encodings - Developer guides
the html specification recommends the use of the utf-8 encoding (which can represent all of unicode) and regardless of the encoding used req
uires web content to declare what encoding was used.
... to specify that a page is using, for example, the utf-8 character encoding (as per the recommendation), simply place the following line in the <head> block: <meta charset="utf-8"> details and browser internals when the encoding is declared by web content like the html specification req
uires, firefox will use that encoding for turning the bytes into the internal representation.
...however, there are locales where web publishing was common already in the 1990s but the windows-1252 encoding was not s
uitable for the local language.
...And 2 more matches
Mobile Web Development - Developer guides
also see jason grlicky's g
uide to mobile-friendliness for web developers.
... designing for mobile devices mobile devices have q
uite different hardware characteristics compared with desktop or laptop computers.
...it includes techniques such as: fl
uid css layouts, to make the page adapt smoothly as the browser window size changes the use of media queries to conditionally include css rules appropriate for the device screen width and height the viewport meta tag instructs the browser to display your site at the appropriate scale for the user's device.
...And 2 more matches
User input and controls - Developer guides
for devices providing a mouse/touchpad as a pointing method, the pointer lock api helps you in implementing a first person 3d game or other applications req
uiring full control of the pointing device.
... note: have a look at the events reference and keyboardevent g
uide to find out more about keyboard events.
... note: for further information about what you can do with touch events, please read our touch events g
uide.
...And 2 more matches
CSP: require-sri-for - HTTP
the http content-security-policy req
uire-sri-for directive instructs the client to req
uire the use of subresource integrity for scripts or styles on the page.
... syntax content-security-policy: req
uire-sri-for script; content-security-policy: req
uire-sri-for style; content-security-policy: req
uire-sri-for script style; script req
uires sri for scripts.
... style req
uires sri for style sheets.
...And 2 more matches
JSS build instructions for OSX 10.6 - Archive of obsolete content
the following b
uild instructions were provided by pavrw.
... the generic instructions didn't work to b
uild on osx 10.6.7.
... howto successfully compile jss and nss for 32 and 64 bits on osx 10.6 (10.6.7) useful links: https://developer.mozilla.org/en/nss_reference/b
uilding_and_installing_nss/b
uild_instructions https://developer.mozilla.org/jss_b
uild_4.3.html ftp://ftp.mozilla.org/pub/mozilla.org/ <componente> /releases http://www.mozilla.org/projects/secu...using_jss.html steps: export all this: b
uild_opt="1" cvsroot=":pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot" java_home=$(/usr/libexec/java_home") no_mdupdate="1" nsdistmode="copy" ns_use_gcc="1" create working dir: mkdir nss-jss cd nss-jss obtain source: altought manual said nspr_4_6_4_rtm, nss_3_11_4_rtm, jss_4_2_5_rtm, they didnt work for osx, giving many compiling errors.
... cvs login cvs co -r nspr_4_8_7_rtm nspr cvs co -r nss_3_12_9_with_ckbi_1_82_rtm nss cvs co -r jss_4_3_2_rtm jss b
uild nss for 32 and 64: cd mozilla/security/nss make nss_b
uild_all cc="gcc -arch i386" ccc="g++ -arch i386" make nss_b
uild_all use_64=1 b
uild jss for 32 and 64: cd ../jss make cc="gcc -arch i386" ccc="g++ -arch i386" make use_64=1 on osx, java.library.path doesnt seem to have /usr/lib or other paths.
Building up a basic demo with Babylon.js - Game development
as with any other 3d library it provides b
uilt-in functions to help you implement common 3d functionality more q
uickly.
...if you have already worked through our b
uilding up a basic demo series with three.js, playcanvas or a-frame (or you are familiar with other 3d libraries) you'll notice that babylon.js works on similar concepts: camera, light and objects.
...for the box size) are unitless, and can basically be anything you deem s
uitable for your scene — milimeters, meters, feet, or miles — it's up to you.
...we can use the b
uilt-in color3 function to define it.
Object building practice - Learn web development
in this article we dive into a practical exercise, giving you some more practice in b
uilding custom javascript objects, with a fun and colorful result.
... prereq
uisites: basic computer literacy, a basic understanding of html and css, familiarity with javascript basics (see first steps and b
uilding blocks) and oojs basics (see introduction to objects).
... note that we are chaining multiple assignments together, to get the variables all set q
uicker — this is perfectly ok.
...here we specify 0 degrees, and 2 * pi, which is the eq
uivalent of 360 degrees in radians (annoyingly, you have to specify this in radians).
GC Rooting Guide
introduction this g
uide explains the basics of interacting with spidermonkey's gc as a spidermonkey api user.
... if you use these types directly, or create classes, structs or arrays that contain them, you must follow the rules set out in this g
uide.
... js::heap<t> doesn't req
uire a jscontext*, and can be constructed with or without an initial value parameter.
... one consequence of having different rooting req
uirements for heap and stack data is that a single structure containing gc thing pointers cannot be used on both the stack and the heap.
Places Developer Guide
the api signature and context usually make clear which is req
uired.
... string getitemg
uid(aitemid) obsolete since gecko 14.0 - returns a globally unique identifier for the item.
... setitemg
uid(aitemid, ag
uid) obsolete since gecko 14.0 - returns a globally unique identifier for the item.
...the unique identifier is the uri, and all apis req
uire uris as nsiuri objects.
nsIDownloadManagerUI
toolkit/components/downloads/public/nsidownloadmanager
ui.idlscriptable this interface is used to implement the user interface for the download manager.
... introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getattention(); void show([optional] in nsiinterfacerequestor awindowcontext, [optional] in unsigned long aid, [optional] in short areason); attributes attribute type description visible boolean true if the download manager
ui is visible; otherwise false.
...the
ui need not be visible to call this function, nor will the
ui be made visible.
... aid optional the id of the download to be preselected upon opening the download manager
ui.
Building an Account Manager Extension
if (server.type == \"imap\") return true; return false; }, queryinterface: xpcomutils.generateqi([ components.interfaces.nsimsgaccountmanagerextension ]) } step 2: b
uilding a component we convert the interface to a xpcom component and register it in the component manager as account manager extension.
...as our account manager extension is named "devmo-account", we are req
uired to include a property named prefpanel-devmo-account.
... function onpreinit(account, accountvalues) { } function oninit(pageid, serverid) { } function onaccepteditor() { } function onsave() { } function updatepage() {} step5: putting it all together // todo b
uild an demo extension for this tutorial...
... how to b
uild an xpcom component in javascript ...
UI Tour - Firefox Developer Tools
this article is a q
uick tour of the main sections of the javascript debugger's user interface.
... the
ui is split vertically into three panels source list pane source pane the contents of the third pane depend on the current state of the debugger and may include the following sections: toolbar watch expressions breakpoints call stack scopes xhr breakpoints event listener breakpoints dom mutation breakpoints source list pane the source list pane lists all the javascript source files loaded into the page, and enables you to select one to debug.
...all child files acq
uired the eye icon, and the folder menu option changes to unignore files in this directory.
...all such files acq
uire the eye icon, and the menu option for that folder changes to unignore files outside this directory.
uuid - Web APIs
the bluetoothremotegattdescriptor.u
uid read-only property returns the u
uid of the characteristic descriptor, for example '00002902-0000-1000-8000-00805f9b34fb' for theclient characteristic configuration descriptor.
... syntax var u
uid = bluetoothremotegattdescriptor.u
uid returns a u
uid.
... specifications specification status comment web bluetooththe definition of 'u
uid' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetu
uid experimentalchrome full support 57notes full support 57notes notes macos only.
ByteLengthQueuingStrategy.size() - Web APIs
the size() method of the bytelengthque
uingstrategy interface returns the given chunk’s bytelength property.
... syntax var size = bytelengthque
uingstrategy.size(chunk); parameters chunk a chunk of data being passed through the stream.
... examples const que
uingstrategy = new bytelengthque
uingstrategy({ highwatermark: 1 }); const readablestream = new readablestream({ start(controller) { ...
... }, cancel(err) { console.log("stream error:", err); } }, que
uingstrategy); var size = queueingstrategy.size(chunk); specifications specification status comment streamsthe definition of 'size' in that specification.
CountQueuingStrategy.size() - Web APIs
the size() method of the countque
uingstrategy interface always returns 1, so that the total queue size is a count of the number of chunks in the queue.
... syntax var size = countque
uingstrategy.size(); parameters none.
... examples const que
uingstrategy = new countque
uingstrategy({ highwatermark: 1 }); const writablestream = new writablestream({ // implement the sink write(chunk) { ...
... }, abort(err) { console.log("sink error:", err); } }, que
uingstrategy); var size = que
uingstrategy.size(); specifications specification status comment streamsthe definition of 'size' in that specification.
Navigator.buildID - Web APIs
returns the b
uild identifier of the browser.
... syntax b
uildid = navigator.b
uildid; value a string representing the b
uild identifier of the application.
... the b
uild id is in the form yyyymmddhhmmss.
... example console.log(window.navigator.b
uildid); specification not part of any public standard.
Notification.requireInteraction - Web APIs
the req
uireinteraction read-only property of the notification interface returns a boolean indicating that a notification should remain active until the user clicks or dismisses it, rather than closing automatically.
... note: this can be set when the notification is first created by setting the req
uireinteraction option to true in the options object of the notification.notification() constructor.
... syntax function spawnnotification(thetitle,thebody,shouldreq
uireinteraction) { var options = { body: thebody, req
uireinteraction: shouldreq
uireinteraction } var n = new notification(thetitle,options); } value a boolean.
... specifications specification status comment notifications apithe definition of 'req
uireinteraction' in that specification.
RTCIceCandidatePairStats.circuitBreakerTriggerCount - Web APIs
the rtcicecandidatepairstats property circ
uitbreakertriggercount indicates the number of times the circ
uit-breaker has been triggered to indicate a connection timeout or other unexpected connection abort on this specific connection configuration.
... a circ
uit breaker trigger is fired each time the connection times out or otherwise needs to be halted automatically.
... syntax cbtcount = rtcicecandidatepairstats.circ
uitbreakertriggercount; value an integer value indicating the number of times the circ
uit-breaker has been triggered for the 5-tuple used by this connection.
... specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.circ
uitbreakertriggercount' in that specification.
XRPermissionDescriptor.requiredFeatures - Web APIs
the xrpermissiondescriptor dictionary's req
uiredfeatures property should be set prior to calling navigator.permissions.query() to a list of webxr features which must be supported for the app to work.
... syntax xrpermissiondescriptor = { mode: xrsessionmode, req
uiredfeatures: reqfeaturelist, optionalfeatures: optfeaturelist }; xrpermissiondescriptor.req
uiredfeatures = reqfeaturelist; reqfeaturelist = xrpermissiondescriptor.req
uiredfeatures; value an array of strings indicating the webxr features which must be available for use by the app or site.
... let xrpermissiondesc = { name: "xr", mode: "immersive-ar", req
uiredfeatures: [ "local-floor" ] }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({state}) => { switch(state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr...
...(); } specifications specification status comment webxr device apithe definition of 'xrpermissiondescriptor.req
uiredfeatures' in that specification.
ARIA Screen Reader Implementors Guide - Accessibility
live regions this is just a g
uide.
...the following is intended to provide implementation g
uidance that respects screen readers developers' need to try different things.
... the intention is to strike a balance between providing useful g
uidance on how to use the markup's intended meaning while supporting live regions as an area for screen readers to innovate and compete.
...it is probably desirable to have at least a tiny timeout before presenting atomic region changes, in order to avoid presenting the region twice for two changes that occur q
uickly one after the other.
WAI ARIA Live Regions/API Support - Developer guides
newtext to retrieve the offsets and inserted text) text replaced text_changed::delete followed immediately by text_changed::insert ia2_event_text_removed followed immediately by ia2_event_text_inserted * we do not use msaa's create/destroy at the request of screen reader vendors, who avoid those events because they cause crashes on some important system -- show/hide are the eq
uivalent of those events.
... retrieving author-supplied aria live region semantics from an event for any mutation event in a page, the author can get the following object attributes from the event object, if they are defined on some ancestor element (closest ancestor wins): object attribute name possible values default value if not specified meaning aria markup if req
uired container-live "off" | "polite" | "assertive" "off" interruption policy aria-live on ancestor element container-relevant "[additions] [removals] [text]" | "all" "additions text" what types of mutations are possibly relevant?
... does not req
uire author's cooperation.
...please read the live region section of the wai-aria screen reader implementor's g
uide.
Setting up adaptive streaming media sources - Developer guides
we are req
uired to provide several different quality files split up over several time points.
...for adaptive streaming over http, no special server-side components are req
uired.
... for live services streaming, the live profile is a req
uirement.
... apple also provides a file segmenter for mac — which takes a s
uitably encoded file, splits it up and produces a index file, in a similar fashion to the stream segmenter.
Writing Web Audio API code that works in every browser - Developer guides
there's a section in the spec that lists the old names and their updated eq
uivalences; be sure to check it out and change your code accordingly.
...for example, up until a couple of days ago pannernode did not support the default hrtf panning model yet, and attempting to use a pannernode with that configuration simply resulted in silence or a mono output coming out from that node, depending on the b
uild you used.
... today the support is already present in nightly, but not q
uite yet in aurora.
... in the meantime, you can explicitly specify 'equalpower' instead: var panner = new audiocontext.pannernode(); panner.panningmodel = 'equalpower'; note that there's a list of projects b
uilt with the web audio api, specifying which ones use the standard audiocontext and which browsers do they work on.
Media buffering, seeking, and time ranges - Developer guides
this article discusses how to b
uild a buffer/seek bar using timeranges, and other features of the media api.
...if it doesn't then audio.seekable will be eq
uivalent to audio.buffered, which will give a valid indication of the end of seekable media.
... so let's b
uild this.
... a q
uick word about played it’s worth mentioning the played property — this tells us which time ranges have been played within the media.
Using HTML sections and outlines - Developer guides
html elements in <nav> while list elements are common for navigation they are not req
uired.
...the heading does not req
uire the use of the <header> element <section> <h1>amazing mdn contributors</h1> <ul> <li><img src="link" alt="descriptive text"></li> <li><img src="link" alt="descriptive text"></li> <li><img src="link" alt="descriptive text"></li> </ul> </section> aside element the <aside> element defines related content that has a different placement than the main content.
... document.createelement("header"); document.createelement("nav"); document.createelement("section"); document.createelement("time"); </script> <![endif]--> as a last precaution, you could also add an explicit <noscript> element inside the <head> element to warn any users that have javascript disabled that your page relies on javascript: <noscript> <p><strong>this web page req
uires javascript to be enabled.</strong></p> <p>javascript is an object-oriented computer programming language commonly used to create interactive effects within web browsers.</p> <p><a href="https://goo.gl/koeeaj">how to enable javascript?</a></p> </noscript> this leads to the following code to allow the support of the html5 sections and headings elements in non-html5 browsers, even for i...
...owser is configured not to use scripting: <!--[if lt ie 9]> <script> document.createelement("article"); document.createelement("aside"); document.createelement("footer"); document.createelement("header"); document.createelement("nav"); document.createelement("section"); document.createelement("time"); </script> <![endif]--> <noscript> <p><strong>this web page req
uires javascript to be enabled.</strong></p> <p>javascript is an object-oriented computer programming language commonly used to create interactive effects within web browsers.</p> <p><a href="https://goo.gl/koeeaj">how to enable javascript?</a></p> </noscript> note: this code will also cause the html validator to return errors.
BigInt.asUintN() - JavaScript
the bigint.as
uintn static method is used to wrap a bigint value to an unsigned integer between 0 and 2width-1.
... syntax bigint.as
uintn(width, bigint); parameters width the amount of bits available for the integer size.
... examples staying in 64-bit ranges the bigint.as
uintn() method can be useful to stay in the range of 64-bit arithmetic.
... const max = 2n ** 64n - 1n; bigint.as
uintn(64, max); // ↪ 18446744073709551615n bigint.as
uintn(64, max + 1n); // ↪ 0n // zero because of overflow specifications specification ecmascript (ecma-262)the definition of 'bigint.as
uintn()' in that specification.
BigUint64Array() constructor - JavaScript
the big
uint64array() typed array constructor creates a new big
uint64array object, which is, an array of 64-bit unsigned integers in the platform byte order.
... syntax new big
uint64array(); new big
uint64array(length); new big
uint64array(typedarray); new big
uint64array(object); new big
uint64array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... examples different ways to create a big
uint64array // from a length var big
uint64 = new big
uint64array(2); big
uint64[0] = 42n; console.log(big
uint64[0]); // 42n console.log(big
uint64.length); // 2 console.log(big
uint64.bytes_per_element); // 8 // from an array var arr = new big
uint64array([21n,31n]); console.log(arr[1]); // 31n // from another typedarray var x = new big
uint64array([21n, 31n]); var y = new big
uint64array(x); console.lo...
...g(y[0]); // 21n // from an arraybuffer var buffer = new arraybuffer(32); var z = new big
uint64array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1n, 2n, 3n]; }(); var big
uint64 = new big
uint64array(iterable); // big
uint64array[1n, 2n, 3n] specifications specification ecmascript (ecma-262)the definition of 'big
uint64array' in that specification.
Uint32Array() constructor - JavaScript
the
uint32array() typed array constructor creates an array of 32-bit unsigned integers in the platform byte order.
... syntax new
uint32array(); // new in es2017 new
uint32array(length); new
uint32array(typedarray); new
uint32array(object); new
uint32array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... examples different ways to create a
uint32array // from a length var
uint32 = new
uint32array(2);
uint32[0] = 42; console.log(
uint32[0]); // 42 console.log(
uint32.length); // 2 console.log(
uint32.bytes_per_element); // 4 // from an array var arr = new
uint32array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new
uint32array([21, 31]); var y = new
uint32array(x); console.log(y[0]); // 21 // from an arraybu...
...ffer var buffer = new arraybuffer(16); var z = new
uint32array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var
uint32 = new
uint32array(iterable); //
uint32array[1, 2, 3] specifications specification ecmascript (ecma-262)the definition of 'typedarray constructors' in that specification.
Uint8Array() constructor - JavaScript
the
uint8array() constructor creates a typed array of 8-bit unsigned integers.
... syntax new
uint8array(); // new in es2017 new
uint8array(length); new
uint8array(typedarray); new
uint8array(object); new
uint8array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... examples different ways to create a
uint8array // from a length var
uint8 = new
uint8array(2);
uint8[0] = 42; console.log(
uint8[0]); // 42 console.log(
uint8.length); // 2 console.log(
uint8.bytes_per_element); // 1 // from an array var arr = new
uint8array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new
uint8array([21, 31]); var y = new
uint8array(x); console.log(y[0]); // 21 // from an arraybuffer var b...
...uffer = new arraybuffer(8); var z = new
uint8array(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var
uint8 = new
uint8array(iterable); //
uint8array[1, 2, 3] specifications specification ecmascript (ecma-262)the definition of 'typedarray constructors' in that specification.
Uint8ClampedArray() constructor - JavaScript
the
uint8clampedarray() constructor creates a typed array of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the range of [0,255], 0 or 255 will be set instead; if you specify a non-integer, the nearest integer will be set.
... syntax new
uint8clampedarray(); // new in es2017 new
uint8clampedarray(length); new
uint8clampedarray(typedarray); new
uint8clampedarray(object); new
uint8clampedarray(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... examples different ways to create a
uint8clampedarray // from a length var
uintc8 = new
uint8clampedarray(2);
uintc8[0] = 42;
uintc8[1] = 1337; console.log(
uintc8[0]); // 42 console.log(
uintc8[1]); // 255 (clamped) console.log(
uintc8.length); // 2 console.log(
uintc8.bytes_per_element); // 1 // from an array var arr = new
uint8clampedarray([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new
uint8clampedarray(...
...[21, 31]); var y = new
uint8clampedarray(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new
uint8clampedarray(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var
uintc8 = new
uint8clampedarray(iterable); //
uint8clampedarray[1, 2, 3] specifications specification ecmascript (ecma-262)the definition of 'typedarray constructors' in that specification.
Autoplay guide for media and Web Audio APIs - Web media technologies
in this g
uide, we'll cover autoplay functionality in the various media and web audio apis, including a brief overview of how to use autoplay and how to work with browsers to handle autoplay blocking gracefully.
...the exact situations that result in blocking, and the specifics of how sites become whitelisted vary from browser to browser, but the above are good g
uidelines to go by.
...this is currently false by default (except in nightly b
uilds, where it's true by default).
... media.autoplay.enabled.user-gestures-needed (nightly b
uilds only) a boolean preference which controls whether or not detection of user gestures is allowed to override the setting of media.autoplay.default.
Builder - Archive of obsolete content
the add-on b
uilder tool was retired on april 1, 2014.
... the add-on b
uilder was a web-based development environment that allowed developers to create add-ons using the sdk apis, but without needing to use the jpm command line tool.
... it was retired on april 1, 2014, and the "b
uilder.addons.mozilla.org" domain now redirects to this page.
Extension Theming Guidelines - Archive of obsolete content
this is a set of g
uidelines on how to control the look and feel of your extension while leaving it open for styling by custom themes.
... branding certain items of your extensions style, in particular logos and icons can be kept in the chrome content package such that they are not replaceable by custom themes stylesheets g
uidelines include stylesheets for every new window that your extension adds and for every window that your extension overlays content into be sure to add a stylesheet from your chrome skin package.
... xul g
uidelines xbl bindings xbl bindings are applied using style rules.
Enabling quicklaunch for all users - Archive of obsolete content
enabling q
uicklaunch for all users unlike all other settings, q
uicklaunch is stored in the windows registry.
... to enable it, just load the following registry script into the user's windows registry: q
uicklaunch.reg.
... this can be performed automatically by including the following command into the windows logon script: regedit /s \\server\netlogon\reg\q
uicklaunch.reg ...
[Deprecated] The Mozilla build VM - Archive of obsolete content
the mozilla b
uild vm is no longer maintained or supported.
... thanks to significant improvements in our b
uild environment setup process, it's much simpler and easier to get set up and stay up to date by starting with b
uilding firefox instead.
... other links of interest may include: developer g
uide (documentation about developing on and for mozilla projects).
menuitem.name - Archive of obsolete content
« xul reference home name type: string name radio men
uitems with the same name as put into a group.
... only one men
uitem in each radio group can be checked at a time.
... example <toolbox> <menubar id="planets-menubar"> <menu id="planet-menu" label="planet"> <menupopup> <men
uitem id="jupiter" label="jupiter" type="radio" name="planet"/> <men
uitem id="saturn" label="saturn" type="radio" name="planet" checked="true"/> <men
uitem id="uranus" label="uranus" type="radio" name="planet"/> </menupopup> </menu> </menubar> </toolbox> see also name and menus in the xul tutorial ...
builder - Archive of obsolete content
« xul reference b
uilder type: nsixultemplateb
uilder for content generated from a template, this is the xpcom object that is responsible for generating the content.
...to reb
uild the content call the b
uilder's reb
uild method.
... for example, given a reference to a tree mytree, this example will reb
uild its content: mytree.b
uilder.reb
uild(); ...
builderView - Archive of obsolete content
« xul reference b
uilderview type: nsixultreeb
uilder a reference to the tree b
uilder which constructed the tree data.
... the b
uilder provides access to the rdf resources for each row in the tree, and allows sorting the data by column.
... in newer versions of mozilla, the b
uilderview property is actually a synonym for the view property, since the two interfaces are flattened together into a single interface in javascript.
NPAPI plugin developer guide - Archive of obsolete content
for example, the adobe flash plug-in is used to access flash content (including videos and certain interactive applications), and the q
uicktime and realplayer plugins are used to play special format videos in a web page.
...ing rules for html elements using the appropriate attributes using the embed element for plug-in display using custom embed attributes plug-in references plug-in development overview writing plug-ins registering plug-ins ms windows unix mac os x drawing a plug-in instance handling memory sending and receiving streams working with urls getting version and
ui information displaying messages on the status line making plug-ins scriptable b
uilding plug-ins b
uilding, platforms, and compilers b
uilding carbonized plug-ins for mac os x type libraries installing plug-ins native installers xpi plug-ins installations plug-in installation and the windows registry initialization and destruction initialization instance cre...
...nding a stream creating a stream pushing data into the stream deleting the stream example of sending a stream urls getting urls getting the url and displaying the page posting urls posting data to an http server uploading files to an ftp server sending mail memory allocating and freeing memory mac os flushing memory (mac os only) version,
ui, and status information displaying a status line message getting agent information getting the current version finding out if a feature exists reloading a plug-in ...
NSPR Release Engineering Guide - Archive of obsolete content
feature complete update ...pr/include/prinit.h with release numbers b
uild all targets, debug and optimized on all platforms using local directories run the test s
uite on all targets verify release numbers show up in binaries resolve testing anomalies tag the tree with nsprpub_release_x_y_z_beta beta release checkout a whole new tree using the tag from above b
uild all targets, debug and optimized on all platforms using the command: gmake release mdist=<dir>/mdist b
uild_number=vx.y.z [b
uild_opt=1 | use_debug_rtl=1] copy the bits from mdist to /share/b
uilds/components/nspr20/.vx.y.z 1 run...
... explode.pl run the test s
uite on all targets, using binaries & headers from shipped bits resolve testing anomalies tag the tree with nsprpub_release_x_y[_z] release candidate checkout a whole new tree using tag (including fixes) tag the treey with nsprpub_release_x_y_z b
uild all targets, debug and optimized on all platforms using the command: gmake release mdist=<dir>/mdist b
uild_number=vx.y.z [b
uild_opt=1 | use_debug_rtl=1] copy the bits from mdist to /share/b
uilds/components/nspr20/.vx.y.z in /share/b
uilds/components/nspr20/ run the following scripts: explode.pl rename.sh symlink.sh rtm bits rename the .vx.y.z directory to vx.y.z (remove the hidden directory 'dot').
... copy /share/b
uilds/components/nspr20/vx.y.z/* to /share/systems/mozilla/pub/nspr/vx.y.z/ original document information author: larryh@netscape.com last updated date: september 20, 2000 1 copying files to /share/b
uilds/components req
uires that one be logged on to a machine named "smithers" as user "svbld".
UUID - Archive of obsolete content
u
uid: universal unique identifier a u
uid can be obtained by visiting http://www.famkr
uithof.net/u
uid/u
uidgen or by typing "firebot: u
uid?" on irc.mozilla.org in a channel where nickname "firebot" is present.
... or you can also type "/query firebot u
uid?" in any tab connected to the irc.mozilla.org (or, with chatzilla, "moznet") network.
... see also generating_g
uids ...
ScriptEngineBuildVersion - Archive of obsolete content
the scriptengineb
uildversion function bets the b
uild version number of the scripting engine in use.
... syntax scriptengineb
uildversion() remarks the return value corresponds directly to the version information contained in the dynamic-link library (dll) for the scripting language in use.
... example the following example illustrates the use of the scriptengineb
uildversion function: if(window.scriptengineb
uildversion) { console.log(window.scriptengineb
uildversion()); } // output: <current b
uild version> req
uirements supported in the following document modes: q
uirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards, internet explorer 11 standards.
Cipher suite - MDN Web Docs Glossary: Definitions of Web-related terms
a cipher s
uite is a combination of a key exchange algorithm, authentication method, bulk encryption cipher, and message authentication code.
... in a cryptosystem like tls, the client and server must agree on a cipher s
uite before they can begin communicating securely.
... a typical cipher s
uite looks like ecdhe_rsa_with_aes_128_gcm_sha256 or ecdhe-rsa-aes128-gcm-sha256, indicating: ecdhe (elliptic curve diffie-hellman ephemeral) for key exchange rsa for authentication aes-128 as the cipher, with galois/counter mode (gcm) as the block cipher mode of operation sha-256 as the hash-based message authentication code (hmac) learn more mozilla recommended cipher s
uite choices for tls ...
Accessibility information for UI designers and developers
don't rely on color alone when your interface uses color to disting
uish between things, make sure the distinction is also made in other ways.
... or in this one, you could consider using patterns besides colored areas: again, if people are unable to disting
uish the colors, they can rely on the patterns instead.
... use default controls controls that are b
uilt into browsers come with a lot of accessibility for free.
Building SpiderMonkey with UBSan
/bin/sh if [ -z $1 ] ; then echo "usage: $0 <dirname>" elif [ -d $1 ] ; then echo "directory $1 already exists" else autoconf2.13 autoconf213 mkdir $1 cd $1 llvm_root="$home/llvm" sanflag="-fsanitize=undefined -fno-sanitize=alignment,float-cast-overflow,float-divide-by-zero,vptr -dxmalloc=myxmalloc" \ cc="$llvm_root/b
uild/release+asserts/bin/clang" \ cxx="$llvm_root/b
uild/release+asserts/bin/clang++" \ cflags="$sanflag" \ cxxflags="$sanflag" \ moz_llvm_hacks=1 \ ../configure --enable-debug --disable-optimize make -j 8 fi 3.
... which hits known bugs in spidermonkey, and is more implementation-defined (slow on x86 / crash on arm) than undefined behavior float-cast-overflow, which hits known bugs in spidermonkey, and isn't exploited by today's compilers float-divide-by-zero, which jesse doesn't think is actually undefined behavior (aside from the question of whether cpu overflow flags are set) vptr, a check that req
uires rtti, which is disabled by default in spidermonkey 4.
... (for automated testing outside of gdb, you can instead b
uild with -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error, but then you lose ubsan's diagnostics and the ability to continue past errors.) known bugs.
Interface development guide
the articles linked from this page offer g
uidelines for developing and using these interfaces.
...idl interface rules design g
uidelines and rules when creating and changing xpcom interfaces.
...commenting idl for better documentation a g
uide explaining how to properly comment your interface's idl in order to ensure that not only can others understand your interface, but to ensure that the documentation here on mdc is as accurate as possible.
Localization prerequisites
to work on localization, you need a subset of the mozilla b
uild prereq
uisites.
... on mac and linux, you should be just fine, and on windows, mozillab
uild should get you everything you need.
...on windows, mozillab
uild offers a start-shell-l10n.bat in c:\mozilla-b
uild.
MathML3Testsuite
the pages below contain our current results of the mathml 3 full tests
uite for presentation mathml.
... the sections are marked with passed, failed, not-tested or some parts pass, giving the status of trunk b
uilds with the appropriate fonts installed.
...however, any report is welcome on the tracking bug for the mathml tests
uite.
A brief guide to Mozilla preferences
if the application encounters any error during loading of a default pref file, the application will issue a warning that a configuration file has failed to load and then q
uit.
... this allows system administrators to know q
uickly if there is a configuration error in the installation.
...this
ui is not recommended for most users.
A guide to searching crash reports
this g
uide to searching through crash reports may help you locate the crash reports that will help you find and fix the firefox bug you're working on.
... to achieve full power and flexibility req
uires a good understanding of both of these functions.
... to become an expert at searching and grouping req
uires understanding the full range of the 100+ fields available for searching and grouping.
JS_IsBuiltinEvalFunction
syntax bool js_isb
uiltinevalfunction(jsfunction *fun); name type description obj jsfunction * pointer to the function to test.
... description js_isb
uiltinevalfunction returns whether the given function is the global eval function.
... see also mxr id search for js_isb
uiltinevalfunction js_isb
uiltinfunctionconstructor bug 638312 ...
Building a Thunderbird extension 1: introduction
this tutorial will introduce you to the components of a thunderbird extension and will show you how to b
uild your own.
...all thunderbird b
uilds are available from the ftp site.
... documentation thunderbird extensions (documentation overview) firefox addons developer g
uide (many topics are applicable to thunderbird) mozilla cross-reference source code browser ("comm-central" contains the thunderbird code repository) community the thunderbird development community has a mailing list with an extensive searchable archive with an extensive searchable archive.
BluetoothRemoteGATTCharacteristic.uuid - Web APIs
the bluetoothremotegattcharacteristic.u
uid read-only property returns domstring containing the u
uid of the characteristic, for example '00002a37-0000-1000-8000-00805f9b34fb' for the heart rate measurement characteristic.
... syntax var u
uid = bluetoothremotegattcharacteristic.u
uid returns a domstring.
... specifications specification status comment web bluetooththe definition of 'u
uid' in that specification.
uuid - Web APIs
the bluetoothgattservice.u
uid read-only property returns a domstring representing the u
uid of this service.
... syntax var u
uid = bluetoothgattservice.u
uid returns a domstring.
... specifications specification status comment web bluetooththe definition of 'u
uid' in that specification.
FullscreenOptions.navigationUI - Web APIs
the fullscreenoptions dictionary's navigation
ui property is used when calling requestfullscreen() to specify to what extent the user agent should include its standard user interface while the element is presented in full-screen mode.
... syntax let fullscreenoptions = { navigation
ui: value }; value the value of the navigation
ui property must be one of the following strings.
... let elem = document.documentelement; elem.requestfullscreen({ navigation
ui: "show" }).then({}).catch(err => { alert(`an error occurred while trying to switch into full-screen mode: ${err.message} (${err.name})`); }); the promise's resolve handler does nothing, but if the promise is rejected, an error message is displayed by calling alert().
HTMLMenuItemElement - Web APIs
the htmlmen
uitemelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating <men
uitem> elements.
...,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlelement</text></a><polyline points="491,25 501,20 501,30 491,25" stroke="#d4dde4" fill="none"/><line x1="501" y1="25" x2="509" y2="25" stroke="#d4dde4"/><line x1="509" y1="25" x2="509" y2="90" stroke="#d4dde4"/><line x1="509" y1="90" x2="492" y2="90" stroke="#d4dde4"/><a xlink:href="/docs/web/api/htmlmen
uitemelement" target="_top"><rect x="301" y="65" width="190" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmen
uitemelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} propertiesthis i...
...nterface has no properties, but inherits properties from: htmlelementmethodsthis interface has no methods, but inherits methods from: htmlelement specifications specification status comment html 5.1the definition of 'htmlmen
uitemelement' in that specification.
UIEvent.isChar - Web APIs
the
uievent.ischar read-only property returns a boolean indicating whether the event produced a key character or not.
... syntax var ischar =
uievent.ischar; value a boolean which is true if the event produces a character; otherwise false.
... example in this snippet, which is part of an event handler, the event is checked to see if it generates a character; if it does, the value of
uievent.which is appended to a string which buffers the typed characters.
UIEvent.view - Web APIs
the
uievent.view read-only property returns the windowproxy object from which the event was generated.
... specifications specification status comment document object model (dom) level 3 events specificationthe definition of '
uievent' in that specification.
... document object model (dom) level 2 events specificationthe definition of '
uievent' in that specification.
WebRTC coding guide - Web APIs
how do you create a web application that uses two-way video or data streams without having to do all the hard work of compressing frames, b
uilding streams, and so forth by yourself?
... this coding g
uide will explain in depth how webrtc works, and will dive into actual code that uses webrtc to do useful things.
... if you need to learn more about the fundamentals of how webrtc and its protocols work, check out our high-level g
uides for webrtc.
High-level guides - Web APIs
the high-level g
uides listed below introduce webrtc technology from a top-down perspective, describing the overall architecture, the life cycle of a webrtc connection, and basic security and technological issues you might run into as you explore and b
uild web content or apps using the webrtc api.
... in addition, you'll find suggestions as to tools, libraries, and frameworks that might be helpful and compatibility information so you know which parts of the overall s
uite of webrtc features can be safely used given your target audience.
... when you're ready to explore webrtc in more depth, be sure to take a look at our low-level g
uide to webrtc.
:-moz-ui-invalid - CSS: Cascading Style Sheets
the :-moz-
ui-invalid css pseudo-class represents any validated form element whose value isn't valid based on their validation constraints, in certain circumstances.
... if the element is req
uired, the preceding rules apply only if the user has changed the value or attempted to submit the form.
...req
uired items have the pseudo-class applied only if the user changes them or attempts to submit an unchanged valid value.
:-moz-ui-valid - CSS: Cascading Style Sheets
the :-moz-
ui-valid css pseudo-class represents any validated form element whose value validates correctly based on its validation constraints.
... if the element is req
uired, the preceding rules apply only if the user has changed the value or attempted to submit the form.
...req
uired items are flagged as invalid only if the user changes them or attempts to submit an unchanged invalid value.
HTML5 Parser - Developer guides
parsing is now done in a separate thread from firefox’s main
ui thread, improving overall browser responsiveness.
... performance improvement with speculative parsing unrelated to the req
uirements of html5 specification, the gecko 2 parser uses speculative parsing, in which it continues parsing a document while scripts are being downloaded and executed.
... to best take advantage of speculative parsing, and help your pages to load as q
uickly as possible, ensure that when you call document.write(), you write a balanced sub-tree within that chunk of script.
The Unicode Bidirectional Text Algorithm - Developer guides
in this g
uide, we'll take a look at the bidi algorithm and learn in general what it does and how it applies to your content, so that you'll be better prepared when using the features of html and css to which the algorithm applies while determining the order and directionality of text during rendering.
... initial unicode bidi algorithm control characters character code point html entity markup eq
uivalent description left-to-right isolate (lri) u+2066 ⁦ dir="ltr" sets the base direction to ltr, isolating the embedded content from the surrounding text right-to-left isolate (lri) u+2067 ⁧ dir="rtl" sets the base direction to rtl, isolating the embedded content from the surrounding text first strong isolate (fsi) u+2068 ...
...errides the bidi algorithm, displaying the characters in memory order, from left to right right-to-left override (rlo) u+202e ‮ <bdo dir="rtl"> overrides the bidi algorithm and displays the embedded characters in reverse memory order, from right to left closing unicode bidi algorithm control characters character code point html entity markup eq
uivalent description pop directional formatting (pdf) u+202c ‬ closing whatever opening tag used the dir attribute used for rle or lre </bdo> used for rlo or lro pop directional isolate (pdi) u+2069 ⁩ closing whatever opening tag used the dir attribute used for rli, lri, or fsi ...
Writing forward-compatible websites - Developer guides
ask the authors of any javascript libraries you use to also follow these g
uidelines suggest to the developers of your favorite libraries that they follow these g
uidelines too.
...unfortunately, libraries are common transgressors of these g
uidelines.
...if you have a single code path that works in all the top engines, it means that you are either using features where browser behavior has already converged or, if the behavior hasn't q
uite converged yet, your code works regardless of which engine's behavior standards turn out to uphold.
426 Upgrade Required - HTTP
the http 426 upgrade req
uired client error response code indicates that the server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol.
... the server sends an upgrade header with this response to indicate the req
uired protocol(s).
... status 426 upgrade req
uired examples http/1.1 426 upgrade req
uired upgrade: http/2.0 connection: upgrade content-length: 53 content-type: text/plain this service req
uires use of the http/2.0 protocol specifications specification title rfc 7231, section 6.5.15: 426 upgrade req
uired hypertext transfer protocol (http/1.1): semantics and content ...
428 Precondition Required - HTTP
the http 428 precondition req
uired response status code indicates that the server req
uires the request to be conditional.
... typically, this means that a req
uired precondition header, such as if-match, is missing.
... status 428 precondition req
uired specifications specification title rfc 6585, section 3: 428 precondition req
uired additional http status codes ...
511 Network Authentication Required - HTTP
the http 511 network authentication req
uired response status code indicates that the client needs to authenticate to gain network access.
... network operators sometimes req
uire some authentication, acceptance of terms, or other user interaction before granting access (for example in an internet café or at an airport).
... status 511 network authentication req
uired specifications specification title rfc 6585, section 6: 511 network authentication req
uired additional http status codes ...
DataView.prototype.getBigUint64() - JavaScript
the getbig
uint64() method gets an unsigned 64-bit integer (unsigned long long) at the specified byte offset from the start of the dataview.
... syntax dataview.getbig
uint64(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to read the data from.
... examples using the getbig
uint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getbig
uint64(0); // 0n specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getbig
uint64()' in that specification.
DataView.prototype.getUint16() - JavaScript
the get
uint16() method gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the dataview.
... syntax dataview.get
uint16(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
... examples using the get
uint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.get
uint16(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.get
uint16' in that specification.
DataView.prototype.getUint32() - JavaScript
the get
uint32() method gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the dataview.
... syntax dataview.get
uint32(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
... examples using the get
uint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.get
uint32(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.get
uint32' in that specification.
DataView.prototype.getUint8() - JavaScript
the get
uint8() method gets an unsigned 8-bit integer (unsigned byte) at the specified byte offset from the start of the dataview.
... syntax dataview.get
uint8(byteoffset) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
... examples using the get
uint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.get
uint8(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.get
uint8' in that specification.
DataView.prototype.setBigUint64() - JavaScript
the setbig
uint64() method stores an unsigned 64-bit integer (unsigned long long) value at the specified byte offset from the start of the dataview.
... syntax dataview.setbig
uint64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to store the data from.
... examples using the setbig
uint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setbig
uint64(0, 3n); dataview.getbig
uint64(0); // 3n specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setbig
uint64()' in that specification.
DataView.prototype.setUint16() - JavaScript
the set
uint16() method stores an unsigned 16-bit integer (unsigned short) value at the specified byte offset from the start of the dataview.
... syntax dataview.set
uint16(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
... examples using the set
uint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.set
uint16(1, 3); dataview.get
uint16(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.set
uint16' in that specification.
DataView.prototype.setUint32() - JavaScript
the set
uint32() method stores an unsigned 32-bit integer (unsigned long) value at the specified byte offset from the start of the dataview.
... syntax dataview.set
uint32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
... examples using the set
uint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.set
uint32(1, 3); dataview.get
uint32(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.set
uint32' in that specification.
DataView.prototype.setUint8() - JavaScript
the set
uint8() method stores an unsigned 8-bit integer (byte) value at the specified byte offset from the start of the dataview.
... syntax dataview.set
uint8(byteoffset, value) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
... examples using the set
uint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.set
uint8(1, 3); dataview.get
uint8(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.set
uint8' in that specification.
Standard built-in objects - JavaScript
this chapter documents all of javascript's standard, b
uilt-in objects, including their methods and properties.
... the term "global objects" (or standard b
uilt-in objects) here is not to be confused with the global object.
... array int8array
uint8array
uint8clampedarray int16array
uint16array int32array
uint32array float32array float64array bigint64array big
uint64array keyed collections these objects represent collections which use keys.
PWA developer guide - Progressive web apps (PWAs)
in the articles listed here, you'll find g
uides about every aspect of development specific to the greation of progressive web applications (pwas).
...<<<--- web app basics introduction and getting started with pwa development some description installing and uninstalling web apps an introductory g
uide to how a web app can be installed on the user's device...
...lerting the user using notifications description creating a web app from an existing site description advanced topics pushing data from the server to your web application some description resource management description integration with the host device description security and privacy description gaming topics for web app developers description polishing web apps web api eq
uivalents for common native apis some description platform-specific tips and issues description web application performance g
uide description ensuring a good user experience description related topics some topic some description ...
Firefox addons developer guide - Archive of obsolete content
the firefox add-ons developer g
uide was contributed by the mozilla japan community; it covers how to go about b
uilding firefox extensions using xpcom and xul.
... next » introduction to extensions technologies used in developing extensions introduction to xul—how to b
uild a more int
uitive
ui using xpcom—implementing advanced processes let's b
uild a firefox extension firefox extensions and xul applications license and authors next » ...
Editor Embedding Guide - Archive of obsolete content
getcommandstate "state_attribute" (cstring) docommand "state_attribute" (cstring) "left", "right", "center", "justify" cmd_inserthtml cmd_insertlinkno
ui cmd_insertimageno
ui cmd_inserthr cmd_charset sets the charset for the document.
... commandparam->getbooleanvalue("state_enabled",&boolval); original document information authors: michael judge (mjudge@netscape.com) contributor: kathleen brade (brade@netscape.com) last updated date: march 27, 2003 original document: a g
uide to embedding the gecko editor ...
UI - Archive of obsolete content
menu accessing, modifying, and creating menus in the browser slidebar
ui mechanism for displaying jetpack content in a slide-out animated vertical column toolbar including entries and access elements into the toolbar panel a movable, expandable, and custom styled content element to display jetpack content tabs adding events and interacting with browser tabs and their contained documents statusbar low-level functions and basic calls notifications a system for alert...
...ing users via provided
ui mechanisms selection interacting with user-selected content window mitigates and eases interactions between different browser windows ...
WebXR performance guide - Web APIs
in this g
uide, we'll examine a variety of suggestions and recommendations that will help you make your webxr app as performant as possible.
... while an individual vector or matrix doesn't occupy an inordinate amount of memory, the sheer number of vectors and matrices and other structures that are used to b
uild each frame of a 3d scene means the memory management becomes a problem eventually if you keep allocating and de-allocating memory objects.
OpenType font features guide - CSS: Cascading Style Sheets
note: the examples below show the properties and some example combinations, along with the lower-level syntax eq
uivalents.
... for example, small caps can be set several ways, but if you want to ensure that no matter what the underlying capitalization is that you end up with everything in small caps, it req
uires 2 settings with font-feature-settings versus a single property value using font-variant-caps.
Ajax - Developer guides
when these technologies are combined in the ajax model, web applications are able to make q
uick, incremental updates to the user interface without reloading the entire browser page.
... documentation getting started this article g
uides you through the ajax basics and gives you two simple hands-on examples to get you started.
Block formatting context - Developer guides
as explained in the g
uide to in-flow and out of flow elements, the float has been taken out of flow so the background and border of the <div> only contain the content and not the float.
...esize this outer float</div> <div class="box" style="display:flow-root"><p><code>display:flow-root</code><p></div> </section> css section { height:150px; } .box { background-color: rgb(224, 206, 247); border: 5px solid rebeccapurple; } .box[style] { background-color: aliceblue; border: 5px solid steelblue; } .float { float: left; overflow: hidden; /* req
uired by resize:both */ resize: both; margin-right:25px; width: 200px; height: 100px; background-color: rgba(255, 255, 255, .75); border: 1px solid black; padding: 10px; } rather than inline-blocks with width:<percentage>, in this case we don't have to specify the width of the right div.
DOM onevent handlers - Developer guides
when the element is b
uilt from the html, the value of its onevent attributes are copied to the dom object that represents the element, so that accessing the attributes' values using javascript will get the value set in the html.
... html given this html document: <p>demonstrating q
uirks of <code>on<em>event</em></code> html attributes on <a onclick="log('click!')">these three words</a>.
Overview of events and handlers - Developer guides
in general, we can disting
uish events of different kinds based on the object emitting the event including: the window object, such as due to resizing the browser, the window.screen object, such as due to changes in device orientation, the document object, including the loading, modification, user interaction, and unloading of the page, the objects in the dom (document object model) tree including user interactions or m...
... documents three sources on the mdn (mozilla developer network) web site are particularly useful for programmers wanting to work with events: this event g
uide which is part of the web developers' g
uide, the event reference, the web api documentation for the event object.
Rich-Text Editing in Mozilla - Developer guides
mozilla uses the w3c standard way, namely iframeelement.contentdocument, while ie req
uires iframeelement.document.
...atdoc('paste');" src="data:image/gif;base64,r0lgodlhfgawaiquad04ktrly2txqf9vj414wzwibxmorpqbmpgjudclfaezxsa0cb/i1+3yitha7prkiphvbups+/fvrvv8/f///////////////////////////////////////////////yh5baeaab8alaaaaaawabyaaawn4ceozgmeakqubgsuspvbsyfjjvds6njlb0khr4akbcmfscgbqaocwjf5gwquvyksfbwze+awibv0ghfog2ewidchjwriqo9e2fx4xd5r+b0ddaenbxbhbhn2dgwdaqfjjyvhcqyrfgoidgiqjawtcqmriwwmfgicnvcaaamoak+blaortluyt7i5
uiuhads=" /> </div> <div id="textbox" contenteditable="true"><p>lorem ipsum</p></div> <p id="editmode"><input type="checkbox" name="switchmode" id="switchbox" onchange="setdocmode(this.checked);" /> <label for="switchbox">show html</label></p> <p><input type="submit" value="send" /></p> </form> </body> </html> note: if you want to see how to standardize the creation and the insertion of your edit...
Making content editable - Developer guides
see bug 1449564 and firefox-specific html editing
ui has been deprecated for additional details.
...atdoc('paste');" src="data:image/gif;base64,r0lgodlhfgawaiquad04ktrly2txqf9vj414wzwibxmorpqbmpgjudclfaezxsa0cb/i1+3yitha7prkiphvbups+/fvrvv8/f///////////////////////////////////////////////yh5baeaab8alaaaaaawabyaaawn4ceozgmeakqubgsuspvbsyfjjvds6njlb0khr4akbcmfscgbqaocwjf5gwquvyksfbwze+awibv0ghfog2ewidchjwriqo9e2fx4xd5r+b0ddaenbxbhbhn2dgwdaqfjjyvhcqyrfgoidgiqjawtcqmriwwmfgicnvcaaamoak+blaortluyt7i5
uiuhads=" /> </div> <div id="textbox" contenteditable="true"><p>lorem ipsum</p></div> <p id="editmode"><input type="checkbox" name="switchmode" id="switchbox" onchange="setdocmode(this.checked);" /> <label for="switchbox">show html</label></p> <p><input type="submit" value="send" /></p> </form> </body> </html> note: if you want to see how to standardize the creation and the insertion of your edito...
A hybrid approach - Developer guides
but even if it does not work, it is no worse with respect to performance than only using fl
uid images.
... every page on the site should look great at a wide variety of resolutions, being b
uilt with responsive design in mind.
Printing - Developer guides
open and automatically close a popup window when finished if you want to be able to automatically close a popup window (for example, the printer-friendly version of a document) after the user prints its contents, you can use code like this: <!doctype html> <html> <head> <meta http-eq
uiv="content-type" content="text/html; charset=utf-8" /> <title>javascript window close example </title> <script type="text/javascript"> function popuponclick() { my_window = window.open('', 'mywindow', 'status=1,width=350,height=150'); my_window.document.write('<html><head><title>print me</title></head>'); my_window.document.write('<body onafterprint="self.close()">'); ...
...the following is a possible example which will print a file named externalpage.html: <!doctype html> <html> <head> <meta http-eq
uiv="content-type" content="text/html; charset=utf-8" /> <title>mdn example</title> <script type="text/javascript"> function closeprint () { document.body.removechild(this.__container__); } function setprint () { this.contentwindow.__container__ = this; this.contentwindow.onbeforeunload = closeprint; this.contentwindow.onafterprint = closeprint; this.contentwindow.focus(); // req
uired for...
402 Payment Required - HTTP
the http 402 payment req
uired is a nonstandard client error status response code that is reserved for future use.
... status 402 payment req
uired example response http/1.1 402 payment req
uired date: wed, 21 oct 2015 07:28:00 gmt specifications specification title rfc 7231, section 6.5.2: 402 payment req
uired http/1.1: semantics and content ...
407 Proxy Authentication Required - HTTP
the http 407 proxy authentication req
uired client error status response code indicates that the request has not been applied because it lacks valid authentication credentials for a proxy server that is between the browser and the server that can access the requested resource.
... status 407 proxy authentication req
uired example response http/1.1 407 proxy authentication req
uired date: wed, 21 oct 2015 07:28:00 gmt proxy-authenticate: basic realm="access to internal site" specifications specification title rfc 7235, section 3.2: 407 proxy authentication req
uired http/1.1: authentication ...
411 Length Required - HTTP
the hypertext transfer protocol (http) 411 length req
uired client error response code indicates that the server refuses to accept the request without a defined content-length header.
... status 411 length req
uired specifications specification title rfc 7231, section 6.5.10: 411 length req
uired hypertext transfer protocol (http/1.1): semantics and content ...
JavaScript Guide - JavaScript
the javascript g
uide shows you how to use javascript and gives an overview of the language.
... chapters this g
uide is divided into several chapters: introduction about this g
uide about javascript javascript and java ecmascript tools hello world grammar and types basic syntax & comments declarations variable scope variable hoisting data structures and types literals control flow and error handling if...else switch try/catch/throw error objects loops and iteration for while do...while break/continue for..in for..of functions defining functions calling functions function scope closures arguments & parameters arrow functions expressions and operators assignment & comparisons arith...
Bytecode Descriptions
jsop::zero, jsop::one, jsop::int8, jsop::
uint16, and jsop::
uint24 are all compact encodings for jsop::int32.
...
uint16 operands: (
uint16_t val) stack: ⇒ val push the
uint16_t immediate operand as an int32value.
...
uint24 operands: (
uint24_t val) stack: ⇒ val push the
uint24_t immediate operand as an int32value.
...And 97 more matches
Index
4 binary compatibility xpcom if mozilla decides to upgrade to a compiler that does not have the same abi as the current version, any b
uilt component may fail.
... 5 bundling multiple binary components binary xpcom components are sometimes req
uired to implement low-level features for extensions.
... 6 creating a python xpcom component g
uide, needshelp, pyxpcom, xpcom, xpcom:language bindings creating applications with mozilla already provides a tutorial for making a simple javascript or c++ component (implementing the nsisimple interface).
...And 93 more matches
Index
2 creating javascript tests automated testing, b
uild documentation, g
uide, qa, spidermonkey in which test s
uite does your new test belong?
... 3 creating javascript jstest reftests ecmascript, g
uide, javascript, test in the js/src/tests directory, there are a few important subdirectories.
... 4 foss g
uide, spidermonkey feel free to add your own spidermonkey-based open source projects (and if necessary add categories)!
...And 65 more matches
Introduction to SSL - Archive of obsolete content
an encrypted ssl connection req
uires all information sent between a client and a server to be encrypted by the sending software and decrypted by the receiving software, thus providing a high degree of confidentiality.
...clients and servers may support different cipher s
uites, or sets of ciphers, depending on factors such as the version of ssl they support, company policies regarding acceptable encryption strength, and government restrictions on export of ssl-enabled software.
... among its other functions, the ssl handshake protocol determines how the server and client negotiate which cipher s
uites they will use to authenticate each other, to transmit certificates, and to establish session keys.
...And 60 more matches
Eclipse CDT
system req
uirements eclipse will use a lot of memory to fully index the mozilla source tree to provide code assistance features (easily 4 gb of ram, although this will drop to just over 1 gb if you restart after indexing is complete).
...this plugin is intended mainly for managed projects but we use an unmanaged project for mozilla (since it has its own b
uild system).
... using this plugin will result in parts of the
ui described below being hidden or disabled.
...And 56 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
this glossary provides definitions of words and abbreviations you need to know to successfully understand and b
uild for the web.
... 4 alpn alpn, draft, glossary, needscontent, tls application-layer protocol negotiation (alpn) is a tls extension which indicates what application layer protocol is negotiating the encryped connection without req
uiring additional round trips.
... 9 atag atag, accessibility, authoring tool accessibility g
uidelines, glossary atag (authoring tool accessibility g
uidelines) is a w3c recommendation for b
uilding accessible-authoring tools that produce accessible contents.
...And 53 more matches
Index - Firefox Developer Tools
found 158 pages: # page tags and summary 1 firefox developer tools developing mozilla, g
uide, tools, web development, web development:tools, l10n:priority firefox developer tools is a set of web developer tools b
uilt into firefox.
... 3 accessibility inspector accessibility, accessibility inspector, devtools, g
uide, tools the accessibility inspector provides a means to access important information exposed to assistive technologies on the current page via the accessibility tree, allowing you to check what's missing or otherwise needs attention.
... 4 color vision simulation accessibility, accessibility inspector, color blindness, devtools, g
uide, simulation, tools the simulator in the accessibility inspector in firefox developer tools lets you see what a web page would look like to users with various forms of color vision deficiency (better known as "color blindness"), as well as contrast sensitivity loss.
...And 53 more matches
StringView - Archive of obsolete content
on creating new immutable javascript strings to work with unicode encodings other than javascript's default utf-16 domstrings introduction as web applications become more and more powerful, adding features such as audio and video manipulation, access to raw data using websockets, and so forth, it has become clear that there are times when it would be helpful for javascript code to be able to q
uickly and easily manipulate raw binary data.
...noffset : 0, ntranscrtype = 15; if (sencoding) { this.encoding = sencoding.tostring(); } encswitch: switch (this.encoding) { case "utf-8": fputoutptcode = stringview.pututf8charcode; fgetoutptchrsize = stringview.getutf8charlength; ftaview =
uint8array; break encswitch; case "utf-16": fputoutptcode = stringview.pututf16charcode; fgetoutptchrsize = stringview.getutf16charlength; ftaview =
uint16array; break encswitch; case "utf-32": ftaview =
uint32array; ntranscrtype &= 14; break encswitch; default: /* case "ascii", or case "binarystring" or unknown cases */ ftaview...
... =
uint8array; ntranscrtype &= 14; } typeswitch: switch (typeof vinput) { case "string": /* the input argument is a primitive string: a new buffer will be created.
...And 52 more matches
Client-side form validation - Learn web development
previous overview: forms next before submitting data to the server, it is important to ensure all req
uired form controls are filled out, in the correct format.
... this is called client-side form validation, and helps ensure data submitted matches the req
uirements set forth in the various form controls.
... prereq
uisites: computer literacy, a reasonable understanding of html, css, and javascript.
...And 50 more matches
Eclipse CDT Manual Setup
some of it like the section on b
uilding the index and usage tips are still relevant, and other parts still may provide useful background information to understand it in more detail on how eclipse works.
... (this assumes that you already have a copy of the mozilla source, and that you have also b
uilt the source so that you have a pre-existing object directory.
... if that is not the case, then get your b
uild going now so that it can be running while you continue with the instructions below.
...And 49 more matches
Displaying Places information using views
the b
uilt-in views if you need to show the contents of bookmarks or history in your extension or application, you may want to use the b
uilt-in places views, which are generic and will save you a lot of time writing basic functionality so that you can focus on b
uilding your extension or application.
... places provides the following b
uilt-in views: tree menu toolbar instantiating the three b
uilt-in views are simply standard xul elements with a special type attribute whose value is "places".
... every xul document containing a b
uilt-in view must import the stylesheet browser/components/places/content/places.css and overlay the file browser/components/places/content/placesoverlay.xul: <?xml-stylesheet href="chrome://browser/content/places/places.css" ?> <?xul-overlay href="chrome://browser/content/places/placesoverlay.xul" ?> it's this stylesheet that binds elements with the special type attribute to one of the views.
...And 47 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
encryption and decryption allow two communicating parties to disg
uise information they send to each other.
... to get a driver's license, you typically apply to a government agency, such as the department of motor vehicles, which verifies your identity, your ability to drive, your address, and other information before iss
uing the license.
... to get a student id, you apply to a school or college, which performs different checks (such as whether you have paid your t
uition) before iss
uing the id.
...And 45 more matches
window.location - Web APIs
q
uisque in ante tellus, in placerat est.
...donec a mi magna, q
uis mattis dolor.
... etiam sit amet ligula q
uis urna auctor imperdiet nec faucibus ante.
...And 45 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
abstract this document is a concrete example of a centralized auto-configuration of mozilla apps, that are; firefox, thunderbird, mozilla s
uite 1.x.x, seamonkey and for the record, old netscape 4.x.
...l.smtpserver.smtp1.auth_method", 0); lockpref("mail.smtpserver.smtp1.hostname", "smtp-int.int-evry.fr"); lockpref("mail.smtpserver.smtp1.port", 25); lockpref("mail.smtpserver.smtp1.try_ssl", 0); lockpref("mail.smtpserver.smtp1.username", ""); lockpref("mail.smtpservers", "smtp1"); lockpref("mail.startup.enabledmailcheckonce", true); lockpref("mailnews.quotingprefs.version", 1); lockpref("mailnews.
ui.threadpane.version", 5); /* 3) define here (because if set after "4)" below it doesn't work!) processldapvalues which is eventually called by getldapattributes() just below, check getldapattributes() code from $mozilla_home/defaults/autoconfig/prefcalls.js to see the inside call to "user defined" processldapvalues */ function processldapvalues(values) { if(values) { // set the global var ...
...with the values returned from the ldap query ldap_values = values; var
uid = getldapvalue(values, "
uid"); var cn = getldapvalue(values, "cn"); var mail = getldapvalue(values, "mail"); var url = getldapvalue(values, "labeleduri"); // those ldap variables are only available in this processldapvalues context!
...And 44 more matches
HTTP Index - HTTP
rudp — the reliable update of udp — is a s
uitable alternative.
...a complete document is reconstructed from the different sub-documents fetched, for instance text, layout description, images, videos, scripts, and more 4 basics of http g
uide, http, overview http is a pretty extensible protocol.
... 5 choosing between www and non-www urls g
uide, http, url a recurring question among website owners is whether to choose non-www or www urls.
...And 42 more matches
Introduction to client-side frameworks - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages.
... the advent of modern javascript frameworks has made it much easier to b
uild highly dynamic, interactive applications.
... a framework is a library that offers opinions about how software gets b
uilt.
...And 40 more matches
Mozilla
the articles below include content about downloading and b
uilding mozilla code.
... in addition, you'll find helpful articles about how the code works, how to b
uild add-ons for mozilla applications and the like.
... an introduction to hacking mozilla this g
uide introduces the mozilla project and provides an overview for developers interested in contributing to or exploring the various parts of the codebase.
...And 38 more matches
Color picker tool - CSS: Cascading Style Sheets
colorpicker tool html <div id="container"> <div id="palette" class="block"> <div id="color-palette"></div> <div id="color-info"> <div class="title"> css color </div> </div> </div> <div id="picker" class="block"> <div class="
ui-color-picker" data-topic="picker" data-mode="hsl"></div> <div id="picker-samples" sample-id="master"></div> <div id="controls"> <div id="delete"> <div id="trash-can"></div> </div> <div id="void-sample" class="icon"></div> </div> </div> <div id="canvas" data-tutorial="drop"> <div id="zindex" class="
ui-input-slider" data-topic="z-index" d...
...ata-info="z-index" data-max="20" data-sensivity="10"></div> </div> </div> css /* * color picker tool */ .
ui-color-picker { width: 420px; margin: 0; border: 1px solid #ddd; background-color: #fff; display: table; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .
ui-color-picker .picking-area { width: 198px; height: 198px; margin: 5px; border: 1px solid #ddd; position: relative; float: left; display: table; } .
ui-color-picker .picking-area:hover { cursor: default; } /* hsv format - hue-saturation-value(brightness) */ .
ui-color-picker .picking-area { background: url('https://mdn.mozillademos.org/files/5707/picker_mask_200.png') center center; background: -moz-linear-gradient(bottom, #000 0%,...
...t, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -ms-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -ms-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -o-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -o-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background-color: #f00; } /* hsl format - hue-saturation-lightness */ .
ui-color-picker[data-mode='hsl'] .picking-area { background: -moz-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -moz-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -webkit-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0...
...And 38 more matches
JavaScript Daemons Management - Archive of obsolete content
ity the code the code of this framework is split into three files: daemon.js (the core) daemon-safe.js (an extension of the core which adds a replacement of setinterval with a recursive invocation of settimeout) daemon-methods.js (a wide and highly scalable collection of methods) the only independent module is daemon.js: both the daemon-safe.js module and the daemon-methods.js module req
uire daemon.js to work.
... daemon.prototype.rate = 100; daemon.prototype.length = infinity; daemon.prototype.reversals = 0; daemon.prototype.onstart = null; daemon.prototype.onstop = null; /* these properties should be read-only after the creation of the daemon */ daemon.prototype.session = -1; daemon.prototype.index = 0; daemon.prototype.paused = true; daemon.prototype.backw = true; /* system req
uired daemon global object methods */ daemon.forcecall = function (odmn) { odmn.index += odmn.backw ?
... -1 : 1; var bbreak = odmn.task.call(odmn.owner, odmn.index, odmn.length, odmn.backw) === false, bend = odmn.isatend(), binvert = odmn.reversals > 0; if (bend && !binvert || bbreak) { odmn.pause(); return false; } if (bend && binvert) { odmn.backw = !odmn.backw; odmn.reversals--; } return true; }; /* system not req
uired daemon global object methods */ /** * daemon global object optional methods (shortcuts).
...And 37 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
req
uired for accessibility autocomplete all hint for form autofill feature autofocus all automatically focus the form control when the page is loaded capture file media capture input method in file upload controls checked radio, checkbox whether the command or control is checked dirname text, search name of form field to use for...
...the value is not editable req
uired almost all boolean.
... a value is req
uired or must be check for the form to be submittable size email, password, tel, text size of the control src image same as src attribute for <img>; address of image resource step numeric types incremental values that are valid.
...And 36 more matches
Setting up your own test automation environment - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages; an idea of the high-level principles of cross browser testing, and automated testing.
...there are other ways, but the best way to use selenium is via webdriver, a powerful api that b
uilds on top of selenium and makes calls to a browser to automate it, carrying out actions such as "open this web page", "move over this element on the page", "click this link", "see whether the link opens this url", etc.
...most popular environments have available a package or framework that will install webdriver and the bindings req
uired to communicate with webdriver using this language, for example, java, c#, ruby, python, javascript (node), etc.
...And 35 more matches
Border-image generator - CSS: Cascading Style Sheets
id="remote-url" type="text" placeholder="load an image from url"/> <div id="load-remote" class="button"> </div> </div> <div id="general-controls" class="group section"> <div class="name"> control box </div> <div class="separator"></div> <div class="property"> <div class="name">scale</div> <div class="
ui-input-slider" data-topic="scale" data-unit="%" data-max="300" data-sensivity="10"> </div> </div> <div class="separator"></div> <div class="property"> <div class="name">draggable</div> <div class="
ui-checkbox" data-topic='drag-subject'></div> </div> <div class="property r...
...ight"> <div class="name">section height</div> <div class="
ui-input-slider" data-topic="preview-area-height" data-min="400" data-max="1000"> </div> </div> </div> <div id="preview_section" class="group section"> <div id="subject"> <div class="g
uideline" data-axis="y" data-topic="slice-top"></div> <div class="g
uideline" data-axis="x" data-topic="slice-right"></div> <div class="g
uideline" data-axis="y" data-topic="slice-bottom"></div> <div class="g
uideline" data-axis="x" data-topic="slice-left"></div> </div> <div id="preview"> </div> </div> <!-- controls --> <div id="controls" ...
...class="group section"> <!-- border-image-slice --> <div id="border-slice-control" class="category"> <div class="title"> border-image-slice </div> <div class="property"> <div class="name">fill</div> <div class="
ui-checkbox" data-topic='slice-fill'></div> </div> </div> <!-- border-image-width --> <div id="border-width-control" class="category"> <div class="title"> border-image-width </div> </div> <!-- border-image-outset --> <div id="border-outset-control" class="category"> <div class="title"> border-image-outset </div> </div> <!-- other-settings --> ...
...And 35 more matches
Menu - Archive of obsolete content
jetpack's menu api allows features to access and modify the browser's b
uilt-in menus.
...because it is still under development, the api currently lives in the future and must be imported before it is used: jetpack.future.import("menu"); menus all menus in jetpack are jetpack.menu objects, including both b
uilt-in firefox menus and menus that features create.
...jetpack.menu(men
uitems) creates a menu with the given items.
...And 34 more matches
WAI-ARIA basics - Learn web development
previous overview: accessibility next following on from the previous article, sometimes making complex
ui controls that involve unsemantic html and dynamic javascript-updated content can be difficult.
... prereq
uisites: basic computer literacy, a basic understanding of html, css, and javascript, an understanding of the previous articles in the course.
... objective: to gain familiarity with wai-aria, and how it can be used to provide useful additional semantics to enhance accessibility where req
uired.
...And 33 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
linear-gradient generator html content <div id="container"> <div id="gradient-container" data-alpha="true"> </div> <div id="controls"> <div class="section"> <div class="title"> active point </div> <div class="property"> <div class="
ui-input-slider" data-topic="point-position" data-info="position" data-unit="px" data-min="-1000" data-value="0" data-max="1000" data-sensivity="5"></div> <div id="delete-point" class="button"> delete point </div> </div> <div class="
ui-color-picker" data-topic="picker"></div> </div> <div class="section"> <div class="title"> active axis </div> ...
... <div class="property"> <div class="name"> axis unit </div> <div class="
ui-dropdown" data-topic="axis-unit" data-selected="1"> <div data-value='px'> pixels (px) </div> <div data-value='%'> percentage (%) </div> </div> <div id="delete-axis" class="button"> delete line </div> </div> <div class="property"> <div class="
ui-slider" data-topic="axis-rotation" data-info="rotation" data-min="-180" data-value="0" data-max="180"></div> </div> </div> <div id="tool-section" class="section"> <div class="title"> tool settings </div> ...
... <div id="gradient-axes"></div> <div id="gradient-order"></div> </div> </div> </div> <div id="output"> <div class="css-property"> <span class="property">background:</span> <span class="value"></span> </div> </div> </div> css content /* * color picker tool */ .
ui-color-picker { width: 420px; margin: 0; border: 1px solid #ddd; background-color: #fff; display: table; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .
ui-color-picker .picking-area { width: 198px; height: 198px; margin: 5px; border: 1px solid #ddd; position: relative; float: left; display: table; } .
ui-color-picker .picking-area:...
...And 33 more matches
Codecs used by WebRTC - Web media technologies
this g
uide reviews the codecs that browsers are req
uired to implement as well as other codecs that some or all browsers support for webrtc.
...this g
uide reviews the codecs that browsers are req
uired to implement as well as other codecs that some or all browsers support for webrtc.
... general codec req
uirements before looking at codec-specific capabilities and req
uirements, there are a few overall req
uirements that must be met by any codec configuration used with webrtc.
...And 33 more matches
Floats - Learn web development
prereq
uisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to learn how to create floated features on webpages, and to use the clear property and other methods of clearing floats.
... but web developers q
uickly realized that you can float anything, not just images, so the use of float broadened, for example to fun layout effects such as drop-caps.
...d
uis felis orci, pulvinar id metus ut, rutrum luctus orci.
...And 32 more matches
Getting started with Svelte - Learn web development
previous overview: client-side javascript frameworks next in this article we'll provide a q
uick introduction to the svelte framework.
...then we will learn how to setup our development environment, create a sample app, understand the structure of the project, and see how to run it locally and b
uild it for production.
... prereq
uisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line.
...And 32 more matches
Deploying our app - Learn web development
previous overview: understanding client-side tools in the final article in our series, we take the example toolchain we b
uilt up in the previous article and add to it so that we can deploy our sample app.
... prereq
uisites: familiarity with the core html, css, and javascript languages.
...as such, it's important to create a toolchain that handles these problems in a way that req
uires as little manual intervention as possible.
...And 32 more matches
mach
req
uirements mach req
uires a current version of /mozilla-central/ (or a tree derived from there).
...mach also req
uires python 2.7.
... for full help: $ ./mach help try b
uilding the tree: $ ./mach b
uild if you get error messages, make sure that you have all of the b
uild req
uisites for your system.
...And 32 more matches
HTML parser threading
nshtml5parser has one tokenizer/tree b
uilder pair for parsing data from document.write().
... it also has another lazily initialized tokenizer/tree b
uilder for speculatively scanning the tail of document.write() data when the parser blocks without parsing the document.write() data to completion.
... nshtml5streamparser has one tokenizer/tree b
uilder pair for parsing data from the network.
...And 32 more matches
nsIXULTemplateQueryProcessor
there is a one-to-one relationship between a template b
uilder and a query processor.
... the template b
uilder creates the query processor, and there is no other means to retrieve it.
...there is a one-to-one relationship between a template b
uilder and a query processor.
...And 32 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
browsers, like internet explorer 4, that were b
uilt before the conception of w3c standards inherited many q
uirks.
... in this article, i will describe mozilla's q
uirks mode, which provides strong backwards html compatibility with internet explorer and other legacy browsers.
... i'll also cover nonstandard technologies, such as xmlhttprequest and rich text editing, that mozilla does support because no w3c eq
uivalent existed at the time.
...And 31 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
toolkit applications (such as firefox) use a different autocomplete mechanism than the mozilla s
uite.
... autocompletesearch new in thunderbird 2req
uires seamonkey 1.1 type: space-separated list of values a space-separated list of search component names, each of which implements the nsiautocompletesearch interface.
... search-autocomplete req
uires seamonkey 2.1 the user's default search engine's suggestions are searched.
...And 31 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
autocompletesearch new in thunderbird 2req
uires seamonkey 1.1 type: space-separated list of values a space-separated list of search component names, each of which implements the nsiautocompletesearch interface.
... search-autocomplete req
uires seamonkey 2.1 the user's default search engine's suggestions are searched.
... places-tag-autocomplete req
uires seamonkey 2.1 the user's places tags are searched.
...And 31 more matches
WebIDL bindings
the webidl bindings are generated at b
uild time based on two things: the actual webidl file and a configuration file that lists some metadata about how the webidl should be reflected into gecko-internal code.
... all webidl files should be placed in dom/webidl and added to the list in the moz.b
uild file in that directory.
...resist the urge to just add your interfaces to the moz.b
uild list without the review; it will just annoy the dom peers and they'll make you get the review anyway.
...And 31 more matches
RDF in Mozilla FAQ - Archive of obsolete content
rdf in fifty words or less is a q
uick, high-level description of what rdf does in mozilla.
... the rdf back-end architecture document describes in more detail how mozilla's rdf implementation works, and gives a q
uick overview of the interfaces that are involved.
...by loading chunks of it into a xul
ui from a remote site), don't forget to let mozilla-rdf and the rdf interest group lists know.
...And 30 more matches
ARIA Test Cases - Accessibility
however, where things don't work we may test with nightly b
uilds if they are available, in order to show what is already fixed in upcoming releases.
... widget test cases alert simple alert complex alert real alert example with aria-req
uired and aria-invalid -- type in a email address without an at sign to test the alert expected at behavior: a screen reader or screen magnifier must speak an alert when it becomes visible.
... alertdialog alert dialog y
ui alert dialog (3rd button in this page) expected at behavior: at should speak the fact that this is an alert, the title and contents of the dialog, then place virtual focus or the real focus on the desired control (like a button).
...And 30 more matches
Multiple-column layout - Learn web development
prereq
uisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to learn how to create multiple-column layout on webpages, such as you might find in a newspaper.
... d
uis felis orci, pulvinar id metus ut, rutrum luctus orci.
...d
uis ornare egestas augue ut luctus.
...And 29 more matches
Cognitive accessibility - Accessibility
wcag g
uidelines wcag, web content accessibility g
uidelines, includes several g
uidelines to improve cognitive accessibility.
... these g
uidelines are published by the web accessibility initiative (wai) of the world wide web consortium (w3c), the main international standards organization for the internet.
... this group is also responsible for the accessible rich internet application (aria) g
uidelines.
...And 29 more matches
Media container formats (file types) - Web media technologies
in this g
uide, we'll look at the container formats used most commonly on the web, covering basics about their specifications as well as their benefits, limitations, and ideal use cases.
...the mime types and extensions for each are listed.the most commonly used containers for media on the web are probably mpeg-4 (mp4), q
uicktime movie (mov), and the wavefile audio file format (wav).
...not all of these are broadly supported by browsers, however; some combinations of container and codec are sometimes given their own file extensions and mime types as a matter of convenience, or because of their ubiq
uity.
...And 29 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
q
uick tip if you must determine if a visitor is using a gecko-based browser, simply test navigator.product == 'gecko' or look for the string 'gecko/' in the navigator.useragent.
...however, we don't q
uite live in such a world yet.
... the most common approach at this time was to disting
uish user agents by vendor and version using the reported user agent string.
...And 28 more matches
Index of archived content - Archive of obsolete content
.htaccess ( hypertext access ) 2015 mdn fellowship program api navigator navigator.moznotification add-ons add-on sdk b
uilder g
uides content scripts communicating with other scripts communicating using "port" communicating using "postmessage" cross-domain content scripts interacting with page scripts loading content scripts reddit example port self ...
... contributor's g
uide classes and inheritance content processes getting started modules private properties firefox compatibility module structure of the sdk porting the library detector program id sdk api lifecycle sdk and xul comparison testing the add-on sdk two types of scripts working with events xul migration g
uide high-level apis addon-page base64 clipboard ...
...xed-db l10n notifications page-mod page-worker panel passwords private-browsing querystring request selection self simple-prefs simple-storage system tabs timers
ui url widget windows low-level apis /loader chrome console/plain-text console/traceback content/content content/loader content/mod content/symbiont content/worker ...
...And 27 more matches
JavaScript Client API - Archive of obsolete content
aged and protected; (b) that your third party client will only store data in encrypted form on the firefox sync servers operated by mozilla; (c) that you and your third party client will use the firefox sync apis solely for their intended purpose; (d) that your third party client will not hide or mask its identity as it uses the services and/or firefox sync apis, including by failing to follow req
uired identification conventions; and (e) that you and your third party client will not use the firefox sync apis for any application or service that replicates or attempts to replicate the services or firefox sync experience unless such use is non-confusing (by non-confusing, we mean that people should always know with whom they are dealing and where the information or software they are downloading...
... a word of warning: the javascript client api is still a young component and is contin
uing to evolve.
... therefore, developers outside of the sync core should know that their code could req
uire significant refactoring in future releases.
...And 27 more matches
The Joy of XUL - Archive of obsolete content
this g
uide is designed to introduce application developers and their managers to xul so they can not only understand why mozilla's platform is based on it, but how they might adopt it for their own use.
... xul (pronounced "zool") is mozilla's xml-based user interface language that lets you b
uild feature rich cross-platform applications that can run connected to or disconnected from the internet.
...web developers already familiar with dynamic html (dhtml) will learn xul q
uickly and can start b
uilding applications right away.
...And 27 more matches
Introducing a complete toolchain - Learn web development
previous overview: understanding client-side tools next in the final couple of articles in the series we will solidify your tooling knowledge by walking you through the process of b
uilding up a sample case study toolchain.
... prereq
uisites: familiarity with the core html, css, and javascript languages.
... introducing our case study the toolchain that we are creating in this article will be used to b
uild and deploy a mini site that lists data (taken from one of nasa's open apis) concerning potentially hazardous space objects that threaten our existence on earth!
...And 27 more matches
An overview of NSS Internals
(note that it's important to look at the number 11, as there are other pkcs standards with different numbers that define q
uite different topics.) a software or hardware module conforming to the pkcs#11 standard implements an interface of c calls, which allow querying the characteristics and offered services of the module.
...this strategy allows nss to work with many hardware devices (e.g., to speed up the calculations req
uired for cryptographic operations, or to access smartcards that securely protect a secret key) and software modules (e.g., to allow to load such modules as a plugin that provides additional algorithms or stores key or trust information) that implement the pkcs#11 interface.
...this set, including their trust assignments, is provided by nss as a software module, called ckbi (“b
uilt-in root certificates”), which also implements the pkcs#11 interface.
...And 27 more matches
Index
the downsides are that we have had some bugs, it complicates and bloats the code, and it req
uires more testing.
... 18 cookies in thunderbird cookies, g
uide, thunderbird in versions of thunderbird prior to 3 the cookie policy was very restrictive (to rss only).
...it assumes you are already familiar with configuring preferences for deployed b
uilds in addition to setting up thunderbird to use an ldap directory.
...And 27 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
using this information, a screen reader will speak out loud important changes to the document or
ui, and allow the user to track where they navigate.
...finally, voice dictation software needs to know what's in the current document or
ui in order to implement "say what you see" kinds of features.
... on microsoft windows, these kinds of assistive technology acq
uire this necessary information via a combination of hacks, msaa and proprietary doms.
...And 27 more matches
Enhanced Extension Installation - Archive of obsolete content
items that are installed must be visible in the extension manager user interface, even if the extension type is just an integration hook that has no meaningful
ui presence.
... in the profile directory, the file compatibility.ini stores information about the version of the application (b
uild info) that last started this profile - during startup this file is checked and if the version info held by the running app disagrees with the info held by this file, a compatibility check is run on all installed items.
...sections of
ui that display installed items are rooted on these containers.
...And 26 more matches
Setting Up a Development Environment - Archive of obsolete content
« previousnext » getting the right tools there are 3 tools that we think are essential for effective add-on development (or any kind of development, really): a source code editor, a source control system, and a b
uild system.
...we chose make because this is the same system used by mozilla to b
uild firefox, and it is available for all operating systems.
... we recommend you set up make in your system, since our examples come with all the necessary files to b
uild and install the resulting xpi using this tool.
...And 26 more matches
RDF Modifications - Archive of obsolete content
this involves a third type of observer involved in a template b
uilder, an nsirdfobserver, used to listen for modifications to the rdf datasource.
...the template b
uilder uses these notifcations to update the template as necessary based on the new or removed information.
...if the reloaded datasource hasn't changed, the b
uilder won't receive any notifications.
...And 26 more matches
Box-shadow generator - CSS: Cascading Style Sheets
e" data-type="subject" data-title=":before"> :before <span class="delete" data-type="disable"></span> </div> <div class="button" id="after" data-type="subject" data-title=":after"> :after <span class="delete" data-type="disable"></span> </div> <div class="
ui-checkbox" data-topic='before' data-label=":before"></div> <div class="
ui-checkbox" data-topic='after' data-label=":after"></div> </div> <div id="preview"> <div id="obj-element"> <div class="content"> </div> <div id="obj-before"> </div> <div id="obj-after"> </div> </...
... data-title='' data-action="hexa"></div> </div> </div> </div> </div> <div class="wrap-right"> <div id="shadow_properties" class="category"> <div class="title"> shadow properties </div> <div class="group"> <div class="group property"> <div class="
ui-slider-name"> inset </div> <div class="
ui-checkbox" data-topic='inset'></div> </div> <div class="slidergroup"> <div class="
ui-slider-name"> position x </div> <div class="
ui-slider-btn-set" data-topic="posx" data-type="sub"></div> <div class="
ui-slider" data-topic...
...="posx" data-min="-500" data-max="500" data-step="1"> </div> <div class="
ui-slider-btn-set" data-topic="posx" data-type="add"></div> <div class="
ui-slider-input" data-topic="posx" data-unit="px"></div> </div> <div class="slidergroup"> <div class="
ui-slider-name"> position y </div> <div class="
ui-slider-btn-set" data-topic="posy" data-type="sub"></div> <div class="
ui-slider" data-topic="posy" data-min="-500" data-max="500" data-step="1"> </div> <div class="
ui-slider-btn-set" data-topic="posy" data-type="add"></div> <div class="
ui-sli...
...And 26 more matches
Index - Game development
4 index meta found 74 pages: 5 introduction to html5 game development (summary) firefox os, games, html5, mobile games b
uilt with html5 work on smartphones, tablets, pcs and smart tvs.update your game whenever you want.players can play the game anywhere, anytime.
... 6 introduction to game development for the web firefox os, games, g
uide, mobile no summary!
... 11 techniques for game development games, g
uide this page lists essential core techniques for anyone wanting to develop games using open web technologies.
...And 24 more matches
Accessibility documentation index - Accessibility
it supplements html so that interactions and widgets commonly used in applications can be passed to assistive technologies 3 aria screen reader implementors g
uide aria, accessibility this is just a g
uide.
...the following is intended to provide implementation g
uidance that respects screen readers developers' need to try different things.
... the intention is to strike a balance between providing useful g
uidance on how to use the markup's intended meaning while supporting live regions as an area for screen readers to innovate and compete.
...And 24 more matches
Install Manifests - Archive of obsolete content
layout the basic layout of an install manifest is like so: <?xml version="1.0" encoding="utf-8"?> <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"> <!-- properties --> </description> </rdf> some properties are req
uired, some are optional.
... req
uired property reference your install manifest must specify these properties correctly otherwise your add-on may not install.
... id the id of the extension, which must be one of the following: g
uid (firefox 1.0) a string formatted like so: extensionname@example.org the latter format is significantly easier to generate and manipulate.
...And 23 more matches
Template and Tree Listeners - Archive of obsolete content
« previousnext » there are several listeners (or observers) used during the template b
uild process, each used for different purposes.
... these each implement a different xpcom interface, as listed below: nsixulb
uilderlistener - used to listen to template reb
uilds.
... nsixultreeb
uilderobserver - used to listen to particular tree operations.
...And 23 more matches
Mozilla’s UAAG evaluation report
the uaag document contains a very rich set of accessibility g
uidelines, that broadly define how accessibility should be implemented by any user agent, i.e.
...this uaag evaluation report covers nightly b
uilds of the mozilla web browser itself, running on windows 2000, as of february 20, 2002.
...when filing mozilla bugs based on uaag req
uirements, please use bug 24413 as the uaag meta bug.
...And 23 more matches
/loader - Archive of obsolete content
it can be loaded as a javascript code module: let { loader, req
uire, unload } = components.utils.import('resource://gre/modules/commonjs/toolkit/loader.js'); it can be req
uired as a commonjs module from a module loaded in the loader itself: let { loader, req
uire, unload } = req
uire('toolkit/loader'); what is it good for ?
... secure each module in an isolated js sandbox and makes any capability imports explicit via calls to the req
uire() function.
... paths the loader needs to be provided with a set of locations to indicate where to find modules loaded using req
uire().
...And 22 more matches
JXON - Archive of obsolete content
oxmlparent.childnodes.item(nitem); if (onode.nodetype === 4) { scollectedtxt += onode.nodevalue; } /* nodetype is "cdatasection" (4) */ else if (onode.nodetype === 3) { scollectedtxt += onode.nodevalue.trim(); } /* nodetype is "text" (3) */ else if (onode.nodetype === 1 && !onode.prefix) { atmpels.push(onode); } /* nodetype is "element" (1) */ } var nlevelend = atmpels.length, vb
uiltval = parsetext(scollectedtxt); if (oparentnode.hasattributes && oxmlparent.hasattributes()) { vresult = objectify(vb
uiltval); for (nlength; nlength < oxmlparent.attributes.length; nlength++) { oattrib = oxmlparent.attributes.item(nlength); vresult["@" + oattrib.name.tolowercase()] = parsetext(oattrib.value.trim()); } } else if (nlevelend > nlevelstart) { vresult = o...
...bjectify(vb
uiltval); } for (var nelid = nlevelstart; nelid < nlevelend; nelid++) { sprop = atmpels[nelid].nodename.tolowercase(); vcontent = getjxontree(atmpels[nelid]); if (vresult.hasownproperty(sprop)) { if (vresult[sprop].constructor !== array) { vresult[sprop] = [vresult[sprop]]; } vresult[sprop].push(vcontent); } else { vresult[sprop] = vcontent; nlength++; } } atmpels.length = nlevelstart; if (nlength === 0) { vresult = scollectedtxt ?
... vb
uiltval : /* put here the default value for empty nodes: */ true; } /* else { object.freeze(vresult); } */ return vresult; } var myobject = getjxontree(doc); alert(myobject.catalog.product.catalog_item[1].size.color_swatch["@image"]); // "black_cardigan.jpg" alert(myobject.catalog.product.catalog_item[1].size.color_swatch); // "black" !
...And 22 more matches
Introduction to automated testing - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross-browser testing.
...there are two main ways in which we can automate the tests we've been talking about in this module: use a task runner such as grunt or gulp, or npm scripts to run tests and clean up code during your b
uild process.
... using a task runner to automate testing tools as we said above, you can drastically speed up common tasks such as linting and minifying code by using a task runner to run everything you need to run automatically at a certain point in your b
uild process.
...And 22 more matches
page-mod - Archive of obsolete content
for example, the following add-on displays an alert whenever the user visits any page hosted at "mozilla.org": var pagemod = req
uire("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscript: 'window.alert("page matches ruleset");' }); you can modify the document in your script: var pagemod = req
uire("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscript: 'document.body.innerhtml = ' + ' "<h1>page matches ruleset</h1>";' }); you can supply the content script(...
... if you supply the scripts as separate files in the "data" directory, you specify them using with a url, typically constructed using the url() method of the self module's data object: var data = req
uire("sdk/self").data; var pagemod = req
uire("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: data.url("my-script.js") }); var data = req
uire("sdk/self").data; var pagemod = req
uire("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: [data.url("jquery-1.7.min.js"), data.url("my-script.js")] }); from firefox 34, you ca...
...so you can rewrite the above code like this: var pagemod = req
uire("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: "./my-script.js" }); unless your content script is extremely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo.
...And 21 more matches
Introduction to XUL - Archive of obsolete content
preamble mozilla has configurable, downloadable chrome, meaning that the arrangement and even presence or absence of controls in the main window is not hardwired into the application, but loaded from a separate
ui description.
...xul (pronounced "zool," as if that spelling helped any, and short for "xml user interface language") is our name for the language in which these
ui descriptions are b
uilt.
...
ui descriptions, then, look a great deal like html 4.
...And 21 more matches
Menus - Archive of obsolete content
the popup tag is deprecated but is eq
uivalent to the menupopup tag.
... <menubar id="sample-menubar"> <menu id="file-menu" label="file"> <menupopup id="file-popup"> <men
uitem label="new"/> <men
uitem label="open"/> <men
uitem label="save"/> <menuseparator/> <men
uitem label="exit"/> </menupopup> </menu> </menubar> there are five tags used in this example, described briefly here: menubar a row of menus that appears along the top of the window or screen.
... men
uitem a single item to appear on a menu.
...And 21 more matches
Mozilla release FAQ - Archive of obsolete content
if b
uilt from cvs, the date of the cvs checkout is the best way to refer to the version, otherwise use the release number.
...it is more s
uitable for being embedded in other applications than the previous rendering engine.
...here are a few that are specific to the mozilla newsgroups: fe = front end -- the part of mozilla that handles the interface be = back end -- the part of mozilla that does all the behind-the-scenes stuff nspr = netscape portable runtime -- an abstraction layer over the local os gtk = a free g
ui toolkit native to unix qt = another g
ui toolkit xp = cross platform xpfe = cross-platform frontend based on nglayout m[number] = milestone release [number] (no longer used) i'm wondering how to do xxx with navigator 3.x...
...And 21 more matches
Introduction to CSS layout - Learn web development
prereq
uisites: the basics of html (study introduction to html), and an idea of how css works (study introduction to css.) objective: to give you an overview of css page layout techniques.
...let's look at a q
uick html example: <p>i love my cat.</p> <ul> <li>buy cat food</li> <li>exercise</li> <li>cheer up friend</li> </ul> <p>the end!</p> by default, the browser will display this code as follows: note here how the html is displayed in the exact order in which it appears in the source code, with elements stacked up on top of one another — the first paragraph, followed by the unordered list...
... the rest of this g
uide covers other layout methods, which are less important for the main layout structures of your page but can still help you achieve specific tasks.
...And 21 more matches
Debugging on Mac OS X
creating a debuggable b
uild first, you need to b
uild the application you're going to debug using --disable-optimize--enable-debug-symbols in your .mozconfig (also add --enable-debug if you want assertions etc.
...see b
uilding firefox for macos if you need help creating your own b
uild.
...macos 10.15 went further, req
uiring applications to be notarized with hardened runtime enabled in order to launch (ignoring workarounds.) when run on earlier macos versions, notarization and hardened runtime settings have no effect.
...And 21 more matches
NSS_3.12_release_notes.html
nss 3.12 req
uires nspr 4.7.1.
... see the documentation section for the b
uild instructions.
...both debug and optimized b
uilds are provided.
...And 21 more matches
Python binding for NSS
nss is b
uilt upon nspr because nspr provides an abstraction of common operating system services, particularly in the areas of networking and process management.
...the design of python-nss follows these basic g
uiding principles: be a thin layer with almost a one-to-one mapping of nss/nspr calls to python methods and functions.
... programmers already familiar with nss/nspr will be q
uite comfortable with python-nss.
...And 21 more matches
Starting WebLock
the sample component you've b
uilt up so far doesn't do anything.
...the nsiobserver is a generic interface for passing messages between two or more objects without defining a specific frozen interface, and it's one of the ways in which extensibility is b
uilt into xpcom.
...the category name also maps nicely onto the notion of a notification "topic." the topic name could be something like "xpcom-startup", for instance, and the name-value pair could contain the contract ids req
uired to create the components requesting startup.
...And 21 more matches
HTML documentation index - HTML: Hypertext Markup Language
found 237 pages: # page tags and summary 1 html: hypertext markup language html, html5, landing, web, l10n:priority html (hypertext markup language) is the most basic b
uilding block of the web.
... 3 applying color to html elements using css beginner, css, css colors, g
uide, html, html colors, html styles, styling html, color with css, there are lots of ways to add color to your html elements to create just the look you want.
... 4 block-level elements beginner, development, g
uide, html, html5, web html (hypertext markup language) elements historically were categorized as either "block-level" elements or "inline-level" elements.
...And 21 more matches
Package management basics - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages.
... without modern b
uild tools, dependencies like this might be included in your project using a simple <script> element, but this might not work right out of the box and you will likely need some modern tooling to bundle your code and dependencies together when they are released on the web.
...it can also automatically b
uild our code.
...And 20 more matches
OS.File for the main thread
let decoder = new textdecoder(); // this decoder can be reused for several reads let promise = os.file.read("file.txt"); // read the complete file as an array promise = promise.then( function onsuccess(array) { return decoder.decode(array); // convert this array to a text } ); this example req
uires firefox 18 or a more recent version.
... these examples req
uire firefox 19 or a more recent version.
... let promise = os.file.copy("oldname.txt", "newname.txt"); this example req
uires firefox 16 or a more recent version.
...And 20 more matches
Profiling with the Firefox Profiler
the firefox profiler is a profiler that is b
uilt into firefox and is available at profiler.firefox.com.
... reporting a performance problem has a step-by-step g
uide for obtaining a profile when requested by firefox developers.
... tip: threads that are annotated with "[default]" are in the parent (aka "
ui", aka "browser chrome", aka "main") process and those annotated with "[tab]" are in the web content (aka "child") processes.
...And 20 more matches
nss tech note1
how to use the nss asn.1 and q
uickder decoders nss technical note: 1 nss 3.6 contains several decoders for asn.1 and der.two of them are extensively used and are part of the public nss api : the "classic" asn.1 decoder, written by lisa repka .
... this was written to be a generic decoder, that includes both der (disting
uished encoding rules) and ber (basic encoding rules).† it handles both streaming and non-streaming input.
... the "q
uickder" decoder, written by julien pierre for nss 3.6 .
...And 20 more matches
NSS environment variables
there is a separate set of environment variables that affect how nss is b
uilt, documented below.
... [2|r|r]: ssl_renegotiate_req
uires_xtn (default) only allows renegotiation if the peer's hello bears the tls renegotiation_info extension.
... 3.12.5 modified in 3.12.6 nss_ssl_req
uire_safe_negotiation boolean (1 to enable) it controls whether safe renegotiation indication is req
uired for initial handshake.
...And 20 more matches
nsINavBookmarkObserver
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 21.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) method overview void onbeforeitemremoved(in long long aitemid, in unsigned short aitemtype, in long long aparentid, in acstring ag
uid, in acstring aparentg
uid); obsolete since gecko 21.0 void onbeginupdatebatch(); void onendupdatebatch(); void onfolderadded(in print64 folder, in print64 parent, in print32 index); obsolete since gecko 1.9 void onfolderchanged(in print64 folder, in acstring property); obsolete since gecko 1.9 void onfoldermoved(in print64 folder, in print64 oldparent...
..., in print32 oldindex, in print64 newparent, in print32 newindex); obsolete since gecko 1.9 void onfolderremoved(in print64 folder, in print64 parent, in print32 index); obsolete since gecko 1.9 void onitemadded(in long long aitemid, in long long aparentid, in long aindex, in unsigned short aitemtype, in nsiuri auri, in autf8string atitle, in prtime adateadded, in acstring ag
uid, in acstring aparentg
uid); void onitemchanged(in long long aitemid, in acstring aproperty, in boolean aisannotationproperty, in autf8string anewvalue, in prtime alastmodified, in unsigned short aitemtype, in long long aparentid, in acstring ag
uid, in acstring aparentg
uid); void onitemmoved(in long long aitemid, in long long aoldparentid, in long aoldindex, in long long anewparentid...
..., in long anewindex, in unsigned short aitemtype, in acstring ag
uid, in acstring aoldparentg
uid, in acstring anewparentg
uid); void onitemremoved(in long long aitemid, in long long aparentid, in long aindex, in unsigned short aitemtype, in nsiuri auri, in acstring ag
uid, in acstring aparentg
uid); void onitemreplaced(in print64 folder, in nsiuri item, in nsiuri newitem); obsolete since gecko 1.9 void onitemvisited(in long long aitemid, in long long avisitid, in prtime atime, in unsigned long atransitiontype, in nsiuri auri, in long long aparentid, in acstring ag
uid, in acstring aparentg
uid); void onseparatoradded(in print64 parent, in print32 index); obsolete since gecko 1.9 void onseparatorremoved(in print64 parent, in print32 index); obsolete sin...
...And 20 more matches
nsIVariant
nsresult getasarray(out pr
uint16 type, out nsiid iid, out pr
uint32 count, out voidptr ptr); violates the xpcom interface g
uidelines astring getasastring(); native code only!
... nsresult getasid(out nsid retval); violates the xpcom interface g
uidelines print16 getasint16(); native code only!
... pr
uint8 getasint8(); native code only!
...And 20 more matches
XPIDL
xpidl:syntax (now up to date again) xpidl syntax (out of date) xpidl author's g
uide (not as out of date) explanation of idl semantics a full g
uide to the syntax can be found at xpidl:syntax, which is written in an abnf form.
...in addition, there are a few b
uilt-in native types.
... the b
uilt-in native types are those listed under the type_spec production above.
...And 20 more matches
DevTools API - Firefox Developer Tools
a definition is a js light object that exposes different information about the tool (like its name and its icon), and a b
uild method that will be used later-on to start an instance of this tool.
...the toolpanel is b
uilt only when the tool is selected (not when the toolbox is opened).
...to use the gdevtools api from an add-on, it can be imported with following snippet const { gdevtools } = req
uire("resource:///modules/devtools/gdevtools.jsm"); methods registertool(tooldefinition) registers a new tool and adds a tab to each existing toolbox.
...And 20 more matches
Operable - Accessibility
this article provides practical advice on how to write your web content so that it conforms to the success criteria outlined in the operable principle of the web content accessibility g
uidelines (wcag) 2.0 and 2.1.
... note: to read the w3c definitions for operable and its g
uidelines and success criteria, see principle 2: operable — user interface components and navigation must be operable.
... g
uideline 2.1 — keyboard accessible: make all functionality available from a keyboard this g
uideline covers the necessity of making core website functionality available via a keyboard in addition to other means (e.g.
...And 20 more matches
Perceivable - Accessibility
this article provides practical advice on how to write your web content so that it conforms to the success criteria outlined in the perceivable principle of the web content accessibility g
uidelines (wcag) 2.0 and 2.1.
... note: to read the w3c definitions for perceivable and its g
uidelines and success criteria, see principle 1: perceivable - information and user interface components must be presentable to users in ways they can perceive.
... g
uideline 1.1 — providing text alternatives for non-text content the key here is that text can be converted to other forms that people with disabilities can use.
...And 20 more matches
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
installing this is bundled with the mozilla s
uite and the current version of seamonkey, but it needs to be installed as an extension in firefox.
... fixme: figure 1: uncheck “exclude browser files.” set up q
uicknote for the purposes of this explanation, we’re going to use the file-storage mechanism in q
uicknote1 for our debugger.
... install q
uicknote from the following url and relaunch firefox.
...And 19 more matches
Gecko Compatibility Handbook - Archive of obsolete content
** notes ** - the solution q
uick reference needs more attention.
...because of gecko's cross-platform nature, functionality is generally very much the same on different platforms unlike internet explorer for mac and ie for windows, which are very different programs and so may behave q
uite differently from each other.
... q
uick compatibility test if your site uses netscape 4.x and microsoft proprietary technologies, see using web standards in your web pages for a q
uick tutorial on standards.
...And 19 more matches
Legacy layout methods - Learn web development
prereq
uisites: html basics (study introduction to html), and an idea of how css works (study introduction to css and styling boxes.) objective: to understand the fundamental concepts behind the grid layout systems used prior to css grid layout being available in browsers.
... layout and grid systems before css grid layout it may seem surprising to anyone coming from a design background that css didn’t have an inb
uilt grid system until very recently, and instead we seemed to be using a variety of sub-optimal methods to create grid-like designs.
...d
uis felis orci, pulvinar id metus ut, rutrum luctus orci.
...And 19 more matches
Deployment and next steps - Learn web development
prereq
uisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line.
... you'll need a terminal with node + npm installed to compile and b
uild your app.
...as we saw earlier, this instruction tells svelte to compile our components and javascript files into a public/b
uild/bundle.js file and all the css sections of our components into public/b
uild/bundle.css.
...And 19 more matches
Index
found 42 pages: # page tags and summary 1 localization at mozilla landing, localization, mozilla, translation, l10n localization (l10n) is the process of translating software user interfaces from one language to another and adapting it to s
uit a foreign culture.
... 2 application translation with mercurial android, draft, editing, firefox, lightning, localization, mercurial, seamonkey, translate, patch, thunderbird first, get the req
uired programs to compile mozilla applications like firefox and thunderbird from b
uild instructions.
... 10 localization notes g
uide, internationalization, localization, mozilla localizers usually work on the localizable files without the context of the source files including the localized strings; it is important to add comments to the localizable files themselves, too.
...And 19 more matches
Places utilities for JavaScript
utils.js is accessible at the following url: http://mxr.mozilla.org/mozilla-centr...ntent/utils.js this file includes utility functions used by a lot of the bookmarking, tagging, and annotation services that are b
uilt into firefox.
... warning : placesutils class since firefox 3 beta 5 has been split into: placesutils: can be used in any toolkit application places
uiutils: only in firefox placesutils this is a gigantic object full of usefulness if you need to do any bookmark work from within browser.xul.
...wrapnode(nsinavhistoryresultnode anode, string atype, nsiuri aoverrideuri); array unwrapnodes(string blob, string atype); nsitransaction maketransaction(string data, string type, nsinavhistoryresultnode container, int index, boolean copy); nsinavhistoryresult getfoldercontents(int afolderid, boolean aexcludeitems, boolean aexpandqueries); boolean showaddbookmark
ui(nsiuri auri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker, boolean aloadinsidebar, string akeyword, string apostdata); boolean showminimaladdbookmark
ui(nsiuri auri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker, boolean aloadinsidebar, string akeyword, string apostdata); boolean showaddlivemark
ui(nsiuri...
...And 19 more matches
nsCStringContainer (External)
compare(const char*, print32 (*) compare(const nsacstring&, print32 (*) equals(const char*, print32 (*) equals(const nsacstring&, print32 (*) operator< operator<= operator== operator>= operator> operator!= equalsliteral find(const nsacstring&, print32 (*) find(const nsacstring&, pr
uint32, print32 (*) find(const char*, print32 (*) find(const char*, pr
uint32, print32 (*) rfind(const nsacstring&, print32 (*) rfind(const nsacstring&, print32, print32 (*) rfind(const char*, print32 (*) rfind(const char*, print32, print32 (*) findchar rfindchar appendint tointeger base classes nsacstri...
...methods beginreading pr
uint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
... parameters char* begin char* end char beginreading() const - source endreading char endreading() const - source charat char charat(pr
uint32) const - source parameters pr
uint32 apos operator[] char operator[](pr
uint32) const - source parameters pr
uint32 apos first char first() const - source beginwriting pr
uint32 beginwriting(char**, char**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...And 19 more matches
nsDependentCSubstring external
methods constructors void nsdependentcsubstring_external() - source void nsdependentcsubstring_external(const char*, pr
uint32) - source parameters char* astart pr
uint32 alength void nsdependentcsubstring_external(const nsacstring&, pr
uint32) - source parameters nsacstring& astr pr
uint32 astartpos void nsdependentcsubstring_external(const nsacstring&, pr
uint32, pr
uint32) - source parameters nsacstring& astr pr
uint32...
... astartpos pr
uint32 alength rebind void rebind(const char*, pr
uint32) - source parameters char* astart pr
uint32 alength beginreading pr
uint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
... parameters char** begin char** end char* beginreading() const - source endreading char* endreading() const - source charat char charat(pr
uint32) const - source parameters pr
uint32 apos operator[] char operator[](pr
uint32) const - source parameters pr
uint32 apos first char first() const - source beginwriting pr
uint32 beginwriting(char**, char**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...And 19 more matches
Understandable - Accessibility
this article provides practical advice on how to write your web content so that it conforms to the success criteria outlined in the understandable principle of the web content accessibility g
uidelines (wcag) 2.0 and 2.1.
... note: to read the w3c definitions for understandable and its g
uidelines and success criteria, see principle 3: understandable — information and the operation of user interface must be understandable.
... g
uideline 3.1 — readable: make text content readable and understandable this g
uideline focuses on making text content as understandable as possible.
...And 19 more matches
context-menu - Archive of obsolete content
declarative contexts you can specify some simple, declarative contexts when you create a menu item by setting the context property of the options object passed to its constructor, like this: var cm = req
uire("sdk/context-menu"); cm.item({ label: "my menu item", context: cm.urlcontext("*.mozilla.org") }); constructor description pagecontext() the page context.
...for example: var context = req
uire("sdk/context-menu").selectorcontext("img"); mymen
uitem.context.add(context); mymen
uitem.context.remove(context); when a menu item is bound to more than one context, it appears in the menu when all of those contexts occur.
... for example, this item appears whenever the context menu is invoked on a page that contains at least one image: req
uire("sdk/context-menu").item({ label: "this page has images", contentscript: 'self.on("context", function (node) {' + ' return !!document.queryselector("img");' + '});' }); note that the listener function has a parameter called node.
...And 18 more matches
Responsive design - Learn web development
previous overview: css layout next in the early days of web design, pages were b
uilt to target a particular screen size.
...as more diverse screen sizes became available, the concept of responsive web design (rwd) appeared, a set of practices that allows web pages to alter their layout and appearance to s
uit different screen widths, resolutions, etc.
... prereq
uisites: html basics (study introduction to html), and an idea of how css works (study css first steps and css b
uilding blocks.) objective: to understand the fundamental concepts and history of responsive design.
...And 18 more matches
How to structure a web form - Learn web development
prereq
uisites: basic computer literacy, and a basic understanding of html.
... the flexibility of forms makes them one of the most complex structures in html; you can b
uild any kind of basic form using dedicated form elements and attributes.
... using correct structure when b
uilding an html form will help ensure that the form is both usable and accessible.
...And 18 more matches
NSS Tools modutil
availability this tool is known to b
uild on solaris 2.5.1 (sunos 5.5.1) and windows nt 4.0.
...in this context, the term "password" is eq
uivalent to a personal identification number (pin).
...the options and arguments in square brackets are optional, those without square brackets are req
uired.
...And 18 more matches
NS ConvertUTF16toUTF8 external
methods constructors void ns_convertutf16toutf8_external(const nsastring&) - source parameters nsastring& astr void ns_convertutf16toutf8_external(const prunichar*, pr
uint32) - source parameters prunichar* adata pr
uint32 alength get char* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters ...
... nsacstring& astring nsacstring& operator=(const char*) - source parameters char* aptr nsacstring& operator=(char) - source parameters char achar adopt void adopt(const char*, pr
uint32) - source parameters char* adata pr
uint32 alength beginreading pr
uint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
... parameters char** begin char** end char* beginreading() const - source endreading char* endreading() const - source charat char charat(pr
uint32) const - source parameters pr
uint32 apos operator[] char operator[](pr
uint32) const - source parameters pr
uint32 apos first char first() const - source beginwriting pr
uint32 beginwriting(char**, char**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...And 18 more matches
NS LossyConvertUTF16toASCII external
methods constructors void ns_lossyconvertutf16toascii_external(const nsastring&) - source parameters nsastring& astr void ns_lossyconvertutf16toascii_external(const prunichar*, pr
uint32) - source parameters prunichar* adata pr
uint32 alength get char* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters ...
... nsacstring& astring nsacstring& operator=(const char*) - source parameters char* aptr nsacstring& operator=(char) - source parameters char achar adopt void adopt(const char*, pr
uint32) - source parameters char* adata pr
uint32 alength beginreading pr
uint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
... parameters char** begin char** end char* beginreading() const - source endreading char* endreading() const - source charat char charat(pr
uint32) const - source parameters pr
uint32 apos operator[] char operator[](pr
uint32) const - source parameters pr
uint32 apos first char first() const - source beginwriting pr
uint32 beginwriting(char**, char**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...And 18 more matches
nsACString (External)
methods beginreading pr
uint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
... parameters char** begin char** end char* beginreading() const - source endreading char* endreading() const - source charat char charat(pr
uint32) const - source parameters pr
uint32 apos operator[] char operator[](pr
uint32) const - source parameters pr
uint32 apos first char first() const - source beginwriting pr
uint32 beginwriting(char**, char**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...pass pr_
uint32_max to leave the length unchanged.
...And 18 more matches
nsCString external
methods constructors void nscstring_external() - source void nscstring_external(const nscstring_external&) - source parameters nscstring_external& astring void nscstring_external(const nsacstring&) - source parameters nsacstring& areadable void nscstring_external(const char*, pr
uint32) - source parameters char* adata pr
uint32 alength get char* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsa...
...cstring& astring nsacstring& operator=(const char*) - source parameters char* aptr nsacstring& operator=(char) - source parameters char achar adopt void adopt(const char*, pr
uint32) - source parameters char* adata pr
uint32 alength beginreading pr
uint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
... parameters char** begin char** end char* beginreading() const - source endreading char* endreading() const - source charat char charat(pr
uint32) const - source parameters pr
uint32 apos operator[] char operator[](pr
uint32) const - source parameters pr
uint32 apos first char first() const - source beginwriting pr
uint32 beginwriting(char**, char**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...And 18 more matches
nsDependentCString external
methods constructors void nsdependentcstring_external() - source void nsdependentcstring_external(const char*, pr
uint32) - source parameters char* adata pr
uint32 alength rebind void rebind(const char*, pr
uint32) - source parameters char* adata pr
uint32 alength get char* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source param...
...nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* aptr nsacstring& operator=(char) - source parameters char achar adopt void adopt(const char*, pr
uint32) - source parameters char* adata pr
uint32 alength beginreading pr
uint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
... parameters char** begin char** end char* beginreading() const - source endreading char* endreading() const - source charat char charat(pr
uint32) const - source parameters pr
uint32 apos operator[] char operator[](pr
uint32) const - source parameters pr
uint32 apos first char first() const - source beginwriting pr
uint32 beginwriting(char**, char**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...And 18 more matches
nsLiteralCString (External)
methods rebind void rebind(const char*, pr
uint32) - source parameters char* adata pr
uint32 alength get char* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsa...
...cstring& astring nsacstring& operator=(const char*) - source parameters char* aptr nsacstring& operator=(char) - source parameters char achar adopt void adopt(const char*, pr
uint32) - source parameters char* adata pr
uint32 alength beginreading pr
uint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
... parameters char** begin char** end char* beginreading() const - source endreading char* endreading() const - source charat char charat(pr
uint32) const - source parameters pr
uint32 apos operator[] char operator[](pr
uint32) const - source parameters pr
uint32 apos first char first() const - source beginwriting pr
uint32 beginwriting(char**, char**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...And 18 more matches
nsLiteralString (External)
methods rebind void rebind(const char*, pr
uint32) - source parameters char* adata pr
uint32 alength get char* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsa...
...cstring& astring nsacstring& operator=(const char*) - source parameters char* aptr nsacstring& operator=(char) - source parameters char achar adopt void adopt(const char*, pr
uint32) - source parameters char* adata pr
uint32 alength beginreading pr
uint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
... parameters char** begin char** end char* beginreading() const - source endreading char* endreading() const - source charat char charat(pr
uint32) const - source parameters pr
uint32 apos operator[] char operator[](pr
uint32) const - source parameters pr
uint32 apos first char first() const - source beginwriting pr
uint32 beginwriting(char**, char**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...And 18 more matches
imgIContainer
obsolete since gecko 2.0 void appendframe(in print32 ax, in print32 ay, in print32 awidth, in print32 aheight, in gfximageformat aformat, [array, size_is(imagelength)] out pr
uint8 imagedata, out unsigned long imagelength); native code only!
... obsolete since gecko 2.0 void appendpalettedframe(in print32 ax, in print32 ay, in print32 awidth, in print32 aheight, in gfximageformat aformat, in pr
uint8 apalettedepth, [array, size_is(imagelength)] out pr
uint8 imagedata, out unsigned long imagelength, [array, size_is(palettelength)] out pr
uint32 palettedata, out unsigned long palettelength); native code only!
... obsolete since gecko 2.0 gfximagesurface copyframe(in pr
uint32 awhichframe, in pr
uint32 aflags); native code only!
...And 18 more matches
<input type="email"> - HTML: Hypertext Markup Language
value a domstring representing an e-mail address, or empty events change and input supported common attributes autocomplete, list, maxlength, minlength, multiple, name,pattern, placeholder, readonly, req
uired, size, and type idl attributes list and value methods select() value the <input> element's value attribute contains a domstring which is automatically validated as conforming to e-mail syntax.
...the values provided are suggestions, not req
uirements: users can select from this predefined list or provide a different value.
... note: normally, if you specify the req
uired attribute, the user must enter a valid e-mail address for the field to be considered valid.
...And 18 more matches
Getting started with Ember - Learn web development
prereq
uisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line.
... use cases generally, emberjs works well for b
uilding apps that desire either or both of the following traits: single page applications, including native-like web apps, and progressive web apps (pwas) ember works best when it is the entire front end of your application.
... ember has clear conventions that are useful for enforcing consistency and helping team members get up to speed q
uickly.
...And 17 more matches
Command line crash course - Learn web development
previous overview: understanding client-side tools next in your development process you'll undoubtedly be req
uired to run some command in the terminal (or on the "command line" — these are effectively the same thing).
... prereq
uisites: familiarity with the core html, css, and javascript languages.
... on the surface they’re far from welcoming but there’s a lot you can do with them, and we promise that, with a bit of g
uidance and practise, using them will get easier!
...And 17 more matches
PKCS11 Implement
this document supplements the information in pkcs #11: cryptographic token interface standard, version 2.0 with g
uidelines for implementors of cryptographic modules who want their products to work with mozilla client software: how nss calls pkcs #11 functions.
...the nss always passes null, as req
uired by the pkcs #11 specification, in the single c_initialize parameter preserved.
...the nss interprets the combination of the ckf_login_req
uired and ckf_user_pin_initialized flags as shown in table 1.1.
...And 17 more matches
sslerr.html
this page is part of the ssl reference that we are migrating into the format described in the mdn style g
uide.
...peer does not support high-grade encryption." the local system was configured to support the cipher s
uites permitted for domestic use.
... the remote system was configured to support only the cipher s
uites permitted for export use.
...And 17 more matches
Hacking Tips
all tips listed here are dealing with the javascript shell obtained at the end of the b
uild documentation of spidermonkey.
...many of these tips only apply to debug b
uilds of the js shell; they will not function in a release b
uild.
..., js::value*), js::callargs const&) (cx=0x14f2640, native=0xf89960 , args=...) at js/src/jscntxtinlines.h:235 #2 0x0000000000c87625 in js::invoke(jscontext*, js::callargs const&, js::maybeconstruct) (cx=0x14f2640, args=..., construct=js::no_construct) at js/src/vm/interpreter.cpp:476 #3 0x000000000069bdcf in js::jit::docallfallback(jscontext*, js::jit::baselineframe*, js::jit::iccall_fallback*,
uint32_t, js::value*, js::mutablehandlevalue) (cx=0x14f2640, frame=0x7fffffff6ad8, stub_=0x1798838, argc=1, vp=0x7fffffff6a88, res=jsval_void) at js/src/jit/baselineic.cpp:6113 #4 0x00007ffff7f41395 in <<jitframe_exit>> () #5 0x00007ffff7f42223 in <<jitframe_baselinestub>> () #6 0x00007ffff7f4423d in <<jitframe_baselinejs>> () #7 0x00007ffff7f4222e in <<jitframe_baselinestub>> () #8 0x00007ffff...
...And 17 more matches
Setting up an update server
there are two common ways to obtain a mar to use: download a preb
uilt one, or b
uild one yourself.
... downloading a mar preb
uilt nightly mars can be found here on archive.mozilla.org.
... preb
uilt mars for release and beta can be found here.
...And 17 more matches
NS ConvertASCIItoUTF16 external
methods constructors void ns_convertasciitoutf16_external(const nsacstring&) - source parameters nsacstring& astr void ns_convertasciitoutf16_external(const char*, pr
uint32) - source parameters char* adata pr
uint32 alength get prunichar* get() const - source operator= nsstring_external& operator=(const nsstring_external&) - source parameters nsstring_external& astring nsastring& operator=(const nsastring&) - source parameters nsa...
...string& astring nsastring& operator=(const prunichar*) - source parameters prunichar* aptr nsastring& operator=(prunichar) - source parameters prunichar achar adopt void adopt(const prunichar*, pr
uint32) - source parameters prunichar* adata pr
uint32 alength beginreading pr
uint32 beginreading(const prunichar**, const prunichar**) const - source returns the length, beginning, and end of a string in one operation.
... parameters prunichar** begin prunichar** end prunichar* beginreading() const - source endreading prunichar* endreading() const - source charat prunichar charat(pr
uint32) const - source parameters pr
uint32 apos operator[] prunichar operator[](pr
uint32) const - source parameters pr
uint32 apos first prunichar first() const - source beginwriting pr
uint32 beginwriting(prunichar**, prunichar**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...And 17 more matches
NS ConvertUTF8toUTF16 external
methods constructors void ns_convertutf8toutf16_external(const nsacstring&) - source parameters nsacstring& astr void ns_convertutf8toutf16_external(const char*, pr
uint32) - source parameters char* adata pr
uint32 alength get prunichar* get() const - source operator= nsstring_external& operator=(const nsstring_external&) - source parameters nsstring_external& astring nsastring& operator=(const nsastring&) - source parameters nsa...
...string& astring nsastring& operator=(const prunichar*) - source parameters prunichar* aptr nsastring& operator=(prunichar) - source parameters prunichar achar adopt void adopt(const prunichar*, pr
uint32) - source parameters prunichar* adata pr
uint32 alength beginreading pr
uint32 beginreading(const prunichar**, const prunichar**) const - source returns the length, beginning, and end of a string in one operation.
... parameters prunichar** begin prunichar** end prunichar* beginreading() const - source endreading prunichar* endreading() const - source charat prunichar charat(pr
uint32) const - source parameters pr
uint32 apos operator[] prunichar operator[](pr
uint32) const - source parameters pr
uint32 apos first prunichar first() const - source beginwriting pr
uint32 beginwriting(prunichar**, prunichar**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...And 17 more matches
PromiseFlatCString (External)
nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* aptr nsacstring& operator=(char) - source parameters char achar adopt void adopt(const char*, pr
uint32) - source parameters char* adata pr
uint32 alength beginreading pr
uint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
... parameters char** begin char** end char* beginreading() const - source endreading char* endreading() const - source charat char charat(pr
uint32) const - source parameters pr
uint32 apos operator[] char operator[](pr
uint32) const - source parameters pr
uint32 apos first char first() const - source beginwriting pr
uint32 beginwriting(char**, char**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...pass pr_
uint32_max to leave the length unchanged.
...And 17 more matches
nsAString (External)
class declaration this header provides wrapper classes around the frozen string api which are roughly eq
uivalent to the internal string classes.
...methods beginreading pr
uint32 beginreading(const prunichar**, const prunichar**) const - source returns the length, beginning, and end of a string in one operation.
... parameters prunichar** begin prunichar** end prunichar* beginreading() const - source endreading prunichar* endreading() const - source charat prunichar charat(pr
uint32) const - source parameters pr
uint32 apos operator[] prunichar operator[](pr
uint32) const - source parameters pr
uint32 apos first prunichar first() const - source beginwriting pr
uint32 beginwriting(prunichar**, prunichar**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...And 17 more matches
nsCAutoString (External)
nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* aptr nsacstring& operator=(char) - source parameters char achar adopt void adopt(const char*, pr
uint32) - source parameters char* adata pr
uint32 alength beginreading pr
uint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
... parameters char** begin char** end char* beginreading() const - source endreading char* endreading() const - source charat char charat(pr
uint32) const - source parameters pr
uint32 apos operator[] char operator[](pr
uint32) const - source parameters pr
uint32 apos first char first() const - source beginwriting pr
uint32 beginwriting(char**, char**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...pass pr_
uint32_max to leave the length unchanged.
...And 17 more matches
nsDependentString external
methods constructors void nsdependentstring_external() - source void nsdependentstring_external(const prunichar*, pr
uint32) - source parameters prunichar* adata pr
uint32 alength rebind void rebind(const prunichar*, pr
uint32) - source parameters prunichar* adata pr
uint32 alength get prunichar* get() const - source operator= nsstring_external& operator=(const nsstring_external&) - so...
...astring nsastring& operator=(const nsastring&) - source parameters nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* aptr nsastring& operator=(prunichar) - source parameters prunichar achar adopt void adopt(const prunichar*, pr
uint32) - source parameters prunichar* adata pr
uint32 alength beginreading pr
uint32 beginreading(const prunichar**, const prunichar**) const - source returns the length, beginning, and end of a string in one operation.
... parameters prunichar** begin prunichar** end prunichar* beginreading() const - source endreading prunichar* endreading() const - source charat prunichar charat(pr
uint32) const - source parameters pr
uint32 apos operator[] prunichar operator[](pr
uint32) const - source parameters pr
uint32 apos first prunichar first() const - source beginwriting pr
uint32 beginwriting(prunichar**, prunichar**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...And 17 more matches
nsDependentSubstring external
int32 (*) compare(const nsastring&, print32 (*) equals(const prunichar*, print32 (*) equals(const nsastring&, print32 (*) operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find(const nsastring&, print32 (*) find(const nsastring&, pr
uint32, print32 (*) find rfind(const nsastring&, print32 (*) rfind(const nsastring&, print32, print32 (*) rfind findchar rfindchar appendint tointeger base classes nsstringcontainer data members no public members.
... methods constructors void nsdependentsubstring_external() - source void nsdependentsubstring_external(const prunichar*, pr
uint32) - source parameters prunichar astart pr
uint32 alength void nsdependentsubstring_external(const nsastring&, pr
uint32) - source parameters nsastring astr pr
uint32 astartpos void nsdependentsubstring_external(const nsastring&, pr
uint32, pr
uint32) - source parameters nsastring astr pr
uint32 astartpos pr
uint32 alength rebind void rebind(const prunichar*, pr
uint32) - source parameters prunichar astart pr
uint32 alength beginreading pr
uint32 beginreadi...
... parameters prunichar* begin prunichar* end prunichar beginreading() const - source endreading prunichar endreading() const - source charat prunichar charat(pr
uint32) const - source parameters pr
uint32 apos operator[] prunichar operator[](pr
uint32) const - source parameters pr
uint32 apos first prunichar first() const - source beginwriting pr
uint32 beginwriting(prunichar**, prunichar**, pr
uint32) - source get the length, begin writing, and...
...And 17 more matches
nsStringContainer (External)
methods beginreading pr
uint32 beginreading(const prunichar**, const prunichar**) const - source returns the length, beginning, and end of a string in one operation.
... parameters prunichar** begin prunichar** end prunichar* beginreading() const - source endreading prunichar* endreading() const - source charat prunichar charat(pr
uint32) const - source parameters pr
uint32 apos operator[] prunichar operator[](pr
uint32) const - source parameters pr
uint32 apos first prunichar first() const - source beginwriting pr
uint32 beginwriting(prunichar**, prunichar**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...pass pr_
uint32_max to leave the length unchanged.
...And 17 more matches
nsString external
methods constructors void nsstring_external() - source void nsstring_external(const nsstring_external&) - source parameters nsstring_external& astring void nsstring_external(const nsastring&) - source parameters nsastring& areadable void nsstring_external(const prunichar*, pr
uint32) - source parameters prunichar* adata pr
uint32 alength get prunichar* get() const - source operator= nsstring_external& operator=(const nsstring_external&) - source parameters nsstring_external& astring nsastring& operator=(const nsastring&) - source parameters ...
... nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* aptr nsastring& operator=(prunichar) - source parameters prunichar achar adopt void adopt(const prunichar*, pr
uint32) - source parameters prunichar* adata pr
uint32 alength beginreading pr
uint32 beginreading(const prunichar**, const prunichar**) const - source returns the length, beginning, and end of a string in one operation.
... parameters prunichar** begin prunichar** end prunichar* beginreading() const - source endreading prunichar* endreading() const - source charat prunichar charat(pr
uint32) const - source parameters pr
uint32 apos operator[] prunichar operator[](pr
uint32) const - source parameters pr
uint32 apos first prunichar first() const - source beginwriting pr
uint32 beginwriting(prunichar**, prunichar**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...And 17 more matches
nsIAppStartup
it also helps in q
uitting applications as well.
... void ensure1window(in nsicmdlineservice acmdlineservice); obsolete since gecko 1.9.1 void enterlastwindowclosingsurvivalarea(); void exitlastwindowclosingsurvivalarea(); void getstartupinfo(); void hidesplashscreen(); obsolete since gecko 1.9.1 void initialize(in nsisupports nativeappsupportorsplashscreen); obsolete since gecko 1.9.1 void q
uit(in pr
uint32 amode); void restartinsafemode(in pr
uint32 aq
uitmode); void run(); attributes attribute type description interrupted boolean true if the startup process was interrupted by an interactive prompt.
...obsolete since gecko 1.9.1 constants the following flags may be passed as the amode parameter to the q
uit() method.
...And 17 more matches
nsIXPConnect
nsistackframe createstackframelocation(in pr
uint32 alanguage, in string afilename, in string afunctionname, in print32 alinenumber, in nsistackframe acaller); void debugdump(in short depth); void debugdumpevalinjsstackframe(in pr
uint32 aframenumber, in string asourcetext); void debugdumpjsstack(in prbool showargs, in prbool showlocals, in prbool showthisprops); void debugdumpobject(in nsisupports acomobj, i...
...n short depth); [noscript,notxpcom] prbool definedomq
uickstubs(in jscontextptr cx, in jsobjectptr proto, in pr
uint32 flags, in pr
uint32 interfacecount, [array, size_is(interfacecount)] in nsiidptr interfacearray); jsval evalinsandboxobject(in astring source, in jscontextptr cx, in nsixpconnectjsobjectholder sandbox, in prbool returnstringonly); native code only!
... obsolete since gecko 2.0 void getdefaultsecuritymanager(out nsixpcsecuritymanager amanager, out pr
uint16 flags); nsixpcfunctionthistranslator getfunctionthistranslator(in nsiidref aiid); jsobjectptr getjsobjectofwrapper(in jscontextptr ajscontext, in jsobjectptr ajsobj); [noscript, notxpcom] nsisupports getnativeofwrapper(in jscontextptr ajscontext, in jsobjectptr ajsobj); void getsecuritymanagerforjscontext(in jscontextptr ajscontext, out nsixpcsecuritymana...
...And 17 more matches
Digital audio concepts - Web media technologies
this g
uide is an overview examining how audio is represented digitally, and how codecs are used to encode and decode audio for use on the web.
...this analog signal is then converted into digital form by a circ
uit that captures the incoming wave's amplitude at regular intervals, converting that data into a number in a form that is understood by the audio recording system.
...at regular intervals, the a/d converter circ
uitry reads the voltage of the signal as a value between (in this case) -1.0 and +1.0.
...And 17 more matches
MMgc - Archive of obsolete content
mmgc is the tamarin (née macromedia) garbage collector, a memory management library that has been b
uilt as part of the avm2/tamarin effort.
...}; myobject* myobject = new (gc) myobject(); any pointers to a gcobject from unmanaged memory req
uire the unmanaged object to be a gcroot.
... class myunmanagedobject : public mmgc::gcroot { myobject *object; }; any pointers to a gcobject from managed memory req
uire a dwb write barrier macro.
...And 16 more matches
Styling web forms - Learn web development
prereq
uisites: basic computer literacy, and a basic understanding of html and css.
... for some form widgets, it is still difficult to reb
uild controls to make them stylable, but we can now use css to style many form features, though we do need to take extra care to ensure we don't break usability.
... multi-line <textarea>s buttons (both <input> and <button>s) <label> <output> the bad some elements are more difficult to style, req
uiring more complex css or some more specific tricks: checkboxes and radio buttons <input type="search"> we describe how to handle these more specific features in the article advanced form styling.
...And 16 more matches
Functions — reusable blocks of code - Learn web development
previous overview: b
uilding blocks next another essential concept in coding is functions, which allow you to store a piece of code that does a single task inside a defined block, and then call that code whenever you need it using a single short command — rather than having to type out the same code multiple times.
... prereq
uisites: basic computer literacy, a basic understanding of html and css, javascript first steps.
... pretty much anytime you make use of a javascript structure that features a pair of parentheses — () — and you're not using a common b
uilt-in language structure like a for loop, while or do...while loop, or if...else statement, you are making use of a function.
...And 16 more matches
Getting started with React - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line.
... objective: to set up a local react development environment, create a start app, and understand the basics of how it works hello react as its official tagline states, react is a library for b
uilding user interfaces.
...for instance, react native can be used to b
uild mobile applications; react 360 can be used to b
uild virtual reality applications; and there are other possibilities besides.
...And 16 more matches
NSS tools : certutil
certificate issuance, part of the key and certificate management process, req
uires that keys and certificates be created in the key database.
... options and arguments running certutil always req
uires one and only one command option to specify the type of certificate operation.
... this req
uires the -i argument.
...And 16 more matches
NSS tools : modutil
options running modutil always req
uires one (and only one) option to specify the type of module operation.
...a password is eq
uivalent to a personal identification number (pin).
...the only req
uired argument is the database that where the databases will be located.
...And 16 more matches
NSS tools : modutil
options running modutil always req
uires one (and only one) option to specify the type of module operation.
...a password is eq
uivalent to a personal identification number (pin).
...the only req
uired argument is the database that where the databases will be located.
...And 16 more matches
Web Replay
this req
uires using the same b
uild of firefox and a reasonably similar version of the operating system; otherwise the tab will probably crash.
... if we record and later replay the order in which threads acq
uire locks (and, by extension, release locks and use condvars) then accesses on lock-protected memory will occur in the same order.
... atomic variables can be handled by treating reads and writes as if they were wrapped by a lock acq
uire/release during recording.
...And 16 more matches
PromiseFlatString (External)
astring nsastring& operator=(const nsastring&) - source parameters nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* aptr nsastring& operator=(prunichar) - source parameters prunichar achar adopt void adopt(const prunichar*, pr
uint32) - source parameters prunichar* adata pr
uint32 alength beginreading pr
uint32 beginreading(const prunichar**, const prunichar**) const - source returns the length, beginning, and end of a string in one operation.
... parameters prunichar** begin prunichar** end prunichar* beginreading() const - source endreading prunichar* endreading() const - source charat prunichar charat(pr
uint32) const - source parameters pr
uint32 apos operator[] prunichar operator[](pr
uint32) const - source parameters pr
uint32 apos first prunichar first() const - source beginwriting pr
uint32 beginwriting(prunichar**, prunichar**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...pass pr_
uint32_max to leave the length unchanged.
...And 16 more matches
nsAutoString (External)
astring nsastring& operator=(const nsastring&) - source parameters nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* aptr nsastring& operator=(prunichar) - source parameters prunichar achar adopt void adopt(const prunichar*, pr
uint32) - source parameters prunichar* adata pr
uint32 alength beginreading pr
uint32 beginreading(const prunichar**, const prunichar**) const - source returns the length, beginning, and end of a string in one operation.
... parameters prunichar** begin prunichar** end prunichar* beginreading() const - source endreading prunichar* endreading() const - source charat prunichar charat(pr
uint32) const - source parameters pr
uint32 apos operator[] prunichar operator[](pr
uint32) const - source parameters pr
uint32 apos first prunichar first() const - source beginwriting pr
uint32 beginwriting(prunichar**, prunichar**, pr
uint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...pass pr_
uint32_max to leave the length unchanged.
...And 16 more matches
XUL Overlays
xul files and xul overlays overlays are xul files used to describe extra content in the
ui.
... though overlays often define
ui elements that have been added as a result of an update or enhancement of some kind, they can be used in many different ways.
... overlays provide a general mechanism for: adding
ui for additional components, as described in the example above overriding small pieces of a xul file without having to resupply the whole
ui reusing particular pieces of the
ui xul files and overlays work together to describe a single master document.
...And 16 more matches
DOM Inspector internals - Firefox Developer Tools
the one you are likely to be most familiar with is its inspector.xul-based primary
ui.
... this is the two-pane inspector that appears when ctrl+shift+i (or cmd+shift+i) is pressed from one of the applications for which dom inspector has explicit support (i.e., men
uitems placed via overlay).
... besides the dom inspector's primary
ui, there are a couple other top-level inspectors which differ slightly (the object inspector and dom inspector sidebar used in seamonkey).
...And 16 more matches
Populating the page: how browsers work - Web Performance
web performance is what we have to do to make the page load happen as q
uickly as possible.
... tls negotiation for secure connections established over https, another "handshake" is req
uired.
...this req
uires three more round trips to the server before the request for content is actually sent.
...And 16 more matches
system - Archive of obsolete content
var system = req
uire("sdk/system"); // path environment variable console.log(system.env.path); // operating system console.log("platform = " + system.platform); // processor architecture console.log("architecture = " + system.architecture); // compiler used to b
uild host application console.log("compiler = " + system.compiler); // host application b
uild identifier console.log("b
uild = " + system.b
uild); // host application u
uid console.log("id = " + system...
....id); // host application name console.log("name = " + system.name); // host application version console.log("version = " + system.version); // host application vendor console.log("vendor = " + system.vendor); // host application profile directory console.log("profile directory = " + system.pathfor("profd")); q
uit the host application to q
uit the host application, use the exit() function.
... var system = req
uire("sdk/system"); system.exit(); globals functions exit(code) q
uits the host application with the specified code.
...And 15 more matches
tabs - Archive of obsolete content
usage open a tab you can open a new tab, specifying various properties including location: var tabs = req
uire("sdk/tabs"); tabs.open("http://www.example.com"); track tabs you can register event listeners to be notified when tabs open, close, finish loading dom content, or are made active or inactive: var tabs = req
uire("sdk/tabs"); // listen for tab openings.
...in particular, you can enumerate it: var tabs = req
uire('sdk/tabs'); for (let tab of tabs) console.log(tab.title); you can also access individual tabs by index: var tabs = req
uire('sdk/tabs'); tabs.on('ready', function () { console.log('first: ' + tabs[0].title); console.log('last: ' + tabs[tabs.length-1].title); }); you can access the currently active tab: var tabs = req
uire('sdk/tabs'); tabs.on('activate', function () { console.log('active: ' + tabs.activetab.url); }); track a single tab given ...
...a tab, you can register event listeners to be notified when the tab is closed, activated or deactivated, or when the page hosted by the tab is loaded or retrieved from the "back-forward cache": var tabs = req
uire("sdk/tabs"); function onopen(tab) { console.log(tab.url + " is open"); tab.on("pageshow", logshow); tab.on("activate", logactivate); tab.on("deactivate", logdeactivate); tab.on("close", logclose); } function logshow(tab) { console.log(tab.url + " is loaded"); } function logactivate(tab) { console.log(tab.url + " is activated"); } function logdeactivate(tab) { console.log(tab.url + " is deactivated"); } function logclose(tab) { console.log(tab.url + " is closed"); } tabs.on('open', onopen); manipulate a tab you can get and set various properties of tabs (bu...
...And 15 more matches
Aprender y obtener ayuda - Learn web development
focused thinking is great for concentrating hard on specific subjects, getting into deep problem solving, and improving your mastery of the techniques req
uired — strengthening the neural pathways in your brain where that information is stored.
...many people prefer textual articles for more in-depth learning and reference material, and videos for q
uick explanations of concepts and new features, but it is really up to you what you prefer to learn from.
... i want to learn enough to b
uild a website for my local amateur tennis club.
...And 15 more matches
Framework main features - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages.
... domain-specific languages all of the frameworks discussed in this module are powered by javascript, and all allow you to use domain-specific languages (dsls) in order to b
uild your applications.
...unlike html, these languages know how to read data variables, and this data can be used to streamline the process of writing your
ui.
...And 15 more matches
Getting started with Vue - Learn web development
in this article we'll look at a little bit of vue background, learn how to install it and create a new project, study the high-level structure of the whole project and an individual component, see how to run the project locally, and get it prepared to start b
uilding our example.
... prereq
uisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line.
... as you work through this tutorial, you might want to keep the vue g
uide and api documentation open in other tabs, so you can refer to them if you want more information on any sub topic.
...And 15 more matches
Handling common accessibility problems - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross browser testing.
... common accessibility issues in this section we'll detail some of the main issues that arise around web accessibility, connected with specific technologies, along with best practices to follow, and some q
uick tests you can do to see if your sites are going in the right direction.
...present significant market segments), but it is also a legal req
uirement in many parts of the world to make web content accessible to people with disabilities.
...And 15 more matches
Handling common JavaScript problems - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages; an idea of the high-level principles of cross browser testing.
... things have improved significantly since then; modern browsers do a good job of supporting "classic javascript features", and the req
uirement to use such code has diminished as the req
uirement to support older browsers has lessened (although bear in mind that they have not gone away altogether).
...for example, the following command installs jshint: npm install -g jshint you can then point these tools at javascript files you want to lint, for example: you can also use these tools with a task runner/b
uild tool such as gulp or webpack to automatically lint your javascript during development.
...And 15 more matches
Application Translation with Mercurial
seamonkey and sea-* denote branches of seamonkey, the s
uite consisting of browser, mail and chat client and more.
... if it is a red text consisting of a number and the word 'missing', then there are untranslated texts and you can move on with this g
uide.
... req
uired tools b
uild pre-req
uisites first, get the req
uired programs to compile mozilla applications like firefox and thunderbird from b
uild instructions.
...And 15 more matches
Creating localizable web applications
take advantage of printf() (or eq
uivalents) and use variables in the english strings.
...good: body.de foo, body.fr foo, body.pl foo { /* locale-specific rules for the foo element */ width: 10em; /* originally 8em */ } adapt the interaction to rtl locales right-to-left locales not only req
uire good images handling (see images), but also should be taken into account when designing the interaction on the website.
...bad: req
uire_once('lib/user.php'); $user = new personauser(); snippet 2.
...And 15 more matches
Setting up CDT to work on SpiderMonkey
there is a g
uide for setting up cdt to work with the mozilla codebase, but it does not cover setting things up for just spidermonkey instead of the whole mozilla codebase.
... hence, here is a short-ish g
uide for doing just that.
... step 1 - preparing a spidermonkey b
uild for cdt to index all code, spidermonkey has to be b
uilt with debug information.
...And 15 more matches
Introduction to XPCOM for the DOM
target audience: people who would like a q
uick introduction to the use of c++ and xpcom in the dom code.
... the understanding of the content of this document is a req
uirement to read the rest of the dom hacking g
uide.
...for more information about nscomptr's, please read the user's g
uide.
...And 15 more matches
nsDependentCString
nsdependentcstring(const char*, pr
uint32) - source parameters char* data a pointer to the string.
...pr
uint32 length the length of the string.
...nsdependentcstring(const nscstring_internal&, pr
uint32) constructs an nsdependentstring from an existing flat string.
...And 15 more matches
nsINavBookmarksService
dforitem(in long long aitemid); boolean getfolderreadonly(in long long aitemid); astring getfoldertitle(in print64 folder); obsolete since gecko 1.9 nsiuri getfolderuri(in print64 folder); obsolete since gecko 1.9 long long getidforitemat(in long long aparentid, in long aindex); prtime getitemdateadded(in long long aitemid); astring getitemg
uid(in long long aitemid); obsolete since gecko 14.0 long long getitemidforg
uid(in astring ag
uid); obsolete since gecko 14.0 long getitemindex(in long long aitemid); prtime getitemlastmodified(in long long aitemid); autf8string getitemtitle(in long long aitemid); unsigned short getitemtype(in long long aitemid); astring getkeywordforbookmark...
...witem); obsolete since gecko 1.9 void runinbatchmode(in nsinavhistorybatchcallback acallback, in nsisupports auserdata); void setfolderreadonly(in long long afolder, in boolean areadonly); void setfoldertitle(in print64 folder, in astring title); obsolete since gecko 1.9 void setitemdateadded(in long long aitemid, in prtime adateadded); void setitemg
uid(in long long aitemid, in astring ag
uid); obsolete since gecko 14.0 void setitemindex(in long long aitemid, in long anewindex); void setitemlastmodified(in long long aitemid, in prtime alastmodified); void setitemtitle(in long long aitemid, in autf8string atitle); void setkeywordforbookmark(in long long aitemid, in astring akeyword); obsolete since gecko 40...
... constants constant value description default_index -1 this is the default index; this value should be used for apis that allow passing in an index where the index is not known or is not req
uired to be specified, such as when appending an item to a folder.
...And 15 more matches
Signaling and video calling - Web APIs
this tutorial will g
uide you through b
uilding a two-way video-call.
...in addition, there is a short timeout period; the glitch instance is for q
uick experiments and testing only.
... the signaling server establishing a webrtc connection between two devices req
uires the use of a signaling server to resolve how to connect them over the internet.
...And 15 more matches
Border-radius generator - CSS: Cascading Style Sheets
"radius-container" data-x="right" data-y="top"> </div> <div id="bottom-right" class="radius-container" data-x="right" data-y="bottom"> </div> <div id="bottom-left" class="radius-container" data-x="left" data-y="bottom"> </div> <div id="radius-
ui-sliders"> <div id="tlr" class="
ui-input-slider" data-topic="top-left" data-unit=" px" data-sensivity="2"></div> <div id="tlw" class="
ui-input-slider" data-topic="top-left-w" data-unit=" px" data-sensivity="2"></div> <div id="tlh" class="
ui-input-slider" data-topic="top-left-h" ...
... data-unit=" px" data-sensivity="2"></div> <div id="trr" class="
ui-input-slider" data-topic="top-right" data-unit=" px" data-sensivity="2"></div> <div id="trw" class="
ui-input-slider" data-topic="top-right-w" data-unit=" px" data-sensivity="2"></div> <div id="trh" class="
ui-input-slider" data-topic="top-right-h" data-unit=" px" data-sensivity="2"></div> <div id="brr" class="
ui-input-slider" data-topic="bottom-right" data-unit=" px" data-sensivity="2"></div> <div id="brw" class="
ui-input-slider" data-topic="bottom-right-w" data-unit=" px" data-sensivity=...
..."2"></div> <div id="brh" class="
ui-input-slider" data-topic="bottom-right-h" data-unit=" px" data-sensivity="2"></div> <div id="blr" class="
ui-input-slider" data-topic="bottom-left" data-unit=" px" data-sensivity="2"></div> <div id="blw" class="
ui-input-slider" data-topic="bottom-left-w" data-unit=" px" data-sensivity="2"></div> <div id="blh" class="
ui-input-slider" data-topic="bottom-left-h" data-unit=" px" data-sensivity="2"></div> </div> </div> </div> </div> <div id="controls" class="group section"> <div class="group section"> <div id="dimensions...
...And 15 more matches
Using multi-column layouts - CSS: Cascading Style Sheets
</p> <p> ut enim ad minim veniam, q
uis nostrud exercitation ullamco laboris nisi ut aliq
uip ex ea commodo consequat.
... </p> <p> d
uis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
... </p> <p> excepteur sint occaecat cupidatat non proident, sunt in culpa q
ui officia deserunt mollit anim id est laborum.
...And 15 more matches
Content Scripts - Archive of obsolete content
there are five basic principles: the add-on's main code, including "main.js" and other modules in "lib", can use the sdk high-level and low-level apis, but can't access web content directly content scripts can't use the sdk's apis (no access to globals exports, req
uire) but can access web content sdk apis that use content scripts, like page-mod and tabs, provide functions that enable the add-on's main code to load content scripts into web pages content scripts can be loaded in as strings, but are more often stored as separate files under the add-on's "data" directory.
...the content script simply replaces the content of the page: // main.js var tabs = req
uire("sdk/tabs"); var contentscriptstring = 'document.body.innerhtml = "<h1>this page has been eaten</h1>";' tabs.activetab.attach({ contentscript: contentscriptstring }); the following high-level sdk modules can use content scripts to modify web pages: page-mod: enables you to attach content scripts to web pages that match a specific url pattern.
... almost all the examples presented in this g
uide are available as complete, but minimal, add-ons in the addon-sdk-content-scripts repository on github.
...And 14 more matches
List of Mozilla-Based Applications - Archive of obsolete content
the following is a list of all known active applications that are b
uilt using mozilla technologies.
...es mozilla spidermonkey adobe flash player popular browser plug-in uses nss in linux version adwatch content management system uses xul and xpcom aicpcu/iia exam app exam delivery software aliwal geocoder geocoding & data on a map amarok xul remote remote control for amarok music player ample sdk javascript g
ui-framework aol instant messenger im client uses nss apache web server doesn't use nss by default, but can be configured to use nss with mod_nss ssl module apicawatch site performance monitoring tool uses firefox as part of its monitoring package astyle css editor editing tool atmail webmail client aviva for j...
...ilisk pre-servo xul-based web browser uses most of the firefox 55 source code batik java-based toolkit uses mozilla rhino bitbox security focused browser seemingly based on firefox blackbird browser for african american community bluegriffon wysiwyg editor next generation version of composer buzzbird twitter client b
uilt on xulrunner camino browser 2.5m downloads and ~400,000 active users ...
...And 14 more matches
Running Tamarin acceptance tests - Archive of obsolete content
running the tamarin test s
uite req
uires the following steps: set the avm environment variable to the path of the avmplus executable (avmshell).
... note: the name of the avmshell executable varies among the b
uild systems; use the name of the avm shell produced from the b
uild process you used, above.
... set the b
uiltinabc environment variable to the path of the generated/b
uiltin.abc.
...And 14 more matches
Templates - Archive of obsolete content
usually, elements such as treeitems and men
uitems will be populated with data.
...nevertheless, we'll start with these other elements because trees and menus req
uire more code.
... example 3 : source <vbox datasources="rdf:bookmarks" ref="nc:bookmarksroot" flex="1"> <template> <label uri="rdf:*" value="rdf:http://home.netscape.com/nc-rdf#name rdf:http://home.netscape.com/nc-rdf#url"/> </template> </vbox> how templates are b
uilt when an element has a datasources attribute, it indicates that the element is expected to be b
uilt from a template.
...And 14 more matches
Using Remote XUL - Archive of obsolete content
it contains elements for all common
ui widgets (menus, buttons, toolbars, etc.) and many sophisticated ones (trees, browsers, color pickers).
...xul loaded and rendered in this way is called remote xul and can be used for basic functions like web site navigation as well as to b
uild sophisticated web-based applications.
... [***aw: we should have a screenshot here of a xul document loaded in a content window***] this tutorial walks you through the process of b
uilding xul-based navigation for the mozilla.org web site.
...And 14 more matches
The Implementation of the Application Object Model - Archive of obsolete content
let's just use serialized rdf to represent the
ui!
...let's just extend html and use it to represent the
ui!
...by keeping the dom tree in a sandbox (safely insulated from the containing aom tree in which it might occur), you have an easy means of disting
uishing the two trees and preventing scripts in the dom tree from manipulating the aom tree.
...And 14 more matches
tree - Archive of obsolete content
rdf tree nsitreeview, nsixultreeb
uilder no this tree is generated from an rdf datasource.
... it is used when a tree has a datasources attribute, and has dont-b
uild-content in its flags attribute.
... rdf content tree nsitreeview, nsixultreeb
uilder, nsitreecontentview yes this tree is generated from an rdf datasource.
...And 14 more matches
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
following standards is certainly not a new organizational phenomenon; organizations req
uire their employees to follow common rules, or a common set of standards all the time.
...they may req
uire that each project be comprised of marketing req
uirements documents, product req
uirements documents, functional req
uirements documents, quality assurance test plans, and certification documents.
... common development process as an organization matures, managers and engineers develop a fundamental understanding of the importance of req
uiring adherence to these processes.
...And 14 more matches
Game distribution - Game development
benefits of html5 over native b
uilding games with html5 gives you extra advantages, such as: multiplatform bliss the technology itself is multiplatform, so you can write the code once and target multiple devices.
...if your user finds a bug, you can q
uickly fix it, update the system and refresh the game on your server to provide players with the updated code almost instantly.
... saying this, desktop platforms can be used for distribution q
uite easily with the availability of wrappers that can help you prepare native b
uilds of your game see packaging games.
...And 14 more matches
3D games on the Web - Game development
webgl is basically an opengl es 2.0 for the web — it's a javascript api providing tools to b
uild rich interactive animations and of course, also games.
... there's an ongoing effort on releasing webgl 2.0 (based on opengl es 3.0) in the near future, which will bring many improvements and will help developers b
uild games for the modern web using current, powerful hardware.
... there's also the b
uilding up a basic demo with a-frame article showing you how easy it is to b
uild 3d environments for virtual reality using the a-frame framework.
...And 14 more matches
HTML: A good basis for accessibility - Learn web development
prereq
uisites: basic computer literacy, a basic understanding of html (see introduction to html), and an understanding of what accessibility is.
...for example, a control button to play a video on your site could be marked up like this: <div>play video</div> but as you'll see in greater detail later on, it makes sense to use the correct element for the job: <button>play video</button> not only do html <button>s have some s
uitable styling applied by default (which you will probably want to override), they also have b
uilt-in keyboard accessibility — users can navigate between buttons using the tab key and activate their selection using return or enter.
...see our screen readers g
uide for more details.
...And 14 more matches
HTML: A good basis for accessibility - Learn web development
prereq
uisites: basic computer literacy, a basic understanding of html (see introduction to html), and an understanding of what accessibility is.
...for example, a control button to play a video on your site could be marked up like this: <div>play video</div> but as you'll see in greater detail later on, it makes sense to use the correct element for the job: <button>play video</button> not only do html <button>s have some s
uitable styling applied by default (which you will probably want to override), they also have b
uilt-in keyboard accessibility — users can navigate between buttons using the tab key and activate their selection using return or enter.
...see our screen readers g
uide for more details.
...And 14 more matches
Graceful asynchronous programming with Promises - Learn web development
prereq
uisites: basic computer literacy, a reasonable understanding of javascript fundamentals.
...there are certain steps that you have to take for your order to be successful, which doesn't really make sense to try to execute out of order, or in order but before each previous step has q
uite finished: you choose what toppings you want.
...this can take a while to return a pizza and may fail if the restaurant does not have the req
uired ingredients to cook it.
...And 14 more matches
Gecko info for Windows accessibility vendors
however, exposing the entire dom to external software packages is q
uite involved, partially because changes to the dom in firefox must occur on the main thread.
... xul: extensible user-interface language the xml-based language used by firefox and mozilla to develop the
ui.
... ajax: asynchronous javascript and xml ajax is a method of b
uilding interactive web applications that process user requests, user actions immediately in real time, unlike an http request, during which users must wait for a whole page to reload or for a new page to load.
...And 14 more matches
A bird's-eye view of the Mozilla framework
it examines what happens when the user performs a simple user interface (
ui) action such as clicking a link in the contents panel of the help viewer window shown below.
... the article focuses on the architecture of the overall framework supporting the mozilla application s
uite, not the architecture of the individual applications themselves.
... prereq
uisites this article assumes you have access to mozilla sources and are familiar with the directory structure of the source tree.
...And 14 more matches
Embedding the editor
composer embedded in a native application in this application, the <iframe> on which the editor lives is embedded directly in the native application; this is eq
uivalent to embedding the browser via nsiwebbrowser, but instead having an editable document.
...this type of embedding req
uires that the composer code is agnostic to where its
ui is coming from; communication between the core editor and the
ui needs to go through one or more interfaces that insulate the editor from its host application.
...as is the case for composer embedded in a native application, there is a req
uirement here that the composer
ui be configurable, such that it can be displayed either as a toolbar at the top of the <htmlarea>, a floating palette, or a top-level toolbar.
...And 14 more matches
DMD
b
uilding and running nightly firefox the easiest way to use dmd is with the normal nightly firefox b
uild, which has dmd already enabled in the b
uild.
... desktop firefox (linux) b
uild b
uild firefox with these options: ac_add_options --enable-dmd if b
uilding via try server, modify browser/config/mozconfigs/linux64/common-opt or a similar file before pushing.
... visit about:memory and click the dmd button (depending on how old your b
uild is, it might be labelled "save" or "analyze reports" or "dmd").
...And 14 more matches
NSS 3.12.4 release notes
distribution information this release is b
uilt from the source, at the cvs repository rooted at cvs.mozilla.org:/cvsroot, with the cvs tag nss_3_12_4_rtm.
... nss 3.12.4 req
uires nspr 4.8.
... this is not a hard req
uirement.
...And 14 more matches
certutil
options and arguments running certutil always req
uires one (and only one) option to specify the type of certificate operation.
...this req
uires the -i argument.
... -b validity-time specify a time at which a certificate is req
uired to be valid.
...And 14 more matches
nsDependentString
methods constructors void nsdependentstring(const prunichar*, const prunichar*) - source constructors parameters prunichar* start prunichar* end void nsdependentstring(const prunichar*, pr
uint32) - source parameters prunichar* data pr
uint32 length void nsdependentstring(const prunichar*) - source parameters prunichar* data void nsdependentstring(const nsastring_internal&) - source parameters nsastring_internal& str void nsdependentstring() - source assertvalid void assertvalid() - source verify restrictions rebind void rebind(const prunichar*) - sourc...
...parameters prunichar* data void rebind(const prunichar*, pr
uint32) - source parameters prunichar* data pr
uint32 length void rebind(const prunichar*, const prunichar*) - source parameters prunichar* start prunichar* end operator= nsstring& operator=(const nsstring&) - source parameters nsstring& str nsastring_internal& operator=(prunichar) - source parameters prunichar c nsastring_internal& operator=(const prunichar*) - source parameters prunichar* data nsastring_internal& operator=(const nsastring_internal&) - source parameters nsastring_internal& str nsastring_internal& operator=(const nssubstringtuple&) - source parameters nssubstringtuple& tuple get prunichar* get() const - sour...
... @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nsstring&, pr
uint32, pr
uint32) const - source parameters nsstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nsstring&, pr
uint32) const - source parameters nsstring& aresult pr
uint32 acount right pr
uint32 right(nsstring&, pr
uint32) const - source parameters nsst...
...And 14 more matches
nsFixedString
methods constructors void nsfixedstring(prunichar*, pr
uint32) - source @param data fixed-size buffer to be used by the string (the contents of this buffer may be modified by the string) @param storagesize the size of the fixed buffer @param length (optional) the length of the string already contained in the buffer parameters prunichar* data pr
uint32 storagesize void nsfixedstring(prunichar*, pr
uint32, pr
uint32) - source parameters prunichar* d...
...ata pr
uint32 storagesize pr
uint32 length operator= nsstring& operator=(const nsstring&) - source parameters nsstring& str nsastring_internal& operator=(prunichar) - source parameters prunichar c nsastring_internal& operator=(const prunichar*) - source parameters prunichar* data nsastring_internal& operator=(const nsastring_internal&) - source parameters nsastring_internal& str nsastring_internal& operator=(const nssubstringtuple&) - source parameters nssubstringtuple& tuple get prunichar* get() const - source returns the null-terminated string find print32 find(const nscstring&, prbool, print32, print32) const - source search for the given substring within this string.
... @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nsstring&, pr
uint32, pr
uint32) const - source parameters nsstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nsstring&, pr
uint32) const - source parameters nsstring& aresult pr
uint32 acount right pr
uint32 right(nsstring&, pr
uint32) const - source parameters nsst...
...And 14 more matches
Thunderbird Binaries
described below are three types of generally available thunderbird packages - releases, early preview releases, and nightly b
uilds (including trunk development b
uilds) - and their downloaded locations.
... additionally, ad-hoc packages called try b
uilds are made available on an as-needed basis to allow for testing of certain patches, and are typically announced in related bug reports.
...these b
uilds are made to get feedback from testers and extension developers.
...And 14 more matches
ctypes
method overview ctype arraytype(type[, length]); cdata cast(data, type); ctype functiontype(abi, returntype[, argtype1, ...]); cdata int64(n); string libraryname(name); library open(libspec); ctype pointertype(typespec); ctype structtype(name[, fields]); cdata
uint64(n); properties property type description errno number the value of the latest system error.
...
uint8_t unsigned 8-bit integer.
...
uint16_t unsigned 16-bit integer.
...And 14 more matches
Document.execCommand() - Web APIs
syntax document.execcommand(acommandname, ashowdefault
ui, avalueargument) return value a boolean that is false if the command is unsupported or disabled.
... ashowdefault
ui a boolean indicating whether the default user interface should be shown.
... avalueargument for commands which req
uire an input argument, is a domstring providing that information.
...And 14 more matches
Event reference
svg events svgabort svgerror svgload svgresize svgscroll svgunload svgzoom database events abort blocked complete error success upgradeneeded versionchange script events afterscriptexecute beforescriptexecute menu events dommen
uitemactive dommen
uiteminactive window events close popup events popuphidden popuphiding popupshowing popupshown tab events visibilitychange battery events chargingchange chargingtimechange dischargingtimechange levelchange call events alerting busy callschanged cfstatechange connecting dialing disconnected disconnecting error held, holding incoming resuming statechange voicechange sen...
... abort
uievent dom l3 the loading of a resource has been aborted.
... domactivate
uievent dom l3 a button, link, or state changing element is activated (use click instead).
...And 14 more matches
<input type="url"> - HTML: Hypertext Markup Language
value a domstring representing a url, or empty events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, req
uired and size idl attributes list, value, selectionend, selectiondirection methods select(), setrangetext() and setselectionrange().
...the values provided are suggestions, not req
uirements: users can select from this predefined list or provide a different value.
...it must be a valid javascript regular expression, as used by the regexp type, and as documented in our g
uide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of unicode code points, instead of as ascii.
...And 14 more matches
Mobile first - Progressive web apps (PWAs)
this g
uide looks at a few useful techniques inside the mobile first umbrella.
...this rings true, yes, but in our experience mobile first is more about having the mobile implementation as a default layer to b
uild on.
...this means that mobiles (often the target devices with the least available memory, bandwidth or processing power available) can be given an experience s
uitable for them as q
uickly as possible, and as free as possible of extraneous information.
...And 14 more matches
Compiling from Rust to WebAssembly - WebAssembly
rust and webassembly use cases there are two main use cases for rust and webassembly: to b
uild an entire application — an entire web app based in rust.
... to b
uild a part of an application — using rust in an existing javascript frontend.
... in this tutorial, we b
uild an npm package using wasm-pack, a tool for b
uilding npm packages in rust.
...And 14 more matches
panel - Archive of obsolete content
the screenshot below shows a panel whose content is b
uilt from the list of currently open tabs: panels are useful for presenting temporary interfaces to users in a way that is easier for users to ignore and dismiss than a modal dialog, since panels are hidden the moment users interact with parts of the application interface outside them.
... you can load remote html into the panel: var mypanel = req
uire("sdk/panel").panel({ width: 180, height: 180, contenturl: "https://en.wikipedia.org/w/index.php?title=jetpack&useformat=mobile" }); mypanel.show(); you can also load html that's been packaged with your add-on, and this is most probably how you will create dialogs.
... to do this, save the html in your add-on's data directory and load it using the data.url() method exported by the self module, like this: var mypanel = req
uire("sdk/panel").panel({ contenturl: req
uire("sdk/self").data.url("myfile.html") }); mypanel.show(); from firefox 34, you can use "./myfile.html" as an alias for self.data.url("myfile.html").
...And 13 more matches
widget - Archive of obsolete content
please see the
ui module for replacements.
... for example, this widget contains an image, so it looks like a simple icon: req
uire("sdk/widget").widget({ id: "mozilla-icon", label: "my mozilla widget", contenturl: "http://www.mozilla.org/favicon.ico" }); you can make contenturl point to an html or icon file which you have packaged inside your add-on.
... just save the file in your add-on's data directory, and reference it using the data.url() method of the self module: var data = req
uire("sdk/self").data; req
uire("sdk/widget").widget({ id: "my-widget", label: "my widget", contenturl: data.url("my-content.html") }); this widget contains an entire web page: req
uire("sdk/widget").widget({ id: "hello-display", label: "my hello widget", content: "hello!", width: 50 }); widgets are q
uite small by default, so this example used the width property to grow it in order to show all the text.
...And 13 more matches
lang/type - Archive of obsolete content
let { isundefined } = req
uire('sdk/lang/type'); var foo; isundefined(foo); // true isundefined(0); // false parameters value : mixed the variable to check.
... let { isnull } = req
uire('sdk/lang/type'); isnull(null); // true isnull(false); // false parameters value : mixed the variable to check.
... let { isstring } = req
uire('sdk/lang/type'); isstring('my string'); // true isstring(100); // false isstring('100'); // true parameters value : mixed the variable to check.
...And 13 more matches
XPCOM Objects - Archive of obsolete content
that's q
uite a lot.
...this section is a q
uick g
uide on how to read xpcom documentation, which basically amounts to understanding the syntax of xpidl, the language used to specify xpcom interfaces.
... some commonly used xpcom methods req
uire other xpcom types as parameters.
...And 13 more matches
Introduction - Archive of obsolete content
when the xul parser sees an element with this attribute, it constructs a template b
uilder for the element and attaches it to the element.
...the template b
uilder loads the datasource, performs a query on the datasource and generates content based on the results in combination with the template.
...the template b
uilder loads an rdf datasource using the rdf service in the same way as you would create a datasource through the rdf service directly.
...And 13 more matches
Mobile accessibility - Learn web development
prereq
uisites: basic computer literacy, a basic understanding of html, css, and javascript, and an understanding of the previous articles in the course.
...long gone are the days when mobile devices ran completely different web technologies to desktop browsers, forcing developers to use browser sniffing and serve them completely separate sites (although q
uite a few companies still detect usage of mobile devices and serve them a separate mobile domain).
... these days, mobile devices can usually handle fully-featured websites, and the main platforms even have screenreaders b
uilt in to enable visually impaired users to use them successfully.
...And 13 more matches
What is accessibility? - Learn web development
prereq
uisites: basic computer literacy, a basic understanding of html and css.
...just as it is wrong to exclude someone from a physical b
uilding because they are in a wheelchair (modern public b
uildings generally have wheelchair ramps or elevators), it is also not right to exclude someone from a website because they have a visual impairment.
... b
uilding accessible sites benefit everyone: semantic html, which improves accessibility, also improves seo, making your site more findable.
...And 13 more matches
Organizing your CSS - Learn web development
previous overview: b
uilding blocks as you start to work on larger stylesheets and big projects you will discover that maintaining a huge css file can be challenging.
... prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn some tips and best practices for organizing stylesheets, and find out about some of the naming conventions and tools in common usage to help with css organization and team working.
... does your project have a coding style g
uide?
...And 13 more matches
Grids - Learn web development
it lets you lay content out in rows and columns, and has many features that make b
uilding complex layouts straightforward.
... prereq
uisites: html basics (study introduction to html), and an idea of how css works (study introduction to css and styling boxes.) objective: to understand the fundamental concepts behind grid layout systems, and how to implement a grid layout using css grid.
...row: 2; } aside { grid-column: 1; grid-row: 2; } footer { grid-column: 1 / 3; grid-row: 3; } header, footer { border-radius: 5px; padding: 10px; background-color: rgb(207,232,220); border: 2px solid rgb(79,185,227); } aside { border-right: 1px solid #999; } <div class="container"> <header>this is my lovely blog</header> <article> <h1>my article</h1> <p>d
uis felis orci, pulvinar id metus ut, rutrum luctus orci.
...And 13 more matches
Practical positioning examples - Learn web development
this article shows how to b
uild some real world examples to illustrate what kinds of things you can do with positioning.
... prereq
uisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to get an idea of the practicalities of positioning a tabbed info-box the first example we'll look at is a classic tabbed info box — a very common feature used when you want to pack a lot of information into a small area.
... this includes information-heavy apps like strategy/war games, mobile versions of websites where the screen is narrow and space is limited, and compact information boxes where you might want to make lots of information available without having it fill the whole
ui.
...And 13 more matches
Continuous Integration
when you push a commit to mozilla-central or a related repository, it initiates a large chain of b
uilds and tests across multiple types of infrastructure.
... taskcluster generate binary b
uilds for firefox and firefox for android across a variety of operating sytems.
... after the b
uilds are completed, they are used to run a series of correctness and performance tests.
...And 13 more matches
Localization content best practices
note: if you're a localizer and you want to contribute to the localization of mozilla products, you might want to read our localization q
uick start g
uide for information on localizing mozilla code.
...for example accessibility (a11y) strings: in this case space is less important than clarity, since these strings are not displayed in the
ui but used by tools like screen readers.
... example: search %1$s for "%2$s" non-directional single, and double, quotation marks should be used in reference to html code, or other languages where ascii character usage is req
uired, such as html.
...And 13 more matches
QA phase
since such is the case, this part of the g
uide may not be entirely applicable to you.
... in order to see your work on firefox (or another mozilla application), you'll need to have a b
uilt language pack to install on your local instance.
... manual & automated b
uilds with the click of a button, some l10n tools (like narro and koala) automatically create language pack b
uilds for you.
...And 13 more matches
sslintro.html
this page is part of the ssl reference that we are migrating into the format described in the mdn style g
uide.
...req
uired.
...sets up configuration files and performs other tasks req
uired to run network security services.
...And 13 more matches
SpiderMonkey Internals
see the jsapi user g
uide.
... self-hosting of b
uilt-in functions in js starting with firefox 17, spidermonkey has the ability to implement b
uilt-in functions in self-hosted js code.
... this code is compiled in a special compilation mode that gives it access to functionality that's not normally exposed to js code, but that's req
uired for safe and specification-conformant implementation of b
uilt-in functions.
...And 13 more matches
Introduction to the JavaScript shell
it is the javascript eq
uivalent of python's interactive prompt, the lisp read-eval-print loop, or ruby's irb.
... to get the spidermonkey javascript shell, see the spidermonkey b
uild documentation or download a compiled binary for your platform from the nightly b
uilds.
...the version() shell b
uiltin is still there for testing legacy features.
...And 13 more matches
Setting up the Gecko SDK
« previousnext » this chapter provides basic setup information for the gecko software development kit (sdk) used to b
uild the weblock component in this tutorial.
... downloading and setting the sdk the gecko sdk provides all of the tools, headers, and libraries that you need to b
uild xpcom components.
...the weblock component was b
uilt with version 1.4a, which is no longer available.
...And 13 more matches
NS_ConvertASCIItoUTF16
methods constructors void ns_convertasciitoutf16(const char*) - source parameters char* acstring void ns_convertasciitoutf16(const char*, pr
uint32) - source parameters char* acstring pr
uint32 alength void ns_convertasciitoutf16(const nsacstring_internal&) - source parameters nsacstring_internal& acstring operator= nsautostring& operator=(const nsautostring&) - source parameters nsautostring& str nsstring& operator=(const nsstring&) - source parameters nsstring& str nsastring_internal& operator=(prunichar) - s...
... @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nsstring&, pr
uint32, pr
uint32) const - source parameters nsstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nsstring&, pr
uint32) const - source parameters nsstring& aresult pr
uint32 acount right pr
uint32 right(nsstring&, pr
uint32) const - source parameters nsst...
...ring& aresult pr
uint32 acount setcharat prbool setcharat(prunichar, pr
uint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pr
uint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
...And 13 more matches
NS_ConvertUTF8toUTF16
methods constructors void ns_convertutf8toutf16(const char*) - source parameters char* acstring void ns_convertutf8toutf16(const char*, pr
uint32) - source parameters char* acstring pr
uint32 alength void ns_convertutf8toutf16(const nsacstring_internal&) - source parameters nsacstring_internal& acstring operator= nsautostring& operator=(const nsautostring&) - source parameters nsautostring& str nsstring& operator=(const nsstring&) - source parameters nsstring& str nsastring_internal& operator=(prunichar) - so...
... @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nsstring&, pr
uint32, pr
uint32) const - source parameters nsstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nsstring&, pr
uint32) const - source parameters nsstring& aresult pr
uint32 acount right pr
uint32 right(nsstring&, pr
uint32) const - source parameters nsst...
...ring& aresult pr
uint32 acount setcharat prbool setcharat(prunichar, pr
uint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pr
uint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
...And 13 more matches
nsAdoptingString
methods constructors void nsadoptingstring() - source void nsadoptingstring(prunichar*, pr
uint32) - source parameters prunichar* str pr
uint32 length void nsadoptingstring(const nsadoptingstring&) - source parameters nsadoptingstring& str operator= nsadoptingstring& operator=(const nsadoptingstring&) - source parameters nsadoptingstring& str nsxpidlstring& operator=(const nsxpidlstring&) - source parameters nsxpidlstring& str nsstring& operator=(const nsstring&...
..._internal& operator=(const nsastring_internal&) - source parameters nsastring_internal& str nsastring_internal& operator=(const nssubstringtuple&) - source parameters nssubstringtuple& tuple operator const prunichar* prunichar* operator const prunichar*() const - source operator[] prunichar operator[](print32) const - source parameters print32 i prunichar operator[](pr
uint32) const - source parameters pr
uint32 i get prunichar* get() const - source returns the null-terminated string find print32 find(const nscstring&, prbool, print32, print32) const - source search for the given substring within this string.
... @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nsstring&, pr
uint32, pr
uint32) const - source parameters nsstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nsstring&, pr
uint32) const - source parameters nsstring& aresult pr
uint32 acount right pr
uint32 right(nsstring&, pr
uint32) const - source parameters nsst...
...And 13 more matches
nsAutoString
methods constructors void nsautostring() - source constructors void nsautostring(prunichar) - source parameters prunichar c void nsautostring(const prunichar*, pr
uint32) - source parameters prunichar* data pr
uint32 length void nsautostring(const nsautostring&) - source parameters nsautostring& str void nsautostring(const nsastring_internal&) - source parameters nsastring_internal& str void nsautostring(const nssubstringtuple&) - source parameters nssubstringtuple& tuple operator= nsautostring& operator=(const nsautostring&) - sour...
... @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nsstring&, pr
uint32, pr
uint32) const - source parameters nsstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nsstring&, pr
uint32) const - source parameters nsstring& aresult pr
uint32 acount right pr
uint32 right(nsstring&, pr
uint32) const - source parameters nsst...
...ring& aresult pr
uint32 acount setcharat prbool setcharat(prunichar, pr
uint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pr
uint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
...And 13 more matches
nsCAutoString
methods constructors void nscautostring() - source constructors void nscautostring(char) - source parameters char c void nscautostring(const char*, pr
uint32) - source parameters char* data pr
uint32 length void nscautostring(const nscautostring&) - source parameters nscautostring& str void nscautostring(const nsacstring_internal&) - source parameters nsacstring_internal& str void nscautostring(const nscsubstringtuple&) - source parameters nscsubstringtuple& tuple operator= nscautostring& ...
... @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nscstring&, pr
uint32, pr
uint32) const - source parameters nscstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nscstring&, pr
uint32) const - source parameters nscstring& aresult pr
uint32 acount right pr
uint32 right(nscstring&, pru...
...int32) const - source parameters nscstring& aresult pr
uint32 acount setcharat prbool setcharat(prunichar, pr
uint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pr
uint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
...And 13 more matches
nsString
methods constructors void nsstring() - source constructors void nsstring(prunichar) - source parameters prunichar c void nsstring(const prunichar*, pr
uint32) - source parameters prunichar* data pr
uint32 length void nsstring(const nsstring&) - source parameters nsstring& str void nsstring(const nssubstringtuple&) - source parameters nssubstringtuple& tuple void nsstring(const nsastring_internal&) - source parameters nsastring_internal& readable operator= nsstring& operator=(const nsstring&) - source parameters nsstri...
... @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nsstring&, pr
uint32, pr
uint32) const - source parameters nsstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nsstring&, pr
uint32) const - source parameters nsstring& aresult pr
uint32 acount right pr
uint32 right(nsstring&, pr
uint32) const - source parameters nsst...
...ring& aresult pr
uint32 acount setcharat prbool setcharat(prunichar, pr
uint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pr
uint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
...And 13 more matches
xptcall FAQ
porting this code is req
uired in order to make mozilla run on any given platform.
... both of these facilities are req
uired by xpconnect.
... the xptcall approach was chosen over an approach that would have req
uired generating stub code for calling and implementing all interfaces.
...And 13 more matches
MediaTrackConstraints - Web APIs
a constraints dictionary is passed into applyconstraints() to allow a script to establish a set of exact (req
uired) values or ranges and/or preferred values or ranges of values for the track, and the most recently-requested set of custom constraints can be retrieved by calling getconstraints().
... properties of all media tracks deviceid a constraindomstring object specifying a device id or an array of device ids which are acceptable and/or req
uired.
... groupid a constraindomstring object specifying a group id or an array of group ids which are acceptable and/or req
uired.
...And 13 more matches
Screen Wake Lock API - Web APIs
only visible (active) documents can acq
uire the screen wake lock.
... you acq
uire a wakelocksentinel object by calling the navigator.wakelock.request() promise based method that resolves if the platform allows it.
...it is good practice to store a reference to the sentinel object to control release later and also to reacq
uire the lock if need be.
...And 13 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
the most common host environment is the browser, but javascript interpreters can also be found in a huge list of other places, including adobe acrobat, adobe photoshop, svg images, yahoo's widget engine, server-side environments such as node.js, nosql databases like the open source apache couchdb, embedded computers, complete desktop environments like gnome (one of the most popular g
uis for gnu/linux operating systems), and others.
... overview javascript is a multi-paradigm, dynamic language with types and operators, standard b
uilt-in objects, and methods.
... let's start off by looking at the b
uilding blocks of any language: the types.
...And 13 more matches
Modules - Archive of obsolete content
we will show how to do each of these things using the b
uilt-in components object provided by xulrunner application such as firefox and thunderbird.
...xulrunner adds a b
uilt-in object, known as components, to the global scope.
...this breaks encapsulation, as it allows the script being loaded to access the b
uilt-in constructors of the loading script, which are defined on its global object.
...And 12 more matches
Signing an XPI - Archive of obsolete content
see signing an extension for a practical g
uide.
...use this command to create it (note the trailing dot is req
uired).
...if the browser is currently running, you should exit the browser before contin
uing this operation.
...And 12 more matches
Mozilla Crypto FAQ - Archive of obsolete content
at that point both nss and psm will be completely b
uildable using the open source code available from the mozilla.org site, and nss and psm will be included in the mozilla binary releases distributed by mozilla.org.
...also note that the nss developers are creating code for support of s/mime secure messages; however full s/mime support within mozilla will req
uire further development, and may not be available until after the mozilla 1.0 release.
... finally, note that nss (and thus psm) can also be b
uilt using a licensed copy of the rsa bsafe crypto-c library (versions 4.1 or 5.0).
...And 12 more matches
Running Tamarin performance tests - Archive of obsolete content
running the performance tests req
uires the following steps: set the avm environment variable to the path of the avmshell executable.
... set the b
uiltinabc environment variable to the path of the b
uiltin.abc.
...also the source to asc.jar may be downloaded and reb
uilt from http://opensource.adobe.com/wiki/dis...exsdk/flex+sdk.
...And 12 more matches
Rule Compilation - Archive of obsolete content
<vbox datasources="http://www.xulplanet.com/ds/sample.rdf" ref="http://www.xulplanet.com/rdf/a" flex="1"> <template> <query> -- query content goes here -- </query> <rule> -- rule content goes here -- </rule> <rule> -- rule content goes here -- </rule> </template> </vbox> query/rule compilation and lazy content generation when the template b
uilder starts processing, and after it has started the datasource loading, it first must compile the query and rules.
...however, reb
uilding the template (using the b
uilder.reb
uild method) will recompile the query and rules and reapply the template again.
... this means that you can change the rules using dom methods, reb
uild the template, and get different results.
...And 12 more matches
Simple Query Syntax - Archive of obsolete content
a simple query is eq
uivalent to a query with only the content tag and a member tag, as well as optionally a set of triples from the child node.
... at its simplest, the simple query syntax is eq
uivalent to the following: <query> <content uri="?start"/> <member container="?start" child="?photo"/> </query> the template b
uilder uses the simple query syntax whenever a template does not have a <query> element.
...in the simple syntax, the b
uilder will use the default query shown above, although the variable names are randomly generated.
...And 12 more matches
2006-10-20 - Archive of obsolete content
summary: mozilla.dev.b
uilds - october 14th to october 20th 2006 linux reference platform 1.8.1 october 18th: marcus is wondering about the linux platform that is currently used to compile both public releases of firefox and xulrunner.
... marcus claims that when he b
uilds firefox using centos he encounters crashes (segmentation faults) under linux distributions such as gentoo, suse and fedora.
... he also points out that when he performs a local b
uild any of those platforms (gentoo, suse and fedora) he doesn't encounter any problems on the same machine.
...And 12 more matches
Archive of obsolete content
or for "reasons," your company is req
uired to use very old software and you need to b
uild web content that runs on that software.
...material in this archived content zone should not be used for b
uilding new web sites or apps for modern browsers.
... adding preferences to an extension this article takes the creating a dynamic status bar extension sample to the next level, adding a popup menu that lets you q
uickly switch between multiple stocks to watch.
...And 12 more matches
CSS and JavaScript accessibility best practices - Learn web development
prereq
uisites: basic computer literacy, a basic understanding of html, css, and javascript, and understanding of what accessibility is.
...to put it another way, it is important that you consider some best practice advice to make sure that your use of css and javascript doesn't r
uin the accessibility of your documents.
...instead of marking req
uired form fields in red, for example, mark them with an asterisk and in red.
...And 12 more matches
HTML text fundamentals - Learn web development
prereq
uisites: basic html familiarity, as covered in getting started with html.
...furthermore: users looking at a web page tend to scan q
uickly to find relevant content, often just reading the headings to begin with.
...among the various techniques used, they provide an outline of the document by reading out the headings, allowing their users to find the information they need q
uickly.
...And 12 more matches
Third-party APIs - Learn web development
previous overview: client-side web apis next the apis we've covered so far are b
uilt into the browser, but not all apis are.
... prereq
uisites: javascript basics (see first steps, b
uilding blocks, javascript objects), the basics of client-side apis objective: to learn how third-party apis work, and how to use them to enhance your websites.
... they are found on third-party servers browser apis are b
uilt into the browser — you can access them from javascript immediately.
...And 12 more matches
Understanding client-side JavaScript frameworks - Learn web development
javascript frameworks are an essential part of modern front-end web development, providing developers with tried and tested tools for b
uilding scalable, interactive web applications.
... many modern companies use frameworks as a standard part of their tooling, so many front-end development jobs now req
uire framework experience.
... get started now, with "introduction to client-side frameworks" prereq
uisites you should really learn the basics of the core web languages first before attempting to move on to learning client-side frameworks — html, css, and especially javascript.
...And 12 more matches
Strategies for carrying out testing - Learn web development
previous overview: cross browser testing next this article starts the module off by providing an overview of the topic of (cross) browser testing, answering questions such as "what is cross-browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" prereq
uisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross-browser testing.
... by coding defensively, we mean trying to b
uild in intelligent fallbacks so that if a feature or style doesn't work in a browser, the site will be able to downgrade to something less exciting that still provides an acceptable user experience — the core information is still accessible, for example, even if it doesn't look q
uite as nice.
... the aim is to b
uild up a chart of browsers/devices you can refer to as you test.
...And 12 more matches
Mozilla's Section 508 Compliance
the united states federal rehabilitation act's section 508 is a new standard for defining accessibility req
uirements for software and other electronic and information technology.
... here is a detailed list of section 508 bugs in mozilla's seamonkey application s
uite.
...here are the section 508 req
uirements and how far along mozilla seamonkey rv1.8a4 is with each one: req
uirement windows linux/unix mac os req
uirement windows linux/unix mac os (a) when software is designed to run on a system that has a keyboard, product functions shall be executable from a keyboard where the function itself or the result of performing a function can be discerned textually.
...And 12 more matches
Multiprocess on Windows
prereq
uisite reading since so much of this design resolves around microsoft com and its concept of the apartment, readers of this document should have a solid understanding of what apartments are.
...since gecko's main thread uses com, and com req
uires threads to declare their threading model, the main thread must initialize itself to live inside its own single threaded apartment (sta).
... as you should already know from the prereq
uisite reading, single threaded apartments receive remote procedure calls (rpcs) from com, via the windows message queue.
...And 12 more matches
Software accessibility: Where are we today?
magnification enlarges the screen's contents: for those with low vision, it may suffice to use a larger font, a b
uilt-in high contrast theme, or even just an an extra large screen.
...screen magnifiers also have some b
uilt-in text-to-speech and the ability to filter text and images through various color palettes, such as black on yellow for high contrast, or green on blue for low contrast.
... braille a solution used for q
uiet reading, for detailed work, and by deaf-blind users.
...And 12 more matches
Creating a Language Pack
please consult the documentation on localized b
uilds on firefox-source-docs.
... pre-b
uild steps in the .mozconfig, you want to have mk_add_options moz_objdir=@topsrcdir@/obj-firefox-b
uild ac_add_options --disable-compile-environment ac_add_options --with-l10n-base=../l10n-central # path relative to moz_objdir ac_add_options --enable-application=[browser or mail] the given path should have your localization directory as child (i.e., a subdirectory ab-cd where ab-cd is your locale code).
... configure step you need to prepare the b
uild directory, which is done with ./mach configure you only need to run this if the version number of firefox changes.
...And 12 more matches
Internationalized Domain Names (IDN) Support in Mozilla Browsers
introduction netscape 7.1 is the first commercial browser that has b
uilt-in support for internationalized domain name under the new ietf rfc's established in 2003.
... how idn works when a browser sees a host name such as http://developer.mozilla.org, it passes a request to the dns resolver service (usually b
uilt into an os), which in turn sends a request to a nearest domain name server to return an ip address that corresponds to the host name.
... how mozilla browsers handle non-ascii domain names unicode and nameprep when mozilla receives idn input from the user via the location bar or a request to process non-ascii host name links, it first turns them into unicode, then normalizes the input string to make it conform to general uri req
uirement.
...And 12 more matches
Creating the Component Code
« previousnext » this chapter goes over the basic code req
uired to handle the relationship between your component and xpcom.
...an xpcom component needs to implement at least three interfaces that xpcom req
uires, and often others as well.
...this is very useful if the caller is req
uired to know information about the component like its threading module, whether or not it's a singleton, its implementation language, and so forth.
...And 12 more matches
nsAdoptingCString
methods constructors void nsadoptingcstring() - source void nsadoptingcstring(char*, pr
uint32) - source parameters char* str pr
uint32 length void nsadoptingcstring(const nsadoptingcstring&) - source parameters nsadoptingcstring& str operator= nsadoptingcstring& operator=(const nsadoptingcstring&) - source parameters nsadoptingcstring& str nsxpidlcstring& operator=(const nsxpidlcstring&) - source parameters nsxpidlcstring& str nscstring& operator=(const nscs...
...* data nsacstring_internal& operator=(const nsacstring_internal&) - source parameters nsacstring_internal& str nsacstring_internal& operator=(const nscsubstringtuple&) - source parameters nscsubstringtuple& tuple operator const char* char* operator const char*() const - source operator[] char operator[](print32) const - source parameters print32 i char operator[](pr
uint32) const - source parameters pr
uint32 i get char* get() const - source returns the null-terminated string find print32 find(const nscstring&, prbool, print32, print32) const - source search for the given substring within this string.
... @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nscstring&, pr
uint32, pr
uint32) const - source parameters nscstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nscstring&, pr
uint32) const - source parameters nscstring& aresult pr
uint32 acount right pr
uint32 right(nscstring&, pr
uint32) const - source parameters ...
...And 12 more matches
nsFixedCString
methods constructors void nsfixedcstring(char*, pr
uint32) - source @param data fixed-size buffer to be used by the string (the contents of this buffer may be modified by the string) @param storagesize the size of the fixed buffer @param length (optional) the length of the string already contained in the buffer parameters char* data pr
uint32 storagesize void nsfixedcstring(char*, pr
uint32, pr
uint32) - source parameters char* data pr
uint32 s...
...toragesize pr
uint32 length operator= nscstring& operator=(const nscstring&) - source parameters nscstring& str nsacstring_internal& operator=(char) - source parameters char c nsacstring_internal& operator=(const char*) - source parameters char* data nsacstring_internal& operator=(const nsacstring_internal&) - source parameters nsacstring_internal& str nsacstring_internal& operator=(const nscsubstringtuple&) - source parameters nscsubstringtuple& tuple get char* get() const - source returns the null-terminated string find print32 find(const nscstring&, prbool, print32, print32) const - source search for the given substring within this string.
... @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nscstring&, pr
uint32, pr
uint32) const - source parameters nscstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nscstring&, pr
uint32) const - source parameters nscstring& aresult pr
uint32 acount right pr
uint32 right(nscstring&, pr
uint32) const - source parameters ...
...And 12 more matches
nsPromiseFlatString
@param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nsstring&, pr
uint32, pr
uint32) const - source parameters nsstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nsstring&, pr
uint32) const - source parameters nsstring& aresult pr
uint32 acount right pr
uint32 right(nsstring&, pr
uint32) const - source parameters nsst...
...ring& aresult pr
uint32 acount setcharat prbool setcharat(prunichar, pr
uint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pr
uint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... appendwithconversion void appendwithconversion(const nsacstring_internal&) - source parameters nsacstring_internal& astring void appendwithconversion(const char*, print32) - source parameters char* adata print32 alength appendint void appendint(print32, print32) - source append the given integer to this string parameters print32 ainteger print32 aradix void appendint(pr
uint32, print32) - source append the given unsigned integer to this string parameters pr
uint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat be...
...And 12 more matches
nsXPIDLString
methods constructors void nsxpidlstring() - source void nsxpidlstring(const nsxpidlstring&) - source parameters nsxpidlstring& str operator const prunichar* prunichar* operator const prunichar*() const - source operator[] prunichar operator[](print32) const - source parameters print32 i prunichar operator[](pr
uint32) const - source parameters pr
uint32 i operator= nsxpidlstring& operator=(const nsxpidlstring&) - source parameters nsxpidlstring& str nsstring& operator=(const nsstring&) - source parameters nsstring& str nsastring_internal& operator=(prunichar) - source parameters prunichar c nsastring_internal& operator=(const prunichar*) - source parameters prunichar* data ...
... @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nsstring&, pr
uint32, pr
uint32) const - source parameters nsstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nsstring&, pr
uint32) const - source parameters nsstring& aresult pr
uint32 acount right pr
uint32 right(nsstring&, pr
uint32) const - source parameters nsst...
...ring& aresult pr
uint32 acount setcharat prbool setcharat(prunichar, pr
uint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pr
uint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
...And 12 more matches
nsIAppShellService
boolean createstartupstate(in long awindowwidth, in long awindowheight); obsolete since gecko 1.8 nsixulwindow createtoplevelwindow(in nsixulwindow aparent, in nsiuri aurl, in pr
uint32 achromemask, in long ainitialwidth, in long ainitialheight, in nsiappshell aappshell); nsiwebnav createwindowlessbrowser (in bool aischrome) void destroyhiddenwindow(); void doprofilestartup(in nsicmdlineservice acmdlineservice, in boolean caninteract); obsolete since gecko 1.8 void ensure1window(in nsicmdlineservice acmdlineservice); obsolete since gecko ...
... void hidesplashscreen(); obsolete since gecko 1.8 void initialize(in nsicmdlineservice acmdlineservice, in nsisupports nativeappsupportorsplashscreen); obsolete since gecko 1.8 void q
uit(in pr
uint32 aferocity); obsolete since gecko 1.8 void registertoplevelwindow(in nsixulwindow awindow); void run(); obsolete since gecko 1.8 void toplevelwindowismodal(in nsixulwindow awindow, in boolean amodal); obsolete since gecko 1.9.1 void unregistertoplevelwindow(in nsixulwindow awindow); note: prior to gecko 8.0, all references to nsidomwindow us...
... econsiderq
uit 1 attempt to q
uit if all windows are closed.
...And 12 more matches
nsIDOMWindowUtils
to get this interface, use: var domwindowutils = window.windowutils; method overview void activatenativemen
uitemat(in astring indexstring); void clearmozafterpaintevents(); pr
uint32 comparecanvases(in nsidomhtmlcanvaselement acanvas1, in nsidomhtmlcanvaselement acanvas2, out unsigned long amaxdifference); double computeanimationdistance(in nsidomelement element, in astring property, in astring value1, in astring value2); nsicompositionstringsynthesizer createcompos...
...odesfromrect(in float ax, in float ay, in float atopsize, in float arightsize, in float abottomsize, in float aleftsize, in boolean aignorerootscrollframe, in boolean aflushlayout); void processupdates(); obsolete since gecko 13.0 void purgepccounts(); unsigned long redraw([optional] in unsigned long acount); void renderdocument(in nsconstrect arect, in pr
uint32 aflags, in nscolor abackgroundcolor, in gfxcontext athebescontext); native code only!
...; void sendtextevent(in astring acompositionstring, in long afirstclauselength, in unsigned long afirstclauseattr, in long asecondclauselength, in unsigned long asecondclauseattr, in long athirdclauselength, in unsigned long athirdclauseattr, in long acaretstart, in long acaretlength); obsolete since gecko 26 boolean sendtouchevent(in astring atype, [array, size_is(count)] in pr
uint32 aidentifiers, [array, size_is(count)] in print32 axs, [array, size_is(count)] in print32 ays, [array, size_is(count)] in pr
uint32 arxs, [array, size_is(count)] in pr
uint32 arys, [array, size_is(count)] in float arotationangles, [array, size_is(count)] in float aforces, in pr
uint32 count, in long amodifiers, [optional] in boolean aignorerootscrollframe); void setcssviewport(in float ...
...And 12 more matches
BasicCardResponse - Web APIs
request.show().then(function(instrumentresponse) { // do something with the response from the
ui.
...androidfirefox for androidopera for androidsafari on iossamsung internetbasiccardresponsechrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true) and the dom.payments.request.supportedregions preference (needs to be set to a comma-delineated list of one or more 2-character iso country codes indicating the countries in which to support payments (for example, us,ca.).
... webview android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true) and the dom.payments.request.supportedregions preference (needs to be set to a comma-delineated list of one or more 2-character iso country codes indicating the countries in which to support payments (for example, us,ca.).
...And 12 more matches
Accessibility Information for Web Authors - Accessibility
g
uidelines and regulations section 508 g
uidelines for web authors these g
uidelines must be followed by u.s.
...other organizations such as schools are starting to follow these g
uidelines as well.
... web content accessibility g
uidelines (wcag) 1.0 another important set of g
uidelines from the w3c web accessibility initiative (wai).
...And 12 more matches
text-justify - CSS: Cascading Style Sheets
d
uis nisi velit, dictum id mauris vitae, lobortis pretium quam.
... q
uisque sed nisi pulvinar, consequat justo id, feugiat leo.
... cras eu elementum d
ui.</p> <p class="auto"><code>text-justify: auto</code> —<br>lorem ipsum dolor sit amet, consectetur adipiscing elit.
...And 12 more matches
SVG documentation index - SVG: Scalable Vector Graphics
tags and summary 1 svg: scalable vector graphics 2d graphics, graphics, icons, images, reference, responsive design, svg, scalable graphics, scalable images, vector graphics, web, l10n:priority scalable vector graphics (svg) are an xml-based markup language for describing two-dimensional based vector graphics.xml 2 applying svg effects to html content css, g
uide, html, svg modern browsers support using svg within css styles to apply graphical effects to html content.
... 5 linking g
uide, svg the target attribute on the svg <a> element doesn't work in mozilla firefox 1.5.
... 11 svg 1.1 support in firefox firefox, svg you can find some basic examples of svg syntax and usage in the w3c svg test s
uite.
...And 12 more matches
dev/panel - Archive of obsolete content
most of the firefox developer tools are hosted in a
ui component called the toolbox.
... individual b
uilt-in tools, such as the javascript debugger or the web console, occupy "panels" in the toolbox.
...you can use the class utility function: const { panel } = req
uire("dev/panel"); const { class } = req
uire("sdk/core/heritage"); const mypanel = class({ extends: panel, label: "my panel", tooltip: "my new devtool", icon: "./my-devtool.png", url: "./my-devtool.html", setup: function(options) { // my setup goes here }, dispose: function() { // my teardown goes here }, onready: function() { // i can send messages to // the pan...
...And 11 more matches
remote/parent - Archive of obsolete content
usage in multiprocess firefox: the browser
ui runs in one process, sometimes called the chrome process or the parent process web content runs in one or more other processes, sometimes called content processes or remote processes or child processes.
... its primary purpose is to help b
uild apis.
... terms process every application has at least one process running, the main process that displays the
ui.
...And 11 more matches
Chrome Authority - Archive of obsolete content
to obtain these privileges, the module must declare its intent with a statement like the following: var {cc, ci} = req
uire("chrome"); the "chrome" b
uilt-in pseudo module is provided by the "toolkit/loader" module.
... the object returned by req
uire("chrome"), when unpacked with the destructuring assignment feature available in the mozilla js environment, will provide the usual components.* aliases: cc an alias for components.classes.
... note: the req
uire("chrome") statement is the only way to access chrome functionality and the components api.
...And 11 more matches
Finding window handles - Archive of obsolete content
when working on windows platforms, many apis and frameworks req
uire a window handle (hwnd type).
... finding the content window handle hwnd hcontent = 0; // first we need to find the main browser window hwnd hff = ::findwindowex(0, 0, "mozilla
uiwindowclass", 0); if (hff) { // next we step down through a fixed structure hwnd htemp; htemp = ::findwindowex(hff, 0, "mozillawindowclass", 0); htemp = ::findwindowex(htemp, 0, "mozillawindowclass", 0); // assume only 1 window at this level has children // and the 1 with children is the one we want hwnd hchild = ::getwindow(htemp, gw_child); while (htemp && !hchi...
...'resource://gre/modules/ctypes.jsm'); var user32 = ctypes.open('user32.dll'); /* http://msdn.microsoft.com/en-us/library/ms633539%28v=vs.85%29.aspx * bool winapi setforegroundwindow( * __in_ hwnd hwnd * ); */ var setforegroundwindow = user32.declare('setforegroundwindow', ctypes.winapi_abi, ctypes.bool, // return bool ctypes.voidptr_t // hwnd ); var hwnd = ctypes.voidptr_t(ctypes.
uint64(hwndstring)); var rez_setforegroundwindow = setforegroundwindow(hwnd); console.log('rez_setforegroundwindow:', rez_setforegroundwindow, rez_setforegroundwindow.tostring()); user32.close(); mac os x objective-c components.utils.import('resource://gre/modules/services.jsm'); var browserwindow = services.wm.getmostrecentwindow('navigator:browser'); if (!browserwindow) { throw new error(...
...And 11 more matches
Multiple Queries - Archive of obsolete content
here is an example using an rdf datasource: <hbox id="photoslist" datasources="template-g
uide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <queryset> <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="canal"/> </query> <action> <button uri="?photo" image="?photo" l...
...this would be a better idea as it only req
uires one query, is simpler and more efficient, however you could imagine a more complex query where this wasn't possible.
...there's no magic to the way in which the template b
uilder processes multiple queries.
...And 11 more matches
RDF Query Syntax - Archive of obsolete content
however, the template b
uilder will be able to compile the rules and examine them as described earlier.
... the b
uilder needs to start with a single result as the seed result.
...actually, in the current template implementation, the above description isn't q
uite correct.
...And 11 more matches
Static Content - Archive of obsolete content
« previousnext » creating a men
uitem in the filter list to show all items is fairly easy.
... <menulist datasources="template-g
uide-photos4.rdf" ref="http://www.daml.org/2001/09/countries/country-ont#country" oncommand="applyfilter(event.target.value);"> <menupopup> <men
uitem label="all"/> </menupopup> <template> <query> <content uri="?start"/> <triple subject="?country" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" object="?start"/> <triple subject="?country" predicate="http://purl.org/dc...
.../elements/1.1/title" object="?countrytitle"/> </query> <action> <menupopup> <men
uitem uri="?country" label="?countrytitle" value="?country"/> </menupopup> </action> </template> </menulist> the only difference between the previous example and this one is that the menulist element has some additional content added before the template.
...And 11 more matches
Advanced Rules - Archive of obsolete content
rule conditions when a tree, menu or other element with a datasource generates content, the template b
uilder first finds the resource referred to by the ref attribute.
...it serves as a placeholder as the template b
uilder iterates through the resources.
...to do this, use the member element as in the following: <tree id="citiestree" datasources="weather.rdf" ref="http://www.xulplanet.com/rdf/weather/cities"> <template> <rule> <conditions> <content uri="?list"/> <member container="?list" child="?city"/> </conditions> <rule> <template> </tree> the template b
uilder starts by grabbing the value of the ref attribute, which in this case is http://www.xulplanet.com/rdf/weather/cities.
...And 11 more matches
Positioning - Learn web development
prereq
uisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to learn how css positioning works.
...what if you want to slightly alter the position of some boxes inside a layout from their default layout flow position, to give a slightly q
uirky, distressed feel?
...or if you want to create a
ui element that floats over the top of other parts of the page, and/or always sits in the same place inside the browser window no matter how much the page is scrolled?
...And 11 more matches
Web fonts - Learn web development
prereq
uisites: basic computer literacy, html basics (study introduction to html), css basics (study introduction to css), css text and font fundamentals.
...the syntax req
uired looks something like this: first of all, you have a @font-face block at the start of the css, which specifies the font file(s) to download: @font-face { font-family: "myfont"; src: url("myfont.woff"); } below this you can then use the font family name specified inside @font-face to apply your custom font to anything you like, as normal: html { font-family: "myfont", "bitstream vera s...
...we'll show you below how to generate the req
uired code.
...And 11 more matches
Sending forms through JavaScript - Learn web development
let's first talk about why this req
uires a different approach.
... many modern
uis only use html forms to collect input from the user, and not for data submission.
... when the user tries to send the data, the application takes control and transmits the data asynchronously in the background, updating only the parts of the
ui that req
uire changes.
...And 11 more matches
Client-side storage - Learn web development
prereq
uisites: javascript basics (see first steps, b
uilding blocks, javascript objects), the basics of client-side apis objective: to learn how to use client-side storage apis to store application data.
... saving data and assets locally so a site will be q
uicker (and potentially less expensive) to download, or be usable without a network connection.
... let's b
uild up the example, so you can understand how it works.
...And 11 more matches
Drawing graphics - Learn web development
prereq
uisites: javascript basics (see first steps, b
uilding blocks, javascript objects), the basics of client-side apis objective: to learn the basics of drawing on <canvas> elements using javascript.
...the web still had no way to effectively create animations, games, 3d scenes, and other req
uirements commonly handled by lower level languages such as c++ or java.
... add the following code into it, just below the opening <body> tag: <canvas class="mycanvas"> <p>add s
uitable fallback here.</p> </canvas> we have added a class to the <canvas> element so it will be easier to select if we have multiple canvases on the page, but we have removed the width and height attributes for now (you could add them back in if you wanted, but we will set them using javascript in a below section).
...And 11 more matches
Server-side web frameworks - Learn web development
prereq
uisites: basic computer literacy.
...every "view" function (a request handler) receives an httprequest object containing request information, and is req
uired to return an httpresponse object with the formatted output (in this case a string).
...an http get request to get files or data from the server may encode what data is req
uired in url parameters or within the url structure.
...And 11 more matches
Handling common HTML and CSS problems - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross browser testing.
... in our debugging html and debugging css articles, we provided some really basic g
uidance on debugging html/css — if you are not familiar with the basics, you should definitely study these articles before carrying on.
...for example, see: sublimelinter for sublime text notepad++ linter vscode linters browser developer tools the developer tools b
uilt into most browsers also feature useful tools for hunting down errors, mainly for css.
...And 11 more matches
Creating reftest-based unit tests
if one has software that multiplies numbers, one wants a regression test to show that 2 * 2 continues to be calculated to be 4, not something similar to but not q
uite exactly 4.
... all the reftests, go to the directory where you save firefox's source code and run: ./mach reftest if you want to run a particular set of reftests, pass the path as an argument: ./mach reftest path/from/sourcedir/reftest.list and to run a single reftest just pass the path to the test file (not the reference file): ./mach reftest path/from/sourcedir/reftest-name.html there is no reftest eq
uivalent to mach mochitest --keep-open, but temporarily adding the reftest-wait class to a test (or disabling the script that removes it) will keep it open longer.
...if you try to run the full s
uite, you may experience stalls or other issues.
...And 11 more matches
Performance best practices for Firefox front-end engineers
this g
uide will help firefox developers working on front-end code produce code which is as performant as possible—not just on its own, but in terms of its impact on other parts of firefox.
... it is expected that over time, script will update the dom, req
uiring us to recalculate styles.
...calling it on the outer window of a subframe is not supported, and calling it from within the inner window of a subframe might cause the callback to fire even though a style and layout flush will still be req
uired.
...And 11 more matches
Extending a Protocol
q
uick start: extending a protocol this tutorial implements a simple ping-pong style ipdl protocol, which sends a message from the content process (main thread) to the chrome process (
ui thread).
... return echopromise.forget(); } ok, let's ./mach b
uild and make sure everything is compiling ok.
... custom protocol - pecho.ipdl this next part req
uires us to both specify the protocol and actually implement everything in c++.
...And 11 more matches
AddonManager
to import the addonmanager object in the add-on sdk, use: const { addonmanager } = req
uire("resource://gre/modules/addonmanager.jsm"); to import it in a normal bootstrapped extension or similar, use: cu.import("resource://gre/modules/addonmanager.jsm"); method overview promise?
...getaddonbysyncg
uid(in string id, in addoncallback?
... error_signedstate_req
uired the addon must be signed and isn't.
...And 11 more matches
Gecko Profiler FAQ
therefore the gecko profiler is not a s
uitable tool for finding hotspots within a single function.
... if the issue you are trying to avoid is not profiling on fast machines that mozilla developers typically use to b
uild firefox on, a better solution may be using a less high-end machine that actually has lower spec’d hardware instead of artificially slowing down just the cpu.
... it is q
uite reasonable to actually run the browser for 40 minutes and once the said leaks have happened capture the profiles and study what went wrong.
...And 11 more matches
Profiling with the Gecko Profiler and Local Symbols on Windows
profiling local b
uilds as of march 2018, profiling local b
uilds on windows should work out of the box, with full symbol information.
... in the past you had to need to run mach b
uildsymbols manually, but this is no longer needed.
... the profiler automatically reads symbols from the pdb files that are generated during the b
uild process.
...And 11 more matches
NSS_3.12.3_release_notes.html
nss 3.12.3 req
uires nspr 4.7.4.
... see the documentation section for the b
uild instructions.
...both debug and optimized b
uilds are provided.
...And 11 more matches
Thread Sanitizer
unlike other tools, it understands compiler-b
uiltin atomics and synchronization and therefore provides very accurate results with no real false positives.
... public b
uilds note: no public b
uilds are available at this time yet.
... manual b
uild b
uild prereq
uisites note: this section assumes you're using linux to b
uild.
...And 11 more matches
XForms Accessibility
intoduction this article provides a q
uick g
uide to how accessibility is handled in gecko for xforms..
... get b
uild subsections below explain how you can obtain accessible xforms-enabled b
uild.
... these are either downloading latest b
uild of firefox or b
uilding it yourself.
...And 11 more matches
NS_ConvertUTF16toUTF8
methods constructors void ns_convertutf16toutf8(const prunichar*) - source a helper class that converts a utf-16 string to utf-8 parameters prunichar* astring void ns_convertutf16toutf8(const prunichar*, pr
uint32) - source parameters prunichar* astring pr
uint32 alength void ns_convertutf16toutf8(const nsastring_internal&) - source parameters nsastring_internal& astring operator= nscautostring& operator=(const nscautostring&) - source parameters nscautostring& str nscstring& operator=(const nscstring&) - source parameters nscstring& str nsacstring_internal& operator=(char) -...
... @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nscstring&, pr
uint32, pr
uint32) const - source parameters nscstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nscstring&, pr
uint32) const - source parameters nscstring& aresult pr
uint32 acount right pr
uint32 right(nscstring&, pr
uint32) const - source parameters ...
... nscstring& aresult pr
uint32 acount setcharat prbool setcharat(prunichar, pr
uint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pr
uint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
...And 11 more matches
NS_LossyConvertUTF16toASCII
methods constructors void ns_lossyconvertutf16toascii(const prunichar*) - source a helper class that converts a utf-16 string to ascii in a lossy manner parameters prunichar* astring void ns_lossyconvertutf16toascii(const prunichar*, pr
uint32) - source parameters prunichar* astring pr
uint32 alength void ns_lossyconvertutf16toascii(const nsastring_internal&) - source parameters nsastring_internal& astring operator= nscautostring& operator=(const nscautostring&) - source parameters nscautostring& str nscstring& operator=(const nscstring&) - source parameters nscstring& str nsacstring_internal& operator=(c...
... @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nscstring&, pr
uint32, pr
uint32) const - source parameters nscstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nscstring&, pr
uint32) const - source parameters nscstring& aresult pr
uint32 acount right pr
uint32 right(nscstring&, pr
uint32) const - source parameters ...
... nscstring& aresult pr
uint32 acount setcharat prbool setcharat(prunichar, pr
uint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pr
uint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
...And 11 more matches
nsCString
methods constructors void nscstring() - source constructors void nscstring(char) - source parameters char c void nscstring(const char*, pr
uint32) - source parameters char* data pr
uint32 length void nscstring(const nscstring&) - source parameters nscstring& str void nscstring(const nscsubstringtuple&) - source parameters nscsubstringtuple& tuple void nscstring(const nsacstring_internal&) - source parameters nsacstring_internal& readable operator= nscstring& operator=(const nscstring&) - source parameters ...
... @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nscstring&, pr
uint32, pr
uint32) const - source parameters nscstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nscstring&, pr
uint32) const - source parameters nscstring& aresult pr
uint32 acount right pr
uint32 right(nscstring&, pr
uint32) const - source parameters ...
... nscstring& aresult pr
uint32 acount setcharat prbool setcharat(prunichar, pr
uint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pr
uint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
...And 11 more matches
nsDependentSubstring
methods constructors void nsdependentsubstring(const nsastring_internal&, pr
uint32, pr
uint32) - source parameters nsastring_internal& str pr
uint32 startpos pr
uint32 length void nsdependentsubstring(const prunichar*, const prunichar*) - source parameters prunichar* start prunichar* end void nsdependentsubstring(const nsreadingiterator<short unsigned int>&, const nsreadingiterator<short unsigned int>&) - source parameters nsreadingiterator<short unsigned int>& ...
...start nsreadingiterator<short unsigned int>& end void nsdependentsubstring() - source rebind void rebind(const nsastring_internal&, pr
uint32, pr
uint32) - source parameters nsastring_internal& <anonymous> pr
uint32 startpos pr
uint32 length void rebind(const prunichar*, const prunichar*) - source parameters prunichar* start prunichar* end beginreading prunichar* beginreading() const - source reading iterators nsreadingiterator<short unsigned int>& beginreading(nsreadingiterator<short unsigned int>&) const - source deprecated reading iterators parameters nsreadingiterator<short unsigned int>& iter prunichar*& beginreading(const prunichar*&) const - source parameters prunichar*& iter endreading prunichar* endreading() const - source nsreadingiterat...
...source parameters prunichar*& iter endwriting prunichar* endwriting() - source nswritingiterator<short unsigned int>& endwriting(nswritingiterator<short unsigned int>&) - source parameters nswritingiterator<short unsigned int>& iter prunichar*& endwriting(prunichar*&) - source parameters prunichar*& iter data prunichar* data() const - source accessors length pr
uint32 length() const - source isempty prbool isempty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat prunichar charat(pr
uint32) const - source parameters pr
uint32 i operator[] prunichar operator[](pr
uint32) const - source parameters pr
uint32 i first prunichar first() const - source l...
...And 11 more matches
nsXPIDLCString
methods constructors void nsxpidlcstring() - source void nsxpidlcstring(const nsxpidlcstring&) - source parameters nsxpidlcstring& str operator const char* char* operator const char*() const - source operator[] char operator[](print32) const - source parameters print32 i char operator[](pr
uint32) const - source parameters pr
uint32 i operator= nsxpidlcstring& operator=(const nsxpidlcstring&) - source parameters nsxpidlcstring& str nscstring& operator=(const nscstring&) - source parameters nscstring& str nsacstring_internal& operator=(char) - source parameters char c nsacstring_internal& operator=(const char*) - source parameters char* data nsacstring_...
... @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nscstring&, pr
uint32, pr
uint32) const - source parameters nscstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nscstring&, pr
uint32) const - source parameters nscstring& aresult pr
uint32 acount right pr
uint32 right(nscstring&, pr
uint32) const - source parameters ...
... nscstring& aresult pr
uint32 acount setcharat prbool setcharat(prunichar, pr
uint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pr
uint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
...And 11 more matches
Element.scrollHeight - Web APIs
the scrollheight value is equal to the minimum height the element would req
uire in order to fit all the content in the viewport without using a vertical scrollbar.
...ut enim ad minim veniam, q
uis nostrud exercitation ullamco laboris nisi ut aliq
uip ex ea commodo consequat.
... d
uis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
...And 11 more matches
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
to round off this set of g
uides to css grid layout, i am going to walk through a few different layouts, which demonstrate some of the different techniques you can use when designing with grid layout.
... a responsive layout with 1 to 3 fl
uid columns using grid-template-areas many websites are a variation of this type of layout, with content, sidebars, a header and a footer.
... i am going to create this layout using the named template areas that we learned about in the g
uide grid template areas.
...And 11 more matches
<input type="number"> - HTML: Hypertext Markup Language
they include b
uilt-in validation to reject non-numerical entries.
...the values provided are suggestions, not req
uirements: users can select from this predefined list or provide a different value.
... note: because a read-only field cannot have a value, req
uired does not have any effect on inputs with the readonly attribute also specified.
...And 11 more matches
<input type="password"> - HTML: Hypertext Markup Language
value a domstring representing a password, or empty events change and input supported common attributes autocomplete, inputmode, maxlength, minlength, pattern, placeholder, readonly, req
uired, and size idl attributes selectionstart, selectionend, selectiondirection, and value methods select(), setrangetext(), and setselectionrange() value the value attribute contains a domstring whose value is the current contents of the text editing control being used to enter the password.
...if the req
uired property is specified, then the password edit box must contain a value other than an empty string to be valid.
...it must be a valid javascript regular expression, as used by the regexp type, and as documented in our g
uide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of unicode code points, instead of as ascii.
...And 11 more matches
<input type="tel"> - HTML: Hypertext Markup Language
despite the fact that inputs of type tel are functionally identical to standard text inputs, they do serve useful purposes; the most q
uickly apparent of these is that mobile browsers — especially on mobile phones — may opt to present a custom keypad optimized for entering phone numbers.
...the values provided are suggestions, not req
uirements: users can select from this predefined list or provide a different value.
...it must be a valid javascript regular expression, as used by the regexp type, and as documented in our g
uide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of unicode code points, instead of as ascii.
...And 11 more matches
JavaScript data types and data structures - JavaScript
programming languages all have b
uilt-in data structures, but these often differ from one language to another.
... this article attempts to list the b
uilt-in data structures available in javascript and what properties they have.
... these can be used to b
uild other data structures.
...And 11 more matches
Introduction - JavaScript
what you should already know this g
uide assumes you have the following basic background: a general understanding of the internet and the world wide web (www).
... javascript g
uide (this g
uide) provides an overview about the javascript language and its objects.
... if you are new to javascript, start with the articles in the learning area and the javascript g
uide.
...And 11 more matches
Progressive web apps (PWAs)
to find out how to implement pwas, read through our pwa developer g
uide.
...this g
uide explains how a2hs is used, and what you need to do as a developer to allow your users to take advantage of it.how to make pwas installablein this article, we learned about how we can make pwas installable with a properly-configured web manifest, and how the user can then install the pwa with the "add to home screen" feature of their browser.how to make pwas re-engageable using notifications and pushhaving the ability ...
...we will start with analyzing the js13kpwa application, why it is b
uilt that way, and what benefits it brings.pwa developer g
uidein the articles listed here, you'll find g
uides about every aspect of development specific to the greation of progressive web applications (pwas).structural overview of progressive web appsin this structural overview, we'll look at the features that make up a standard web application, as well as some design patterns you can follow when bu...
...And 11 more matches
places/bookmarks - Archive of obsolete content
examples creating a new bookmark let { bookmark, save } = req
uire("sdk/places/bookmarks"); // create a new bookmark instance, unsaved let bookmark = bookmark({ title: "mozilla", url: "http://mozilla.org" }); // attempt to save the bookmark instance to the bookmarks database // and store the emitter let emitter = save(bookmark); // listen for events emitter.on("data", function (saved, inputitem) { // on a "data" event, an item has been updated, passing in...
...= inputitem.title); // true console.log(saved !== inputitem); // true console.log(inputitem === bookmark); // true }).on("end", function (saveditems, inputitems) { // similar to "data" events, except "end" is an aggregate of // all progress events, with ordered arrays as `saveditems` // and `inputitems` }); creating several bookmarks with a new group let { bookmark, group, save } = req
uire("sdk/places/bookmarks"); let group = group({ title: "g
uitars" }); let bookmarks = [ bookmark({ title: "ran", url: "http://rang
uitars.com", group: group }), bookmark({ title: "ibanez", url: "http://ibanez.com", group: group }), bookmark({ title: "esp", url: "http://espg
uitars.com", group: group }) ]; // save `bookmarks` array -- notice we don't have `group` in the array, // although it n...
... console.log(saves[0].title); // "ran" console.log(saves[2].group.title); // "g
uitars" }); searching for bookmarks bookmarks can be queried with the search() function, which accepts a query object or an array of query objects, as well as a query options object.
...And 10 more matches
Creating Reusable Modules - Archive of obsolete content
you then import and use these modules from other parts of your add-on using the req
uire() statement, in exactly that same way that you import core sdk modules like page-mod or panel.
...the documentation for that interface includes an example which we can adapt like this: var {cc, ci} = req
uire("chrome"); function promptforfile() { const nsifilepicker = ci.nsifilepicker; var fp = cc["@mozilla.org/filepicker;1"] .createinstance(nsifilepicker); var window = req
uire("sdk/window/utils").getmostrecentbrowserwindow(); fp.init(window, "select a file", nsifilepicker.modeopen); fp.appendfilters(nsifilepicker.filterall | nsifilepicker.filtertext); var rv = fp.show(); ...
... } return path; } hash function firefox has b
uilt-in support for hash functions, exposed via the nsicryptohash xpcom interface the documentation page for that interface includes an example of calculating an md5 hash of a file's contents, given its path.
...And 10 more matches
Bootstrapped extensions - Archive of obsolete content
traditional extensions include overlays, wherein the application can load up xul from the extension's package and automatically apply it on top its own
ui.
... while this makes creating extensions that add to the application's user interface relatively easy, it means that updating, installing, or disabling an extension req
uires an application restart.
... all the application does is call into this script file; the extension is responsible for adding and removing its user interface and handling any other setup and shutdown tasks it req
uires.
...And 10 more matches
Adding menus and submenus - Archive of obsolete content
if your extension req
uires custom xul windows, you may also need to have menus on those windows.
... the toolbox should be positioned near the top of the xul document, and the code should be similar to this: <toolbox> <menubar id="xulschoolhello-menubar"> <menu id="xulschoolhello-greeting-menu" label="&xulschoolhello.greeting.label;"> <menupopup> <men
uitem label="&xulschoolhello.greet.short.label;" oncommand="xulschoolchrome.greetingdialog.greetingshort(event);" /> <men
uitem label="&xulschoolhello.greet.medium.label;" oncommand="xulschoolchrome.greetingdialog.greetingmedium(event);" /> <men
uitem label="&xulschoolhello.greet.long.label;" oncommand="xulschoolchrome.greetingdialog.greetinglong(event);" ...
.../> <menuseparator /> <men
uitem label="&xulschoolhello.greet.custom.label;" oncommand="xulschoolchrome.greetingdialog.greetingcustom(event);" /> </menupopup> </menu> </menubar> </toolbox> this code displays a simple menu with options for 3 different types of greetings, a menuseparator, and finally an option to show a custom greeting.
...And 10 more matches
JavaScript Object Management - Archive of obsolete content
*/ init : function() { this.obsservice = cc["@mozilla.org/observer-service;1"].getservice(ci.nsiobserverservice); } }; 〈namespace〉.init(); }; js objects can also be treated as string-indexed arrays: // eq
uivalent.
... 〈namespace〉.hello = {}; 〈namespace〉["hello"] = {}; // eq
uivalent.
... you usually need only one js file to control a xul window, since the code req
uired is normally not that much.
...And 10 more matches
Source code directories overview - Archive of obsolete content
this document is a g
uide for developers to the directory structure of the mozilla source code tree.
...although not req
uired, these common names are typically used for a common purpose.
... b
uild contains any special makefiles for b
uilding the particular module.
...And 10 more matches
jspage - Archive of obsolete content
var mootools={version:"1.2.4",b
uild:"0d9113241a90b9cd5643b926795852a2026710d4"};var native=function(k){k=k||{};var a=k.name;var i=k.legacy;var b=k.protect; var c=k.implement;var h=k.generics;var f=k.initialize;var g=k.afterimplement||function(){};var d=f||i;h=h!==false;d.constructor=native;d.$family={name:"native"}; if(i&&f){d.prototype=i.prototype;}d.prototype.constructor=d;if(a){var e=a.tolowercase();d.prototype.$family={name:e};native.typize(d,e);}var j=function(n,l,o,m){if(!b||m||!n.prototype[l]){n.prototype[l]=o; }if(h){native.genericize(n,l,b);}g.call(n,l,o);return n;};d.alias=function(n,l,p){if(typeof n=="string"){var o=this.prototype[n];if((n=o)){return j(this,l,n,p); }}for(var m in n){this.alias(m,n[m],l);}return this;};d.implement=function(m,l,o){if(typeof m=="string"){retu...
...lhttp"); },function(){return new activexobject("microsoft.xmlhttp");});};browser.features.xhr=!!(browser.request());browser.plugins.flash=(function(){var a=($try(function(){return navigator.plugins["shockwave flash"].description; },function(){return new activexobject("shockwaveflash.shockwaveflash").getvariable("$version");})||"0 r0").match(/\d+/g);return{version:parseint(a[0]||0+"."+a[1],10)||0,b
uild:parseint(a[2],10)||0}; })();function $exec(b){if(!b){return b;}if(window.execscript){window.execscript(b);}else{var a=document.createelement("script");a.setattribute("type","text/javascript"); a[(browser.engine.webkit&&browser.engine.version<420)?"innertext":"text"]=b;document.head.appendchild(a);document.head.removechild(a);}return b;}native.
uid=1; var $
uid=(browser.engine.trident)?function(a)...
...{return(a.
uid||(a.
uid=[native.
uid++]))[0];}:function(a){return a.
uid||(a.
uid=native.
uid++);};var window=new native({name:"window",legacy:(browser.engine.trident)?null:window.window,initialize:function(a){$
uid(a); if(!a.element){a.element=$empty;if(browser.engine.webkit){a.document.createelement("iframe");}a.element.prototype=(browser.engine.webkit)?window["[[domelement.prototype]]"]:{}; }a.document.window=a;return $extend(a,window.prototype);},afterimplement:function(b,a){window[b]=window.prototype[b]=a;}});window.prototype={$family:{name:"window"}}; new window(window);var document=new native({name:"document",legacy:(browser.engine.trident)?null:window.document,initialize:function(a){$
uid(a);a.head=a.getelementsbytagname("head")[0]; a.html=a.getelementsbytagname("html")[0];if(browser.engine.
...And 10 more matches
Static Analysis for Windows Code under Linux - Archive of obsolete content
we highly recommend you to read the cross compiling manual and the dehydra b
uild manual before you start the following reading.
... b
uild gcc corss-compiler with plugin support by default gcc does not support plugins.
... dehydra req
uires patching gcc such that it can load plugins as shared libraries: # prepare a directory mkdir $home/dehydra cd $home/dehydra #obtain gcc 4.3 sources wget ftp://mirrors.kernel.org/gnu/gcc/gcc...-4.3.0.tar.bz2 tar jxvf gcc-4.3.0.tar.bz2 # get the patches which enable plugins cd gcc-4.3.0/ # create an hg repository.
...And 10 more matches
XUL controls - Archive of obsolete content
for a step-by-step g
uide on how to use these controls, see the xul tutorial.
... <button type="menu" label="view"> <menupopup> <men
uitem label="list"/> <men
uitem label="details"/> </menupopup> </button> more information about this type of menu button element.
... button reference related elements: menupopup men
uitem <button type="menu-button"> a button that that has a separate arrow button with a menu attached to it.
...And 10 more matches
The web and web standards - Learn web development
this can be considered a forerunner of the web, as it worked on packet switching, and featured the first implementation of the tcp/ip protocol s
uite.
... these two technologies form the basis of the infrastructure that the internet is b
uilt on.
... in 1980, tim berners-lee (often referred to as timbl) wrote a notebook program called enq
uire, which featured the concept of links between different nodes.
...And 10 more matches
Tips for authoring fast-loading HTML pages - Learn web development
minimize the number of files reducing the number of files referenced in a web page lowers the number of http connections req
uired to download a page, thereby reducing the time for these requests to be sent, and for their responses to be received.
... more information: http conditional get for rss hackers http 304: not modified http etag on wikipedia caching in http optimally order the components of the page download page content first, along with any css or javascript that may be req
uired for its initial display, so that the user gets the q
uickest apparent response during the page loading.
... this content is typically text, and can, therefore, benefit from text compression in transit, thus providing an even q
uicker response to the user.
...And 10 more matches
Introduction to events - Learn web development
previous overview: b
uilding blocks next events are actions or occurrences that happen in the system you are programming, which the system tells you about so you can respond to them in some way if desired.
... prereq
uisites: basic computer literacy, a basic understanding of html and css, javascript first steps.
... note: web events are not part of the core javascript language — they are defined as part of the apis b
uilt into the browser.
...And 10 more matches
Introduction to web APIs - Learn web development
prereq
uisites: basic computer literacy, a basic understanding of html and css, javascript basics (see first steps, b
uilding blocks, javascript objects).
... apis in client-side javascript client-side javascript, in particular, has many apis available to it — these are not part of the javascript language itself, rather they are b
uilt on top of the core javascript language, providing you with extra superpowers to use in your javascript code.
... they generally fall into two categories: browser apis are b
uilt into your web browser and are able to expose data from the browser and surrounding computer environment and do useful complex things with it.
...And 10 more matches
Inheritance in JavaScript - Learn web development
prereq
uisites: basic computer literacy, a basic understanding of html and css, familiarity with javascript basics (see first steps and b
uilding blocks) and oojs basics (see introduction to objects).
...but mostly this has involved b
uilt-in browser functions.
... an updated greeting() method, which sounds a bit more formal than the standard greeting() method — more s
uitable for a teacher addressing some students at school.
...And 10 more matches
IPDL Tutorial
generated c++ code when pplugin.ipdl is compiled, the headers ppluginparent.h, and ppluginchild.h will be generated in the ipc/ipdl/_ipdlheaders/ directory of the b
uild tree.
...ipdl supports b
uilt-in and custom primitive types, as well as unions and arrays.
... the b
uilt-in simple types include the c++ integer types (bool, char, int, double) and xpcom string types (nsstring, nscstring).
...And 10 more matches
Mozilla Web Developer FAQ
what are the q
uirks mode and the standards mode?
... gecko has two and a half layout modes: q
uirks, almost standards and standards.
...in the q
uirks mode—for the purpose of backwards compatibility—gecko mimics some behaviors of legacy browsers in ways that are spec violations.
...And 10 more matches
NSS 3.12.6 release notes
nss 3.12.6 req
uires nspr 4.8.4.
... see the documentation section for the b
uild instructions.
... you also need to download the nspr 4.8.4 binary distributions to get the nspr 4.8.4 header files and shared libraries, which nss 3.12.6 req
uires.
...And 10 more matches
gtstd.html
this page is part of the ssl reference that we are migrating into the format described in the mdn style g
uide.
... ssl, pkcs #11, and the default security databases setting up the certificate and key databases b
uilding nss programs ssl, pkcs #11, and the default security databases the basic relationships among the nss libraries are described in introduction to network security services.
...netscape provides a b
uilt-in pkcs #11 module with nss.
...And 10 more matches
Parser API
recent b
uilds of the standalone spidermonkey shell include a reflection of the spidermonkey parser, made available as a javascript api.
...type:"identifier", name:"foo"}) > expr.right ({loc:{source:null, start:{line:1, column:10}, end:{line:1, column:12}}, type:"literal", value:42}) it is also available since firefox 7; it can be imported into the global object via: components.utils.import("resource://gre/modules/reflect.jsm") or into a specified object via: components.utils.import("resource://gre/modules/reflect.jsm", obj) b
uilt-in objects whether in spidermonkey shell or firefox (after importing), the global singleton object reflect currently contains just the parse method.
... b
uilder b
uilder default: null a b
uilder object, which can be used to produce ast nodes in custom data formats.
...And 10 more matches
WebReplayRoadmap
this document describes existing, planned, and potential features for the firefox developer tools that are based on web replay, along with their
ui.
... seeing messages in the console provides a simple and int
uitive view into the order in which events have happened.
... without time travel, using the console req
uires repeatedly updating the source or the debugger's log points, reloading, and reproducing the bug.
...And 10 more matches
An Overview of XPCOM
this chapter provides a q
uick tour of xpcom - an introduction to the basic concepts and technologies in xpcom and component development.
... the goal of xpcom is to allow different pieces of software to be developed and b
uilt independently of one another.
... every interface is assigned an identifier that gets generated from a tool commonly named "u
uidgen".
...And 10 more matches
Component Internals
a component in the xpcom framework when you b
uild a component or module and compile it into a library, it must export a single method named nsgetmodule.
...another, more explicit way to register your component is to run the application regxpcom, which is b
uilt as part of mozilla and is also available in the gecko sdk.
...component discovery does not currently happen automatically in non-debug b
uilds of gecko, however.
...And 10 more matches
Finishing the Component
you b
uild your component using this interface, and it works great with the version of gecko that you have tested against.
... however, some point in the future, the nsifoo interface req
uires a major change, and methods are reordered, some are added, others are removed.
... copying interfaces into your b
uild environment to get and implement interfaces that are not part of gecko in your component, simply create a new directory in the gecko sdk named unfrozen.
...And 10 more matches
nsAString_internal
parameters nssubstringtuple& tuple void nsastring_internal(prunichar*, pr
uint32, pr
uint32) - source parameters prunichar* data pr
uint32 length pr
uint32 flags beginreading prunichar* beginreading() const - source reading iterators nsreadingiterator<short unsigned int>& beginreading(nsreadingiterator<short unsigned int>&) const - source deprecated reading iterators parameters nsreadingiterator<short unsigned int>& iter prunichar*& beginreading(const pru...
...source parameters prunichar*& iter endwriting prunichar* endwriting() - source nswritingiterator<short unsigned int>& endwriting(nswritingiterator<short unsigned int>&) - source parameters nswritingiterator<short unsigned int>& iter prunichar*& endwriting(prunichar*&) - source parameters prunichar*& iter data prunichar* data() const - source accessors length pr
uint32 length() const - source isempty prbool isempty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat prunichar charat(pr
uint32) const - source parameters pr
uint32 i operator[] prunichar operator[](pr
uint32) const - source parameters pr
uint32 i first prunichar first() const - source l...
...ast prunichar last() const - source countchar pr
uint32 countchar(prunichar) const - source parameters prunichar <anonymous> findchar print32 findchar(prunichar, pr
uint32) const - source parameters prunichar <anonymous> pr
uint32 offset equals prbool equals(const nsastring_internal&) const - source equality parameters nsastring_internal& <anonymous> prbool equals(const nsastring_internal&, const nsstringcomparator&) const - source parameters nsastring_internal& <anonymous> nsstringcomparator& <anonymous> prbool equals(const prunichar*) const - source parameters prunichar* data prbool equals(const prunichar*, const nsstringcomparator&) const - source parameters prunichar* data nsstringcomparator& comp equalsascii prbool equalsascii(const ...
...And 10 more matches
nsDependentCSubstring
methods constructors void nsdependentcsubstring(const nsacstring_internal&, pr
uint32, pr
uint32) - source parameters nsacstring_internal& str pr
uint32 startpos pr
uint32 length void nsdependentcsubstring(const char*, const char*) - source parameters char* start char* end void nsdependentcsubstring(const nsreadingiterator<char>&, const nsreadingiterator<char>&) - source parameters nsreadingiterator<char>& start nsreadingiterator<char>& end void nsdependentcsubs...
...tring() - source rebind void rebind(const nsacstring_internal&, pr
uint32, pr
uint32) - source parameters nsacstring_internal& <anonymous> pr
uint32 startpos pr
uint32 length void rebind(const char*, const char*) - source parameters char* start char* end beginreading char* beginreading() const - source reading iterators nsreadingiterator<char>& beginreading(nsreadingiterator<char>&) const - source deprecated reading iterators parameters nsreadingiterator<char>& iter char*& beginreading(const char*&) const - source parameters char*& iter endreading char* endreading() const - source nsreadingiterator<char>& endreading(nsreadingiterator<char>&) const - source parameters nsreadingiterator<char>& iter char*& endreading(const char*&) const - source ...
...ameters nswritingiterator<char>& iter char*& beginwriting(char*&) - source parameters char*& iter endwriting char* endwriting() - source nswritingiterator<char>& endwriting(nswritingiterator<char>&) - source parameters nswritingiterator<char>& iter char*& endwriting(char*&) - source parameters char*& iter data char* data() const - source accessors length pr
uint32 length() const - source isempty prbool isempty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat char charat(pr
uint32) const - source parameters pr
uint32 i operator[] char operator[](pr
uint32) const - source parameters pr
uint32 i first char first() const - source last char last...
...And 10 more matches
nsPromiseFlatCString
@param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pr
uint32) const - source parameters print32* aerrorcode pr
uint32 aradix mid pr
uint32 mid(nscstring&, pr
uint32, pr
uint32) const - source parameters nscstring& aresult pr
uint32 astartpos pr
uint32 acount left pr
uint32 left(nscstring&, pr
uint32) const - source parameters nscstring& aresult pr
uint32 acount right pr
uint32 right(nscstring&, pr
uint32) const - source parameters ...
... nscstring& aresult pr
uint32 acount setcharat prbool setcharat(prunichar, pr
uint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pr
uint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
...ndwithconversion void appendwithconversion(const nsastring_internal&) - source parameters nsastring_internal& astring void appendwithconversion(const prunichar*, print32) - source parameters prunichar* adata print32 alength appendint void appendint(print32, print32) - source append the given integer to this string parameters print32 ainteger print32 aradix void appendint(pr
uint32, print32) - source append the given unsigned integer to this string parameters pr
uint32 ainteger print32 aradix void appendint(print64, print32) - source parameters print64 ainteger print32 aradix appendfloat void appendfloat(float) - source append the given float to this string parameters float afloat void appendfloat(double) - source parameters double afloat be...
...And 10 more matches
mozIRegistry
it happens that this objective req
uires storing information about which implementation to use in a place distinct from your source code.
...clients req
uiring dynamic "binding" of clsids will be req
uired to use some higher-level services (tbd) to figure out the clsids they should use.
... the intent is that such services themselves be b
uilt on top of the new moziregistry interface.
...And 10 more matches
nsIMsgDBHdr
method overview astring getproperty(in string propertyname); void setproperty(in string propertyname, in astring propertystr); void setstringproperty(in string propertyname, in string propertyvalue); string getstringproperty(in string propertyname); unsigned long get
uint32property(in string propertyname); void set
uint32property(in string propertyname, in unsigned long propertyval); void markread(in boolean read); void markflagged(in boolean flagged); void markhasattachments(in boolean hasattachments); void setprioritystring(in string priority); unsigned long orflags(in unsigned long flags); unsigned...
... isflagged boolean readonly: indicates whether or not the message is starred in the
ui.
... iskilled boolean readonly: indicates whether or not this message belongs to a subthread that has been ignored in the
ui.
...And 10 more matches
nsIPermissionManager
last changed in gecko 16 (firefox 16 / thunderbird 16 / seamonkey 2.13) inherits from: nsisupports method overview void add(in nsiuri uri, in string type, in pr
uint32 permission, [optional] in pr
uint32 expiretype, [optional] in print64 expiretime); void addfromprincipal(in nsiprincipal principal, in string type, in pr
uint32 permission, [optional] in pr
uint32 expiretype, [optional] in print64 expiretime); void remove(in autf8string host, in string type); void removefromprincipal(in nsiprincipal principal, in string type); ...
... void removepermission(in nsipermission perm); void removeallsince(in int64_t since); void removeall(); pr
uint32 testexactpermission(in nsiuri uri, in string type); pr
uint32 testexactpermissionfromprincipal(in nsiprincipal principal, in string type); pr
uint32 testpermission(in nsiuri uri, in string type); pr
uint32 testpermissionfromprincipal(in nsiprincipal principal, in string type); attributes attribute type description enumerator nsisimpleenumerator enumerates all stored permissions.
... void add( in nsiuri uri, in string type, in pr
uint32 permission, [optional] in pr
uint32 expiretype, [optional] in print64 expiretime ); parameters uri the uri to add the permission for.
...And 10 more matches
Working with data
q
uirks in equality equality doesn't work the same way in javascript as it does in c, which means certain operations might not work the way you expect.
...if you need to convert a string that doesn't meet these req
uirements, you'll need to do it yourself.
...a q
uicker way to make a non-null terminated string is force a length on the ctypes array like this: var cstr_notnullterminated = ctypes.jschar.array(4)('rawr'); // notice the `4` we pass here console.log(cstr_notnullterminated); // outputs to browser console: `cdata { length: 4 }` console.log(cstr_notnullterminated.tostring()); // outputs to browser console: `"ctypes.char16_t.array(5)(["r", "a", "w", ...
...And 10 more matches
MediaDevices.getUserMedia() - Web APIs
note: it's possible for the returned promise to neither resolve nor reject, as the user is not req
uired to make a choice at all and may simply ignore the request.
... syntax var promise = navigator.mediadevices.getusermedia(constraints); parameters constraints a mediastreamconstraints object specifying the types of media to request, along with any req
uirements for each type.
... the following requests both audio and video without any specific req
uirements: { audio: true, video: true } if true is specified for a media type, the resulting stream is req
uired to have that type of track in it.
...And 10 more matches
WebRTC API - Web APIs
webrtc (web real-time communication) is a technology which enables web applications and sites to capture and optionally stream audio and/or video media, as well as to exchange arbitrary data between browsers without req
uiring an intermediary.
... the set of standards that comprise webrtc makes it possible to share data and perform teleconferencing peer-to-peer, without req
uiring that the user installs plug-ins or any other third-party software.
...connections between peers can be made without req
uiring any special drivers or plug-ins, and can often be made without any intermediary servers.
...And 10 more matches
WebXR Device API - Web APIs
the eq
uipment may also include an accelerometer, barometer, or other sensors which are used to sense when the user moves through space, rotates their head, or the like.
... g
uides and tutorials the following g
uides and tutorials are a great resource to learn how to comprehend webxr and the underlying 3d and vr/ar graphics concepts.
... matrix math for the web a g
uide covering how matrices can be used on the web, including both for css transforms and for webgl purposes, as well as to handle the positioning and orientation of objects in webxr contexts.
...And 10 more matches
filter - CSS: Cascading Style Sheets
if they have different lengths, the missing eq
uivalent filter functions from the longer list are added to the end of the shorter list using their lacuna values, then all filter functions are interpolated according to their specific rules.
... filter: blur(5px) <table class="standard-table"> <thead> <tr> <th style="text-align: left;" scope="col">original image</th> <th style="text-align: left;" scope="col">live example</th> <th style="text-align: left;" scope="col">svg eq
uivalent</th> <th style="text-align: left;" scope="col">static example</th> </tr> </thead> <tbody> <tr> <td><img alt="test_form.jpg" id="img1" class="internal default" src="/files/3710/test_form_2.jpg" style="width: 100%;" /></td> <td><img alt="test_form.jpg" id="img2" class="internal default" src="/files/3710/test_form_2.jpg" style="width: 100%;" /></td> <td> ...
...lope="[amount]"/> <fefuncg type="linear" slope="[amount]"/> <fefuncb type="linear" slope="[amount]"/> </fecomponenttransfer> </filter> </svg> <table class="standard-table"> <thead> <tr> <th style="text-align: left;" scope="col">original image</th> <th style="text-align: left;" scope="col">live example</th> <th style="text-align: left;" scope="col">svg eq
uivalent</th> <th style="text-align: left;" scope="col">static example</th> </tr> </thead> <tbody> <tr> <td><img alt="test_form.jpg" id="img1" class="internal default" src="/files/3708/test_form.jpg" style="width: 100%;" /></td> <td><img alt="test_form.jpg" id="img2" class="internal default" src="/files/3708/test_form.jpg" style="width: 100%;" /></td> <td><div cla...
...And 10 more matches
Regular expression syntax cheatsheet - JavaScript
this page provides an overall cheat sheet of all the capabilities of regexp syntax by aggregating the content of the articles in the regexp g
uide.
... if you need more information on a specific topic, please follow the link on the corresponding heading to access the full article or head to the g
uide.
...eq
uivalent to [0-9].
...And 10 more matches
Web Performance
are pop-ups q
uick to load and display, and do they animate smoothly as they do so?
...we cover them in this section: key performance g
uides animation performance and frame rateanimation on the web can be done via svg, javascript, including <canvas> and webgl, css animation, <video>, animated gifs and even animated pngs and other image types.
...resource timings are detailed network timing measurements regarding the loading of an application's resources.optimizing startup performanceregardless of platform, it's always a good idea to start up as q
uickly as possible.
...And 10 more matches
passwords - Archive of obsolete content
realm you can use this as a name for the credential, to disting
uish it from any other credentials you've stored.
... url the url for the web service which req
uires the credential.
... url the url for the web service which req
uires the credential.
...And 9 more matches
lang/functional - Archive of obsolete content
let { method } = req
uire("sdk/lang/functional"); let mynumber = { times: method(times), add: method(add), number: 0 }; function times (target, x) { return target.number *= x; } function add (target, x) { return target.number += x; } console.log(mynumber.number); // 0 mynumber.add(10); // 10 mynumber.times(2); // 20 mynumber.add(3); // 23 parameters lambda : function the function to be wrapped and returne...
... let { defer } = req
uire("sdk/lang/functional"); let fn = defer(function myevent (event, value) { console.log(event + " : " + value); }); fn("click", "#home"); console.log("done"); // this will print 'done' before 'click : #home' since // we deferred the execution of the wrapped `myevent` // function, making it non-blocking and executing on the // next event loop parameters fn : function the function to be defer...
... let { invoke } = req
uire("sdk/lang/functional"); invoke(sum, [1,2,3,4,5], null); // 15 function sum () { return array.slice(arguments).reduce(function (a, b) { return a + b; }); } parameters callee : function function to invoke.
...And 9 more matches
Low-Level APIs - Archive of obsolete content
b
uilding blocks for higher level modules, such as events and worker.
... you're more likely to use these if you are b
uilding your own modules that implement new apis, thus extending the sdk itself.
... content/loader provides one of the b
uilding blocks for those modules that use content scripts to interact with web content, such as panel and page-mod.
...And 9 more matches
Appendix: What you should know about open-source software licenses - Archive of obsolete content
in countries that are signatories to the berne convention (which is most countries, including japan, china, india, australia, the americas, and all of europe) this right is automatic, and req
uires no declaration or registration.
...this is what we might call the reader’s use of the work, and it req
uires no permission from the author.
... these conditions will vary from one license to the next, but the open source definition stipulates the following minimum conditions: the integrity of the author’s source code must be preserved; no discrimination may be made against individuals or organizations; no discrimination may be made based on field of endeavor; no additional licensing can be req
uired when redistributing; license must not be specific to a product; license must not interfere with other software.
...And 9 more matches
The Essentials of an Extension - Archive of obsolete content
firefox needs this to disting
uish your extension from other extensions, so it is req
uired that you have an id that is unique.
...the other standard practice is to use a generated u
uid string, which is extremely unlikely to be duplicated.
... unix-based systems have a command line tool called u
uidgen that generates u
uids.
...And 9 more matches
What to do and what not to do in Bugzilla
it lists the req
uirements and the email to contact.
...the same is true for editbugs: leave comments with the information you'd like to be able to edit into the bug, and that will help you get the editbugs permissions q
uickly.
...it also governs which bug entry form you are presented with first (either the g
uided or advanced forms).
...And 9 more matches
Gecko SDK
therefore it makes no sense to use a particular product to b
uild general functionality.
... get the sdk updates there is no need to download or reb
uild the gecko sdk corresponding to security updates of mozilla (e.g., mozilla 1.7.3) since the headers and glue libs in the gecko sdk are usually not changed as a result of security updates.
... once the sdk enters beta, it is s
uitable for b
uilding extensions; your component should work with release b
uilds of the sdk without any modifications.
...And 9 more matches
PKCS11 FAQ
nss req
uires at least pkcs #11 version 2.0, but can support some features of later versions of nss, including nss 2.20.
...multipart functions, such as bulk encryption, hashing, and mac functions (for example, c_digest and c_sign) and those that req
uire overlapped operation (c_unwrap, c_decrypt) are handled by creating new sessions.
...other certificates on the token are also loaded (to allow b
uilding certificate chains), but it's not necessary to include the full chain, as long as the full chain is available in the regular certificate database.
...And 9 more matches
SpiderMonkey 1.8.5
the old b
uild system (using makefile.ref) is no longer supported.
... spidermonkey 1.8.5 includes a new configure-based b
uild system, introduced shortly after active development on the engine moved from cvs to mercurial.
...instead use double_to_jsval, int_to_jsval, and
uint_to_jsval, which are faster and can't fail.
...And 9 more matches
nsACString_internal
parameters nscsubstringtuple& tuple void nsacstring_internal(char*, pr
uint32, pr
uint32) - source parameters char* data pr
uint32 length pr
uint32 flags beginreading char* beginreading() const - source reading iterators nsreadingiterator<char>& beginreading(nsreadingiterator<char>&) const - source deprecated reading iterators parameters nsreadingiterator<char>& iter char*& beginreading(const char*&) const - source parameters char*& iter endrea...
...ameters nswritingiterator<char>& iter char*& beginwriting(char*&) - source parameters char*& iter endwriting char* endwriting() - source nswritingiterator<char>& endwriting(nswritingiterator<char>&) - source parameters nswritingiterator<char>& iter char*& endwriting(char*&) - source parameters char*& iter data char* data() const - source accessors length pr
uint32 length() const - source isempty prbool isempty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat char charat(pr
uint32) const - source parameters pr
uint32 i operator[] char operator[](pr
uint32) const - source parameters pr
uint32 i first char first() const - source last char last...
...() const - source countchar pr
uint32 countchar(char) const - source parameters char <anonymous> findchar print32 findchar(char, pr
uint32) const - source parameters char <anonymous> pr
uint32 offset equals prbool equals(const nsacstring_internal&) const - source equality parameters nsacstring_internal& <anonymous> prbool equals(const nsacstring_internal&, const nscstringcomparator&) const - source parameters nsacstring_internal& <anonymous> nscstringcomparator& <anonymous> prbool equals(const char*) const - source parameters char* data prbool equals(const char*, const nscstringcomparator&) const - source parameters char* data nscstringcomparator& comp equalsascii prbool equalsascii(const char*, pr
uint32) const - source an efficient compa...
...And 9 more matches
nsINavHistoryObserver
method overview void onbeforedeleteuri(in nsiuri auri, in acstring ag
uid); obsolete since gecko 21.0 void onbeginupdatebatch(); void onclearhistory(); void ondeleteuri(in nsiuri auri, in acstring ag
uid); void ondeletevisits(in nsiuri auri, in prtime avisittime, in acstring ag
uid); void onendupdatebatch(); void onpagechanged(in nsiuri auri, in unsigned long awhat, in astring avalue); void onpageexpired(i...
...n nsiuri auri, in prtime avisittime, in boolean awholeentry); obsolete since gecko 2.0 void ontitlechanged(in nsiuri auri, in astring apagetitle); void onvisit(in nsiuri auri, in long long avisitid, in prtime atime, in long long asessionid, in long long areferringid, in unsigned long atransitiontype, in acstring ag
uid, out unsigned long aadded); constants constant value description attribute_favicon 3 the page's favicon changed.
...delete notifications aren't q
uite 100% accurate.
...And 9 more matches
Plug-in Development Overview - Plugins
b
uild the plug-in for your operating system.
... see "b
uilding plug-ins".
...rce of the plug-in dll should contain the following set of string/value pairs: mimetype: for mime types fileextents: for file extensions fileopenname: for file open template productname: for plug-in name filedescription: for description language: for language in use in the mime types and file extensions strings, multiple values are separated by the "|" character, for example: video/q
uicktime|audio/aiff|image/jpeg the version stamp will be loaded only if it has been created with the language set to "us english" and the character set to "windows multilingual" in your development environment.
...And 9 more matches
Using IndexedDB - Web APIs
in it, you can create and delete object stores and b
uild and remove indices.
...the complete event may thus be delivered q
uicker than before, however, there exists a small chance that the entire transaction will be lost if the os crashes or there is a loss of system power before the data is flushed to disk.
...note that the add() function req
uires that no object already be in the database with the same key.
...And 9 more matches
WebGL best practices - Web APIs
you can rely on this document to g
uide your choice of approach, and ensure you're on the right track no matter what browser or hardware your users run.
... take advantage of universally supported webgl 1 extensions these webgl 1 extensions are universally supported: angle_instanced_arrays ext_blend_minmax oes_element_index_
uint oes_standard_derivatives oes_vertex_array_object webgl_debug_renderer_info webgl_lose_context (see also: https://jdashg.github.io/misc/webgl/webgl-feature-levels.html) consider polyfilling these into webglrenderingcontext, like: https://github.com/jdashg/misc/blob/master/webgl/webgl-v1.1.js universally supported limits the minimum req
uirements for webgl are q
uite low.
...this req
uires estimating the number of bytes consumed by each texture, for example.
...And 9 more matches
Geometry and reference spaces in WebXR - Web APIs
however, in order to provide the ability to present scenes in true 3d using xr headsets and other such eq
uipment, webxr has additional concepts that must be understood.
... the article spatial tracking in webxr b
uilds upon the information provided here to cover how the physical position and orientation of the user's head, as well as potentially other parts of their body such as the hands, are mapped into the digital world, as well as how the relative positions of both physical and virtual objects are tracked as they move around, so that the scene can be properly rendered and composited.
... fundamentals of 3d geometry while we'll examine here the req
uired math operations used to compute the positions, orientations, and movement of objects in virtual space—plus the need to integrate the human viewer of the scene into the mix—a thorough introduction to geometry and the use of matrices and vectors to manage 3d representations of a scene is well beyond the scope of what can be accomplished in this article.
...And 9 more matches
ARIA annotations - Accessibility
these are semantically eq
uivalent to the html <ins> and <del> elements.
...this is semantically eq
uivalent to the html <mark> element.
... aria annotation roles and objects are currently exposed in: firefox from version 75 onwards, on windows and linux (on macos, we are first waiting for apple to define what safari will expose as apple-dialect attributes to voiceover, and will then follow s
uit.) chrome from version 81 onwards, currently behind the #enable-accessibility-expose-aria-annotations flag (go to chrome://flags to enable this.) unfortunately, you won’t be able to use any of these yet, as screenreader support is currently not there.
...And 9 more matches
An overview of accessible web applications and widgets - Accessibility
sliders, menu bars, file list views, and more can be b
uilt with a combination of javascript, css, and html.
... since the html4 specification doesn't provide b
uilt-in tags that semantically describe these kinds of widgets, developers typically resort to using generic elements such as <div> and <span>.
... example 1: markup for a tabs widget b
uilt without aria labeling.
...And 9 more matches
font-family - CSS: Cascading Style Sheets
syntax /* a font family name and a generic family name */ font-family: gill sans extrabold, sans-serif; font-family: "goudy bookletter 1911", sans-serif; /* a generic family name only */ font-family: serif; font-family: sans-serif; font-family: monospace; font-family: cursive; font-family: fantasy; font-family: system-
ui; font-family:
ui-serif; font-family:
ui-sans-serif; font-family:
ui-monospace; font-family:
ui-rounded; font-family: emoji; font-family: math; font-family: fangsong; /* global values */ font-family: inherit; font-family: initial; font-family: unset; the font-family property lists one or more font families, separated by commas.
... system-
ui glyphs are taken from the default user interface font on a given platform.
...this is example system-
ui text.
...And 9 more matches
<input type="search"> - HTML: Hypertext Markup Language
events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, req
uired, size.
...the values provided are suggestions, not req
uirements: users can select from this predefined list or provide a different value.
...it must be a valid javascript regular expression, as used by the regexp type, and as documented in our g
uide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of unicode code points, instead of as ascii.
...And 9 more matches
<input type="text"> - HTML: Hypertext Markup Language
events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, req
uired and size idl attributes list, value methods select(), setrangetext() and setselectionrange().
...the values provided are suggestions, not req
uirements: users can select from this predefined list or provide a different value.
...it must be a valid javascript regular expression, as used by the regexp type, and as documented in our g
uide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of unicode code points, instead of as ascii.
...And 9 more matches
Evolution of HTTP - HTTP
invention of the world wide web in 1989, while he was working at cern, tim berners-lee wrote a proposal to b
uild a hypertext system over the internet.
...b
uilt over the existing tcp and ip protocols, it consisted of 4 b
uilding blocks: a textual format to represent hypertext documents, the hypertext markup language (html).
... these four b
uilding blocks were completed by the end of 1990, and the first servers were already running outside of cern by early 1991.
...And 9 more matches
DataView - JavaScript
as a workaround, you could implement your own get
uint64() function to obtain a value with precision up to number.max_safe_integer, which could suffice for certain cases.
... function get
uint64(dataview, byteoffset, littleendian) { // split 64-bit number into two 32-bit (4-byte) parts const left = dataview.get
uint32(byteoffset, littleendian); const right = dataview.get
uint32(byteoffset+4, littleendian); // combine the two 32-bit values const combined = littleendian?
...further, although native bigints are much faster than user-land library eq
uivalents, bigints will always be much slower than 32-bit integers in javascript due to the nature of their variable size.
...And 9 more matches
Tutorials
creating a simple web page with html an html g
uide for beginners that includes explanations of common tags, including html5 tags.
... also includes a step-by-step g
uide to creating a basic web page with code examples.
... css b
uilding blocks this module carries on where css first steps left off — now you've gained familiarity with the language and its syntax, and got some basic experience with using it, its time to dive a bit deeper.
...And 9 more matches
core/promise - Archive of obsolete content
ntinuation passing style, involving lots of machinery: function sphagetti(a, b, callback) { assemble(a, function continuewith(error, c) { if (error) callback(error); else combine(b, c, callback); }); } this style also makes doing things in sequence hard: widget.on('click', function onclick() { promptuserfortwitterhandle(function continuewith(error, handle) { if (error) return
ui.displayerror(error); twitter.gettweetsfor(handle, funtion continuewith(error, tweets) { if (error) return
ui.displayerror(error);
ui.showtweets(tweets); }); }); }); doing things in parallel is even harder: var tweets, answers, checkins; twitter.gettweetsfor(user, function continuewith(result) { tweets = result; somethingfinished(); }); stackoverflow.getanswersfor(ques...
...tion, function continuewith(result) { answers = result; somethingfinished(); }); foursquare.getcheckinsby(user, function continuewith(result) { checkins=result; somethingfinished(); }); var finished = 0; function somethingfinished() { if (++finished === 3)
ui.show(tweets, answers, checkins); } this also makes error handling q
uite an adventure.
... return readdbasync(extractquery(json)).then(function(data) { return writeasync(json.url, data); }); }); in general, nesting is useful for computing values from more than one promise: function eventualadd(a, b) { return a.then(function (a) { return b.then(function (b) { return a + b; }); }); } var c = eventualadd(aasync(), basync()); error handling one sometimes-unint
uitive aspect of promises is that if you throw an exception in the value handler, it will not be be caught by the error handler.
...And 8 more matches
platform/xpcom - Archive of obsolete content
you can just use req
uire("chrome") to get direct access to the components object, and access xpcom objects from there.
... for example, the add-on below implements the nsiobserver interface to listen for and log all topic notifications: var { class } = req
uire('sdk/core/heritage'); var { unknown } = req
uire('sdk/platform/xpcom'); var { cc, ci } = req
uire('chrome') var observerservice = cc['@mozilla.org/observer-service;1'].
... in this example the helloworld component is available to javascript only, so we use the technique documented under the "using wrappedjsobject" section of how to b
uild an xpcom component in javascript.
...And 8 more matches
cfx to jpm - Archive of obsolete content
a g
uide to working with jpm if you're already familiar with cfx.
...in a b
uilt xpi, it's the id field in the add-on's install manifest (install.rdf) file.
...for example: addons.mozilla.org uses it to disting
uish between new add-ons and updates to existing add-ons, and the simple-storage module uses it to figure out which stored data belongs to which add-on.
...And 8 more matches
package.json - Archive of obsolete content
the package.json file contains manifest data for your add-on, providing not only descriptive information about the add-on for presentation in the add-ons manager, but other metadata req
uired of add-ons.
... some of its entries, such as icon, name, and description, have direct analogues in the install manifest format, and entries from package.json are written into the install manifest when the add-on is b
uilt using jpm xpi.
...it looks like this (assuming the add-on's directory is "my-addon"): { "name": "my-addon", "title": "my-addon", "id": "jid1-1fergv45e4f4f@jetpack", "description": "a basic add-on", "author": "", "license": "mpl-2.0", "version": "0.1" } if you are using the new jpm tool, you can easily access manifest data from package.json by req
uiring it like any other module: var title = req
uire("./package.json").title; key reference package.json may contain the following keys: author the name of the package's original author; this could be the name of a person or a company.
...And 8 more matches
Updating addons broken by private browsing changes - Archive of obsolete content
able ff 18: imgicache moziasyncfavicons nsifaviconservice nsiwebbrowserpersist ff 19: nsicontentprefservice nsidownloadmanager nsidownload nsihttpauthmanager nsistricttransportsecurityservice ff 20: nsiprivatebrowsingservice nsirecentbadcertservice furthermore, if your code uses any of these common chrome apis: ff 19: saveurl saveinternal openlinkin ff 20: openbrowserwindow gprivatebrowsing
ui finally, if your code watches for any of these observer notifications: private-browsing private-browsing-cancel-vote private-browsing-change-granted private-browsing-transition-complete then your addon will req
uire updating to correctly support the new per-window private browser feature in firefox 20 (and will req
uire updating to work correctly in releases of firefox since the ones liste...
... moziasyncfavicons/nsifaviconservice: setandfetchfaviconforpage/setandloadfaviconforpage now take a req
uired privacy status argument, either nsifaviconservice.favicon_load_private or nsifaviconservice.favicon_load_non_private.
... nsicontentprefservice: getpref, setpref, haspref, hascachedpref, removepref, removegroupedprefs, removeprefsbyname, getprefs, and getprefsbyname all take a req
uired nsiloadcontext argument to indicate the privacy status of the pref in question.
...And 8 more matches
Creating a Firefox sidebar extension - Archive of obsolete content
introduction this article is a q
uick start for the creation of a new sidebar for firefox.
... creating a sidebar req
uires some g
ui creation and registration in the destination application.
... pre-req
uisites this article is a q
uick start, it won't explain all elements of xul, packaging and xpi's.
...And 8 more matches
Installing Dehydra - Archive of obsolete content
prereq
uisites mercurial 1.0 is needed to access source repositories.
...(alternately, b
uild from source) a modern linux distribution.
... b
uilding spidermonkey it is recommended that you use spidermonkey revision aurora_base_20110705 when b
uilding dehydra.
...And 8 more matches
Layout System Overview - Archive of obsolete content
this presentation is typically formatted in accordance with the req
uirements of the css1 and css2 specifications from the w3c.
... presentation formatting is also req
uired to provide compatibility with legacy browsers (microsoft internet explorer and netscape navigator 4.x).
...these layout modes are referred to as 'standards' and 'navq
uirks' modes.
...And 8 more matches
Elements - Archive of obsolete content
xmlns:html = "http://www.w3.org/1999/xhtml" xmlns:xul = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:svg = "http://www.w3.org/2000/svg" xmlns:xlink= "http://www.w3.org/1999/xlink"> binding <!entity % binding-content "(resources?,content?,implementation?,handlers?)"> <!element binding %binding-content;> <!attlist binding id id #req
uired extends cdata #implied display cdata #implied inheritstyle true #implied > the binding element describes a single xbl binding.
...keep in mind that the binding is still req
uired to have an id even though you're not referencing it.
...for the binding element, this attribute is req
uired, since it is used to attach bindings.
...And 8 more matches
Creating XPI Installer Modules - Archive of obsolete content
introduction this article is rather old and only applies to mozilla s
uite and seamonkey (until it gets converted to toolkit).
... mozilla has introduced major changes to the way that themes and all the other parts of the
ui are packaged.
...a xpi file typically contains the resources to be installed (in this case the barley.jar we want to have installed in the mozilla/bin/chrome/ directory) and an install script that g
uides the installation process.
...And 8 more matches
Introduction - Archive of obsolete content
next » this tutorial is a g
uide to learning xul (xml user interface language) which is a cross-platform language for describing applications' user interfaces.
... most applications need to be developed using features of a specific platform making b
uilding cross-platform software time-consuming and costly.
...xul is one such language designed specifically for b
uilding portable user interfaces.
...And 8 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
in recent developments we also see the advent of other performant engines for javascript such as v8 from google and sq
uirrelfish for webkit, these engines are raising the bar on performance and help to maintain a competitive environment that will hopefully direct competitive focus on the performance aspect of all the major javascript implementations.
...in addition, the jaxer “ajax server” (a project i work on at aptana) is an example of ssjs that uses not only spidermonkey, but also embeds the entire firefox browser engine in the application server such that you can do server-side dom manipulation and other ajaxy things server-side that rhino was not b
uilt to do.
... the act of creating an e4x object is q
uite simple, in the case of listing 3, we do this through the line var x = new xml( str ); from here, the xml is accessible via dot notation.
...And 8 more matches
XForms Custom Controls - Archive of obsolete content
this is req
uired for all examples here to run!
...xf|output[mediatype^="image"] { -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-output-mediatype-anyuri'); } custom data types if you define a new schema data type or you use a b
uilt-in data type and find the current xforms control for this type to be insufficient, then you should write a new custom control.
...nsixforms
uiwidget every custom control should implement the nsixforms
uiwidget interface.
...And 8 more matches
Efficient animation for web games - Game development
it is worth documenting some of these things, as there is evidence to suggest (in popular and widely-used
ui libraries, for example) that they aren’t necessarily common knowledge.
... help the browser help you if you are using dom for your
ui, which i would certainly recommend, you really ought to use css transitions and/or css animations, rather than javascript-powered animations.
... though javascript animations can be easier to express at times, unless you have a great need to synchronise
ui animation state with game animation state, you’re unlikely to be able to do a better job than the browser.
...And 8 more matches
Other form controls - Learn web development
prereq
uisites: basic computer literacy, and a basic understanding of html.
... <select id="simple" name="simple"> <option>banana</option> <option selected>cherry</option> <option>lemon</option> </select> if req
uired, the default value for the select box can be set using the selected attribute on the desired <option> element — this option is then preselected when the page loads.
... the <option> elements can be nested inside <optgroup> elements to create visually associated groups of values: <select id="groups" name="groups"> <optgroup label="fr
uits"> <option>banana</option> <option selected>cherry</option> <option>lemon</option> </optgroup> <optgroup label="vegetables"> <option>carrot</option> <option>eggplant</option> <option>potato</option> </optgroup> </select> on the <optgroup> element, the value of the label attribute is displayed before the values of the nested options.
...And 8 more matches
Fetching data from the server - Learn web development
prereq
uisites: javascript basics (see first steps, b
uilding blocks, javascript objects), the basics of client-side apis objective: to learn how to fetch data from the server and use it to update the contents of a web page.
... this is a really good thing because: page updates are a lot q
uicker and you don't have to wait for the page to refresh, meaning that the site feels faster and more responsive.
...this may not be such a big issue on a desktop on a broadband connection, but it's a major issue on mobile devices and in developing countries that don't have ubiq
uitous fast internet service.
...And 8 more matches
Implementing feature detection - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages; an idea of the high-level principles of cross-browser testing.
... objective: to understand what the concept of feature detection is, and be able to implement s
uitable solutions in css and javascript.
... @supports also has or and not logic available — the other block applies the float layout if the flexbox properties are not available: @supports not (flex-flow: row) and (flex: 1) { /* rules in here */ } this may look a lot more convenient than the previous example — we can do all of our feature detection in css, no javascript req
uired, and we can handle all the logic in a single css file, cutting down on http requests.
...And 8 more matches
Makefile - variables
global_deps a list of common dependencies (makefile.in, autoconf.mk) that will force reb
uilding.
... module instructs the b
uild system where to install exported headers.
... tier b
uild order dependencies - subdirectories for make to traverse prior to b
uilding current.
...And 8 more matches
PerfMeasurement.jsm
variable type description cpu_cycles
uint64 the number of cpu cycles elapsed.
... instructions
uint64 the number of instructions executed.
... cache_references
uint64 the number of memory accesses that occurred.
...And 8 more matches
NSS FAQ
because nss provides complete support for all versions of ssl and tls, it is particularly well-s
uited for applications that need to communicate with the many clients and servers that already support the ssl protocol.
...it contains bugs that were never fixed, doesn't support tls or or the new 56-bit export cipher s
uites, and does not contain the fix to the bleichenbacher attack on pkcs#1.
...it was b
uilt as an example of an ssl implementation, not for creating production applications.
...And 8 more matches
Shell global objects
note: this list overlaps with "b
uilt-in functions" in introduction to the javascript shell and is probably not complete.
... q
uit() q
uit the shell.
... functions available only in debug b
uild disassemble([fun/code]) return the disassembly for the given function or code.
...And 8 more matches
History Service Design
history views should allow to q
uickly find a page in a certain timeframe remembering only small details about it.
... another step to improve performance is mainly dedicated to not locking
ui.
... since places is actually not thread-safe and doing most of the work in the main-thread, adding visits (the most common action usually executed on user interaction) could end up locking the
ui till the database i/o to save data is complete.
...And 8 more matches
Using XPCOM Components
the cookie manager dialog shows user interface[cookie-manager-
ui] that is presented to the user in mozilla for working with the cookiemanager component.
... xpconnect is what binds the application code to the user interface of the mozilla browser, to other gecko-based xul, and to javascript environments like xpcshell, which is a command-line javascript interpreter and xpcom tool is b
uilt with mozilla.
... this isn't q
uite all there is to it, of course, but this shows an important aspect of xpcom.
...And 8 more matches
XPCOM
this article will show you how to use the available interfaces in several mozilla products.aggregating the in-memory datasourcealready_addrefedalready_addrefed in association with nscomptr allows you to assign in a pointer without addrefing it.binary compatibilityif mozilla decides to upgrade to a compiler that does not have the same abi as the current version, any b
uilt component may fail.
...effectively, it is a different platform.bundling multiple binary componentsbinary xpcom components are sometimes req
uired to implement low-level features for extensions.
...here is how to make the same component in python using pyxpcom.fun with xbl and xpconnectgenerating g
uidsg
uids are used in mozilla programming for identifying several types of entities, including xpcom interfaces (this type of g
uids is callled iid), components (cid), and legacy add-ons—like extensions and themes—that were created prior to firefox 1.5.
...And 8 more matches
Type conversion
target type source type ctypes.int16_t ctypes.int8_t ctypes.
uint8_t ctypes.short ctypes.
uint16_t ctypes.
uint8_t ctypes.unsigned_short ctypes.short ctypes.int8_t ctypes.
uint8_t ctypes.int16_t ctypes.unsigned_short ctypes.
uint8_t ctypes.
uint16_t ctypes.int32_t ctypes.int8_t ctypes.
uint8_t ctypes.int16_t ctypes.
uint16_t ctypes.short ...
... ctypes.unsigned_short ctypes.int ctypes.
uint32_t ctypes.
uint8_t ctypes.
uint16_t ctypes.unsigned_short ctypes.unsigned_int ctypes.int ctypes.int8_t ctypes.
uint8_t ctypes.int16_t ctypes.
uint16_t ctypes.short ctypes.unsigned_short ctypes.int32_t ctypes.unsigned_int ctypes.
uint8_t ctypes.
uint16_t ctypes.unsigned_short ctypes.
uint32_t ctypes.int64_t ctypes.int8_t ctypes.
uint8_t ctypes.int16_t ctypes.
uint16_t ctypes.short ctypes.unsigned_short ctypes.int32_t ctypes.
uint32_t ctypes.int ctypes.unsigned_int ctypes.long_long ctypes.
ui...
...nt64_t ctypes.
uint8_t ctypes.
uint16_t ctypes.unsigned_short ctypes.
uint32_t ctypes.unsigned_int ctypes.unsigned_long_long ctypes.long_long ctypes.int8_t ctypes.
uint8_t ctypes.int16_t ctypes.
uint16_t ctypes.short ctypes.unsigned_short ctypes.int32_t ctypes.
uint32_t ctypes.int ctypes.unsigned_int ctypes.int64_t ctypes.unsigned_long_long ctypes.
uint8_t ctypes.
uint16_t ctypes.unsigned_short ctypes.
uint32_t ctypes.unsigned_int ctypes.
uint64_t ctypes.float32_t ctypes.int8_t ctypes.
uint8_t ctypes.int16_t ctypes.
uint16_t ctypes.short ctypes...
...And 8 more matches
Using the Payment Request API - Web APIs
this article is a g
uide to making use of the payment request api, with examples and suggested best practices.
... so for example, you could create a new paymentrequest instance like so: var request = new paymentrequest(b
uildsupportedpaymentmethoddata(), b
uildshoppingcartdetails()); the functions invoked inside the constructor simply return the req
uired object parameters: function b
uildsupportedpaymentmethoddata() { // example supported payment methods: return [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard'], supportedtype...
...s: ['debit', 'credit'] } }]; } function b
uildshoppingcartdetails() { // hardcoded for demo purposes: return { id: 'order-123', displayitems: [ { label: 'example item', amount: {currency: 'usd', value: '1.00'} } ], total: { label: 'total', amount: {currency: 'usd', value: '1.00'} } }; } starting the payment process once the paymentrequest object has been created, you call the paymentrequest.show() method on it to initiate the payment request.
...And 8 more matches
A basic 2D WebGL animation example - Web APIs
since we're drawing a solid, untextured object with no lighting applied, this is exceptionally simple: <script id="fragment-shader" type="x-shader/x-fragment"> #ifdef gl_es precision highp float; #endif uniform vec4 uglobalcolor; void main() { gl_fragcolor = uglobalcolor; } </script> this starts by specifying the precision of the float type, as req
uired.
...dled through a load event handler called startup(): window.addeventlistener("load", startup, false); function startup() { glcanvas = document.getelementbyid("glcanvas"); gl = glcanvas.getcontext("webgl"); const shaderset = [ { type: gl.vertex_shader, id: "vertex-shader" }, { type: gl.fragment_shader, id: "fragment-shader" } ]; shaderprogram = b
uildshaderprogram(shaderset); aspectratio = glcanvas.width/glcanvas.height; currentrotation = [0, 1]; currentscale = [1.0, aspectratio]; vertexarray = new float32array([ -0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5 ]); vertexbuffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, vertexbuffer); gl.bufferdata(gl.array_buffer, vertexarray, gl.stati...
...c_draw); vertexnumcomponents = 2; vertexcount = vertexarray.length/vertexnumcomponents; currentangle = 0.0; rotationrate = 6; animatescene(); } after getting the webgl context, gl, we need to begin by b
uilding the shader program.
...And 8 more matches
Window.open() - Web APIs
the returned reference can be used to access properties and methods of the new window as long as it complies with same-origin policy security req
uirements.
...the minimum req
uired value is 100.
...the height value does not include other
ui parts such as location bar, title bar, tab bar, etc.
...And 8 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
the above example shows usage of the <img> element: the src attribute is req
uired, and contains the path to the image you want to embed.
...a complete g
uide to image formats supported by web browsers is available.
... .pjpeg, .pjp chrome, edge, firefox, internet explorer, opera, safari png portable network graphics image/png .png chrome, edge, firefox, internet explorer, opera, safari svg scalable vector graphics image/svg+xml .svg chrome, edge, firefox, internet explorer, opera, safari tiff tagged image file format image/tiff .tif, .tiff none b
uilt-in; add-ons req
uired webp web picture format image/webp .webp chrome, edge, firefox, opera the abbreviation for each format links to a longer description of the format, its capabilities, and detailed browser compatibility information; including which versions introduced support and specific special features that may have been introduced later.
...And 8 more matches
Equality comparisons and sameness - JavaScript
its behavior is eq
uivalent to +a (the unary + operator).
...the result of a comparison using strict equality is easier to predict, and may evaluate more q
uickly due to the lack of type coercion.
...(alternatively, someone might say that double equals is the baseline, and triple equals is an enhanced version, because it req
uires the two operands to be the same type, so it adds an extra constraint.
...And 8 more matches
Performance fundamentals - Web Performance
from this comes an important but counter-int
uitive corollary: a well-designed system does not maximize the amount of free memory.
...in service of meeting upp goals, the system must use only the minimum power req
uired.
...from a developer's or user's perspective, this answers the question, "what does the platform do for you?" web technologies the web platform provides many tools, some better s
uited for particular jobs than others.
...And 8 more matches
Introduction to progressive web apps - Progressive web apps (PWAs)
progressive enhancement and responsive design already allow us to b
uild mobile friendly websites.
...they represent a new philosophy for b
uilding web apps, involving some specific patterns, apis, and other features.
...an app could be considered a pwa when it meets certain req
uirements, or implements a set of given features: works offline, is installable, is easy to synchronize, can send push notifications, etc.
...And 8 more matches
Transport Layer Security - Web security
the security of any connection using transport layer security (tls) is heavily dependent upon the cipher s
uites and security parameters selected.
... a tls connection starts with a handshake phase where a client and server agree on a shared secret and important parameters, like cipher s
uites, are negotiated.
... cipher s
uites the primary parameters that the tls handshake negotiates is a cipher s
uite.
...And 8 more matches
Web Components
web components is a s
uite of different technologies allowing you to create reusable custom elements — with their functionality encapsulated away from the rest of your code — and utilize them in your web apps.
...this has traditionally not been so easy for custom markup structures — think of the complex html (and associated style and script) you've sometimes had to write to render custom
ui controls, and how using them multiple times can turn your page into a mess if you are not careful.
... if req
uired, attach a shadow dom to the custom element using element.attachshadow() method.
...And 8 more matches
Module structure of the SDK - Archive of obsolete content
commonjs is the underlying infrastructure for both the sdk and the add-ons you b
uild using the sdk.
...commonjs defines: an object called exports which contains all the objects which a commonjs module wants to make available to other modules a function called req
uire which a module can use to import the exports object of another module.
... to use sdk modules, you can pass req
uire() a complete path, starting with "sdk", to the module you want to use.
...And 7 more matches
Testing the Add-on SDK - Archive of obsolete content
with cfx (which is part of the addon-sdk repo), we can run the first test s
uite which was produced for the add-on sdk.
... this includes: cfx testcfx: a s
uite of python tests which test cfx itself (which is written in python).
... this s
uite basically tests cfx xpi's ability to produce the xpi files that we expect it to.
...And 7 more matches
cfx - Archive of obsolete content
for information on how to migrate from cfx to jpm see this g
uide.
...from firefox 21 onwards, sdk add-ons b
uilt with sdk 1.14 or higher will use the sdk modules that are b
uilt into firefox, even if the add-on includes its own copies of the sdk modules.
... use this flag to reverse that behavior: if this flag is set and the add-on includes its own copies of the sdk modules, then the add-on will use the sdk modules in the add-on, not the ones b
uilt into firefox.
...And 7 more matches
jpm - Archive of obsolete content
-o --overload path rather than use the sdk modules b
uilt into firefox, use the modules found at path.
... see overloading the b
uilt-in modules for more information.
... -o --overload path rather than use the sdk modules b
uilt into firefox, use the modules found at path.
...And 7 more matches
Extension Versioning, Update and Compatibility - Archive of obsolete content
as a rough overview this is a version string split by periods, some examples: 2.0 1.0b1 3.0pre1 5.0.1.2 note: before firefox 1.5 the more basic firefox version format was used: major.minor.release.b
uild[+] where only digits were allowed.
...in particular you should never specify a maxversion that is larger than the currently available version of the application since you do not know what api and
ui changes are just around the corner.
... note: starting in gecko 2.0, the automatic add-on update process properly supports cases in which the add-on's g
uid changes by uninstalling the old version and then installing the new one.
...And 7 more matches
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
this includes rules and g
uidelines applying to everything from headers, footers, page hierarchy, titles, typography, iconography, navigation, and others.
...as i was designing the product, i began discovering a broader set of web standards, and was q
uickly swayed by the advantages i could see if we were to adopt them.
...one was the req
uired order of content within generic markup.
...And 7 more matches
Style System Overview - Archive of obsolete content
styleruleimpl ↓ ↓ ↓ ↓ h1 nscssdeclaration h2 ↙ ↘ nscsscolor — color: green nscsstext — text-align: right text-indent: 0 css style rule representation problem: the rule structures use too much memory (a few hundred kilobytes for all our chrome), and req
uire large numbers of allocations to construct.
... the nsistyleruleprocessor interface implemented by cssruleprocessor, htmlstylesheetimpl, and htmlcssstylesheetimpl has a rulesmatching method, which is req
uired to call nsrulewalker::forward on any rules that match the element.
... (we'll see what this does later.) the main argument to rulesmatching is a structure of enumeration data that implementations use to determine more q
uickly which rules match.
...And 7 more matches
Extensions - Archive of obsolete content
for instance: <menubar id="main-menubar"> <menu label="search" insertbefore="tools-menu"> <menupopup> <men
uitem label="web"/> <men
uitem label="mail"/> </menupopup> </menu> </menubar> this menu is added to the main menu bar just before the tools menu.
... adding a new men
uitem you might wish to add a new item to one of the menus.
...for example, to add an item to the end of the tools menu, use the following: <menupopup id="menu_toolspopup"> <men
uitem label="thesaurus"/> </menupopup> note that other extensions may be adding their own items into the same menus.
...And 7 more matches
Template Logging - Archive of obsolete content
each result is logged in a form much like the following: in template with id root using ref http://www.some-fictitious-zoo.com/birds new active result for query 2 matching rule 1: http://www.some-fictitious-zoo.com/birds/emperorpeng
uin in the example above, a new result has been added.
...the id of the result is specified at the end, in this case 'http://www.some-fictitious-zoo.com/b...emperorpeng
uin'.
...<binding> req
uires a variable for its subject attribute the subject attribute on a <binding> element has to be variable (a value beginning with a question mark).
...And 7 more matches
Keyboard Shortcuts - Archive of obsolete content
example 1 : source view <menubar id="sample-menubar"> <menu id="file-menu" label="file" accesskey="f"> <menupopup id="file-popup"> <men
uitem id="close-command" label="close" accesskey="c"/> </menupopup> </menu> </menubar> you can also use the accesskey attribute on buttons.
...you could add any character for this attribute to req
uire that key to be pressed.
...if you wanted to disting
uish between keys on the main part of the keyboard and the numeric keypad, use the vk_numpad keys (such as vk_numpad1).
...And 7 more matches
XUL Event Propagation - Archive of obsolete content
chrome://global/skin/" type="text/css"?> <window id="events" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" oncommand="alert('window handler')"> <vbox> <vbox style="background-color: lightgrey;" oncommand="alert('box handler')"> <menu class="menu" label="file" oncommand="alert('menu handler')"> <menupopup> <men
uitem oncommand="alert('new item alert')" label="new" /> <men
uitem label="open" /> <men
uitem oncommand="alert('close handler')" label="close" /> </menupopup> </menu> <menu class="menu" label="edit"> <menupopup> <men
uitem oncommand="alert('edit source handler')" label="edit source" /> <men
uitem label="reload" /> <men
uitem label="view source" /> ...
... </menupopup> </menu> </vbox> <spring flex="1" /> </vbox> </window> in this file, the lowest-down, or "leaf" elements are the men
uitems.
... the hierarchy of the interface can be represented as follows: when one of these men
uitems raises an event, any of the elements above it in the hierarchy can handle it.
...And 7 more matches
menulist - Archive of obsolete content
to create the drop-down, put a menupopup inside the menulist containing the choices as men
uitem elements.
...popup, tabindex, value properties accessibletype, crop, description, disableautoselect, disabled, editable, editor, image, inputfield, itemcount, label, menuboxobject, menupopup, open, selectedindex, selecteditem, tabindex, value methods appenditem, contains, getindexofitem, getitematindex, insertitemat, removeallitems, removeitemat, select examples <menulist> <menupopup> <men
uitem label="option 1" value="1"/> <men
uitem label="option 2" value="2"/> <men
uitem label="option 3" value="3"/> <men
uitem label="option 4" value="4"/> </menupopup> </menulist> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
...for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } disableautoselect type: boolean if this attribute is true or omitted, the selected item on the menu will update to match what the user entered in the textbox.
...And 7 more matches
Application Update - Archive of obsolete content
getting started you will need the following utility scripts from http://lxr.mozilla.org/mozilla/sourc...ate-packaging/ (or local source of xulrunner) common.sh make_full_update.sh you will need mar / mar.exe to b
uild a complete update patch.
...as far as i can tell enabling the options --enable-updater and --enable-update-packaging on your configure will b
uild you mar.
... application settings you will need to configure the following settings in your application: branding the update process uses branding information, setup branding for your application as described here: xulrunner tips icons the updater process for linux systems req
uires updater.png to be in your <application folder>/icons/, see https://bugzilla.mozilla.org/show_bug.cgi?id=706846 preferences // whether or not app updates are enabled pref("app.update.enabled", true); // this preference turns on app.update.mode and allows automatic download and // install to take place.
...And 7 more matches
2006-10-27 - Archive of obsolete content
summary: mozilla.dev.b
uilds - october 21st to october 27th 2006 fx 1.5.0.x (linux) not b
uilding since 20-oct-2006 17:45 pdt october 22nd: gavin sharp answered a question that was posted by tony mechelynck.
...nick stated that the b
uild engineers knew that there was a problem with the tinderbox and that they would be solving the problem by adding a hard disk, and moving all or part of the concerned filesystem there.
... firefox 2 wont b
uild under solaris 10 x86 october 26: alex was trying to b
uild firefox 2 source on a solaris 10 x86 machine but was not successful with the b
uild.
...And 7 more matches
2006-11-03 - Archive of obsolete content
summary: mozilla.dev.b
uilds - october 28th to november 3rd 2006 no such file or directory (b
uild problem on winxp) november 2nd: kenoa complained that when he is compiling using cygwin on win32 he gets the following error no such file or directory1: /cygdrive/c/mozilla/mail/config/mozconfig client.mk:339: /cygdrive/c/mozilla/.mozconfig.mk: no such file or directory he claims that the file ".mozconfig" exists in /cygdrive/c/mozilla/mail/config/mozconfig the disable-crypto cause problem originally posted on november 2nd: gxk is b
uilding minimo using the code base from sept.
... when he b
uilds using the disable.crypto option he encounters the following problem: no rule to make target `../../dist/lib/components/libpipboot.a', needed by `minimo'.
... problem compiling with vs 2003 .net phil is trying to compile firefox for the first time and is getting an error when doing so: b
uilding deps for /cygdrive/c/mozilla/toolkit/airbag/airbag/src/common/windows/g
uid_string.cc make[1]: leaving directory `/cygdrive/c/mozilla/obj-i686-pc-cygwin' make: *** [b
uild] error 2 he also noted that he is using make 3.80-1.
...And 7 more matches
Examples - Archive of obsolete content
please note that the examples 4, 5 and 6 req
uire a file named style.css to exist in the same directory as the example.
...--> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head> <title>problem 1 - < in xhtml</title> <meta http-eq
uiv="content-type" content="application/xhtml+xml; charset=utf-8" /> <script type="text/javascript"> var i = 0; while (++i > 10) { // ...
... </p> </body> </html> back to the article problem 2 <!-- this file should have a .xhtml extension --> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head> <title>problem 2 - comments in xhtml</title> <meta http-eq
uiv="content-type" content="application/xhtml+xml; charset=utf-8" /> <style type="text/css"> <!-- body {background-color: blue; color: yellow; } --> </style> <script type="text/javascript"> <!-- var i = 0; var sum = 0; for (i = 0; i < 10; ++i) { sum += i; } alert('sum = ' + sum); // --> </script> </head> <body> <h1>problem 2 - comments in xhtml</h1> ...
...And 7 more matches
Anatomy of a video game - Game development
it helps beginners to the modern game development arena understand what is req
uired when b
uilding a game and how web standards like javascript lend themselves as tools.
...it might req
uire both input and simulated time.
... b
uilding a main loop in javascript javascript works best with events and callback functions.
...And 7 more matches
Images, media, and form elements - Learn web development
previous overview: b
uilding blocks next in this lesson we will take a look at how certain special elements are treated in css.
... prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to understand the way that some elements behave unusually when styled with css.
... form elements form elements can be a tricky issue when it comes to styling with css, and the web forms module contains detailed g
uides to the trickier aspects of styling form elements, which i will not fully reproduce here.
...And 7 more matches
Your first form - Learn web development
prereq
uisites: basic computer literacy, and a basic understanding of html.
...forms allow users to enter data, which is generally sent to a web server for processing and storage (see sending form data later in the module), or used on the client-side to immediately update the interface in some way (for example, add another item to a list, or show or hide a
ui feature).
...designing a q
uick mockup will help you to define the right set of data you want to ask your user to enter.
...And 7 more matches
Web forms — Working with user data - Learn web development
get started prereq
uisites before starting this module, you should at least work through our introduction to html.
... at this point you should find the introductory g
uides easy to understand, and also be able to make use of our basic native form controls g
uide.
... mastering forms however req
uires more than just html knowledge — you also need to learn some specific techniques to style form controls, and some scripting knowledge is req
uired to handle things like validation and creating custom form controls.
...And 7 more matches
From object to iframe — other embedding technologies - Learn web development
prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with html fundamentals (as covered in getting started with html) and the previous articles in this module.
... click on the "hamburger menu" (three horizontal lines) in the top left of the
ui.
... there are some serious security concerns to consider with <iframe>s, as we'll discuss below, but this doesn't mean that you shouldn't use them in your websites — it just req
uires some knowledge and careful thinking.
...And 7 more matches
TypeScript support in Svelte - Learn web development
prereq
uisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line.
... you'll need a terminal with node + npm installed to compile and b
uild your app.
...that means that it parses typescript code and produces the eq
uivalent vanilla javascript code for browsers to run.
...And 7 more matches
Signing Mozilla apps for Mac OS X
signing mozilla apps without the signing server firefox and thunderbird are b
uilt using mozilla's release automation infrastructure.
...for projects that don't use mozilla's release automation and would like to be signed for secure launching on os 10.8 mountain lion and later, this g
uide should provide some insight into how to make sure applications are signed correctly using apple's codesign tool.
... apple's code signing g
uide is also a good resource on the subject.
...And 7 more matches
Observer Notifications
if your component req
uires access to the user profile, or any services which req
uire access to the profile (preferences, bookmarks, and so on) then a common pattern is to register with the nsicategorymanager for the app-startup topic which can be done in the component's registration code, and then in that notification register with the observer service for the profile-after-change notification.
... final-
ui-startup triggered just before the first window for the application is displayed.
... topic description q
uit-application-requested something has requested that the application be shutdown.
...And 7 more matches
Reference Manual
if you've never use nscomptrs before, you might want to read the getting started g
uide first.
... if you're trying to fix a broken b
uild, the faq might lead you to the answer more q
uickly.
...in debug b
uilds, if you subvert this invariant with one of the assignment forms that doesn't call queryinterface, nscomptr will assert at runtime in the bad assignment.
...And 7 more matches
Key Values - Web APIs
learn how to use these key values in javascript using keyboardevent.key special values | modifier keys | whitespace keys | navigation keys | editing keys |
ui keys | device keys | ime and composition keys | function keys | phone keys | multimedia keys | audio control keys | tv control keys | media controller keys | speech recognition keys | document keys | application selector keys | browser control keys | numeric keypad keys special values values of key which have special meanings other than identifying a specific key or character.
...allows iss
uing special command inputs.
...
ui keys keyboardevent.key value description virtual keycode windows mac linux android "accept" the accept, commit, or ok key or button.
...And 7 more matches
WebGL: 2D and 3D graphics for the web - Web APIs
support for webgl is present in firefox 4+, google chrome 9+, opera 12+, safari 5.1+, internet explorer 11+, and microsoft edge b
uild 10240+; however, the user's device must also have hardware that supports these features.
...edback webgluniformlocation webglvertexarrayobject extensions angle_instanced_arrays ext_blend_minmax ext_color_buffer_float ext_color_buffer_half_float ext_disjoint_timer_query ext_float_blend ext_frag_depth ext_srgb ext_shader_texture_lod ext_texture_compression_bptc ext_texture_compression_rgtc ext_texture_filter_anisotropic khr_parallel_shader_compile oes_element_index_
uint oes_fbo_render_mipmap oes_standard_derivatives oes_texture_float oes_texture_float_linear oes_texture_half_float oes_texture_half_float_linear oes_vertex_array_object ovr_multiview2 webgl_color_buffer_float webgl_compressed_texture_astc webgl_compressed_texture_atc webgl_compressed_texture_etc webgl_compressed_texture_etc1 webgl_compressed_texture_pvrtc webgl_compressed_texture_s...
... g
uides and tutorials below, you'll find an assortment of g
uides to help you learn webgl concepts and tutorials that offer step-by-step lessons and examples.
...And 7 more matches
Lighting a WebXR setting - Web APIs
this g
uide discusses these topics.
... and while this article provides brief reminders as to how lighting works in general, it is not by any means a tutorial in lighting or a g
uide to how to create a properly-lit 3d scene.
... flashback: simulating lighting in 3d although this article isn't a comprehensive g
uide to lighting a 3d scene, it's useful to provide a brief reminder as to how lighting works in general.
...And 7 more matches
Starting up and shutting down a WebXR session - Web APIs
this object represents the overall webxr device s
uite available to you through the hardware and drivers available on the user's eq
uipment.
... there is a global xrsystem object available for use by your document through the the navigator property xr, which returns the xrsystem object if s
uitable xr hardware is available for your use given the hardware available and your document's environment.
... context req
uirements a webxr compatible environment starts with a securely-loaded document.
...And 7 more matches
Advanced techniques: Creating and sequencing audio - Web APIs
demo we're going to be looking at a very simple step sequencer: in practice this is easier to do with a library — the web audio api was b
uilt to be b
uilt upon.
... if you are about to embark on b
uilding something more complex, tone.js would be a good place to start.
... however, we want to demonstrate how to b
uild such a demo from first principles, as a learning exercise.
...And 7 more matches
Web Audio API - Web APIs
a common modification is multiplying the samples by a value to make them louder or q
uieter (as is the case with gainnode).
...with that in mind, it is s
uitable for both developers and musicians alike.
...this also includes a good introduction to some of the concepts the api is b
uilt upon.
...And 7 more matches
Web applications and ARIA FAQ - Accessibility
live region support req
uires safari 5 with voiceover on ios5 or os x lion opera 9.5+ req
uires voiceover on os x.
... javascript toolkits aria roles, states, and properties have been added to a number of popular javascript user interface toolkits, including: dojo/dijit jquery
ui fl
uid infusion google closure google web toolkit bbc glow yahoo!
... user interface library (y
ui) for more information about javascript toolkit accessibility: steve faulkner's wai-aria implementation in javascript
ui libraries can you show me an example of aria in action?
...And 7 more matches
<input type="month"> - HTML: Hypertext Markup Language
the control's
ui varies in general from browser to browser; at the moment support is patchy, with only chrome/opera and edge on desktop — and most modern mobile browser versions — having usable implementations.
...the values provided are suggestions, not req
uirements: users can select from this predefined list or provide a different value.
... note: because a read-only field cannot have a value, req
uired does not have any effect on inputs with the readonly attribute also specified.
...And 7 more matches
<input type="time"> - HTML: Hypertext Markup Language
12-hour 24-hour chrome 83 in chrome 83, the
ui controls have been updated with a new look and feel.
... the new element is functionally identical to the old one, but has a similar
ui to edge.
...the values provided are suggestions, not req
uirements: users can select from this predefined list or provide a different value.
...And 7 more matches
<input type="week"> - HTML: Hypertext Markup Language
note: because a read-only field cannot have a value, req
uired does not have any effect on inputs with the readonly attribute also specified.
... using week inputs week inputs sound convenient at first glance, since they provide an easy
ui for choosing weeks, and they normalize the data format sent to the server, regardless of the user's browser or locale.
...the
ui implementations generally don't let you specify anything that isn't a valid week/year, which is helpful, but it's still possible to submit with the field empty, and you might want to restrict the range of choosable weeks.
...And 7 more matches
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
permitted parents <meta charset>, <meta http-eq
uiv>: a <head> element.
... if the http-eq
uiv is not an encoding declaration, it can also be inside a <noscript> element, itself inside a <head> element.
... if the http-eq
uiv attribute is set, the meta element is a pragma directive, providing information eq
uivalent to what can be given by a similarly-named http header.
...And 7 more matches
Web media technologies
webrtc webrtc (web real-time communication) makes it possible to stream live audio and video, as well as transfer arbitrary data, between two peers over the internet, without req
uiring an intermediary.
... g
uides overview of media technology on the web a general look at the open web technologies and apis that provide support for audio and video playback, manipulation, and recording.
... using audio and video in html a g
uide to using the html <audio> and <video> elements.
...And 7 more matches
Critical rendering path - Web Performance
the html includes or makes requests for styles, which in turn b
uilds the css object model.
...the browser continues to parse the html making requests and b
uilding the dom, until it gets to the end, at which point it constructs the css object model.
... with the dom and cssom complete, the browser b
uilds the render tree, computing the styles for all the visible content.
...And 7 more matches
Add to Home screen - Progressive web apps (PWAs)
this g
uide explains how a2hs is used, and what you need to do as a developer to allow your users to take advantage of it.
... tapping this icon opens it up, but as a fullscreen app, you'll no longer see the browser
ui around it.
... chrome additionally req
uires the app to have a service worker registered (e.g., so it can function when offline).
...And 7 more matches
Progressive web app structure - Progressive web apps (PWAs)
we will start with analyzing the js13kpwa application, why it is b
uilt that way, and what benefits it brings.
... server-side rendering (ssr) means a website is rendered on the server, so it offers q
uicker first load, but navigating between pages req
uires downloading new html content.
... it works great across browsers, but it suffers in terms of time navigating between pages and therefore general perceived performance — loading a page req
uires a new round trip to the server.
...And 7 more matches
Structural overview of progressive web apps - Progressive web apps (PWAs)
in this structural overview, we'll look at the features that make up a standard web application, as well as some design patterns you can follow when b
uilding your pwa.
... server-side rendering (ssr) means a website is rendered on the server, so it offers q
uicker first load, but navigating between pages req
uires downloading new html content.
... it works great across browsers, but it suffers in terms of time navigating between pages and therefore general perceived performance — loading a page req
uires a new round trip to the server.
...And 7 more matches
2015 MDN Fellowship Program - Archive of obsolete content
what seven weeks of partnering closely with mozilla to (1) b
uild curriculum, code, or likely both; and (2) receive coaching, training and best practices for effectively communicating and educating with technical information.
... req
uired skills and experience experience and comfort writing javascript test scripts.
... req
uired skills and experience experienced web developer with expertise in javascript, css, html as well as with efficient network interaction (que
uing resource fetching, etc.).
...And 6 more matches
Interacting with page scripts - Archive of obsolete content
this g
uide describes: how to share objects between content scripts and page scripts how to send messages between content scripts and page scripts sharing objects with page scripts there are two possible cases here: a content script might want to access an object defined by a page script a content script might want to expose an object to a page script access objects defined by page scripts to...
... in this example a page script adds a string variable foo to the window: <!doctype html"> <html> <head> <script> window.foo = "hello from page script" </script> </head> </html> the content script can see this object if it uses unsafewindow.foo instead of window.foo: // main.js var tabs = req
uire("sdk/tabs"); var mod = req
uire("sdk/page-mod"); var self = req
uire("sdk/self"); var pageurl = self.data.url("page.html") var pagemod = mod.pagemod({ include: pageurl, contentscript: "console.log(unsafewindow.foo);" }) tabs.open(pageurl); be careful using unsafewindow: you can't rely on any of its properties or functions being, or doing, what you expect.
...the "main.js" opens the local file "page.html" and attaches a content script to it: // main.js var tabs = req
uire("sdk/tabs"); var self = req
uire("sdk/self"); tabs.open({ url: self.data.url("page.html"), onready: attachscript }); function attachscript(tab) { tab.attach({ contentscriptfile: self.data.url("content-script.js") }); } the content script defines an object and assigns it to unsafewindow twice: the first time using cloneinto(), the second time using simple assignment: // content-s...
...And 6 more matches
url - Archive of obsolete content
var urls = req
uire("sdk/url"); console.log(urls.gettld("http://www.bbc.co.uk/")); // "co.uk" console.log(urls.gettld("https://developer.mozilla.org/")); // "org" parameters url : string the url, as a string.
...for example: var url = req
uire("sdk/url").url("https://developer.mozilla.org/add-ons?example=true&visible=yes#top"); console.log(url.scheme); // https userpass the username:password part of the url, null if not present.
...for example: var url = req
uire("sdk/url").url("https://developer.mozilla.org/add-ons?example=true&visible=yes#top"); console.log(url.host); // developer.mozilla.org port the port number of the url, null if none was specified.
...And 6 more matches
windows - Archive of obsolete content
here's an example converting from a high-level browserwindow to a chrome window, and then back the other way: var { modelfor } = req
uire("sdk/model/core"); var { viewfor } = req
uire("sdk/view/core"); var browserwindows = req
uire("sdk/windows").browserwindows; function converttochromeandback(browserwindow) { // get the chrome window for this browserwindow var chromewindow = viewfor(browserwindow); // now we can use the chrome window api console.log(chromewindow.document.location.href); // -> "chrome://browser/content/...
... var windows = req
uire("sdk/windows").browserwindows; // open a new window.
... } }); returns the window that was opened: var windows = req
uire("sdk/windows").browserwindows; var example = windows.open("http://www.example.com"); req
uire("sdk/
ui/button/action").actionbutton({ id: "read", label: "read", icon: "./read.png", onclick: function() { example.close(); } }); this example uses the action button api, which is only available from firefox 29 onwards.
...And 6 more matches
Storing annotations - Archive of obsolete content
please see the
ui module for replacements.
... first, import the simple-storage module with a declaration like: var simplestorage = req
uire('sdk/simple-storage'); in the module scope, initialize an array which will contain the stored annotations: if (!simplestorage.storage.annotations) simplestorage.storage.annotations = []; now we'll add a function to the module scope which deals with a new annotation.
... the panel has three new files associated with it: a content-script which b
uilds the panel content a simple html file used as a template for the panel's content a simple css file to provide some basic styling.
...And 6 more matches
Creating Event Targets - Archive of obsolete content
the g
uide to event-driven programming with the sdk describes how to consume events: that is, how to listen to events generated by event targets.
...this is especially useful if you want to b
uild your own modules, either to organize your add-on better or to enable other developers to reuse your code.
...then open "index.js" and add the following code: var {cc, ci} = req
uire("chrome"); var { xpcomutils } = req
uire("resource://gre/modules/xpcomutils.jsm"); var bookmarkservice = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); var bookmarkobserver = { onitemadded: function(aitemid, afolder, aindex) { console.log("added ", bookmarkservice.getbookmarkuri(aitemid).spec); }, onitemvisited: fun...
...And 6 more matches
Modifying Web Pages Based on URL - Archive of obsolete content
a simple code snippet where content script is supplied as contentscript option and url pattern is given as include option is as follows: // import the page-mod api var pagemod = req
uire("sdk/page-mod"); // create a page-mod // it will run a script whenever a ".org" url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscript: 'document.body.innerhtml = ' + ' "<h1>page matches ruleset</h1>";' }); do as follows: create a new directory and navigate to it.
... for example, if we save the script above under the add-on's data directory in a file called my-script.js: // import the page-mod api var pagemod = req
uire("sdk/page-mod"); // import the self api var self = req
uire("sdk/self"); // create a page-mod // it will run a script whenever a ".org" url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscriptfile: self.data.url("my-script.js") }); or from firefox 34 onwards: // import the page-mod api var pagemod = req
uire("sdk/page-mod"); /...
... // import the page-mod api var pagemod = req
uire("sdk/page-mod"); // import the self api var self = req
uire("sdk/self"); // create a page mod // it will run a script whenever a ".org" url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscriptfile: [self.data.url("jquery-1.7.min.js"), self.data.url("my-script.js")] }); you can use both contentscript and contentscriptfile in th...
...And 6 more matches
Localization - Archive of obsolete content
to reference localized strings from html, add a data-l10n-id attribute to the html tag where you want the localized string to appear, and assign the identifier to it: <html> <body> <h1 data-l10n-id="hello_id"></h1> </body> </html> then you can use this html file to b
uild your interface, for example inside a panel: var button = req
uire("sdk/
ui/button/action").actionbutton({ id: "localized-hello", label: "localized hello", icon: "./icon-16.png", onclick: function() { hello.show(); } }); var hello = req
uire("sdk/panel").panel({ height: 75, width: 150, contenturl: req
uire("sdk/self").data.url("my-panel.html") }); given locale files for "en-us...
...the following attributes are supported: accesskey alt label title placeholder further the localization of the aria attributes aria-label, aria-valuetext and aria-moz-hint are supported with the same aliases as on firefox os: arialabel ariavaluetext ariamozhint using localized strings in javascript to reference localized strings from your main add-on code, you do this: var _ = req
uire("sdk/l10n").get; console.log(_("hello_id")); assigning to "_" in particular is not req
uired, but is a convention from the gettext tools and will make it possible to work with existing tools that expect "_" to indicate localizable strings.
... note that because you can't req
uire() modules in content scripts, you can't yet reference localized strings from content scripts.
...And 6 more matches
Adding sidebars - Archive of obsolete content
« previousnext » the sidebar in firefox is a relatively large and flexible space to add rich interfaces without req
uiring new windows or complicated overlays.
... the code req
uired to add a sidebar is very simple, as explained in creating a firefox sidebar.
... <menupopup id="viewsidebarmenu"> <men
uitem id="xulschoolhello-sidebar" label="&xulschoolhello.sidebar.title;" accesskey="&xulschoolhello.sidebar.accesskey;" type="checkbox" autocheck="false" group="sidebar" sidebarurl="chrome://xulschoolhello/content/sidebar.xul" sidebartitle="&xulschoolhello.sidebar.title;" oncommand="togglesidebar('xulschoolhello-sidebar');" /> </menupopup> the example in the mdc page includes a shortcut key combination to toggle the new sidebar.
...And 6 more matches
Setting up an extension development environment - Archive of obsolete content
note: for an extended g
uide on how to set up even more user profiles, take a look at multiple firefox profiles.
... to q
uickly achieve our task of creating just a developer profile, we will start the application with the parameters: /path/to/firefox -no-remote -p profilename without these parameters, the default behavior of your mozilla applications is to only open the everyday user profile: named default.
...disables the xul cache so that changes to windows and dialogs do not req
uire a restart.
...And 6 more matches
Extensions - Archive of obsolete content
extensions are b
uilt using the same methods as any mozilla-based extension.
...most notably, the prism application id and the differences in the user interface (
ui).
... extensions typically overlay the host application's
ui to add toolbar buttons, menus and other features.
...And 6 more matches
Actionscript Acceptance Tests - Archive of obsolete content
see running tamarin acceptance tests for instructions on running the acceptance test s
uite.
...testing versioned bug fixes when testing versioned bug fixes (using avmplus.system.swfversion) there are a couple of req
uirements: you must use system.swfversion when looking up the swfversion.
...testname.as.asc_args this file specifies additional arguments to pass to asc when compiling the test: # asc args for file # two modes are available: # override| all command line arguments (except b
uiltin.py) are ignored and replaced by these # merge| merge these args in with the current args # specifiy an arg that starts with -no will disable the arg...
...And 6 more matches
Venkman Introduction - Archive of obsolete content
a powerful new tool is available for web developers for use in many mozilla-based products, including firefox, mozilla s
uite and netscape 7.x.
...you can then access the debugger via a new, dynamically created men
uitem in the tools menu of that browser, or else restart the browser with a special debugger option.
... (note that venkman displays usage data when it starts up: "recorded local startup x, global yyy." this data comes from a counter b
uilt in to the application.
...And 6 more matches
Video presentations - Archive of obsolete content
how pages are b
uilt using the dom this presentation describes how documents are loaded and the dom tree is constructed.
... (as q
uicktime; 198 mb) laying out and drawing documents (slides) this presentation describes how a document is laid out and painted to the display by the gecko engine.
... (as q
uicktime; 282 mb) community these presentations provide insight into the mozilla community and how the project works.
...And 6 more matches
Filtering - Archive of obsolete content
this can be done by modifying the dom nodes inside the query and reb
uilding the template.
...iple) { triple = document.createelement("triple"); triple.id = "filtertriple"; triple.setattribute("subject", "?photo"); triple.setattribute("predicate", "http://www.xulplanet.com/rdf/country"); } triple.setattribute("object", country); cond.appendchild(triple); } else if (triple) { cond.removechild(triple); } document.getelementbyid("photoslist").b
uilder.reb
uild(); } the 'country' argument to the applyfilter function holds the value to filter by.
...whether a triple or member is added or removed, the template must be reb
uilt by calling the reb
uild method.
...And 6 more matches
Result Generation - Archive of obsolete content
no req
uirement exists to follow the arrows in the direction they point; you can easily go the other way (though in only one direction within a given series of iterations).
...during query processing, the template b
uilder b
uilds up a network of information such as: possible results that are available where content should be generated information that indicates what to do when the rdf datasource changes this network of information remains for the lifetime of the template, or until it is reb
uilt.
... the template b
uilder uses a method based on the rete algorithm to match data.
...And 6 more matches
Sorting Results - Archive of obsolete content
when the reference node is an rdf seq container and the results are in that container, however, the template b
uilder orders the results in the order the items appear in the seq.
...in this case, the natural order of the results will just be the order that the template b
uilder generates the results.
...using a tree b
uilder, you can sort the results in a tree by a column.
...And 6 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
in particular, the articles creating toolbar buttons and b
uilding an extension explain the process in more detail.
... req
uired tools you will need two tools.
... delete these two files: chrome.rdf overlays.rdf explanation: seamonkey automatically reb
uilds these files the next time it starts.
...And 6 more matches
Trees and Templates - Archive of obsolete content
adding datasources to trees when using a tree, you will often use a template to b
uild its content, to handle a large amount of hierarchial data.
...the following example uses the history datasource: <tree datasources="rdf:history" ref="nc:historybydate" flags="dont-b
uild-content"> as described in the previous section, the tree may use a tree b
uilder for template generation instead of the normal content b
uilder.
...the flags attribute set to the value dont-b
uild-content, as used in the example above, indicates that the tree b
uilder should be used.
...And 6 more matches
XUL Structure - Archive of obsolete content
registered packages are not req
uired to use overlays, of course.
...however, this xul code will be registered in the chrome system such that the application can display the
ui.
...you can examine these packages by looking in the chrome directory where firefox or another xul application is b
uilt.
...And 6 more matches
XML - Archive of obsolete content
but the necessary tradeoff for xul's flexibility is a lack of implicit functionality -- the lack ofint
uition, you might say, that xul has in interpreting what it is you want.
...any familiarity you already have with xml will help you q
uickly get up to speed developing with xul.
...an actual memo using the memoml to represent itself might look like this: <memo> <from>ian oeschger</from> <to>steve rudman</to> <body>i think the first draft of the g
uide is done!</body> </memo> note how the memo element -- the root element in our brief definition, ordeclaration, above -- surrounds the other three elements.
...And 6 more matches
Getting started with XULRunner - Archive of obsolete content
next » this article explores the mozilla platform by b
uilding a basic desktop application using xulrunner.
... given that firefox, thunderbird, and multiple other applications are written using the platform, it's a safe bet that it can be used to b
uild a basic application.
... there is an article with a more complicated approach to b
uilding xulrunner applications at creating xulrunner apps with the mozilla b
uild system.
...And 6 more matches
What is RSS - Archive of obsolete content
now, the story doesn't q
uite end there.
...for example: <?xml version="1.0"?> <rss version="2.0"> <channel> <title>example news site</title> <description>this is an example news site.</description> <lastb
uilddate>wed, 27 jul 2005 00:30:30 -0700</lastb
uilddate> <link>http://news.example.com/</link> <item> <title>news flash: i like bread</title> <g
uid ispermalink="false">4d4a0a12-f188-4c97-908b-eea27213c2fe</g
uid> <pubdate>wed, 27 jul 2005 00:30:30 -0700</pubdate> <link>http://news.example.com/artcle/554</link> </item> <it...
...em> <title>big news today: birds fly</title> <g
uid ispermalink="false">c4a63f09-b45b-466b-8773-6ff264001ab7</g
uid> <pubdate>tue, 19 jul 2005 04:32:51 -0700</pubdate> <link>http://news.example.com/artcle/553</link> </item> <item> <title>fire is hot</title> <g
uid ispermalink="false">c1795324-d5ea-44fa-95b1-b5ce2090d4f1</g
uid> <pubdate>sun, 15 may 2005 13:02:08 -0700</pubdate> <link>http://news.example.com/artcle/552</link> </item> </channel> </rss> bloggers use rss to provide everyone with a list of their newest blog posts.
...And 6 more matches
SSL and TLS - Archive of obsolete content
clients and servers may support different cipher s
uites, or sets of ciphers.
... among other functions, the ssl handshake determines how the server and client negotiate which cipher s
uite they will use to authenticate each other, to transmit certificates, and to establish session keys.
...the most common ssl cipher s
uites use rsa key exchange, while tls supports ecc cipher s
uites as well as rsa.
...And 6 more matches
Using SSH to connect to CVS - Archive of obsolete content
introduction this document is a g
uide to setting up access to cvs.mozilla.org using ssh.
...the following command should generate a s
uitable key pair: ssh-keygen -t dsa this will take a moment, followed by a prompt for a passphrase.
... download, b
uild, and install corkscrew by following the instructions in the install file in the corkscrew source distribution.
...And 6 more matches
Implementation Status - Archive of obsolete content
nts supported 4.2.1 xforms-model-construct supported 4.2.2 xforms-model-construct-done supported 4.2.3 xforms-ready supported 4.2.4 xforms-model-destruct supported 4.3.1 xforms-reb
uild supported 4.3.2 xforms-recalculate supported 4.3.3 xforms-revalidate supported 4.3.4 xforms-refresh supported 4.3.5 xforms-reset supported 4.3.6 xforms-next xforms-previous ...
...3 xforms-value-changed supported 4.4.4 xforms-valid supported 4.4.5 xforms-invalid supported 4.4.6 xforms-readonly supported 4.4.7 xforms-readwrite supported 4.4.8 xforms-req
uired supported 4.4.9 xforms-optional supported 4.4.10 xforms-enabled supported 4.4.11 xforms-disabled supported 4.4.12 domactivate supported 4.4.13 domfocusin supported ...
...eferences to elements within a repeat element unsupported 4.7.2 references to elements within a bind element unsupported 4.8 dom interface for access to instance data supported 4.8.1 getinstancedocument() supported 4.8.2 reb
uild() supported 4.8.3 recalculate() supported 4.8.4 revalidate() supported 4.8.5 refresh() supported 4.9 feature string for the hasfeature method call supported 5.
...And 6 more matches
Game monetization - Game development
when you've spent your time b
uilding a game, distributing it and promoting it you should consider earning some money out of it.
...you have to follow the market and do your own research — learning from your mistakes q
uickly is important.
... in-app purchases instead of having people pay for your game up front, you can offer a free game with in-app purchases (iaps.) in this case the game can be acq
uired without spending a dime — give the game to the players, but offer in-game currency, bonuses or benefits for real money.
...And 6 more matches
Game promotion - Game development
many great games get started as a q
uick, sloppy demo submitted to a competition.
...plus competitions generally req
uire games to follow a mandatory theme, so you can get creative around a theme if you are stuck for ideas.
...the more information you can include the better — you should include screenshots, description, trailer, press kit, req
uirements, available platforms, support details and more.
...And 6 more matches
Visual-js game engine - Game development
full name : visual-js g
ui for windows multiplatform 2d game engine creator : nikola lukic 2017 2018 open source visual-js project parts : -2d part : this is javascript game engine (server part node.js / client part js) js framework with windows g
ui editor and game instance creator.
... external licences in this project : webcam n
ui control is under : created by romuald quantin.
... http://creativecommons.org/licenses/by-nc-sa/3.0/ download from : https://www.adobe.com/devnet/archive/html5/articles/javascript-motion-detection.html webrtc - webcam communication is under : creator muaz khan www.muazkhan.com mit license - www.webrtc-experiment.com/licence socket.io.js - http://socket.io/download/ ( also implemented intro b
uild.js ) webgl2 based on : copyright (c) 2014 tappali ekanathan keestu (keestu@gmail.com) gnu general public license obj loader : https://github.com/frenchtoast747/webgl-obj-loader textures download from http://textures.com more texture downloads http://www.textures4photoshop.com/ female body v3.blend this file has been released by andrescuccaro under the following license: creative commons attribution ...
...And 6 more matches
Pseudo-classes and pseudo-elements - Learn web development
previous overview: b
uilding blocks next the next set of selectors we will look at are referred to as pseudo-classes and pseudo-elements.
... there are a large number of these, and they often serve q
uite specific purposes.
... prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn about the pseudo-class and pseudo-element selectors.
...And 6 more matches
What is a Domain Name? - Learn web development
prereq
uisites: first you need to know how the internet works and understand what urls are.
...the most generic tlds (.com, .org, .net) don't req
uire web services to meet any particular criteria, but some tlds enforce stricter policies so it is clearer what their purpose is.
... for example: local tlds such as .us, .fr, or .se can req
uire the service to be provided in a given language or hosted in a certain country — they are supposed to indicate a resource in a particular language or country.
...And 6 more matches
HTML forms in legacy browsers - Learn web development
all web developers learn very q
uickly (and sometimes painfully) that the web is a very rough place for them.
...there are so many cases where we want forms that are "nicer" or "with advanced functionality", but b
uilding efficient html forms is not a question of design or technology.
... rather, it's about simplicity, int
uitivess, and ease of user interaction.
...And 6 more matches
Video and audio content - Learn web development
prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with html fundamentals (as covered in getting started with html) and images in html.
... we won't be teaching you how to produce audio and video files — that req
uires a completely different skillset.
... note: before you begin here, you should also know that there are q
uite a few ovps (online video providers) like youtube, dailymotion, and vimeo, and online audio providers like soundcloud.
...And 6 more matches
Starting our Svelte Todo list app - Learn web development
previous overview: client-side javascript frameworks next now that we have a basic understanding of how things work in svelte, we can start b
uilding our example app: a todo list.
... prereq
uisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line.
... you'll need a terminal with node + npm installed to compile and b
uild your app.
...And 6 more matches
Client-side tooling overview - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages.
...although it is still entirely reasonable to write html, css, and javascript "by hand" there is now a wealth of tools that developers can use to speed up the process of b
uilding a web site, or app.
... in these articles, we won’t answer every question about web tooling, but we will provide you with a useful starting point of understanding the fundamentals, which you can then b
uild from.
...And 6 more matches
Chrome Worker Modules
this module loader should not surprise developers familiar with commonjs, as it implements a minimal commonjs req
uire().
...you only need to do it once for each worker, from within the chrome worker itself: importscripts("resource://gre/modules/workers/req
uire.js"); note: although you only need to do this once for each worker, it doesn't hurt if you do it more than once.
... this defines a global value req
uire(), that you may now use as follows: // import the module // (here, we import the core of os.file) let core = req
uire("resource://gre/modules/osfile/osfile_shared_allthreads.jsm"); // we may now use module core.
...And 6 more matches
Accessibility API cross-reference
aria is a standard developed as part of the web accessibility initiative, which uses markup syntax q
uite familiar to users of html, xml, sgml and others.
...<h> is also available but its use is not recommended because of lack of s
uitable tools - and the heading level is undefined click on this thing and then click on the item for tooltip style help helpballoon n/a n/a n/a editable field that allows user to assign a key combination hotkeyfield n/a n/a n/a graphic that indicates something, such as an arrow indicator n/a n/a n...
... marquee the main menu bar below the app's title bar menubar menu_bar menu_bar menubar a menu item men
uitem menu_item menu_item men
uitem a men
uitem with a checkable state whose possible values are true, false, or mixed.
...And 6 more matches
Benchmarking
debug b
uilds debug b
uilds (--enable-debug) and non-optimized b
uilds (--disable-optimize) are much slower.
... any performance metrics gathered by such b
uilds are largely unrelated to what would be found in a release browser.
... rust optimization level local optimized b
uilds are compiled with rust optimization level 1 by default, unlike nightly b
uilds, which use rust optimization level 2.
...And 6 more matches
Debugging on Windows
if you have followed the steps in b
uilding firefox for windows and have a local debug b
uild, you can execute ./mach run --debug from the same command line.
... alternatively, if you have generated the visual studio solution, via ./mach b
uild-backend -b visualstudio, opening this solution allows you to run firefox.exe directly in the debugger.
... debugging release and nightly b
uilds refer to the steps to use the mozilla symbol server and source server.
...And 6 more matches
HTTP logging
other bugs may req
uire all the logs to be uploaded--ask the developer if you're not sure.
...you can type "%temp%" directly into the windows explorer location bar to get there q
uickly.
... q
uit out of firefox if it's running.
...And 6 more matches
pymake
pyb
uild is no longer supported!
...prereq
uisites if running windows, you need to have a windows b
uild environment installed for using pymake to b
uild mozilla.
... on other operating systems (linux, os x, etc), pymake itself only req
uires python 2.6 or higher (but not python 3).
...And 6 more matches
Reviewer Checklist
this article provides a list of best practices for your patch content that reviewers will check for or req
uire.
... if it's js, try to design and b
uild so that xpcshell can exercise most functionality.
... it's q
uicker.
...And 6 more matches
Leak-hunting strategies and tips
start finding and fixing leaks by running part of the task under nstracerefcnt logging, gradually b
uilding up from as little as possible to the complete task, and fixing most of the leaks in the first steps before adding additional steps.
... tool finds platforms req
uires leak tools for large object graphs leak gauge windows, documents, and docshells only all platforms any b
uild gc and cc logs js objects, dom objects, many other kinds of objects all platforms any b
uild leak tools for medium-size object graphs bloatview, refcount tracing and balancing objects that implement nsisupports or use moz_...
...count_{ctor,dtor} all tier 1 platforms debug b
uild (or b
uild opt with --enable-logrefcnt) leaksoup (part of tracemalloc) all objects?
...And 6 more matches
Refcount tracing and balancing
how to b
uild for refcount tracing b
uild with --enable-debug or --enable-logrefcnt.
... note: due to an issue with the sandbox on windows (bug 1345568), refcount logging currently req
uires the moz_disable_content_sandbox environment variable to be set.
...this req
uires c++ dynamic casts, so it is not supported on all platforms.
...And 6 more matches
Running NSPR tests
nspr has a test s
uite in the mozilla/nsprpub/pr/tests directory.
... by default, we don't b
uild the test programs.
... running gmake in the top-level directory (mozilla/nsprpub) only b
uilds the nspr libraries.
...And 6 more matches
Using JSS
using jss newsgroup: mozilla.dev.tech.crypto if you have already b
uilt jss, or if you are planning to use a binary release of jss, here's how to get jss working with your code.
...jss version 3.0 linked statically with nss, so it only req
uired nspr.
... jss versions 3.1 and later link dynamically with nss, so they also req
uire the nss shared libraries.
...And 6 more matches
NSS Tools certutil
-b validity-time specify a time at which a certificate is req
uired to be valid.
...these usages are described under standard x.509 v3 certificate extensions in appendix a.3 of thered hat certificate system administration g
uide.
...constraint extensions are described in standard x.509 v3 certificate extensions in appendix a.3 of thered hat certificate system administration g
uide.
...And 6 more matches
Installing Pork
prereq
uisites flex >2.5.4 (flex-old on ubuntu) bison gcc pork uses gcc to generate .i/.ii files (preprocessed c/c++) for elsa to parse.
... b
uild and install mcpp mcpp generates macro expansion comments that allow pork's elsa to undo macros, which is necessary in order to get exact position information.
...but don't give absolute paths there: mcpp won't b
uild right.
...And 6 more matches
Creating JavaScript tests
there are two large spidermonkey test s
uites: jstests (in js/src/tests) and jit-tests (in js/src/jit-test).
... in which test s
uite does your new test belong?
...only add tests to these s
uites which test jit correctness or functionality.
...And 6 more matches
64-bit Compatibility
the following types or typedefs are always 64-bit on 64-bit platforms, and 32-bit on 32-bit platforms: pointers
uintptr_t, intptr_t, ptrdiff_t, (probably) size_t jsval jsuword, jsword length of a string, though the actual length cannot exceed 30 bits js
uintptr, jsintptr, jsptrdiff, jsuptrdiff, jssize, jsuword, jsword (let's not use these, kthx) the following types are 32-bit on 32-bit platforms.
... for all intents and purposes they are also 32-bit on 64-bit platforms: intn,
uintn jsintn, js
uintn, jsbool general problems with pointers when performing bitwise operations on pointer values, make sure that both operands are 64-bit.
...for example, consider this code: #define pointer_tagbits 3 static inline
uintptr_t unmaskpointer(
uintptr_t v) { return v & ~pointer_tagbits; } the value 3 will be inverted to 0xfffffffc, then zero-extended to 0x00000000fffffffc - a subtle and nasty bug, assuming it is unintended.
...And 6 more matches
JS_InitClass
req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
...(this is the javascript eq
uivalent of public, non-static methods in c++ or java.) static_ps jspropertyspec * either null or a pointer to the first element of an array of jspropertyspecs, terminated by the null jspropertyspec.
...And 6 more matches
JS_THREADSAFE
requests in a js_threadsafe b
uild, the application must separate code that uses the jsapi from code that performs blocking i/o or time-consuming calculations.
... most jsapi functions req
uire the caller to be in a request.
... in this reference, these jsapi functions are marked with the words "req
uires request", like this: name type description cx jscontext * the context to use.
...And 6 more matches
SpiderMonkey 1.8.7
if you are running valgrind on your embedding, be sure to b
uild spidermonkey with the --enable-valgrind option to suppress superflous error messages triggered by the garbage collector.
...instead, jsvals should be converted to their c eq
uivalents with the appropriate jsval_to_* macro and then compared.
...javascript shell changes there are many new b
uilt-in functions in the javascript shell, mostly useful for testing spidermonkey.
...And 6 more matches
Animated PNG graphics
apng is a simpler alternative to mng, providing a spec s
uitable for the most common usage of animated images on the internet.
... exactly one 'fctl' chunk is req
uired for each frame.
...if the the value of the numerator is 0 the decoder should render the next frame as q
uickly as possible, though viewers may impose a reasonable lower bound.
...And 6 more matches
Embedded Dialog API
its simplest req
uirements are that the app must allow gecko to create new browser windows and new simple, empty windows.
... gecko can use the latter to pose dialogs b
uilt from xul.
...however while xul dialogs are very configurable, they will not behave and probably not look precisely like dialogs which the application b
uilds for itself, independently of gecko.
...And 6 more matches
Using the Places history service
nsiautocompletesearch: url-bar autocomplete from history from 1.9.1 (firefox3.1) on, don't use any places service on (or after) q
uit-application has been notified, since the database connection will be closed to allow the last sync, and changes will most likely be lost.
... use q
uit-application-granted instead.
...this is called by the
ui when the user deletes a history entry.
...And 6 more matches
Avoiding leaks in JavaScript XPCOM components
q
uite a lot has happened since this article was written.
... basics of memory management creating objects that are not a fixed size for the lifetime of the program (global variables) or a fixed size for the lifetime of a function (stack variables) req
uires a system for dynamic memory allocation: a system that allocates memory from a space called the heap.
... the req
uirements for such a memory allocation system are: memory should be returned to the heap when the program no longer needs it (or soon thereafter) so that the amount of memory consumed by the program does not increase.
...And 6 more matches
Preface
by the end of the book, if we've done our job, you will have learned how to b
uild a component and you will know something about the framework for these components in gecko, which is xpcom.
... this book provides a tutorial about b
uilding an xpcom component that controls browsing behavior.
... organization of the tutorial the following list provides an overview of the steps that we will take to b
uild an xpcom component called weblock, which provides site blocking functionality to gecko-based browsers.
...And 6 more matches
nsIBinaryInputStream
inherits from: nsiinputstream last changed in gecko 1.7 method overview pr
uint8 read8(); pr
uint16 read16(); pr
uint32 read32(); pr
uint64 read64(); unsigned long readarraybuffer(in pr
uint32 alength, in jsval aarraybuffer); prbool readboolean(); void readbytearray(in pr
uint32 alength, [array, size_is(alength), retval] out pr
uint8 abytes); void readbytes(in pr
uint32 alength, [size_is(alength), retval] out string a...
... pr
uint8 read8(); parameters none.
... pr
uint16 read16(); parameters none.
...And 6 more matches
nsISecurityCheckedComponent
this interface is used in mozilla by xpconnect and a handful of things that need special handing (xul controllers, the
ui for the <video> tag, etc.).
... method overview string cancallmethod(in nsiidptr iid, in wstring methodname); string cancreatewrapper(in nsiidptr iid); string cangetproperty(in nsiidptr iid, in wstring propertyname); string cansetproperty(in nsiidptr iid, in wstring propertyname); methods cancallmethod() returns a capability string indicating what permissions are req
uired to call the specified method on the given interface.
... return value the capability req
uired to call this method.
...And 6 more matches
Troubleshooting XPCOM components registration
when adding a component to a xulrunner application, change the b
uildid in application.ini.
... if your component req
uires any external libraries, you may need to read using dependent libraries in extension components make sure you are compiling against the right version.
... if you are compiling your own firefox (or xulrunner, etc.), use the artifacts from that compilation to b
uild your component.
...And 6 more matches
XPCOM ABI
while xpcom components written in a scripting language (such as javascript) can be moved across platforms (such as windows and os x) without adaptation, those written in a compiled language (such as c++) req
uire recompilation when moving to a different platform.
...to put it simply, an xpcom component b
uilt for a specific abi would only be compatible with firefox, thunderbird or other xulrunner application b
uilt for the same abi.
... amd64/emt64 series in 64-bit mode (32-bit mode is still considered x86) sparc - sparc series ia64 - itanium series {target_compiler_abi}[platforms] represents the compiler abi and may be either: msvc - microsoft visual c++ n32 - irix 6 c++ compiler gcc2 - gnu c++ compiler 2.x gcc3 - gnu c++ compiler 3.x or 4.x sunc - sun c++ compiler ibmc - ibm c++ compiler for example: firefox b
uilt with the gnu c++ compiler 4.0.0 for the intel pentium processor would have xpcom abi of x86-gcc3 the xpcom abi string can be retrieved programmatically by using the nsixulruntime interface.
...And 6 more matches
Using the Mozilla symbol server
the mozilla project runs a symbol server for trunk firefox nightly and release b
uilds on windows.
... symbols are available for at least 30 previous days worth of nightly b
uilds, and firefox releases from 2.0.0.4.
... this allows debugging of those b
uilds without forcing all users to download large debugging files.
...And 6 more matches
Plug-in Basics - Plugins
this g
uide notes platform-specific differences in coding for the ms windows, mac os x, and unix platforms.
...alternatively, you can write plug-ins that do not req
uire a window to draw into.
...the plug-in must draw its own scroll bars if it req
uires them.
...And 6 more matches
Accessibility Inspector - Firefox Developer Tools
a (very) brief g
uide to accessibility accessibility is the practice of making your websites usable by as many people as possible.
...sometimes, however, you need to use some non-semantic markup (e.g., <div>s) to b
uild a complex custom control, and the control won't have a default role that reflects its purpose.
...the check for issues men
uitems are a q
uick way to view all and only those items that have issues.
...And 6 more matches
FontFace - Web APIs
constructor fontface() constructs and returns a new fontface object, b
uilt from an external resource described by an url or from an arraybuffer.
...it is eq
uivalent to the font-family descriptor.
...it is eq
uivalent to the font-feature-settings descriptor.
...And 6 more matches
Transcoding assets for Media Source Extensions - Web APIs
this article takes you through the req
uirements and shows you a toolchain you can use to encode your assets appropriately.
... [0] (c) copyright 2008, blender foundation / www.bigbuckbunny.org / https://peach.blender.org/about/ tools req
uired when working with mse, the following tools are a must have: ffmpeg — a command-line utility for transcoding your media into the req
uired formats.
...to install, you'll need to b
uild/compile the application yourself from the provided project files/source files, depending on your os and preferences.
...And 6 more matches
Capabilities, constraints, and settings - Web APIs
the most important thing to understand is that most constraints aren't req
uirements; instead, they're requests.
... simple constraints like these, specifying a single value, are always treated as non-req
uired.
...however, if you use simple values for properties when calling mediastreamtrack.applyconstraints(), the request will always succeed, because these values will be considered a request, not a req
uirement.
...And 6 more matches
SubtleCrypto.wrapKey() - Web APIs
wrapalgo is an object specifying the algorithm to be used to encrypt the exported key, and any req
uired extra parameters: to use rsa-oaep, pass an rsaoaepparams object.
... notsupported raised when trying to use an algorithm that is either unknown or isn't s
uitable for encryption or wrapping.
... one advantage of using aes-kw over another aes mode such as aes-gcm is that aes-kw does not req
uire an initialization vector.
...And 6 more matches
TextEncoder.prototype.encodeInto() - Web APIs
the textencoder.prototype.encodeinto() method takes a usvstring to encode and a destination
uint8array to put resulting utf-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
... syntax b1 = encoder.encodeinto(string,
uint8array); parameters string is a usvstring containing the text to encode.
...
uint8array is a
uint8array object instance to place the resulting utf-8 encoded text into.
...And 6 more matches
Writing WebSocket servers - Web APIs
this is not a tutorial in any specific language, but serves as a g
uide to facilitate writing your own server.
...depending on language support, knowledge of tcp sockets may be req
uired.
... the scope of this g
uide is to present the minimum knowledge you need to write a websocket server.
...And 6 more matches
Regular expressions - JavaScript
note: if you are already familiar with the forms of a regular expression, you may also read the cheatsheet for a q
uick lookup for a specific pattern/construct.
... using special characters when the search for a match req
uires something more than a direct match, such as finding one or more b's, or finding white space, you can include special characters in the pattern.
... character classes disting
uish different types of characters.
...And 6 more matches
The "codecs" parameter in common media types - Web media technologies
this g
uide briefly examines the syntax of the media type codecs parameter and how it's used with the mime type string to provide details about the contents of audio or video media beyond simply indicating the container type.
... video/q
uicktime a video file in apple's q
uicktime format.
... as noted elsewhere, this format was once commonly used on the web but no longer is, since it req
uired a plugin to use.
...And 6 more matches
Certificate Transparency - Web security
potentially malicious certificates, such as those that violate the ca/b forum baseline req
uirements, can be detected and revoked much more q
uickly.
... background ct logs are b
uilt upon the foundation of the merkle tree data structure.
... x.509v3 certificate extension which embeds signed certificate timestamps directly into the leaf certificate a tls extension of type signed_certificate_timestamp sent during the handshake ocsp stapling (that is, the status_request tls extension) and providing a signedcertificatetimestamplist with one or more scts with the x.509 certificate extension, the included scts are decided by the iss
uing ca.
...And 6 more matches
Using custom elements - Web Components
note that custom element names req
uire a dash to be used in them (kebab-case); they can't be single words.
... optionally, an options object containing an extends property, which specifies the b
uilt-in element your element inherits from, if any (only relevant to customized b
uilt-in elements; see the definition below).
... customized b
uilt-in elements inherit from basic html elements.
...And 6 more matches
simple-prefs - Archive of obsolete content
this is used to access the preference from your add-on: console.log(req
uire("sdk/simple-prefs").prefs.mysettingname); this means that it must be a valid javascript identifier.
... optional common attributes these are attributes that all preferences may have: attribute description description this appears below the preference title in the add-ons manager
ui.
... to provide this mapping the boolint req
uires two mandatory attributes called "on" and "off", both of which are supplied as strings.
...And 5 more matches
core/heritage - Archive of obsolete content
reading or writing such code req
uires sharp eye and lot's of discipline, mainly due to code fragmentation and lots of machinery being exposed: // defining a simple class function dog(name) { // classes are for creating instances, calling them without `new` changes // behavior, which in majority cases you need to handle, so you end up // with additional boilerplate.
...this.bark() : ''; }; since sdk apis may be interacting with untrusted code an extra security measures are req
uired to guarantee that documented behavior can't be changed at runtime.
... to do that we need to freeze constructor's prototype chain to make sure functions are frozen: object.freeze(dog.prototype); object.freeze(pet.prototype); note: also, this is not q
uite enough as object.prototype stays mutable & in fact we do little bit more in sdk to address that, but it's not in the scope of this documentation.
...And 5 more matches
util/array - Archive of obsolete content
let { has } = req
uire('sdk/util/array'); let a = ['rock', 'roll', 100]; has(a, 'rock'); // true has(a, 'rush'); // false has(a, 100); // true parameters array : array the array to search.
... let { hasany } = req
uire('sdk/util/array'); let a = ['rock', 'roll', 100]; hasany(a, ['rock', 'bright', 'light']); // true hasany(a, ['rush', 'coil', 'jet']); // false parameters array : array the array to search for elements.
... let { add } = req
uire('sdk/util/array'); let a = ['alice', 'bob', 'carol']; add(a, 'dave'); // true add(a, 'dave'); // false add(a, 'alice'); // false console.log(a); // ['alice', 'bob', 'carol', 'dave'] parameters array : array the array to add the element to.
...And 5 more matches
Using third-party modules (jpm) - Archive of obsolete content
to install men
uitem you'll need to have git command.
...module developers can publish sdk modules to npm, and add-on developers can install them from npm and b
uild them into their add-ons.
...we'll use the men
uitem package to add a new menu item to firefox.
...And 5 more matches
Adding Events and Commands - Archive of obsolete content
broadcasters keeping a consistent
ui is another important aspect of extension behavior.
... then you need to identify which of your xul elements will be linked to this broadcaster, using the observes attribute: <men
uitem id="xulschoolhello-hello-menu-item" label="&xulschoolhello.hello.label;" accesskey="&xulschoolhello.helloitem.accesskey;" observes="xulschoolhello-online-broadcaster" oncommand="xulschoolchrome.browseroverlay.sayhello(event);" /> the attribute value is set to be the id of the broadcaster element, indicating that this element will observe all attribute changes that happen in the broad...
...this is the recommended way of centralizing common
ui behavior in firefox and extensions.
...And 5 more matches
The Box Model - Archive of obsolete content
a box is a generic version that you can orient as you please, but its default is horizontal orientation, so it's pretty much eq
uivalent to an hbox and it is seldom used.
...this is because this attribute is used much too often, and it would req
uire a great deal of css code to avoid using it.
...using the former allows the
ui to scale proportionately depending on font size settings, which are often changed by users with accessibility limitations.
...And 5 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
the single-page context and abstraction of data from the presentation can give your web applications new contin
uity, precision and control.
...also, on the server side, the server often has to reb
uild all of the context of the user interface with each new request.
...there are basically two steps in this process: data load: acq
uisition of information data acq
uisition can be implemented using javascript and remote procedure calls using soap-based rpc mechanism or using interfaces like xmlhttprequest (currently offered in netscape 7 and internet explorer 6).
...And 5 more matches
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
the sections below tell you how to fetch, b
uild and use the pluginhostctrl.dll .
... b
uild it it is q
uite simple to b
uild the control locate the pluginhostctrl directory: open pluginhostctrl.dsp b
uild "win32 debug" or another target open some of the test files under pluginhostctrl\tests in internet explorer to verify the control has b
uilt and registered correctly.
... a note to developers if you intend to modify this control in any way then you must also change the clsid from {dbb2de32-61f1-4f7f-beb8-a37f5bc24ee2} to something else and any other g
uids this control relies upon (iid, libids etc).
...And 5 more matches
Creating a Help Content Pack - Archive of obsolete content
this is still very much a work in progress, tho, and i need to complete the rest of it soon (where "complete" means "use what's there that's good, b
uild on the stuff that's not as good, and add other useful information as necessary".
...this attribute is req
uired.
... <rdf:description nc:panelid="toc" nc:datasources="chrome://foo/locale/help/glossary.rdf"/> </rdf:li> <rdf:li> <rdf:description nc:panelid="index" nc:datasources="chrome://foo/locale/help/glossary.rdf"/> </rdf:li> </rdf:seq> the help viewer
ui may or may not provide a panel for each of these data sources.
...And 5 more matches
Mozilla Application Framework - Archive of obsolete content
related: xulrunner:what xulrunner provides, xulrunner hall of fame the mozilla application framework: for powerful, easy to develop cross-platform applications want to b
uild applications?
... framework xul a comprehensive, cross-platform
ui toolkit with an easy-to-learn xml language for defining
ui structure, a schema for localization, and support for both native and cross-platform (using css) look and feel to make writing
uis q
uick and painless.
... necko a wicked-fast, extensible networking library with b
uilt-in support for many common protocols and a well-defined plug-in interface for custom protocol handling so you can add the protocols you need.
...And 5 more matches
New Security Model for Web Services - Archive of obsolete content
these scripts may legitimately req
uire access to external resources, but permitting them to access internal resources permits the compromise of these resources that would normally not be available to applications outside of the firewall.
... the sandbox must disting
uish and protect internal resources.
... if the sandbox is unable to disting
uish the common uri substring of the domain to be trusted from similar uris of untrusted domains, then it could allow a script loaded from an indisting
uishable domain to exploit firewall-protected resources.
...And 5 more matches
A XUL Bestiary - Archive of obsolete content
in the example above, the chrome is simply a skin file to be loaded into the xul file, but the chrome can also be used to load whole chromes, as when a <men
uitem> in one window brings up a new chrome: <men
uitem value="mozilla help" oncommand="window.opendialog('chrome://help/content/help.xul', '_blank', 'chrome,all,dialog=no')" /> in this example, the chrome url is being used to point to a chrome within the package hierarchy of the mozilla application.
...just as html is reflected in the dom as nodes like link, layer, and img, xul is reflected in the application object model in the hierarchy of xul widgets: browser, menu, men
uitem, and so on.
...this section describes xul, xptoolkit, and xpfe, which are in some respects synonymous and in others q
uite different.
...And 5 more matches
autocompletesearch - Archive of obsolete content
« xul reference home autocompletesearch new in thunderbird 2req
uires seamonkey 1.1 type: space-separated list of values a space-separated list of search component names, each of which implements the nsiautocompletesearch interface.
... search-autocomplete req
uires seamonkey 2.1 the user's default search engine's suggestions are searched.
... places-tag-autocomplete req
uires seamonkey 2.1 the user's places tags are searched.
...And 5 more matches
Additional Navigation - Archive of obsolete content
been evaluated: (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace.jpg) (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/canal.jpg) (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/obselisk.jpg) when evaluating the triple, the template b
uilder will iterate over the three potential results found so far.
...since there are no variables to fill into the triple, the b
uilder will just confirm that such a triple exists in the datasource.
...another thing that you cannot have is a triple where both variables would be unknown as in the following: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?category" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> </query> in this case when the template b
uilder gets to the triple, neither the ?category nor the ?title variables can be filled in so the b
uilder doesn't know what to generate.
...And 5 more matches
Accesskey display rules - Archive of obsolete content
however, in some locales, e.g., japanese localized b
uild, its most
ui labels don't have alphabets but alphabets are used to accesskey.
... for coherence of the labels on such localized b
uilds, the accesskey text is always appended even if the labels have their accesskey characters.
... e.g., when an accesskey of "ok" is 'o' and an accesskey of "キャンセル" (means "cancel") is 'c', the labels will be "ok(o)" and "キャンセル(c)" on japanese localized b
uild.
...And 5 more matches
Localization - Archive of obsolete content
entities many applications are b
uilt such that translating the interface into a different language is as simple as possible.
... xul <men
uitem label="&undo.label;" accesskey="&undo.key;"/> dtd <!entity undo.label "undo"> <!entity undo.key "u"> the example above uses two entities, one for the label on the undo menu item and the second for the access key.
...dfile.css" type="text/css"?> <!doctype window system "chrome://findfile/locale/findfile.dtd"> <window id="findfile-window" title="&findwindow.title;" persist="screenx screeny width height" orient="horizontal" onload="initsearchlist()" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="findfile.js"/> <popupset> <menupopup id="editpopup"> <men
uitem label="&cutcmd.label;" accesskey="&cutcmd.accesskey;"/> <men
uitem label="©cmd.label;" accesskey="©cmd.accesskey;"/> <men
uitem label="&pastecmd.label;" accesskey="&pastecmd.accesskey;" disabled="true"/> </menupopup> </popupset> <keyset> <key id="cut_cmd" modifiers="accel" key="&cutcmd.commandkey;"/> <key id="copy_cmd" modifiers="accel" key="©cmd.commandkey;"/> ...
...And 5 more matches
Trees - Archive of obsolete content
an advantage of using a tree view is that it allows the view to store the data in a manner which is more s
uitable for the data, or to load the data on demand as rows are displayed.
...fortunately, xul provides a couple of b
uilt-in view implementations which do most of the hard work for you.
... for most trees, especially when you first start to use trees, you will use one of these b
uilt-in types.
...And 5 more matches
menu - Archive of obsolete content
erties accessibletype, accesskey, command, control, crop, disabled, image, itemcount, label, labelelement, menupopup, open, parentcontainer, selected, tabindex, value methods appenditem, getindexofitem, getitematindex, insertitemat, removeitemat style classes menu-iconic example <menubar id="sample-menubar"> <menu id="file-menu" label="file"> <menupopup id="file-popup"> <men
uitem label="new"/> <men
uitem label="open"/> <men
uitem label="save"/> <menuseparator/> <men
uitem label="exit"/> </menupopup> </menu> <menu id="edit-menu" label="edit"> <menupopup id="edit-popup"> <men
uitem label="undo"/> <men
uitem label="redo"/> </menupopup> </menu> </menubar> attributes acceltext type: string text that...
...for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
... visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...And 5 more matches
Using LDAP XPCOM with XULRunner - Archive of obsolete content
by default, xulrunner is b
uilt without ldap xpcom support.
...in any case, you will have to b
uild ldap xpcom, by adding --enable-ldap b
uild option.
... see the b
uild_documentation for more information about how to b
uild xulrunner.
...And 5 more matches
Windows and menus in XULRunner - Archive of obsolete content
« previousnext » our quest to b
uild a basic desktop application using xulrunner continues.
... last time i installed xulrunner and b
uilt a very simple, bare-bones test application.
... menus and toolbars most desktop applications are complex enough to req
uire some sort of menu and/or toolbar to structure the application’s available commands.
...And 5 more matches
The First Install Problem - Archive of obsolete content
this document proposes a meta-information model in the win32 registry similar to the one used by microsoft's hkey_classes_root\clsid\ where a new activex control (ocx) on the system presents its u
uid as a registry key (identifying the activex control) as well as information about where to find the ocx (e.g.
...for mozilla-based browsers, this system would be on a per-module basis, and instead of a u
uid, we'll use a uri nomenclature that gives us the desired uniqueness.
...thus, some installers may need to write to the hkey_current_user key; this doesn't req
uire administrator privileges.
...And 5 more matches
TCP/IP Security - Archive of obsolete content
while this provides a very high degree of control and flexibility over the application’s security, it may req
uire a large resource investment to add and configure controls properly for each application.
... another good source of information is nist sp 800-52, g
uidelines on the selection and use of transport layer security, available from https://csrc.nist.gov/publications/nistpubs/.) the use of tls typically req
uires each application to support tls; however, unlike application layer controls, which typically involve extensive customization of the application, transport layer controls such as tls are much less intrusive because they do not need to understa...
... although using tls may req
uire modifying some applications, tls is a well-tested protocol that has several implementations that have been added to many applications, so it is a relatively low-risk option compared to adding protection at the application layer.
...And 5 more matches
Theme changes in Firefox 2 - Archive of obsolete content
note: we could use an article called updating themes for firefox 2 that would serve as a how-to g
uide for updating themes.
... browser changes req
uiring theme updates there are a number of changed and deleted files in the browser that may req
uire you to make changes to your theme.
... feeds/addfeedreader.xul feeds/addfeedreader.css new file that presents
ui for adding a new feed reader.
...And 5 more matches
Unconventional controls - Game development
modern smart tvs can handle html5 games, because they have a b
uilt-in browser that can be used as a gaming platform.
...interestingly enough, the first captain rogers game (asteroid belt of sirius) was optimized for low-end, small-screen, cheap smartphones running firefox os, so you can see the difference three years can make — you can read the whole story in our b
uilding games for firefox os tv hacks post.
...you can also check out the tutorial about using leap motion plugin for kiwi.js, or the case study of b
uilding a web game with leap motion and pixi.js.
...And 5 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
previous overview: client-side javascript frameworks next now that we have our markup and styles ready we can start developing the req
uired features for our svelte to-do list app.
... prereq
uisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line.
... you'll need a terminal with node + npm installed to compile and b
uild your app.
...And 5 more matches
Introduction to cross browser testing - Learn web development
overview: cross browser testing next this article starts the module off by providing an overview of the topic of (cross) browser testing, answering questions such as "what is cross browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" prereq
uisites: familiarity with the core html, css, and javascript languages.
... the workflow for testing and bug fixes on a project can be broken down into roughly the following four phases (this is only very rough — different people may do things q
uite differently to this): initial planning > development > testing/discovery > fixes/iteration steps 2–4 will tend to be repeated as many times as necessary to get all of the implementation done.
... initial planning in the initial planning phase, you will probably have several planning meetings with the site owner/client (this might be your boss, or someone from an external company you are b
uilding a web site for), in which you determine exactly what the web site should be — what content and functionality should it have, what should it look like, etc.
...And 5 more matches
Git and GitHub - Learn web development
get started prereq
uisites to use git and github, you need: a desktop computer with git installed on it (see the git downloads page).
...depending on how you like to work, you could use a git g
ui client (we'd recommend github desktop, sourcetree or git kraken) or just stick to using a terminal window.
... in fact, it is probably useful for you to get to know at least the basics of git terminal commands, even if you intend to use a g
ui.
...And 5 more matches
CSUN Firefox Materials
it's a q
uick download, occupies very little disk space, and has a clean, no-nonsense interface." - pc magazine firefox 1.5 is a fast, free, standards compliant web browser which is rapidly gaining recognition for its fresh, streamlined approach to browsing the web.
...jaws support is q
uickly catching up as well.
..." - alan cantor, cantor access consulting (http://www.cantoraccess.com) firefox includes keyboard access to all of its amazing features: find as you type allows for q
uick navigation to links and text searching without opening a separate dialog -- this allows more convenient use by screen magnification users because there is a single point of regard for the search.
...And 5 more matches
Index
3 b
uilding firefox with rust code b
uild documentation, gecko, b
uild, rust in may 2015 the rust programming language reached its 1.0 stability milestone, and various experiments with writing parts of gecko in rust began.
...it became a req
uirement for b
uilding gecko in february 2017 with firefox 54.
... 10 firefox
ui considerations for web developers activity stream, firefox, icons, mozilla, new tab, newtab,
ui, web, web development, favicon there are a number of places within the firefox user interface where web sites are listed for the user to choose a destination to visit or a site to manage in some way.
...And 5 more matches
Addon
the interface can represent many different kinds of add-ons and as such, some of the methods and properties are considered "req
uired" and others "optional," which means that the optional methods or property may not exist on addon instances for some types of add-ons.
... overview of req
uired methods void iscompatiblewith(in string appversion, in string platformversion) void findupdates(in updatelistener listener, in integer reason, in string appversion, in string platformversion) overview of optional methods void uninstall() void canceluninstall() boolean hasresource(in string path) nsiuri getresourceuri(in string path) void getdatadirectory(in datadirectorycallback callback) req
uired properties attribute type description appdisabled read only boolean true if this add-on cannot be used in the application based on version compatibility, de...
...the user is provided a
ui for this in the add-ons manager and it's the add-on provider's responsibility to remember its selection.
...And 5 more matches
Bootstrapping a new locale
er/chrome/browser to see what is contained in "browser" type $ ls and, you should see the following output from your terminal: aboutcerterror.dtd pageinfo.dtd aboutdialog.dtd pageinfo.properties aboutprivatebrowsing.dtd pagereportfirsttime.dtd aboutrobots.dtd places aboutsessionrestore.dtd preferences aboutsupport.dtd q
uitdialog.properties basemenuoverlay.dtd safemode.dtd browser.dtd safebrowsing browser.properties sanitize.dtd credits.dtd search.properties enginemanager.dtd searchbar.dtd enginemanager.properties setdesktopbackground.dtd feeds shellservice.properties history sidebar migration ...
... recommended order of localization for recommended order of localization, refer to the localization "phase list" which provides a very rough g
uide on where to start and in what order to proceed through translation.
... set up for b
uilding the next step is to create a .mozconfig file with the compile options for the localized b
uild of firefox, and to set up the object directory for the localized b
uild.
...And 5 more matches
Investigating leaks using DMD heap scan mode
prereq
uisites a debug dmd b
uild of firefox.
...this should probably be an optimized b
uild.
... non-optimized dmd b
uilds will generate better stack traces, but they can be so slow as to be useless.
...And 5 more matches
Performance
documentation reporting a performance problem a user friendly g
uide to reporting a performance problem.
... a development environment is not req
uired.
... performance best practices in extensions a performance "best practices" g
uide for extension developers.
...And 5 more matches
Introduction to NSPR
each thread has a b
uilt-in per-thread error number and error string that are updated when nspr operations fail.
...this req
uirement implies that when a thread first enters the monitor, an evaluation of the invariant expression must yield a true.
...any modification of v1 or v2 req
uires modification of sum.
...And 5 more matches
NSS_3.12.1_release_notes.html
nss 3.12.1 req
uires nspr 4.7.1.
... see the documentation section for the b
uild instructions.
...both debug and optimized b
uilds are provided.
...And 5 more matches
NSS 3.52 release notes
nss 3.52 req
uires nspr 4.25 or newer.
... bug 1630458 - fix problem of gyp msvc b
uilds not producing debug symbol files.
... bug 1629663 - add ikev1 q
uick mode kdf.
...And 5 more matches
nss tech note6
nss .chk files for the fips 140 mode nss technical note: 6 in nss 3.8, we added checksum files req
uired for the nss softoken to operate in fips 140 mode.
...when in fips 140 mode, the softoken is req
uired to compute its checksum and compare it with the value in libsoftokn3.chk/softokn3.chk.
... multiply operations faster in floating point, with a corresponding libfreebl_32fpu_3.chk libfreebl_32int_3.sl for other pa-risc cpus, with a corresponding libfreebl_32int_3.chk on the 64-bit hp-ux pa-risc architecture, there is only one freebl library, called libfreebl3.sl, with a corresponding libfreebl3.chk applications should always use nss binaries that are the output of the regular nss b
uild process.
...And 5 more matches
troubleshoot.html
troubleshooting nss and jss b
uilds newsgroup: mozilla.dev.tech.crypto this page summarizes information on troubleshooting the nss and jss b
uild and test systems, including known problems and configuration suggestions.
... b
uilding nss having /usr/ucb/bin in the path before /usr/ccs/bin breaks the b
uild on 64-bit solaris.
... the 64-bit b
uilds don't support gcc.
...And 5 more matches
NSS Tools ssltap
availability this tool is known to b
uild on solaris 2.5.1 (sunos 5.5.1) and windows nt 4.0.
... syntax to run the ssl debugging tool, type this command in a command shell: ssltap [-vhfsxl] [-p port] hostname:port options the command does not req
uire any options other than hostname:port, but you normally use them to control the connection interception and output.
...although you can run the tool at its most basic by iss
uing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful.
...And 5 more matches
GCIntegration - SpiderMonkey Redirect 1
overview before digging too deep, here are some q
uick rules of thumb for how to write code that will work smoothly with the gc regardless of changes that happen in the future.
... write barriers all the schemes for preventing this sort of thing req
uire write barriers.
...initializing a pointer never req
uires a write barrier because there was nothing being destroyed that might have part of the initial snapshot.
...And 5 more matches
JS_ValueToECMAInt32
syntax jsbool js_valuetoecmaint32(jscontext *cx, jsval v, int32 *ip); jsbool js_valuetoecma
uint32(jscontext *cx, jsval v,
uint32 *ip); jsbool js_valueto
uint16(jscontext *cx, jsval v,
uint16 *ip); name type description cx jscontext * the context in which to perform the conversion.
... req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
...And 5 more matches
jsint
js
uint; typedef ...
...
uintn; // following types are still provides in js/public/legacyinttypes.h, // but should not use them.
...
uint8; typedef ...
...And 5 more matches
Using XPCOM Utilities to Make Things Easier
the module macros include one set of macros that define the exported nsgetmodule entry point, the req
uired nsimodule implementation code and another that creates a generic factory for your implementation class.
...the four req
uired parts[other-parts] of the structure contain the following information: a human readable class name the class id (cid) the contract id (an optional but recommended argument) a constructor for the given object static const nsmodulecomponentinfo components[] = { { "pretty class name", cid, contract_id, constructor }, // ...
... these three entries constitute the req
uired parameters for the registerfactorylocation method we looked at in the prior chapter.
...And 5 more matches
imgIEncoder
1.0 66 introduced gecko 1.8 inherits from: nsiasyncinputstream last changed in gecko 1.9 (firefox 3) method overview void addimageframe( [array, size_is(length), const] in pr
uint8 data, in unsigned long length, in pr
uint32 width, in pr
uint32 height, in pr
uint32 stride, in pr
uint32 frameformat, in astring frameoptions); void encodeclipboardimage(in nsiclipboardimage aclipboardimage, out nsifile aimagefile); obsolete since gecko 1.9 void endimageencode(); void initfromdata([array, size_is(length), const] in pr
uint8 data, in unsigned long length, in pr
uint32 width, in pr
uint32 height, in pr
uint32 stride, in pr
uint32 inputformat, in astring outputoptions); ...
...void startimageencode(in pr
uint32 width, in pr
uint32 height, in pr
uint32 inputformat, in astring outputoptions); constants possible values for input format (note that not all image formats support saving alpha channels): constant value description input_format_rgb 0 input is rgb each pixel is represented by three bytes: r, g, and b (in that order, regardless of host endianness) input_format_rgba 1 input is rgb each pixel is represented by four bytes: r, g, and b (in that order, regardless of host endianness).
..."no" and "none" are eq
uivalent.
...And 5 more matches
Component; nsIPrefBranch
method overview void addobserver(in string adomain, in nsiobserver aobserver, in boolean aholdweak); void clearuserpref(in string aprefname); void deletebranch(in string astartingat); boolean getboolpref(in string aprefname, req
uires gecko 54 [optional] in boolean adefaultvalue); string getcharpref(in string aprefname,req
uires gecko 54 [optional] in string adefaultvalue); req
uires gecko 58 utf8tring getstringpref(in string aprefname, [optional] in utf8string adefaultvalue); void getchildlist(in string astartingat, [optional] out unsigned long acount, [array, size_is(acount), retval] out string ac...
...hildarray); void getcomplexvalue(in string aprefname, in nsiidref atype, [iid_is(atype), retval] out nsqiresult avalue); long getintpref(in string aprefname,req
uires gecko 54 [optional] in long adefaultvalue); long getpreftype(in string aprefname); void lockpref(in string aprefname); boolean prefhasuservalue(in string aprefname); boolean prefislocked(in string aprefname); void removeobserver(in string adomain, in nsiobserver aobserver); void resetbranch(in string astartingat); void setboolpref(in string aprefname, in long avalue); void setcharpref(in string aprefname, in string avalue); req
uires gecko 58 void setstringpref(in string aprefname, in utf8string avalue); void setcomplexval...
...see nsiobserver and here is a q
uick snippet: var myobserver = { observe: function(asubject, atopic, adata) { //do stuff here } } aholdweak true holds a weak reference to aobserver.
...And 5 more matches
nsIScriptError
method overview void init(in wstring message, in wstring sourcename, in wstring sourceline, in pr
uint32 linenumber, in pr
uint32 columnnumber, in pr
uint32 flags, in string category); void initwithwindowid(in wstring message, in wstring sourcename, in wstring sourceline, in pr
uint32 linenumber, in pr
uint32 columnnumber, in pr
uint32 flags, in string category, in unsigned long long innerwindowid); autf8string tostring(); attributes attribute type description...
... columnnumber pr
uint32 the column number where the error occurred.
... flags pr
uint32 flags; see flag constants for a list.
...And 5 more matches
Address Book examples
use the address book manager to get an nsisimpleenumerator, then progress through the enumerator, looking for nsiabitem, nsiabcollection or nsiabdirectory interfaces as you req
uire.
... formulate a boolean search string (see nsiabcard for b
uilt-in property names): var searchquery = "(or(primaryemail,bw,@v)(nickname,bw,@v)(and(ismaillist,=,true)(notes,bw,@v)))"; searchquery = searchquery.replace(/@v/g, encodeuricomponent("mystr") the search queries use lisp syntax with operators enumerated in nsabquerystringtoexpression.cpp.
...use searchresult as req
uired.
...And 5 more matches
Add to iPhoto
these are declared near the top of the code: const osstatus = ctypes.int32_t; const cfindex = ctypes.long; const optionbits = ctypes.
uint32_t; osstatus used to represent the status code resulting from an operation.
...this is done using the js-ctypes library object's declare() method, just like importing a function: this.kcftypearraycallbacks = this.lib.declare("kcftypearraycallbacks", this.cfarraycallbacks); note: for the record, this is the part that req
uires a nightly b
uild of firefox 3.7a5pre dated april 16, 2010 or later; this capability was introduced in that b
uild.
... in c, the fsref is declared thusly: struct fsref {
uint8 hidden[80]; /* private to file manager; •• need symbolic constant */ }; typedef struct fsref fsref; we declare it using js-ctypes like this: this.struct_fsref = new ctypes.structtype("fsref", [ {"hidden": ctypes.char.array(80)}]); the carbon library init() and shutdown() routines are otherwise similar to how we do things...
...And 5 more matches
Standard OS Libraries
gtk+ b
uilds over x11.
...gtk+ is the toolkit to b
uild apps, gdk is more low-level.
...wms on ubuntu work a little differently but we'll revisit this topic later in this article (did you know they have a *special* firefox b
uild for ubuntu?).
...And 5 more matches
Working with ArrayBuffers
the js-ctypes eq
uivalent is a ctypes.
uint8_t.array(###) (ctypes.unsigned_char are also ctypes.
uint8_t).
... this feature is based on the following work: //github.com/realityripple/uxp/blob/master/js/src/ctypes/ctypes.cpp#3080 //github.com/realityripple/uxp/blob/master/js/src/vm/arraybufferobject.cpp#1301 example 1 - image data the following example illustrates how to transfer a byte array pointed by ctypes.
uint8_t.ptr to imagedata of canvas.
... this example is based on the fact that the imagedata returned from canvasrenderingcontext2d.getimagedata is a
uint8clampedarray view for an arraybuffer.
...And 5 more matches
Applying styles and colors - Web APIs
function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); for (var i = 0; i < 10; i++) { ctx.linewidth = 1 + i; ctx.beginpath(); ctx.moveto(5 + i * 14, 5); ctx.lineto(5 + i * 14, 140); ctx.stroke(); } } <canvas id="canvas" width="150" height="150"></canvas> draw(); screenshotlive sample obtaining crisp lines req
uires understanding how paths are stroked.
...i also added two g
uides to see the exact differences between the three.
... each of these lines starts and ends exactly on these g
uides.
...And 5 more matches
SubtleCrypto.importKey() - Web APIs
typeerror raised when trying to use an invalid format or if the keydata is not s
uited for that format.
... see the examples section for more concrete g
uidance.
...a pem-encoded subjectpublickeyinfo looks like this: -----begin public key----- miibijanbgkqhkig9w0baqefaaocaq8amiibcgkcaqea3j+hgshunc7f6xzvebd0 r3m5jny+/kabijvu8iu1eral3osi38vgimzjdbdorfxvznnzl+sxahwxiv5bhixl cq6qhwysdgh6oqgkiwialra/wnh4uhxj1or/iyakjhrr/kghutjyvcjzvaqadpjw 2g+syd1
ui0b6kjov2cruwipwpff8hbfvwv8q9yc2yd5hcnykvl0iaiyn+sdak/rv 8dc5eilzci4efucbyg4c9o88qz7bs14dxsfapty8p/twoihvvjladf743lgm/jlq cdpubua3hlszuhkm3bbskd7q9ngkjv3+ybyo4/fl+fkyra8j9ypa2n0iw53lfb3b gqidaqab -----end public key----- just as with pkcs #8, to get this into a format you can give to importkey() you need to do two things: base64-decode the part between header and footer, using window.atob().
...And 5 more matches
WebGLRenderingContext.texImage2D() - Web APIs
�� rgb565 rgb 5 6 5 ● ● rgba4 rgba 4 4 4 4 ● ● rgb5_a1 rgba 5 5 5 1 ● ● rgba8 rgba 8 8 8 8 ● ● rgba8_snorm rgba s8 s8 s8 s8 ● rgb10_a2 rgba 10 10 10 2 ● ● rgb10_a2
ui rgba
ui10
ui10
ui10
ui2 ● srgb8 rgb 8 8 8 ● srgb8_alpha8 rgba 8 8 8 8 ● ● r16f red f16 ● rg16f rg f16 f16 ● rgb16f rgb f16 f16 f16 ● rgba16f rgba f16 f16 f16...
...2 rg32f rg f32 f32 rgb32f rgb f32 f32 f32 rgba32f rgba f32 f32 f32 f32 r11f_g11f_b10f rgb f11 f11 f10 ● rgb9_e5 rgb 9 9 9 5 ● r8i red i8 ● r8
ui red
ui8 ● r16i red i16 ● r16
ui red
ui16 ● r32i red i32 ● r32
ui red
ui32 ● rg8i rg i8 i8 ● rg8
ui rg
ui8
ui8 ● rg16i rg ...
... i16 i16 ● rg16
ui rg
ui16
ui16 ● rg32i rg i32 i32 ● rg32
ui rg
ui32
ui32 ● rgb8i rgb i8 i8 i8 rgb8
ui rgb
ui8
ui8
ui8 rgb16i rgb i16 i16 i16 rgb16
ui rgb
ui16
ui16
ui16 rgb32i rgb i32 i32 i32 rgb32
ui rgb
ui32
ui32
ui32 rgba8i rgba i8 i8 i8 i8 ● rgba8
ui rgba
ui8
ui8
ui8
ui8 ● rgba16i rgba i16 i16 i16 i16 ● rgba16
ui r...
...And 5 more matches
Fundamentals of WebXR - Web APIs
in this g
uide, we provide a fundamental overview of what webxr is and how it works, as well as providing a foundation for what you'll need to know before you even begin to learn to develop augmented reality and virtual reality experiences for the web.
...as browser developers b
uilt support for webvr and allowed developers to experiment, it became clear that in order to finish an api for virtual environments on the web, it would make more sense to start a new specification than to try to "fix" webvr.
... <<<--- replace image with an svg for future translation work and consistency --->>> some more advanced headsets provide at least minimal support for translational movement detection, but to capture more substantial movement through the space, external sensors are usually req
uired, such as cameras (either using visible light or infrared).
...And 5 more matches
XSL Transformations in Mozilla FAQ - Web APIs
disabling output escaping req
uires us to add a parsing step to our output generation, which we don't.
...sadly, current b
uilds don't error, but just give unexpected results, like crashes (bug 202765).
...having xslt stylesheet specific to particular media would req
uire to retransform the original xml source, which counteracts the expectations of the user.
...And 5 more matches
ARIA - Accessibility
for instance, native elements have b
uilt-in keyboard accessibility, roles and states.
... however, if you choose to use aria, you are responsible for mimicking (the eq
uivalent) browser behaviour in script.
... here's the markup for a progress bar widget: <div id="percent-loaded" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"> </div> this progress bar is b
uilt using a <div>, which has no meaning.
...And 5 more matches
Web Accessibility: Understanding Colors and Luminance - Accessibility
understaning color, luminance, and saturation is important in meeting wcag 2 accessibility g
uidelines in terms of ensuring enough color contrast for sighted users with color blindness or reduced vision and preventing seizures and other physical reactions in people with vestibular disorders.
... it is the luminance contrast that enable the color-blind to disting
uish dark against light.
... there's movement towards adopting the use of hsl color values rather than rgb values is css color module 3 (see section 4.2.4), the rationale being that rgb is hardware-oriented, reflecting the use of crts, and that rgb is non-int
uitive.
...And 5 more matches
MIME types (IANA media types) - HTTP
discrete types the discrete types currently registered with the iana are: applicationlist at iana any kind of binary data that doesn't fall explicitly into one of the other types; either data that will be executed or interpreted in some way or binary data that req
uires a specific application or category of application to use.
... .pjpeg, .pjp chrome, edge, firefox, internet explorer, opera, safari png portable network graphics image/png .png chrome, edge, firefox, internet explorer, opera, safari svg scalable vector graphics image/svg+xml .svg chrome, edge, firefox, internet explorer, opera, safari tiff tagged image file format image/tiff .tif, .tiff none b
uilt-in; add-ons req
uired webp web picture format image/webp .webp chrome, edge, firefox, opera the abbreviation for each format links to a longer description of the format, its capabilities, and detailed browser compatibility information; including which versions introduced support and specific special features that may have been introduced later.
... our media container formats g
uide provides a list of the file types that are commonly supported by web browsers, including information about what their special use cases may be, any drawbacks they have, and compatibility information, along with other details.
...And 5 more matches
CSS Houdini
houdini's css typed om is a css object model with types and methods, exposing values as javascript objects making for more int
uitive css manipulation than previous string based htmlelement.style manipulations.
...with worklets, you can create modular css, req
uiring a single line of javascript to import configureable components: no pre-processors, post-processors or javascript frameworks needed.
... the houdini apis below you can find links to the main reference pages covering the apis that fall under the houdini umbrella, along with links to g
uides to help you if you need g
uidance in learning how to use them.
...And 5 more matches
Indexed collections - JavaScript
creating an array the following statements create eq
uivalent arrays: let arr = new array(element0, element1, ..., elementn) let arr = array(element0, element1, ..., elementn) let arr = [element0, element1, ..., elementn] element0, element1, ..., elementn is a list of values for the array's elements.
... // // this is eq
uivalent to: let arr = [] arr.length = 42 calling array(n) results in a rangeerror, if n is a non-whole number whose fractional portion is non-zero.
...ength - 1]) return -1; if (a[a.length - 1] > b[b.length - 1]) return 1; if (a[a.length - 1] == b[b.length - 1]) return 0; } myarray.sort(sortfn) // sorts the array so that myarray = ["wind","fire","rain"] if a is less than b by the sorting system, return -1 (or any negative number) if a is greater than b by the sorting system, return 1 (or any positive number) if a and b are considered eq
uivalent, return 0.
...And 5 more matches
JavaScript modules - JavaScript
« previous this g
uide gives you all you need to get started with javascript module syntax.
...node.js has had this ability for a long time, and there are a number of javascript libraries and frameworks that enable module usage (for example, other commonjs and amd-based module systems like req
uirejs, and more recently webpack and babel).
... basic example structure in our first example (see basic-modules) we have a file structure as follows: index.html main.js modules/ canvas.js square.js note: all of the examples in this g
uide have basically the same structure; the above should start getting pretty familiar.
...And 5 more matches
Optional chaining (?.) - JavaScript
chaining operator, except that instead of causing an error if a reference is nullish (null or undefined), the expression short-circ
uits with a return value of undefined.
...it can also be helpful while exploring the content of an object when there's no known guarantee as to which properties are req
uired.
...without optional chaining, looking up a deeply-nested subproperty req
uires validating the references in between, such as: let nestedprop = obj.first && obj.first.second; the value of obj.first is confirmed to be non-null (and non-undefined) before then accessing the value of obj.first.second.
...And 5 more matches
JavaScript typed arrays - JavaScript
however, as web applications become more and more powerful, adding features such as audio and video manipulation, access to raw data using websockets, and so forth, it has become clear that there are times when it would be helpful for javascript code to be able to q
uickly and easily manipulate raw binary data.
... typed array views typed array views have self-descriptive names and provide views for all the usual numeric types like int8,
uint32, float64 and so forth.
... there is one special typed array view, the
uint8clampedarray.
...And 5 more matches
Understanding WebAssembly text format - WebAssembly
note: this is potentially overkill if you are a web developer who just wants to load a wasm module into a page and use it in your code (see using the webassembly javascript api), but it is more useful if for example, you want to write wasm modules to optimize the performance of your javascript library, or b
uild your own webassembly compiler.
... this is functionally eq
uivalent to including a separate function statement outside the function, elsewhere in the module in the same manner as we did before, e.g.: (export "getanswerplus1" (func $functionname)) the javascript code to call our above module looks like so: webassembly.instantiatestreaming(fetch('call.wasm')) .then(obj => { console.log(obj.instance.exports.getanswerplus1()); // "43" }); importing ...
...webassembly doesn’t actually have any b
uilt-in knowledge of javascript, but it does have a general way to import functions that can accept either javascript or wasm functions.
...And 5 more matches
Communicating using "port" - Archive of obsolete content
here's a simple add-on that sends a message to a content script using port: var tabs = req
uire("sdk/tabs"); var alertcontentscript = "self.port.on('alert', function(message) {" + " window.alert(message);" + "})"; tabs.on("ready", function(tab) { worker = tab.attach({ contentscript: alertcontentscript }); worker.port.emit("alert", "message from the add-on"); }); tabs.open("http://www.mozilla.org"); in total, the port object...
...thus, to emit a message from a content script: self.port.emit("mycontentscriptmessage", mycontentscriptmessagepayload); to receive a message from the add-on code: self.port.on("myaddonmessage", function(myaddonmessagepayload) { // handle the message }); compare this to the technique used to receive b
uilt-in messages in the content script.
... however, the worker is not exposed to add-on code in q
uite the same way in all modules.
...And 4 more matches
Working with Events - Archive of obsolete content
we talk about content scripts in more detail in the working with content scripts g
uide.
... so there are two main ways you will interact with the eventemitter framework: listening to b
uilt-in events emitted by objects in the sdk, such as tabs opening, pages loading, mouse clicks sending and receiving user-defined events between content scripts and add-on code this g
uide only covers the first of these; the second is explained in the working with content scripts g
uide.
... for example, the following add-on registers a listener with the tabs module to listen for the ready event, and logs a string to the console reporting the event: var tabs = req
uire("sdk/tabs"); tabs.on("ready", function () { console.log("tab loaded"); }); it is not possible to enumerate the set of listeners for a given event.
...And 4 more matches
page-worker - Archive of obsolete content
this can point to a remote file: pageworker = req
uire("sdk/page-worker").page({ contentscript: "console.log(document.body.innerhtml);", contenturl: "http://en.wikipedia.org/wiki/internet" }); it can also point to an html file which you've packaged with your add-on.
... to do this, save the file in your add-on's data directory and create the url using the data.url() method of the self module: pageworker = req
uire("sdk/page-worker").page({ contentscript: "console.log(document.body.innerhtml);", contenturl: req
uire("sdk/self").data.url("myfile.html") }); from firefox 34, you can use "./myfile.html" as an alias for self.data.url("myfile.html").
... so you can rewrite the above code like this: pageworker = req
uire("sdk/page-worker").page({ contentscript: "console.log(document.body.innerhtml);", contenturl: "./myfile.html" }); you can load a new page by setting the page worker's contenturl property.
...And 4 more matches
preferences/service - Archive of obsolete content
example: var name = "extensions.checkcompatibility.nightly"; req
uire("sdk/preferences/service").set(name, false); get(name, defaultvalue) gets the application preference name.
... example: var name = "extensions.checkcompatibility.nightly"; var nightlycompatchk = req
uire("sdk/preferences/service").get(name); has(name) parameters name : string preference name.
... defaultvalue example: var name = "extensions.checkcompatibility.nightly"; if (req
uire("sdk/preferences/service").has(name)) { // ...
...And 4 more matches
test/assert - Archive of obsolete content
for example: var a = 1; exports["test value of a"] = function(assert) { assert.ok(a == 1, "test that a is 1"); } req
uire("sdk/test").run(exports); globals constructors assert(logger) create a new assert object.
... assert.ok(a == 1, "test that a is equal to one"); this is eq
uivalent to: assert.equal(a == 1, true, "test that a is equal to one"); parameters guard : expression the expression to evaluate.
...deep equality is defined in the commonjs specification for assert, item 7, which is quoted here: all identical values are eq
uivalent, as determined by ===.
...And 4 more matches
Getting Started (jpm) - Archive of obsolete content
prereq
uisites to create add-ons for firefox using the sdk, you'll need: firefox version 38 or later.
...open it and add the following code: var buttons = req
uire('sdk/
ui/button/action'); var tabs = req
uire("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("http://www.mozilla.org/"); } note that "entry point" defaults to "index.js" in jpm, me...
...for example, we could change the page that gets loaded: var buttons = req
uire('sdk/
ui/button/action'); var tabs = req
uire("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://developer.mozilla.org/"); } at the command prompt, execute jpm run again.
...And 4 more matches
Getting started (cfx) - Archive of obsolete content
see: getting started with jpm cfx to jpm prereq
uisites to create add-ons for firefox using the sdk, you'll first need to follow the instructions to install and activate the sdk.
...open it and add the following code: var buttons = req
uire('sdk/
ui/button/action'); var tabs = req
uire("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://www.mozilla.org/"); } save the file.
...for example, we could change the page that gets loaded: var buttons = req
uire('sdk/
ui/button/action'); var tabs = req
uire("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://developer.mozilla.org/"); } at the command prompt, execute cfx run again.
...And 4 more matches
Introduction - Archive of obsolete content
xul school was created by appcoast (formerly glaxstar), one of the few companies dedicated to b
uilding high-quality firefox extensions.
...you'll learn how to q
uickly do the most common tasks in extension development, comparing several different approaches to solve them.
...you can think of it as a q
uick g
uide to the expansive world that is the mozilla platform.
...And 4 more matches
Making a Mozilla installation modifiable - Archive of obsolete content
although jar archives are binary files, mozilla's
ui is not compiled into machine code; mozilla instead b
uilds its
ui from the non-compiled files in the archive each time it starts up.
... because of this, we can modify the files in the archive and see our changes to the
ui merely by restarting the application.
... this makes modifying mozilla's
ui much easier than for many other applications.
...And 4 more matches
DTrace - Archive of obsolete content
the dtrace probes currently b
uilt into the codebase may be enabled by default in the future, but for now you'll need to create a b
uild with --enable-dtrace (on mac os x you also have to use at least the 10.5 sdk for --with-macos-sdk, unlike the common configuration that uses the 10.4 sdk).
... trunk nightly b
uilds with shark support (*-mac-shark.dmg here) are b
uilt with --enable-dtrace.
... documentation writing scripts a general introduction to writing d scripts and using the b
uilt-in mozilla probes.
...And 4 more matches
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
prereq
uisites java 1.4.2 or newer xulrunner 1.8.0.1 or newer embedding in order to embed mozilla in your java application, you will need to add the library mozillainterfaces.jar (located in xulrunner/sdk/lib folder) to your classpath.
...first, the java application must find a s
uitable xulrunner installation: mozilla mozilla = mozilla.getinstance(); greversionrange[] range = new greversionrange[1]; range[0] = new greversionrange("1.8.0", true, "1.9", false); // work with trunk nightly version 1.9a1 ^^ try { file grepath = mozilla.getgrepathwithproperties(range, null); locationprovider locprovider = new locationprovider(grepath); mozilla.initembedding(grepath, grepath, locprovider); } catch (filenotfoundexception e) { // this exception is thrown if gregrepathwithproperties cannot find a gre } catch (xpcomexception e) { // this e...
... if (aprop.equals("comsd")) { file = new file(file, "components"); } } return file; } public file[] getfiles(string aprop) { file[] files = null; if (aprop.equals("apluginsdl")) { files = new file[1]; files[0] = new file(libxulpath, "plugins"); } return files; } } calling xpcom
ui from another thread appstartup.run() enters the main event loop and will stay there until the application exits.
...And 4 more matches
Microsummary XML grammar reference - Archive of obsolete content
warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) this article provides detailed information about the xml grammar used to b
uild microsummary generators, describing each element and their attributes.
...attributes: name (req
uired) a descriptive, human-readable name for the microsummary created by the generator.
... child elements: <template> (req
uired) defines how to transform pages into their microsummaries.
...And 4 more matches
New Skin Notes - Archive of obsolete content
--dria css classes for feature and subfeature boxes, including req
uired graphics.
...devmo skin vs cavendish skin --callek i can probably pull-off this patch if needed (q
uickly), so dria or others do not have to hunt up "how".
...--nickolay 09:19, 25 aug 2005 (pdt) (moving this to a new item) on the contrary, the list of categories current page belongs to, should be near the footer (see mdc:policies_and_g
uidelines page) (dria: fix catlinks style) the arrows that appear if you select "enhanced recent changes" in your preferences have an ugly border around them.
...And 4 more matches
Frequently Asked Questions - Archive of obsolete content
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> actually the second binding isn't always req
uired, but unless you understand namespaces, we'd strongly recommend you include it.
...if the plug-in works with the eq
uivalent non-svg version of mozilla, then it should also work in the svg enabled version.
...as of 2004-11-11, b
uilds with native svg support will use the native support to render svg documents that are embeded by reference into an html document using the <embed> tag.
...And 4 more matches
Mac stub installer - Archive of obsolete content
b
uild the mac installer (debug or non-debug target) using miw.mcp grab a nightly b
uild, say from <http://ftp.mozilla.org/pub/mozilla/n...taller.sea.bin> drop in the installer binary next to the "mozilla installer" in the "mozilla installer" folder created by unstuffing the opt b
uild.
... alternative to steps 3 and 4 copy the "installer modules" folder from the "mozilla installer" folder into the "macb
uild" folder that contains the b
uild debug or non-debug installer binary next to miw.mcp.
... copy the license and readme from the "mozilla installer" folder" to the "macb
uild" folder itself.
...And 4 more matches
Learn XPI Installer Scripting by Example - Archive of obsolete content
in this article, we use the unix install file, but the installers for all the platforms are q
uite similar, and you can easily take what you learn here and apply it to installations on any platform that mozilla supports.
... first, a q
uick scan of the contents of the xpi file (which you can open using with any unzip utility) reveals the following high-level directory structure: install.js bin\ chrome\ components defaults\ icons\ plugins\ res\ note that this high-level structure parallels the directory structure of the installed browser very closely: as you will see in the installation script, the contents of the...
... // this function verifies disk space in kilobytes function verifydiskspace(dirpath, spacereq
uired) { var spaceavailable; // get the available disk space on the given path spaceavailable = filegetdiskspaceavailable(dirpath); // convert the available disk space into kilobytes spaceavailable = parseint(spaceavailable / 1024); // do the verification if(spaceavailable < spacereq
uired) { logcomment("insufficient disk space: " + dirpath); logcomment(" req
uir...
...And 4 more matches
MenuModification - Archive of obsolete content
this method will create a new men
uitem element and insert it into the popup.
...the first argument to appenditem is the label of the men
uitem, and the second argument is a value to associate with the item.
... this value be set as the men
uitem's value attribute and can be used for whatever purpose is desired.
...And 4 more matches
PopupEvents - Archive of obsolete content
<menu label="edit"> <menupopup onpopupshowing="if (gdisallowed) event.preventdefault();"> <men
uitem label="undo"/> <men
uitem label="redo"/> </menupopup> </menu> in this example, a global variable gdisallowed is checked and the preventdefault method is called.
...for example: <menu label="file"> <menupopup onpopupshowing="if (event.target == this) adjustfilemenu(this);"> <menu label="open"> <menupopup> <men
uitem label="file..."/> <men
uitem label="page"/> </menupopup> </menu> </menupopup> </menu> the target of the event is examined to ensure that the event is for the desired menupopup.
...the popupshown event will be fired when the
ui is updated and the popup is visible.
...And 4 more matches
Popup Menus - Archive of obsolete content
first, an example: <popupset> <menupopup id="clipmenu"> <men
uitem label="cut"/> <men
uitem label="copy"/> <men
uitem label="paste"/> </menupopup> </popupset> as can be seen here, a simple popup menu with three commands on it has been created.
... the menupopup element surrounds the three men
uitem elements.
...the sample below shows how we might do this: example 1 : source view <popupset> <menupopup id="clipmenu"> <men
uitem label="cut"/> <men
uitem label="copy"/> <men
uitem label="paste"/> </menupopup> </popupset> <box context="clipmenu"> <label value="context click for menu"/> </box> here, the menupopup has been associated with a box.
...And 4 more matches
Skinning XUL Files by Hand - Archive of obsolete content
in the meantime, however, skinning a file req
uires some manual interaction.
...css can q
uickly become complicated.
...to keep your xul looking consistent and to avoid breaking skins altogether (when your styles have some dependency on a part of the global skin that changes, such as an image), use the style rules in the global skin by importing it into your stylesheet with the following instruction: @import url("chrome://global/skin/"); refer to the document writing skinnable xul and css for g
uidelines on how to make your skins friendly to the global skin, to xul, and to mozilla.
...And 4 more matches
XUL accessibility tool - Archive of obsolete content
it is designed to test (insofar as automated testing is possible) the g
uidelines and req
uirement for creating accessible xul as set forth in the xul accessibility g
uidelines, and to report on any problems found in tested documents.
... while not meant to be a comprehensive test s
uite (meaning that passing all included tests does not guarantee that an application is free of accessibility bugs or issues), many of the most common accessibility mistakes will be found and reported.
...the version currently on xulplanet is compatible with the following xul applications: firefox 1.5+ thunderbird 3.0a+ recent sunbird b
uilds recent songbird b
uilds.
...And 4 more matches
menupopup - Archive of obsolete content
more information is available in the xul tutorial and popup g
uide.
... <menulist> <menupopup> <men
uitem label="mozilla" value="http://mozilla.org"/> <men
uitem label="slashdot" value="http://slashdot.org"/> <men
uitem label="sourceforge" value="http://sf.net"/> <men
uitem label="freshmeat" value="http://freshmeat.net"/> </menupopup> </menulist> the following example shows how a menupopup can be used as a context menu for an element.
... <menupopup id="clipmenu"> <men
uitem label="cut"/> <men
uitem label="copy"/> <men
uitem label="paste"/> </menupopup> <label value="right click for popup" context="clipmenu"/> attributes ignorekeys type: boolean if true, keyboard navigation between items in the popup is disabled.
...And 4 more matches
menuseparator - Archive of obsolete content
attributes acceltext, accesskey, allowevents, command, crop, disabled, image, label, selected, tabindex, value properties accessibletype, accesskey, command, control, crop, disabled, image, label, labelelement, parentcontainer, selected, tabindex, value examples <menu label="menu"> <menupopup> <men
uitem label="item1"/> <menuseparator/> <men
uitem label="item2"/> <men
uitem label="item3"/> </menupopup> </menu> attributes acceltext type: string text that appears beside the menu label to indicate the shortcut key (accelerator key) to use to invoke the command.
...for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
... visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...And 4 more matches
toolbarbutton - Archive of obsolete content
it is eq
uivalent to a regular button except that it may be rendered differently.
... relevant accessbility g
uidelines all toolbar functionality should be duplicated elsewhere in the application where possible, provide keyboard alternatives.
... accesskey, accessibletype, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, image, label, open, orient, tabindex, type examples <toolbar id="test-toolbar"> <toolbarbutton accesskey="p" label="plain"/> <toolbarbutton accesskey="c" label="checkbox" type="checkbox"/> <toolbarbutton accesskey="b" label="menu-button" type="menu-button"> <menupopup> <men
uitem label="menu item 1"/> <men
uitem label="menu item 2"/> </menupopup> </toolbarbutton> <toolbarbutton accesskey="m" label="menu" type="menu"> <menupopup> <men
uitem label="menu item 1"/> <men
uitem label="menu item 2"/> </menupopup> </toolbarbutton> </toolbar> <toolbar id="radio-toolbar"> <toolbarbutton accesskey="1" label="radio 1" type="radio" group="radiogro...
...And 4 more matches
XUL - Archive of obsolete content
xul tutorial a g
uided tutorial that will help you get started with xul, originally from xulplanet.
... xul (xml user interface language) is mozilla's xml-based language for b
uilding user interfaces of applications like firefox.
... documentation xul tutorial a g
uided tutorial that will help you get started with xul, originally from xulplanet.
...And 4 more matches
XUL Application Packaging - Archive of obsolete content
req
uired name example: name=testapplication version specifies the application version number.
... req
uired see toolkit version format for version numbering details example: version=0.1 b
uildid specifies a unique b
uild identifier.
... req
uired example: b
uildid=20060201 id specifies the unique application id req
uired the application id, like extension ids, can be formatted either like an email applicationname@vendor.tld or a u
uid {12345678-1234-1234-1234-123456789abc}.
...And 4 more matches
2006-11-24 - Archive of obsolete content
summary: mozilla.dev.b
uilds - november 17th to november 24th 2006 trouble b
uilding xulrunner 1.8.4 on winxp using mingw32 november 20th: joe is trying to b
uild xulrunner using the ming compiler on windowsxp.
... he is using make 3.80, working with the source tarball for xulrunner 1.8.4,running "make -f client.mk distclean" followed by "make -f client.mk b
uild_all".
... b
uilding xpcom components with msvs 2005 november 21st: buffaloaf is having trouble getting a personal xpcom component to work under xulrunner when compiled with msvs 2005.
...And 4 more matches
Reference - Archive of obsolete content
inheritance and private variables the g
uide section links to an interesting document discussing how to create and use private variables in objects, which is great if you want to protect the various properties within an object from being poked at accidentally.
...--george3 11:47, 14 sept 2006 (edt) sgml comment hiding q
uirks sgml comment hiding needs to be mentioned here and its consequences.
...--nickolay 05:37, 31 aug 2005 (pdt) gonna follow mozilla's coding g
uides here: http://www.mozilla.org/hacking/mozil...de.html#visual --maian 00:30, 20 september 2005 (pdt) btoa() and atob() base64 encode and decode functions this documentation is missing the base64 encode (btoa) and decode (atob) functions.
...And 4 more matches
Requests For Enhancement - Archive of obsolete content
custom controls i think that xforms is a great way to show that 14 year old html hacks can b
uild really powerful web apps and reduce the need for javascript by 90%.
... now we need to start teaching xforms to web newcomers before they are brainwashed into believing that the only way to b
uild cool web apps is to do dom surgery with javascript!
...if you find that you can't create a custom control due to limitations in our interfaces or the functionality of our controls, then this is the right place to pass along your req
uirements.
...And 4 more matches
The Business Benefits of Web Standards - Archive of obsolete content
while some browsers have q
uirks that cause different behavior by platform, mozilla-based browsers are designed to behave identically on all supported platforms (mac, linux, unix, windows...) web content is increasingly being accessed by a growing number of user agents other than browsers, or by browsers on different platforms - for example mobile telephones.
... feed content such as rss and atom simply will not work without being implemented by following the req
uisite standard.
...using validation tools such as the w3c validator helps by spotting coding errors and making sure html code is well-formed, which eliminates ambig
uity in parsing by browsers.
...And 4 more matches
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
windows command u
uidgen should be sufficient.
... how to call plugin native methods the following html code will do the job:</p> this should be changed, we shouldn't advocate embed <embed type="application/plugin-mimetype"> <script language="javascript"> var embed = document.embeds[0]; embed.nativemethod(); </script> how to b
uild and install having the b
uilt mozilla tree is probably not necessary, but b
uilding the plugin with a scriptable instance interface will req
uire mozilla headers and the xpcom compatible idl compiler -- xpidl.exe.
...b
uild nptestplugin.dll with nsitestplugin.h included for compiling scriptable instance class implementaion.
...And 4 more matches
GLSL Shaders - Game development
glsl is not as int
uitive as javascript.
...it can get very complicated — very q
uickly.
... shader types a shader is essentially a function req
uired to draw something on the screen.
...And 4 more matches
Debugging CSS - Learn web development
previous overview: b
uilding blocks next sometimes when writing css you will encounter an issue where your css doesn't seem to be doing what you expect.
...this article will give you g
uidance on how to go about debugging a css problem, and show you how the devtools included in all modern browsers can help you to find out what is going on.
... prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn the basics of what browser devtools are, and how to do simple inspection and editing of css.
...And 4 more matches
CSS layout - Learn web development
we have covered the necessary prereq
uisites so we can now dive deep into css layout, looking at different display settings, modern layout tools like flexbox, css grid, and positioning, and some of the legacy techniques you might still want to know about.
... get started prereq
uisites before starting this module, you should already: have basic familiarity with html, as discussed in the introduction to html module.
... g
uides these articles will provide instruction on the fundamental layout tools and techniques available in css.
...And 4 more matches
What is CSS? - Learn web development
prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, and html basics (study introduction to html.) objective: to learn what css is.
...links are colored and underlined to disting
uish them from the rest of the text.
... h1 { color: red; font-size: 5em; } p { color: black; } you will find that you q
uickly learn some values, whereas others you will need to look up.
...And 4 more matches
What do common web layouts contain? - Learn web development
prereq
uisites: make sure you've already thought about what you want to accomplish with your web project.
... even now with the new focus on mobile web, almost all mainstream webpages are b
uilt from these parts: header visible at the top of every page on the site.
...in fact, everything not absolutely req
uired by the page's main content.
...And 4 more matches
How can we design for all types of users? - Learn web development
prereq
uisites: you should first read what is accessibility?, since we don't cover accessibility in detail here.
...this article lists the most important q
uick-wins for universal design.
... summary when you're b
uilding a website, one top issue to consider is universal design: accommodating all users regardless of disability, technical constraints, culture, location, and so on.
...And 4 more matches
How does the Internet work? - Learn web development
prereq
uisites: none, but we encourage you to read the article on setting project goals first objective: you will learn the basics of the technical infrastructure of the web and the difference between internet and the web.
...but it gets complicated q
uickly.
... once we add a router to the system, our network of 10 computers only req
uires 10 cables: a single plug for each computer and a router with 10 plugs.
...And 4 more matches
How do you upload your files to a web server? - Learn web development
prereq
uisites: you must know what a web server is and how domain names work.
... summary if you have b
uilt a simple web page (see html basics for an example), you will probably want to put it online, on a web server.
... your account is: demozilla your website will be visible at demozilla.examplehostingprovider.net to publish to this account, please connect through sftp with the following credentials: sftp server: sftp://demozilla.examplehostingprovider.net username: demozilla password: q
uickbrownfox port: 5548 to publish on the web, put your files into the public/htdocs directory.
...And 4 more matches
JavaScript basics - Learn web development
these include: browser application programming interfaces (apis) b
uilt into web browsers, providing functionality such as dynamically creating html and setting css styles; collecting and manipulating a video stream from a user's webcam, or generating 3d graphics and audio samples.
... third-party frameworks and libraries that you can apply to html to accelerate the work of b
uilding sites and applications.
...it is only req
uired when you need to separate statements on a single line.
...And 4 more matches
Creating hyperlinks - Learn web development
this article shows the syntax req
uired to make a link, and discusses link best practices.
... prereq
uisites: basic html familiarity, as covered in getting started with html.
...if the web browser doesn't know how to display or handle the file, it will ask you if you want to open the file (in which case the duty of opening or handling the file is passed to a s
uitable native app on the device) or download the file (in which case you can try to deal with it later on).
...And 4 more matches
Images in HTML - Learn web development
overview: multimedia and embedding next in the beginning, the web was just text, and it was really q
uite boring.
... prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with html fundamentals (as covered in getting started with html.) objective: to learn how to embed simple images in html, annotate them with captions, and how html images relate to css background images.
...this is an empty element (meaning that it has no text content or closing tag) that req
uires a minimum of one attribute to be useful — src (sometimes spoken as its full title, source).
...And 4 more matches
Choosing the right approach - Learn web development
prereq
uisites: basic computer literacy, a reasonable understanding of javascript fundamentals.
... single delayed operation repeating operation multiple sequential operations multiple simultaneous operations no yes no (unless it is the same one) no code example the following function creates a new date() object, extracts a time string out of it using tolocaletimestring(), and then displays it in the
ui.
... 14opera android full support 14safari ios full support 6.1samsung internet android full support 1.5legend full support full supportsee implementation notes.see implementation notes.req
uires a vendor prefix or different name for use.req
uires a vendor prefix or different name for use.
...And 4 more matches
JavaScript object basics - Learn web development
prereq
uisites: basic computer literacy, a basic understanding of html and css, familiarity with javascript basics (see first steps and b
uilding blocks).
...the this keyword refers to the current object the code is being written inside — so in this case this is eq
uivalent to person.
...every time we've been working through an example that uses a b
uilt-in browser api or javascript object, we've been using objects, because such features are b
uilt using exactly the same kind of object structures that we've been looking at here, albeit more complex ones than in our own basic custom examples.
...And 4 more matches
Object prototypes - Learn web development
prereq
uisites: understanding javascript functions, familiarity with javascript basics (see first steps and b
uilding blocks), and oojs basics (see introduction to objects).
... note: it is worth reading our more in-depth g
uide to "using prototypes in javascript", once you've made sense of this section and wish to know more.
... a clever trick is that you can put parentheses onto the end of the constructor property (containing any req
uired parameters) to create another object instance from that constructor.
...And 4 more matches
Introducing JavaScript objects - Learn web development
in javascript, most things are objects, from core javascript features like arrays to the browser apis b
uilt on top of javascript.
... get started prereq
uisites before starting this module, you should have some familiarity with html and css.
...before attempting this module, work through javascript first steps and javascript b
uilding blocks.
...And 4 more matches
Perceived performance - Learn web development
prereq
uisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies.
...for this, time to interactive, is a good metric; it is the moment when the last long task of the load process finishes and the
ui is available for user interaction with delay.
...
ui lack or responsiveness and jank both harm perceived performance.
...And 4 more matches
What is web performance? - Learn web development
does the site load q
uickly, allow the user to start interacting with it q
uickly, and offer reassuring feedback if something is taking time to load (e.g.
... prereq
uisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies.
...this includes the following major areas: reducing overall load time: how long does it take the files req
uired to render the web site to download on to the user's computer?
...And 4 more matches
Client-Server Overview - Learn web development
prereq
uisites: basic computer literacy.
... a method that defines the req
uired action (for example, to get a file or to save or update some data).
...e: text/html; charset=utf-8 date: wed, 07 sep 2016 00:11:31 gmt keep-alive: timeout=5, max=999 connection: keep-alive x-frame-options: deny allow: get x-cache-info: caching content-length: 41823 <!doctype html> <html lang="en-us" dir="ltr" class="redesign no-js" data-ffo-opensanslight=false data-ffo-opensans=false > <head prefix="og: http://ogp.me/ns#"> <meta charset="utf-8"> <meta http-eq
uiv="x-ua-compatible" content="ie=edge"> <script>(function(d) { d.classname = d.classname.replace(/\bno-js/, ''); })(document.documentelement);</script> ...
...And 4 more matches
Introduction to the server side - Learn web development
prereq
uisites: basic computer literacy.
... the request includes a url identifying the affected resource, a method that defines the req
uired action (for example to get, delete, or post the resource), and may include additional information encoded in url parameters (the field-value pairs sent via a query string), as post data (data sent by the http post method), or in associated cookies.
...for "dynamic requests" the server interprets the request, reads req
uired information from the database (3), combines the retrieved data with html templates (4), and sends back a response containing the generated html (5,6).
...And 4 more matches
Ember interactivity: Events, classes and state - Learn web development
prereq
uisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line.
... storing todos with a service ember has b
uilt-in application-level state management that we can use to manage the storage of our todos and allow each of our components to access data from that application-level state.
...… } block as follows: export default class tododataservice extends service { @tracked todos = []; @action add(text) { let newtodo = new todo(text); this.todos = [...this.todos, newtodo]; } } here, the todos property on the service will maintain our list of todos contained inside an array, and we'll mark it with @tracked, because when the value of todos is updated we want the
ui to update as well.
...And 4 more matches
Componentizing our React app - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line.
... that second bullet is especially valuable: making a component out of common
ui elements allows you to change your code in one place and see those changes everywhere that component is used.
...let's take the second bullet point as inspiration and make a component out of the most reused, most important piece of the
ui: a todo list item.
...And 4 more matches
React resources - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line.
...you'll likely have app-wide styles and specific component styles that b
uilt on top of those.
... try installing one of these, then using it to inspect the app you’ve just b
uilt!
...And 4 more matches
Componentizing our Svelte app - Learn web development
prereq
uisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line.
... you'll need a terminal with node + npm installed to compile and b
uild your app.
...some people prefer an int
uitive approach and start looking at the markup and drawing boxes around every component and subcomponent that seems to have its own logic.
...And 4 more matches
Accessibility Features in Firefox
for more detailed information, please check the assistive technology compatibility g
uide is kept on an editable wiki.
... both history and bookmarks can be searched with a "q
uick search" field that q
uickly narrows the list down via a substring search.
...custom searches can be added to this q
uick search bar and the user can switch between them by choosing from a drop down available via the standard alt+down arrow key combination.
...And 4 more matches
Mozilla accessibility architecture
accessibility apis are used by 3rd party software like screen readers, screen magnifiers, and voice dictation software, which need information about document content and
ui controls, as well as important events like changes of focus.
...accessibility apis on each operating system have b
uilt-in assumptions about what is the most important information, and how an accessibility server like mozilla should use the api's programmatic interfaces to expose this information to an accessibility client (the assistive technology).
... accessible/src/other/ empty implementations of platform-specific classes so that b
uilds don't fail on platforms currently not-supported where we put toolkit-specific code because atk and msaa are different accessibility api toolkits which share only about 75% of their code, there is a lot of toolkit-specific code that needs to live somewhere.
...And 4 more matches
Index
675 creating an appealing add-on listing add-ons, beginner, g
uide, webextension, publishing there are two essential steps to getting people to use your add-on: they need to discover your add-on and open the listing page, then the listing page needs to encourage them to click the add to firefox button.
... 676 index add-ons, glossary, g
uide, index found 689 pages: 677 signing and distributing your add-on add-ons, extensions, webextensions, distribution, publication, reviews, signing add-ons need to be signed before they can be installed into release and beta versions of firefox.
... 678 make money from browser extensions g
uide, monetization, webextensions, distribution while users can download browser extensions for firefox free of cost from addons.mozilla.org (amo), this doesn’t mean you can’t make money from browser extensions, and to a more limited extent themes.
...And 4 more matches
Updating NSPR or NSS in mozilla-central
(because some developers might not be aware that nspr/nss are separately maintained and released, the mozilla hg server rejects accidental changes/forking, if the req
uired keywords are missing in the commit comment.) if nspr or nss must be upgraded to a new static tag, follow this procedure: before starting, make sure your local repository is updated to mozilla-central tip and that there are no local changes: $ hg status -mard pull the new sources $ python client.py update_nspr nspr_tag_name or $ python client.py update_nss nss_tag_name if yo...
...u update a branch older than mozilla 17 (without the change from bug 782784), you must manually add a dummy change (add or remove a blank line) to force a reb
uild of nspr: mozilla/nsprpub/config/prdepend.h or nss: mozilla/security/nss/coreconf/coreconf.dep check directory mozilla/nsprpub/patches/ for patches that need to be applied to nspr, and directory mozilla/security/patches/ for patches that need to be applied to nss.
...if merging is req
uired, update the patch file.
...And 4 more matches
Windows SDK versions
mozilla, from time to time, might support b
uilding against multiple versions of the windows sdk as a compatibility/transitional measure.
... if it does, several features will be disabled if you b
uild with an sdk older than the default, which means that you'll have to specify a non-default sdk version explicitly.
... q
uick start follow the instructions for whichever version of visual c++ you're using.
...And 4 more matches
Roll your own browser: An embedding how-to
you should instead b
uild xulrunner and use it for all new embedding.
... one of the req
uirements of b
uilding a sdk is the ability to identify and package up req
uired files.
... after the b
uild is done, you can change directory into mozilla/embedding/config, and do a make.
...And 4 more matches
Hacking with Bonsai
the b
uild team will then pull the 8:00 am tree, and b
uild it on a subset of the platforms, linux, win32 & macppc.
... at 10:00 am, everyone who is on the hook is available in case the b
uild breaks eventually, the tree b
uilds, and it is re-opened.
... there is a web page, which records if the tree is open or closed what the date stamp of the last known good tree is who is on the hook for the current tree before the tree is opened, the list of checkins that happened when the tree was closed is reviewed to insure that only b
uild related checkins took place.
...And 4 more matches
Assert.jsm
this statement is eq
uivalent to assert.equal(true, !!guard, message_opt);.
... undefined equal( actual, expected, message ); parameters actual test subject to be evaluated as eq
uivalent to expected expected test reference to evaluate against actual message short explanation of the expected result notequal() the non-equality assertion tests for whether two objects are not equal with !=.
... undefined notequal( actual, expected, message ); parameters actual test subject to be evaluated as not eq
uivalent to expected expected test reference to evaluate against actual message short explanation of the expected result deepequal() the eq
uivalence assertion tests a deep equality relation.
...And 4 more matches
PromiseWorker.jsm
as well known with workers, there is a minimum of two files req
uired.
...the req
uire.js file must be imported with workerglobalscope/importscripts().
... next, the promiseworker.js file should be brought in with the req
uire() method.
...And 4 more matches
Mozilla Development Strategies
make sure documentation gets updated if the bug you're fixing is likely to req
uire an update to developer documentation once it's fixed, be sure to add the dev-doc-needed keyword to the bug (or ask someone to do it, if you don't have editbugs privileges on bugzilla).
... take extra time to do it right the first time it's also better to come up with one really solid, well tested, well commented, clean, easy to maintain piece of code than a bunch of q
uick fixes.
...it's easier to do it right once, when your mind is in the problem, than to do it once q
uickly and then have to come back and do it again the right way.
...And 4 more matches
Power profiling overview
it is eq
uivalent to an amount of energy consumed per unit time.
... in si units, energy is measured in joules, and power is measured in watts, which is eq
uivalent to joules per second.
...the long measurement times req
uired are a disadvantage, though.
...And 4 more matches
Profiling with Xperf
for stack walking, windows vista or higher is req
uired; i haven't tested it at all on xp.
...(note that it's not the first version number in the about window; that's the windows version.) if you have an older version, you will experience bugs, especially around symbol loading for local b
uilds.
... the standard symbol path that includes both mozilla's and microsoft's symbol server configuration is as follows: _nt_symcache_path: c:\symbols _nt_symbol_path: srv*c:\symbols*http://msdl.microsoft.com/download/symbols;srv*c:\symbols*http://symbols.mozilla.org/firefox/ to add symbols from your own b
uilds, add c:\path\to\objdir\dist\bin to _nt_symbol_path.
...And 4 more matches
About NSPR
netscape portable runtime (nspr) provides platform independence for non-g
ui operating system facilities.
...nspr went beyond that req
uirement in some areas and since it was also the platform independent layer for most of the servers produced by netscape.
...the first generation of nspr was originally conceived just to satisfy the req
uirements of porting java to various host environments.
...And 4 more matches
4.3.1 Release Notes
new in jss 4.3.1 a list of bug fixes and enhancement requests were implemented in this release can be obtained by running this bugzilla query jss 4.3.1 req
uires nss 3.12.5 or higher.
...sslsocket.ssl_renegotiate_req
uires_xtn - not yet implemented explicitly set the key usage for the generated private key in pkcs #11, each keypair can be marked with the operations it will be used to perform.
... some tokens req
uire that a key be marked for an operation before the key can be used to perform that operation; other tokens don't care.
...And 4 more matches
JSS
jss source should now be checked out from the github: git clone git@github.com:dogtagpki/jss.git -- or -- git clone https://github.com/dogtagpki/jss.git all future upstream enq
uiries to jss should now use the pagure issue tracker system: https://pagure.io/jss/issues documentation regarding the jss project should now be viewed at: http://www.dogtagpki.org/wiki/jss note: as much of the jss documentation is sorely out-of-date, updated information will be a work in progress, and many portions of any legacy documentation will be re-written over the course of time.
... jss, jss4.jar, is still b
uilt with jdk 1.4.2.
...jss req
uires nspr and nss.
...And 4 more matches
NSS_3.12.2_release_notes.html
nss 3.12.2 req
uires nspr 4.7.1.
... see the documentation section for the b
uild instructions.
...both debug and optimized b
uilds are provided.
...And 4 more matches
NSS 3.20 release notes
nss 3.20 req
uires nspr 4.10.8 or newer.
... nss 3.20 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_20_rtm/src/ new in nss 3.20 new functionality the tls library has been extended to support dhe ciphers
uites in server applications.
... new types in sslt.h ssldhegrouptype - enumerates the set of dhe parameters embedded in nss that can be used with function ssl_dhegroupprefset new macros in ssl.h ssl_enable_server_dhe - a socket option user to enable or disable dhe ciphers
uites for a server socket notable changes in nss 3.20 the tls library has been extended to support dhe ciphers
uites in server applications.
...And 4 more matches
NSS 3.46 release notes
the nss team would like to recognize first-time contributors: giulio benetti lo
uis dassy mike kaganski xhimanshuz distribution information the hg tag is nss_3_46_rtm.
... nss 3.46 req
uires nspr 4.22 or newer.
... bugs fixed in nss 3.46 bug 1572164 - don't unnecessarily free session in nsc_wrapkey bug 1574220 - improve controls after errors in tstcln, selfserv and vfyserv cmds bug 1550636 - upgrade sqlite in nss to a 2019 version bug 1572593 - reset advertised extensions in ssl_constructextensions bug 1415118 - nss b
uild with ./b
uild.sh --enable-libpkix fails bug 1539788 - add length checks for cryptographic primitives (cve-2019-17006) bug 1542077 - mp_set_ulong and mp_set_int should return errors on bad values bug 1572791 - read out-of-bounds in der_decodetimechoice_util from sslexp_delegatecredential bug 1560593 - cleanup.sh script does not set error exit code for tests that "failed with core" bug 156660...
...And 4 more matches
Network Security Services
applications b
uilt with nss can support ssl v3, tls, pkcs #5, pkcs #7, pkcs #11, pkcs #12, s/mime, x.509 v3 certificates, and other security standards.
... get the source code and b
uild it instructions on how to b
uild nss on the different supported platforms.
... nss api g
uidelines explains how the libraries and code are organized, and g
uidelines for developing code (naming conventions, error handling, thread safety, etc.) nss technical notes links to nss technical notes, which provide latest information about new nss features and supplementary documentation for advanced topics in programming with nss.
...And 4 more matches
Creating JavaScript jstest reftests
you should not add tests of the following type: tests of the jit test of jit correctness belong in the jit-test s
uite, read more here.
... performance tests or stress tests tests of spidermonkey's comformance to the ecmascript standard a brief history: in 2017, spidermonkey started comsuming test262, a comprehensive tests s
uite for ecmascript implementations.
... test262 tests test262 is the implementation conformance test s
uite for the latest drafts of ecmascript language specification, as well as internationalization api specification and the json data interchange format.
...And 4 more matches
Garbage collection
this allows compartments to be used for security checks: objects in the same compartment have the same access req
uirements, so no checks are needed, but checks may be done when traversing cross-compartment wrappers.
...for information on how the rooting apis should be used by embedders, read: gc rooting g
uide.
... there is always a possibility that a long pause will be req
uired.
...And 4 more matches
JS_BeginRequest
in a js_threadsafe b
uild, many jsapi functions must only be called from within a request.
... in this reference, the cx parameter of such functions is documented with the phrase “req
uires request”, like this: name type description cx jscontext * the context to use.
... req
uires request.
...And 4 more matches
JS_DefineElement
syntax /* added in spidermonkey 38 (jsapi 32) */ bool js_defineelement(jscontext *cx, js::handleobject obj,
uint32_t index, js::handlevalue value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj,
uint32_t index, js::handleobject value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj,
uint32_t index, js::handlestring value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(js...
...context *cx, js::handleobject obj,
uint32_t index, int32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj,
uint32_t index,
uint32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj,
uint32_t index, double value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); /* obsolete since jsapi 32 */ js_defineelement(jscontext *cx, jsobject *obj,
uint32_t index, jsval value, jspropertyop getter, jsstrictpropertyop setter, unsigned attrs)...
...req
uires request.
...And 4 more matches
JS_SetGCZeal
syntax void js_setgczeal(jscontext *cx,
uint8_t zeal,
uint32_t frequency); name type description cx jscontext * a context.
... zeal
uint8_t the desired level of garbage collection.
... frequency
uint32_t with some zeal levels, a gc is triggered every frequency allocations.
...And 4 more matches
SpiderMonkey 31
compiling it req
uires a c++ compiler, and the jsapi can only be used from c++ code.
...here is a list of the most significant changes: many of the garbage collector changes req
uire type signature changes to jsapi methods: specifically introducing js::rooted, js::handle, and js::mutablehandle types.
... obsolete apis js_convertarguments "j" type deleted apis js_newgrowablestring (can be replaced with js_newucstring) js_isconstructing (can be replaced with callargs::isconstructing or callreceiver::isconstructing) js_valuetoboolean (replaced by js::toboolean) js_valuetonumber (can be replaced with js::tonumber) js_valuetoint64 (replaced by js::toint64) js_valueto
uint64 (replaced by js::to
uint64) js_valuetoecma
uint32 (replaced by js::to
uint32) js_valuetoecmaint32 (replaced by js::toint32) js_valuetoint32 (can be replaced with js::toint32, which has a different behavior!) js_valueto
uint16 (replaced by js::to
uint16) js_valuetostring (replaced by js::tostring) js_definepropertywithtinyid js_defineucpropertywithtinyid js_getobjectid api changes spider...
...And 4 more matches
TPS Tests
set up an environment and run a test to run tps, you should create a new firefox account using a restmail.net email address (strictly speaking, restmail isn't req
uired, but it will allow tps to automatically do account confirmation steps for you.
...hat the testfile is not a path, it should only be the filename from services/sync/tests/tps/ runtps --debug --testfile %test_file_name% --binary %firefox_binary_path% additionally, omitting a --testfile parameter will cause it to run all tps tests listed in services/sync/tests/tps/all_tests.json an example on osx, for running just the test_sync.js testfile against a locally b
uilt firefox (where the mozconfig set the objdir to obj-ff-artifact): runtps --debug --testfile test_sync.js --binary obj-ff-artifact/dist/nightly.app/contents/macos/firefox running tps against stage, or dev fxa tps can be configured using the $tps_venv_path/config.json file.
... each type of asset list has a number of b
uilt-in functions you can call, described in the section on asset lists; there are also some additional b
uilt-in functions.
...And 4 more matches
Redis Tips
in node, create client with explicit host and port like so: > var r = req
uire('redis').createclient(6379, '127.0.0.1') commands are asynchronous.
... here's a stupid node script to show how this works: #!/usr/bin/env node var r = req
uire('redis').createclient(); r.multi() .set("foo", 42) .set("bar", "ice cream") .set("baz", 6.28) .get("foo") .get("bar") .get("baz") .exec(function(err, resultlist) { console.log(json.stringify(resultlist, null, 2)); r.end(); // terminate the redis connection; node can q
uit }); when run, this prints: [ "ok", "ok", "ok", "42", "ice cream", "6.28" ] the result...
... for example, here's some node code: var redis = req
uire("redis"), client = redis.createclient({ ...
...And 4 more matches
A Web PKI x509 certificate primer
in order for a certificate to be valid these three req
uirements must be met: there is a verification path from the site certificate to a trusted certificate of the user agent (ie if you follow the issuer path you will end on a self-signed certificate that is considered trusted by the browser).
...this allows for a certificate to be used for more than one fqdn, for example you can have a certificate that is valid for both a.example.com and b.example.com basic constraints this allows certificates to be asserted as iss
uing certificates (it is mandatory for ca certificates).
...for end-entity certificates for pki this extension is req
uired to exist with the serverauth bit asserted.
...And 4 more matches
nsIBinaryOutputStream
inherits from: nsioutputstream last changed in gecko 1.7 method overview void setoutputstream(in nsioutputstream aoutputstream); void write8(in pr
uint8 abyte); void write16(in pr
uint16 a16); void write32(in pr
uint32 a32); void write64(in pr
uint64 a64); void writeboolean(in prbool aboolean); void writebytearray([array, size_is(alength)] in pr
uint8 abytes, in pr
uint32 alength); void writebytes(alength)] in string astring, in pr
uint32 alength); void writedouble(in double adouble); void writefloat(in float afloat); void writestr...
...void write8( in pr
uint8 abyte ); parameters abyte the byte to write to the stream.
...void write16( in pr
uint16 a16 ); parameters a16 the 16-bit integer to write to the stream.
...And 4 more matches
nsIDOMNSHTMLDocument
inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void captureevents(in long eventflags); void clear(); boolean execcommand(in domstring commandid, in boolean doshow
ui, in domstring value); boolean execcommandshowhelp(in domstring commandid); obsolete since gecko 14.0 domstring getselection(); nsidomdocument open(in acstring acontenttype, in boolean areplace); boolean querycommandenabled(in domstring commandid); boolean querycommandindeterm(in domstring commandid); boolean querycommandstate(in domstring comm...
...flags); void routeevent(in nsidomevent evt); void write(); obsolete since gecko 2.0 void writeln(); obsolete since gecko 2.0 attributes attribute type description alinkcolor domstring same as body.alink bgcolor domstring same as body.bgcolor compatmode domstring returns "backcompat" if the document is in q
uirks mode or "css1compat" if the document is in full standards or almost standards mode.
...roughly eq
uivalent to body.contenteditable domain domstring initially the host name of the document's url, but may be changed to the parent (but not top-level) domain in order to facilitate data exchange between documents from different sites in the same domain.
...And 4 more matches
nsIMsgFolder
enamesubfolders( in nsimsgwindow msgwindow, in nsimsgfolder oldfolder); astring generateuniquesubfoldername(in astring prefix,in nsimsgfolder otherfolder); void updatesummarytotals(in boolean force); void summarychanged(); long getnumunread(in boolean deep); long gettotalmessages(in boolean deep); void clearnewmessages(); void clearreq
uirescleanup(); void setflag(in unsigned long flag); void clearflag(in unsigned long flag); boolean getflag(in unsigned long flag); void toggleflag(in unsigned long flag); void onflagchange(in unsigned long flag); void setprefflag(); nsimsgfolder getfolderswithflag(in unsigned long flags, in unsigned long resultsize, out unsigned long nu...
...ner, in boolean isfolder, in boolean allowundo); void copyfolder(in nsimsgfolder srcfolder, in boolean ismovefolder,in nsimsgwindow msgwindow, in nsimsgcopyservicelistener listener ); void copyfilemessage(in nsifile file, in nsimsgdbhdr msgtoreplace,in boolean isdraft, in unsigned long newmsgflags,in nsimsgwindow msgwindow,in nsimsgcopyservicelistener listener); void acq
uiresemaphore(in nsisupports semholder); void releasesemaphore(in nsisupports semholder); boolean testsemaphore(in nsisupports semholder); void getnewmessages(in nsimsgwindow awindow, in nsiurllistener alistener); void writetofoldercache(in nsimsgfoldercache foldercache, in boolean deep); long getnumnewmessages(in boolean deep); void setnumnewmes...
...window msgwindow); void setmsgdatabase(in nsimsgdatabase msgdatabase); nsimsgdatabase getdbfolderinfoanddb(out nsidbfolderinfo folderinfo); nsimsgdbhdr getmessageheader(in nsmsgkey msgkey); boolean shouldstoremsgoffline(in nsmsgkey msgkey); boolean hasmsgoffline(in nsmsgkey msgkey); nsiinputstream getofflinefilestream(in nsmsgkey msgkey, out pr
uint32 offset, out pr
uint32 size); void downloadmessagesforoffline(in nsisupportsarray messages, in nsimsgwindow window); nsimsgfolder getchildwithuri(in acstring uri, in boolean deep, in boolean caseinsensitive); void downloadallforoffline(in nsiurllistener listener, in nsimsgwindow window); void enablenotifications(in long notificationtype, in boolean enable, in...
...And 4 more matches
nsIMsgWindow
method overview void displayhtmlinmessagepane(in astring title, in astring body, in boolean clearmsghdr); void stopurls(); void closewindow(); attributes attribute type description windowcommands nsimsgwindowcommands this allows the backend code to send commands to the
ui, such as clearmsgpane.
... statusfeedback nsimsgstatusfeedback this allows the backend code to send status feedback to the
ui.
... msgheadersink nsimsgheadersink this allows the backend code to send message header information to the
ui.
...And 4 more matches
nsISupportsArray
inherits from: nsicollection last changed in gecko 1.7 method overview boolean appendelements(in nsisupportsarray aelements); violates the xpcom interface g
uidelines nsisupportsarray clone(); void compact(); void deleteelementat(in unsigned long aindex); void deletelastelement(in nsisupports aelement); nsisupports elementat(in unsigned long aindex); violates the xpcom interface g
uidelines boolean enumeratebackwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface g
uidelines boolean enumerateforwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface g
uidelines boolean equals([const] in nsisupportsarray other); viola...
...tes the xpcom interface g
uidelines long getindexof(in nsisupports apossibleelement); long getindexofstartingat(in nsisupports apossibleelement, in unsigned long astartindex); long getlastindexof(in nsisupports apossibleelement); long indexof([const] in nsisupports apossibleelement); violates the xpcom interface g
uidelines long indexofstartingat([const] in nsisupports apossibleelement, in unsigned long astartindex); violates the xpcom interface g
uidelines boolean insertelementat(in nsisupports aelement, in unsigned long aindex); violates the xpcom interface g
uidelines boolean insertelementsat(in nsisupportsarray aother, in unsigned long aindex); violates the xpcom interface g
uidelines long lastindexof([const] in nsisupports apossibleelement); violates the xpcom interface g
uide...
...lines boolean moveelement(in long afrom, in long ato); violates the xpcom interface g
uidelines boolean removeelementat(in unsigned long aindex); violates the xpcom interface g
uidelines boolean removeelementsat(in unsigned long aindex, in unsigned long acount); violates the xpcom interface g
uidelines boolean removelastelement([const] in nsisupports aelement); violates the xpcom interface g
uidelines boolean replaceelementat(in nsisupports aelement, in unsigned long aindex); violates the xpcom interface g
uidelines boolean sizeto(in long asize); violates the xpcom interface g
uidelines methods violates the xpcom interface g
uidelines appendelements() boolean appendelements( in nsisupportsarray aelements ); parameters aelements return value clone() nsisupportsarray clone...
...And 4 more matches
nsISupports proxies
the main reason for nsisupports proxies is that javascript and
ui are on a single thread.
...they from the majority of javascript code, which is small and can be q
uickly run.
... xpinstall installation scripts are sometimes very complex and can req
uire long execution time due to unzipping or native file system actions.
...And 4 more matches
nsIWinTaskbar
they don't even have to represent actual g
ui elements on the window.
... unlike window previews, tab previews req
uire most of the functionality of the nsitaskbarpreviewcontroller interface be implemented.
...to create an instance, use: var wintaskbar = components.classes["@mozilla.org/windows-taskbar;1"] .getservice(components.interfaces.nsiwintaskbar); method overview nsijumplistb
uilder createjumplistb
uilder(); nsitaskbartabpreview createtaskbartabpreview(in nsidocshell shell, in nsitaskbarpreviewcontroller controller); nsitaskbarprogress gettaskbarprogress(in nsidocshell shell); nsitaskbarwindowpreview gettaskbarwindowpreview(in nsidocshell shell); void setgroupidforwindow(in nsidomwindow aparent, in astring aidentifier); attributes attribute type descriptio...
...And 4 more matches
nsIXPCScriptable
jscontextptr cx, in jsobjectptr obj, in jsval id, in jsvalptr vp); prbool setproperty(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in jsvalptr vp); prbool enumerate(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); prbool newenumerate(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in pr
uint32 enum_op, in jsvalptr statep, out jsid idp); prbool newresolve(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in pr
uint32 flags, out jsobjectptr objp); prbool convert(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in pr
uint32 type, in jsvalptr vp); void finalize(in nsixpconnectwrappednative wrapper, in jscontextpt...
...r cx, in jsobjectptr obj); prbool checkaccess(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in pr
uint32 mode, in jsvalptr vp); prbool call(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in pr
uint32 argc, in jsvalptr argv, in jsvalptr vp); prbool construct(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in pr
uint32 argc, in jsvalptr argv, in jsvalptr vp); prbool hasinstance(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval val, out prbool bp); void trace(in nsixpconnectwrappednative wrapper, in jstracerptr trc, in jsobjectptr obj); prbool equality(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval val); ...
... jsobjectptr outerobject(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); jsobjectptr innerobject(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); void postcreateprototype(in jscontextptr cx, in jsobjectptr proto); attributes attribute type description classname string scriptableflags pr
uint32 the bitwise or'd set of flags (define below) that indicate the behavior of this object.
...And 4 more matches
Mail composition back end
nsimessage *msgtoreplace, - if the delivery mode is set to nsmsgsaveasdraft, this is a pointer to the the nsimessage object for the message that needs to be replaced const char *attachment1_type, const char *attachment1_body, pr
uint32 attachment1_body_length, - the full text of the first attachment is provided via `attachment1_type' `attachment1_body' and `attachment1_body_length'.
... ns_imethod onstartsending(const char *amsgid, - the message id for the message being sent pr
uint32 amsgsize) = 0; - the total message size for the message being sent onprogress the onprogress interface is called with progress notification on the send operation.
... ns_imethod onprogress(const char *amsgid, - the message id for the message being sent pr
uint32 aprogress, - the progress so far pr
uint32 aprogressmax) = 0; - the maximum progress (aprogress should be used as a numerator and aprogressmax as a denominator for a message sent percentage) onstatus the onstatus gives the listener status updates for the current operation.
...And 4 more matches
customDBHeaders Preference
as you follow along the step-by-step g
uide in creating a custom column, you may want to consider a preference setting that exposes custom header data for use in a custom column within thunderbird's main view.
... while i was going through the creating a custom column g
uide, i b
uilt and used thunderbird-2.0b1 checked-out from cvs with the thunderbird_2_0b1_release tag.
... getting started to b
uild upon the reply-to column tutorial, i'll describe the process i went through in developing a custom column to display a 'superfluous' column within thunderbird's main view.
...And 4 more matches
Using js-ctypes
examples these examples offer a q
uick look at how js-ctypes is used.
...we see that it needs to be defined like this: int winapi messagebox( _in_opt_ hwnd hwnd, _in_opt_ lpctstr lptext, _in_opt_ lpctstr lpcaption, _in_
uint utype ); so we read this article here on defining types and replicate it: declaring types var lib = ctypes.open("user32.dll"); or even without the extension.
... note: this example will not work on 64bit os x, see below for core foundation for 64bit os x /* b
uild a str255 ("pascal style") string from the passed-in string */ function makestr(str) { return string.fromcharcode(str.length) + str; } components.utils.import("resource://gre/modules/ctypes.jsm"); var carbon = ctypes.open("/system/library/frameworks/carbon.framework/carbon"); stdalert = carbon.declare("standardalert", /* function name */ ctypes.default_abi, /* abi type */ ctypes.int16_t, /* return type */ ctypes.int16_t, /* alert t...
...And 4 more matches
Flash Activation: Browser Comparison - Plugins
this g
uide will help outline the similarities and differences between the browsers so web developers can provide the best user experience.
...flash-blocking extensions are no longer necessary because this functionality is now b
uilt into the browser.
... firefox google chrome microsoft edge setting name ask to activate html5 by default click-to-run 'application/x-shockwave-flash' in navigator.mimetypes by default when flash is inactive yes no no 'application/x-shockwave-flash' in navigator.mimetypes when user enables flash yes yes yes <object> with fallback content triggers
ui yes, with exceptions no yes small/hidden flash triggers additional
ui yes no no enabling flash automatically reloads the page no yes yes other features related to flash domain blocking plugin power saver peripheral content pause each of the browser vendors has a roadmap about the future of flash and changes to the user experien...
...And 4 more matches
URLs - Plugins
nperror npn_posturl(npp instance, const char *url, const char *target,
uint32 len, const char *buf, npbool file); the instance, url, and target parameters have the same definitions as those of npn_geturl.
...for protocols in which the headers must be disting
uished from the body, such as http, the buffer or file should contain the headers, followed by a blank line, then the body.
... if no custom headers are req
uired, simply add a blank line ('\n') to the beginning of the file or buffer.
...And 4 more matches
The JavaScript input interpreter - Firefox Developer Tools
accessing variables you can access variables defined in the page, both b
uilt-in variables like window and variables added by javascript libraries like jquery: autocomplete the editor has autocomplete: enter the first few letters and a popup appears with possible completions: press enter, tab, or the right arrow key to accept the suggestion, use the up/down arrows to move to a different suggestion, or just keep typing if you don't like any of the suggestions.
...the men
uitem enable autocompletion has a checkmark next to it when the feature is enabled, which is missing when it is disabled.
... select the men
uitem to change the state.
...And 4 more matches
BluetoothRemoteGATTService - Web APIs
interface interface bluetoothremotegattservice : serviceeventhandlers { readonly attribute u
uid u
uid; readonly attribute boolean isprimary; readonly attribute bluetoothdevice device; promise<bluetoothgattcharacteristic> getcharacteristic(bluetoothcharacteristicu
uid characteristic); promise<sequence<bluetoothgattcharacteristic>> getcharacteristics(optional bluetoothcharacteristicu
uid characteristic); promise<bluetoothgattservice> getincludedservice(bluetoothserviceu
uid service); promise<sequence<bluetoothgattservice>> getincludedservices(optional bluetoothservic...
...eu
uid service); }; properties bluetoothremotegattservice.deviceread only returns information about a bluetooth device through an instance of bluetoothdevice.
... bluetoothremotegattservice.u
uidread only returns a domstring representing the u
uid of this service.
...And 4 more matches
Fullscreen API - Web APIs
see the article g
uide to the fullscreen api for details on how to use the api.
... note: support for this api varies somewhat across browsers, with many req
uiring vendor prefixes and/or not implementing the latest specification.
... methods on the element interface element.requestfullscreen() asks the user agent to place the specified element (and, by extension, its descendants) into full-screen mode, removing all of the browser's
ui elements as well as all other applications from the screen.
...And 4 more matches
HTMLImageElement.alt - Web APIs
if the image doesn't req
uire a fallback (such as for an image which is simply decorative or an advisory icon of minimal importance), you may specify an empty string ("").
... usage notes the fundamental g
uideline for the alt attribute is that every image's alternate text should be able to replace the image without altering the meaning of the page.
... examples beyond that, there are additional g
uidelines for using alt appropriately which vary depending on what the image is being used for.
...And 4 more matches
Basic concepts - Web APIs
you can create indexes that use any property of the objects for q
uick searching, as well as sorted enumeration.
... indexeddb is b
uilt on a transactional database model.
...this is q
uite important, as error events abort whatever transactions they're running in, unless they are cancelled.
...And 4 more matches
Timing element visibility with the Intersection Observer API - Web APIs
in this article, we'll b
uild a mock blog which has a number of ads interspersed among the contents of the page, then use the intersection observer api to track how much time each ad is visible to the user.
... although many aspects of this example will not match real world usage (in particular, the articles all have the same text and aren't loaded from a database, and there are just a handful of simple text-only ads that are selected from an array), this should provide enough understanding of the api to q
uickly learn how to apply the intersection observer api to your own site.
...ndow.addeventlistener("load", startup, false); function startup() { contentbox = document.queryselector("main"); document.addeventlistener("visibilitychange", handlevisibilitychange, false); let observeroptions = { root: null, rootmargin: "0px", threshold: [0.0, 0.75] }; adobserver = new intersectionobserver(intersectioncallback, observeroptions); b
uildcontents(); refreshintervalid = window.setinterval(handlerefreshinterval, 1000); } first, a reference to the content wrapping <main> element is obtained, so we can insert our content into it.
...And 4 more matches
Intersection Observer API - Web APIs
implementing intersection detection in the past involved event handlers and loops calling methods like element.getboundingclientrect() to b
uild up the needed information for every element affected.
...it should operate as q
uickly as possible; if anything time-consuming needs to be done, use window.requestidlecallback().
... we call window.addeventlistener() to start listening for the load event; once the page has finished loading, we get a reference to the element with the id "box" using queryselector(), then call the createobserver() method we'll create in a moment to handle b
uilding and installing the intersection observer.
...And 4 more matches
Web Push API Notifications best practices - Web APIs
in addition to the question of whether a push notification is req
uired at all, there are many different types of push notifications, ranging from casual-and-disappearing to persistent-and-req
uiring-interaction.
... we caution you to use the interaction-req
uiring ones very sparingly, since they can be the most annoying.
... b
uilding trust some studies have shown that as many as 60% of push notifications are blocked.
...And 4 more matches
RTCRtpSender.replaceTrack() - Web APIs
the new track must be of the same media kind (audio, video, etc) and switching the track should not req
uire negotiation.
...the promise is rejected if the track cannot be replaced for any reason; this is commonly because the change would req
uire renegotiation of the codec, which is not allowed (see things that req
uire negotiation).
...no negotiation is req
uired in this case.
...And 4 more matches
SecurityPolicyViolationEvent.SecurityPolicyViolationEvent() - Web APIs
this can include the following properties, but bear in mind that if you do include an eventinitdict, certain properties must be included (marked below with req
uired): blockeduri: the blockeduri of the securitypolicyviolationevent.
... disposition: the disposition of the securitypolicyviolationevent (req
uired).
... documenturi: the documenturi of the securitypolicyviolationevent (req
uired).
...And 4 more matches
Using readable streams - Web APIs
browser support you can consume fetch body objects as streams and create your own custom readable streams in firefox 65+ and chrome 42+ (and eq
uivalent chromium-based browsers).
... attaching a reader now we’ve got our streaming body, reading the stream req
uires attaching a reader to it.
...the first object is req
uired, and creates a model in javascript of the underlying source the data is being read from.
...And 4 more matches
Using writable streams - Web APIs
this takes a given message and writes it into a writable stream, displaying each chunk on the
ui as it is written to the stream and also displaying the whole message on the
ui when writing has finished.
...the first object is req
uired, and creates a model in javascript of the underlying sink the data is being written to.
... the second object is optional, and allows you to specify a custom queueing strategy to use for your stream, which takes the form of an instance of bytelengthque
uingstrategy or countque
uingstrategy.
...And 4 more matches
TextEncoder - Web APIs
example const encoder = new textencoder() const view = encoder.encode('€') console.log(view); //
uint8array(3) [226, 130, 172] constructor textencoder() returns a newly constructed textencoder that will generate a byte stream with utf-8 encoding.
... textencoder.prototype.encode() takes a usvstring as input, and returns a
uint8array containing utf-8 encoded text.
... textencoder.prototype.encodeinto() takes a usvstring to encode and a destination
uint8array to put resulting utf-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
...And 4 more matches
Using DTMF with WebRTC - Web APIs
this article offers a brief high-level overview of how dtmf works over webrtc, then provides a g
uide for everyday developers about how to send dtmf over an rtcpeerconnection.
...keep in mind that the process of establishing the connection is somewhat contrived here; you normally don't b
uild both ends of the connection in the same document.
... hasaddtrack because some browsers have not yet implemented rtcpeerconnection.addtrack(), therefore req
uiring the use of the obsolete addstream() method, we use this boolean to determine whether or not the user agent supports addtrack(); if it doesn't, we'll fall back to addstream().
...And 4 more matches
Inputs and input sources - Web APIs
in this g
uide, we'll look at how to use webxr's input device management features to determine what input sources are available and how to then monitor those sources for inputs in order to handle user interactivity with your virtual or augmented environment.
...the use of these profiles is briefly described under input profiles below, and a more complete g
uide may be found in our article using webxr input profiles.
...you also need to be able to determine which input source to use for what activities; for example, if the user has two controllers, which one will be tracked for manipulating
ui elements, or will both?
...And 4 more matches
WritableStream.WritableStream() - Web APIs
syntax var writablestream = new writablestream(underlyingsink[, que
uingstrategy]); parameters underlyingsink an object containing methods and properties that define how the constructed stream instance will behave.
... que
uingstrategy optional an object that optionally defines a que
uing strategy for the stream.
... note: you could define your own custom que
uingstrategy, or use an instance of bytelengthque
uingstrategy or countque
uingstrategy for this object value.
...And 4 more matches
ARIA: dialog role - Accessibility
the dialog role is used to mark up an html based application dialog or window that separates content or
ui from the rest of the web application or page.
...additionally, the following needs to be done: the dialog must be properly labeled keyboard focus must be managed correctly the sections below describe how these two req
uirements can be met.
... labeling even though it is not req
uired for the dialog itself to be able to receive focus, it still needs to be labeled.
...And 4 more matches
Accessibility and Spacial Patterns - Accessibility
in 2005, arnold wilkins, john emmett, and graham harding evaluated the g
uidelines for characterizing patterned images that could precipitate seizures.
... they revised the g
uidelines to their fundamental core, and came up with a surprisingly simple, but powerful test.
... which they published in the paper, characterizing the patterned images that precipitate seizures and optimizing g
uidelines to prevent them the steps necessary to evaluate material reduce to the following: look at the screen are there more than five stripes?
...And 4 more matches
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
in these g
uides, i have already touched on an important feature of grid layout: the support for different writing modes that is b
uilt into the specification.
... for this g
uide, we will look at this feature of grid and other modern layout methods, learning a little about writing modes and logical vs.
...we need a new reference point, and this is where understanding the block and inline axes, that we met previously in the g
uide to alignment, becomes very useful.
...And 4 more matches
clamp() - CSS: Cascading Style Sheets
it has the same effect as the code in fl
uid typography but in one line, and without the use of media queries.
...fusce iaculis, libero q
uis elementum viverra, nulla ante accumsan lectus, sit amet convallis lacus ipsum vel est.
...ut vestibulum, sem in semper aliquet, felis arcu e
uismod sapien, ac imperdiet massa nisl q
uis sem.
...And 4 more matches
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
it may contain one or more audio sources, represented using the src attribute or the <source> element: the browser will choose the most s
uitable one.
...if you must offer autoplay functionality, you should make it opt-in (req
uiring a user to specifically enable it).
...see our autoplay g
uide for additional information about how to properly use autoplay.
...And 4 more matches
<details>: The Details disclosure element - HTML: Hypertext Markup Language
this might look like the following: here we see a standard disclosure widget with the label "system req
uirements", in its default closed state.
... note: unfortunately, at this time there's no b
uilt-in way to animate the transition between open and closed.
... <details> <p>req
uires a computer running an operating system.
...And 4 more matches
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
src req
uired for <audio> and <video>, address of the media resource.
... when used in the context of a <picture> element, the browser will fall back to using the image specified by the <picture> element's <img> child if it is unable to find a s
uitable image to use after examing every provided <source>.
... for information about image formats supported by web browsers and g
uidance on selecting appropriate formats to use, see our image file type and format g
uide on the web.
...And 4 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
if you must offer autoplay functionality, you should make it opt-in (req
uiring a user to specifically enable it).
...see our autoplay g
uide for additional information about how to properly use autoplay.
...here is a <a href="myvideo.mp4">link to the video</a> instead.</p> </video> we offer a substantive and thorough g
uide to media file types and the g
uide to the codecs supported for video.
...And 4 more matches
HTML: Hypertext Markup Language
html (hypertext markup language) is the most basic b
uilding block of the web.
... get started beginner's tutorials our html learning area features multiple modules that teach html from the ground up — no previous knowledge req
uired.
...this article provides a basic g
uide to how preload works.
...And 4 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
aders automatically set by the user agent (for example, connection, user-agent, or the other headers defined in the fetch spec as a “forbidden header name”), the only headers which are allowed to be manually set are those which the fetch spec defines as a “cors-safelisted request-header”, which are: accept accept-language content-language content-type (but note the additional req
uirements below) dpr downlink save-data viewport-width width the only allowed values for the content-type header are: application/x-www-form-urlencoded multipart/form-data text/plain no event listeners are registered on any xmlhttprequestupload object used in the request; these are accessed using the xmlhttprequest.upload property.
...what values webkit/safari consider “nonstandard” is not documented, except in the following webkit bugs: req
uire preflight for non-standard cors-safelisted request headers accept, accept-language, and content-language allow commas in accept, accept-language, and content-language request headers for simple cors switch to a blacklist model for restricted accept headers in simple cors requests no other browsers implement these extra restrictions, because they’re not part of the spec.
... the request was redirected to 'https://example.com/foo', which is disallowed for cross-origin requests that req
uire preflight request req
uires preflight, which is disallowed to follow cross-origin redirect the cors protocol originally req
uired that behavior but was subsequently changed to no longer req
uire it.
...And 4 more matches
Index - HTTP
13 access-control-request-headers cors, http, reference, header the access-control-request-headers request header is used when iss
uing a preflight request to let the server know which http headers will be used when the actual request is made.
... 14 access-control-request-method cors, http, reference, header the access-control-request-method request header is used when iss
uing a preflight request to let the server know which http method will be used when the actual request is made.
... 45 csp: req
uire-sri-for csp, directive, http, reference, security the http content-security-policy req
uire-sri-for directive instructs the client to req
uire the use of subresource integrity for scripts or styles on the page.
...And 4 more matches
HTTP headers - HTTP
accept-ch servers can advertise support for client hints using the accept-ch header field or an eq
uivalent html <meta> element with http-eq
uiv attribute ([html5]).
... access-control-request-headers used when iss
uing a preflight request to let the server know which http headers will be used when the actual request is made.
... access-control-request-method used when iss
uing a preflight request to let the server know which http method will be used when the actual request is made.
...And 4 more matches
Assertions - JavaScript
in this example, we can get the fr
uits that start with 'a' by a /^a/ regex.
... for selecting appropriate fr
uits we can use the filter method with an arrow function.
... let fr
uits = ["apple", "watermelon", "orange", "avocado", "strawberry"]; // select fr
uits started with 'a' by /^a/ regex.
...And 4 more matches
Array - JavaScript
common operations create an array let fr
uits = ['apple', 'banana'] console.log(fr
uits.length) // 2 access an array item using the index position let first = fr
uits[0] // apple let last = fr
uits[fr
uits.length - 1] // banana loop over an array fr
uits.foreach(function(item, index, array) { console.log(item, index) }) // apple 0 // banana 1 add an item to the end of an array let newlength = fr
uits.push('orange') // ["apple", "ban...
...ana", "orange"] remove an item from the end of an array let last = fr
uits.pop() // remove orange (from the end) // ["apple", "banana"] remove an item from the beginning of an array let first = fr
uits.shift() // remove apple from the front // ["banana"] add an item to the beginning of an array let newlength = fr
uits.unshift('strawberry') // add to the front // ["strawberry", "banana"] find the index of an item in the array fr
uits.push('mango') // ["strawberry", "banana", "mango"] let pos = fr
uits.indexof('banana') // 1 remove an item by index position let removeditem = fr
uits.splice(pos, 1) // this is how to remove an item // ["strawberry", "mango"] remove items from an index position let vegetables = ['cabbage', 'turnip', 'radish', 'carrot'] console.log(vegetables) // ["ca...
... console.log(vegetables) // ["cabbage", "carrot"] (the original array is changed) console.log(removeditems) // ["turnip", "radish"] copy an array let shallowcopy = fr
uits.slice() // this is how to make a copy // ["strawberry", "mango"] accessing array elements javascript arrays are zero-indexed.
...And 4 more matches
Object.create() - JavaScript
however, when attempting to actually use these objects, their differences q
uickly become apparent: > "oco is: " + oco // shows "oco is: [object object]" > "ocn is: " + ocn // throws error: cannot convert object to primitive value testing just a few of the many most basic b
uilt-in functions shows the magnitude of the problem more clearly: > alert(oco) // shows [object object] > alert(ocn) // throws error: cannot convert object to primitive value > oco.tostring() // sh...
...a function > oco.valueof() // shows {} > ocn.valueof() // throws error: ocn.valueof is not a function > oco.hasownproperty("p") // shows "true" > ocn.hasownproperty("p") // throws error: ocn.hasownproperty is not a function > oco.constructor // shows "object() { [native code] }" > ocn.constructor // shows "undefined" as said, these differences can make debugging even simple-seeming problems q
uickly go astray.
...ct (same as before) ocn.tostring = object.tostring; // since new object lacks method then try assigning it directly from standard-object > ocn.tostring // shows "tostring() { [native code] }" -- missing method seems to be there now > ocn.tostring == object.tostring // shows "true" -- method seems to be same as the standard object-method > ocn.tostring() // error: function.prototype.tostring req
uires that 'this' be a function adding the missing object-method directly to new object's "prototype" does not work either, since the new object does not have a real prototype (which is really the cause of all these problems) and one cannot be directly added: ocn = object.create( null ); // create "null" object (same as before) ocn.prototype.tostring = object.tostring; // error: cannot set pro...
...And 4 more matches
Iteration protocols - JavaScript
as a couple of additions to ecmascript 2015, iteration protocols aren't new b
uilt-ins or syntax, but protocols.
...some b
uilt-in types are b
uilt-in iterables with a default iteration behavior, such as array or map, while other types (such as object) are not.
...(this is eq
uivalent to not specifying the done property altogether.) has the value true if the iterator has completed its sequence.
...And 4 more matches
JavaScript
get started tutorials learn how to program in javascript with g
uides and tutorials.
... javascript b
uilding blocks continues our coverage of javascript's key fundamental features, turning our attention to commonly-encountered types of code blocks such as conditional statements, loops, functions, and events.
... javascript g
uide javascript g
uide a much more detailed g
uide to the javascript language, aimed at those with previous programming experience either in javascript or another language.
...And 4 more matches
Authoring MathML - MathML
mathematical notations are even more complex with structures like fractions, square roots or matrices that are likely to req
uire their own tags.
... mathml in xml documents (xhtml, epub, etc) if for some reason you need to use mathml in xml documents, be sure to satisfy the usual req
uirements: well-formed document, use of correct mime type, mathml namespace "http://www.w3.org/1998/math/mathml" on <math> roots.
... pros: writing mathematical expressions may only req
uire a standard text editor.
...And 4 more matches
Optimizing startup performance - Web Performance
starting up nicely regardless of platform, it's always a good idea to start up as q
uickly as possible.
...instead, we're going to look at a more important issue when b
uilding web apps: starting up as asynchronously as possible.
... instead, you should write your code so that your app creates a web worker that does as much as possible in a background thread (for example, fetching and processing data.) then, anything that must be done on the main thread (such as user events and rendering
ui) should be broken up into small pieces so that the app's event loop continues to cycle while it starts up.
...And 4 more matches
Namespaces crash course - SVG: Scalable Vector Graphics
being able to mix content types like this has many advantages, but it also req
uired a very real problem to be solved.
...how should the user agent disting
uish between the two?
...xml, and some xml dialects (svg included), don't req
uire a doctype declaration, and svg 1.2 won't even have one.
...And 4 more matches
Index - XSLT: Extensible Stylesheet Language Transformations
since the xml data loaded only contains the raw information without any presentation data, it can load q
uickly even on dialup.
... 12 setting parameters xslt while running transformations using precoded .xsl and .xml files is q
uite useful, configuring the .xsl file from javascript may be even more useful.
...import precedence req
uires that template rules in main stylesheets have higher precedence than template rules in imported stylesheets.
...And 4 more matches
WebAssembly Concepts - WebAssembly
it has many advantages — it is dynamically typed, req
uires no compile step, and has a huge ecosystem that provides powerful frameworks, libraries, and other tools.
... the different code types can call each other as req
uired — the webassembly javascript api wraps exported webassembly code with javascript functions that can be called normally, and webassembly code can import and synchronously call normal javascript functions.
...these libraries are implemented in terms of web apis and thus each one req
uires some javascript glue code to connect webassembly to the underlying web api.
...And 4 more matches
Using the WebAssembly JavaScript API - WebAssembly
these methods don't directly access the byte code, so req
uire an extra step to turn the response into an arraybuffer before compiling/instantiating the wasm module.
... the eq
uivalent code would look like this: fetch('simple.wasm').then(response => response.arraybuffer() ).then(bytes => webassembly.instantiate(bytes, importobject) ).then(results => { results.instance.exports.exported_func(); }); viewing wasm in developer tools in firefox 54+, the developer tool debugger panel has functionality to expose the text representation of any wasm code included in a web page.
... let’s start exploring this by looking at a q
uick example.
...And 4 more matches
Communicating With Other Scripts - Archive of obsolete content
this section of the g
uide explains how content scripts can communicate with: your main.js file, or any other modules in your add-on other content scripts loaded by your add-on page scripts (that is, scripts embedded in the web page or included using <script> tags) main.js your content scripts can communicate with your add-on's "main.js" (or any other modules you're written for your add-on) by sending it messages, using either the port.emit() api or the postmessage() api.
... in the main add-on code, we have a page-mod that attaches the content script "talk.js" to the right page: var data = req
uire("sdk/self").data; var pagemod = req
uire("sdk/page-mod"); pagemod.pagemod({ include: "http://my-domain.org/listen.html", contentscriptfile: data.url("talk.js") }); the "talk.js" content script uses window.postmessage() to send the message to the page: // content-script (talk.js) window.postmessage("message from content script", "http://my-domain.org/"); the second argument may be '*' w...
... here "main.js" creates a page-mod that attaches "listen.js" to the web page: var data = req
uire("sdk/self").data; var pagemod = req
uire("sdk/page-mod"); pagemod.pagemod({ include: "http://my-domain.org/talk.html", contentscriptfile: data.url("listen.js") }); the web page "talk.html" embeds a script that uses window.postmessage() to send the content script a message when the user clicks a button: <!doctype html> <html> <head></head> <body> <script> function sendmessag...
...And 3 more matches
Two Types of Scripts - Archive of obsolete content
minimally you'll have a single module implemented by a script called "main.js", but you can include additional modules in lib, and import them using the req
uire() function.
... to learn all about content scripts read the working with content scripts g
uide.
... ✔ ✔ the req
uire() and exports globals defined by version 1.0 of the commonjs module specification.
...And 3 more matches
clipboard - Archive of obsolete content
var clipboard = req
uire("sdk/clipboard"); clipboard.set("lorem ipsum dolor sit amet"); var contents = clipboard.get(); set the clipboard contents to some html.
... var clipboard = req
uire("sdk/clipboard"); clipboard.set("<blink>lorem ipsum dolor sit amet</blink>", "html"); if the clipboard contains html content, open it in a new tab.
... var clipboard = req
uire("sdk/clipboard"); if (clipboard.currentflavors.indexof("html") != -1) req
uire("sdk/tabs").open("data:text/html;charset=utf-8," + clipboard.get("html")); set the clipboard contents to an image.
...And 3 more matches
simple-storage - Archive of obsolete content
to store a value, just assign it to a property on storage: var ss = req
uire("sdk/simple-storage"); ss.storage.myarray = [1, 1, 2, 3, 5, 8, 13]; ss.storage.myboolean = true; ss.storage.mynull = null; ss.storage.mynumber = 3.1337; ss.storage.myobject = { a: "foo", b: { c: true }, d: null }; ss.storage.mystring = "o frabjous day!"; you can store array, boolean, number, object, null, and string values.
...var ss = req
uire("sdk/simple-storage"); ss.foo = "i will not be saved!
... important: if you use this method, you must end your debugging session by q
uitting firefox normally, not by cancelling the shell command.
...And 3 more matches
Developing for Firefox Mobile - Archive of obsolete content
firefox for android implements its
ui using native android widgets instead of xul.
...the tables at the end of this g
uide list the modules that are currently supported on firefox mobile.
...then: install the nightly b
uild of the native version of firefox mobile on the device.
...And 3 more matches
Preferences - Archive of obsolete content
information here applies to the mozilla s
uite, firefox, thunderbird, and possibly other mozilla-based applications.
... (this is not exactly how it's coded in libpref, but it's eq
uivalent) where the default values are read from all mozilla-based applications read (application directory)/defaults/preferences/*.js in addition to that, recent versions of toolkit applications (firefox 1.0, thunderbird 1.0, and the like but not the mozilla s
uite) read extension defaults -- usually located in (profile folder)/extensions/(id)/defaults/preferences/ these files use simple java...
...to add a default value for a preference, you should add a line like this to your default preferences file: pref("extensions.extensionname.preferencename", false); how to install an extension's defaults files for mozilla s
uite (not firefox and thunderbird), copy them to (appdir)/defaults/pref in your install script.
...And 3 more matches
Extension Etiquette - Archive of obsolete content
it assumes that you are already familiar with b
uilding an extension.
...ideally, the location would be below the add-ons item, grouped with the other extension-related commands (men
uitem:insertafter="javascriptconsole,devtoolsseparator").
... other
ui elements in general, toolbar items are very useful to end users because they can be removed or added to various toolbars as necessary.
...And 3 more matches
Inline options - Archive of obsolete content
pe="color" title="color"/> <!-- file and directory examples --> <setting pref="extensions.myaddon.file" type="file" title="file"/> <setting pref="extensions.myaddon.directory" type="directory" title="directory"/> <!-- list example (this example would be stored as an integer) --> <setting pref="extensions.myaddon.options1" type="menulist" title="options 1"> <menulist> <menupopup> <men
uitem value="500" label="small"/> <men
uitem value="800" label="medium"/> <men
uitem value="1200" label="large"/> </menupopup> </menulist> </setting> <!-- radio button example (this example would be stored as a boolean) --> <setting pref="extensions.myaddon.options2" type="radio" title="options 2"> <radiogroup> <radio value="false" label="disabled"/> <radio value="true" la...
... some discussion on the subject at stackoverflow: how to use addeventlistener on inputchanged of inline options display notifications if you want to use the settings
ui for anything more than storing preferences, then you will probably need to initialize them when they first appear.
... note: starting in gecko 13.0, you can also listen for the addon-options-hidden notification, which has the same subject and data as above, to find out when the
ui is about to be removed.
...And 3 more matches
Connecting to Remote Content - Archive of obsolete content
the open method takes two req
uired parameters: the http request method and the url to send the request.
...sending a post request req
uires you to set the content type of the request and to pass the post data to the send() method as below.
...l returned from remote server is this: <?xml version="1.0"?> <data> <shops> <shop> <name>apple</name> <code>a001</code> </shop> <shop> <name>orange</name> </shop> </shops> <total>2</total> </data> when a valid xml response comes back from the remote server, the xml document object can be manipulated using different dom methods, to display the data in the
ui or store it into a local datasource.
...And 3 more matches
Custom XUL Elements with XBL - Archive of obsolete content
the element that the binding is attached to, called the bound element, acq
uires the new behavior specified by the binding.
...download the hello world xbl project, b
uild it and test it for a while.
...we didn't need to create a whole xul structure that would req
uire around 7 nodes every time a "person" is created.
...And 3 more matches
Tabbed browser - Archive of obsolete content
opening a url in the correct window/tab there are methods available in chrome://browser/content/utilityoverlay.js that make it easy to open url in tabs such as open
uilinkin and open
uilink.
... open
uilinkin( url, where, allowthirdpartyfixup, postdata, referrerurl ) where: "current" current tab (if there aren't any browser windows, then in a new window instead) "tab" new tab (if there aren't any browser windows, then in a new window instead) "tabshifted" same as "tab" but in background if default is to select new tabs, and vice versa "window" new window "save" save to disk (with no filename hint!) open
uilink( url, e, ignorebutton, ignorealt, allowkeywordfixup, postdata, referrerurl ) the following code will open a url in a new tab, an existing tab, or an existing window based on which mouse button was pressed and which hotkeys (ex: ctrl) are being held.
... the code given is for a men
uitem, but will work equally well for other xul elements.
...And 3 more matches
Installing plugins to Gecko embedding browsers on Windows - Archive of obsolete content
thus, some mozilla based browsers, such as the netscape 6 installer, write to the hkey_current_user key in addition; this doesn't req
uire administrator privileges.
...future mozilla based browsers won't disting
uish between plugins and components, and will pick both up from a common location.
...thus, software such as the netscape 6 installer writes to the hkey_current_user key additionally, which doesn't req
uire administrator privileges.
...And 3 more matches
Source Navigator - Archive of obsolete content
(quoted from the internet) source-navigator is a source code analysis tool which lets users to edit, browse and b
uild their projects.
...you can also b
uild your projects, either with your own makefile, or by using source-navigator's b
uild system to automatically generate a makefile.
... source-navigator works with the insight g
ui interface for gdb.
...And 3 more matches
Tinderbox - Archive of obsolete content
it consists of a set of client machines that continuously b
uild and test mozilla and report their results back to a server that makes those results available via a web page.
...while it isn't difficult to load the tinderbox web page or sidebar, it would be useful to have an even q
uicker way to check tinderbox that doesn't req
uire going to a web page, changing sidebars, or even having the sidebar open.
... although there are multiple tinderbox clients machines doing different kinds of b
uilds (f.e.
...And 3 more matches
Dehydra Function Reference - Archive of obsolete content
decl is a variable type input_end() called once at the end of the c++ source file before the compiler q
uits.
...b
uiltin functions the following functions are provided by dehydra and may be called by the user: print(msg) print a string to stdout (or stderr if the compiler is piping output).
...include example include("map.js") // includes map.js into toplevel var map = {} include("map.js", map) // includes map.js into the map object req
uire({version:, strict:, werror:, gczeal:}) req
uire is used to set runtime execution flags.
...And 3 more matches
Download Manager preferences - Archive of obsolete content
browser.download.manager.alertonexeopen a boolean value that indicates whether the
ui should alert the user about the dangers of opening (executing) an exe.
... the user may check a "don't ask" box on the
ui to toggle this.
... browser.download.manager.q
uitbehavior indicates what should happen to in-progress downloads if the application is q
uit while they're ongoing.
...And 3 more matches
Repackaging Firefox - Archive of obsolete content
important legal considerations before you get started, it is very important to know and abide by the legal req
uirements for distributing firefox.
...at the time of writing this document, the latest b
uilds are here.
... once you have all the ingredients, the customization process is q
uite easy: download the firefox installer.
...And 3 more matches
Java in Firefox Extensions - Archive of obsolete content
the following approach is taken from the extension xquseme (note you must use the latest version, currently still in the sandbox, as prior versions only worked with liveconnect before java 6 update 11) which borrows some of the code of the java firefox extension in order to grant full privileges to java within a firefox extension, but it is easier to understand and doesn't req
uire creation of a xpcom component.
... [note: a simpler hello world version than that below is now available at http://brett-zamir.me/java_demo/ ] for privileges, the basic procedure is: download and include http://simile.mit.edu/repository/jav...nsionutils.jar within your extension (you can also b
uild your own from the source files at http://simile.mit.edu/repository/jav...xtensionutils/ ) b
uild and add references leading to this jar and all other jars in your extension within an array of java.net.url's, pass to java.net.urlclassloader to get a class loader, and finally pass the classloader and array to a function which gives the necessary privileges: // this function will be called to give the necessary privileges to your jar files // however, the policy never comes into play, because // (1) adding permissions doesn't ...
...// g
uid of extension getitemlocation("test@yoursite"); //the path logic would work if we include em:unpack for ff 4.x, for ff 3.x since things are unpacked by default things work // get path to the jar files (the following assumes your jars are within a // directory called "java" at the root of your extension's folder hierarchy) // you must add this utilities (classloader) jar to give you...
...And 3 more matches
How to Write and Land Nanojit Patches - Archive of obsolete content
repository: http://hg.mozilla.org/projects/nanojit-central (or clone ssh://hg.mozilla.org/projects/nanojit-central if you want to actually commit changes) tinderbox: http://tinderbox.mozilla.org/showb
uilds.cgi?tree=nanojit commit log: http://hg.mozilla.org/projects/nanojit-central/shortlog/ irc channel: irc.mozilla.org #nanojit procedure the first thing to understand is that there are now three copies of nanojit in public mozilla.com repositories: one in nanojit-central, one in tracemonkey, one in tamarin-redux.
... here's how to clone and b
uild nanojit-central: $ hg clone ssh://hg.mozilla.org/projects/nanojit-central $ cd nanojit-central $ autoconf $ mkdir b
uild $ cd b
uild $ ../configure $ make $ make check learn and setup automated testing for all three repositories.
... for tracemonkey, use the "make update-nanojit" target (it req
uires that mercurial's "convert" extension be enabled; add "hgext.convert =" to your .hgrc file under "[extensions]").
...And 3 more matches
Prism - Archive of obsolete content
minimal user interface: a general-purpose browser
ui is not necessary or appropriate for most web apps.
... it is more efficient to provide a
ui that is specific to the application.
... this also cuts down on
ui clutter (hence the term distraction-free browser).
...And 3 more matches
Space Manager Detailed Design - Archive of obsolete content
valend) { mfloatdamage.includeinterval(aintervalbegin + my, aintervalend + my); } prbool intersectsdamage(nscoord aintervalbegin, nscoord aintervalend) { return mfloatdamage.intersects(aintervalbegin + my, aintervalend + my); } #ifdef debug /** * dump the state of the spacemanager out to a file */ nsresult list(file* out); void sizeof(nsisizeofhandler* ahandler, pr
uint32* aresult) const; #endif private: // structure that maintains information about the region associated // with a particular frame struct frameinfo { nsiframe* const mframe; nsrect mrect; // rectangular region frameinfo* mnext; frameinfo(nsiframe* aframe, const nsrect& arect); #ifdef ns_b
uild_refcnt_logging ~frameinfo(); #endif }; // doubly li...
.../sentinel for circular linked list of band rects frameinfo* mframeinfomap; nsintervalset mfloatdamage; static print32 scachedspacemanagercount; static void* scachedspacemanagers[ns_space_manager_cache_size]; nsspacemanager(const nsspacemanager&); // no implementation void operator=(const nsspacemanager&); // no implementation }; public api life cycle the constructor req
uires a presentation shell, used for arena allocations mostly, and a frame that this space manager is rooted on.
..., nscoord aintervalend) { mfloatdamage.includeinterval(aintervalbegin + my, aintervalend + my); } prbool intersectsdamage(nscoord aintervalbegin, nscoord aintervalend) { return mfloatdamage.intersects(aintervalbegin + my, aintervalend + my); } debug only methods /** * dump the state of the spacemanager out to a file */ nsresult list(file* out); void sizeof(nsisizeofhandler* ahandler, pr
uint32* aresult) const; unused / obsolete methods /* * get the frame that's associated with the space manager.
...And 3 more matches
Standalone XPCOM - Archive of obsolete content
standalone xpcom is a tree configuration that b
uilds a minimal set of libraries (shared mostly) that can be used to get all features of xpcom.
... note 2: xpcom standalone differs from the xpcom b
uilt with mozilla.
... b
uilding standalone xpcom here are the instructions for b
uilding the standalone xpcom on unix or windows: step 1 : pull the sources cvs -z 3 co mozilla/client.mk cd mozilla gmake -f client.mk pull_all b
uild_modules=xpcom step 2 : b
uild xpcom standalone ./configure --enable-standalone-modules=xpcom --enable-application=standalone gmake testing standalone xpcom xpcom/sample contains a sample application and a component.
...And 3 more matches
The new nsString class implementation (1999) - Archive of obsolete content
in the meantime, try the xpcom string g
uide—but note that that article bears a warning of its own!
...the deficiencies of the current implementation are: class based -- making it uns
uitable for cross-dll usage due to fragility little intrinsic i18n support few efficiencies, notably a lack of support for narrow (1-byte) character strings no support for external memory management policy lack of xpcom interface notable features of the new nsstrimpl implementation are: intrinsic support for 1 and 2 byte character widths provides automatic conversion between strings with dif...
...ferent character sizes inviolate base structure eliminates class fragility problem; safe across dll boundaries offers c-style function api to manipulate nsstrimpl offers simple memory allocator api for specialized memory policy shares binary format with bstring coming soon: a new xpcom (nsistring) interface non-templatized; this is a req
uirement for gecko very efficient buffer manipulation architecture the fundamental data type in the new architecture is struct nsstrimpl, given below: struct nsstrimpl { print32 mlength; void* mbuffer; print32 mcapacity; char mcharsize; char munused; // and now for the nsstrimpl api...
...And 3 more matches
How to implement a custom XUL query processor component - Archive of obsolete content
the xul template g
uide has lots of detailed information on using xul templates.
...the templating system also supports b
uilding custom query processors.
... rulematched: function(aquery, arulenode) { }, // the output for a result has been removed and the result is no longer being used by the b
uilder hasbeenremoved: function() { } }; // basic wrapper for nsisimpleenumerator function templateresultset(aarrayofdata) { this._index = 0; this._array = aarrayofdata; } templateresultset.prototype = { queryinterface: xpcomutils.generateqi([components.interfaces.nsisimpleenumerator]), hasmoreelements: function() { return this._index < this._array.length; }, getnext: function...
...And 3 more matches
MenuButtons - Archive of obsolete content
for instance, in the following example, pressing the 'view' button will open a menu which allows the user to select from a set of radio men
uitems.
... <button type="menu" label="view"> <menupopup> <men
uitem label="icons" type="radio" name="view"/> <men
uitem label="list" type="radio" name="view"/> <men
uitem label="details" type="radio" name="view"/> </menupopup> </button> note that when the menu is closed, the button doesn't indicate which view is selected.
... <toolbarbutton type="menu" image="cookies.png"> <menupopup> <men
uitem label="block cookies" type="checkbox"/> <men
uitem label="clear cookies"/> </menupopup> </toolbarbutton> the 'menu-button' button the 'menu-button' type of button is used when you want to attach a menu to a button but want to have a default action carried out when the button is pressed by itself.
...And 3 more matches
Containment Properties - Archive of obsolete content
<vbox datasources="template-g
uide-ex1.rdf" ref="http://www.xulplanet.com/rdf/a" containment="http://www.xulplanet.com/rdf/relateditem"> <template> <rule> <label uri="rdf:*" value="rdf:*"/> </rule> </template> </vbox> instead of iterating over a container, this example iterates over a specific predicate.
...the b
uilder treats the predicate in the containment attribute as an indicator that an element is a container.
... if the starting node (or ref) has that predicate as one of its triples in the rdf data, the b
uilder will use it in addition to checking if it is a container.
...And 3 more matches
Recursive Generation - Archive of obsolete content
« previousnext » in the previous example, the template b
uilder generated an extra set of two buttons for the second row.
...after generating content, the template b
uilder always repeats the generation for inner levels as far as it can go.
... thus, the b
uilder can be said to generate content from the graph recursively.
...And 3 more matches
Commands - Archive of obsolete content
commands provide a s
uitable way to abstract operations from the code.
...if you did not use commands, you would need to figure out which field has the focus, then check to ensure that the operation is s
uitable for that element.
... in addition, the menu commands would need to be enabled and disabled depending on whether the focused element had selected text or not, and for paste operations, whether there is something s
uitable on the clipboard to paste.
...And 3 more matches
Manifest Files - Archive of obsolete content
extensions will make the most use of overlays, since they merge their
ui with the browser
ui.
...in javascript, it is possible for a web page to override b
uilt-in functions with their own code.
... if the xpcnativewrappers flag is specified, it indicates that scripts running in a privileged context don't call these overridden versions, but the original b
uilt-in versions instead.
...And 3 more matches
Writing Skinnable XUL and CSS - Archive of obsolete content
mozilla can have any number of installed
ui packages, from navigator to sidebar to editor.
...if you wish for your package to blend in with the other packages, then the skin for your package should inherit information from the global skin in order to reduce the amount of duplication across packages and in order to make the
ui as a whole easier to skin.
...this rule also applies when designing a css file for a
ui component that will be overlayed into other components.
...And 3 more matches
XUL Questions and Answers - Archive of obsolete content
how to use dynamic objects in toolbar there may be a few ways to implement this: by b
uilding your menupopup from an rdf datasource, which could be generated on the server.
...json string) from the server, parsing it on client, and b
uilding the menupopup using dom methods (such as document.createelementns).
...pass a python string/int/etc to the method req
uiring an nsivariant.
...And 3 more matches
radio - Archive of obsolete content
for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
... visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
...And 3 more matches
XULRunner tips - Archive of obsolete content
extensions' list: copy files fuelapplication.js and fuelapplication.manifest from browser/fuel/src for instance into your components/ directory tweak the line #include ../../../toolkit/components/exthelper/extapplication.js in your copy of fuelapplication.js as needed make sure to declare the fuel module and the two files in your components/makefile.in as in browser/fuel/src/makefile.in reb
uild...
... useful chrome urls most of these req
uire branding.
...nt/extensions/extensions.xul?type=extensions extension:manager-extensions theme manager chrome://mozapps/content/extensions/extensions.xul?type=themes extension:manager-themes javascript console chrome://global/content/console.xul global:console about:config chrome://global/content/config.xul developer extensions venkman need a custom b
uild or a compatible extension need to edit compatibility in needs a method to start venkman (usually by overlaying the main xul file, similar to existing code for firefox, s
uite, etc.) the function toopenwindowbytype() needs to be defined.
...And 3 more matches
2006-10-06 - Archive of obsolete content
summary: mozilla.dev.apps.thunderbird - september 30-october 06, 2006 announcements mac user needed scott macgregor announced that .mac support and a dynamically add isp account feature has been added to the thunderbird account manager, however, testing is req
uired before release can be issued.
... hence, they are looking for a mac user to test out the new features by b
uilding a mac.rdf file with all of the various .mac account properties mentioned in the document here.
... q & a q: walt experienced an unusual behaviour in his b
uild and wanted to perform an experiment to figure out the problem, but he couldn't find the mozilla.org's config file.
...And 3 more matches
2006-11-10 - Archive of obsolete content
summary: mozilla.dev.b
uilds - november 4th to november 10th 2006 browser buttons november 4th: mojr wants to know if firefox has a similar feature that the new ie 6 has b
uilt in.
... reflow branch b
uild failed with vc 7.1 sp1 november 8th: roy received an error when he tried to reflow a branch b
uild using vc 7.1 sp1.
... b
uilding xulrunner application with mozilla november 8th: kirans is trying to b
uild mozilla with xulrunner option on a windows machine.
...And 3 more matches
Writing a plugin for Mac OS X - Archive of obsolete content
getting started if you check out the mozilla source code in mac os x, you can simply open basicplugin.xcodeproj in xcode, click b
uild, and you're done.
... xcode will create a "b
uild" directory next to the project file, and if you b
uilt it in release mode, that folder in turn contains a "release" directory with the plugin inside it.
... notes and tips this section provides some additional information that may be helpful if you're trying to get a plugin b
uilding on your own.
...And 3 more matches
Common Firefox theme issues and solutions - Archive of obsolete content
it is a companion document to the amo editors g
uide common theme problems, which provides editors with "boilerplate" copy and paste review notes for common theme issues.
...a little experimenting may be req
uired to fully address this issue with your theme.
...e > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon, #identity-box[open=true] > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon { -moz-image-region: rect(0, 48px, 16px, 32px); } #page-proxy-favicon[pageproxystate="invalid"] { opacity: 0.5; } for more information about identity boxes please see the identity box section of the amo editors theme review g
uidelines no visual clue for disabled url bars there needs to be a visual clue when url bar is disabled.
...And 3 more matches
JSObject - Archive of obsolete content
see the core javascript 1.5 g
uide for more information about data type conversions.
...eq
uivalent to "this.methodname(args[0], args[1], ...)" in javascript.
...eq
uivalent to "this.name" in javascript.
...And 3 more matches
Windows Media in Netscape - Archive of obsolete content
netscape 7.1 has the ability to load the microsoft® windows media player™ as an activex control, and thus developers can now b
uild multimedia experiences that script the windows media player in netscape 7.1, just as they do in internet explorer.
...netscape 7.1 is the first netscape gecko™ browser to support the windows media player as an activex control -- previous netscape browsers did not support any activex controls, and thus detecting which versions of netscape support the windows media activex control is an important first step towards b
uilding multimedia experiences using html, javascript, and the windows media activex control.
... this is the example: needs to be embedded in wiki page (can it just be put here?) <object id="playerex2" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" height="200" width="200"> <param name="
uimode" value="full"> <param name="autostart" value="true"> <param name="url" value="media/preludesteel.wma"> your browser does not support the activex windows media player </object> the same markup (used above and shown below) will work in both ie and netscape 7.1.
...And 3 more matches
XUL Parser in Python - Archive of obsolete content
v.00001 to celebrate activestate's recent announcement about support for perl and python in mozilla, i have put together this little python script that parses your local xul and b
uilds a list of all the xul elements and their attributes in an html page.
... with new widgets and attributes landing all the time, i wanted to get some q
uicker way of looking at the xul--at particular b
uilds, at particular widgets, at which elements had which attributes, etc.
...for example, you could easily adapt this to: return the id values of all the elements take elements on the command line and only spell them out b
uild new chrome subdirectories (i.e.
...And 3 more matches
Introduction to game development for the Web - Game development
the modern web has q
uickly become a viable platform not only for creating stunning, high quality games, but also for distributing those games.
...thanks to massive performance improvements in javascript just-in-time compiler technology and new apis, you can b
uild games that run in the browser (or on html5-powered devices) without making compromises.
...games b
uilt with html5 work on smartphones, tablets, pcs and smart tvs.
...And 3 more matches
Explaining basic 3D theory - Game development
objects different types of objects are b
uilt using vertices.
... you can b
uild geometry using this information — here is an example of a cube: a face of the given shape is a plane between vertices.
...the geometry is b
uilt from a vertex and the face, while material is a texture, which uses a color or an image.
...And 3 more matches
Audio for Web games - Game development
this article provides a detailed g
uide to implementing audio for web games, looking at what works currently across as wide a range of platforms as possible.
...however, preloading is still useful — without it, there would always need to be some client-server communication req
uired before playing can commence.
... concurrent audio playback a req
uirement of many games is the need to play more than one piece of audio at the same time; for example, there might be background music playing along with sound effects for various things happening in the game.
...And 3 more matches
WCAG - MDN Web Docs Glossary: Definitions of Web-related terms
web content accessibility g
uidelines (wcag) are a recommendation published by the web accessibility initiative group at the w3c.
... they outline a set of g
uidelines for making content accessible primarily for people with disabilities but also for limited-resource devices such as mobile phones.
...it consists of 12 g
uidelines organized under 4 principles (perceivable, operable, understandable, and robust) and each g
uideline has testable success criteria.
...And 3 more matches
Accessible multimedia - Learn web development
prereq
uisites: basic computer literacy, a basic understanding of html, css, and javascript, an understanding of what accessibility is.
... the problem with native html5 controls html5 video and audio instances even come with a set of inb
uilt controls that allow you to control the media straight out of the box.
... different browsers give the native controls differing styling and functionality, and they aren't stylable, meaning that they can't be easily made to follow a site style g
uide.
...And 3 more matches
Overflowing content - Learn web development
previous overview: b
uilding blocks next overflow is what happens when there is too much content to fit in a container.
... in this g
uide you will learn what overflow is and how to manage it.
... prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to understand overflow and how to manage it.
...And 3 more matches
How CSS is structured - Learn web development
prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works.
...with css in internal stylesheets, there is the risk that even one simple styling change may req
uire edits to multiple web pages.
...one styling change might req
uire multiple edits within in a single web page.
...And 3 more matches
create fancy boxes - Learn web development
css boxes are the b
uilding blocks of any web page styled with css.
...it's also a good idea, but not a prereq
uisite, to be familiar with some css layout basics.
...just remember that such use of gradient is q
uite expensive, performance wise.
...And 3 more matches
Fundamental text and font styling - Learn web development
prereq
uisites: basic computer literacy, html basics (study introduction to html), css basics (study introduction to css).
...serif, sans-serif and monospace are q
uite predictable and should provide something reasonable.
... it is a good idea to provide a s
uitable generic font name at the end of the stack so that if none of the listed fonts are available, the browser can at least provide something approximately s
uitable.
...And 3 more matches
Making asynchronous programming easier with async and await - Learn web development
prereq
uisites: basic computer literacy, a reasonable understanding of javascript fundamentals, an understanding of async code in general and promises.
... you are probably already thinking "this is really cool!", and you are right — fewer .then() blocks to wrap around code, and it mostly just looks like synchronous code, so it is really int
uitive.
... if you wanted to use the second (refactored) version of the code that we showed above, you would be better off just contin
uing the hybrid approach and chaining a .catch() block onto the end of the .then() call, like this: async function myfetch() { let response = await fetch('coffee.jpg'); if (!response.ok) { throw new error(`http error!
...And 3 more matches
General asynchronous programming concepts - Learn web development
prereq
uisites: basic computer literacy, a reasonable understanding of javascript fundamentals.
...this is called blocking; the browser is blocked from contin
uing to handle user input and perform other tasks until the web app returns control of the processor.
... in our second example, simple-sync-
ui-blocking.html (see it live), we simulate something slightly more realistic that you might come across on a real page.
...And 3 more matches
Getting Started with Chat
general rules and etiquette once you have your client set up (see software below) and are connected, there are some basic rules you should follow to ensure the most enjoyable and productive experience: as with all mozilla forums and events, agreeing to our community participation g
uidelines is a req
uirement for participation.
...mibbit does not req
uire flash or any other plugins.
...simply type them into the message box at the bottom of the screen and press enter: /join #channel joins you to the specified channel until you q
uit your irc client or q
uit the channel /leave leave the current channel /mode #channel +k password sets a password for the channel.
...And 3 more matches
How to Report a Hung Firefox
what information to include in a bug report as usual, following bug writing g
uidelines will make your report much more likely to lead to a fix in firefox.
... the firefox crash report
ui should appear.
... then, in a terminal, kill firefox using a command such as this: # replace 31042 with the pid of firefox found above kill -n sigabrt 31042 # on osx kill -s sigabrt 31042 the firefox crash report
ui should appear.
...And 3 more matches
API-provided widgets
properties property description id the id of the widget (req
uired).
... viewid only useful for views (and req
uired there): the id of the that should be shown when clicking the widget.
... overflows whether widget can overflow when in an overflowable toolbar (optional, default: true) defaultarea default area to add the widget to (optional, default: none; req
uired if non-removable) shortcutid id of an element that has a shortcut for this widget (optional, default: null).
...And 3 more matches
L10n Checks
once python is installed, the easiest way to install l10n checks (on mac or linux) is to just run: $ sudo easy_install -u l10n-checks or, if you're on windows: $ easy_install -u l10n-checks installation (development versions) l10n checks needs to be installed, and it req
uires that you have python and mercurial installed on your machine.
..."seamonkey" with its extensions), e.g.: check-l10n-completeness -f s
uite/locales/l10n.ini ../l10n/ de test the reference locale in the source mode you can tell l10n checks to also check the reference locale, by setting the -e parameter (req
uires the -a parameter to be set too), e.g.: check-l10n-completeness -a 1 -e s
uite/locales/l10n.ini ../l10n/ de turbo mode in the source mode you can tell l10n checks to look only for missing and obsolete entities and files, by ...
...setting the -t parameter, e.g.: check-l10n-completeness -t s
uite/locales/l10n.ini ../l10n/ de check access keys in all modes you can tell l10n checks to check if the access keys are set properly, by setting the -a parameter, e.g.: check-l10n-completeness -a 1 s
uite/locales/l10n.ini ../l10n/ de there are three modes available: 1: show just errors 2: show errors and important warnings 3: show all errors and warnings spell checking in all modes you can tell l10n checks to search for spelling errors, by setting the -c parameter, e.g.: check-l10n-completeness -c s
uite/locales/l10n.ini ../l10n/ de spell checking req
uires enchant and pyenchant to be installed on the system.
...And 3 more matches
Localizing with Koala
introduction this tutorial will g
uide you through making a couple of changes to firefox's user interface using koala, an add-on for komodo edit created to help localizing mozilla.
...we will translate a small piece of the
ui found in the search bar.
... req
uirements mercurial, linux, windows or mac os x.
...And 3 more matches
Translation phase
it's up to you and your community to determine which l10n tool will best s
uit your needs.
... these are the l10n tools we use to localize mozilla applications: pootle a user-friendly web portal b
uilt on the translate toolkit api.
... virtaal an offline, stand-alone version of pootle that is also b
uilt on the translate toolkit api.
...And 3 more matches
Localization technical reviews
this g
uide provides details on what a localization technical review is, what criteria are used for the technical reviews, and the process for requesting one and following its progress.
...you need to make sure that your work can effectively be compiled into a b
uild for the next release channel.
...since it is performed on the first revision a l10n team proposes for release, this first revision req
uires a very detailed and comprehensive form of review.
...And 3 more matches
What every Mozilla translator should know
when you create a bug, if you want the person in charge of the l10n to follow up your bug you should cc: l10n@mozilla.com if you choose to make changes to your localization, you should make the changes local to your disk, push them to your hg repository on merucial, test the changes on a nightly/tinderbox b
uild, fix any errors if some are found and test again, and send the new changeset id as your "opt-in" revisions to the l10-drivers.
...for example: bug 12345, fix typos and resize prefwindow, a=l10n as soon as you have committed, put the bug in fixed state and write fixed1.8.xxx in the keyword field you have to verify in the next b
uild that the changes have been successful.
... if so, change the state of the bug to verified and write verified1.8.xxx in the keyword field tinderbox in tinderbox you can see the result of the b
uild process.
...And 3 more matches
Installing JSHydra
prereq
uisites mercurial 1.0 is needed to access source repositories.
... prereq
uisites for b
uilding spidermonkey spidermonkey is part of the b
uild process, but since jshydra will get the code if req
uired, you do not need to worry about obtaining the right version of spidermonkey.
... b
uilding jshydra jshydra req
uires, as part of its b
uild process, spidermonkey.
...And 3 more matches
Optimizing Applications For NSPR
this has proven to be q
uite challenging, a challenge that was met to a large degree, but there is always room for improvement.
... functions called in an application by a shared library req
uire an additional function prolog.
...generally speaking, the native threads (on nt or '95) are q
uite functional.
...And 3 more matches
4.3 Release Notes
new in jss 4.3 a list of bug fixes and enhancement requests were implemented in this release can be obtained by running this bugzilla query jss 4.3 req
uires nss 3.12 or higher.
...st.java) support for all nss 3.12 initialization options (see initializationvalues) new ssl error codes (see http://mxr.mozilla.org/security/sour...util/sslerrs.h) ssl_error_unsupported_extension_alert ssl_error_certificate_unobtainable_alert ssl_error_unrecognized_name_alert ssl_error_bad_cert_status_response_alert ssl_error_bad_cert_hash_value_alert new tls cipher s
uites (see http://mxr.mozilla.org/security/sour...sslsocket.java): tls_rsa_with_camellia_128_cbc_sha tls_dhe_dss_with_camellia_128_cbc_sha tls_dhe_rsa_with_camellia_128_cbc_sha tls_rsa_with_camellia_256_cbc_sha tls_dhe_dss_with_camellia_256_cbc_sha tls_dhe_rsa_with_camellia_256_cbc_sha note: the following tls cipher s
uites are declared but are not yet implemented: ...
...jss is a jni library we provide the jss4.jar but expect you to b
uild the jss's matching jni shared library.
...And 3 more matches
NSS 3.12.5 release_notes
nss 3.12.5 req
uires nspr 4.8.
... you can check out the source from cvs by cvs co -r nspr_4_8_rtm nspr cvs co -r nss_3_12_5_rtm nss see the documentation section for the b
uild instructions.
...these are eq
uivalent to the parameters for pk11_configurepkcs11().
...And 3 more matches
NSS 3.14 release notes
export and des cipher s
uites are disabled by default.
... non-ecc aes and triple des cipher s
uites are enabled by default.
... warning: because of ambig
uity in the current draft text, applications should only use gcm in single-part mode (c_encrypt/c_decrypt).
...And 3 more matches
NSS 3.16 release notes
nss 3.16 req
uires nspr 4.10.3 or newer.
...(this req
uires nspr 4.10.4.) to b
uild for the linux x32 target, set the environment variable use_x32=1 when b
uilding nss.
...- cipher s
uites that were first defined in ssl 3.0 can now be referred to with their official iana names in tls, with the tls_ prefix.
...And 3 more matches
NSS Developer Tutorial
when a block of code consists of a single statement, nss doesn’t req
uire curly braces, so both of these examples are fine: if (condition) { action(); } or: if (condition) action(); although the use of curly braces is more common.
... c features nss req
uires c99.
... the mozilla c++ language features g
uide, and the chromium c++ usage g
uide, list c++ features that are known to be widely available and compatible.
...And 3 more matches
nss tech note3
each of the above seccertusages translates into a req
uired set of cert type and key usage for the certificate itself, and into another set of req
uired cert type and key usage for all the ca certs in the cert chain.
... to determine if a cert is valid for a given cert usage, it must have the the cert type and key usage req
uired for that cert usage, and all the ca certs in the cert chain must have the cert type and key usage req
uired for ca certs for that cert usage.
... there are 8 key usages: cert_sign crl_sign data_encipherment digital_signature govt_approved key_agreement key_encipherment non_repudiation there are 9 cert types: email email_ca object_signing object_signing_ca ssl_ca ssl_client ssl_server status_responder time_stamp for the cert being checked, the req
uirements are: cert usage requried key usage req
uired cert type -------------------- -------------------- ----------------------- sslclient: digital_signature; ssl_client; sslserver: key_agreement or key_encipherment; ssl_server; sslserverwithstepup: govt_approved and ssl_server key_agreement or key_encipherment sslca: cert_sign; ssl_ca; emailsigner: digital_signature; email; emailrecipient: key_agreement or key_encipherment; emai...
...And 3 more matches
NSS tools : ssltab
although you can run the tool at its most basic by iss
uing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful.
...example 1 $ ssltap.exe -sx -p 444 interzone.mcom.com:443 > sx.txt output connected to interzone.mcom.com:443 -->; [ alloclen = 66 bytes [ssl2] clienthellov2 { version = {0x03, 0x00} cipher-specs-length = 39 (0x27) sid-length = 0 (0x00) challenge-length = 16 (0x10) cipher-s
uites = { (0x010080) ssl2/rsa/rc4-128/md5 (0x020080) ssl2/rsa/rc4-40/md5 (0x030080) ssl2/rsa/rc2cbc128/md5 (0x040080) ssl2/rsa/rc2cbc40/md5 (0x060040) ssl2/rsa/des64cbc/md5 (0x0700c0) ssl2/rsa/3des192ede-cbc/md5 (0x000004) ssl3/rsa/rc4-128/md5 (0x00ffe0) ssl3/rsa-fips/3des192ede-cbc/sha (0x00000a) ssl3/rsa/3des192ede-cbc/sha (0x00ffe1) ssl3/rsa-fips/des64cbc/sha (0x000009) ssl3/rsa/des64cbc/sha (0x0...
...} cipher_s
uite = (0x0003) ssl3/rsa/rc4-40/md5 } 0: 0b 00 02 c5 |...Å type = 11 (certificate) length = 709 (0x0002c5) certificatechain { chainlength = 706 (0x02c2) certificate { size = 703 (0x02bf) data = { saved in file 'cert.001' } } } 0: 0c 00 00 ca |....
...And 3 more matches
NSS tools : ssltap
although you can run the tool at its most basic by iss
uing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful.
...example 1 $ ssltap.exe -sx -p 444 interzone.mcom.com:443 > sx.txt output connected to interzone.mcom.com:443 -->; [ alloclen = 66 bytes [ssl2] clienthellov2 { version = {0x03, 0x00} cipher-specs-length = 39 (0x27) sid-length = 0 (0x00) challenge-length = 16 (0x10) cipher-s
uites = { (0x010080) ssl2/rsa/rc4-128/md5 (0x020080) ssl2/rsa/rc4-40/md5 (0x030080) ssl2/rsa/rc2cbc128/md5 (0x040080) ssl2/rsa/rc2cbc40/md5 (0x060040) ssl2/rsa/des64cbc/md5 (0x0700c0) ssl2/rsa/3des192ede-cbc/md5 (0x000004) ssl3/rsa/rc4-128/md5 (0x00ffe0) ssl3/rsa-fips/3des192ede-cbc/sha (0x00000a) ssl3/rsa/3des192ede-cbc/sha (0x00ffe1) ssl3/rsa-fips/des64cbc/sha (0x000009) ssl3/rsa/des64cbc/sha (0x0...
...} cipher_s
uite = (0x0003) ssl3/rsa/rc4-40/md5 } 0: 0b 00 02 c5 |...Å type = 11 (certificate) length = 709 (0x0002c5) certificatechain { chainlength = 706 (0x02c2) certificate { size = 703 (0x02bf) data = { saved in file 'cert.001' } } } 0: 0c 00 00 ca |....
...And 3 more matches
NSS tools : signtool
the nt version of signtool always req
uires the use of the -d option to specify where the database files are located.
...however, you can use the -s option specify the req
uired key size and the -t option to specify the token.
... -l lists signing certificates, including iss
uing cas.
...And 3 more matches
NSS tools : ssltap
although you can run the tool at its most basic by iss
uing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful.
... example 1 $ ssltap.exe -sx -p 444 interzone.mcom.com:443 > sx.txt output connected to interzone.mcom.com:443 -->; [ alloclen = 66 bytes [ssl2] clienthellov2 { version = {0x03, 0x00} cipher-specs-length = 39 (0x27) sid-length = 0 (0x00) challenge-length = 16 (0x10) cipher-s
uites = { (0x010080) ssl2/rsa/rc4-128/md5 (0x020080) ssl2/rsa/rc4-40/md5 (0x030080) ssl2/rsa/rc2cbc128/md5 (0x040080) ssl2/rsa/rc2cbc40/md5 (0x060040) ssl2/rsa/des64cbc/md5 (0x0700c0) ssl2/rsa/3des192ede-cbc/md5 (0x000004) ssl3/rsa/rc4-128/md5 (0x00ff...
... } cipher_s
uite = (0x0003) ssl3/rsa/rc4-40/md5 } 0: 0b 00 02 c5 |...Å type = 11 (certificate) length = 709 (0x0002c5) certificatechain { chainlength = 706 (0x02c2) certificate { size = 703 (0x02bf) data = { saved in file 'cert.001' } } } 0: 0c 00 00...
...And 3 more matches
Renaming With Pork
most refactoring toolchains are
ui-based.
... typically they req
uire loading the entire project into an ide.
... usually, ides req
uire one to use their b
uild system.
...And 3 more matches
Rebranding SpiderMonkey (1.8.5)
after installing the b
uild pre-req
uisites and downloading the spidermonkey source tarball issue the following commands at the terminal: cd js/src autoconf-2.13 for the remainder of this document wherever you see the text $brand you will substitute that text with the name of your brand.
...mkdir b
uild-$brand-release cd b
uild-$brand-release configure this b
uild of spidermonkey with the desired options.
...the only req
uired part in this step is the ../configure command.
...And 3 more matches
JIT Optimization Strategies
provide a repository of jit optimization strategy information which the jit coach tool can parse to display in its
ui.
... inline caches are an order of magnitude slower than the other optimization strategies, and are an indication that the type inference engine has failed to collect enough information to g
uide the optimization process.
... inline caches are an order of magnitude slower than the other optimization strategies, and are an indication that the type inference engine has failed to collect enough information to g
uide the optimization process.
...And 3 more matches
JS::CompileOptions
req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
...this allows an attack by which a malicious website loads a sensitive file (say, a bank statement) cross-origin (using the user's cookies), and sniffs the generated syntax errors (via a window.onerror handler) for j
uicy morsels of its contents.
...And 3 more matches
JS::Value
), val.istrue(), val.isfalse() js::booleanvalue(bool), js::truevalue(), js::falsevalue() val.toboolean() val.setboolean(bool) number val.isint32(), val.isdouble(), val.isnumber() js::numbervalue(any number type), js::int32value(int32_t), js::doublevalue(double), js::float32value(float) val.toint32(), val.todouble(), val.tonumber() val.setint32(int32_t), val.setnumber(
uint32_t), val.setnumber(double) string val.isstring() js::stringvalue(jsstring*) val.tostring() val.setstring(jsstring *) object val.isobject() js::objectvalue(jsobject&), js::objectornullvalue(jsobject*) val.toobject() val.setobject(jsobject &) symbol val.issymbol() js::symbolvalue(js::symbol*) val.tosymbol() val.setsymbol(js::symb...
...the number mutators attempt to use int32_t representation for compatible input values, returning true when int32 could be used and false when double representation was req
uired.
...it is eq
uivalent to !val.isobject().
...And 3 more matches
JS_DefineProperty
tring value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, int32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name,
uint32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, double value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *...
...ative getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, int32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen,
uint32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, double value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); // ---- added in spidermonkey 45 ---- bool js_definepropertybyid(js...
... unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_definepropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, int32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_definepropertybyid(jscontext *cx, js::handleobject obj, js::handleid id,
uint32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_definepropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, double value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); name type description cx jscont...
...And 3 more matches
JS_LookupElement
syntax bool js_lookupelement(jscontext *cx, js::handleobject obj,
uint32_t index, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to look up the property.
... req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
...And 3 more matches
JS_SetElement
syntax /* added in spidermonkey 31 */ bool js_setelement(jscontext *cx, js::handleobject obj,
uint32_t index, js::handlevalue v); bool js_setelement(jscontext *cx, js::handleobject obj,
uint32_t index, js::handleobject v); bool js_setelement(jscontext *cx, js::handleobject obj,
uint32_t index, js::handlestring v); bool js_setelement(jscontext *cx, js::handleobject obj,
uint32_t index, int32_t v); bool js_setelement(jscontext *cx, js::handleobject obj,
uint32_t index,
uint32_t v); bool js_setelement(jscontext *cx, js::handleobject obj,
uint32_t index, double v); /* obsolete since jsapi 29 */ bool js_setelement(jscontext *cx, js::handleobje...
...ct obj,
uint32_t index, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to set the element.
... req
uires request.
...And 3 more matches
SpiderMonkey 17
a significant number of typedefs of b
uilt-in types, or of types which are now standardized, have been removed.
... obsolete typedef replacement type provided by
uint8, int8,
uint16, int16,
uint32, int32,
uint64, int64
uint8_t, int8_t,
uint16_t, int16_t,
uint32_t, int32_t,
uint64_t, int64_t mozilla/stdint.h
uintn, intn unsigned (also known as unsigned int), int n/a jsdouble double n/a js
uintn, jsintn unsigned (also known as unsigned int), int n/a jspackedbool n/a n/a jsre...
... the environment variable is provided as a solution for embedders whose code req
uires particular definitions of those types, and those particular definitions are incompatible with the standard definitions or the custom implementation needed for older versions of visual studio.
...And 3 more matches
Running Automated JavaScript Tests
there are two test s
uites, affectionately called "jstests" and "jit-tests".
...both sets of tests can be used from a normal b
uild of the js shell.
... the jstests test s
uite also includes some tests from web-platform-tests.
...And 3 more matches
SpiderMonkey: The Mozilla JavaScript runtime
g
uides b
uilding spidermonkey b
uild documentation how to get spidermonkey source code, b
uild it, and run the test s
uite.
... jsapi user g
uide this g
uide provides an overview of spidermonkey and describes how you can embed engine calls in your applications to make them javascript-aware.
... gc rooting g
uide g
uide on how to write code compatible with the generational gc in spidermonkey.
...And 3 more matches
Querying Places
bookmark queries there is a q
uick-start for doing simple bookmark queries in retrieving part of the bookmarks tree.
... // |query| and |options| are objects created in the previous section query.setparents([placesutils.bookmarks.toolbarg
uid], 1); let result = placesutils.history.executequery(query, options); serializing queries query and options objects can be serialized into a string starting with "place:" using queriestoquerystring.
...there is a b
uilt-in view that will put results in tree controls, and you can also implement your own.
...And 3 more matches
IAccessibleText
it should be roughly eq
uivalent to the bounding box of some character when inserted at the end of the text().
...the result of this method should be same as a result for textatoffset() with a s
uitably increased index value.
...if the index is valid, but no s
uitable word (or other text() type) is found, a null pointer is returned.
...And 3 more matches
nsIClassInfo
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsisupports gethelperforlanguage(in pr
uint32 language); void getinterfaces(out pr
uint32 count, [array, size_is(count), retval] out nsiidptr array); attributes attribute type description classdescription string a human readable string naming the class, or null.
...violates the xpcom interface g
uidelines exceptions thrown ns_error_not_available if the class does not have a classid contractid string a contractid through which an instance of this class can be created, or null.
... flags pr
uint32 specifies various binary properties of this class.
...And 3 more matches
nsICollection
inherits from: nsiserializable last changed in gecko 1.7 method overview void appendelement(in nsisupports item); void clear(); pr
uint32 count(); nsienumerator enumerate(); nsisupports getelementat(in pr
uint32 index); void queryelementat(in pr
uint32 index, in nsiidref u
uid, [iid_is(u
uid),retval] out nsqiresult result); void removeelement(in nsisupports item); void setelementat(in pr
uint32 index, in nsisupports item); methods appendelement() appends a new item to the collection.
...pr
uint32 count(); parameters none.
...nsisupports getelementat( in pr
uint32 index ); parameters index the index position of the item to be returned.
...And 3 more matches
nsIDOMEvent
method overview boolean deserialize(in constipcmessageptr amsg, out voidptr aiter); violates the xpcom interface g
uidelines void duplicateprivatedata(); native code only!
... nseventptr getinternalnsevent(); violates the xpcom interface g
uidelines boolean getpreventdefault(); deprecated since gecko 16.0 void initevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg); boolean isdispatchstopped(); violates the xpcom interface g
uidelines void preventbubble(); obsolete since gecko 24 void preventcapture(); obsolete since gecko 24 void preventdefault(); void serialize(in ipcmessageptr amsg, in boolean aserializeinterfacetype); violates the xpcom interface g
uidelines void settarget(in nsidomeventtarget atarget); native code only!
... move 0x02000000 resize 0x04000000 forward 0x08000000 help 0x10000000 back 0x20000000 text 0x40000000 alt_mask 0x00000001 control_mask 0x00000002 shift_mask 0x00000004 meta_mask 0x00000008 methods violates the xpcom interface g
uidelines deserialize() boolean deserialize( in constipcmessageptr amsg, out voidptr aiter ); parameters amsg aiter return value native code only!duplicateprivatedata void duplicateprivatedata(); parameters none.
...And 3 more matches
nsIHttpChannel
the implementation is not req
uired to throw an exception when the referrer uri is rejected.
...use this attribute to disting
uish server error pages from normal pages, instead of comparing the response status manually against the set of valid response codes, if that is req
uired by your application.
... isnocacheresponse() returns true if the server sent the eq
uivalent of a "cache-control: no-cache" response header.
...And 3 more matches
nsIMacDockSupport
s can be done like this: var docksupport = cc['@mozilla.org/widget/macdocksupport;1'].getservice(ci.nsimacdocksupport); console.log('docksupport:', docksupport); var win = services.wm.getmostrecentwindow('navigator:browser'); var macmenu = win.document.createelementns('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'menupopup'); macmenu.setattribute('id', 'mymacmenu'); var macmen
uitem = win.document.createelementns('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'men
uitem'); macmen
uitem.setattribute('label', 'show most recent window'); macmen
uitem.setattribute('id', 'mymacmen
uitem'); macmen
uitem.addeventlistener('command', function(){ var docksupport = cc['@mozilla.org/widget/macdocksupport;1'].getservice(ci.nsimacdocksupport); docksupport.activateappli...
...cation(true); services.wm.getmostrecentwindow(null).focus() }) macmenu.appendchild(macmen
uitem); var mainpopupset = win.document.getelementbyid('mainpopupset'); mainpopupset.appendchild(macmenu); let dockmenuelement = macmenu; //document.getelementbyid("menu_mac_dockmenu");66 let nativemenu = cc["@mozilla.org/widget/standalonenativemenu;1"].createinstance(ci.nsistandalonenativemenu); console.log('dockmenuelement:', dockmenuelement); nativemenu.init(dockmenuelement); docksupport.dockmenu = nativemenu; this replaces the default menu with this one men
uitem that says "show most recent window".
... notice how the "new window" and "new private window" men
uitem's are missing.
...And 3 more matches
nsIOutputStream
a nsioutputstream is not req
uired to implement this method.
...typically, output streams that do not have an internal buffer will not implement this method since such an implementation would req
uire an intermediate buffer unless afromstream supported nsiinputstream.readsegments(), but that is not guaranteed.
... note: a nsioutputstream is not req
uired to implement this method.
...And 3 more matches
nsIProtocolHandler
note: starting with firefox 3, one of uri_loadable_by_anyone, uri_dangerous_to_load, uri_is_
ui_resource, or uri_is_local_file must be set on every protocol handler.
... uri_is_
ui_resource 1<<8 the uris for this protocol refer to resources that are part of the application's user interface.
... uri_non_persistable 1<<10 loading channels from this protocol has side-effects that make it uns
uitable for saving to a local file.
...And 3 more matches
nsISHEntry
docshell/shistory/public/nsishentry.idlscriptable each document or subframe in session history will have a nsishentry associated with it which will hold all information req
uired to recreate the document from history.
... nsdocshelleditordataptr forgeteditordata(); violates the xpcom interface g
uidelines nsicontentviewer getanycontentviewer(out nsishentry ownerentry); void getscrollposition(out long x, out long y); void getviewerbounds(in nsintrect bounds); native code only!
... boolean hasdetachededitor(); violates the xpcom interface g
uidelines boolean hasdynamicallyaddedchild(); boolean isdynamicallyadded(); void seteditordata(in nsdocshelleditordataptr adata); violates the xpcom interface g
uidelines void setissubframe(in boolean aflag); void setscrollposition(in long x, in long y); void settitle(in astring atitle); void setuniquedocidentifier(); void seturi(in nsiuri auri); void setviewerbounds(in nsintrect bounds); native code only!
...And 3 more matches
nsIWindowMediator
nsisimpleenumerator getenumerator(in wstring awindowtype); nsidomwindow getmostrecentwindow(in wstring awindowtype); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); nsisimpleenumerator getxulwindowenumerator(in wstring awindowtype); pr
uint32 getzlevel(in nsixulwindow awindow); native code only!
... void removelistener(in nsiwindowmediatorlistener alistener); void setzlevel(in nsixulwindow awindow, in pr
uint32 azlevel); native code only!
...for that reason this interface req
uires only objects one step removed from the native window (nsiwidgets), and its implementation must be very understanding of what may be completely invalid pointers in those parameters.
...And 3 more matches
nsIXULAppInfo
it can be used to disting
uish between different mozilla-based applications.
...attributes attribute type description appb
uildid acstring the application's b
uild id/date, for example "2004051604".
... for xulrunner applications, this will be different than the b
uild id of the platform.
...And 3 more matches
XPCOM primitive
also, certain apis, such as nsitransferable.settransferdata(), req
uire primitives.
... (however, if you are designing that kind of api today, you should probably use nsivariant instead.) idl data type interface component idl nsidptr nsisupportsid @mozilla.org/supports-id;1 [scriptable, u
uid(d18290a0-4a1c-11d3-9890-006008962422)] interface nsisupportsid : nsisupportsprimitive { attribute nsidptr data; string tostring(); }; astring nsisupportsstring @mozilla.org/supports-string;1 [scriptable, u
uid(d79dc970-4a1c-11d3-9890-006008962422)] interface nsisupportsstring : nsisupportsprimitive { attribute astring data; wstring tostring(); }; prbool nsisupportsprbool @mozilla.org/supports-prbool;1 [scriptable, u
uid(ddc3b490-4a1c-11d3-9890-006008962422)] interface nsisupportsprbool : nsisupportsprimitive { attribute prbool data; string tostring(); }; pr...
...
uint8 nsisupportspr
uint8 @mozilla.org/supports-pr
uint8;1 [scriptable, u
uid(dec2e4e0-4a1c-11d3-9890-006008962422)] interface nsisupportspr
uint8 : nsisupportsprimitive { attribute pr
uint8 data; string tostring(); }; pr
uint16 nsisupportspr
uint16 @mozilla.org/supports-pr
uint16;1 [scriptable, u
uid(dfacb090-4a1c-11d3-9890-006008962422)] interface nsisupportspr
uint16 : nsisupportsprimitive { attribute pr
uint16 data; string tostring(); }; pr
uint32 nsisupportspr
uint32 @mozilla.org/supports-pr
uint32;1 [scriptable, u
uid(e01dc470-4a1c-11d3-9890-006008962422)] interface nsisupportspr
uint32 : nsisupportsprimitive { attribute pr
uint32 data; string tostring(); }; pr
uint64 nsisupportspr
uint64 @mozilla.org/supports-pr
uint64;1 [scriptable, u
uid(e13567c0-4a1c-11d3-9890-006008962422...
...And 3 more matches
XPCOM tasks
changes to the b
uild hierarchy there are things in xpcom that don't belong there.
... p2 do we still req
uire our own version of q
uicksort?
... 5.1 if the b
uild hierarchy were fixed, the registry could exploit expat and dbm.
...And 3 more matches
Filelink Providers
if the provider is being merged into the comm-central code repository (and thus added to the official thunderbird b
uild), you must also add the components to the cloudfile/cloudfilecomponents.manifest, cloudfile/jar.mn, and installer/package-manifest.in.
... some providers req
uire thunderbird to do very little in order to connect a user to their account.
... other providers however may req
uire the user to fill in additional details in order to connect to the service.
...And 3 more matches
Browser Console - Firefox Developer Tools
here is an example on how to clear the contents of the browser console: components.utils.import("resource://devtools/shared/loader.jsm"); var hudservice = devtools.req
uire("devtools/client/webconsole/hudservice"); var hud = hudservice.getbrowserconsole(); hud.jsterm.clearoutput(true); if you would like to access the content document of the browser console this can be done with the hudservice.
... this example here makes it so that when you mouse over the "clear" button it will clear the browser console: components.utils.import("resource://devtools/shared/loader.jsm"); var hudservice = devtools.req
uire("devtools/client/webconsole/hudservice"); var hud = hudservice.getbrowserconsole(); var clearbtn = hud.chromewindow.document.queryselector('.webconsole-clear-console-button'); clearbtn.addeventlistener('mouseover', function() { hud.jsterm.clearoutput(true); }, false); bonus features available for add-on sdk add-ons, the console api is available automatically.
... here's an example add-on that just logs an error when the user clicks a widget: widget = req
uire("sdk/widget").widget({ id: "an-error-happened", label: "error!", width: 40, content: "error!", onclick: logerror }); function logerror() { console.error("something went wrong!"); } if you b
uild this as an xpi file, then open the browser console, then open the xpi file in firefox and install it, you'll see a widget labeled "error!" in the add-on bar: click the icon.
...And 3 more matches
Sorting algorithms comparison - Firefox Developer Tools
this article describes a simple example program that we use in two of the performance g
uides: the g
uide to the call tree and the g
uide to the flame chart.
... this program compares the performance of three different sorting algorithms: bubble sort selection sort q
uicksort it consists of the following functions: sortall() top-level function.
... sort() calls each of bubblesort(), selectionsort(), q
uicksort() in turn and logs the result.
...And 3 more matches
Firefox Developer Tools
firefox developer tools is a set of web developer tools b
uilt into firefox.
... this section contains detailed g
uides to all of the tools as well as information on how to debug firefox for android, how to extend devtools, and how to debug the browser as a whole.
... note: the collective term for the
ui inside which the devtools all live is the toolbox.
...And 3 more matches
Managing screen orientation - Web APIs
d
uis lacinia nisi nec sem viverra vitae fringilla nulla ultricies.
... in ac est dolor, q
uis tincidunt leo.
...nullam q
uis malesuada est.</p> css relies on the orientation media query to handle specific styles based on the screen orientation /* first let's define some common styles */ html, body { width : 100%; height: 100%; } body { border: 1px solid black; -moz-box-sizing: border-box; box-sizing: border-box; } p { font : 1em sans-serif; margin : 0; padding: .5em; } ul { list-style: none; font : 1em monospace; margin : 0; padding: .5em; -moz-box-sizing: border-box; box-sizing: border-box; background: black; } li { display: inline-block; margin : 0; padding: 0.5em; background: white; } once we have some common styles we can start defining a spec...
...And 3 more matches
console - Web APIs
however, unlike group() this starts with the inline group collapsed req
uiring the use of a disclosure button to expand it.
... console.profile() starts the browser's b
uilt-in profiler (for example, the firefox performance tool).
... the properties usable along with the %c syntax are as follows (at least, in firefox — they may differ in other browsers): background and its longhand eq
uivalents.
...And 3 more matches
CredentialsContainer.get() - Web APIs
the options include criteria that the credentials are req
uired or allowed to have, and options for interacting with the user.
... federated: a federatedcredentialrequestoptions object containing req
uirements for returned federated credentials.
... publickey: an publickeycredentialrequestoptions object containing req
uirements for returned webauthn credentials.
...And 3 more matches
DOMMatrixReadOnly - Web APIs
the dommatrixreadonly interface represents a read-only 4×4 matrix, s
uitable for 2d and 3d operations.
...a 4×4 matrix is s
uitable to describe any rotation and translation in 3d.
... a, b, c, d, e, f double-precision floating-point values representing the components of a 4×4 matrix which are req
uired in order to perform 2d rotations and translations.
...And 3 more matches
Introduction to the DOM - Web APIs
in this g
uide, we'll briefly introduce the dom.
... the modern dom is b
uilt using multiple apis that work together.
...though we focus exclusively on javascript in this reference documentation, implementations of the dom can be b
uilt for any language, as this python example demonstrates: # python dom example import xml.dom.minidom as m doc = m.parse(r"c:\projects\py\chap1.xml") doc.nodename # dom property of document object p_list = doc.getelementsbytagname("para") for more information on what technologies are involved in writing javascript on the web, see javascript technologies overview.
...And 3 more matches
Using FormData Objects - Web APIs
creating a formdata object from scratch you can b
uild a formdata object yourself, instantiating it then appending fields to it by calling its append() method, like this: var formdata = new formdata(); formdata.append("username", "groucho"); formdata.append("accountnum", 123456); // number 123456 is immediately converted to a string "123456" // html file input, chosen by user formdata.append("userfile", fileinputelement.files[0]); // javascript...
... this example b
uilds a formdata instance containing values for fields named "username", "accountnum", "userfile" and "webmasterfile", then uses the xmlhttprequest method send() to send the form's data.
...in order to b
uild a blob you can invoke the blob() constructor.
...And 3 more matches
Ajax navigation example - Web APIs
it is shared between all ajax pages.</p> include/before_content.php: <p> [ <a class="ajax-nav" href="first_page.php">first example</a> | <a class="ajax-nav" href="second_page.php">second example</a> | <a class="ajax-nav" href="third_page.php">third example</a> | <a class="ajax-nav" href="unexisting.php">unexisting page</a> ] </p> include/header.php: <meta http-eq
uiv="content-type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="js/ajax_nav.js"></script> <link rel="stylesheet" href="css/style.css" /> js/ajax_nav.js: "use strict"; const ajaxrequest = new (function () { function closereq () { oloadingbox.parentnode && document.body.removechild(oloadingbox); bisloading = false; } function abortreq () ...
...ed", 300: "multiple choices", 301: "moved permanently", 302: "found", 303: "see other", 304: "not modified", 305: "use proxy", 306: "reserved", 307: "temporary redirect", 308: "permanent redirect", 400: "bad request", 401: "unauthorized", 402: "payment req
uired", 403: "forbidden", 404: "not found", 405: "method not allowed", 406: "not acceptable", 407: "proxy authentication req
uired", 408: "request timeout", 409: "conflict", 410: "gone", 411: "length req
uired", 412: "precondition failed", 413: "request entity too large",...
... 414: "request-uri too long", 415: "unsupported media type", 416: "requested range not satisfiable", 417: "expectation failed", 422: "unprocessable entity", 423: "locked", 424: "failed dependency", 425: "unassigned", 426: "upgrade req
uired", 427: "unassigned", 428: "precondition req
uired", 429: "too many requests", 430: "unassigned", 431: "request header fields too large", 500: "internal server error", 501: "not implemented", 502: "bad gateway", 503: "service unavailable", 504: "gateway timeout", 505: "http version not supported", 506: "variant...
...And 3 more matches
Checking when a deadline is due - Web APIs
human-readable dates are q
uite different, with a number of different representations.
... recording the date information to provide a reasonable user experience on mobile devices, and to cut down on ambig
uities, i decided to create an html form with: a text input for entering a title for your to-do list.
...if not, we drop a message into our developer notifications pane (see the bottom left of the app
ui) to tell the user what is going on, and exit out of the function.
...And 3 more matches
Media Source API - Web APIs
it lays the groundwork for adaptive bitrate streaming clients (such as those using dash or hls) to be b
uilt on its extensible api.
...the usage of external utilities to massage the content into a s
uitable format is req
uired.
... if you do not req
uire explicit control of video quality over time, the rate at which content is fetched, or the rate at which memory is evicted, then the <video> and <source> tags may well be a simple and adequate solution.
...And 3 more matches
RTCConfiguration - Web APIs
you may find in some cases that connections can be established more q
uickly by allowing the ice agent to start fetching ice candidates before you start trying to connect, so that they're already available for inspection when rtcpeerconnection.setlocaldescription() is called.
...the default is "req
uire".
... "req
uire" tells the ice agent to gather ice candidates for only rtp, and to multiplex rtcp atop them.
...And 3 more matches
SVGSVGElement - Web APIs
on systems where it is impossible to know the size of a pixel, a s
uitable default pixel size is provided.
... svgsvgelement.screenpixeltomillimeterx user interface (
ui) events in dom level 2 indicate the screen positions at which the given
ui event occurred.
... when the browser actually knows the physical size of a "screen unit", this float attribute will express that information; otherwise, user agents will provide a s
uitable default value (such as .28mm).
...And 3 more matches
Streams API - Web APIs
previously, if we wanted to process a resource of some kind (be it a video, or a text file, etc.), we'd have to download the entire file, wait for it to be deserialized into a s
uitable format, then process the whole lot after it is fully received.
... there are more advantages too — you can detect when streams start or end, chain streams together, handle errors and cancel streams as req
uired, and react to the speed of the stream is being read at.
...this object comes with b
uilt-in backpressure and que
uing.
...And 3 more matches
SubtleCrypto.encrypt() - Web APIs
syntax const result = crypto.subtle.encrypt(algorithm, key, data); parameters algorithm is an object specifying the algorithm to be used and any extra parameters if req
uired: to use rsa-oaep, pass an rsaoaepparams object.
...gcm does provide b
uilt-in authentication, and for this reason it's often recommended over the other two aes modes.
... function getmessageencoding() { const messagebox = document.queryselector(".aes-ctr #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } function encryptmessage(key) { let encoded = getmessageencoding(); // counter will be needed for decryption counter = window.crypto.getrandomvalues(new
uint8array(16)); return window.crypto.subtle.encrypt( { name: "aes-ctr", counter, length: 64 }, key, encoded ); } let iv = new
uint8array(16); let key = new
uint8array(16); let data = new
uint8array(12345); //crypto functions are wrapped in promises so we have to use await and make sure the function that //contains this code is an async function //encrypt func...
...And 3 more matches
WakeLockSentinel - Web APIs
the wakelocksentinel interface of the screen wake lock api provides a handle to the underlying platform wake lock and can be manually released and reacq
uired.
... an acq
uired wakelocksentinel can be released manually via the release() method, or automatically via the platform wake lock.
... type read only returns a string representation of the currently acq
uired wakelocksentinel type.
...And 3 more matches
Creating 3D objects using WebGL - Web APIs
consider: each face req
uires four vertices to define it, but each vertex is shared by three faces.
... we can pass a lot fewer data around by b
uilding an array of all 24 vertices, then referring to each vertex by its index into that array instead of moving entire sets of coordinates around.
... define the positions of the cube's vertices first, let's b
uild the cube's vertex position buffer by updating the code in initbuffers().
...And 3 more matches
WebGL model view projection - Web APIs
gl_position = model * vec4(position, 1.0); note: in javascript, matrix multiplication req
uires a custom function, while in the shader it is b
uilt into the language with the simple * operator.
... perspective projection matrix up to this point, we've b
uilt up our own 3d rendering setup, step by step.
... however the current code as we've b
uilt it has some issues.
...And 3 more matches
Writing a WebSocket server in C# - Web APIs
using system.text; using system.text.regularexpressions; while(client.available < 3) { // wait for enough bytes to be available } byte[] bytes = new byte[client.available]; stream.read(bytes, 0, bytes.length); //translate bytes of request to string string data = encoding.utf8.getstring(bytes); if (regex.ismatch(data, "^get")) { } else { } the response is easy to b
uild, but might be a little bit difficult to understand.
...for our purposes, we'll just b
uild a simple response.
... you must: obtain the value of the "sec-websocket-key" request header without any leading or trailing whitespace concatenate it with "258eafa5-e914-47da-95ca-c5ab0dc85b11" (a special g
uid specified by rfc 6455) compute sha-1 and base64 hash of the new value write the hash back as the value of "sec-websocket-accept" response header in an http response if (new system.text.regularexpressions.regex("^get").ismatch(data)) { const string eol = "\r\n"; // http/1.1 defines the sequence cr lf as the end-of-line marker byte[] response = encoding.utf8.getbytes("http/1.1 101 switching protocols" + eol + "connection: upgrade" + eol + "upgrade: websocket" + eol + "sec-websocket-accept: " + convert.tobase64string( system.security.cryptography.sha1.crea...
...And 3 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
in this g
uide we show how use webgl to simulate camera movements without having a camera to move.
...this ability is also used by games offering weapons with scopes, where the view isn't q
uite based off the head's position in the same way anymore.
...so you need to be careful about the order in which you apply your transforms when b
uilding your composite transform (or directly applying transforms in sequence).
...And 3 more matches
Example and tutorial: Simple synth keyboard - Web APIs
the keyboard first, we create space to b
uild the keyboard into.
... creating the note table the createnotetable() function b
uilds the array notefreq to contain an array of objects representing each octave.
... with this table in place, we can find out the frequency for a given note in a particular octave q
uite easily.
...And 3 more matches
Window - Web APIs
however, the window interface is a s
uitable place to include these items that need to be globally available.
...for overriding the prototype of b
uilt-in elements) are listed in a separate section below.
... window.dommatrix read only returns a reference to a dommatrix object, which represents 4x4 matrices, s
uitable for 2d and 3d operations.
...And 3 more matches
Web APIs
cessingevent audioscheduledsourcenode audiotrack audiotracklist audioworklet audioworkletglobalscope audioworkletnode audioworkletnodeoptions audioworkletprocessor authenticatorassertionresponse authenticatorattestationresponse authenticatorresponse b baseaudiocontext basiccardrequest basiccardresponse batterymanager beforeinstallpromptevent beforeunloadevent biquadfilternode blob blobb
uilder blobevent bluetooth bluetoothadvertisingdata bluetoothcharacteristicproperties bluetoothdevice bluetoothremotegattcharacteristic bluetoothremotegattdescriptor bluetoothremotegattserver bluetoothremotegattservice body broadcastchannel budgetservice budgetstate buffersource bytelengthque
uingstrategy bytestring c cdatasection css cssconditionrule csscounterstylerule cs...
...treamtrack canvasgradient canvasimagesource canvaspattern canvasrenderingcontext2d caretposition channelmergernode channelsplitternode characterdata childnode client clients clipboard clipboardevent clipboarditem closeevent comment compositionevent constantsourcenode constrainboolean constraindomstring constraindouble constrainulong contentindex contentindexevent convolvernode countque
uingstrategy crashreportbody credential credentialscontainer crypto cryptokey cryptokeypair customelementregistry customevent d domconfiguration domerror domexception domhighrestimestamp domimplementation domimplementationlist domlocator dommatrix dommatrixreadonly domobject domparser dompoint dompointinit dompointreadonly domquad domrect domrectreadonly domstring domstringl...
...ement htmlformcontrolscollection htmlformelement htmlframesetelement htmlhrelement htmlheadelement htmlheadingelement htmlhtmlelement htmlhyperlinkelementutils htmliframeelement htmlimageelement htmlinputelement htmlisindexelement htmlkeygenelement htmllielement htmllabelelement htmllegendelement htmllinkelement htmlmapelement htmlmarqueeelement htmlmediaelement htmlmenuelement htmlmen
uitemelement htmlmetaelement htmlmeterelement htmlmodelement htmlolistelement htmlobjectelement htmloptgroupelement htmloptionelement htmloptionscollection htmlorforeignelement htmloutputelement htmlparagraphelement htmlparamelement htmlpictureelement htmlpreelement htmlprogresselement htmlquoteelement htmlscriptelement htmlselectelement htmlshadowelement htmlslotelement htmlsourceelement html...
...And 3 more matches
Basic form hints - Accessibility
req
uired and invalid fields note: now that req
uired is available to more than 97% of users globally, it is no longer recommended that you use both req
uired and aria-req
uired.
... web developers typically use presentational strategies to indicate req
uired or invalid fields.
...aria provides attributes for indicating that form controls are req
uired or invalid: the aria-req
uired property can be applied to a form element, to indicate to an at that it is req
uired to complete the form.
...And 3 more matches
Mobile accessibility checklist - Accessibility
this document provides a concise checklist of accessibility req
uirements for mobile app developers.
... colour colour contrast must comply with wcag 2.1 aa level req
uirements: contrast ratio of 4.5:1 for normal text (less than 18 point or 14 point bold.) contrast ratio of 3:1 for large text (at least 18 point or 14 point bold.) information conveyed via colour must be also available by other means too (underlined text for links, etc.) visibility content hiding techniques such as zero opacity, z-index order and off-screen placement must not be used exclusively to handle visibility.
... text eq
uivalents text eq
uivalent must be provided for every non-strictly presentational non-text element within the app.
...And 3 more matches
:optional - CSS: Cascading Style Sheets
the :optional css pseudo-class represents any <input>, <select>, or <textarea> element that does not have the req
uired attribute set on it.
... /* selects any optional <input> */ input:optional { border: 1px dashed black; } this pseudo-class is useful for styling fields that are not req
uired to submit a form.
... note: the :req
uired pseudo-class selects req
uired form fields.
...And 3 more matches
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
in this g
uide we will be exploring the three properties that are applied to flex items, which enable us to control the size and flexibility of the items along the main axis — flex-grow, flex-shrink, and flex-basis.
...when a flex container has positive free space, it has more space than is req
uired to display the flex items inside the container.
...however there are two reasons why it isn’t q
uite the same.
...And 3 more matches
Basic Concepts of grid layout - CSS: Cascading Style Sheets
the features shown in this overview will then be explained in greater detail in the rest of this g
uide.
... grid is a powerful specification that, when combined with other parts of css such as flexbox, can help you create layouts that were previously impossible to b
uild in css.
...lines can also be named, and we will look at how to do this in a later g
uide in this series.
...And 3 more matches
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
we will learn more about the interaction between writing modes and grids in a later g
uide.
...we will take a proper look at how these work in a later g
uide but you can see as you work that grid is laying out un-placed items into empty cells of the grid.
... grid-row-start: 1; grid-row-end: 4; } .box2 { grid-column-start: 3; grid-column-end: 4; grid-row-start: 1; grid-row-end: 3; } .box3 { grid-column-start: 2; grid-column-end: 3; grid-row-start: 1; grid-row-end: 2; } .box4 { grid-column-start: 2; grid-column-end: 4; grid-row-start: 3; grid-row-end: 4; } the grid-column and grid-row shorthands we have q
uite a lot of code here to position each item.
...And 3 more matches
CSS Tutorials - CSS: Cascading Style Sheets
editor's note: we should look at using "difficulty level" tags on the tutorial/g
uide pages so that difficulty-based lists can be automatically b
uilt.
... beginner-level css tutorials getting started this g
uide is aimed at complete beginners: you haven't written one single line of css?
...it explains the fundamental concepts of the language and g
uides you in writing basic stylesheets.
...And 3 more matches
display - CSS: Cascading Style Sheets
legacy <display-legacy> css 2 used a single-keyword syntax for the display property, req
uiring separate keywords for block-level and inline-level variants of the same layout mode.
... it is eq
uivalent to inline flow-root.
... it is eq
uivalent to inline table.
...And 3 more matches
position - CSS: Cascading Style Sheets
mdn understanding wcag, g
uideline 1.4 explanations visual presentation: understanding sc 1.4.8 | understanding wcag 2.0 performance & accessibility scrolling elements containing fixed or sticky content can cause performance and accessibility issues.
... d
uis nisl mauris, aliquam sit amet luctus eget, dapibus in enim.
... d
uis nisl mauris, aliquam sit amet luctus eget, dapibus in enim.
...And 3 more matches
white-space - CSS: Cascading Style Sheets
ut enim ad minim veniam, q
uis nostrud exercitation ullamco laboris nisi ut aliq
uip ex ea commodo consequat.
... d
uis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
... excepteur sint occaecat cupidatat non proident, sunt in culpa q
ui officia deserunt mollit anim id est laborum.</p> </div> .box { width: 300px; padding: 16px; border-radius: 10px; } #css-code { background-color: rgb(220, 220, 220); font-size: 16px; font-family: monospace; } #css-code select { font-family: inherit; } #results { background-color: rgb(230, 230, 230); overflow-x: scroll; height: 400px; white-space: normal; font-size: 14px; } var select = document.queryselector("#css-code select"); var results = document.queryselector("#results p"); select.addeventlistener("change", function(e) { results.setattribute("style", "white-space: "+e.target.value); }) <p> lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut l...
...And 3 more matches
The HTML autocomplete attribute - HTML: Hypertext Markup Language
autocomplete lets web developers specify what if any permission the user agent has to provide automated assistance in filling out form field values, as well as g
uidance to the browser as to the type of information expected in the field.
... in order to provide autocompletion, user-agents might req
uire <input>/<select>/<textarea> elements to: have a name and/or id attribute be descendants of a <form> element the form to have a submit button values "off" the browser is not permitted to automatically enter or select a value for this field.
... it is possible that the document or application provides its own autocomplete feature, or that security concerns req
uire that the field's value not be automatically entered.
...And 3 more matches
<dfn>: The Definition element - HTML: Hypertext Markup Language
such links should be uses of the term, with the intent being that the reader can q
uickly navigate to the term's definition if they're not already aware of it, by clicking on the term's link.
...eq
uidem e cn.
... q
uid de pythagora?
...And 3 more matches
<input type="date"> - HTML: Hypertext Markup Language
the input
ui generally varies from browser to browser; see browser compatibility for further details.
... hopefully, over time browser support will become ubiq
uitous, and this problem will fade away.
... you can also use the req
uired attribute to make filling in the date mandatory — an error will be displayed if you try to submit an empty date field.
...And 3 more matches
<menu> - HTML: Hypertext Markup Language
(list menu is the default state, unless the parent element is a <menu> in the context menu state.) if the element is in the context menu state: zero or more occurrences, in any order, of <menu> (context menu state only), <men
uitem>, <hr>, <script>, and <template>.
... context menus consist of a <menu> element which contains <men
uitem> elements for each selectable option in the menu, <menu> elements for submenus within the menu, and <hr> elements for separator lines to break up the menu's content into sections.
... examples context menu html <!-- a <div> element with a context menu --> <div contextmenu="popup-menu"> right-click to see the adjusted context menu </div> <menu type="context" id="popup-menu"> <men
uitem>action</men
uitem> <men
uitem>another action</men
uitem> <hr/> <men
uitem>separated action</men
uitem> </menu> css div { width: 300px; height: 80px; background-color: lightgreen; } result menu button menu buttons haven't been implemented in any known browsers yet.
...And 3 more matches
<textarea> - HTML: Hypertext Markup Language
the <textarea> element also accepts several attributes common to form <input>s, such as autocomplete, autofocus, disabled, placeholder, readonly, and req
uired.
... minlength the minimum number of characters (utf-16 code units) req
uired that the user should enter.
... req
uired this attribute specifies that the user must fill in a value before submitting a form.
...And 3 more matches
HTML elements reference - HTML: Hypertext Markup Language
it may contain one or more audio sources, represented using the src attribute or the <source> element: the browser will choose the most s
uitable one.
...there's a great deal of further information about this available in the html forms g
uide.
... element description <slot> the html <slot> element—part of the web components technology s
uite—is a placeholder inside a web component that you can fill with your own markup, which lets you create separate dom trees and present them together.
...And 3 more matches
Link types - HTML: Hypertext Markup Language
note: this may be a mailto: hyperlink, but this is not recommended on public pages as robot harvesters will q
uickly lead to a lot of spam sent to the address.
...if not inside the <head> element, the standard doesn't disting
uish between a hyperlink applying to a specific part of the document or to the document as a whole.
...links clicked in the
ui, like "open in a new tab" via the contextual menu, ignored this).
...And 3 more matches
Microformats - HTML: Hypertext Markup Language
microformats2 is an update to microformats that provides a simpler way of annotating html structured syntax & vocabularies than previous approaches of using rdfa and microdata which req
uire learning new attributes.
... as in this example, some markup patterns req
uire only a single microformat root class name, which parsers use to find a few generic properties such as name, url, photo.
... u-email email address u-photo a photo of the person or organization u-url home page or other url representing the person or organization u-
uid universally unique identifier, preferably canonical url p-street-address street number + name p-locality city/town/village p-country-name country name nested h-card example <div class="h-card"> <a class="p-name u-url" href="http://blog.lizardwrangler.com/" >mitchell baker</a> (<a class="p-org h-card" href="http://mozilla.org/" >mozi...
...And 3 more matches
CSP: base-uri - HTTP
the colon is req
uired.
...the single quotes are req
uired.
...the single quotes are req
uired.
...And 3 more matches
CSP: form-action - HTTP
the colon is req
uired.
...the single quotes are req
uired.
...the single quotes are req
uired.
...And 3 more matches
CSP: navigate-to - HTTP
the colon is req
uired.
...the single quotes are req
uired.
...the single quotes are req
uired.
...And 3 more matches
Set-Cookie - HTTP
browsers block frontend javascript code from accessing the set cookie header, as req
uired by the fetch spec, which defines set-cookie as a forbidden response-header name that must be filtered out from any response exposed to frontend code.
... for more information, see the g
uide on http cookies.
...encoding: many implementations perform url encoding on cookie values, however it is not req
uired per the rfc specification.
...And 3 more matches
Proxy Auto-Configuration (PAC) file - HTTP
return value format the javascript function returns a single string if the string is null, no proxies should be used the string can contain any number of the following b
uilding blocks, separated by a semicolon: direct connections should be made directly, without any proxies proxy host:port the specified proxy should be used socks host:port the specified socks server should be used recent versions of firefox support as well: http host:port the specified proxy should be used https host:port the specified https proxy should be used socks4 host:port ...
...(of course, the javascripts must be edited to reflect your site's domain name and/or subnets.) predefined functions and environment these functions can be used in b
uilding the pac file: hostname based conditions isplainhostname() dnsdomainis() localhostordomainis() isresolvable() isinnet() related utility functions dnsresolve() convert_addr() myipaddress() dnsdomainlevels() url/hostname based conditions shexpmatch() time based conditions weekdayrange() daterange() timerange() logging...
...e("mon", "fri", "gmt"); // returns true monday through friday (gmt timezone) weekdayrange("sat"); // returns true on saturdays local time weekdayrange("sat", "gmt"); // returns true on saturdays gmt time weekdayrange("fri", "mon"); // returns true friday and monday only (note, order does matter!) daterange() syntax daterange(<day> | <month> | <year>, [gmt]) // ambig
uity is resolved by assuming year is greater than 31 daterange(<day1>, <day2>, [gmt]) daterange(<month1>, <month2>, [gmt]) daterange(<year1>, <year2>, [gmt]) daterange(<day1>, <month1>, <day2>, <month2>, [gmt]) daterange(<month1>, <year1>, <month2>, <year2>, [gmt]) daterange(<day1>, <month1>, <year1>, <day2>, <month2>, <year2>, [gmt]) note: (before firefox 49) day1 must be less than day2, month1 m...
...And 3 more matches
Functions - JavaScript
« previousnext » functions are one of the fundamental b
uilding blocks in javascript.
...there are three ways for a function to refer to itself: the function's name arguments.callee an in-scope variable that refers to the function for example, consider the following function definition: var foo = function bar() { // statements go here } within the function body, the following are all eq
uivalent: bar() arguments.callee() foo() a function that calls itself is called a recursive function.
...both execute the same code multiple times, and both req
uire a condition (to avoid an infinite loop, or rather, infinite recursion in this case).
...And 3 more matches
Function.name - JavaScript
these tools are often used as part of a javascript b
uild pipeline to reduce the size of a program prior to deploying it to production.
... such transformations often change a function's name at b
uild-time.
...if you rely on function.name, like in the example above, make sure your b
uild pipeline doesn't change function names, or don't assume a function to have a particular name.
...And 3 more matches
How to make PWAs installable - Progressive web apps (PWAs)
req
uirements to make the web site installable, it needs the following things in place: a web manifest, with the correct fields filled in the web site to be served from a secure (https) domain an icon to represent the app on the device a service worker registered, to allow the app to work offline (this is req
uired only by chrome for android currently) currently, only the chromium-based browser...
...s such as chrome, edge, and samsung internet req
uire the service worker.
... display: how the app is displayed; can be fullscreen, standalone, minimal-
ui, or browser.
...And 3 more matches
Paths - SVG: Scalable Vector Graphics
while <polyline>s and <path>s can create similar-looking shapes, <polyline>s req
uire a lot of small straight lines to simulate curves, and don't scale well to larger sizes.
...later, we will learn how paths can be transformed to s
uit other needs.
...it req
uires one control point which determines the slope of the curve at both the start point and the end point.
...And 3 more matches
Communicating using "postMessage" - Archive of obsolete content
as an alternative to port, content modules support the b
uilt-in message event.
...again, panel and page integrate worker directly: // post a message to the panel's content scripts panel.postmessage(addonmessage); however, for page-mod objects you need to listen to the onattach event and use the worker supplied to that: var pagemod = req
uire('sdk/page-mod').pagemod({ include: ['*'], contentscript: pagemodscript, onattach: function(worker) { worker.postmessage(addonmessage); } }); to receive messages from a content script, use the worker's on function.
... to simplify this most content modules provide an onmessage property as an argument to the constructor: panel = req
uire("sdk/panel").panel({ onmessage: function(contentscriptmessage) { // handle message from the content script } }); message events versus user-defined events you can use message events as an alternative to user-defined events: var pagemodscript = "window.addeventlistener('mouseover', function(event) {" + " self.postmessage(event.target.tostring());" + "}, false);"; var pagemod = req
uire('sdk/page-mod').pagemod({ include: ['*'], contentscript: pagemodscript, onattach: function(worker) { worker.on('message', function(message) { console.log('mouseover: ' + message); }); } }); the reason to prefer user-...
...And 2 more matches
Porting the Library Detector - Archive of obsolete content
it's a very simple add-on and a good candidate for porting because there are s
uitable sdk apis for all its features.
...when this is triggered, the testlibraries() function b
uilds an array of libraries by iterating through the tests and adding an entry for each library which passes.
... once the list is b
uilt, the switchlibraries() function constructs a xul statusbarpanel element for each library it found, populates it with the icon at the corresponding chrome:// url, and adds it to the box.
...And 2 more matches
l10n - Archive of obsolete content
for compatibility with tools that expect this syntax, you can assign this function to "_": var _ = req
uire("sdk/l10n").get; given a .properties file for the current locale containing an entry like: hello_string= hello!
... and the following code: var _ = req
uire("sdk/l10n").get; console.log(_("hello_string")); the following output will be logged: info: hello!
...this enables you to write functional, localizable code without localizing any strings - just make the identifiers the default language: var _ = req
uire("sdk/l10n").get; console.log(_("hello!")); however, this will make it more difficult to maintain your code if you have many localizations, because any changes to the identifier values break all your .properties files.
...And 2 more matches
private-browsing - Archive of obsolete content
opting into private browsing add-ons b
uilt using the sdk must opt into private browsing by setting the following key in their package.json file: "permissions": {"private-browsing": true} if an add-on has not opted in, then the high-level sdk modules will not expose private windows, or objects (such as tabs) that are associated with private windows: the windows module will not list any private browser windows, generate any events...
... for private browser windows, or let the add-on open any private browser windows the tabs module will not list any tabs that belong to private browser windows, and the add-on won't receive any events for such tabs any
ui components will not be displayed in private browser windows any menus or menu items created using the context-menu will not be shown in context menus that belong to private browser windows the page-mod module will not attach content scripts to documents belonging to private browser windows any panel objects will not be shown if the active window is a private browser window the selection module will not include any selections made in private browser windows add-ons that have opted in will see private windows, so they will need to use th...
...for example, here's an add-on that stores the titles of tabs the user loads, and uses isprivate() to exclude the titles of tabs that were loaded into private windows: var simplestorage = req
uire("simple-storage"); if (!simplestorage.storage.titles) simplestorage.storage.titles = []; req
uire("tabs").on("ready", function(tab) { if (!req
uire("sdk/private-browsing").isprivate(tab)) { console.log("storing..."); simplestorage.storage.titles.push(tab.title); } else { console.log("not storing, private data"); } }); here's an add-on that uses a page-mod to log the conte...
...And 2 more matches
Modifying the Page Hosted by a Tab - Archive of obsolete content
here's a simple example: var button = req
uire("sdk/
ui/button/action").actionbutton({ id: "style-tab", label: "style tab", icon: "./icon-16.png", onclick: function() { req
uire("sdk/tabs").activetab.attach({ contentscript: 'document.body.style.border = "5px solid red";' }); } }); to run this example, save an icon file named "icon-16.png" in add-on's "data" directory.
... for example, if we save the script above under the add-on's data directory in a file called my-script.js: var self = req
uire("sdk/self"); var button = req
uire("sdk/
ui/button/action").actionbutton({ id: "style-tab", label: "style tab", icon: "./icon-16.png", onclick: function() { req
uire("sdk/tabs").activetab.attach({ contentscriptfile: self.data.url("my-script.js") }); } }); you can load more than one script, and the scripts can interact directly with each other.
... // index.js var self = req
uire("sdk/self"); var tabs = req
uire("sdk/tabs"); req
uire("sdk/
ui/button/action").actionbutton({ id: "load-several", label: "load several scripts", icon: "./icon-16.png", onclick: function () { tabs.activetab.attach({ contentscriptfile: [self.data.url('first.js'), self.data.url('second.js')] }); } }); communicating with the content scripts your a...
...And 2 more matches
Unit Testing - Archive of obsolete content
if you're migrating test code from cfx to jpm, see the g
uide to migrating from cfx, in particular the section on loading modules from test code.
...now create a new file called "base64.js", and give it the following contents: const { atob, btoa } = req
uire("resource://gre/modules/services.jsm"); exports.atob = a => atob(a); exports.btoa = b => btoa(b); this code exports two functions, which just call the platform's btoa() and atob() functions.
... to show the module in use, edit the "index.js" file as follows: var base64 = req
uire("./base64"); var button = req
uire("sdk/
ui/button/action").actionbutton({ id: "base64", label: "base64", icon: "./icon-16.png", onclick: function() { encoded = base64.btoa("hello"); console.log(encoded); decoded = base64.atob(encoded); console.log(decoded); } }); to run this example you'll also have to have an icon file named "icon-16.png" saved in your add-ons "data" directory.
...And 2 more matches
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
this document is a g
uide to common code patterns that may need to change to work with frozen linkage.
... strings the most obvious change req
uired by frozen linkage is using the frozen string api.
...- #include "nscrt.h" + #include <string.h> const char *str = "foo"; - pr
uint32 len = nscrt::strlen(str); + pr
uint32 len = strlen(str); - #include "nscrt.h" + #include "nscrtglue.h" const prunichar str[] = {'f','o','o','\0'}; - pr
uint32 len = nscrt::strlen(str); + pr
uint32 len = ns_strlen(str); - #include "nscrt.h" + #include "nsmemory.h" + #include "nscrtglue.h" prunichar* anotherstr = (prunichar*) ns_alloc(100 * sizeof(prunichar)); - prunichar *str = nscrt::str...
...And 2 more matches
Multiple item extension packaging - Archive of obsolete content
every multiple item package must provide an install.rdf file (not old-style install.js!) and has the same req
uirements as an extension except as noted below.
... multiple item package file layout the multiple item package file layout is a simplified form of an installable bundle and req
uires a file extension of xpi.
... install.rdf a multiple item package does not have the same req
uirements as an extension for its install.rdf.
...And 2 more matches
Chapter 1: Introduction to Extensions - Archive of obsolete content
« previousnext » note: if you want contribute to this document please following g
uidelines from the contribute page.
...emura-san is a co-author of firefox 3 hacks (o'reilly japan, 2008.) introduction if you're reading this g
uide, you’ve probably used firefox before.
... because firefox and its extensions are designed to support multiple languages, excellent extensions come from all over the world, and can be q
uickly localized by anyone interested.
...And 2 more matches
Handling Preferences - Archive of obsolete content
firefox exposes its most common high-level preferences through the preferences window and other parts of its
ui.
...you don't need to know them by heart; if doing task x req
uires some preference, then it's better to look for an explanation on how to do x rather than diving into the preferences list and see if you can find the preference you need.
... mdc articles and other g
uides are usually good at specifying the preferences you'll need to use.
...And 2 more matches
User Notifications and Alerts - Archive of obsolete content
« previousnext » it is often the case that extensions need to notify users about important events, often req
uiring some response.
...users will find them annoying and probably will learn to dismiss them as q
uickly as possible without even reading what they have to say.
... the alerts service this is a very good option when you want to alert users about events without req
uiring input from them.
...And 2 more matches
Promises - Archive of obsolete content
e/modules/task.jsm"); task.spawn(function* () { var response = yield request("login", { username: user, password: password }); if (response.messages) { try { yield publish({ username: user, messages: response.messages }); } catch (e) { self.reporterror("publication failed", e); } } }); can be converted to a pure promise-based eq
uivalent as such: request("login", { username: user, password: password }) .then(response => { if (response.messages) return publish({ username: user, messages: response.messages }); }) .then(null, (e) => { self.reporterror("publication failed", e); }); file io file io in add-ons should be done via the os.file api, which provides a simple, but powerful,...
...the downloads object provides a promise-based api for downloading remote files, with full support for progress tracking, pause and resume, and, optionally, integration with the download manager
ui.
... let download_2 = yield downloads.createdownload({ source: url_2, target: path_2, }); // add it to the downloads list used by the download manager
ui.
...And 2 more matches
Add-ons - Archive of obsolete content
bootstrapped extensions browser.bookmarks.export( function() {...} // optional function ) code snippets … creating custom firefox extensions with the mozilla b
uild system there is a wealth of material on creating extensions for firefox.
...it assumes that you are already familiar with b
uilding an extension.
... firefox addons developer g
uide the original document is in japanese and distributed via the xuldev.org website.
...And 2 more matches
Adding preferences to an extension - Archive of obsolete content
« previousnext » this article takes the creating a dynamic status bar extension sample to the next level, adding a popup menu that lets you q
uickly switch between multiple stocks to watch.
...; var fullurl = "http://quote.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=" + symbol; function inforeceived() { var samplepanel = document.getelementbyid('stockwatcher2'); var output = httprequest.responsetext; if (output.length) { // remove any whitespace from the end of the string output = output.replace(/\w*$/, ""); // b
uild the tooltip string var fieldarray = output.split(","); samplepanel.label = symbol + ": " + fieldarray[1]; samplepanel.tooltiptext = "chg: " + fieldarray[4] + " | " + "open: " + fieldarray[5] + " | " + "low: " + fieldarray[6] + " | " + "high: " + fieldarray[7] + " | " + "vol: " + fieldarray[8]; } } v...
... window.addeventlistener("load", function(e) { stockwatcher.startup(); }, false); window.addeventlistener("unload", function(e) { stockwatcher.shutdown(); }, false); design the preference dialog now that we've written all the code, we need to b
uild the xul file for the options dialog.
...And 2 more matches
CSS3 - Archive of obsolete content
allow the styling of forms according their content using the css :indeterminate, :default, :valid, :invalid, :in-range, :out-of-range, :req
uired, :optional, :read-only, and :read-write pseudo-classes and the ::value, ::choices, ::repeat-item, and ::repeat-index pseudo-elements.
... these modules extend and amend the css2.1 specification which b
uild the core of the specification.
... clarifies: interaction of media-dependent @import statements and style sheet loading req
uirements.
...And 2 more matches
Images, Tables, and Mysterious Gaps - Archive of obsolete content
you can do this by using a doctype that will trigger either "q
uirks" mode or "almost standards" mode, or not having a doctype appear in your document at all.
...for authors who are working with legacy documents, a "q
uirks" mode doctype is the best choice.
...if you're using strict markup, or you need for other reasons to be in "standards" rendering, then remember these g
uidelines: any image alone in a table cell (e.g., single-pixel spacer images) should be made block-level.
...And 2 more matches
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
b
uild create a new project in visual studio for a win32 g
ui library (dll) (in .net 2003: win32 template, then switch to dll in application settings in the following dialog, export symbols too?)(in visual studio 2008, it is visualc++|win32|win32 project, then check dll in the wizard).
... again note that the resulting dll filename must start with "np", so either call your project like this or rename the file later delete the .cpp and .h and readme files from the project and disk (if you did not create an empty project) copy the npruntime sample plugin source code into the dir of the new vs project and add the files to the project using the vs g
ui (.cpp files to "source files", .h files to "header files", .rc file to "resource files").
...to reflect your plugin remove the function npp_getjavaclass from npp_gate.cpp b
uild rename the resulting dll so that the filename starts with "np" and ends with ".dll" (or "32.dll"?
...And 2 more matches
Creating a Mozilla Extension - Archive of obsolete content
this tutorial describes how to create an extension for the old versions of mozilla s
uite (currently seamonkey).
... see b
uilding an extension for an up-to-date tutorial (it focuses on firefox, but is also applicable to other new applications).
...this tutorial walks you through the process of b
uilding a mozilla extension that adds an icon to mozilla's status bar showing the current status of the mozilla source code (i.e.
...And 2 more matches
Creating a Release Tag - Archive of obsolete content
the mini-branch is created so you can check in the b
uild scripts with the necessary changes without touching the original branch.
...remember to also check out extra mac and win32 files that aren't normally checked out on linux or the tag won't b
uild on those platforms.
...cvs tag -b mozilla_0_9_4_1_release_mini_branch mozilla/client.mk delete the existing b
uild scripts and repull them from the mini-branch you just created.
...And 2 more matches
Hidden prefs - Archive of obsolete content
the default (defined in mailnews.js) is: pref("mail.addr_book.mapit_url.format", "http://www.mapquest.com/maps/map.adp...st&zipcode=@zi"); addressbook q
uick search query pref ("mail.addr_book.q
uicksearchquery.format" ) the format for this pref is: @v == the escaped value typed in the q
uick search bar in the addressbook every occurance of @v will be replaced.
... note, the
ui has "name or email contains:".
... so if you change the q
uick search query to match based on phone number, the
ui will not match the query.
...And 2 more matches
JavaScript crypto - Archive of obsolete content
avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to g
uide your decision.
...these services are a balance between the functionality web pages need and the req
uirement to protect users from malicious web sites.
... generating keys and iss
uing user certificates there are several crypto object methods used in generating keys for certificates: generatecrmfrequest(), importusercertificates().
...And 2 more matches
Metro browser chrome tests - Archive of obsolete content
the metro browser chrome test s
uite is an automated testing framework designed to allow testing of the immersive version of firefox for windows 8 and above using javascript.
...running the metro browser chrome tests to run mochitest, first b
uild mozilla with your changes; then run ./mach mochitest-metro this will launch metro browser chrome tests in the default immersive browser.
... for information on setting your local b
uild as the default, visit the windows 8 integration wiki page.
...And 2 more matches
Supporting private browsing mode - Archive of obsolete content
doing this is q
uite easy, using the nsiprivatebrowsingservice interface.
... detecting whether private browsing mode is permanent req
uires gecko 2.0(firefox 4 / thunderbird 3.3 / seamonkey 2.1) firefox 4 added support for having private browsing mode permanently enabled.
..._inprivatebrowsing: false, // whether we are in private browsing mode _watcher: null, // the watcher object init : function () { this._inited = true; this._os = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); this._os.addobserver(this, "private-browsing", false); this._os.addobserver(this, "q
uit-application", false); try { var pbs = components.classes["@mozilla.org/privatebrowsing;1"] .getservice(components.interfaces.nsiprivatebrowsingservice); this._inprivatebrowsing = pbs.privatebrowsingenabled; } catch(ex) { // ignore exceptions in older versions of firefox } }, observe : function (asubject, atopic, adata) { if (atopic...
...And 2 more matches
Table Layout Regression Tests - Archive of obsolete content
prereq
uisites in order to run these tests, you will need to have: make sure that your b
uild is a debug b
uild (in short you need ac_add_options --enable-debug in your .mozconfig file).
... to b
uild the layoutdebugger itself, b
uild either all extensions or include layoutdebug in your .mozconfig file.
... execute the baseline test shutdown the layoutdebugger execute mozilla -layoutdebug - p foo >selftest.txt execute the verify test make a note which tests have failed grep 'failed' selftest.txt (these are false positives, q
uite frequently they indicate reflow problems, pages showing differently when loaded from cache) make your changes to the source, recompile.
...And 2 more matches
Tamarin-central rev 703:2cee46be9ce0 - Archive of obsolete content
performance tests
uite time metric the following is a comparison of the current tamarin-central (tc-703) versus the prior b
uild (tc-700) as well as current against the vm in flash player 10.
...% fastertc-703 vs tc-700: 16.4% fastertc-703 vs flash10: 148.7% fastertc-703 vs tc-700: 0.1% slowertc-703 vs flash10: 5.2% faster linux (ubuntu linux, 2.13 ghz dual core)tc-703 vs tc-700: 6.0% fastertc-703 vs flash10: 1.7% fastertc-703 vs tc-700: 89.5% fastertc-703 vs flash10: 182.0% fastertc-703 vs tc-700: 6.1% fastertc-703 vs flash10: 1.4% faster performance test
uite memory metric the following is a comparison of the current tamarin-central (tc-703) versus the prior b
uild (tc-700).
...2.13ghz dual core)tc-703 vs tc-700: 3.2% largertc-703 vs tc-663: 7.6% largertc-703 vs tc-700: 3.9% largertc-703 vs tc-663: 12.4% largertc-703 vs tc-700: 3.3% largertc-703 vs tc-663: 21.4% larger linux (ubuntu linux, 2.13 ghz dual core)n/an/an/a vm code size the following is a comparison of the current tamarin-central compiled size (tc-703) versus the prior b
uild (tc-700) as well as the current b
uild against the vm in flash player 10.
...And 2 more matches
XUL Events - Archive of obsolete content
this event would be used to update the disabled status of its commands.dommen
uitemactivethe dommen
uitemactive event is executed when a <menu> or a <men
uitem> has been hovered or highlighted.dommen
uiteminactivethe dommen
uiteminactive event is executed when a <menu> or a <men
uitem> in no longer hovered or highlighted.popuphiddenthe popuphidden event is executed when a <menupopup>, <panel> or <tooltip> has become hidden.popuphidingthe popuphiding event is executed when a <menup...
...not file -> q
uit) use the unload event to capture all attempts to unload the window.
...this event is usually used to adjust the preference value so that it is more s
uitable for display in the user interface.
...And 2 more matches
Special per-platform menu considerations - Archive of obsolete content
for instance, this is the proper place to put the menu items which open the application preferences and which q
uit the application.
... menu_fileq
uitseparator the separator just before the q
uit/exit item.
... menu_fileq
uititem the item which exits the application.
...And 2 more matches
Actions - Archive of obsolete content
here is the [example], and an image of what it looks like: the template b
uilder iterates through the three results, processing the body of the action for each one in turn.
...let's look at the results again: (?start = http://www.xulplanet.com/rdf/a, ?relateditem = http://www.xulplanet.com/rdf/b) (?start = http://www.xulplanet.com/rdf/a, ?relateditem = http://www.xulplanet.com/rdf/c) (?start = http://www.xulplanet.com/rdf/a, ?relateditem = http://www.xulplanet.com/rdf/d) the b
uilder will start with the first result.
...processing is now complete for the first result, so the b
uilder moves on to the next result.
...And 2 more matches
Additional Template Attributes - Archive of obsolete content
<listbox datasources="template-g
uide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos" template="phototemplate"/> ...
... declaring the container and member variables normally, the container and member variables are determined by the template b
uilder automatically.
...this isn't particularly useful although there is a very slight optimization since the b
uilder does not need to scan the action body looking for the member variable when compiling the queries and rules.
...And 2 more matches
SQLite Templates - Archive of obsolete content
this is useful for user data, and is s
uitable as you do not need to calculate where this directory is located.
...the uri attribute on the hbox element is req
uired on one element within the action body.
...one possibility is to simply use methods to adjust the text within the query element and reb
uild the template.
...And 2 more matches
Special Condition Tests - Archive of obsolete content
it's most useful to disting
uish between the outer and inner levels during template generation.
...for instance, we might use the following: <vbox datasources="template-g
uide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood"> <template> <rule parent="vbox"> <groupbox uri="rdf:*"> <caption label="rdf:http://purl.org/dc/elements/1.1/title"/> </groupbox> </rule> <rule> <label uri="rdf:*" value="rdf:http://www.xulplanet.com/rdf/address"/> </rule> </template> </vbox> on the first pass, the container where...
...here is the same example using the extended template syntax: <vbox datasources="template-g
uide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood"> <template> <query> <content uri="?start"/> <member container="?start" child="?item"/> </query> <rule parent="vbox"> <binding subject="?item" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <action> <groupbox uri="?item"> <caption label="?title"/> ...
...And 2 more matches
Element Positioning - Archive of obsolete content
in the image, the first two buttons have been given a s
uitable size to hold their text.
...the height of the buttons is a s
uitable size to hold the text.
...the q
uick way is to simply add the width and height attributes on an element, much like you might do on an html img tag.
...And 2 more matches
More Event Handlers - Archive of obsolete content
other arguments can be passed to a listener function, if req
uired.
...example 1 : source view <vbox oncommand="alert(event.currenttarget.tagname);"> <button label="ok"/> <checkbox label="show images"/> </vbox> stop event propagation once you handle an event, regardless of where in the propagation the event is, you will likely want to stop the event from being sent to further elements, essentially stopping the capturing or bubbling phases from contin
uing.
...example 3 : source view <button label="types" type="menu"> <menupopup onpopupshowing="event.preventdefault();"> <men
uitem label="glass"/> <men
uitem label="plastic"/> </menupopup> </button> alternatively, for attribute event listeners, you can just return false from the code.
...And 2 more matches
More Menu Features - Archive of obsolete content
we've looked at placing men
uitems and menuseparators in menupopups.
...the example below creates a simple submenu inside the file menu example 1 : source view <toolbox flex="1"> <menubar id="sample-menubar"> <menu id="file-menu" label="file"> <menupopup id="file-popup"> <menu id="new-menu" label="new"> <menupopup id="new-popup"> <men
uitem label="window"/> <men
uitem label="message"/> </menupopup> </menu> <men
uitem label="open"/> <men
uitem label="save"/> <menuseparator/> <men
uitem label="exit"/> </menupopup> </menu> </menubar> </toolbox> adding a menu to our find files example let's add a menu to the find files dialog.
... <toolbox> <menubar id="findfiles-menubar"> <menu id="file-menu" label="file" accesskey="f"> <menupopup id="file-popup"> <men
uitem label="open search..." accesskey="o"/> <men
uitem label="save search..." accesskey="s"/> <menuseparator/> <men
uitem label="close" accesskey="c"/> </menupopup> </menu> <menu id="edit-menu" label="edit" accesskey="e"> <menupopup id="edit-popup"> <men
uitem label="cut" accesskey="t"/> <men
uitem label="copy" accesskey="c"/> <men
uitem label="paste" accesskey="p" disabled="true"/> </menupopup> </menu> </menubar> <toolbar id="findfiles-toolbar> here we have added two menus with variou...
...And 2 more matches
Styling a Tree - Archive of obsolete content
this can be used with trees with static content, rdf b
uilt content or with those with a custom view.
...you can think of the properties as functioning much like style classes, although they req
uire a somewhat more complex syntax to use in a style sheet.
... setting properties for the rdf-b
uilt trees for rdf-b
uilt trees, you can use the same syntax.
...And 2 more matches
Using Spacers - Archive of obsolete content
in addition, different platforms may have special req
uirements on the user interface.
... if adding support for multiple languages, the text for one language may req
uire more room than another.
...a spacer is very simple and only req
uires one attribute, which will be explained in a moment.
...And 2 more matches
Using nsIXULAppInfo - Archive of obsolete content
nsixulappinfo interface to disting
uish between different mozilla-based applications, use the frozen nsixulappinfo interface.
... in such cases, you probably want to check nsixulappinfo.version and/or nsixulappinfo.appb
uildid.
... the latter is useful if you're trying to support nightly development b
uilds of the application, and the former can be useful if you only support official releases, and to disting
uish between branch and trunk b
uilds.
...And 2 more matches
key - Archive of obsolete content
to display the shortcut defined with the key element in the
ui, you can use <men
uitem key="key element's id" command="command id" .../>.
... visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...this text would appear next to a men
uitem label if that men
uitem is associated with the key element via its key attribute.
...And 2 more matches
listitem - Archive of obsolete content
for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } current type: boolean this attribute will be set to true if the listitem is the current item.
... visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
...And 2 more matches
prefpane - Archive of obsolete content
more
ui elements ...
...for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
... preferenceelements type: dom nodelist holds a list of the
ui elements in the pane that are attached to preferences.
...And 2 more matches
tooltip - Archive of obsolete content
for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } default type: boolean if true, the tooltip is used as the default popup for displaying tooltips in the window.
...for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
... example: <menupopup id="top" onpopuphidden="console.log('the onpopuphidden method of id=top was called.');"> <men
uitem label="item 1"/> <men
uitem label="item 2"/> <menu id="submenu1" label="submenu 1"> <menupopup id="submenu1-popup"> <men
uitem label="submenu1 item 1"/> <men
uitem label="submenu1 item 2"/> </menupopup> </menu> <menu id="submenu2" label="submenu 1"> <menupopup id="submenu2-popup"> <men
uitem label="submenu2 item 1"/> ...
...And 2 more matches
wizard - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to construct a step-by-step wizard found in some applications to g
uide users through a task.
...the wizard will rendered in a manner s
uitable for the user's selected theme and platform.
...this might be used, for example, to disting
uish between a browser window and an editor window.
...And 2 more matches
Creating a Windows Inno Setup installer for XULRunner applications - Archive of obsolete content
if you want to edit scripts, you should get the q
uickstart pack (which includes istool, the script editor.
... however, if you don't get the q
uickstart pack, you can later get istool from inno setup third-party files.
...[setup] appname=my app appvername=my app 1.0 apppublisher=mark finkle apppublisherurl=http://developer.mozilla.org/en/docs/getting_started_with_xulrunner appsupporturl=http://developer.mozilla.org/en/docs/getting_started_with_xulrunner appupdatesurl=http://developer.mozilla.org/en/docs/getting_started_with_xulrunner defaultdirname={pf}\my app defaultgroupname=my app allownoicons=yes outputdir=..\b
uild\output outputbasefilename=myapp-1.0-win32 ; setupiconfile= compression=lzma solidcompression=yes [languages] name: english; messagesfile: compiler:default.isl [components] name: main; description: my app; types: full compact custom; flags: fixed name: runtime; description: xul runner runtime; types: full custom [tasks] name: desktopicon; description: {cm:createdesktopicon}; groupdescription:...
...And 2 more matches
Extentsions FAQ - Archive of obsolete content
<https://bugzilla.mozilla.org/show_bug.cgi?id=312818> "thunderbird req
uires domain in addresses and doesn't always add default" there is an extension that allows what you want attached to one of the comments in this bug.
...the appearance with a firefox tab isn't q
uite the same as having a completely separate explorer window.
... are there any b
uilt in libraries that can be used to encrypt data?
...And 2 more matches
External resources for plugin creation - Archive of obsolete content
feature highlights include thread safety checks, unicode support (with std::wstring), activex support, b
uilt-in drawing model negotiation for mac, automatic type conversion (including javascript arrays and objects), advanced security features, and more.
... all platforms rely on cmake for easy cross-platform b
uilds.
... it contains pretty much everything you're likely to need to create most applications, and is particularly good for creating highly-specialised
uis and for handling graphics and sound.
...And 2 more matches
XEmbed Extension for Mozilla Plugins - Archive of obsolete content
also, when included with b
uilds of mozilla that are based on gtk 1.2 or gtk 2.x, the xt code that hosts the plugins is at best hacky and has been the source for many minor problems including inconsistent focus behavior as well as occasional crashes.
... hosting using gtk2.x included below are a couple of code snippits that should help you get started as well as some hints on b
uilding a successful plugin.
...if you've b
uilt your plugin so that it will support either xt or xembed you can include a fallback for older style hosting.
...And 2 more matches
Security Controls - Archive of obsolete content
second, the system should offer only the req
uired functionality to each authorized user, so that no one can use functions that are not necessary.
...for example, a security policy is a management control, but its security req
uirements are implemented by people (operational controls) and systems (technical controls).
... the goal should be to strike a proper balance: provide a reasonably secure solution while offering the functionality and usability that users req
uire.
...And 2 more matches
Sunbird Theme Tutorial - Archive of obsolete content
this tutorial is a step-by-step g
uide to making a theme for sunbird 0.3a1 and later versions.
... fixing bug 320823 if you are using the sunbird 0.3a1 release, or a test b
uild before 2005-12-21, then you must apply a fix for bug 320823 to allow sunbird to use themes.
...install a compatible test b
uild of the calendar extension in firefox 1.5, and examine its interface.
...And 2 more matches
Create Your Own Firefox Background Theme - Archive of obsolete content
how to create your own background theme themes are made up of a "header" graphic image file, which skins the default firefox
ui background.
... image req
uirements dimensions should be 3000px wide × 200px high png or jpg file format image must be no larger than 300 kb in file size tips subtle, soft contrast images and gradients work best; highly detailed images will compete with the browser
ui.
... firefox may reveal more of the lower portion of the image if another toolbar or other
ui element is added to the top of the window.
...And 2 more matches
LiveConnect Overview - Archive of obsolete content
in some ways, the existence of the liveconnect objects is transparent, because you interact with java in a fairly int
uitive way.
...string"); var thearray = java.lang.reflect.array.newinstance(theclass, 5); in javascript 1.4 and later, you can pass a javaclass object directly to a method, as shown in the following example: // javascript 1.4 var thearray = java.lang.reflect.array.newinstance(java.lang.string, 5); arguments of type char in javascript 1.4 and later, you can pass a one-character string to a java method which req
uires an argument of type char.
...(although this functionality (along with some others) had been broken in gecko 1.9 (see bug 391642) as the mozilla-specific liveconnect code had not been maintained inside mozilla, with java 6 update 11 and 12 b
uilding support for reliance on mozilla's implementation of the generic (and cross-browser) npapi plugin code, this has again been fixed.) for example, suppose you are using the java forname method to assign the name of a java class to a variable called theclass.
...And 2 more matches
Mozilla XForms User Interface - Archive of obsolete content
introduction this article is a q
uick reference of the xforms user interface elements.
...the xforms specs define two kinds of xforms
ui elements, called 'form controls' and 'xforms user interface'.
...the set of "xforms user interface" elements exist to aid form authors in combining host language markup and xforms markup together in order to b
uild user interfaces.
...And 2 more matches
WebVR — Virtual Reality for the Web - Game development
browser support and spec status currently browser support for the webvr api is still experimental — it works in nightly b
uilds of firefox and experimental b
uilds of chrome (mozilla and google teamed up to work on the implementation together), but sooner rather than later we'll see it in regular b
uilds.
... there's also a markup framework called a-frame that offers simple b
uilding blocks for webvr, so you can rapidly b
uild and experiment with vr websites and games: read the b
uilding up a basic demo with a-frame tutorial for more details.
...it's not easy to achieve, but it doesn't req
uire realistic images.
...And 2 more matches
Visual typescript game engine - Game development
client part to make all dependency works in b
uild process we need some plugins.
... npm install npm run b
uild navigate in browser /b
uild/app.html to see client app in action -the client part is a browser web application.
...me: "crypto-runner", title: "play platformer crypto runner!", }; // symbolic for now const gameslist: any[] = [ plarformergameinfo, ]; const master = new ioc(gameslist); const appicon: appicon = new appicon(master.get.browser); master.singlton(platformer, master.get.starter); console.log("platformer: ", master.get.platformer); master.get.platformer.attachappevents(); project structure b
uilds/ is autogenerated.
...And 2 more matches
Styling links - Learn web development
prereq
uisites: basic computer literacy, html basics (study introduction to html), css basics (study introduction to css), css text and font fundamentals.
... objective: to learn how to style link states, and how to use links effectively in common
ui features like navigation menus.
...in this article we'll b
uild on this knowledge, showing you best practices for styling links.
...And 2 more matches
What is a web server? - Learn web development
prereq
uisites: you should already know how the internet works, and understand the difference between a web page, a web site, a web server, and a search engine.
... for all these reasons, finding a good hosting provider is a key part of b
uilding your website.
...if not, an application server b
uilds the necessary file.
...And 2 more matches
Common questions - Learn web development
tools and setup questions related to the tools/software you can use to b
uild websites.
... what software do i need to b
uild a website?
... this article provides a basic g
uide to publishing content using github's gh-pages feature.
...And 2 more matches
Basic native form controls - Learn web development
prereq
uisites: basic computer literacy, and a basic understanding of html.
... <input type="hidden" id="timestamp" name="timestamp" value="1286705410"> if you create such an element, it's req
uired to set its name and value attributes.
... below you can find examples of each button <input> type, along with the eq
uivalent button type.
...And 2 more matches
CSS property compatibility table for form controls - Learn web development
therefore, it's req
uired to use -webkit-appearance:none to be able to apply this property to search fields.
...therefore, it's req
uired to use -webkit-appearance:none to be able to apply this property to search fields.
...therefore, it's req
uired to use -webkit-appearance:none to be able to apply this property to search fields.
...And 2 more matches
Add a hitmap on top of an image - Learn web development
prereq
uisites: you should already know how to create a basic html document and how to add accessible images to a webpage.
...do not use server-side image maps, which req
uire the user to have a mouse.
...to keep keyboard navigation int
uitive, make sure the source order of <area> elements corresponds to the visual order of hotspots.
...And 2 more matches
Debugging HTML - Learn web development
prereq
uisites: html familiarity, as covered in, for example, getting started with html, html text fundamentals, and creating hyperlinks.
... debugging isn't scary when writing code of some kind, everything is usually fine, until that dreaded moment when an error occurs — you've done something wrong, so your code doesn't work — either not at all, or not q
uite how you wanted it to.
...however, error messages can q
uickly get more complicated and less easy to interpret as programs get bigger, and even simple cases can look a little intimidating to someone who doesn't know anything about rust.
...And 2 more matches
Document and website structure - Learn web development
prereq
uisites: basic html familiarity, as covered in getting started with html.
...many web designers consider the navigation bar to be part of the header rather than an individual component, but that's not a req
uirement; in fact, some also argue that having the two separate is better for accessibility, as screen readers can read the two features better if they are separate.
...the footer is also sometimes used for seo purposes, by providing links for q
uick access to popular content.
...And 2 more matches
HTML table advanced features and accessibility - Learn web development
prereq
uisites: the basics of html (see introduction to html).
...this is useful for all readers wishing to get a q
uick idea of whether the table is useful to them as they scan the page, but particularly for blind users.
... add a s
uitable caption for the table.
...And 2 more matches
Introducing asynchronous JavaScript - Learn web development
prereq
uisites: basic computer literacy, a reasonable understanding of javascript fundamentals.
...let's look at a q
uick example.
...that means that the following (pseudocode) wouldn't work: let response = fetch('myimage.png'); let blob = response.blob(); // display your image blob in the
ui somehow that's because you don't know how long the image will take to download, so when you come to run the second line it will throw an error (possibly intermittently, possibly every time) because the response is not yet available.
...And 2 more matches
Function return values - Learn web development
previous overview: b
uilding blocks next there's one last essential concept about functions for us to discuss — return values.
... prereq
uisites: basic computer literacy, a basic understanding of html and css, javascript first steps, functions — reusable blocks of code.
...(in these cases, our reference pages list the return value as void or undefined.) for example, in the displaymessage() function we b
uilt in the previous article, no specific value is returned when the function is invoked.
...And 2 more matches
Manipulating documents - Learn web development
prereq
uisites: basic computer literacy, a basic understanding of html, css, and javascript — including javascript objects.
...tetextnode(): const text = document.createtextnode(' — the premier source for web development knowledge.'); now we'll grab a reference to the paragraph the link is inside, and append the text node to it: const linkpara = document.queryselector('p'); linkpara.appendchild(text); that's most of what you need for adding nodes to the dom — you'll make a lot of use of these methods when b
uilding dynamic interfaces (we'll look at some examples later).
...as you start b
uilding larger and more involved apps, you will probably start using the second method more, but it is really up to you.
...And 2 more matches
Video and Audio APIs - Learn web development
prereq
uisites: javascript basics (see first steps, b
uilding blocks, javascript objects), the basics of client-side apis objective: to learn how to use browser apis to control video and audio playback.
... next, let's define stopmedia() — add the following function below playpausemedia(): function stopmedia() { media.pause(); media.currenttime = 0; play.setattribute('data-icon','p'); } there is no stop() method on the htmlmediaelement api — the eq
uivalent is to pause() the video, and set its currenttime property to 0.
... the node.textcontent value of the timer is set to the time value, so it displays in the
ui.
...And 2 more matches
Storing the information you need — Variables - Learn web development
in this article, we will get down to the real basics, looking at how to work with the most basic b
uilding blocks of javascript — variables.
... prereq
uisites: basic computer literacy, a basic understanding of html and css, an understanding of what javascript is.
...again, you can return your variable values by simply typing their name into the console — try these again: myname; myage; you can declare and initialize a variable at the same time, like this: let mydog = 'rover'; this is probably what you'll do most of the time, as it is q
uicker than doing the two actions on two separate lines.
...And 2 more matches
Multimedia: Images - Learn web development
in terms of download performance, eliminating media, and reducing file size is the low-hanging fr
uit.
... prereq
uisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies.
... for a more in-depth g
uide, see https://images.g
uide.
...And 2 more matches
Server-side website programming first steps - Learn web development
we then provide an overview of some of the most popular server-side web frameworks, along with g
uidance on how to select the most s
uitable framework for creating your first site.
... prereq
uisites before starting this module, you don't need to have any knowledge of server-side website programming, or indeed any other type of programming.
... what software do i need to b
uild a website?
...And 2 more matches
Server-side website programming - Learn web development
most major websites use some kind of server-side technology to dynamically display data as req
uired.
...displaying all of these using different static pages would be extremely inefficient, so instead such sites display static templates (b
uilt using html, css, and javascript), and then dynamically update the data displayed inside those templates when needed, such as when you want to view a different product on amazon.
...similarly, expertise in client-side coding is not req
uired, but a basic knowledge will help you work better with the developers creating your client-side web "front end".
...And 2 more matches
Routing in Ember - Learn web development
prereq
uisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line.
... router.js behaves as a "sitemap" for developers to be able to q
uickly see how the entire app is structured.
...since our data is static, we won't get to any of those fancy features, but we'll still make sure that the route provides the minimally req
uired data to view a page.
...And 2 more matches
Vue resources - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line.
... b
uilding and publishing your vue app the vue cli also provides us with tools for preparing our app for publishing to the web.
... next, run the npm run b
uild (or yarn b
uild) in the console.
...And 2 more matches
Understanding client-side web development tools - Learn web development
get started now, with our "client-side tooling overview" prereq
uisites you should really learn the basics of the core html, css, and javascript languages first before attempting to use the tools detailed here.
... get started g
uides 1.
...command line crash course in your development process you'll undoubtedly be req
uired to run some command in the terminal (or on the "command line" — these are effectively the same thing).
...And 2 more matches
Embedding API for Accessibility
in part, being accessible means supporting a b
uilt-in accessibility apis for a platform, such as microsoft active accessibility or atk for linux and unix desktops.
...be aware that in debug b
uilds, this can cause a great number of assertions (bug 71598) to use prefs in embedding, use something like the following code: #include "nsipref.h"; nsresult rv; nscomptr<nsipref> prefs(do_getservice(ns_pref_contractid, &rv)); prefs->setboolpref("bool.pref.name", pr_true /* or pr_false */); prefs->setintpref("int.pref.name", newvalue); prefs->setcharpref("string.pref.name", newcharstarvalue);...
...it's a w3c uaag req
uirement */ setboolpref("browser.selection.use_system_colors", usesystemcolors); no content waiting alerts setcharpref("alert.audio.mail_waiting", pathtosoundfile); setcharpref("alert.audio.background_image_waiting", pathtosoundfile); setcharpref("alert.audio.po...
...And 2 more matches
Information for External Developers Dealing with Accessibility
implementing an msaa server, a practical g
uide a document for developers who need to support microsoft active accessibility (msaa) in a desktop application, in order to make it accessible with 3rd party assistive technologies, containing practical tips and the details of mozilla's implementation.
... accessible toolkit checklist a list of what needs to be done for accessibility when b
uilding new toolkits, widget by widget.
... in addition, here is a list of official keyboard
ui g
uidelines for each desktop: windows keys: g
uidelines on keyboard
ui design and on implementing keyboard shortcuts: an excellent resource from microsoft.
...And 2 more matches
Accessibility and Mozilla
since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night.accessibility information for
ui designers and developerswhen you design user interfaces with accessibility in mind, they will work for more people.
... this page describes a number of design-related aspects to look out for, in no particular order.accessibility/liveregiondevg
uidethis page is currently under construction.
... this developer's g
uide lays out general g
uidelines that assistive technology (at) developers can use in developing live region support.
...And 2 more matches
Lightweight themes
how to create your own lightweight theme lightweight themes are made up of a "header" graphic image file, which skins the default firefox
ui background.
... image req
uirements dimensions should be 3000px wide × 200px high png or jpg file format image must be no larger than 300 kb in file size tips subtle, soft contrast images and gradients work best; highly detailed images will compete with the browser
ui.
... firefox may reveal more of the lower portion of the image if another toolbar or other
ui element is added to the top of the window.
...And 2 more matches
Add-ons
developing extensions in the past, there were several toolsets for developing firefox extensions, but as of november 2017, extensions must be b
uilt using webextensions apis.
...you’ll find: overview of the firefox extension features tools and processes for developing and testing how to publish your extension on addons.mozilla.org or distribute it yourself how to manage your published extension an enterprise g
uide for developing and using extensions how to develop themes for firefox firefox developer communities extensions for firefox for android in 2020, mozilla will release a new firefox for android experience.
... this new, high-performance browser for android has been reb
uilt from the ground up using geckoview, mozilla’s mobile browser engine.
...And 2 more matches
Testopia
testopia 2.5 this versions supports bugzilla 4.2 and 4.4, and the best news is that it no longer req
uires a patch for bugzilla.
...a fresh install only req
uires that you untar the tarball in your bugzilla root directory and run checksetup.
...though all attempts have been made to provide contin
uing support for positional parameters, please be aware that some api calls may fail until you make this change.
...And 2 more matches
Debugging Frame Reflow
element width maximum width frame status overflow area getting the log make sure that your b
uild is a debug b
uild (in short you need ac_add_options --enable-debug in your .mozconfig file).
... run the debug b
uild, saving stdout to a file.
... log file analysis the log file for a simple table like <!doctype html public "-//w3c//dtd html 4.01 transitional//en"> <html> <head> <meta http-eq
uiv="content-type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="100"> <tbody> <tr> <td>foo</td> </tr> </tbody> </table> </body> </html> will create the following log: vp 00b97c30 r=0 a=9180,4470 c=9180,4470 cnt=856 scroll 00b97ee0 r=0 a=9180,4470 c=9180,4470 cnt=857 scroll 00b97ee0 r=0 a=9180,4470 c=9180,4470 cnt=858 canvas 00b97c6c r=0 a=9180,uc c=9...
...And 2 more matches
Gecko Logging
it is enabled for all b
uilds, thread-safe, and the preferred alternative to nspr logging.
...lazyloglodule provides a conversion operator to logmodule* and is s
uitable for passing into the logging macros detailed below.
... error 1 an error occurred, generally something you would consider asserting in a debug b
uild.
...And 2 more matches
Using the Browser API
the javascript implementation to wire up the functionality req
uired by our simple browser, we've written some basic javascript (see the full javascript listing.) wiring up the back and forward buttons early on in the code we implement two simple event listeners to move the browser back and forward in history when the relevant buttons are pressed: back.addeventlistener('touchend',function() { browser.goback(); }); fwd.addeventlistener('touchend',function(...
...when you tap the url bar, you can enter a url using the b
uilt-in firefox os keyboard (although note that we haven't implemented anything sophisticated in this app, like autofilling the http://, etc.).
... in addition, the background of the controls
ui bar is changed to the background color of the site that has just loaded, to provide a more integrated experience — this can be read out of the event object's e.detail.backgroundcolor value.
...And 2 more matches
mozbrowserloadend
although implementations may change in the future and it is not supported widely across browsers, it is s
uitable for use in code dedicated to firefox os apps.
... this can be used when the embedder wants to stop spinning a loading indicator, or update the
ui in some other way to indicate loading is complete.
...can be used to make the theme of the surrounding
ui complement the theme of the currently loaded content, for example.
...And 2 more matches
Gecko Keypress Event
problem 2 the access keys for the menu items are specified with the localized characters on some localized b
uilds.
... however, users with the same non-latin keyboard layouts would also like to be able to use latin access keys of en-us b
uilds (including nightly b
uilds) without needing to switch keyboard layout (bug 399939).
...this makes it impossible for users to disting
uish between accesskeys using two different characters on the same key (when the shift modifier is usually used to select one of the characters).
...And 2 more matches
Implementing QueryInterface
a reference implementation of queryinterface ns_imethodimp nsmyimplementation::queryinterface( refnsiid aiid, void** ainstanceptr ) { ns_assertion(ainstanceptr, "queryinterface req
uires a non-null destination!"); // it's a logic error, not a runtime error, to call me without any place to put my answer!
... // ...but that won't matter when someone calls me wrongly in a non-debug b
uild.
... else if ( aiid.equals(nscomtypeinfo<nsisupports>::getiid()) ) foundinterface = ns_static_cast(nsisupports*, ns_static_cast(nsix*, this)); // i (may) have multiple |nsisupports| in me, // so first i cast to a specific base to avoid ambig
uity else foundinterface = 0; nsresult status; if ( !foundinterface ) status = ns_nointerface; else { ns_addref(foundinterface); status = ns_ok; } *ainstanceptr = foundinterface; return status; } what's so good about it?
...And 2 more matches
JavaScript OS.Constants
init(); from a chrome worker no initialization is req
uired.
... debug set to true on debug b
uild configurations, non-existent otherwise.
...eq
uivalent to s_irusr | s_iwusr | s_ixusr.
...And 2 more matches
Sqlite.jsm
sqlite.jsm exposes a transaction api b
uilt on top of task.jsm that allows transactions to be written as procedural javascript functions (as opposed to a series of callback driven operations).
...this function takes an object defining connection options: path (req
uired) the database file to open.
...however, sharing also req
uires connections to obtain a lock, possibly making database access slower.
...And 2 more matches
Using JavaScript code modules
modules can also be used to create global javascript singletons that previously req
uired using javascript xpcom objects.
...for example: components.utils.import("resource://app/my_module.jsm"); alert(foo()); // displays "foo" alert(bar.size + 3); // displays "6" alert(dummy); // displays "dummy is not defined" because 'dummy' was not exported from the module note: when you're testing changes to a code module, be sure to change the application's b
uild id (e.g., the version) before your next test run; otherwise, you may find yourself running the previous version of your module's code.
... unloading code modules req
uires gecko 7.0(firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) components.utils.unload() allows you to unload a previously imported code module.
...And 2 more matches
Writing localizable code
this page tells you about best practices and g
uidelines when dealing with
ui code with respect to localization.
... about localizers a few notes about localizers for developers who rarely deal with them: localizers like tools, and they don't like editors, localization tools are often based on key-value pairs, at least some localizers have their talents focused on language skills and are not savvy in programming, or even b
uilding applications.
... g
uidelines thus, there are a few g
uidelines you should follow to make localization of your code easier: choose good key names the names chosen for your keys (regardless of whether that's a dtd or a properties file) should be descriptive.
...And 2 more matches
Fonts for Mozilla 2.0's MathML engine
q
uick instructions try this test page to q
uickly determine whether you need to install additional fonts and to follow the instructions below.
...this req
uires gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) or higher.
...mozilla can display any of these symbols provided s
uitable unicode fonts are installed.
...And 2 more matches
Mozilla MathML Project
the mozilla mathml project is mozilla's project to b
uild and enhance mathml support within firefox and other mozilla-based applications.
... for a q
uick overview, see the slides for the innovation fairs at mozilla summit 2013.
... updates status of each tag result of the mathml 3 tests
uite unofficial nightly b
uilds with mathml patches applied (maintained by bill gianopoulos) more updates and archived content community view mozilla forums...
...And 2 more matches
Memory Profiler
firefox developer tools now has a b
uilt-in memory profiler.
... getting the profiler add-on the b
uilt-in memory profiler's interface is still under construction.
...you may need to set the "xpinstall.signatures.req
uired" pref to false in order to install it, since the xpi is not yet signed.
...And 2 more matches
TraceMalloc
to enable tracemalloc in your b
uild, configure with --enable-trace-malloc.
... the b
uilt mozilla application will support the following additional command-line options: --trace-malloc filename the application will log allocation and deallocation events with stack traces in a binary format to the given file.
...here is a how-to for analyzing the shutdown log, taken from the tinderbox leak b
uilds.
...And 2 more matches
about:memory
it is present in all b
uilds and does not req
uire any preparation to be used.
...��─33.73 mb (17.58%) ── heap-unclassified ├───22.51 mb (11.73%) ++ heap-overhead ├────6.62 mb (03.45%) ++ images ├────5.82 mb (03.03%) ++ workers/workers(chrome) ├────5.36 mb (02.80%) ++ (16 tiny) ├────4.07 mb (02.12%) ++ storage ├────2.74 mb (01.43%) ++ startup-cache └────2.16 mb (01.12%) ++ xpconnect some expertise is req
uired to understand the full details here, but there are various things worth pointing out.
... the "window-objects" sub-tree represents all javascript window objects, which includes the browser tabs and
ui windows.
...And 2 more matches
Leak And Bloat Tests
provide a consistent number from b
uild to b
uild where no source code has changed.
... startup main mail window open address book and message composition windows close address book and message composition windows q
uit the application future improvements will be discussed on the discussion page of the mozilla wiki.
... manually running tests setting up b
uild set up b
uild thunderbird or seamonkey with your standard mozconfig file, but with the following options set: ac_add_options --enable-debug ac_add_options --enable-trace-malloc running the tests in your <objdir> run the following command: make mailbloat this will run the tests and produce some result files.
...And 2 more matches
NSPR Types
des the following type definitions with unambiguous bit widths for algebraic operations: 8-, 16-, and 32-bit integer types 64-bit integer types floating-point number type for convenience, nspr also provides type definitions with platform-dependent bit widths: native os integer types 8-, 16-, and 32-bit integer types signed integers print8 print16 print32 unsigned integers pr
uint8 pr
uint16 pr
uint32 64-bit integer types different platforms treat 64-bit numeric fields in different ways.
... some systems req
uire emulation of 64-bit fields by using two 32-bit numeric fields bound in a structure.
... print64 pr
uint64 floating-point number type the nspr floating-point type is always 64 bits.
...And 2 more matches
NSS_3.11.10_release_notes.html
nss 3.11.10 req
uires nspr 4.7.1.
... see the documentation section for the b
uild instructions.
...both debug and optimized b
uilds are provided.
...And 2 more matches
NSS 3.14.2 release notes
note: the new assembly code req
uires gnu as version 2.19 or newer.
...the documentation is in the docbook format and can be rendered as html and unix-style manual pages using an optional b
uild target.
...if so, nss uses the optimized code path, reducing the cpu cycles per byte to 1/20 of what was req
uired before the patch (https://bugzilla.mozilla.org/show_bug.cgi?id=805604 and https://crypto.stanford.edu/realworldcrypto/slides/gueron.pdf).
...And 2 more matches
NSS 3.35 release notes
nss 3.35 req
uires nspr 4.18, or newer.
... please use the eq
uivalent ssl_sig_rsa_pss_rsae_sha* for rsaencryption keys, or ssl_sig_rsa_pss_pss_sha* for pss keys.
...note that debug b
uilds will use a lower count, for better performance in test environments.
...And 2 more matches
NSS 3.37 release notes
nss 3.37 req
uires nspr 4.19 or newer.
...nss now req
uires the sqlite apis of version 3.5.0 or newer.
...this alternative implementation is selected at b
uild time by defining the seed_only_dev_urandom symbol.
...And 2 more matches
NSS 3.47 release notes
nss 3.47 req
uires nspr 4.23 or newer.
... notable changes in nss 3.47 bug 1152625 - support aes hw acceleration on armv8 bug 1267894 - allow per-socket run-time ordering of the cipher s
uites presented in clienthello bug 1570501 - add cmac to freebl and pkcs #11 libraries bugs fixed in nss 3.47 bug 1459141 - make softoken cbc padding removal constant time bug 1589120 - more cbc padding tests bug 1465613 - add ability to distrust certificates issued after a certain date for a specified root cert bug 1588557 - bad debug statement in tls13con.c bug 1579060 - mozilla::pkix ta...
... bug 1578238 - handle invald tag sizes for ckm_aes_gcm bug 1576295 - check all bounds when encrypting with seed_cbc bug 1580286 - nss rejects tls 1.2 records with large padding with sha384 hmac bug 1577448 - create additional nested s/mime test messages for thunderbird bug 1399095 - allow nss-try to be used to test nspr changes bug 1267894 - libssl should allow selecting the order of cipher s
uites in clienthello bug 1581507 - fix unportable grep expression in test scripts bug 1234830 - [cid 1242894][cid 1242852] unused values bug 1580126 - fix b
uild failure on aarch64_be while b
uilding freebl/gcm bug 1385039 - b
uild nspr tests as part of nss continuous integration bug 1581391 - fix b
uild on openbsd/arm64 after bug #1559012 bug 1581041 - mach-commands -> mach-completion bug 155831...
...And 2 more matches
NSS 3.48 release notes
nss 3.48 req
uires nspr 4.24 or newer.
...because using an iteration count higher than 1 with the legacy dbm (key3.db) storage creates files that are incompatible with previous versions of nss, applications that wish to enable it for key3.db are req
uired to set environment variable nss_allow_legacy_dbm_iteration_count=1.
... certificate authority changes the following ca certificates were added: bug 1591178 - entrust root certification authority - g4 cert sha-256 fingerprint: db3517d1f6732a2d5ab97c533ec70779ee3270a62fb4ac4238372460e6f01e88 upcoming changes in nss 3.49 the legacy dbm database, libnssdbm, will no longer be b
uilt by default.
...And 2 more matches
NSS 3.50 release notes
nss 3.50 req
uires nspr 4.25 or newer.
... note that intel processors with sse4 but without avx are currently unable to use the improved chacha20/poly1305 due to a b
uild issue; such platforms will fall-back to less optimized algorithms.
... bugs fixed in nss 3.50 bug 1599514 - update dtls 1.3 implementation to draft-30 bug 1603438 - fix native tools b
uild failure due to lack of zlib include dir if external bug 1599603 - nist sp800-108 kbkdf - pkcs#11 implementation bug 1606992 - cache the most recent pbkdf1 password hash, to speed up repeated sdr operations, important with the increased kdf iteration counts.
...And 2 more matches
NSS 3.53 release notes
nss 3.53 req
uires nspr 4.25 or newer.
... notable changes in nss 3.53 when using the makefiles, nss can be b
uilt in parallel, speeding up those b
uilds to more similar performance as the b
uild.sh/ninja/gyp system.
...(bug 1618404, bug 1621159) if a b
uiltin certificate has a cka_nss_server_distrust_after timestamp before the sct or notbefore date of a certificate that b
uiltin issued, then clients can elect not to trust it.
...And 2 more matches
NSS 3.55 release notes
nss 3.55 req
uires nspr 4.27 or newer.
... known issues on some platforms, using the makefile b
uilds fails to locate seccomon.h; ensure you are using make all rather than just make.
... another potential workaround is to use the gyp-based b
uild.sh script.
...And 2 more matches
NSS 3.56 release notes
nss 3.56 req
uires nspr 4.28 or newer.
... the known issue where makefile b
uilds failed to locate seccomon.h was fixed in bug 1653975.
... bug 1656986 - properly detect arm64 during gyp b
uild architecture detection.
...And 2 more matches
NSS functions
erversidcache mxr 3.2 and later ssl_configsecureserver mxr 3.2 and later ssl_configserversessionidcache mxr 3.2 and later ssl_datapending mxr 3.2 and later ssl_forcehandshake mxr 3.2 and later ssl_forcehandshakewithtimeout mxr 3.11.4 and later ssl_getchannelinfo mxr 3.4 and later ssl_getciphers
uiteinfo mxr 3.4 and later ssl_getclientauthdatahook mxr 3.2 and later ssl_getmaxservercachelocks mxr 3.4 and later ssl_getsessionid mxr 3.2 and later ssl_getstatistics mxr 3.2 and later ssl_handshakecallback mxr 3.2 and later ssl_importfd mxr 3.2 and later ssl_inheritmpserversidcache mxr 3...
...ert mxr 3.4 and later cert_getcertemailaddress mxr 3.2 and later cert_getcertificatenames mxr 3.10 and later cert_getcertificaterequestextensions mxr 3.10 and later cert_getcertissuerandsn mxr 3.2 and later cert_getcertnicknames mxr 3.2 and later cert_getcerttrust mxr 3.2 and later cert_getcert
uid mxr 3.2 and later cert_getclassicocspdisabledpolicy mxr 3.12 and later cert_getclassicocspenabledhardfailurepolicy mxr 3.12 and later cert_getclassicocspenabledsoftfailurepolicy mxr 3.12 and later cert_getcommonname mxr 3.2 and later cert_getcountryname mxr 3.2 and later cert_getdbcontentversion mxr 3...
... later sec_dersigndata mxr 3.2 and later sec_destroycrl mxr 3.2 and later sec_findcrlbydercert mxr 3.2 and later sec_findcrlbyname mxr 3.2 and later sec_lookupcrls mxr 3.2 and later sec_newcrl mxr 3.2 and later sec_q
uickderdecodeitem mxr 3.6 and later seckey_cachestaticflags mxr 3.10 and later seckey_converttopublickey mxr 3.2 and later seckey_copyprivatekey mxr 3.2 and later seckey_copypublickey mxr 3.6 and later seckey_copysubjectpublickeyinfo mxr 3.4 and late...
...And 2 more matches
NSS tools : pk12util
enter new password: re-enter password: enter password for pkcs12 file: pk12util: pkcs12 import successful exporting keys and certificates using the pk12util command to export certificates and keys req
uires both the name of the certificate to extract from the database (-n) and the pkcs#12-formatted output file to write to.
...each certificate is written to a sequentially-number file, beginning with file0001.der and contin
uing through file000n.der, incrementing the number for every certificate: # pk12util -l test.p12 -r enter password for pkcs12 file: key(shrouded): friendly name: thawte freemail member's thawte consulting (pty) ltd.
... id encryption algorithm: pkcs #12 v2 pbe with sha-1 and 3key triple des-cbc parameters: salt: 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f iteration count: 1 (0x1) certificate friendly name: thawte personal freemail iss
uing ca - thawte consulting certificate friendly name: thawte freemail member's thawte consulting (pty) ltd.
...And 2 more matches
NSS tools : pk12util
enter new password: re-enter password: enter password for pkcs12 file: pk12util: pkcs12 import successful exporting keys and certificates using the pk12util command to export certificates and keys req
uires both the name of the certificate to extract from the database (-n) and the pkcs#12-formatted output file to write to.
...each certificate is written to a sequentially-number file, beginning with file0001.der and contin
uing through file000n.der, incrementing the number for every certificate: # pk12util -l test.p12 -r enter password for pkcs12 file: key(shrouded): friendly name: thawte freemail member's thawte consulting (pty) ltd.
... id encryption algorithm: pkcs #12 v2 pbe with sha-1 and 3key triple des-cbc parameters: salt: 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f iteration count: 1 (0x1) certificate friendly name: thawte personal freemail iss
uing ca - thawte consulting certificate friendly name: thawte freemail member's thawte consulting (pty) ltd.
...And 2 more matches
Rhino overview
javascript: the definitive g
uide is recommended, and contains a chapter on rhino.
... second, the value of the property security.req
uiresecuritydomain should be changed to true in the resource bundle org.mozilla.javascript.resources.security.
... the value of this property can be determined at runtime by calling the issecuritydomainreq
uired method of context.
...And 2 more matches
JIT Optimization Outcomes
accessnottypedarray accessnotstring statictypedarray
uint32 statictypedarraycantcomputemask outofbounds getelemstringnotcached nonnativereceiver indextype setelemnondensenontanotcached nosimdjitsupport optimization failed because simd jit support was not enabled.
...for example, it could be a native function for which ion has no b
uilt-in specialization.
...the interpreted callee function req
uires an arguments object to be created.
...And 2 more matches
JSAPI Cookbook
this article shows the jsapi eq
uivalent for a tiny handful of common javascript idioms.
...etint32(0); // or: v = js::int32value(0); v.setdouble(0.5); // or: v = js::doublevalue(0.5); v.setstring(somestring); // or: v = js::stringvalue(somestring); v.setnull(); // or: v = js::nullvalue(); v.setundefined(); // or: v = js::undefinedvalue(); v.setboolean(false); // or: v = js::booleanvalue(false); finding the global object many of these recipes req
uire finding the current global object first.
...it req
uires a jsobject * argument.
...And 2 more matches
JS::CreateError
syntax // added in spidermonkey 45 bool js::createerror(jscontext *cx, jsexntype type, handleobject stack, handlestring filename,
uint32_t linenumber,
uint32_t columnnumber, jserrorreport *report, handlestring message, mutablehandlevalue rval); // obsolete since jsapi 39 bool js::createerror(jscontext *cx, jsexntype type, handlestring stack, handlestring filename,
uint32_t linenumber,
uint32_t columnnumber, jserrorreport *report, handlestring message, mutablehandlevalue rval); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
...And 2 more matches
JS::PersistentRooted
they are registered with the jsruntime itself, without locking, so they req
uire a full jscontext to be initialized, not one of its more restricted superclasses.
... // destroy here // req
uired because of maybe or pointer.
... // persistentrooted itself doesn't req
uire explicit destruction.
...And 2 more matches
JSObjectOps.dropProperty
(in a js_threadsafe b
uild, that would risk deadlock.) when finished with a locked property, the caller must release it by calling the dropproperty callback.
... a single, b
uilt-in jsobjectops implementation is used for most spidermonkey objects that are exposed to scripts.
... custom jsobjectops implementations can either retain the spidermonkey property storage and locking scheme (by copying all or most of the b
uilt-in jsobjectops) or replace it entirely.
...And 2 more matches
JS_GetGCParameter
syntax
uint32_t js_getgcparameter(jsruntime *rt, jsgcparamkey key); void js_setgcparameter(jsruntime *rt, jsgcparamkey key,
uint32_t value);
uint32_t js_getgcparameterforthread(jscontext *cx, jsgcparamkey key); // added in spidermonkeysidebar 17 void js_setgcparameterforthread(jscontext *cx, jsgcparamkey key,
uint32_t value); // added in spidermonkeysidebar 17 name type description rt jsruntime * the runtime to configure.
...req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
...And 2 more matches
JS_LookupProperty
ue vp); bool js_lookupucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::mutablehandlevalue vp); bool js_lookuppropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandlevalue vp); // added in spidermonkey 1.8.1 bool js_lookupelement(jscontext *cx, js::handleobject obj,
uint32_t index, js::mutablehandlevalue vp); // ---- obsolete since spidermonkey 31 ---- bool js_lookuppropertywithflags(jscontext *cx, js::handleobject obj, const char *name, unsigned flags, js::mutablehandlevalue vp); bool js_lookuppropertywithflagsbyid(jscontext *cx, js::handleobject obj, js::handleid id, unsigned flags,...
...req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
...And 2 more matches
JS_YieldRequest
req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
... jsapi 1.7 and earlier js_yieldrequest did not cause cx to relinq
uish objects it created to other threads that are blocked waiting for them.
...And 2 more matches
SpiderMonkey 1.8.8
a significant number of typedefs of b
uilt-in types, or of types which are now standardized, have been removed.
... obsolete typedef replacement type provided by
uint8, int8,
uint16, int16,
uint32, int32,
uint64, int64
uint8_t, int8_t,
uint16_t, int16_t,
uint32_t, int32_t,
uint64_t, int64_t mozilla/stdint.h
uintn, intn unsigned (also known as unsigned int), int n/a jsdouble double n/a js
uintn, jsintn unsigned (also known as unsigned int), int n/a jspackedbool n/a n/a jsre...
... the environment variable is provided as a solution for embedders whose code req
uires particular definitions of those types, and those particular definitions are incompatible with the standard definitions or the custom implementation needed for older versions of visual studio.
...And 2 more matches
SpiderMonkey 24
compiling it req
uires a c++ compiler, and the jsapi can only be used from c++ code.
... (this change was motivated by garbage collector improvements, which lean q
uite heavily on c++'s support for raii through constructors and destructors.) if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010: msvc8/9 support has been dropped.
... many of the garbage collector changes req
uire type signature changes to jsapi methods: specifically introducing js::rooted, js::handle, and js::mutablehandle types.
...And 2 more matches
Mozilla Projects
l20n l20n lets localizers reach higher levels of free ling
uistic expression by sharpening the divide between localization and application logic.
... midas midas is the code name for gecko's b
uilt-in rich text editor.
...applications b
uilt with nss can support ssl v3, tls, pkcs #5, pkcs #7, pkcs #11, pkcs #12, s/mime, x.509 v3 certificates, and other security standards.
...And 2 more matches
XML Extras
the xml extras module is b
uilt by default on all platforms, and is included in the browser installers so it is available in the nightly b
uilds.
...more exhaustive test s
uites need to be created, however.
... contribute a test s
uite or individual tests that use the implemented components.
...And 2 more matches
Creating a Python XPCOM component
(note that some details may be missing.) preparation if a binary of pyxpcom is not available, you will need to b
uild it - see b
uilding pyxpcom.
...defining the interface make a file named "nsipysimple.idl" to define the interface: #include "nsisupports.idl" [scriptable, u
uid(2b324e9d-a322-44a7-bd6e-0d8c83d94883)] interface nsipysimple : nsisupports { attribute string yourname; void write( ); void change(in string avalue); }; this is the same as the nsisimple interface used here.
...registering the interface in the "components" directory, execute : ../xpidl -m typelib -w -v -i /usr/share/idl/mozilla/ nsipysimple.idl on windows you must point to the idl directory as part of your mozilla b
uild.
...And 2 more matches
Packaging WebLock
javascript apis from the xpinstall install object download the jar in which the installable files appear and call registration methods that tell mozilla about the new component and the
ui it uses to access the weblock component.
...the component files are copied to the components directory of the gecko application, and the weblock subdirectory gets copied over into the chrome subdirectory, where its
ui resources can be added dynamically to the xul-based gecko application.
...once triggered (see the weblock trigger script), the installation script: downloads the weblock component and places it in the components directory copies the weblock subdirectory in the mozilla chrome application subdirectory registers both the component and the
ui the xpinstall api provides such essential methods[essential-methods] as initinstall, registerchrome, addfile, and others.
...And 2 more matches
mozIAsyncHistory
if there's no information available for a given place, acallback is called with a stub place info object, containing just the provided data (g
uid or uri).
...void isurivisited( in nsiuri auri, in mozivisitedstatuscallback acallback ); parameters auri the places for which to retrieve information, identified by either a single place g
uid, a single uri, or a js array of uris and/or g
uids.
... updateplaces() adds a set of visits for one or more moziplaceinfo objects, and updates each moziplaceinfo's title or g
uid.
...And 2 more matches
nsIDBFolderInfo
obsolete since gecko 1.8 astring getproperty(in string propertyname); nsidbfolderinfo gettransferinfo(); unsigned long get
uint32property(in string propertyname, in unsigned long defaultvalue); void initfromtransferinfo(in nsidbfolderinfo transferinfo); long orflags(in long flags); void setbooleanproperty(in string propertyname, in boolean apropertyvalue); void setcharacterset(in string charset); void setcharactersetoverride(in boolean chara...
...obsolete since gecko 1.8 void setproperty(in string propertyname, in astring propertystr); void set
uint32property(in string propertyname, in unsigned long propertyvalue); attributes attribute type description charactersetoverride boolean expiredmark nsmsgkey expungedbytes long flags long folderdate unsigned long ...
... foldername string foldersize unsigned long highwater nsmsgkey imaphierarchyseparator wchar imaptotalpendingmessages long imap
uidvalidity long imapunreadpendingmessages long knownartsset string locale astring mailboxname astring nummessages long numunreadmessages long sortorder nsmsgviewsortordervalue sorttype nsmsgviewsorttypevalue version unsigned long ...
...And 2 more matches
nsIDocShell
storage); void addstate(in nsivariant adata, in domstring atitle, in domstring aurl, in boolean areplace); void beginrestore(in nsicontentviewer viewer, in boolean top); void createaboutblankcontentviewer(in nsiprincipal aprincipal); void createloadinfo(out nsidocshellloadinfo loadinfo); void detacheditorfromwindow(); violates the xpcom interface g
uidelines void finishrestore(); void firepagehidenotification(in boolean isunload); native code only!
...(in long aitemtype, in long adirection); nsidomstorage getsessionstorageforprincipal(in nsiprincipal principal, in domstring documenturi, in boolean create); nsidomstorage getsessionstorageforuri(in nsiuri uri, in domstring documenturi); void historypurged(in long numentries); void internalload(in nsiuri auri, in nsiuri areferrer, in nsisupports aowner, in pr
uint32 aflags, in wstring awindowtarget, in string atypehint, in nsiinputstream apostdatastream, in nsiinputstream aheadersstream, in unsigned long aloadflags, in nsishentry ashentry, in boolean firstparty, out nsidocshell adocshell, out nsirequest arequest); native code only!
... security
ui nsisecurebrowser
ui the securebrowser
ui object for this docshell.
...And 2 more matches
nsIEffectiveTLDService
method overview acstring getbasedomain(in nsiuri auri, [optional] in pr
uint32 aadditionalparts); acstring getbasedomainfromhost(in autf8string ahost, [optional] in pr
uint32 aadditionalparts); acstring getpublicsuffix(in nsiuri auri); acstring getpublicsuffixfromhost(in autf8string ahost); methods getbasedomain() returns the base domain of a uri; that is, the public suffix with a given number of additional domain name parts.
... acstring getbasedomain( in nsiuri auri, [optional] in pr
uint32 aadditionalparts ); parameters auri the uri to be analyzed.
... note: it is strongly recommended that you use getbasedomain() if a s
uitable nsiuri is available.
...And 2 more matches
nsIIOService
me); nsiprotocolhandler getprotocolhandler(in string ascheme); nsichannel newchannel(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); obsolete since gecko 48 nsichannel newchannel2(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri, in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in
uint32_t asecurityflags, in
uint32_t acontentpolicytype); nsichannel newchannelfromuri(in nsiuri auri); obsolete since gecko 48 nsichannel newchannelfromuri2(in nsiuri auri, in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in unsigned long asecurityflags, in unsigned long acontentpolicytype); nsichannel newchannelfromuri...
...withloadinfo(in nsiuri auri, in nsiloadinfo aloadinfo); nsichannel newchannelfromuriwithproxyflags2(in nsiuri auri, in nsiuri aproxyuri, in
uint32_t aproxyflags,in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in
uint32_t asecurityflags, in
uint32_t acontentpolicytype); nsiuri newfileuri(in nsifile afile); nsiuri newuri(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description offline boolean returns true if networking is in "offline" mode.
... nsichannel newchannel2( in autf8string aspec, in string aorigincharset, in nsiuri abaseuri, in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in
uint32_t asecurityflags, in
uint32_t acontentpolicytype, ); parameters aspec the spec for the desired uri.
...And 2 more matches
nsIInputStream
return value number of bytes currently available in the stream, or pr_
uint32_max if the size of the stream exceeds pr_
uint32_max.
... note: a nsiinputstream is not req
uired to implement this method.
... nsresult consumestream(nsiinputstream* astream) { nsresult rv;
uint32_t numread; char buf[512]; while (1) { rv = astream->read(buf, sizeof(buf), &numread); if (ns_failed(rv)) { printf("### error reading stream: %x\n", rv); break; } if (numread == 0) break; // buf now contains numread bytes of data } return rv; } consume all data from an input stream using readsegments().
...And 2 more matches
nsIInstallLocation
constant value description priority_app_profile 0 priority_app_system_user 10 priority_xre_system_user 100 priority_app_system_global 1000 priority_xre_system_global 10000 methods getidforlocation() retrieves the g
uid for an item at the specified location.
...nsifile getitemfile( in astring id, in astring path ); parameters id the g
uid of the item.
...nsifile getitemlocation( in astring id ); parameters id the g
uid of the item.
...And 2 more matches
nsIMsgProtocolInfo
cangetincomingmessages boolean true if junk
ui actions should be enabled for the account type.
... cangetmessages boolean true if "get messages"
ui actions should be enabled for the account type.
... req
uiresusername boolean true if the server req
uires a username to log on.
...And 2 more matches
nsIPropertyBag2
autf8string getpropertyasautf8string(in astring prop); boolean getpropertyasbool(in astring prop); double getpropertyasdouble(in astring prop); print32 getpropertyasint32(in astring prop); print64 getpropertyasint64(in astring prop); void getpropertyasinterface(in astring prop, in nsiidref iid, [iid_is(iid), retval] out nsqiresult result); pr
uint32 getpropertyas
uint32(in astring prop); pr
uint64 getpropertyas
uint64(in astring prop); prbool haskey(in astring prop); methods get() this method returns null if the value does not exist, or exists but is null.
... getpropertyas
uint32() pr
uint32 getpropertyas
uint32( in astring prop ); parameters prop property to return the value of.
... return value the property value as a pr
uint32.
...And 2 more matches
nsISupportsPrimitive
type_pr
uint8 5 corresponding to nsisupportspr
uint8.
... type_pr
uint16 6 corresponding to nsisupportspr
uint16.
... type_pr
uint32 7 corresponding to nsisupportspr
uint32.
...And 2 more matches
nsIXmlRpcClient
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void init(in string serverurl); void setauthentication(in string username, in string password); void clearauthentication(in string username, in string password); void setencoding(in string encoding); void setencoding(in unsigned long type, out nsiidref u
uid, out nsqiresult result); void asynccall (in nsixmlrpcclientlistener listener, in nsisupports ctxt, in string methodname, in nsisupports arguments, in pr
uint32 count); attributes attribute type description serverurl readonly nsiurl the url of the xml-rpc server inprogress readonly boolean whether or not a call is in progress fault readonly nsixmlrpcfault the most recent xml-rpc faul...
...supported arguments are: nsisupportspr
uint8, nsisupportspr
uint16, nsisupportsprint16, nsisupportsprint32: i4, nsisupportsprbool: boolean, nsisupportschar, nsisupportscstring: string, nsisupportsfloat, nsisupportsdouble: double, nsisupportsprtime: datetime.iso8601, nsiinputstream: base64, nsisupportsarray: array, nsidictionary: struct note that both nsisupportsarray and nsidictionary can only hold any of the supported input types.
...er a nsixmlrpcclientlistener that will get notified of xml-rpc events ctxt a context to be passed on to the listener methodname remote method to call arguments array of arguments to pass to the remote method count void asynccall ( in nsixmlrpcclientlistener listener, in nsisupports ctxt, in string methodname, [array, size_is(count)] in nsisupports arguments, in pr
uint32 count ); createtype() convenience: return the correct nsisupportsprimitive for a given xml-rpc type, or nsisupportsarray or nsidictionary.
...And 2 more matches
XPCOM Interface Reference
vicemotionnsidevicemotiondatansidevicemotionlistenernsidialogcreatornsidialogparamblocknsidictionarynsidirindexnsidirindexlistenernsidirindexparsernsidirectoryenumeratornsidirectoryiteratornsidirectoryservicensidirectoryserviceprovidernsidirectoryserviceprovider2nsidiskcachestreaminternalnsidispatchsupportnsidocshellnsidocumentloadernsidownloadnsidownloadhistorynsidownloadmanagernsidownloadmanager
uinsidownloadobservernsidownloadprogresslistenernsidownloadernsidragdrophandlernsidragservicensidragsessionnsidroppedlinkhandlernsidroppedlinkitemnsidynamiccontainernsieditornsieditorboxobjectnsieditordocshellnsieditorimesupportnsieditorloggingnsieditormailsupportnsieditorobservernsieditorspellchecknsieffectivetldservicensienumeratornsienvironmentnsierrorservicensieventlistenerinfonsieventlistenerse...
...ihttpactivityobservernsihttpchannelnsihttpchannelinternalnsihttpheadervisitornsihttpservernsihttpupgradelistenernsiidnservicensiiframeboxobjectnsiiniparsernsiiniparserfactorynsiiniparserwriternsiioservicensiidleservicensiinprocesscontentframemessagemanagernsiinputstreamnsiinputstreamcallbacknsiinstalllocationnsiinterfacerequestornsijscidnsijsidnsijsiidnsijsonnsijetpacknsijetpackservicensijumplistb
uildernsijumplistitemnsilivemarkservicensiloadgroupnsilocalfilensilocalfilemacnsilocalensilocaleservicensilogininfonsiloginmanagernsiloginmanagercryptonsiloginmanageriemigrationhelpernsiloginmanagerprompternsiloginmanagerstoragensiloginmetainfonsimimeinputstreamnsimacdocksupportnsimarkupdocumentviewernsimemorynsimemorymultireporternsimemorymultireportercallbacknsimemoryreporternsimemoryreportermanag...
...rternsistreamlistenernsistringbundlensistringbundleoverridensistringbundleservicensistringenumeratornsistructuredclonecontainernsistylesheetservicensisupportsnsisupports proxiesnsisupportsarraynsisupportscstringnsisupportscharnsisupportsdoublensisupportsfloatnsisupportsidnsisupportsinterfacepointernsisupportsprboolnsisupportsprint16nsisupportsprint32nsisupportsprint64nsisupportsprtimensisupportspr
uint8nsisupportspr
uint16nsisupportspr
uint32nsisupportspr
uint64nsisupportsprimitivensisupportsprioritynsisupportsstringnsisupportsvoidnsisupportsweakreferencensisyncjpakensisyncmessagesendernsitxttohtmlconvnsitaggingservicensitaskbarpreviewnsitaskbarpreviewbuttonnsitaskbarpreviewcontrollernsitaskbarprogressnsitaskbartabpreviewnsitaskbarwindowpreviewnsitelemetrynsitextinputprocessornsitextinputprocess...
...And 2 more matches
XPCOM Interface Reference by grouping
using this g
uide this page lists the current (as of dec.
...rray nsicategorymanager nsicollection nsidictionary nsimutablearray nsisimpleenumerator nsisupportschar nsisupportsdouble nsisupportsfloat nsisupportsid nsisupportsinterfacepointer nsisupportsprbool nsisupportsprimitive nsisupportsprint16 nsisupportsprint32 nsisupportsprint64 nsisupportspriority nsisupportsprtime nsisupportspr
uint16 nsisupportspr
uint32 nsisupportspr
uint64 nsisupportspr
uint8 nsisupportsstring nsisupportsvoid nsisupportsweakreference nsivariant do not use nsienumerator nsiinprocesscontentframemessagemanager nsiscriptableio nsixpcscriptable future nsixmlhttprequestupload obsolete nsixmlrpcclient nsixmlrpcfault security ...
...adcertlistener2 system action nsicancelable application application nsiapplicationupdateservice nsiappshell nsiappshellservice nsiappstartup xul nsixulappinfo nsixulruntime nsixultemplateb
uilder nsixultemplatequeryprocessor nsixultemplateresult bookmark livemark nsilivemarkservice nsinavbookmarkobserver nsinavbookmarksservice nsinavhistoryservice browser dom nsiwebbrowser ...
...And 2 more matches
nsIAbCard/Thunderbird3
yindex prefermailformat (see nsiabprefermailformat) boolean properties: allowremotecontent inherits from: nsiabitem method overview nsivariant getproperty(in autf8string name, in nsivariant defaultvalue); [noscript] astring getpropertyasastring(in string name); [noscript] autf8string getpropertyasautf8string(in string name); [noscript] pr
uint32 getpropertyas
uint32(in string name); [noscript] boolean getpropertyasbool(in string name); void setproperty(in autf8string name, in nsivariant value); [noscript] void setpropertyasastring(in string name, in astring value); [noscript] void setpropertyasautf8string(in string name, in autf8string value); [noscript] void setpropertyas
uint32(in string n...
...ame, in pr
uint32 value); [noscript] void setpropertyasbool(in string name, in boolean value); void deleteproperty(in autf8string name); autf8string translateto(in autf8string atype); void copy(in nsiabcard srccard) boolean equals(in nsiabcard card) astring generatephoneticname(in boolean alastnamefirst) attributes attribute type description properties nsisimpleenumerator readonly: a list of all the properties that this card has as an enumerator, whose members are all nsiproperty objects.
... getpropertyasastring() getpropertyasautf8string() getpropertyas
uint32() getpropertyasbool() [noscript] astring getpropertyasastring(in string name); [noscript] autf8string getpropertyasautf8string(in string name); [noscript] pr
uint32 getpropertyas
uint32(in string name); [noscript] boolean getpropertyasbool(in string name); returns a property for the given name.
...And 2 more matches
Weak reference
a naive design for an observer/observable relationship would req
uire the observable to hold a owning reference to the observer.
...there are other, mostly negligible, costs: it's an extra indirection per call, and the easy implementation req
uires adding an extra pointer per interface to the target implementation.
...queryinterface must satisfy many req
uirements to allow com to work.
...And 2 more matches
nsCOMPtr versus RefPtr
this g
uide provides some explanation and advice on how to choose between them.
...(although, confusingly, debug b
uilds don't work this way).
... nscomptr<t> also req
uires that you can queryinterface to type t.
...And 2 more matches
Xptcall Porting Status
xptcall has a faq and a porting g
uide.
...font> win32 x86 john bandhauer <jband@netscape.com> win32 <font color="white">done</font> linux x86 john bandhauer <jband@netscape.com> ulrich drepper <drepper@cygnus.com> unix <font color="white">done</font> freebsd and netbsd x86 christoph toshok <toshok@hungry.com>, john bandhauer <jband@netscape.com> unix (same as linux 86 code) <font color="white">done</font> bsd/os x86 bert drieh
uis <bert_drieh
uis@nl.compuware.com> unix (same as linux 86 code) bert contributed patches that *should* do the right thing for all the unixish-x86 versions of this code for gcc 2.7 or 2.8 vs.
... <font color="white">done</font> nt alpha bob meader <bob@g
uiduck.com> bob writes: enclosed is xptcall for alpha/nt target..
...And 2 more matches
Adding items to the Folder Pane
each time the folder pane determines that it is necessary to invalidate all its data (because of too many changes, or more commonly because the folder pane's "mode" (aka view) has changed), a "reb
uild" occurs.
... listening for folder pane reb
uilds every time the folder pane reb
uilds, it fires a "mapreb
uild" event, which is the ideal opportunity for extensions to step in and modify the display data.
... the following code snippet listens for that event: let gnumbersext = { load: function gne_load() { window.removeeventlistener("load", gnumbersext.load, false); let tree = document.getelementbyid("foldertree"); tree.addeventlistener("mapreb
uild", gnumbersext._insert, false); }, _insert: function gne__insert() { // this function is called when a reb
uild occurs } }; window.addeventlistener("load", gnumbersext.load, true); the structure of folder-tree-items the folder pane stores its current display data in a property called _rowmap.
...And 2 more matches
Activity Manager examples
if activity developers would like to extend the default
ui representation of the activity types, they can provide their own xbl elements for their own activity types.
... since nsiactivitycancelhandler is provided with the activity, the
ui will show a cancel button beside the activity.
...er implementation class mycopyeventundo : public nsiactivityundohandler { public: ns_decl_isupports ns_decl_nsiactivityundohandler mycopyeventundo() {} private: ~mycopyeventundo() {} }; ns_impl_isupports1(mycopyeventundo, nsiactivityundohandler) ns_imethodimp mycopyeventundo::undo(nsiactivityevent *event, nsresult *result) { nsresult rv; // get the subjects of this copy event pr
uint32 length; nsivariant **subjectlist; rv = event->getsubjects(&length, &subjectlist); if(ns_failed(rv)) return rv; // first subject in the list is the source folder in this particular case nscomptr<nsimsgfolder> folder = do_queryinterface(subjectlist[0]); // get the initiator nsivariant *initiator; event->getinitiator(&initiator); if (initiator) { nsisupports* ptr; ...
...And 2 more matches
Virtualenv
it will req
uire it to be part of a clone of the github repository or have internet access to fetch setuptools.
...due to its utility, tools have been b
uilt around this functionality.
... installation; https://bitbucket.org/kumar303/velcro/ virtualenvwrapper: a set of extensions to ian bicking’s virtualenv tool for creating isolated python development environments; http://www.doughellmann.com/projects...tualenvwrapper the mozilla-central virtualenv in order to make use of various python modules located throughout mozilla-central, a virtualenv is created as part of the b
uild process: http://mxr.mozilla.org/mozilla-central/source/js/src/b
uild/autoconf/python-virtualenv.m4 .
...And 2 more matches
Using COM from js-ctypes
ulong* pulstreamnumber); void* speakstream; void* getstatus; void* skip; void* setpriority; void* getpriority; void* setalertboundary; void* getalertboundary; void* setrate; void* getrate; void* setvolume; void* getvolume; void* waituntildone; void* setsyncspeaktimeout; void* getsyncspeaktimeout; void* speakcompleteevent; void* is
uisupported; void* display
ui; /* end ispvoice */ }; int main(void) { if (succeeded(coinitialize(null))) { struct myispvoice* pvoice = null; hresult hr = cocreateinstance(&clsid_spvoice, null, clsctx_all, &iid_ispvoice, (void**)&pvoice); if (succeeded(hr)) { pvoice->lpvtbl->speak(pvoice, l"hello, firefo...
... com types and functions needs com types (g
uid) and functions (coinitialize etc) description here.
...s.long; let lpvoid = ctypes.voidptr_t; let void = ctypes.void_t; let ulong = ctypes.unsigned_long; let ushort = ctypes.unsigned_short; let wchar = ctypes.jschar; // advanced types - based on simple types let hresult = long; let lpcwstr = wchar.ptr; // guess types - these just work i couldnt find a proper defintion for it let lpunknown = ctypes.voidptr_t; // structures // simple structures let g
uid = ctypes.structtype('g
uid', [ { 'data1': ulong }, { 'data2': ushort }, { 'data3': ushort }, { 'data4': byte.array(8) } ]); // advanced structures let clsid = g
uid; let iid = g
uid; // super advanced structures let refiid = iid.ptr; let refclsid = clsid.ptr; // vtables let ispvoicevtbl = ctypes.structtype('ispvoicevtbl'); let ispvoice = ctypes.structtype('ispvoice', [{ 'lpvtbl': isp...
...And 2 more matches
Declaring types
for example, to define a new 32-bit integer variable with the value 5: var i = ctypes.int32_t(5); you can then pass a pointer to this value to a c function that req
uires a pointer to a 32-bit integer, like this: some_c_function(i.address()); declaring new primitive types there are times when you want to create new types that are simply new names for existing primitive types.
...to declare this type, you can simply do: const dword = ctypes.
uint32_t; after doing this, dword is a ctype that can then be used to represent 32-bit unsigned integers.
... note: at present, there isn't a way to specify that an array's c eq
uivalent was declared as a packed structure; that is, using #pragma pack.
...And 2 more matches
Drawing and Event Handling - Plugins
a windowless plug-in does not req
uire a native window.
... //the npwindow structure typedef enum { npwindowtypewindow = 1, npwindowtypedrawable } npwindowtype; typedef struct _npwindow { void* window; /* platform-specific handle */
uint32 x; /* position of top-left corner */
uint32 y; /* relative to a netscape page */
uint32 width; /* maximum window size */
uint32 height; nprect cliprect; /* clipping rectangle in port coordinates */ #ifdef xp_unix void * ws_info; /* platform-dependent additional data */ #endif /* xp_unix */ npwindowtype type; /* whether this is a window or a drawa...
...on mac os, full-page printing req
uires that the field printinfo contain a standard mac os thprint (see printing.h).
...And 2 more matches
Migrating from Firebug - Firefox Developer Tools
web console the web console is the eq
uivalent of firebug's console panel.
...this functionality is already integrated into the devtools using the chromelogger protocol and doesn't req
uire any extensions to be installed.
...the devtools display an element {} rule for this purpose, which req
uires a single click into it to start editing the properties.
...And 2 more matches
Edit fonts - Firefox Developer Tools
note: the updated font tools as shown in this article are available in firefox 63 onwards; if you are using an older version of firefox the tools will not look or behave q
uite the same, but they will be similar (most notably the font editor will not be available).
... changing the unit of measure converts the numerical value to its eq
uivalent in the new unit, so the same computed value is maintained.
... example: if 1rem is eq
uivalent to 10 pixels, when you change the unit of measurement from rem to px, 2rem becomes 20px.
...And 2 more matches
BluetoothRemoteGATTCharacteristic - Web APIs
interface interface bluetoothremotegattcharacteristic { readonly attribute bluetoothremotegattservice service; readonly attribute u
uid u
uid; readonly attribute bluetoothcharacteristicproperties properties; readonly attribute dataview?
... value; promise<bluetoothremotegattdescriptor> getdescriptor(bluetoothdescriptoru
uid descriptor); promise<sequence<bluetoothremotegattdescriptor>> getdescriptors(optional bluetoothdescriptoru
uid descriptor); promise<dataview> readvalue(); promise<void> writevalue(buffersource value); promise<void> startnotifications(); promise<void> stopnotifications(); }; bluetoothremotegattcharacteristic implements eventtarget; bluetoothremotegattcharacteristic implements characteristiceventhandlers; properties bluetoothremotegattcharacteristic.serviceread only returns the bluetoothgattservice this characteristic belongs to.
... bluetoothremotegattcharacteristic.u
uidread only returns a domstring containing the u
uid of the characteristic, for example '00002a37-0000-1000-8000-00805f9b34fb' for the heart rate measurement characteristic.
...And 2 more matches
Drawing shapes with canvas - Web APIs
once created, future drawing commands are directed into the path and used to b
uild the path up.
... note: this example req
uires a slightly larger canvas than the others on this page: 150 x 200 pixels.
... using quadratic and cubic bézier curves can be q
uite challenging, because unlike vector drawing software like adobe illustrator, we don't have direct visual feedback as to what we're doing.
...And 2 more matches
CredentialsContainer.create() - Web APIs
tbd id: (req
uired) usvstring inherited from credentialdata.
... name: optional usvstring tbd iconurl: optional usvstring tbd password: (req
uired) usvstring tbd federated: optional an federatedcredentialinit object.
... contains req
uirements for creating/obtaining federated credentials.
...And 2 more matches
Crypto.getRandomValues() - Web APIs
the pseudo-random number generator algorithm (prng) may vary across user agents, but is s
uitable for cryptographic purposes.
... implementations are req
uired to use a seed with enough entropy, like a system-level entropy source.
... syntax typedarray = cryptoobj.getrandomvalues(typedarray); parameters typedarray an integer-based typedarray, that is an int8array, a
uint8array, an int16array, a
uint16array, an int32array, or a
uint32array.
...And 2 more matches
CustomElementRegistry.define() - Web APIs
there are two types of custom elements you can create: autonomous custom element: standalone elements; they don't inherit from b
uilt-in html elements.
... customized b
uilt-in element: these elements inherit from — and extend — b
uilt-in html elements.
...one option is currently supported: extends: string specifying the name of a b
uilt-in element to extend.
...And 2 more matches
DOMMatrix - Web APIs
the dommatrix interface represents 4×4 matrices, s
uitable for 2d and 3d operations including rotation and translation.
... a, b, c, d, e, f double-precision floating-point values representing the components of a 4×4 matrix which are req
uired in order to perform 2d rotations and translations.
... 2d 3d eq
uivalent a m11 b m12 c m21 d m22 e m41 f m42 methods this interface includes the following methods, as well as the methods it inherits from dommatrixreadonly.
...And 2 more matches
Document.createEvent() - Web APIs
possible event types include "
uievents", "mouseevents", "mutationevents", and "htmlevents".
...var event = document.createevent('event'); // define that the event name is 'b
uild'.
... event.initevent('b
uild', true, true); // listen for the event.
...And 2 more matches
EffectTiming.easing - Web APIs
eq
uivalent to cubic-bezier(0.25, 0.1, 0.25, 1).
...eq
uivalent to cubic-bezier(0.42, 0, 1, 1).
...eq
uivalent to cubic-bezier(0, 0, 0.58, 1).
...And 2 more matches
Using files from web applications - Web APIs
consider this html: <input type="file" id="fileelem" multiple accept="image/*" class="visually-hidden"> <label for="fileelem">select some files</label> and this css: .visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); } /* separate rule for compatibility, :focus-within is req
uired on modern firefox and chrome */ input.visually-hidden:focus + label { outline: thin dotted; } input.visually-hidden:focus-within + label { outline: thin dotted; } there is no need to add javascript code to call fileelem.click().
...otherwise, we start b
uilding our file list, as follows: a new unordered list (<ul>) element is created.
... creating the upload tasks contin
uing with the code that b
uilt the thumbnails in the previous example, recall that every thumbnail image is in the css class obj with the corresponding file attached in a file attribute.
...And 2 more matches
FileHandle API - Web APIs
basic operations create a filehandle because the intent is to allow the storage of files through indexeddb, creating a filehandle instance req
uires an indexeddb database.
... var idbreq = indexeddb.open("myfilestoragedatabase"); idbreq.onsuccess = function(){ var db = this.result; var b
uildhandle = db.mozcreatefilehandle("test.txt", "plain/text"); b
uildhandle.onsuccess = function(){ var myfilehandle = this.result; console.log('handle', myfilehandle); }; }; mozcreatefilehandle() takes two arguments: a name and an optional type.
... perform read and write operations to read or write within a handled file, it is req
uired to get a lockedfile.
...And 2 more matches
Introduction to the File and Directory Entries API - Web APIs
it was b
uilt on the file writer api, which, in turn, was b
uilt on file api.
...the asynchronous api can be used in cases where you don't want an outstanding operation to block the
ui.
...persistent storage, on the other hand, might offer you larger space that can only be deleted by the user, but it req
uires the user to grant you permission.
...And 2 more matches
KeyboardEvent - Web APIs
75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/
uievent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">
uievent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#d4dde4" fill="none"/><line x1="201" y1="25" x2="231"...
... properties this interface also inherits properties of its parents,
uievent and event.
... methods this interface also inherits methods of its parents,
uievent and event.
...And 2 more matches
MouseEvent - Web APIs
mouseevent derives from
uievent, which in turn derives from event.
...75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/
uievent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">
uievent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#d4dde4" fill="none"/><line x1="201" y1="25" x2="231"...
... properties this interface also inherits properties of its parents,
uievent and event.
...And 2 more matches
Payment Request API - Web APIs
payment request concepts and usage many problems related to online shopping-cart abandonment can be traced to checkout forms, which can be difficult and time consuming to fill out and often req
uire multiple steps to complete.
...it aims to make the checkout process easier, by remembering a user's details, which are then passed along to a merchant hopefully without req
uiring a html form.
...this can include localizing the
ui into the user's preferred language.
...And 2 more matches
ReadableStream.ReadableStream() - Web APIs
syntax var readablestream = new readablestream(underlyingsource[, que
uingstrategy]); parameters underlyingsource an object containing methods and properties that define how the constructed stream instance will behave.
...the contents of this method are defined by the developer, and should aim to get access to the stream source, and do anything else req
uired to set up the stream fuctionality.
... que
uingstrategy optional an object that optionally defines a que
uing strategy for the stream.
...And 2 more matches
Using Service Workers - Web APIs
let’s compare a traditional synchronous callback structure to its asynchronous promise eq
uivalent.
... instead, we could b
uild our own promise to handle this kind of case.
...it also registers, installs, and activates a service worker, and when more of the spec is supported by browsers it will cache all the files req
uired so it will work offline!
...And 2 more matches
Streams API concepts - Web APIs
pull sources req
uire you to explicitly request data from them once connected to.
...an internal queue keeps track of the chunks that have not yet been read (see the internal queues and que
uing strategies section below).
...these allow streams to be read straight into a buffer supplied by the developer, minimizing the copying req
uired.
...And 2 more matches
SubtleCrypto.exportKey() - Web APIs
*/ async function exportcryptokey(key) { const exported = await window.crypto.subtle.exportkey( "raw", key ); const exportedkeybuffer = new
uint8array(exported); const exportkeyoutput = document.queryselector(".exported-key"); exportkeyoutput.textcontent = `[${exportedkeybuffer}]`; } /* generate an encrypt/decrypt secret key, then set up an event listener on the "export" button.
... /* convert an arraybuffer into a string from https://developers.google.com/web/updates/2012/06/how-to-convert-arraybuffer-to-and-from-string */ function ab2str(buf) { return string.fromcharcode.apply(null, new
uint8array(buf)); } /* export the given key and write it into the "exported-key" space.
...*/ window.crypto.subtle.generatekey( { name: "rsa-pss", // consider using a 4096-bit key for systems that req
uire long-term security moduluslength: 2048, publicexponent: new
uint8array([1, 0, 1]), hash: "sha-256", }, true, ["sign", "verify"] ).then((keypair) => { const exportbutton = document.queryselector(".pkcs8"); exportbutton.addeventlistener("click", () => { exportcryptokey(keypair.privatekey); }); }); subjectpublickeyinfo export this example exports an rsa public encryp...
...And 2 more matches
SubtleCrypto.unwrapKey() - Web APIs
unwrapalgo is an object specifying the algorithm to be used to encrypt the exported key, and any extra parameters as req
uired: to use rsa-oaep, pass an rsaoaepparams object.
... unwrappedkeyalgo is a dictionary object defining the type of key to unwrap and providing extra algorithm-specific parameters as req
uired.
... notsupported raised when trying to use an algorithm that is either unknown or isn't s
uitable for encryption or wrapping.
...And 2 more matches
WebGL2RenderingContext.getActiveUniformBlockParameter() - Web APIs
uniformblockindex a gl
uint specifying the index of the active uniform block within the program.
...possible values: gl.uniform_block_binding: returns a gl
uint indicating the uniform buffer binding point.
... gl.uniform_block_data_size: returns a gl
uint indicating the minimum total buffer object size.
...And 2 more matches
WebGLRenderingContext.getParameter() - Web APIs
glenum gl.blend_equation_alpha glenum gl.blend_equation_rgb glenum gl.blend_src_alpha glenum gl.blend_src_rgb glenum gl.blue_bits glint gl.color_clear_value float32array (with 4 values) gl.color_writemask sequence<glboolean> (with 4 values) gl.compressed_texture_formats
uint32array returns the compressed texture formats.
... (with 4 elements) gl.scissor_test glboolean gl.shading_language_version domstring gl.stencil_back_fail glenum gl.stencil_back_func glenum gl.stencil_back_pass_depth_fail glenum gl.stencil_back_pass_depth_pass glenum gl.stencil_back_ref glint gl.stencil_back_value_mask gl
uint gl.stencil_back_writemask gl
uint gl.stencil_bits glint gl.stencil_clear_value glint gl.stencil_fail glenum gl.stencil_func glenum gl.stencil_pass_depth_fail glenum gl.stencil_pass_depth_pass glenum gl.stencil_ref glint gl.stencil_test glboolean ...
... gl.stencil_value_mask gl
uint gl.stencil_writemask gl
uint gl.subpixel_bits glint gl.texture_binding_2d webgltexture or null gl.texture_binding_cube_map webgltexture or null gl.unpack_alignment glint gl.unpack_colorspace_conversion_webgl glenum gl.unpack_flip_y_webgl glboolean gl.unpack_premultiply_alpha_webgl glboolean gl.vendor domstring gl.version domstring gl.viewport int32array (with 4 elements) webgl 2 you can query the following pname parameters when using a webgl2renderingcontext.
...And 2 more matches
Matrix math for the web - Web APIs
result0[3], result1[0], result1[1], result1[2], result1[3], result2[0], result2[1], result2[2], result2[3], result3[0], result3[1], result3[2], result3[3] ]; } let's look at this function in action: let somematrix = [ 4, 0, 0, 0, 0, 3, 0, 0, 0, 0, 5, 0, 4, 8, 4, 1 ] let identitymatrix = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; // returns a new array eq
uivalent to somematrix let somematrixresult = multiplymatrices(identitymatrix, somematrix); important: these matrix functions are written for clarity of explanation, not for speed or memory management.
... // manually rotating a point about the origin without matrices let point = [10, 2]; // calculate the distance from the origin let distance = math.sqrt(point[0] * point[0] + point[1] * point[1]); // the eq
uivalent of 60 degrees, in radians let rotationinradians = math.pi / 3; let transformedpoint = [ math.cos(rotationinradians) * distance, math.sin(rotationinradians) * distance ]; it is possible to encode these type of steps into a matrix, and do it for each of the x, y, and z dimensions.
...the flatness is eq
uivalent to when a camera zooms in really close onto an object in the distance — the sense of perspective disappears.
...And 2 more matches
Using textures in WebGL - Web APIs
const level = 0; const internalformat = gl.rgba; const width = 1; const height = 1; const border = 0; const srcformat = gl.rgba; const srctype = gl.unsigned_byte; const pixel = new
uint8array([0, 0, 255, 255]); // opaque blue gl.teximage2d(gl.texture_2d, level, internalformat, width, height, border, srcformat, srctype, pixel); const image = new image(); image.onload = function() { gl.bindtexture(gl.texture_2d, texture); gl.teximage2d(gl.texture_2d, level, internalformat, srcformat, srctype, image); // webgl...
...1 has different req
uirements for power of 2 images // vs non power of 2 images so check if the image is a // power of 2 in both dimensions.
...without performing the above configuration, webgl req
uires all samples of npot textures to fail by returning transparent black: rgba(0,0,0,0).
...And 2 more matches
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
but webxr goes beyond that by adding the ability to track the location, orientation, and motion of the input devices which generate data used to determine the position and movement of individual parts of the viewer's body (with appropriate eq
uipment).
... in this g
uide, we'll explore how webxr uses spaces and, more specifically, reference spaces, to track the positions, orientations, and movements of objects and of the user's body in the virtual world.
... let viewerpose = frame.getviewerpose(worldreferencespace); let newsession = navigator.xr.requestsession("immersive-vr", { req
uiredfeatures: "unbounded" }); worldreferencespace = await newsession.requestreferencespace("unbounded"); viewerpose = worldreferencespace.getoffsetreferencespace(viewerpose.transform); here, the viewer pose is obtained, with its transform defined relative to worldreferencespace, the current session's global reference space.
...And 2 more matches
Using the Web Audio API - Web APIs
if you simply want to control playback of an audio track, the <audio> media element provides a better, q
uicker solution than the web audio api.
...autoplay policies typically req
uire either explicit permission or a user engagement with the page before scripts can trigger audio to play.
... these special req
uirements are in place essentially because unexpected sounds can be annoying and intrusive, and can cause accessibility problems.
...And 2 more matches
Visualizations with Web Audio API - Web APIs
the first one produces 32-bit floating point numbers, and the second and third ones produce 8-bit unsigned integers, therefore a standard javascript array won't do — you need to use a float32array or
uint8array array, depending on what data you are handling.
...we return the analysernode.frequencybincount value, which is half the fft, then call
uint8array() with the frequencybincount as its length argument — this is how many data points we will be collecting, for that fft size.
... analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new
uint8array(bufferlength); to actually retrieve the data and copy it into our array, we then call the data collection method we want, with the array passed as it's argument.
...And 2 more matches
Using the Web Speech API - Web APIs
generally, the default speech recognition system available on the device will be used for the speech recognition — most modern oses have a speech recognition system for iss
uing voice commands.
...however, for now let's just run through it q
uickly: the lines are separated by semi-colons, just like in javascript.
...we then return its transcript property to get a string containing the individual recognised result as a string, set the background color to that color, and report the color recognised as a diagnostic message in the
ui.
...And 2 more matches
Using Web Workers - Web APIs
note: see the web workers api landing page for reference documentation on workers and additional g
uides.
...both scripts use the same worker to do the actual calculation req
uired.
...its content is (q
uite literally) transferred to the worker context.
...And 2 more matches
Privileged features - Web APIs
this page lists the windowfeatures parameter of window.open function that req
uires chrome-privilege in firefox.
... the following features req
uire the chrome-privilege.
... minimizable this setting can only apply to dialog windows; minimizable req
uires dialog=yes.
...And 2 more matches
Using XMLHttpRequest - Web APIs
in this g
uide, we'll take a look at how to use xmlhttprequest to issue http requests in order to exchange data between the web site and a server.
... using nothing but xmlhttprequest submitting forms without the formdata api does not req
uire other apis for most use cases.
...for this reason, here we place a complete (yet didactic) framework, able to use all four ways to submit, and to upload files: <!doctype html> <html> <head> <meta http-eq
uiv="content-type" content="text/html; charset=utf-8" /> <title>sending forms with pure ajax – mdn</title> <script type="text/javascript"> "use strict"; /*\ |*| |*| :: xmlhttprequest.prototype.sendasbinary() polyfill :: |*| |*| https://developer.mozilla.org/docs/dom/xmlhttprequest#sendasbinary() \*/ if (!xmlhttprequest.prototype.sendasbinary) { xmlhttprequest.prototype.sendasbinary = fu...
...And 2 more matches
XRSessionInit - Web APIs
the webxr device api dictionary xrsessioninit specifies req
uired and/or optional features when requesting a new xrsession by calling the navigator.xr.requestsession() method.
... req
uiredfeatures optional an array of values which the returned xrsession must support.
... because immersive sessions are req
uired to support the local reference space, any request to open an immersive xrsession is req
uired to obtain explicit or implicit user consent.
...And 2 more matches
Using the aria-invalid attribute - Accessibility
aria-invalid can also be used to indicate that a req
uired field has not been filled in.the attribute should be programmatically set as a result of a validation process.
...note that since the default value for aria-req
uired is false, it is not strictly necessary to add the attribute to input.
... <input name="name" id="name" aria-req
uired="true" aria-invalid="false" onblur="checkvalidity('name', ' ', 'invalid name entered (req
uires both first and last name)');"/> <br /> <input name="email" id="email" aria-req
uired="true" aria-invalid="false" onblur="checkvalidity('email', '@', 'invalid e-mail address');"/> note that it is not necessary to validate the fields immediately on blur; the application could wait until the form is submitted (though this is not necessarily recommended).
...And 2 more matches
ARIA: cell role - Accessibility
role="rowgroup" row is a req
uired cell parent.
...it is a structural eq
uivalent to the thead, tfoot, and tbody elements in an html table element.
... role="columnheader" a header cell that is the structural eq
uivalent of the html <th> element with a column scope.
...And 2 more matches
ARIA: form role - Accessibility
the form landmark role can be used to identify a group of elements on a page that provide eq
uivalent functionality to an html form.
... keyboard interactions no role specific keyboard interactions req
uired javascript features onsubmit the onsubmit event handler handles the event raised when the form is submitted.
... anything that is not a <form> cannot be submitted, therefore you would have to use javascript to b
uild an alternative data submission mechanism, for example with xmlhttprequest.
...And 2 more matches
ARIA: row role - Accessibility
it is a structural eq
uivalent to the thead, tfoot, and tbody elements in an html table element.
... role="columnheader" a header cell that is the structural eq
uivalent of the html <th> element with a column scope.
... role="rowheader" a header cell that is the structural eq
uivalent of the html <th> element with a row scope.
...And 2 more matches
ARIA: checkbox role - Accessibility
<span role="checkbox" aria-checked="false" tabindex="0" aria-labelledby="chk1-label"> </span> <label id="chk1-label">remember my preferences</label> the first rule of aria is if a native html element or attribute has the semantics and behavior you req
uire, use it instead of re-purposing an element and adding aria.
... instead use the native html checkbox of <input type="checkbox">, which natively provides all the functionality req
uired: <input type="checkbox" id="chk1-label"> <label for="chk1-label">remember my preferences</label> description the native html checkbox form control can only have two checked states ("checked" or "not checked"), with an indeterminate state settable via javascript.
... the developer is req
uired to change the value of the aria-checked attribute dynamically when the checkbox is activated.
...And 2 more matches
ARIA: listbox role - Accessibility
associated aria roles, states, and properties associated roles option one or more nested options are req
uired.
... aria-req
uired a boolean attribute which indicates that an option with a non-empty string value must be selected.
... multiple selection: authors may implement either of two interaction models to support multiple selection: a recommended model that does not req
uire the user to hold a modifier key, such as shift or control, while navigating the list or an alternative model that does req
uire modifier keys to be held while navigating in order to avoid losing selection states.
...And 2 more matches
Alerts - Accessibility
the form first, please read about the aria-req
uired technique if you have not done so, as this technique expands upon that.
... here is a simple form: <form method="post" action="post.php"> <fieldset> <legend>please enter your contact details</legend> <label for="name">your name (req
uired):</label> <input name="name" id="name" aria-req
uired="true"/> <br /> <label for="email">e-mail address (req
uired):</label> <input name="email" id="email" aria-req
uired="true"/> <br /> <label for="website">website (optional):</label> <input name="website" id="website"/> </fieldset> <label for="message">please enter your message (req
uired):</label> <br /> <textarea name="message" id="message" rows="5" cols="80" aria-req
uired="true"></textarea> <br /> <input type="submit" name="submit" value="send message"/> <input type="reset" name="reset" value="res...
...we need to change the two inputs for e-mail and name for this: <input name="name" id="name" aria-req
uired="true" onblur="checkvalidity('name', ' ', 'invalid name entered!');"/> <br /> <input name="email" id="email" aria-req
uired="true" onblur="checkvalidity('email', '@', 'invalid e-mail address');"/> testing the example if you use firefox 3 and a currently-supported screen reader, try the following: enter only your first name as the name.
...And 2 more matches
Robust - Accessibility
this article provides practical advice on how to write your web content so that it conforms to the success criteria outlined in the robust principle of the web content accessibility g
uidelines (wcag) 2.0 and 2.1.
... note: to read the w3c definitions for robust and its g
uidelines and success criteria, see principle 4: robust — content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies.
... g
uideline 4.1 — compatible: maximize compatibility with current and future user agents, including assistive technologies this g
uideline focuses on making content as compatible as possible, not only with current user agents (e.g.
...And 2 more matches
:valid - CSS: Cascading Style Sheets
syntax :valid examples indicating valid and invalid form fields in this example, we use structures like this, which include extra <span>s to generate content on; we'll use these to provide indicators of valid/invalid data: <div> <label for="fname">first name *: </label> <input id="fname" name="fname" type="text" req
uired> <span></span> </div> to provide these indicators, we use the following css: input + span { position: relative; } input + span::before { position: absolute; right: -20px; top: 5px; } input:invalid { border: 2px solid red; } input:invalid + span::before { content: '✖'; color: red; } input:valid + span::before { content: '✓'; color: green; } we set the <span>s to p...
... note: we've used ::before to add these labels, as we were already using ::after for the "req
uired" labels.
... you can try it below: notice how the req
uired text inputs are invalid when empty, but valid when they have something filled in.
...And 2 more matches
Using CSS animations - CSS: Cascading Style Sheets
<p>the caterpillar and alice looked at each other for some time in silence: at last the caterpillar took the hookah out of its mouth, and addressed her in a lang
uid, sleepy voice.</p> note: reload page to see the animation, or click the codepen button to see the animation in the codepen environment.
...on: 3s; animation-name: slidein; } @keyframes slidein { from { margin-left: 100%; width: 300%; } 75% { font-size: 300%; margin-left: 25%; width: 150%; } to { margin-left: 0%; width: 100%; } } <p>the caterpillar and alice looked at each other for some time in silence: at last the caterpillar took the hookah out of its mouth, and addressed her in a lang
uid, sleepy voice.</p> this tells the browser that 75% of the way through the animation sequence, the header should have its left margin at 25% and the width should be 150%.
...on: 3s; animation-name: slidein; animation-iteration-count: infinite; } adding it to the existing code: @keyframes slidein { from { margin-left: 100%; width: 300%; } to { margin-left: 0%; width: 100%; } } <p>the caterpillar and alice looked at each other for some time in silence: at last the caterpillar took the hookah out of its mouth, and addressed her in a lang
uid, sleepy voice.</p> making it move back and forth that made it repeat, but it’s very odd having it jump back to the start each time it begins animating.
...And 2 more matches
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
in this g
uide we will look at how well flexbox is supported in browsers, and look at some potential issues, resources and methods for creating workarounds and fallbacks.
... in 2009, the specification looked q
uite different.
...this is becoming less and less of a req
uirement today as support is widespread.
...And 2 more matches
Typical use cases of Flexbox - CSS: Cascading Style Sheets
in this g
uide we will take a look at some of the common use cases for flexbox — those places where it makes more sense than another layout method.
...in this g
uide i look at some of the typical things you might use flexbox for today.
...you could either take the content as a g
uide and set both to flex: auto, in which case they would grow and shrink from the size of the content or any size applied directly to the flex items such as a width on the image.
...And 2 more matches
Block and inline layout in normal flow - CSS: Cascading Style Sheets
in this g
uide, we will explore the basics of how block and inline elements behave when they are part of the normal flow.
...the behavior on block and inline elements is the same when working in a vertical writing mode, and we will explore this in a future g
uide on flow layout and writing modes.
... in this g
uide, we will be working in english and therefore a horizontal writing mode.
...And 2 more matches
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
however, while evergreen browsers mean that many of us are going to see the majority of users having grid layout support very q
uickly, there are also old or non-supporting browsers to contend with.
... in this g
uide we will walk through a variety of strategies for support.
...support for all the properties and values detailed in these g
uides is interoperable across browsers.
...And 2 more matches
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
in this g
uide, i will explain how a grid fits together with other techniques you may already be using.
... in a later g
uide in this series, i’ll be taking a proper look at box alignment and how it works in grid layout.
...border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> </div> .wrapper { display: grid; grid-template-columns: repeat(auto-fill, 200px); } a flexible number of tracks this isn’t q
uite the same as flexbox.
...And 2 more matches
Overview of CSS Shapes - CSS: Cascading Style Sheets
there are a number of ways to create these shapes and in these g
uides we will find out how css shapes work, and consider some ways you might like to use them.
... in our g
uide to basic shapes we explore each of the possible basic shapes and how to create them.
... to explore the box values in more detail see our g
uide covering shapes from box values.
...And 2 more matches
CSS values and units - CSS: Cascading Style Sheets
if unquoted, it is parsed as a <url-token>, which has extra req
uirements including the escaping of certain characters.
... absolute length units unit name eq
uivalent to cm centimeters 1cm = 96px/2.54 mm millimeters 1mm = 1/10th of 1cm q quarter-millimeters 1q = 1/40th of 1cm in inches 1in = 2.54cm = 96px pc picas 1pc = 1/16th of 1in pt points 1pt = 1/72th of 1in px pixels 1px = 1/96th of 1in when including a length value, if the length is ...
...0, the unit identifier is not req
uired.
...And 2 more matches
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
textfield div { color: black; -moz-appearance: textfield; -webkit-appearance: textfield; } <div>lorem</div> firefox chrome safari edge the following values are treated as eq
uivalent to auto: button div { color: black; -moz-appearance: button; -webkit-appearance: button; } <div>lorem</div> firefox chrome safari edge the element is drawn like a button.
... checkbox-label div { color: black; -moz-appearance: checkbox-label; -webkit-appearance: checkbox-label; } <div>lorem</div> firefox checkmen
uitem div { color: black; height: 20px; -moz-appearance: checkmen
uitem; -webkit-appearance: checkmen
uitem; } <div>lorem</div> firefox color-well div{ color: black; -moz-appearance: color-well; -webkit-appearance: color-well; } <div>lorem</div> safari input type=color continuous-capacity-level-indicator ...
...efox removed in firefox 64 button-focus firefox removed in firefox 64 dualbutton firefox removed in firefox 64 groupbox firefox removed in firefox 64 menuarrow firefox removed in firefox 64 menubar firefox removed in firefox 64 menucheckbox firefox removed in firefox 64 men
uimage firefox removed in firefox 64 men
uitem firefox removed in firefox 64.
...And 2 more matches
break-after - CSS: Cascading Style Sheets
q
uisque commodo eget nisi sed pretium.
...fusce iaculis urna id neque dapibus, eu lacinia lectus dictum.</p> <h2>subheading</h2> <p>praesent condimentum d
ui d
ui, sit amet rutrum diam tincidunt eu.
...ut turpis leo, malesuada q
uis nisl nec, volutpat egestas tellus.
...And 2 more matches
break-before - CSS: Cascading Style Sheets
q
uisque commodo eget nisi sed pretium.
...fusce iaculis urna id neque dapibus, eu lacinia lectus dictum.</p> <h2>subheading</h2> <p>praesent condimentum d
ui d
ui, sit amet rutrum diam tincidunt eu.
...ut turpis leo, malesuada q
uis nisl nec, volutpat egestas tellus.
...And 2 more matches
<display-legacy> - CSS: Cascading Style Sheets
css 2 used a single-keyword syntax for the display property, req
uiring separate keywords for block-level and inline-level variants of the same layout mode.
... it is eq
uivalent to inline flow-root.
... it is eq
uivalent to inline table.
...And 2 more matches
<easing-function> - CSS: Cascading Style Sheets
not all cubic bézier curves are s
uitable as easing functions as not all are mathematical functions; i.e., curves that for a given abscissa have zero or one value.
... the steps() class of easing functions the steps() functional notation defines a step function dividing the domain of output values in eq
uidistant steps.this subclass of step functions are sometimes also called staircase functions.
... syntax steps(number_of_steps, direction) where: number_of_steps is a strictly positive <integer>, representing the amount of eq
uidistant treads composing the stepping function.
...And 2 more matches
HTML attribute: pattern - HTML: Hypertext Markup Language
it must be a valid javascript regular expression, as used by the regexp type, and as documented in our g
uide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of unicode code points, instead of as ascii.
... tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the req
uirements are to match the pattern.
... the example below restricts the value to 4-8 characters and req
uires that it contain only lower-case letters.
...And 2 more matches
HTML attribute: rel - HTML: Hypertext Markup Language
external resource not allowed not allowed prefetch specifies that the user agent should preemptively fetch and cache the target resource as it is likely to be req
uired for a followup navigation.
...if not inside the <head> element, the standard doesn't disting
uish between a hyperlink applying to a specific part of the document or to the document as a whole.
...req
uires the use of the cors protocol for cross-origin fetching.
...And 2 more matches
HTML attribute reference - HTML: Hypertext Markup Language
content <meta> a value associated with http-eq
uiv or name depending on the context.
... http-eq
uiv <meta> defines a pragma directive.
... req
uired <input>, <select>, <textarea> indicates whether this element is req
uired to fill out or not.
...And 2 more matches
<button>: The Button element - HTML: Hypertext Markup Language
implicit aria role button permitted aria roles checkbox, link, men
uitem, men
uitemcheckbox, men
uitemradio, option, radio, switch, tab dom interface htmlbuttonelement attributes this element's attributes include the global attributes.
...| the paciello group mdn understanding wcag, g
uideline 4.1 explanations understanding success criterion 4.1.2 | w3c understanding wcag 2.0 size and proximity size interactive elements such as buttons should provide an area large enough that it is easy to activate them.
... understanding success criterion 2.5.5: target size | w3c understanding wcag 2.1 target size and 2.5.5 | adrian roselli q
uick test: large touch targets - the a11y project proximity large amounts of interactive content — including buttons — placed in close visual proximity to each other should have space separating them.
...And 2 more matches
<input type="range"> - HTML: Hypertext Markup Language
the values provided are suggestions, not req
uirements: users can select from this predefined list or provide a different value.
... note: the following input attributes do not apply to the input range: accept, alt, checked, dirname, formaction, formenctype, formmethod, formnovalidate, formtarget, height, maxlength, minlength, multiple, pattern, placeholder, readonly, req
uired, size, src, and width.
... examples while the number type lets users enter a number with optional constraints forcing their value to be between a minimum and a maximum value, it does req
uire that they enter a specific value.
...And 2 more matches
<keygen> - HTML: Hypertext Markup Language
the name and challenge attributes are req
uired in all cases.
... the keytype attribute is optional for rsa key generation and req
uired for dsa and ec key generation.
... the keyparams attribute is req
uired for dsa and ec key generation and ignored for rsa key generation.
...And 2 more matches
<main> - HTML: Hypertext Markup Language
example <!-- other content --> <main> <h1>apples</h1> <p>the apple is the pomaceous fr
uit of the apple tree.</p> <article> <h2>red delicious</h2> <p>these bright red apples are the most common found in many supermarkets.</p> <p>...
...</p> </article> <article> <h2>granny smith</h2> <p>these j
uicy, green apples make a great filling for apple pies.</p> <p>...
...landmarks can be used by assistive technology to q
uickly identify and navigate to large sections of the document.
...And 2 more matches
<script>: The Script element - HTML: Hypertext Markup Language
this attribute allows the elimination of parser-blocking javascript where the browser would have to load and evaluate scripts before contin
uing to parse.
... this attribute allows the elimination of parser-blocking javascript where the browser would have to load and evaluate scripts before contin
uing to parse.
...if a higher-level policy is not available, the empty string is treated as being eq
uivalent to no-referrer-when-downgrade.
...And 2 more matches
inputmode - HTML: Hypertext Markup Language
numeric numeric input keyboard, but only req
uires the digits 0–9.
...inputs that req
uire a telephone number should typically use <input type="tel">instead.
...inputs that req
uire a search query should typically use <input type="search"> instead.
...And 2 more matches
HTTP authentication - HTTP
in the case of proxies, the challenging status code is 407 (proxy authentication req
uired), the proxy-authenticate response header contains at least one challenge applicable to the proxy, and the proxy-authorization request header is used for providing the credentials to the proxy server.
...unlike 401 unauthorized or 407 proxy authentication req
uired, authentication is impossible for this user.
... the .htaccess file typically looks like this: authtype basic authname "access to the staging site" authuserfile /path/to/.htpasswd req
uire valid-user the .htaccess file references a .htpasswd file in which each line consists of a username and a password separated by a colon (:).
...And 2 more matches
HTTP conditional requests - HTTP
it is q
uite difficult to have a unique identifier for strong validation with last-modified.
... weak validation weak validation differs from strong validation, as it considers two versions of the document as identical if the content is eq
uivalent.
...b
uilding a system of etags that creates weak validation may be complex, as it involves knowing the importance of the different elements of a page, but is very useful towards optimizing cache performance.
...And 2 more matches
Using HTTP cookies - HTTP
for example, if path=/docs is set, these paths match: /docs /docs/web/ /docs/web/http samesite attribute the samesite attribute lets servers req
uire that a cookie shouldn't be sent with cross-origin requests (where site is defined by the registrable domain), which provides some protection against cross-site request forgery attacks (csrf).
...the none directive req
uires that the secure attribute also be used.
...a third party server can b
uild up a profile of a user's browsing history and habits based on cookies sent to it by the same browser when accessing multiple sites.
...And 2 more matches
Using Feature Policy - HTTP
for example, the following are eq
uivalent: feature-policy: unsized-media 'none'; geolocation 'self' https://example.com; camera *; feature-policy: unsized-media 'none' feature-policy: geolocation 'self' https://example.com feature-policy: camera *; the iframe allow attribute the second way to use feature policy is for controlling content within an iframe.
... for example, allow all browsing contexts within this iframe to use fullscreen: <iframe src="https://example.com..." allow="fullscreen"></iframe> this is eq
uivalent to: <iframe src="https://example.com..." allow="fullscreen 'src'"></iframe> this example allows <iframe> content on a particular origin to access the user's location: <iframe src="https://google-developers.appspot.com/demos/..." allow="geolocation https://google-developers.appspot.com"></iframe> similar to the http header, several features can be controlled at the same time by specifying a semicolon-separated list of policy directives.
... enforcing best practices for good user experiences it's difficult to b
uild a website that uses all the latest best practices and provides great performance and user experiences.
...And 2 more matches
CSP: script-src - HTTP
the colon is req
uired.
...the single quotes are req
uired.
...the single quotes are req
uired.
...And 2 more matches
Content-Security-Policy - HTTP
req
uire-sri-for req
uires the use of sri for scripts or styles on the page.
... req
uire-trusted-types-for enforces trusted types at the dom xss injection sinks.
...fault-src 'self' http://example.com; connect-src 'none'; content-security-policy: connect-src http://example.com/; script-src http://example.com/ examples example: disable unsafe inline/eval, only allow loading of resources (images, fonts, scripts, etc.) over https: // header content-security-policy: default-src https: // meta tag <meta http-eq
uiv="content-security-policy" content="default-src https:"> example: pre-existing site that uses too much inline code to fix but wants to ensure resources are loaded only over https and to disable plugins: content-security-policy: default-src https: 'unsafe-eval' 'unsafe-inline'; object-src 'none' example: do not implement the above policy yet; instead just report violations that would have occu...
...And 2 more matches
Cross-Origin-Embedder-Policy - HTTP
header type response header forbidden header name no syntax cross-origin-embedder-policy: unsafe-none | req
uire-corp directives unsafe-none this is the default value.
... req
uire-corp a document can only load resources from the same origin, or resources explicitly marked as loadable from another origin.
... examples certain features depend on cross-origin isolation you can only access certain features like sharedarraybuffer objects or performance.now() with unthrottled timers, if your document has a coep header with the value req
uire-corp value set.
...And 2 more matches
HTTP Public Key Pinning (HPKP) - HTTP
firefox and chrome disable pin validation for pinned hosts whose validated certificate chain terminates at a user-defined trust anchor (rather than a b
uilt-in trust anchor).
... note: the current specification req
uires including a second pin for a backup key which isn't yet used in production.
...this req
uires mod_headers enabled.
...And 2 more matches
Inheritance and the prototype chain - JavaScript
it is, for example, fairly trivial to b
uild a classic model on top of a prototypal model.
...this is eq
uivalent to the javascript property __proto__ which is non-standard but de-facto implemented by many browsers.
... bad practice: extension of native prototypes one misfeature that is often used is to extend object.prototype or one of the other b
uilt-in prototypes.
...And 2 more matches
Functions - JavaScript
what disting
uishes them from other objects is that functions can be called.
... for more examples and explanations, see also the javascript g
uide about functions.
... for only one argument, the parentheses are not req
uired.
...And 2 more matches
Function.prototype.bind() - JavaScript
type; } fbound.prototype = new fnop(); return fbound; }; })(); some of the many differences (there may well be others, as this list does not seriously attempt to be exhaustive) between this algorithm and the specified algorithm are: the partial implementation relies on array.prototype.slice(), array.prototype.concat(), function.prototype.call() and function.prototype.apply(), b
uilt-in methods to have their original values.
...when working with class methods that req
uire this to refer to class instances, you may explicitly bind this to the callback function, in order to maintain the instance.
... bound functions are automatically s
uitable for use with the new operator to construct new instances created by the target function.
...And 2 more matches
SharedArrayBuffer - JavaScript
apis which use sharedarraybuffer objects webglrenderingcontext.bufferdata() webglrenderingcontext.buffersubdata() webgl2renderingcontext.getbuffersubdata() security req
uirements shared memory and high-resolution timers were effectively disabled at the start of 2018 in light of spectre.
...with a few security measures, postmessage() will no longer throw for sharedarraybuffer objects and shared memory across threads will be available: as a baseline req
uirement, your document needs to be in a secure context.
... for top-level documents, two headers will need to be set to cross-origin isolate your site: cross-origin-opener-policy with same-origin as value (protects your origin from attackers) cross-origin-embedder-policy with req
uire-corp as value (protects victims from your origin) cross-origin-opener-policy: same-origin cross-origin-embedder-policy: req
uire-corp to check if cross origin isolation has been successful, you can test against the crossoriginisolated property available to window and worker contexts: if (crossoriginisolated) { // post sharedarraybuffer } else { // do something else } see also planned changes to shared memory which is starting to roll out to browsers (firefox 79, for example.) always use the new operator to create a sharedarraybuffer sharedarraybuffer con...
...And 2 more matches
String.prototype.localeCompare() - JavaScript
return value a negative number if referencestr occurs before comparestring; positive if the referencestr occurs after comparestring; 0 if they are eq
uivalent.
... description returns an integer indicating whether the referencestr comes before, after or is eq
uivalent to the comparestring.
... negative when the referencestr occurs before comparestring positive when the referencestr occurs after comparestring returns 0 if they are eq
uivalent do not rely on exact return values of -1 or 1!
...And 2 more matches
String.prototype.normalize() - JavaScript
there are two main normalization forms, one based on canonical eq
uivalence and the other based on compatibility.
... canonical eq
uivalence normalization in unicode, two sequences of code points have canonical eq
uivalence if they represent the same abstract characters, and should always have the same visual appearance and behavior (for example, they should always be sorted in the same way).
... you can use normalize() using the "nfd" or "nfc" arguments to produce a form of the string that will be the same for all canonically eq
uivalent strings.
...And 2 more matches
TypedArray - JavaScript
typedarray objects type value range size in bytes description web idl type eq
uivalent c type int8array -128 to 127 1 8-bit two's complement signed integer byte int8_t
uint8array 0 to 255 1 8-bit unsigned integer octet
uint8_t
uint8clampedarray 0 to 255 1 8-bit unsigned integer (clamped) octet
uint8_t int16array -32768 to 32767 2 16-bit two's complement signed integer short int...
...16_t
uint16array 0 to 65535 2 16-bit unsigned integer unsigned short
uint16_t int32array -2147483648 to 2147483647 4 32-bit two's complement signed integer long int32_t
uint32array 0 to 4294967295 4 32-bit unsigned integer unsigned long
uint32_t float32array 1.2×10-38 to 3.4×1038 4 32-bit ieee floating point number (7 significant digits e.g., 1.1234567) unrestricted float float float64array 5.0×10-324 to 1.8×10308 8 64-bit ieee floating point number (16 significant digits e.g., 1.123...15) unrestricted double double bigint64array -263 to 263-1 8 64-bit two's complement signed integer bigint int64_t (signed long long) big
uint64array 0 ...
...to 264-1 8 64-bit unsigned integer bigint
uint64_t (unsigned long long) constructor this object cannot be instantiated directly.
...And 2 more matches
Logical nullish assignment (??=) - JavaScript
syntax expr1 ??= expr2 description short-circ
uit evaluation the nullish coalescing operator is evaluated left to right, it is tested for possible short-circ
uit evaluation using the following rule: (some expression that is neither null nor undefined) ??
... expr is short-circ
uit evaluated to the left-hand side expression if the left-hand side proves to be neither null nor undefined.
... short circ
uit means that the expr part above is not evaluated, hence any side effects of doing so do not take effect (e.g., if expr is a function call, the calling never takes place).
...And 2 more matches
Operator precedence - JavaScript
note on grouping and short-circ
uiting in the table below, grouping is listed as having the highest precedence.
... however, that does not always mean the expression within the grouping symbols ( … ) is evaluated first, especially when it comes to short-circ
uiting.
... short-circ
uiting is jargon for conditional evaluation.
...And 2 more matches
async function - JavaScript
for example, the following: async function foo() { return 1 } ...is eq
uivalent to: function foo() { return promise.resolve(1) } the body of an async function can be thought of as being split by zero or more await expressions.
... for example: async function foo() { await 1 } ...is eq
uivalent to: function foo() { return promise.resolve(1).then(() => undefined) } code after each await expression can be thought of as existing in a .then callback.
... async function foo() { const result1 = await new promise((resolve) => settimeout(() => resolve('1'))) const result2 = await new promise((resolve) => settimeout(() => resolve('2'))) } foo() note how the promise chain is not b
uilt-up in one go.
...And 2 more matches
JavaScript shells - JavaScript
a javascript shell allows you to q
uickly test snippets of javascript code without having to reload a web page.
... node.js - node.js is a platform for easily b
uilding fast, scalable network applications.
... it can use wxwidgets for g
ui apps and was formerly called wxjavascript.
...And 2 more matches
Installing and uninstalling web apps - Progressive web apps (PWAs)
this g
uide explains how installation is performed, what it means, and what you need to do as a developer to let your users take advantage of it.
...by reducing the user experience differential between the web app and native apps on the user's device, you reduce both the loss of any muscle memory they have revolving around the native interface of the device and the sensation of "something isn't q
uite right" that users can experience when switching between native and web-based apps.
... the
ui for this varies from browser to browser, but the general idea is the same.
...And 2 more matches
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
you can examine the service workers cookbook examples, try to set up a push messaging server using firebase, or b
uild your own server (using node.js for example).
...if not, we initialize a new subscription: const response = await fetch('./vapidpublickey'); const vapidpublickey = await response.text(); const convertedvapidkey = urlbase64to
uint8array(vapidpublickey); the app fetches the server's public key and converts the response to text; then it needs to be converted to a
uint8array (to support chrome).
...there are two options passed to the pushmanager.subscribe() method — the first is uservisibleonly: true, which means all the notifications sent to the user will be visible to them, and the second one is the applicationserverkey, which contains our successfully acq
uired and converted vapid key.
...And 2 more matches
Graphic design for responsive sites - Progressive web apps (PWAs)
in 1996, many people involved in b
uilding the web would have laughed at you if you had told them that less than 20 years in the future we would be developing web sites that worked well on mobile phones, tablets, tvs, even cars and home lighting.
...this really depends on what target devices you have to support, how complex the graphics need to be, and how much interactivity your graphics req
uire.
...css3 drop shadows and gradients), you may want to simplify or remove certain assets for the site's mobile layout, or even provide smaller assets to s
uit the smaller screen better.
...And 2 more matches
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
symptoms previously you were able to open and display svg content with mozilla, but for no apparent reason its behaviour changes and now it always pops up the "open or save file" dialog when you try to open local svg files, and displays the "additional plugins are req
uired to display all the media on this page" bar when you try to view html with embedded svg.
... note: the "additional plugins are req
uired" bar can appear for legitimate reasons when the svg or its embedding html is broken or served incorrectly over the network (see the svg faq).
...for files loaded over the network via http, it req
uires and uses the value assigned to the content-type http header.
...And 2 more matches
Same-origin policy - Web security
(a "tuple" is a set of items that together comprise a whole — a generic form for double/triple/quadruple/q
uintuple/etc.) the following table gives examples of origin comparisons with the url http://store.company.com/dir/page.html: url outcome reason http://store.company.com/dir2/other.html same origin only the path differs http://store.company.com/dir/inner/another.html same origin only the path differs https://store.company.com/page.html failur...
...some http requests req
uire preflight.
...due to the relaxed syntax rules of css, cross-origin css req
uires a correct content-type header.
...And 2 more matches
Compiling an Existing C Module to WebAssembly - WebAssembly
e https://github.com/webmproject/libwebp to start off simple, expose webpgetencoderversion() from encode.h to javascript by writing a c file called webp.c: #include "emscripten.h" #include "src/webp/encode.h" emscripten_keepalive int version() { return webpgetencoderversion(); } this is a good simple program to test whether you can get the source code of libwebp to compile, as it doesn't req
uire any parameters or complex data structures to invoke this function.
...luckily, the canvas api has canvasrenderingcontext2d.getimagedata — that gives you an
uint8clampedarray containing the image data in rgba: async function loadimage(src) { // load image const imgblob = await fetch(src).then(resp => resp.blob()); const img = await createimagebitmap(imgblob); // make canvas same size as image const canvas = document.createelement('canvas'); canvas.width = img.width; canvas.height = img.height; // draw image onto canvas const ctx = ca...
...for that, you need to expose two additional functions — one that allocates memory for the image inside wasm and one that frees it up again: #include <stdlib.h> // req
uired for malloc definition emscripten_keepalive
uint8_t* create_buffer(int width, int height) { return malloc(width * height * 4 * sizeof(
uint8_t)); } emscripten_keepalive void destroy_buffer(
uint8_t* p) { free(p); } the create_buffer() function allocates a buffer for the rgba image — hence 4 bytes per pixel.
...And 2 more matches
Private Properties - Archive of obsolete content
is to define private properties as variables and their getter and setter functions as a closure over these variables: function point(_x, _y) { this.getx = function () { return _x; }; this.setx = function (x) { _x = x; }; this.gety = function () { return _y; }; this.sety = function (y) { _y = y; }; } note that this technique req
uires member functions that need access to private properties to be defined on the object itself, instead of its prototype.
...moreover, to create each thumbnail only when it's first req
uired: function getthumbnail(image) { let thumbnail = image._thumbnail; if (!thumbnail) { thumbnail = createthumbnail(image); image._thumbnail = thumbnail; } return thumbnail; } this approach is straightforward, but relies on the use of prefixes.
... namespaces in the add-on sdk the add-on sdk is b
uilt on top of xpcom, the interface between javascript and c++ code.
...to illustrate this, the following reimplements the class point using namespaces: const { ns } = req
uire("sdk/core/namespace"); var internal = ns(); function point(x, y) { internal(this).x = x; internal(this).y = y; } point.prototype.getx = function () { return internal(this).x; }; point.prototype.setx = function (x) { internal(this).x = x; }; point.prototype.gety = function () { return internal(this).y; }; point.prototype.sety = function () { internal(this).y = y; };...
SDK and XUL Comparison - Archive of obsolete content
restartlessness add-ons b
uilt with the sdk can be installed without having to restart firefox.
... user experience best practices the
ui components available in the sdk are designed to align with the usability g
uidelines for firefox, giving your users a better, more consistent experience.
... advantages of xul-based add-ons user interface flexibility xul overlays offer a great deal of options for b
uilding a
ui and integrating it into the browser.
... using only the sdk's supported apis you have much more limited options for your
ui.
timers - Archive of obsolete content
example var { settimeout } = req
uire("sdk/timers"); settimeout(function() { // do something in 0 ms }, 0) cleartimeout(id) given an id returned from settimeout(), prevents the callback with the id from being called (if it hasn't yet been called).
... example var { settimeout, cleartimeout } = req
uire("sdk/timers"); var id = settimeout(function() { // do something in 1 sec }, 1000); // to stop/cancel this timeout cleartimeout(id); setinterval(callback, ms) schedules callback to be called repeatedly every ms milliseconds.
... example var { setinterval } = req
uire("sdk/timers"); setinterval(function() { // do something every 1 sec }, 1000) clearinterval(id) given an id returned from setinterval(), prevents the callback with the id from being called again.
... example var { setinterval, clearinterval } = req
uire("sdk/timers"); var id = setinterval(function() { // do something every 1 sec // to stop/cancel this interval clearinterval(id); }, 1000); ...
event/target - Archive of obsolete content
instantiation it's easy to create event target objects, no special arguments are req
uired.
... const { eventtarget } = req
uire("sdk/event/target"); let target = eventtarget(); for a convenience though optional options arguments may be used, in which case all the function properties with keys like: onmessage, onmyevent...
...in order to emit events one needs to use event/core module instead: let { emit } = req
uire('sdk/event/core'); target.on('hi', function(person) { console.log(person + ' says hi'); }); emit(target, 'hi', 'mark'); // info: 'mark says hi' for more details see event/core documentation.
... more details listeners registered during the event propagation (by one of the listeners) won't be triggered until next emit of the matching type: let { emit } = req
uire('sdk/event/core'); target.on('message', function onmessage(message) { console.log('listener triggered'); target.on('message', function() { console.log('nested listener triggered'); }); }); emit(target, 'message'); // info: 'listener triggered' emit(target, 'message'); // info: 'listener triggered' // info: 'nested listener triggered' exceptions in the listeners can be handled via 'error' event listeners: target.on('boom', function() { throw error('boom!'); }); target.once('error', function(error) { console.log('caught an error: ' + error.message); }); emit(target, 'boom'); // inf...
test/utils - Archive of obsolete content
helper methods used in the commonjs unit testing s
uite.
... usage before and after helper functions before() and after() are available for running a function before or after each test in a s
uite.
... let { before, after } = req
uire('sdk/test/utils'); let { search } = req
uire('sdk/places/bookmarks'); exports.testcountbookmarks = function (assert, done) { search().on('end', function (results) { assert.equal(results, 0, 'should be no bookmarks'); done(); }); }; before(exports, function (name, assert) { removeallbookmarks(); }); req
uire('sdk/test').run(exports); both before and after may be asynchronous.
... to make them asynchronous, pass a third argument done, which is a function to call when you have finished: let { before, after } = req
uire('sdk/test/utils'); let { search } = req
uire('sdk/places/bookmarks'); exports.testcountbookmarks = function (assert, done) { search().on('end', function (results) { assert.equal(results, 0, 'should be no bookmarks'); done(); }); }; before(exports, function (name, assert, done) { removeallbookmarksasync(function () { done(); }); }); req
uire('sdk/test').run(exports); globals functions before(exports, beforefn) runs beforefn before each test in the file.
window/utils - Archive of obsolete content
getxulwindow(window) returns the nsixulwindow for the given nsidomwindow: var { ci } = req
uire('chrome'); var utils = req
uire('sdk/window/utils'); var active = utils.getmostrecentbrowserwindow(); active instanceof ci.nsixulwindow // => false utils.getxulwindow(active) instanceof ci.nsixulwindow // => true parameters window : nsidomwindow returns nsixulwindow getbasewindow(window) returns the nsibasewindow for the given nsidomwindow: var { ci } = req
uire('chrome'); var utils = requ...
...ire('sdk/window/utils'); var active = utils.getmostrecentbrowserwindow(); active instanceof ci.nsibasewindow // => false utils.getbasewindow(active) instanceof ci.nsibasewindow // => true parameters window : nsidomwindow returns nsibasewindow gettoplevelwindow(window) returns the toplevel nsidomwindow for the given child nsidomwindow: var { ci } = req
uire('chrome'); var utils = req
uire('sdk/window/utils'); var browserwindow = utils.getmostrecentbrowserwindow(); var window = browserwindow.content; // `window` object for the current webpage utils.gettoplevelwindow(window) == browserwindow // => true parameters window : nsidomwindow returns nsidomwindow getwindowdocshell(window) returns the nsidocshell for the tabbrowser element.
... var { open } = req
uire('sdk/window/utils'); var window = open('data:text/html,hello window'); this function wraps nsiwindowwatcher.openwindow.
... var { open } = req
uire('sdk/window/utils'); var window = open('data:text/html,hello window', { name: 'jetpack window', features: { width: 200, height: 50, popup: true } }); args object extra argument(s) to be attached to the new window as the window.arguments property.
Add a Context Menu Item - Archive of obsolete content
when it's clicked, the selection is sent to the main add-on code, which just logs it: var contextmenu = req
uire("sdk/context-menu"); var men
uitem = contextmenu.item({ label: "log selection", context: contextmenu.selectioncontext(), contentscript: 'self.on("click", function () {' + ' var text = window.getselection().tostring();' + ' self.postmessage(text);' + '});', onmessage: function (selectiontext) { console.log(selectiontext); } }); try it: run th...
...the context-menu module provides a number of simple b
uilt-in contexts, including this selectioncontext(), which means: display the item when something on the page is selected.
...typically you'd store the image in your add-on's "data" directory, and construct the url using self.data.url(): var self = req
uire("sdk/self"); var contextmenu = req
uire("sdk/context-menu"); var men
uitem = contextmenu.item({ label: "log selection", context: contextmenu.selectioncontext(), contentscript: 'self.on("click", function () {' + ' var text = window.getselection().tostring();' + ' self.postmessage(text);' + '});', image: self.data.url("icon-16.png"), o...
...pressing the key selects the option when the context menu is open: var contextmenu = req
uire("sdk/context-menu"); var men
uitem = contextmenu.item({ label: "log selection", context: contextmenu.selectioncontext(), contentscript: 'self.on("click", function () {' + ' var text = window.getselection().tostring();' + ' self.postmessage(text);' + '});', accesskey: "l", onmessage: function (selectiontext) { console.log(selectiontext); } }); learning more to learn more about the context-menu mod...
Add-on SDK - Archive of obsolete content
g
uides contributor's g
uide learn how to start contributing to the sdk and about the most important idioms used in the sdk code such as modules, classes and inheritance, private properties, and content processes.
... content scripts a detailed g
uide to working with content scripts.
... xul migration a g
uide to porting xul add-ons to the sdk.
... this g
uide includes a comparison of the two toolsets and a working example of porting a xul add-on.
Forms related code snippets - Archive of obsolete content
date picker (before implementing it in a working environment, please read the note about the const statement compatibility) <!doctype html> <html> <head> <meta http-eq
uiv="content-type" content="text/html; charset=utf-8" /> <title>datepicker example - mdn</title> <script type="text/javascript"> /*\ |*| |*| datepicker example mdndeveloper network |*| |*| https://developer.mozilla.org/docs/code_snippets/forms |*| https://developer.mozilla.org/user:fusionchess |*| |*| this snippet is released under the gnu public license, version 3 or later.
... othiscal.writedays(); return false; } function ondayclick () { const othiscal = ainstances[this.id.replace(rbgnandend, "")]; othiscal.target.value = (this.innerhtml / 100).tofixed(2).substr(-2) + "\/" + (othiscal.current.getmonth() + 1) + "\/" + othiscal.current.getfullyear(); othiscal.container.parentnode.removechild(othiscal.container); return false; } function b
uildcalendars () { const afields = document.getelementsbyclassname(sdpclass), nlen = afields.length; for (var nitem = 0; nitem < nlen; new datepicker(afields[nitem++])); } const /* customizable by user */ sprefs = "zdp"; sdpclass = "date-picker", smonthsnames = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], sdays = ["m", "t", "...
...addeventlistener("load", b
uildcalendars, false) : window.attachevent ?
... attachevent("onload", b
uildcalendars) : (onload = b
uildcalendars); document.addeventlistener ?
HTML in XUL for rich tooltips - Archive of obsolete content
mple is what the final xul overlay could look like, assuming a javascript overlay titled overlay.js: <?xml version="1.0" encoding="utf-8"?> <overlay id="htmltip-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> <script type="application/x-javascript" src="overlay.js"/> <popup id="contentareacontextmenu"> <men
uitem id="htmltip1" label="foo1" onmouseover="htmltip.onmousetooltip(event)" tooltip="myhtmltip" /> <men
uitem id="htmltip2" label="foo2" onmouseover="htmltip.onmousetooltip(event)" tooltip="myhtmltip" /> </popup> <popupset id="mainpopupset"> <tooltip id="myhtmltip"> <html:div id="myhtmltipdiv" type="content"/> </too...
... a number of men
uitems have a tooltip attribute pointing to the same tooltip.
... that tooltip is empty now, but we will use the mouseover event to dynamically populate the tooltip (which is about to be shown) with a different message for each men
uitem.
... <?xml version="1.0" encoding="utf-8"?> <overlay id="htmltip-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> <script type="application/x-javascript" src="overlay.js"/> <popup id="contentareacontextmenu"> <men
uitem id="htmltip3" label="foo3" tooltip="mytip3html" /> </popup> <popupset id="mainpopupset"> <tooltip id="mytip3html"> <html:div type="content"> <html:b>bold foo</html:b> </html:div> </tooltip> </popupset> </overlay> ...
Miscellaneous - Archive of obsolete content
host application and version // get the name of the application running us services.appinfo.name; // returns "firefox" for firefox services.appinfo.version; // returns "2.0.0.1" for firefox version 2.0.0.1 retrieving the version of an extension as specified in the extension's install.rdf components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("extension-g
uid@example.org", function(addon) { // this is an asynchronous callback function that might not be called immediately alert("my extension's version is " + addon.version); }); restarting firefox/thunderbird/seamonkey_2.0 for firefox 3 see onwizardfinish around here: http://mxr.mozilla.org/seamonkey/sou...pdates.js#1639 for firefox 2 see around here: http://mxr.mozilla.org/mozilla1.8/so...pda...
... example for firefox: services.startup.q
uit(services.startup.eforceq
uit|services.startup.erestart); mouse and keyboard detecting mouse wheel events when scrolling the mouse wheel on an element, the dommousescroll event fires.
...service(ci.nsiobserverservice); const gioservice = cc["@mozilla.org/network/io-service;1"].getservice(ci.nsiioservice); function certsservice() {} certsservice.prototype = { observe: function(asubject, atopic, adata) { switch(atopic) { case "app-startup": gobserver.addobserver(this,"xpcom-shutdown",false); gobserver.addobserver(this,"final-
ui-startup",false); break; case "xpcom-shutdown": gobserver.removeobserver(this,"final-
ui-startup"); gobserver.removeobserver(this,"xpcom-shutdown"); break; case "final-
ui-startup": this.init(); break; } }, init: function() { // add all certificates you want ...
...see how to b
uild an xpcom component in javascript for details.
SVG General - Archive of obsolete content
svg template here is a basic markup template to start b
uilding an svg document: <svg xmlns="http://www.w3.org/2000/svg"> <!-- svg elements go here --> </svg> note: it is recommended that you do not use dtd's with svg documents.
... the tutorial and authoring g
uidelines have more information.
...svg req
uires you to use setattributens to add attributes to a newly created svg dom element.
...svg image also req
uires the use of xlink for the href attribute, which can be tricky to remember, especially when you're mixing svg with html or xul.
Adding windows and dialogs - Archive of obsolete content
modal windows should be avoided when possible because they interrupt the user's browsing and can become annoying very q
uickly.
...there are some eq
uivalent, simpler functions that are available in the window object, but those are meant for unprivileged html javascript code.
...see the firefox preferences window for an example of this: sections are defined using groupbox elements, but their style is q
uite different from the default.
... focus and tabbing moving through all input controls in a window using only the keyboard is an accessibility req
uirement.
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
also, calling .bind() in a tight (inner) loop should be avoided for performance reasons, as calling .bind() does req
uire some work and memory.
...var functionbody = gbrowser.addtab.tosource(); var afterbracket = functionbody.indexof("{") + 1; functionbody = functionbody.substring(0, afterbracket) + "myaddon.onaddtab(auri);" + functionbody.substring(afterbracket); eval("gbrowser.addtab = " + functionbody); of course, this not only looks messy, but can be q
uite error prone.
...(the example is a q
uite simple one.
... <men
uitem id="mymenu" oncommand="executesomething(); executesomethingelse();"/> <label id="mylabel" onclick="executesomething(); executesomethingelse();"/> add-on authors commonly use eval to trigger the handlers.
Getting Started with Firefox Extensions - Archive of obsolete content
if you're only getting started developing add-ons, the add-ons sdk provides a great way to q
uickly create simple ones and b
uild on them.
...unsigned add-ons can still be installed in developer edition, nightly, and esr versions of firefox, after toggling the xpinstall.signatures.req
uired preference in about:config.
...installing, uninstalling, enabling and disabling add-ons req
uire a restart to complete, with the exception of npapi plugins, add-ons sdk extensions and bootstrapped extensions.
... this is an important point to keep in mind if you're b
uilding an extension that manipulates other extensions or themes.
Local Storage - Archive of obsolete content
it is very common for an extension to req
uire some kind of local persistent storage.
...the rdf api may be removed at some point in the future because it req
uires a great deal of code even for the simplest tasks, and it currently sees little maintenance, so we don't recommend using it unless you really have to.
...there's a very detailed xul template g
uide here.
...there's a section about sqlite templates in the g
uide, but there are some concepts in it that will req
uire you to read at least some of the rest of it.
Mozilla Documentation Roadmap - Archive of obsolete content
the mozilla developer center this is the official and most extensive g
uide to everything related to mozilla.
...it encompasses firefox, other mozilla products, javascript, css, xul, web and extension development g
uidelines, accessibility, usability, best practices...
... the amo developer hub the amo developer hub is a great g
uide for add-on developers.
...but this also means that finding exactly what you need can be time-consuming, and often fr
uitless.
Using Dependent Libraries In Extension Components - Archive of obsolete content
sample code is below, and can be b
uilt by placing the two files in extensions/stub and configuring with --enable-extensions=stub extension file structure using the stub slightly changes how components are packaged in the extension directory structure.
...srcdir = @srcdir@ topsrcdir = @top_srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk module = bsmedberg library_name = bsmedberg_stub is_component = 1 force_shared_lib = 1 req
uires = \ xpcom \ string \ $(null) cppsrcs = bdsstubloader.cpp extra_dso_ldopts += \ $(dist)/lib/$(lib_prefix)xpcomglue_s.$(lib_suffix) \ $(xpcom_frozen_ldopts) \ $(nspr_libs) \ $(null) include $(topsrcdir)/config/rules.mk defines += -dmoz_dll_prefix=\"$(dll_prefix)\" extensions/stub/bdsstubloader.cpp // copyright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> #include "nscore...
... if you update your dependencies in your component, // but forget to remove a dependant library in the stubloader, then we don't want to // fail loading the component since the dependant library isn't req
uired.
...os x code was b
uilt using the 10.4 universal sdk.
Notes on HTML Reflow - Archive of obsolete content
in this case, the primary frame is the frame containing the first line of text, with contin
uing frames (or continuations ) created for subsequent lines.
...there are exceptions to this rule: most notably, html tables may req
uire more than one pass.
...reflow proceeds recursively through some or all of the frame hierarchy, computing geometric information for each frame object that req
uires it.
...the reflow tree work, which will remove several commands from the queue at once.) a path is b
uilt from the target frame to the root frame and stored in the reflow command.
Finding the file to modify - Archive of obsolete content
mozilla's
ui is divided into three layers: the structure, the style, and the behavior.
... the structure layer identifies the widgets (menus, buttons, etc.) and their position in the
ui relative to each other, the style layer defines how the widgets look (size, color, style, etc.) and their overall position (alignment), and the behavior layer specifies how the widgets behave and how users can use them to accomplish their goals.
...in particular, positioning information can be specified in both the structure layer and the style layer, and some behavior can be partly defined in the style layer.) we're going to add code to all three
ui layers, starting with the structure layer.
...it contains elements for all common
ui widgets (menus, buttons, toolbars, etc.) and many sophisticated ones (trees, browsers, color pickers).
GRE Registration - Archive of obsolete content
successfully embedding the gre req
uires that information about installed gres be stored on the system.
...each subkey is searched for gre registration information: hklm/software/mozilla.org/gre/1.8_1 version=1.8 grehome=c:\path\to\installed-dir feature=value feature2=value2 hklm/software/mozilla.org/gre/1.8_2 version=1.8 grehome=c:\path\to\second-installation when installing a gre via the mozilla s
uite gre installer, the installer will blindly overwrite any previous gre information in hklm/software/mozilla.org/gre/<version>.
... linux on linux, registration information is kept in ini-style files of the following form: [1.7.10] gre_path=/usr/lib/mozilla-1.7.10 feature=value feature2=value2 these ini files can be in any of the following locations: /etc/gre.conf /etc/gre.d/*.conf ~/.gre.conf ~/.gre.d/*.conf mozilla has never officially shipped a linux gre based on the mozilla s
uite.
... however, some linux distributors including red hat/fedora core ship /etc/gre.d/*.conf files with the mozilla s
uite rpms.
GRE - Archive of obsolete content
mozilla s
uite: the old gre there are two different forms for the gre: the "old" gre was part of the mozilla application s
uite.
...the mozilla s
uite never supported a gre on mac.
...unfortunately, the mozilla s
uite-based gre is not as forgiving, especially on linux.
... embedders will need to set the ld_library_path environment variable and start a new process in order to embed a s
uite-based gre correctly.
LIR - Archive of obsolete content
source filename for debug symbols 13 line void source line number for debug symbols 14 comment void a comment shown, on its own line, in lir dumps 15 not in use load 16 not in use 17 ldc2i integer load char and sign-extend to an int 18 lds2i integer load short and sign-extend to an int 19 lduc2
ui integer load unsigned char and zero-extend to an unsigned int 20 ldus2
ui integer load unsigned short and zero-extend to an unsigned int 21 ldi integer load int 22 ldq quad 64 bit load quad 23 ldd double load double 24 ldf2d double load float and extend to a double store 25 sti2c void store int truncated to...
... immq 64 bit quad immediate 51 immd double immediate 52 not in use comparisons 53 eqi integer int equality 54 lti integer signed int less-than 55 gti integer signed int greater-than 56 lei integer signed int less-than-or-equal 57 gei integer signed int greater-than-or-equal 58 lt
ui integer unsigned int less-than 59 gt
ui integer unsigned int greater-than 60 le
ui integer unsigned int less-than-or-equal 61 ge
ui integer unsigned int greater-than-or-equal 62 not in use 63 eqq integer 64 bit quad equality 64 ltq integer 64 bit signed quad less-than 65 gtq integer 64 bit signed ...
... 84 noti integer bitwise-not int 85 andi integer bitwise-and int 86 ori integer bitwise-or int 87 xori integer bitwise-xor int 88 lshi integer left shift int 89 rshi integer right shift int (>>) 90 rsh
ui integer right shift unsigned int (>>>) 91 addq quad 64 bit add quad 92 subq quad 64 bit subtract quad 93 andq quad 64 bit bitwise-and quad 94 orq quad 64 bit bitwise-or quad 95 xorq quad 64 bit bitwise-xor quad 96 lshq quad 64 bit left shift quad,2nd operand is an int 97 rshq quad 64 bit right shift quad, ...
... 105 cmovi integer conditional move int 106 cmovq quad 64 bit conditional move quad 107 cmovd double conditional move double conversions 108 i2q quad 64 bit sign-extend int to quad 109
ui2uq quad 64 bit zero-extend unsigned int to unsigned quad 110 q2i integer 64 bit truncate quad to int (removes the high 32 bits) 111 i2d double convert int to double 112
ui2d double convert unsigned int to double 113 d2i integer convert double to int (no exceptions raised) 114 dasq quad 64 bit interpret the bits of a double as...
HostWindow - Archive of obsolete content
the window does have some
ui components (as shown in the screenshot below).
... prism can be configured to show or hide several of the
ui components.
...when the sidebar is displayed, the splitter can be used to change the width or q
uickly collapse it.
... the splitter itself cannot be hidden as it is the only
ui to show a collapsed sidebar.
RDF Datasource How-To - Archive of obsolete content
constructing a dll for a component is beyond the scope of this document; the reader is referred to the rdf factory as a g
uideline.
....com/nc-rdf#name" /> </treecell> <treecell> <text value="rdf:http://home.netscape.com/nc-rdf#url" /> </treecell> </treerow> </treeitem> </treechildren> </template> <treehead> <treeitem> <treecell>name</treecell> <treecell>url</treecell> </treeitem> </treehead> <!-- treechildren b
uilt _here_ --> </tree> </window> the important "magic attributes" have been called out in bold, above: datasources="rdf:my-datasource".
...the xul template that is used to b
uild content from the graph.
... for a complete description of how content is b
uilt from rdf, see the xul:template g
uide.
The life of an HTML HTTP request - Archive of obsolete content
(6) the contentsink then b
uilds up nsicontent nodes that describe the document.
...nsicontent::appendchild() is used to b
uild the content tree but appendchild takes a "anotify" argument that marks if it should notify the document about the content model changes or not.
...the content sink tells the document about content model changes (notifybody()) in places like nshtmlcontentsink::willinterrupt() and nshtmlcontentsink::didb
uildmodel().
...startlayout is called q
uite early in the parsing process, for html it's called in nshtmlcontentsink::openbody() (among other places).
TraceVis - Archive of obsolete content
if tracemonkey is b
uilt with tracevis, and run with tracevis enabled, then tracemonkey will output a log of all its activity transitions.
...prereq
uisites the visualization scripts req
uire pil (python imaging library).
... b
uilding with tracevis these are the steps to b
uild a js shell with tracevis, starting from a mozilla source directory.
... these directions create an optimized b
uild, because optimized b
uilds are usually better for performance analysis.
Anonymous Content - Archive of obsolete content
when anonymous content elements are b
uilt above the bound element, the topmost elements' parentnode pointers are set to the bound element's parentnode.
... handling dom changes insertion points contin
uing to be used as elements are inserted or removed from the dom.
...in general,
ui events are retargeted and mutation events are stopped.
... mouseover and mouseout events mouseover and mouseout events are retargeted if the mouse gen
uinely enters or exits the bound element (in addition to entering or exiting some anonymous content).
Windows stub installer - Archive of obsolete content
b
uild your entire mozilla tree, which should b
uild the stub installer in the setup directory as well.
... (if you need to reb
uild stub installer, got to /mozilla/xpinstall/wizard/windows/setup and type "nmake /f makefile.win") go to mozilla/xpinstall/wizard/windows/b
uilder on the shell prompt type "perl b
uild.pl".
... $spacereq
uired$ which is replaced at package time with the amount of space in kb req
uired for the package when it is fully extracted.
... finally add <component> to the component list array @gcomponentlist at: <http://lxr.mozilla.org/seamonkey/sou...makeall.pl#125> you can test it by changing your current working directory to mozilla/xpinstall/wizard/windows/b
uilder and running "perl b
uild.pl" on the shell prompt.
Install script template - Archive of obsolete content
n: http://mozilla.org/projects/plugins/plugin-identifier.html **/ // define some global variables var plugin_file = "npmyplugin.dll"; // this plugin consists of an xpt file because it is scriptable // http://mozilla.org/projects/plugins/scripting-plugins.html var component_file = "npmypluginscriptable.xpt"; var plugin_size = 2000; // (dll file) reserve a little extra so it is not req
uired to update too often var component_size = 10; // (xpi file) reserve a little extra so it is not req
uired to update too often var software_name="cult3d mozilla viewer"; // plids (http://mozilla.org/projects/plugins/plugin-identifier.html) are coined by vendors.
...r; //special error values used by the cycore developers (www.cycore.com) who helped make this install script var exceptionoccurederror = -4711; var winregisnullerror = -4712; var invalidrootkeyerror = -4713; var registrykeynotwritableerror = -4714; //initinstall block //the installation is initialized here -- if we fail here, cancel the installation // initinstall is q
uite an overloaded method, but i have invoked it here with three strings // which are globally defined err = initinstall(software_name, plid, version); if (err != 0) { // call initinstall again in case illegal characters in plid err = initinstall(software_name, software_name, version); if (err != 0) cancelinstall(err); } //addfiles to current browser block var pluginsfolder = getfolder(...
... * * @param dirpath directory path from getfolder * @param spacereq
uired req
uired space in kilobytes * **/ function verifydiskspace(dirpath, spacereq
uired) { var spaceavailable; // get the available disk space on the given path spaceavailable = filegetdiskspaceavailable(dirpath); // convert the available disk space into kilobytes spaceavailable = parseint(spaceavailable / 1024); // do the verification if(spaceavailable < spacereq
uired) { ...
... logcomment("insufficient disk space: " + dirpath); logcomment(" req
uired : " + spacereq
uired + " k"); logcomment(" available: " + spaceavailable + " k"); return(false); } return(true); } /** * function for writing keys to the win32 system registry.
compareTo - Archive of obsolete content
method of installversion object syntax compareto ( installversion version); compareto ( string version); compareto ( int major, int minor, int release, int b
uild); parameters the compareto method has the following parameters: maj the major version number.
... bld b
uild number.
... -1 this version object has a smaller (earlier) b
uild number than version.
... 1 this version object has a larger (newer) b
uild number than version.
Namespaces - Archive of obsolete content
xml namespaces provide a way to disting
uish duplicate element and attribute names.
...this disting
uishes it from, for example, <foobar:textbox/> which might occur in the same document.
...the only way to disting
uish that they have different meanings is with namespaces.
... <foo/> the answer is that it's in no namespace, or alternately, it's in the namespace denoted by the empty string: <foo xmlns=""/> this second example is semantically eq
uivalent to the first.
Multiple Rule Example - Archive of obsolete content
<vbox id="photoslist" align="start" datasources="template-g
uide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <rule> <conditions> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://purl.o...
...but, you could use a <binding> to get the date without req
uiring it to match the conditions.
...the reason for this is due to the manner in which the b
uilder processes the data.
...although the b
uilder actually generates mutliple matches for one resource, in many cases it isn't necessary to be aware of this detail when creating templates.
Simple Example - Archive of obsolete content
first, we set the datasources and ref attributes as needed: <vbox datasources="template-g
uide-ex2.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> this time, we need to use a new statement, the member condition as well as a triple.
...this will result in the following: <member container="http://www.xulplanet.com/rdf/myphotos" child="?photo"/> as with processing a triple, the b
uilder will now try to find as many values for the ?photo variable as possible and create potential results using them.
...the b
uilder will first fill in as many variables as it can.
... for the first result, the value of the ?photo variable is known, so the triple will be evaluated like so: <triple subject="http://www.xulplanet.com/ndeakin/images/t/palace.jpg" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> the b
uilder next calculates the value for ?title using the predicate 'http://purl.org/dc/elements/1.1/title'.
Things I've tried to do with XUL - Archive of obsolete content
this means that creating any sort of visual display (not necessarily "
ui"; my use case is for creating a calendar time display) that sizes sanely when the user resizes the window is unfortunately very difficult.
...:) silver: if you set height="0" and include "overflow: hidden" on each box that is sharing the space, current gecko will q
uite happily split the space out according to flex, ignoring the contents of each box, as desired.
...html elements have the non-standard clientwidth/clientheight properties (see http://www.mozilla.org/docs/dom/domr...entheight.html); no eq
uivalent exists for xul.
...instead, you must b
uild up your own listitem full of listcells, and then add that listitem to the listbox, using generic dom calls: var row = document.createelement('listitem'); // create and attach 1st cell var cell = document.createelement('listcell'); cell.setattribute('label', label ); cell.setattribute('value', value ); row.appendchild( cell ); // create and attach 2nd cell cell = document.createelement('listcel...
Adding Event Handlers - Archive of obsolete content
« previousnext » the find files dialog so far looks q
uite good.
... each event has a name, for example, 'mousemove' is the name of the event that is triggered when the user moves the mouse over a
ui element.
...once the event has finished propagating, any default action will occur, which is the b
uilt in behaviour of the element.
... <men
uitem label="close" accesskey="c" oncommand="window.close();"/> ...
Adding more elements - Archive of obsolete content
<hbox> <menulist id="searchtype"> <menupopup> <men
uitem label="name"/> <men
uitem label="size"/> <men
uitem label="date modified"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <menulist id="searchmode"> <menupopup> <men
uitem label="is"/> <men
uitem label="is not"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <textbox id="find-text" flex="1" style="min-width: 15em;"/> </hbox> two drop down...
...<spacer style="height: 10px"/> <hbox> <menulist id="searchtype"> <menupopup> <men
uitem label="name"/> <men
uitem label="size"/> <men
uitem label="date modified"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <menulist id="searchmode"> <menupopup> <men
uitem label="is"/> <men
uitem label="is not"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <textbox id="find-text" flex="1" style="min-width: 15em;"/> </hbox> <spa...
...this first method would req
uire that we set the style on the box itself.
...a groupbox has the advantage that it draws a box with a nice beveled look, s
uitable for the current theme.
Adding Style Sheets - Archive of obsolete content
let's assume that we are b
uilding the find files dialog for themeability, because the find files dialog can be referred to with the url chrome://findfile/content/findfile.xul so the style sheet file will be stored in chrome://findfile/skin/findfile.css.
...the style sheet applies various fonts, colors and borders to make the elements look more s
uitable.
...<spacer class="titlespace"/> <groupbox orient="horizontal"> <caption label="search criteria"/> <menulist id="searchtype"> <menupopup> <men
uitem label="name"/> <men
uitem label="size"/> <men
uitem label="date modified"/> </menupopup> </menulist> <spacer class="springspace"/> <menulist id="searchmode"> <menupopup> <men
uitem label="is"/> <men
uitem label="is not"/> </menupopup> </menulist> <spacer class="springspace"/> <menulist id="find-tex...
...in this file, we'll add the style declarations, as shown below: #find-text { min-width: 15em; } #progmeter { margin: 4px; } .springspace { width: 10px; } .titlespace { height: 10px; } notice how these styles are eq
uivalent to the styles we had before.
Anonymous Content - Archive of obsolete content
note that the b
uilt-in elements such as scroll bars get their xbl from the files in the bindings directory in the toolkit package.
...for example, a simplified version of an editable menulist element, might be created as follows: xul: <menu class="dropbox"> <menupopup> <men
uitem label="1000"/> <men
uitem label="2000"/> </menupopup> </menu> css: menu.dropbox { -moz-binding: url('chrome://example/skin/example.xml#dropbox'); } xbl: <binding id="dropbox"> <content> <children/> <xul:textbox flex="1"/> <xul:button src="chrome://global/skin/images/dropbox.jpg"/> </content> </binding> this example creates an input field with a button beside it.
...the resulting content would be: <menu class="dropbox"> <menupopup> <men
uitem label="1000"/> <men
uitem label="2000"/> </menupopup> <textbox flex="1"/> <button src="chrome://global/skin/images/dropbox.jpg"/> </menu> includes attribute in some cases, you may wish to only include specific types of content and not others.
...this results in a display that is eq
uivalent to the following: <binding id="zoombox"> <content> <xul:box flex="1"> <xul:button label="zoom in"/> <xul:box flex="1" style="border: 1px solid black"> <xul:image src="images/happy.jpg"/> <xul:image src="images/angry.jpg"/> </xul:box> <xul:button label="zoom out"/> </xul:box> </content> </binding> from the dom's perspective, the child elem...
Creating Dialogs - Archive of obsolete content
« previousnext » a xul application will often req
uire dialogs to be displayed.
... note: opendialog() req
uires universalbrowserwrite privilege.
... amongst other useful attributes are buttonlabelaccept - label to appear on the accept button egsave buttonaccesskeyaccept - access key to use for the accept button egs defaultbutton - button is activated when the enter key is pressed note: the label attributes are req
uired by remote sites and are probably missing in the above examples due to bug 224996.
...eyaccept="s" ondialogaccept="return dosave();" buttonlabelcancel="cancel" buttonaccesskeycancel="n" ondialogcancel="return docancel();"> <script> function dosave(){ //dosomething() return true; } function docancel(){ return true; } </script> <dialogheader title="my dialog" description="example dialog"/> <groupbox flex="1"> <caption label="select favourite fr
uit"/> <radio id="orange" label="oranges because they are fr
uity"/> <radio id="violet" selected="true" label="strawberries because of their colour"/> <radio id="yellow" label="bananas because they are pre-packaged"/> </groupbox> </dialog> the buttons elements can be accessed with the following javascript // the accept button var acceptbutt = document.documentelement.getbutton("accept") m...
List Controls - Archive of obsolete content
the list box will default to a s
uitable size, but you can control the size with the rows attribute.
...the third, men
uitem, creates the individual choices.
... its syntax is best described with the example below: example 5 : source view <menulist label="bus"> <menupopup> <men
uitem label="car" /> <men
uitem label="taxi" /> <men
uitem label="bus" selected="true" /> <men
uitem label="train" /> </menupopup> </menulist> this menulist will contain four choices, one for each men
uitem element.
...to create an editable menulist, add the editable attribute as follows: example 6 : source view <menulist editable="true"> <menupopup> <men
uitem label="www.mozilla.org" /> <men
uitem label="www.xulplanet.com" /> <men
uitem label="www.dmoz.org" /> </menupopup> </menulist> the url field created here has three pre-populated choices that the user can select or they can enter one of their own by typing it into the field.
Tree View Details - Archive of obsolete content
the view is req
uired to keep track of this.
... var treeview = { childdata : { solids: ["silver", "gold", "lead"], liq
uids: ["mercury"], gases: ["helium", "nitrogen"] }, visibledata : [ ["solids", true, false], ["liq
uids", true, false], ["gases", true, false] ], }; the childdata structure holds an array of the children for each of the three parent nodes.
...for example, if the liq
uids row was opened, the corresponding array from childdata, which in this case contains only the single mercury child, will be inserted into the visibledata array after liq
uids but before gases.
...rome://global/skin/" type="text/css"?> <window onload="init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <tree id="elementlist" flex="1"> <treecols> <treecol id="element" label="element" primary="true" flex="1"/> </treecols> <treechildren/> </tree> <script> <![cdata[ var treeview = { childdata : { solids: ["silver", "gold", "lead"], liq
uids: ["mercury"], gases: ["helium", "nitrogen"] }, visibledata : [ ["solids", true, false], ["liq
uids", true, false], ["gases", true, false] ], treebox: null, selection: null, get rowcount() { return this.visibledata.length; }, settree: function(treebox) { this.treebox = treebox; }, getcelltext: function(idx, column) { return this.visib...
Using the Editor from XUL - Archive of obsolete content
it needs this to poke the
ui (e.g.
... as well as making the editor (which happens via nseditorshell::doeditormode()) we also hook up various listeners and observers for
ui updating and user interaction, and store a file specifier for the document we opened.
... the user chooses 'close' from the file menu, uses the key shortcut, or q
uits the application, causing all windows to be closed.
... nshtmleditor::inserttext() hides q
uite a bit of complexity in some stack-based classes.
XUL Template Primer - Bindings - Archive of obsolete content
see xul:template g
uide for up to date documentation.
... example to illustrate how <bindings> work, we'll examine this xul document, which b
uilds a simple content model an rdf/xml file.
... in the content that's b
uilt for lumpy's <hbox>, the second <label>'s value attribute (which should contain the value of ?street) is just left blank.
... xul template primer - nested content illustrates how a template can be used recursively to b
uild nested content.
browser - Archive of obsolete content
letepopup, autoscroll, disablehistory, disableglobalhistory, disablesecurity, droppedlinkhandler, homepage, showcaret, src, type properties accessibletype, cangoback, cangoforward, contentdocument, contentprincipal, contenttitle, contentvieweredit, contentviewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, messagemanager, preferences, security
ui, sessionhistory, webbrowserfind, webnavigation, webprogress methods addprogresslistener, goback, goforward, gohome, gotoindex, loaduri, loaduriwithflags, reload, reloadwithflags, removeprogresslistener, stop, swapdocshells examples <!-- shows mozilla homepage inside a groupbox --> <groupbox flex="1"> <caption label="mozilla homepage"/> <browser type="content" src="http://www.mozilla...
... disablesecurity type: boolean set this attribute to true to disable the security
ui for this browser.
... security
ui type: nsisecurebrowser
ui the read-only property holds an object which may be used to determine the security level of the loaded document.
... stop() return type: no return value eq
uivalent to pressing the stop button, this method stops the currently loading document.
button - Archive of obsolete content
for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } dir type: one of the values below the direction in which the child elements of the element are placed.
... visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
...unlike the menu type, this type req
uires the user to press the arrow to open the menu, but a different command may be invoked when the main part of the button is pressed.
command - Archive of obsolete content
using this function has the advantage that the command will be sent to the part of the
ui which will respond to it.
... visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
... properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
listcell - Archive of obsolete content
for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
... visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
... inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattribut...
panel - Archive of obsolete content
nonethe panels doesn't automatically fade away.slowthe panels slowly fades away after a short time.fastthe panels q
uickly fades away after a short time.
... example: <menupopup id="top" onpopuphidden="console.log('the onpopuphidden method of id=top was called.');"> <men
uitem label="item 1"/> <men
uitem label="item 2"/> <menu id="submenu1" label="submenu 1"> <menupopup id="submenu1-popup"> <men
uitem label="submenu1 item 1"/> <men
uitem label="submenu1 item 2"/> </menupopup> </menu> <menu id="submenu2" label="submenu 1"> <menupopup id="submenu2-popup"> <men
uitem label="submenu2 item 1"/> ...
... <men
uitem label="submenu2 item 2"/> </menupopup> </menu> <menupopup/> onpopuphiding type: script code this event is sent to a popup when it is about to be hidden.
...check positioning of the popup g
uide for a precise description of the effect of the different values.
tab - Archive of obsolete content
for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
... visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
...this property is available for men
uitem and menuseparator elements in firefox 3.
treecol - Archive of obsolete content
attributes crop, cycler, dragging, editable, fixed, hidden, hideheader, ignoreincolumnpicker, label, primary, sort, sortactive, sortdirection, src, type, width properties accessibletype style classes treecol-image examples this example shows a checkbox in the first column, req
uires the style below.
...for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } cycler type: boolean if true, then the column is a cycler column.
...for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
... inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
treeitem - Archive of obsolete content
in a template condition, you should use a treeitem instead of a content element when the dont-b
uild-content flag is specified.
...this will be set by the template b
uilder as needed.
...this will be set by the template b
uilder as needed.
... properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
Dialogs in XULRunner - Archive of obsolete content
custom dialogs b
uilding dialogs in xul is very similar to creating windows.
...eturn dosave();" buttonlabelcancel="cancel" buttonaccesskeycancel="n" ondialogcancel="return docancel();"> <script> function dosave(){ //dosomething() return true; } function docancel(){ return true; } </script> <dialogheader title="my dialog" description="example dialog"/> <groupbox flex="1"> <caption label="select favorite fr
uit"/> <radiogroup> <radio id="1" label="oranges because they are fr
uity"/> <radio id="2" selected="true" label="strawberries because of color"/> <radio id="3" label="bananna because it pre packaged"/> </radiogroup> </groupbox> </dialog> xul window elements have a special method to open dialogs, called window.opendialog().
...not too sure if i’ll use the <dialogheader>, but if i did, the single element would be a big time saver over b
uilding the header from scratch.
...for instance, windows has supported b
uilt-in file open and file save dialogs for many years, and the macintosh has always had them.
MacFAQ - Archive of obsolete content
(note this document has not been reviewed for accuracy or completeness.) special b
uild notes enable libxul.
... in your .mozconfig for custom b
uilds of xulrunner, add --enable-libxul.
... if you've completed a xulrunner b
uild, you should copy or symlink the dist/xul.framework directory to /library/frameworks.
...for command-line work, you would call on: /applications/(vendor)/(name).app/contents/macos/xulrunner
ui notes menus to enable your application q
uit command to work with the application menu (the one to the right of the blue apple), you need to give your q
uit menu item an id of "menu_fileq
uititem".
XULRunner/Old Releases - Archive of obsolete content
1.9.2.x xulrunner releases these b
uilds are b
uilt from the stable 1.9.2 branch.
... nightly b
uilds of xulrunner 1.9.0.x these b
uilds are b
uilt from the stable 1.9 branch.
... community contributed b
uilds of xulrunner 1.8.1.3 these b
uilds are contributed by the eclipse atf community and are intended for embedding.
... the windows and linux b
uilds will run normal xulrunner applications, but the mac b
uild uses cocoa widgets and will not run xulrunner applications.
What XULRunner Provides - Archive of obsolete content
the following features are either already implemented or planned: gecko features xpcom networking gecko rendering engine dom editing and transaction support (no
ui) cryptography xbl (xbl2 planned) xul svg xslt xml extras (xmlhttprequest, domparser, etc.) web services (soap) auto-update support (not yet complete) type ahead find toolbar history implementation (the places implementation in the 1.9 cycle) accessibility support ipc services for communication between gecko-based apps (not yet complete) storage/sqlite interfaces user interface features the following user interface is supplied by x...
... extension manager file picker (uses native os filepicker as appropriate) find toolbar helper app dialog/
ui security
ui (maintenance of ssl keychains, etc) embedding apis the following embedding apis are provided by xulrunner: cross-platform embedding (xre_initembedding) javaxpcom embedding gtkmozembed (linux only) activex control (windows only) (not yet complete) obsolete since gecko 7.0 nsview-based-widget (mac os x only) (not yet complete) the "maybe" list the following features have been discussed and may be included if developer time permits and code size is controll...
...ed: ldap support spellchecking support (with or without dictionaries provided) see bug 285977 core support for profile roaming (with application-specific extensibility) pyxpcom embedding (not yet complete) - but it does work, if you compile a custom b
uild that includes the pyxpcom bindings and there is a working python available.
... what's out xulrunner will not supply: bookmarks or history
ui (must be managed by the application/embedder) xforms (xforms will be available as an extension) ...
XULRunner - Archive of obsolete content
firefox (from version 3) ships with a private xulrunner package, which can run any compatible xulrunner application using the -app switch: firefox -app application.ini is eq
uivalent to xulrunner -app application.ini older b
uilds are also available.
... overview development plan what xulrunner provides xulrunner faq nightly b
uilds: unstable-trunk documentation getting started with xulrunner short tutorial on b
uilding desktop applications with xulrunner.
... b
uild documentation learn how to get the source and b
uild it.
... debug documentation steps to configure venkman to debug your app xulrunner g
uide a fairly complete, but outdated, introduction and tutorial for xulrunner which collates much of the documentation found here.
calICalendarView - Archive of obsolete content
because of this close association between methods and attributes on the one hand, and content on the other, calicalendarview implementations are particularly well s
uited to xbl.
...this allows lack of req
uired predictability allows calicalendarview implementations to be re-used in a variety of sitatuations.
... interface code [scriptable, u
uid(3e567ccb-2ecf-4f59-b7ca-bf42b0fbf24a)] interface calicalendarview : nsisupports { attribute calicalendar displaycalender; attribute calicalendarviewcontroller controller; void showdate(in calidatetime adate); void setdaterange(in calidatetime astartdate, in calidatetime aenddate); readonly attribute calidatetime startdate; readonly attribute calidatetime enddate; readonly attribute boolean supportsdisjointdates; readonly attribute boolean hasdisjointdates; voi...
...this link allows the calicalendarview to have a way of creating, modifying, and deleting events based on user interaction with the dom nodes it controls, often without req
uiring any other user interaction.
2006-10-26 - Archive of obsolete content
fx 1.5.0.x (linux) not b
uilding since 20-oct-2006 17:45 pdt?
... tony inq
uires why tinderbox is showing that the fx 1.5.0.x (linux) has failed since october 20.
... reb
uild firefox after modifying source code an inqury about how to reb
uild the code after making a minor change - the user is unfamiliar with how to use the command prompt.
... error b
uilding firefox-2.0rc3 on uclinux an error was found about b
uilding on uclinux, user googgled the error and suggests that the error found in older versions.
2006-10-27 - Archive of obsolete content
fx 1.5.0.x (linux) not b
uilding since 20-oct-2006 17:45 pdt?
... tony inq
uires why tinderbox is showing that the fx 1.5.0.x (linux) has failed since october 20.
... reb
uild firefox after modifying source code an inqury about how to reb
uild the code after making a minor change - the user is unfamiliar with how to use the command prompt.
... error b
uilding firefox-2.0rc3 on uclinux an error was found about b
uilding on uclinux, user googgled the error and suggests that the error found in older versions.
2006-11-03 - Archive of obsolete content
source code for the nsinstall contained in moztools a user asks for advice about b
uilding nsinstall on windows.
... suggestion: a b
uilt-in firefox feature a user suggests a feature to compare different versions of a webpage to see what has changed.
... what g
ui lib was used for developing firefox 2.0 ?
... a user inq
uires about what g
ui library is used for developing firefox 2.0.
2006-11-04 - Archive of obsolete content
code for the nsinstall contained in moztools a user asks for advice about b
uilding nsinstall on windows.
... suggestion: a b
uilt-in firefox feature a user suggests a feature to compare different versions of a webpage to see what has changed.
... g
ui lib was used for developing firefox 2.0 ?
... a user inq
uires about what g
ui library is used for developing firefox 2.0.
2006-10-06 - Archive of obsolete content
summary: mozilla.dev.b
uilds - september 30th to october 6th 2006 tb mozilla_1_8_branch b
uild problem on mac os x (10.4.7, universal b
uild) ludwig hügelschäfer stated that he has been encountering an error when he executes a "make export" operation on thunderbird (part of the mozilla_1_8_branch) since september 15th.
...he then was able to successfully b
uild thunderbird.
... announcements new svg b
uild dependency coming on october 2nd t rowley announced that: soon svg on the trunk will be switching to use thebes directly (instead of the current choice of direct cairo or punching a hole through thebes to cairo).
... once completed you will need to b
uild cairo gfx in order to b
uild svg.
NPN_PostURL - Archive of obsolete content
syntax #include <npapi.h> nperror npn_posturl(npp instance, const char *url, const char *target,
uint32 len, const char *buf, npbool file); parameters the function has the following parameters: instance pointer to the current plug-in instance.
...data in buffer cannot be posted for a protocol that req
uires a header.
...for protocols in which the headers must be disting
uished from the body, such as http, the buffer or file should contain the headers, followed by a blank line, then the body.
... if no custom headers are req
uired, simply add a blank line ('\n') to the beginning of the file or buffer.
Samples and Test Cases - Archive of obsolete content
the samples may not b
uild any more on all platforms.
... there are plans to clean up the sample plugin situation - better organization, updated b
uild systems, get them b
uilding on all platforms.
... however, even if one cannot b
uild the samples they can still be very valuable as code references.
... there is a g
uide to compiling the npruntime sample in visual studio.
Why RSS Content Module is Popular - Including HTML Contents - Archive of obsolete content
an example using the most popular element of the rss content module is shown below: <?xml version="1.0"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" > <channel> <title>example</title> <description>an rss example with slash</description> <lastb
uilddate>sun, 15 may 2005 13:02:08 -0500</lastb
uilddate> <link>http://www.example.com</link> <item> <title>a link in here</title> <g
uid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/114</g
uid> <pubdate>sun, 15 may 2005 13:02:08 -0500</pubdate> <link>http://www.example.com/blog/2005/05/15/114</link> <c...
...ontent:encoded><![cdata[this is a <a href="http://example.com/">link</a>.]]></content:encoded> </item> <item> <title>some italics html</title> <g
uid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</g
uid> <pubdate>sun, 15 may 2005 10:55:12 -0500</pubdate> <link>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</link> <content:encoded><![cdata[this is <i>italics</i>.]]></content:encoded> </item> <item> <title>some bold html</title> <g
uid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/112</g
uid> <pubdate>sun, 15 may 2005 08:14:11 -0500</pubdate> <link>http://www.example.com/blog/2005/05/15/112</link> ...
... note: strictly speaking, the rss content module and <content:encoded> are not q
uite being used correctly.
... it req
uires intertwinment with rdf's xml serialization.
Why RSS Slash is Popular - Counting Your Comments - Archive of obsolete content
one of the q
uirks of slashdot is that it includes a comments count, a humorous department, a hit parade, and a section with every blog post.
...an example using the most popular element of the rss slash module is shown below: <?xml version="1.0"> <rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" > <channel> <title>example</title> <description>an rss example with slash</description> <lastb
uilddate>sun, 15 may 2005 13:02:08 -0500</lastb
uilddate> <link>http://www.example.com</link> <item> <title>review of sin city</title> <g
uid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/114</g
uid> <pubdate>sun, 15 may 2005 13:02:08 -0500</lastb
uilddate></pubdate> <link>http://www.example.com/blog/2005/05/15/114</lin...
...k> <slash:comments>43</slash:comments> </item> <item> <title>what is the 3571st prime number</title> <g
uid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</g
uid> <pubdate>sun, 15 may 2005 10:55:12 -0500</lastb
uilddate></pubdate> <link>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</link> <slash:comments>72</slash:comments> </item> <item> <title>first article!</title> <g
uid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/112</g
uid> <pubdate>sun, 15 may 2005 08:14:11 -0500</lastb
uilddate></pubdate> <link>http://www.example.com/blog/2005/05/15/112</link> <slash:comments>118</sla...
...one could assume that the comment count was acurate at the moment in time specified in the <channel>'s <lastb
uilddate> element, but that is a risky assumption given that no where is that mandated.
Encryption and Decryption - Archive of obsolete content
compared with symmetric-key encryption, public-key encryption req
uires more computation and is therefore not always appropriate for large amounts of data.
...nevertheless, private-key encryption is useful, because it means you can use your private key to sign data with your digital signature-an important req
uirement for electronic commerce and other commercial applications of cryptography.
...for a public key algorithm, breaking the algorithm usually means acq
uiring the shared secret information between two recipients.
... different ciphers may req
uire different key lengths to achieve the same level of encryption strength.
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
take a cr
uise through one aspect of the redesign with master styler eric meyer.
...it's like a scuba enthusiast getting to join jacques cousteau on a dive, even down to the req
uired time travel.
...although this design approach was abandoned fairly q
uickly, the class name stuck, kind of like a barnacle.
... i hope that our little cr
uise through this aspect of the redesign has gotten you hooked on the idea of using simple markup and css to create interesting effects, if you weren't already.
Developing Mozilla XForms - Archive of obsolete content
debugging always start with a debug b
uild of the xforms and the schema-validation extensions.
... see b
uilding mozilla xforms for a .mozconfig for debug b
uilds.
...then start firefox out of the b
uild directory: cd obj-*/dist/firefox ./firefox -no-remote -jsconsole -p yourprofilename the xforms extension that was b
uilt together with firefox should be already installed.
...to activate this logging output, set the nspr_log_modules environment variable: export nspr_log_modules=schemavalidation:5 this only works on a debug b
uild as described above.
XForms - Archive of obsolete content
see the html forms g
uide for approaches to creating forms in html5.
... xforms essentials an online book giving you a g
uided tour of xforms.
... documentation implementation status implementation status of the mozilla xforms extension b
uilding get started with b
uilding your own xforms extensions from source.
... xforms
ui elements reference xforms user interface elements documentation.
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
for example: :hover {color: red;} this is eq
uivalent to the css2 rule: *:hover {color: red;} ..which translates as "any element that is being hovered should have its foreground colored red." thus, hovering over paragraphs, tables, headings, and any other element in a document will cause text to become red.
... gecko behavior in browsers based on netscape gecko b
uilds later than 20020410 (netscape 6.1+), :hover styles can be applied to any element in a document.
...the most reliable fix is to add the anchor element to the selectors, like this: a:hover {color: red;} a.nav:hover {color: red;} in an attempt to avoid causing problems for legacy documents, browsers based on mozilla 1.0 and later (netscape 7+) include code that causes bare pseudo-classes to be restricted only to links if the document is rendered in "q
uirks" mode.
... in browsers based on the engine found in mozilla 1.3b and later, this q
uirk is extended to cover selectors that combine a bare class selector with the :hover pseudo-class (see bug 169078 for details).
Mozilla's DOCTYPE sniffing - Archive of obsolete content
q
uirks mode.
...the goals that led to choosing this behavior were the following: almost all existing text/html pages on the web that need to be in q
uirks mode to be displayed correctly should be displayed using q
uirks mode.
... q
uirks mode the following trigger q
uirks mode (this list needs to be comprehensive to ensure that pages already existing on the web trigger q
uirks mode): the following sites have been useful in preparing this list: w3c html validator, htmlhelp html validator.
...(this is technically incorrect, since the strings are case sensitive.) see also web development mozilla's q
uirks mode mozilla q
uirks mode behavior original document information author(s): david baron last updated date: august 2, 2005 copyright information: copyright (c) david baron ...
Common causes of memory leaks in extensions - Extensions
document.body.someproperty = leakref; } see also kris maglione's g
uide to cleaning up bootstrapped extensions.
...if the window in question is browser.xul or some long-lived web app such as gmail, the leaked compartment might survive for q
uite some time.
...you may also specify ownsweak = true in the call to nsiobserverservice.addobserver(), but that might req
uire you to properly implement weak references as well.
... services.obs.removeobserver(myobserver, "private-browsing"); } in javascript code modules it recommended to also observe the xpcom-shutdown or q
uit-application notifications and unregister your observers from that topic: var myobserver = { observe: function(subject, topic, data) { if (topic == "xpcom-shutdown") { services.obs.removeobserver(myobserver, "private-browsing"); services.obs.removeobserver(myobserver, "xpcom-shutdown"); } else { // do something with "private-browsing" } } }; services.obs.add...
Desktop gamepad controls - Game development
api status, browser and hardware support the gamepad api is still in working draft status, although browser support is already q
uite good — around 63% global coverage, according to caniuse.com.
... the list of supported devices is also q
uite extensive — most popular gamepads (e.g.
... xbox 360 or ps3) should be s
uitable for web implementations.
...as straightforward — in the update() function, we check to see if the current state status is paused — if so, the relevant actions are enabled: if(gamepadapi.buttons.pressed('start')) { this.managepause(); } if(gamepadapi.buttons.pressed('back')) { this.stateback(); } similarly, when the gameover state status is active, then we can allow the user to restart the game instead of contin
uing it: if(gamepadapi.buttons.pressed('start')) { this.staterestart(); } if(gamepadapi.buttons.pressed('back')) { this.stateback(); } when the game over screen is visible, the start button restarts the game while the back button helps us get back to the main menu.
Desktop mouse and keyboard controls - Game development
note: the captain rogers: battle at andromeda is b
uilt with phaser and managing the controls is phaser-based, but it could also be done in pure javascript.
... phaser approach as i mentioned before you can write everything on your own, but you can also take the advantage of b
uilt-in functions in frameworks like phaser — these will make your life easier and development a lot faster.
...the b
uilt in this.game.input.keyboard object manages the input from the keyboard and has a few helpful methods like addkey() and isdown().
... controlling the game we can support keyboard input in games b
uilt with phaser by enabling the basic cursor keys in the create() function using the createcursorkeys() function: this.cursors = this.input.keyboard.createcursorkeys(); this creates four directional arrow keys for us: this.cursors.left; this.cursors.right; this.cursors.up; this.cursors.down; you can also define the keys on your own and offer an alternative, w a s d control mechanism for example...
Implementing game control mechanisms - Game development
in this series of articles we will show you how you can approach b
uilding a game that can be played using touchscreen smartphones, mouse and keyboard, and also less common mechanisms such as gamepads.
... captain rogers was created using the phaser framework, the most popular tool for simple 2d game development in javascript right now, but it should be fairly easy to reuse the knowledge contained within these articles when b
uilding games in pure javascript or any other framework.
... setting up the environment let's start with a q
uick overview of the game's folder structure, javascript files and in-game states, so we know what's happening where.
...the first one is needed for preloading req
uired assets, create() is executed once the state had started, and update() is executed on every frame.
Implementing controls using the Gamepad API - Game development
api status and browser support the gamepad api is still at the working draft stage in the w3c process, which means its implementation might still change, but saying that the browser support is already q
uite good.
...the theme for the competition was "change", so they submitted a game where you have to feed the hungry fridge by tapping the healthy food (apples, carrots, lettuces) and avoid the "bad" food (beer, burgers, pizza.) a countdown changes the type of food the fridge wants to eat every few seconds, so you have to be careful and act q
uickly.
... demo the full version of the hungry fridge game was b
uilt first, and then to showcase the gamepad api in action and show the javascript source code, a simple demo was created.
... the index variable is useful if we're connecting more than one controller and want to identify them to act accordingly — for example when we have a two-player game req
uiring two devices to be connected.
Visual JS GE - Game development
visual-js gameengine is a small but comprehensive canvas/websocket-based game engine with g
ui source editor only for windows.
... b
uild_from_editor_to_visual_js found at server_instance/b
uild_from_editor_to_visual_js_file.js.
... if you use editor.js to visually create game objects, you must start the b
uild_from_editor_to_visual_js_file.js when you have finished.
... visual js.exe windows g
ui freeware only for windows users.
Effective connection type - MDN Web Docs Glossary: Definitions of Web-related terms
table of effective connection types ect minimum rtt maximum downlink explanation slow-2g 2000ms 50 kbps the network is s
uited for small transfers only such as text-only pages.
... 2g 1400ms 70 kbps the network is s
uited for transfers of small images.
... 3g 270ms 700 kbps the network is s
uited for transfers of large assets such as high resolution images, audio, and sd video.
... 4g 0ms ∞ the network is s
uited for hd video, real-time video, etc.
Packet - MDN Web Docs Glossary: Definitions of Web-related terms
over time the number packets can cause traversing within closed circ
uits, the number of pa ckets circulating would b
uild up and then ultimately lead to the networking in failing.
...the high priority queue is emptied more q
uickly than lower priority queues when the network is congested.
... addresses when routing network packets it req
uires two network addresses the source address of the sending host, and the destination address of the receiving host.
...it is usually of variable length, up to a maximum that is set by the network protocol and sometimes the eq
uipment on the route.
MDN Web Docs Glossary: Definitions of Web-related terms
this glossary provides definitions of words and abbreviations you need to know to successfully understand and b
uild for the web.
...ble caldav call stack callback function canonical order canvas card sorting carddav caret cdn certificate authority certified challenge-response authentication character character encoding character set chrome cia cipher cipher s
uite ciphertext class client hints closure cms code splitting codec compile compile time computer programming conditional constant constructor continuous media control flow cookie copyleft cors cors-safelisted request header ...
... progressive web apps promise property property (css) property (javascript) protocol prototype prototype-based programming proxy server pseudo-class pseudo-element pseudocode public-key cryptography python q quality values quaternion q
uic r rail random number generator raster image rdf real user monitoring (rum) recursion reference reflow regular expression rendering engine repo reporting directive request header resource timing response header responsive web design ...
...ead three js time to first byte time to interactive tld tofu transmission control protocol (tcp) transport layer security (tls) tree shaking trident truthy ttl turn type type coercion type conversion u udp (user datagram protocol)
ui undefined unicode uri url urn usenet user agent utf-8 ux v validator value variable vendor prefix viewport visual viewport voip w w3c wai wcag web performance web server ...
Backgrounds and borders - Learn web development
previous overview: b
uilding blocks next in this lesson, we will take a look at some of the creative things you can do with css backgrounds and borders.
... prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn how to style the background and border of boxes.
... summary we have covered q
uite a lot here, and you can see that there is q
uite a lot to adding a background or a border to a box.
... previous overview: b
uilding blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organi...
Cascade and inheritance - Learn web development
overview: b
uilding blocks next the aim of this lesson is to develop your understanding of some of the most fundamental concepts of css — the cascade, specificity, and inheritance — which control how css is applied to html and how conflicts are resolved.
... prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn about the cascade and specificity, and how inheritance works in css.
... let's start by taking a q
uick look at the key things we are dealing with, then we'll look at each in turn and see how they interact with each other and your css.
... overview: b
uilding blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css or...
Handling different text directions - Learn web development
previous overview: b
uilding blocks next many of the properties and values that we have encountered so far in our css learning have been tied to the physical dimensions of our screen.
... prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to understand the importance of writing modes to modern css.
... the logical properties and values are newer than their physical eq
uivalents, and therefore have only recently been implemented in browsers.
... previous overview: b
uilding blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css or...
Type, class, and ID selectors - Learn web development
previous overview: b
uilding blocks next in this lesson we will take a look at the simplest selectors that are available, which you will probably use the most in your work.
... prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn about the different css selectors we can use to apply css to a document.
...this can be helpful when b
uilding up components that can be combined in different ways on your site.
... previous overview: b
uilding blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css or...
Flexbox - Learn web development
prereq
uisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to learn how to use the flexbox layout system to create web layouts.
... the following simple layout req
uirements are either difficult or impossible to achieve with such tools, in any kind of convenient, flexible way: vertically centering a block of content inside its parent.
...this is q
uite an advanced flexbox feature, and we won't be covering it any further in this article.
... previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's g
uide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
Supporting older browsers - Learn web development
prereq
uisites: html basics (study introduction to html), and an idea of how css works (study introduction to css and styling boxes.) objective: to understand how to provide support for your layouts on older browsers that might not support the features you want to use.
...this also means that there are some outdated articles and tutorials in existence; this useful g
uide helps you check what you are looking at and can also help if you need flex support in very old browsers.
... the g
uide to progressive enhancement in grid layout can help you understand the ie version of the grid, and we have included some additional useful links at the end of this lesson.
... cascading web design with feature queries using feature queries (video) previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's g
uide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
How CSS works - Learn web development
prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, and html basics (study introduction to html.) objective: to understand the basics of how css and html are parsed by the browser, and what happens when a browser encounters css it does not understand.
...based on the selectors it finds, it works out which rules should be applied to which nodes in the dom, and attaches style to them as req
uired (this intermediate step is called a render tree).
...since the only rule available in the css has a span selector, the browser will be able to sort the css very q
uickly!
... this works particularly well when you want to use a value that is q
uite new and not supported everywhere.
Typesetting a community school homepage - Learn web development
prereq
uisites: before attempting this assessment you should have already worked through all the articles in this module.
... use a s
uitable service to generate bulletproof @font-face code for these two fonts.
... give your headings and other element types appropriate font-sizes defined using a s
uitable relative unit.
... give your body text a s
uitable line-height.
How do you set up a local testing server? - Learn web development
prereq
uisites: you need to first know how the internet works, and what a web server is.
...server-side languages (such as php or python) req
uire a special server to interpret the code and deliver the results.
... to run node.js (javascript) server-side code, you'll need to use raw node or a framework b
uilt on top of it.
... to run php server-side code, launch php's b
uilt-in development server: $ cd path/to/your/php/code $ php -s localhost:8000 ...
Example 1 - Learn web development
this is the first example of code that explains how to b
uild a custom form widget.
... basic state html <div class="select"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> css /* --------------- */ /* req
uired styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, ...
...ound: #000; color: #ffffff; } result for basic state active state html <div class="select active"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> css /* --------------- */ /* req
uired styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { ...
...und: #000; color: #ffffff; } result for active state open state html <div class="select active"> <span class="value">cherry</span> <ul class="optlist"> <li class="option highlight">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> css /* --------------- */ /* req
uired styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { ...
Test your skills: Advanced styling - Learn web development
this aim of this skill test is to assess whether you've understood our advanced form styling and
ui pseudo-classes articles.
... we've already provided you with a basic reset to b
uild upon.
... we've already provided you with a basic reset to b
uild upon.
... advanced form styling 3 in our final task for this assessment series, we provide you with a feedback form that is already nicely-styled — you've already seen something similar if you've worked through our
ui pseudo-classes article, and now we want you to come up with your own solution.
HTML basics - Learn web development
it is req
uired preamble.
...html contains 6 heading levels, <h1>–<h6>, although you'll commonly only use 3 to 4 at most: <h1>my main title</h1> <h2>my top level heading</h2> <h3>my subheading</h3> <h4>my sub-subheading</h4> now try adding a s
uitable title to your html page just above your <img> element.
... for example, if we wanted to turn the part of the following paragraph fragment into a list <p>at mozilla, we’re a global community of technologists, thinkers, and b
uilders working together ...
... </p> we could modify the markup to this <p>at mozilla, we’re a global community of</p> <ul> <li>technologists</li> <li>thinkers</li> <li>b
uilders</li> </ul> <p>working together ...
What will your website look like? - Learn web development
note: complex projects need detailed g
uidelines that go into all the details of colors, fonts, spacing between items on a page, appropriate writing style, and so on.
... this is sometimes called a design g
uide, design system, or brand book, and you can see an example at the firefox photon design system.
... note: even on real, complex websites, the design teams usually start out with rough sketches on paper and later on b
uild digital mockups using a graphics editor or web technologies.
... images to choose an image, go to google images and search for something s
uitable.
Define terms with HTML - Learn web development
prereq
uisites: you need to be familiar with how to create a basic html document.
... objective: learn how to introduce new keywords and how to b
uild description lists.
... how to b
uild a description list description lists are just what they claim to be: a list of terms and their matching descriptions (e.g., definition lists, dictionary entries, faqs, and key-value pairs).
... description lists are not s
uitable for marking up dialogue, because conversation does not directly describe the speakers.
Use JavaScript within a webpage - Learn web development
prereq
uisites: you need to be familiar with how to create a basic html document.
...if you already know something about javascript or if you have a background with other programming languages, we suggest you jump directly into our javascript g
uide.
... if you're only looking for simple visual effects, css can often get the job done even more int
uitively.
... learn more <script> <noscript> james edwards' introduction to using javascript accessibly accessibility g
uidelines from w3c ...
Getting started with HTML - Learn web development
prereq
uisites: basic computer literacy, basic software installed, and basic knowledge of working with files.
...both of these lines are eq
uivalent: <a href="http://www.example.com">a link to my example.</a> <a href='http://www.example.com'>a link to my example.</a> make sure you don't mix single quotes and double quotes.
...these two code snippets are eq
uivalent: <p>dogs are silly.</p> <p>dogs are silly.</p> no matter how much whitespace you use inside html element content (which can include one or more space character, but also line breaks), the html parser reduces each sequence of whitespace to a single space when rendering the code.
... literal character character reference eq
uivalent < < > > " " ' ' & & the character reference eq
uivalent could be easily remembered because the text it uses can be seen as less than for '<' , quotation for ' " ' and similarly for others.
Introduction to HTML - Learn web development
get started prereq
uisites before starting this module, you don't need any previous html knowledge, but you should have at least basic familiarity with using computers and using the web passively (i.e., just looking at it and consuming content).
... g
uides this module contains the following articles, which will take you through all the basic theory of html and provide ample opportunity for you to test out some skills.
...this article shows the syntax req
uired to make a link and discusses best practices for links.
... assessments the following assessments will test your understanding of the html basics covered in the g
uides above.
HTML table basics - Learn web development
prereq
uisites: the basics of html (see introduction to html).
...a table allows you to q
uickly and easily look up values that indicate some kind of connection between different types of data, for example a person and their age, or a day of the week, or the timetable for a local swimming pool.
... active learning: creating your first table we've talked table theory enough, so, let's dive into a practical example and b
uild up a simple table.
... the initial markup looks like this: <table> <tr> <th>animals</th> </tr> <tr> <th>hippopotamus</th> </tr> <tr> <th>horse</th> <td>mare</td> </tr> <tr> <td>stallion</td> </tr> <tr> <th>crocodile</th> </tr> <tr> <th>chicken</th> <td>hen</td> </tr> <tr> <td>rooster</td> </tr> </table> but the output doesn't give us q
uite what we want: animals hippopotamus horse mare stallion crocodile chicken hen rooster we need a way to get "animals", "hippopotamus", and "crocodile" to span across two columns, and "horse" and "chicken" to span downwards over two rows.
Client-side web APIs - Learn web development
when writing client-side javascript for web sites or applications, you will q
uickly encounter application programming interfaces (apis).
... get started prereq
uisites to get the most out of this module, you should have worked your way through the previous javascript modules in the series (first steps, b
uilding blocks, and javascript objects).
... g
uides introduction to web apis first up, we'll start by looking at apis from a high level — what are they, how do they work, how do you use them in your code, and how are they structured?
... third party apis the apis we've covered so far are b
uilt into the browser, but not all apis are.
Handling text — strings in JavaScript - Learn web development
prereq
uisites: basic computer literacy, a basic understanding of html and css, an understanding of what javascript is.
...try the following: let mystring = '123'; let mynum = number(mystring); typeof mynum; conversely, every number has a method called tostring() that converts it to the eq
uivalent string.
...note that this also req
uires knowledge from the next article, so you might want to read that first.
...in the next article, we'll b
uild on this, looking at some of the b
uilt-in methods available to strings in javascript and how we can use them to manipulate our strings into just the form we want.
What went wrong? Troubleshooting JavaScript - Learn web development
previous overview: first steps next when you b
uilt up the "guess the number" game in the previous article, you may have found that it didn't work.
... prereq
uisites: basic computer literacy, a basic understanding of html and css, an understanding of what javascript is.
... okay, so it's not q
uite that simple — there are some other differentiators as you drill down deeper.
...definitely not q
uite how we want the game to play out!
Adding features to our bouncing balls demo - Learn web development
prereq
uisites: before attempting this assessment you should have already worked through all the articles in this module.
... this assessment is q
uite challenging.
...we also want to test your object-b
uilding skills by creating a generic shape() object that our balls and evil circle can inherit from.
... previous overview: objects in this module object basics object-oriented javascript for beginners object prototypes inheritance in javascript working with json data object b
uilding practice adding features to our bouncing balls demo ...
JavaScript — Dynamic client-side scripting - Learn web development
get started prereq
uisites javascript is arguably more difficult to learn than related technologies such as html and css.
... after getting familiar with the basics of javascript, you should be in a position to learn about more advanced topics, for example: javascript in depth, as taught in our javascript g
uide web apis modules this topic contains the following modules, in a suggested order for working through them.
... javascript b
uilding blocks in this module, we continue our coverage of all javascript's key fundamental features, turning our attention to commonly-encountered types of code block such as conditional statements, loops, functions, and events.
... introducing javascript objects in javascript, most things are objects, from core javascript features like strings and arrays to the browser apis b
uilt on top of javascript.
CSS performance optimization - Learn web development
the browser can paint the page once it has downloaded the css and b
uilt the css object model.
... browsers follow a specific rendering path: paint only occurs after layout, which occurs after the render tree is created, which in turn req
uires both the dom and the cssom trees.
... to optimize the cssom construction, remove unnecessary styles, minify, compress and cache it, and split css not req
uired at page load into additional files to reduce css render blocking.
... will-change property the css will-change property tells browsers which properties of an element are expected to change enabling browsers to set up optimizations before the element is actually changed, improving performance by doing potentially expensive work before it is req
uired.
Ember app structure and componentization - Learn web development
prereq
uisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line.
... when you save application.hbs, the development server you started earlier will automatically reb
uild the app and refresh the browser.
... looking at the code next to the rendered todo app, there are a number of ways we could decide how to break up the
ui, but let's plan on splitting the html out into the following components: the component groupings are as follows: the main input / "new-todo" (red in the image) the containing body of the todo list + the mark-all-complete button (purple in the image) the mark-all-complete button, explicitly highlighted for reasons given below (yellow in the image) each todo is an individual compone...
...later on we'll add the req
uired dynamic functionality such as data bindings, responding to user interaction, etc.
Vue conditional rendering: editing existing todos - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line.
...n type="button" class="btn" @click="oncancel"> cancel <span class="visually-hidden">editing {{label}}</span> </button> <button type="submit" class="btn btn__primary"> save <span class="visually-hidden">edit for {{label}}</span> </button> </div> </form> </template> <script> export default { props: { label: { type: string, req
uired: true }, id: { type: string, req
uired: true } }, data() { return { newlabel: this.label }; }, methods: { onsubmit() { if (this.newlabel && this.newlabel !== this.label) { this.$emit("item-edited", this.newlabel); } }, oncancel() { this.$emit("edit-cancelled"); } } }; </script> <style scoped> .edit-label {...
...v-if also has corresponding v-else-if and v-else directives to provide the eq
uivalent of javascript else if and else logic inside vue templates.
... fixing this is fortunately q
uite easy — we can do this by converting our isdone data item into a computed property — another advantage of computed properties is that they preserve reactivity, meaning (among other things) that their state is saved when the template changes like ours is now doing.
Adding a new todo form: Vue events, methods, and models - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line.
...eq
uivalent to event.stoppropagation() in regular javascript events.
...eq
uivalent to event.preventdefault().
... .passive: eq
uivalent to using the { passive: true } parameter when creating an event listener in vanilla javascript using addeventlistener().
Rendering a list of Vue components - Learn web development
prereq
uisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line.
...this is a b
uilt-in vue directive that lets us include a loop inside of our template, repeating the rendering of a template feature for each item in an array.
... make it req
uired, and make its type a string.
... the <script> contents in your todoitem component should now look something like this: export default { props: { label: {req
uired: true, type: string}, done: {default: false, type: boolean}, id: {req
uired: true, type: string} }, data() { return { isdone : this.done, } }, } now, over in your app.vue component, pass item.id as a prop to the todoitem component.
Bugzilla
bugzilla etiquette a g
uide to etiquette; this g
uide will help you understand how best to conduct yourself on b.m.o.
...this g
uide will help you do so.
... other materials an introduction to bugzilla bugzilla for humans bugzilla q
uicksearch help page.
... q
uicksearch is a q
uick, easy, and very effective way of q
uickly querying bugzilla.
Creating a Login Manager storage module
extensions can replace the b
uilt-in password storage with their own implementation.
... overriding the b
uilt-in login manager storage consists of two tasks: implement the nsiloginmanagerstorage interface.
...see how_to_b
uild_an_xpcom_component_in_javascript for more details about javascript components.
...unction sampleloginmanagerstorage() {} sampleloginmanagerstorage.prototype = { classdescription: "sample nsiloginmanagerstorage implementation", contractid: "@example.com/login-manager/storage/sample;1", classid: components.id("{364a118c-747a-4f6d-ac63-2d2998e5a5c1}"), queryinterface: xpcomutils.generateqi([ci.nsiloginmanagerstorage]), // this registers the category for overriding the b
uilt-in nsiloginmanagerstorage _xpcom_categories: [ { category: "login-manager-storage", entry: "nsiloginmanagerstorage" } ], // console logging service, used for debugging.
Creating Sandboxed HTTP Connections
it is usually best to use a javascript wrapper that implements all the req
uired methods and calls the specified callback function when the connection has completed.
... aiid.equals(components.interfaces.nsiinterfacerequestor) || aiid.equals(components.interfaces.nsichanneleventsink) || aiid.equals(components.interfaces.nsiprogresseventsink) || aiid.equals(components.interfaces.nsihttpeventsink) || aiid.equals(components.interfaces.nsistreamlistener)) return this; throw components.results.ns_nointerface; } }; q
uick note: storing the channel in a global (especially in an extension) isn't a good idea, but was done to make the code easier to read.
... these methods provide all the req
uired functionality needed to modify cookies before they are processed/sent, allowing for sandboxed cookie connections that don't affect the user's cookies.
...ke before, the nsiioservice is used: var referreruri = ioservice.newuri(referrerurl, null, null); next, the nsichannel is qied to nsihttpchannel and the referrer property is set to the generated nsiuri: var httpchannel = channel.queryinterface(components.interfaces.nsihttpchannel); httpchannel.referrer = referreruri; creating http posts to create an http post, a few additional steps are req
uired after the nsichannel is created.
Gmake vs. Pymake
mozilla supports b
uilding with two different (but mostly compatible) b
uild tools: gmake and pymake.
... if you try to switch from gmake to pymake or pymake to gmake the b
uild will fail unless you did a relative configure.
...for example, if using the default objdir, you might type in the root of your source tree: mkdir obj-i686-pc-mingw32; cd obj-i686-pc-mingw32; python ../b
uild/pymake/make.py -f ../client.mk.
... note that typing "python b
uild/pymake/make.py -f client.mk" does not trigger a relative configure.
Commenting IDL for better documentation
but by following the g
uidelines here, you can help make sure that our tools can generate a "good start" version of the documentation for your interfaces, and that the writers will be able to easily figure out what the tools are not able to do automatically.
...using these will help generate much higher quality documentation, faster, with less human intervention req
uired.
...[scriptable, u
uid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)] interface nsicookiemonster : nsicookiefan { // cookie flavor constants /** * simple sugar cookie.
... */ [noscript] void sayyummy(in astring language); }; in conclusion with just a little extra help from you, the intrepid developer, the documentation team can crank out full, formatted documentation for your interface much more q
uickly and accurately.
Cross Process Object Wrappers
this is because the chrome process runs the firefox
ui, so if it were blocked by the content process, then a slow content process could cause firefox to become unresponsive to users.
... chrome responsiveness the lack of a synchronous api on the chrome side is intentional: because the chrome process runs the firefox
ui, any responsiveness problems affect the whole browser.
...in multiprocess firefox, the browser
ui is still responsive, because it's running in a different process.
...suddenly, what looked like a simple property access could block the
ui for a noticeable amount of time: there is one scenario, though, in which this is not a problem: when the content process is already blocking on a synchronous message it sent to the chrome process.
Browser API
browser api interfaces to support the req
uirement of a browser <iframe>, the htmliframeelement dom interface has been extended with new methods that give the <iframe> some super powers.
...this allows handling of the <men
uitem> element available within the browser <iframe>'s content.
... mozbrowseropentab sent when a new tab is opened within a browser <iframe> as a result of the user iss
uing a command to open a link target in a new tab (for example ctrl/cmd + click.) mozbrowserresize sent when the browser <iframe>'s window size has changed.
... mozbrowserusernameandpasswordreq
uired sent when an http authentification is requested.
Gecko's "Almost Standards" Mode
this is added to the long-standing "q
uirks" and "standards" modes.
... "almost standards" rendering mode is exactly the same as "standards" mode in all details save one, where it works like "q
uirks" mode: the height calculations for line boxes and some of the inline elements in them.
...this means that sliced-images-in-tables layouts are less likely to fall apart in gecko-based browsers based on the rendering engine found in mozilla 1.0.1 or later when in either "q
uirks" or "almost standards" mode.
... also on mdc images, tables, and mysterious gaps mozilla's doctype sniffing mozilla's q
uirks mode original document information author(s): eric a.
How to get a stacktrace with WinDbg
(to get a stacktrace for thunderbird or some other product, substitute the product name where ever you see firefox in this instructions.) req
uirements to get such a stacktrace you need to install the following software: debugging tools for windows microsoft distributes the debugging tools for windows for free, those include windbg which you will need here.
...you can use any official nightly b
uild or released version of firefox from mozilla.
... you can find the latest trunk nightly b
uilds under http://ftp.mozilla.org/pub/mozilla.o.../latest-trunk/.
... copying and pasting each line is the easiest method to avoid mistakes some commands start with a period (.) or a pipe character (|), which is req
uired.
Creating a New Protocol
this is a q
uick-start on details of how to add a new ipdl protocol to the b
uild.
...to hook up the file to the b
uild, you need to add your ipdl file to ipdl_sources in the nearest moz.b
uild file.
... see dom/ipc/moz.b
uild for an example.
...b
uilding the new protocol to b
uild the new protocol declaration and generate headers, make in ipc/ipdl: make -c objdir/ipc/ipdl if there are any protocol-level errors, the ipdl compiler will print the relevant error messages and stop.
PBackground
pbackground is a mechanism available since gecko 30 (see bug 956218) that b
uilds on top of ipdl to provide a solution to common problems that arise when handling multiple threads in the chrome process, for example communication between workers and multiple child processes and other parent-process worker threads.
...at b
uild time the ipdl compiler automatically generates a large amount of c++ glue code from the ipdl files.
...this has lead to a rather awkward pattern seen in some parts of the gecko codebase, looking something like this (try searching for geckoprocesstype_default in dxr): if (xre_getprocesstype() == geckoprocesstype_default) { dothething(arguments); } else { mipdlprotocol->senddothething(arguments); } this can get unwieldy very q
uickly, so a better solution was needed.
... examples indexeddb was reb
uilt on top of pbackground last year.
AddonType
they are mostly used to help the
ui know how to display the different types of add-on.
...
uipriority integer a number used to determine the order of types displayed in the user interface.
... b
uilt-in values: value category 2000 locale 4000 extension 5000 theme 6000 plugin viewtype integer the type of
ui to use to display this type of add-on in the
ui.
... if undefined the type will not appear in the
ui.
L10n testing with xcode
follow the cloning and b
uilding instructions for firefox on ios.
...this g
uide should help.
...the accessibility inspector remains active until you turn it off, even if you q
uit and restart ios simulator.
... now, you can navigate through the firefox app in the ios simulator, viewing both
ui elements and accessibility strings as you go.
Release phase
here, we'll continue to stay true to the original intent of this g
uide and only present you with the technical information you need to become an official release.
...the output will look something like this: comparing with ssh://hg.mozilla.org/releases/l10n-central/x-testing searching for changes changeset: 0:7c543e8f3a6a tag: tip user: your name <email@example.com> date: mon nov 23 18:08:25 2009 +0100 summary: added search bar strings make sure this output is accurate before contin
uing.
...next, try iss
uing the following command: $ ssh hg.mozilla.org if ssh is working fine, you should see the following message: no interactive shells allowed here!
...you need to make sure that your work can effectively be compiled into a b
uild for the next release channel.
MathML In Action
download a mathml-enabled mozilla b
uild to remedy this sad situation.
... you already have a mathml-enabled b
uild but what you see on the screenshot is not what you get?
...now that you are well-eq
uipped, you should be able to see this inline equation with varying accents: x ^ + xy ^ + xyz ^ .
... - z ) θ ( e k 2 π i - z ) θ ( - ( α k + 1 ) z ) ) π ( n ) = ∑ m = 2 n ⌊ ( ∑ k = 1 m - 1 ⌊ ( m / k ) / ⌈ m / k ⌉ ⌋ ) - 1 ⌋ ‖ ϕ ‖ w s k ( Ω g ) ≝ ( ∑ | α | ≦ k ∂ α ϕ ∂ ξ α l s ( Ω g ) s ) 1 / s for more examples, refer to links on the mathml project page, and if you are b
uilding your own mozilla binary, see the directory mozilla/layout/mathml/tests.
JS::PerfMeasurement
tions .branch_instructions branch instructions executed ::branch_misses .branch_misses branch instructions that were not predicted correctly ::bus_cycles .bus_cycles total memory bus cycles ::page_faults .page_faults total page-fault exceptions fielded by the os ::major_page_faults .major_page_faults page faults that req
uired disk access ::context_switches .context_switches context switches involving the profiled thread ::cpu_migrations .cpu_migrations migrations of the profiled thread from one cpu core to another these events map directly to "generic events" in the linux 2.6.31+ <linux/perf_event.h> interface, and so unfortunately are a little vague in their specification; ...
...static bool perfmeasurement::canmeasuresomething() this class method returns true if and only if some -- not necessarily all -- events can be measured by the current b
uild of spidermonkey, running on the current os.
... all the counter variables for events that are not being measured will have the fixed value (
uint64)-1.
...
uint64 cpu_cycles,
uint64 instructions, etc.
Profiling with Instruments
official apple documentation instruments user g
uide instruments user reference instruments help articles instruments help performance overview basic usage select "time profiler" from the "choose a profiling template for:" dialog.
...the call tree view can be q
uite helpful here.
...currently this means you need to b
uild with jemalloc disabled (ac_add_options --disable-jemalloc).
... you also need the fix to bug 719427 the dtperformancesession api can be used to control profiling from applications like the old chud api we use in shark b
uilds.
TimerFirings logging
timerfirings logging is a feature b
uilt into gecko that prints a line of data for every timer fired.
... invocation timerfirings logging uses gecko's own logging mechanism, and so is able to be used in any b
uild.
... post-processing timerfirings logging q
uickly produces thousands of lines of output.
...50 ms): [content] http://static.dynamicyield.com/scripts/12086/dy-min.js?v=12086:3:3389 94 801266240[7f7c1f248000]: [7163] fn timer (one_shot 50 ms): [content] https://ad.doubleclick.net/ddm/adi/n7921.1283839cadreon.com.au/b9038144.122190976;sz=300x600;click=http://pixel.mathtag.com/click/img?mt_aid=2744535504761193354&mt_id=1895890&mt_adid=148611&mt_sid=973379&mt_exid=9&mt_inapp=0&mt_u
uid=353d5460-19f6-4400-9bbd-d0fcc3bcf595&mt_3pck=http%3a//beacon-apac-hkg1.rubiconproject.com/beacon/t/d1f9921d-4e47-448f-b6ba-36cae1c31b65/&redirect=;ord=2744535504761193354?:83:0 94 801266240[7f7c1f248000]: [7163] fn timer (one_shot 160 ms): nsbrowserstatusfilter::timeouthandler 92 -495057024[7f74e105ba00]: [7108] fn timer (one_shot 160 ms): nsbrowserstatusfilter::timeouthandle...
Preferences
mozilla preference reference a reference g
uide to all mozilla preferences; currently a work in progress.
... a brief g
uide to mozilla preferences an introductory g
uide to where preferences are stored and other useful information about the core preference system.
... mozilla networking preferences a g
uide to key networking-related preferences.
... mozilla preferences for uber-geeks a g
uide to preferences that only truly elite geeks should play with.
Research and prep
this is, therefore, meant to be a g
uideline for how you should be formulating your recommendations.
... ensure that your suggestions follow these parameters: search there are typically five search plug-ins listed for firefox desktop (only four for firefox mobile): generic search the default option should expose the q
uickest path to the best result on the world wide web for the user (indexing a large portion of the global www).
... e-commerce search these search engines should allow users to get connected to new and used products they want to buy as q
uickly and painlessly as possible in a "trusted" site -- for example, choosing the most popular auction, general shopping, or classified type sites that have the desired user experience are good choices.
...your selections for default rss readers and content handlers should follow these g
uidelines: be translated in your language (because it makes the application unusable if it's not in your language provide for the intended user experience (e.g., minimal to no advertisements within the user experience) no more than three (if possible) choices.
Profile Manager
firefox provides a b
uilt-in applet to manage these profiles, but it will eventually be going away (see bug 214675), so a new standalone profile manager application has been created, which works with any xulrunner application, and has many features not found in firefox's b
uilt-in version.
... downloading binaries you can download profile manager b
uilds from https://ftp.mozilla.org/pub/mozilla.org/utilities/profilemanager/1.0/ note: there is no installer; just extract the files from the archive.
... system req
uirements: mac: an intel processor, i386 or x86_64 linux: any version capable of running firefox 4.0 windows: xp or later source code you can download the source as well: hg clone http://hg.mozilla.org/automation/profilemanager/ instructions for b
uilding can be found in b
uild.txt.
... profile manager does not track these backups in the
ui, but using profile archives is an easy way to move profiles between machines.
L20n Javascript API
if you don't call this function, l20n will use the b
uilt-in intl.prioritizelocales negotiator.
...in this case, addresource(string) and linkresource(string) might be better s
uited for adding resources.
...these errors include: context.runtimeerror, when an entity is missing or broken in all supported locales; in this case, l20n will show the the best available fallback of the requested entity in the
ui: the source string as found in the resource, or the identifier.
... localize should be the preferred way of localizing the
ui.
Memory Management Operations
libraries b
uilt on top of nspr, such as the netscape security libraries, use these functions to allocate and free memory.
... if you are allocating memory for use by such libraries or freeing memory that was allocated by such libraries, you must use these nspr functions rather than the libc eq
uivalents.
... memory allocation functions are: pr_malloc pr_calloc pr_realloc pr_free pr_malloc(), pr_calloc(), pr_realloc(), and pr_free() have the same signatures as their libc eq
uivalents malloc(), calloc(), realloc(), and free(), and have the same semantics.
... (note that the argument type size_t is replaced by pr
uint32.) memory allocated by pr_malloc(), pr_calloc(), or pr_realloc() must be freed by pr_free().
FIPS Mode - an explanation
it req
uires that all cryptography done by us government personnel must be done in "devices" that have been independently tested, and certified by nist, to meet the extensive req
uirements of that document.
... these req
uirements have several implications for users.
... the user is only req
uired to enter his master password to use his own private keys (if he has any) or to access his stored web-site passwords.
... the user is not req
uired to enter the master password to visit ordinary https servers, nor to view certificates he has previously stored.
HTTP delegation
this causes ocsp requests to fail if the network environment req
uires the use of a proxy.
...nss may choose to repeatedly call a "network connection keep alive" function (sec_httpserver_keepalivesessionfcn) on the server session object, giving application code a chance to do whatever is req
uired.
...(when iss
uing get requests, the "?query-string=data" portion should already be appended to the request path) after creation, nss might call functions to provide additional details of the http request (e.g.
...now that we have explained the interaction between nss, the callback functions and the application, let's look at the steps req
uired by the application to initially register the callbacks.
JSS FAQ
setcipherpolicy does not need to be called by a jss app unless that app wants to limit itself to export-allowed cipher s
uites.
...windows distinction and provides different nt and windows b
uilds.
... many netscape products, including nss, have nt and windows b
uilds that are essentially the same except one difference: one is linked with the nt version of nspr and the other is linked with the windows version of nspr.
...either use the win 95 version of nspr/nss/jss components (essentially all non-fiber b
uilds) or set the environment variable nspr_native_threads_only=1.
JSS Provider Notes
sun therefore req
uires that jar files implementing jce algorithms be digitally signed by an approved organization.
... netscape has this approval and signs the official b
uilds of jss32.jar.
... if you b
uild jss yourself from source instead of using binaries downloaded from mozilla.org, your jar file will not have a valid signature.
...there is no good design reason for this difference, but it is necessitated by a q
uirk in the nss implementation.
Mozilla-JSS JCA Provider notes
jre therefore req
uires that jar files implementing jce algorithms be digitally signed by an approved organization.
... the maintainers of jss, sun, red hat, and mozilla, have this approval and signs the official b
uilds of jss4.jar.
...if you b
uild jss yourself from source instead of using binaries downloaded from mozilla.org, your jar file will not have a valid signature.
...there is no good design reason for this difference, but it is necessitated by a q
uirk in the nss implementation.
JSS 4.4.0 Release Notes
jss 4.4.0 req
uires netswork security services (nss) 3.29.1 and netscape portable runtime (nspr) 4.13.1 or newer.
... bugs fixed in jss 4.4.0 this bugzilla query returns all the bugs fixed in nss 4.4.0: https://bugzilla.mozilla.org/buglist.cgi?product=jss&target_milestone=4.4&target_milestone=4.4&bug_status=resolved&resolution=fixed documentation b
uild instructions for jss at https://hg.mozilla.org/projects/jss/file/tip/readme platform information you can check out the source from mercurial via hg clone -r 055aa3ce8a61 https://hg.mozilla.org/projects/jss jss 4.4.0 works with openjdk versions 1.7 or higher we suggest the latest - openjdk 1.8.
... jss 4.4.0 req
uires nss 3.12.5 or higher though nss 3.28.3 is recommended.
... jss 4.3.1 req
uires nspr 4.7.1 or higher though nspr 3.13 is recommended.
NSS Key Log Format
note: starting with nss 3.24 (used by firefox 48 and 49 only), the sslkeylogfile approach is disabled by default for optimized b
uilds using the makefile (those using gyp via b
uild.sh are not affected).
... the hex-encoded handshake traffic secret for the server side (for tls 1.3) client_traffic_secret_0: the first hex-encoded application traffic secret for the client side (for tls 1.3) server_traffic_secret_0: the first hex-encoded application traffic secret for the server side (for tls 1.3) early_exporter_secret: the hex-encoded early exporter secret (for tls 1.3, used for 0-rtt keys in older q
uic drafts).
... exporter_secret: the hex-encoded exporter secret (for tls 1.3, used for 1-rtt keys in older q
uic drafts) the rsa form allows ciphers
uites using rsa key-agreement to be logged and was the first form supported by wireshark 1.6.0.
...the size of the hex-encoded secret depends on the selected cipher s
uite.
NSS 3.12.9 release notes
nss 3.12.9 req
uires nspr 4.8.7.
... see the documentation section for the b
uild instructions.
... you also need to download the nspr 4.8.7 binary distributions to get the nspr 4.8.7 header files and shared libraries, which nss 3.12.9 req
uires.
...new and revised documents available since the release of nss 3.11 include the following:</for> b
uild instructions for nss 3.11.4 and above nss shared db compatibility nss 3.12.9 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.14.1 release notes
nss 3.14.1 req
uires nspr 4.9.4 or newer.
...however, when authenticating with such tokens, it was possible for an internal lock to be acq
uired twice, causing a hang.
... bug 611451 - when b
uilt with the current version of apple xcode on mac os x, the nss shared libraries will now only export the public nss functions.
... bug 810582 - tls false start is now only used with servers that negotiate a cipher s
uite that supports forward secrecy.
NSS 3.15.1 release notes
hmac-sha256 cipher s
uites (rfc 5246 and rfc 5289) are supported, allowing tls to be used without md5 and sha-1.
... aes gcm cipher s
uites are not yet supported.
... tls_dhe_rsa_with_aes_256_cbc_sha256, tls_rsa_with_aes_256_cbc_sha256, tls_ecdhe_ecdsa_with_aes_128_cbc_sha256, tls_ecdhe_rsa_with_aes_128_cbc_sha256, tls_dhe_rsa_with_aes_128_cbc_sha256, tls_rsa_with_aes_128_cbc_sha256, tls_rsa_with_null_sha256 - new tls 1.2 only hmac-sha256 cipher s
uites.
... the nss_survive_double_bypass_failure b
uild option is removed.
NSS 3.15.2 release notes
new in nss 3.15.2 new functionality aes-gcm ciphers
uites: aes-gcm cipher s
uite (rfc 5288 and rfc 5289) support has been added when tls 1.2 is negotiated.
... specifically, the following cipher s
uites are now supported: tls_ecdhe_ecdsa_with_aes_128_gcm_sha256 tls_ecdhe_rsa_with_aes_128_gcm_sha256 tls_dhe_rsa_with_aes_128_gcm_sha256 tls_rsa_with_aes_128_gcm_sha256 new functions pk11_cipherfinal has been introduced, which is a simple alias for pk11_digestfinal.
...new pkcs #11 mechanisms no new pkcs#11 mechanisms have been introduced notable changes in nss 3.15.2 bug 880543 - support for aes-gcm ciphers
uites that use the sha-256 prf bug 663313 - md2, md4, and md5 signatures are no longer accepted for ocsp or crls, consistent with their handling for general certificate signatures.
...it is no longer necessary to call nss_setdomesticpolicy because all cipher s
uites are now allowed by default.
NSS 3.15.4 release notes
nss 3.15.4 req
uires nspr 4.10.2 or newer.
...notable changes in nss 3.15.4 reordered the cipher s
uites offered in ssl/tls client hello messages to match modern best practices.
... when b
uilding on windows, os_target now defaults to win95.
... to use the winnt b
uild configuration, specify os_target=winnt.
NSS 3.21 release notes
nss 3.21 req
uires nspr 4.10.10 or newer.
...ptionget to set or get the minimum dh key size nss_dsa_min_key_size - used with nss_optionset and nss_optionget to set or get the minimum dsa key size in pkcs11t.h ckm_tls12_master_key_derive - derives tls 1.2 master secret ckm_tls12_key_and_mac_derive - derives tls 1.2 traffic key and iv ckm_tls12_master_key_derive_dh - derives tls 1.2 master secret for dh (and ecdh) cipher s
uites ckm_tls12_key_safe_derive and ckm_tls_kdf are identifiers for additional pkcs#12 mechanisms for tls 1.2 that are currently unused in nss.
...d ssl_error_unexpected_extended_master_secret - error code for receiving an extended master secret when previously not negotiated in sslt.h ssl_enable_extended_master_secret - configuration to enable the tls extended master secret extension (rfc 7627) ssl_preinfo_version - used with sslpreliminarychannelinfo to indicate that a tls version has been selected ssl_preinfo_cipher_s
uite - used with sslpreliminarychannelinfo to indicate that a tls cipher s
uite has been selected ssl_preinfo_all - used with sslpreliminarychannelinfo to indicate that all preliminary information has been set notable changes in nss 3.21 nss now b
uilds with elliptic curve ciphers enabled by default (bug 1205688) nss now b
uilds with warnings as errors (bug 1182667) the following ca cert...
...(c) kasım 2005 sha-1 fingerprint: b4:35:d4:e1:11:9d:1c:66:90:a7:49:eb:b3:94:bd:63:7b:a7:82:b7 the following ca certificate had the websites trust bit turned off ou = eq
uifax secure certificate authority sha1 fingerprint: d2:32:09:ad:23:d3:14:23:21:74:e4:0d:7f:9d:62:13:97:86:63:3a the following ca certificates were added cn = certification authority of wosign g2 sha1 fingerprint: fb:ed:dc:90:65:b7:27:20:37:bc:55:0c:9c:56:de:bb:f2:78:94:e1 cn = ca wosign ecc root sha1 fingerprint: d2:7a:d2:be:ed:94:c0:a1...
NSS 3.23 release notes
nss 3.23 req
uires nspr 4.12 or newer.
... nss 3.23 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_23_rtm/src/ new in nss 3.23 new functionality chacha20/poly1305 cipher and tls cipher s
uites now supported (bug 917571, bug 1227905) experimental-only support tls 1.3 1-rtt mode (draft-11).
... notable changes in nss 3.23 the copy of sqlite shipped with nss has been updated to version 3.10.2 (bug 1234698) the list of tls extensions sent in the tls handshake has been reordered to increase compatibility of the extended master secret with servers (bug 1243641) the b
uild time environment variable nss_enable_zlib has been renamed to nss_ssl_enable_zlib (bug 1243872).
... the b
uild time environment variable nss_disable_chachapoly was added, which can be used to prevent compilation of the chacha20/poly1305 code.
NSS 3.27.2 Release Notes
nss 3.27.2 req
uires nspr 4.13 or newer.
... notable changes in nss 3.27.2 the ssl_settrustanchors() function is used to set the disting
uished names that an nss server includes in its tls certificaterequest message.
... if this function is not used, nss will include the disting
uished names for all trust anchors installed in the database.
... previous versions of nss leaked the memory used to store disting
uished names when ssl_settrustanchors() was used.
NSS 3.40 release notes
nss 3.40 req
uires nspr 4.20 or newer.
... this is a c++ library for b
uilding certification paths.
... mozilla::pkix apis are not exposed in the libraries nss b
uilds.
... it is easier to b
uild nss on windows in mozilla-b
uild environments.
NSS 3.44 release notes
nss 3.44 req
uires nspr 4.21 or newer.
... notable changes in nss 3.44 it is now possible to b
uild nss as a static library (bug 1543545) initial support for b
uilding for ios.
... bugs fixed in nss 3.44 1501542 - implement checkarmsupport for android 1531244 - use __b
uiltin_bswap64 in crypto_primitives.h 1533216 - cert_decodecertpackage() crash with netscape certificate sequences 1533616 - sdb_getattributevaluenolock should make at most one sql query, rather than one for each attribute 1531236 - provide accessor for certcertificate.dercert 1536734 - lib/freebl/crypto_primitives.c assumes a big endian machine 1532384 - in nss test certificates, use @example.com (not @bogus.com) 1538479 - post-handshake messages after async server authentication break when using record layer separation 1521578 - x25519 support in pk11pars.c 1540205 - freebl b
uild fails with -dnss_disable_chachapoly 1532312 - post-handshake auth doesn't interoperate with openssl 1542741 ...
...- certutil -f crashes with segmentation fault 1546925 - allow preceding text in try comment 1534468 - expose chacha20 primitive 1418944 - quote cc/cxx variables passed to nspr 1543545 - allow to b
uild nss as a static library 1487597 - early data that arrives before the handshake completes can be read afterwards 1548398 - freebl_gtest not b
uilding on linux/mac 1548722 - fix some coverity warnings 1540652 - softoken/sdb.c: logically dead code 1549413 - android log lib is not included in b
uild 1537927 - ipsec usage is too restrictive for existing deployments 1549608 - signature fails with dbm disabled 1549848 - allow b
uilding nss for ios using gyp 1549847 - nss's sqlite compilation warnings make the b
uild fail on ios 1550041 - freebl not b
uilding on ios simulator 1542950 - macos ...
NSS 3.45 release notes
nss 3.45 req
uires nspr 4.21 or newer.
... new in nss 3.45 new functionality new functions in pk11pub.h: pk11_findrawcertswithsubject - finds all certificates on the given slot with the given subject disting
uished name and returns them as der bytes.
...only relevant for clients that might have copied the unit test code verbatim bug 1550022 - ensure nssutil3 gets b
uilt on android bug 1528174 - chacha20poly1305 should no longer modify output length on failure bug 1549382 - don't leak in pkcs#11 modules if c_getslotinfo() returns error bug 1551041 - fix b
uilds using gcc < 4.3 on big-endian architectures bug 1554659 - add versioning to openbsd b
uilds to fix link time errors using nss bug 1553443 - send session ticket only after handshake is marked as f...
...inished bug 1550708 - fix gyp scripts on solaris sparc so that libfreebl_64fpu_3.so b
uilds bug 1554336 - optimize away unneeded loop in mpi.c bug 1559906 - fipstest: use ckm_tls12_master_key_derive instead of vendor specific mechanism bug 1558126 - tls_aes_256_gcm_sha384 should be marked as fips compatible bug 1555207 - helloretryrequestcallback return code for rejecting 0-rtt bug 1556591 - eliminate races in uses of pk11_setwrapkey bug 1558681 - stop using a global for anti-replay of tls 1.3 early data bug 1561510 - fix a bug where removing -arch xxx args from cc didn't work bug 1561523 - add a string for the new-ish error ssl_error_missing_post_handshake_auth_extension this bugzilla query returns all the bugs fixed in nss 3.45: https://bugzilla.mozilla.org/buglist.cgi?resolutio...
NSS 3.49 release notes
nss 3.49 req
uires nspr 4.24 or newer.
... notable changes in nss 3.49 the legacy dbm database, libnssdbm, is no longer b
uilt by default when using gyp b
uilds.
... bug 1606025 - remove -wmaybe-uninitialized warning in sslsnce.c bug 1606119 - fix ppc hw crypto b
uild failure bug 1605545 - memory leak in pk11install_platform_generate bug 1602288 - fix b
uild failure due to missing posix signal.h bug 1588714 - implement checkarmsupport for win64/aarch64 bug 1585189 - nss database uses 3des instead of aes to encrypt db entries bug 1603257 - fix ubsan issue in softoken ckm_nss_chacha20_ctr initialization bug 1590001 - additional hrr tests (cve-2019-17023) bug 1600144 - treat clienthello with message_seq of 1 as a second clienthello bug 1603027 - test that esni is regenerated after helloretryrequest bug 1593167 - int...
...ermittent mis-reporting potential security risk sec_error_unknown_issuer bug 1535787 - fix automation/release/nss-release-helper.py on macos bug 1594933 - disable b
uilding dbm by default bug 1562548 - improve gcm perfomance on aarch32 this bugzilla query returns all the bugs fixed in nss 3.49: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.49 compatibility nss 3.49 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS Config Options
24..." only the specified hashes and curves will be allowed: config="disallow=all allow=sha1:sha256:secp256r1:secp384r1" only the specified hashes and curves will be allowed, and rsa keys of 2048 or more will be accepted, and dh key exchange with 1024-bit primes or more: config="disallow=all allow=sha1:sha256:secp256r1:secp384r1:min-rsa=2048:min-dh=1024" a policy that enables the aes ciphers
uites and the secp256/384 curves: config="allow=aes128-cbc:aes128-gcm::hmac-sha1:sha1:sha256:sha384:rsa:ecdhe-rsa:secp256r1:secp384r1" turn off md5 config="disallow=md5" turn off md5 and sha1 only for ssl config="disallow=md5(ssl):sha1(ssl)" disallow values are parsed first, and then allow values, independent of the order in which they appear.
... future key words (not yet implemented): enable: turn on ciphers
uites by default.
... disable: turn off ciphers
uites by default without disallowing them by policy.
... ssl-default-lock: turn off the ability for applications to change cipher s
uite states with ssl_enablecipher, ssl_disablecipher.
NSS Sample Code Sample1
the primary host unwraps the key using the rsa key each time // access to the key is req
uired, such as at server startup.
...// the secondary host may store the wrapped value that was received // from the primary in a file, and unwrap it each time the key is req
uired // (such as at server startup).
... // // the servers must be started int comparekeys(server *peer); // create a server - the name distig
uish the keys in the // shared database in this example server(const char *servername); ~server(); private: int getprivatekey(seckeyprivatekey **prvkey); int getpublickey(seckeypublickey **pubkey); int wrapkey(pk11symkey *key, seckeypublickey *pubkey, secitem **data); // export raw key (unwrapped) do not use int rawexportkey(pk11symkey *key, secitem **data); char *mservername; ...
... // if there is one, no further action is req
uired.
nss tech note2
for example, to log the softoken on windows, use: set nss_debug_pkcs11_module=nss internal pkcs #11 module the logger is available by default in debug b
uilds.
... for optimized b
uilds, nss must be b
uilt with the variable debug_pkcs11 set.
...this mode is most useful in optimized b
uilds.
...no additional environment variables are req
uired for this mode.
Notes on TLS - SSL 3.0 Intolerant Servers
normally the servers which have this problem are not eq
uipped to deal with the tls protocol, but instead of rolling back to ssl 3.0 as the rollback provision provides, they terminate/drop the connection, thus resulting in most cases a blank page display.
... contact the manufacturer and inq
uire if there is a new version available which fixes this problem.
... detecting intolerant servers because newer versions of netscape and mozilla have b
uilt-in workaround for the problem servers, it is now unlikely that you will experience this problem.
... but if you're running netscape 6.0/6.01/6.1 pr 1 or mozilla b
uild (prior to 6/11/2001), you should look out for the symptom described below.
PKCS #11 Module Specs
if the name is not specified, the application can use the library path to describe the pkcs #11 library in any
ui it may have.
...ags='rsa' askpw=only]}" library=dkck32.dll name="datakey signasure 3600" nss="trustorder=50 ciphers= " library=swft32.dll name="netscape software fortezza" parameters="keyfile=/u/relyea/keyfile" nss="trustorder=50 ciphers=fortezza slotparams=0x1=[slotflags='fortezza']" library=core32.dll name="litronic netsign" softoken specific parameters the internal nss pkcs #11 implementation (softoken) req
uires applications parameters.
... passwordreq
uired zero length passwords are not acceptable (valid only if there is a keydb).
... passwordreq
uired zero length passwords are not acceptable (valid only if there is a keydb).
Migration to HG
besides the new layout, the b
uild system hasn't changed.
... most parts of the nss b
uild instructions remain valid, especially the instructions about setting environment variables.
... updated instructions for b
uilding nss with nspr can be found at: /docs/nss_reference/b
uilding_and_installing_nss/b
uild_instructions it's best to refer to the above document to learn about the various environment variables that you might have to set to b
uild on your platform (this part hasn't changed).
... however, below is a brief summary that shows how to checkout the source code and b
uild both nspr and nss: mkdir workarea cd workarea hg clone https://hg.mozilla.org/projects/nspr hg clone https://hg.mozilla.org/projects/nss cd nss # set use_64=1 on 64 bit architectures # set b
uild_opt=1 to get an optimized b
uild make nss_b
uild_all note that the jss project has been given a private copy of the former mozilla/security/coreconf directory, allowing it to remain stable, and only update its b
uild system as necessary.
Sample manual installation
the nss b
uild system does not include a target to install header files and shared libraries in the system directories, so this needs to be done manually.
... after b
uilding nss with "gmake nss_b
uild_all", the resulting b
uild can be found in the nss source tree as follows: nss header files: mozilla/dist/public/nss nspr header files: mozilla/dist/<obj-dir>/include nspr/nss shared libs: mozilla/dist/<obj-dir>/lib nss binary executables: mozilla/dist/<obj-dir>/bin.
... where <obj-dir> would vary according to the type of b
uild and the platform.
... for example, <obj-dir> for a debug b
uild of nss on the x86 platform with a linux kernel version 2.6 with glibc would be: linux2.6_x86_glibc_pth_dbg.obj from these directories, you can copy the files to any system (or other) directory.
NSS reference
initial notes we are migrating the ssl reference into the format described in the mdn style g
uide.
... should a particular page req
uire the use of an underscore, please see the documentation for the title override extension.
... b
uilding and installing nss overview of an nss application based on "overview of an ssl application" in the ssl reference.
...sec_pkcs12decoderstart sec_pkcs12decoderimportbags sec_pkcs12decoderupdate sec_pkcs12decoderfinish sec_pkcs12decodervalidatebags sec_pkcs12decoderverify sec_pkcs12decodergetcerts sec_pkcs12decodersettargettokencas sec_pkcs12decoderiterateinit sec_pkcs12decoderiteratenext sec_pkcs12isencryptionallowed sec_pkcs12setpreferredcipher nspr functions a small number of nspr functions are req
uired for using the certificate verification and ssl functions in nss.
sslcrt.html
this page is part of the ssl reference that we are migrating into the format described in the mdn style g
uide.
...some of the pk11 functions req
uire a pin argument (see ssl_setpkcs11pinarg for details), which must be specified in the wincx parameter.
... canames a pointer to a structure that contains a list of disting
uished names (dns) against which to check the dns for the signers in the certificate chain.
...some of the pk11 functions req
uire a pin argument (see ssl_setpkcs11pinarg for details), which must be specified in the wincx parameter.
NSS Tools
currently, you must download the nss 3.1 source and b
uild it to create binary files for the nss tools.
... for information about downloading the nss source, see https://developer.mozilla.org/nss/b
uilding.
...the ssltap tool does not decrypt data, but it shows things like the type of ssl message (clienthello, serverhello, etc) and connection data (protocol version, cipher s
uite, etc).
... source, documentation currently points to the netscape certificate management system administration g
uide on docs.sun.com.
Small Footprint
on a recent b
uild, the length of js.jar was 603,127 bytes corresponding to 1,171,708 bytes of all uncompressed rhino classes with debug information included.
... javaadapter implementing the javaadapter functionality req
uires the ability to generate classes on the fly.
... smalljs.jar ant b
uild script in rhino supports smalljar target that will generate smalljs.jar that does not include tools, optimizer, javaadapter and class generation library, regular expressions, e4x implementataion and deprecated files.
... to b
uild such minimalist jar without debug information, run the following command from the top directory of rhino distribution: ant clean ant -ddebug=off -dno-regexp=true -dno-e4x=true smalljar if you omit -dno-regexp=true, then the resulting smalljs.jar will include regular expression support.
Tracing JIT
the recorder records the activity of the interpreter, using nanojit to b
uild an efficient, native representation of the execution called a fragment.
...a running tally is kept of assignments between registers and lir operands, and any time a new lir operand is req
uired in a register a new one is assigned from the list of free registers.
...only one architecture-specific variant is included into any given b
uild of the assembler; the architecture is selected and fixed when the b
uild is configured.
...a deep bail is special only insofar as it req
uires flushing the full set of deferred writes in the trace if it occurs (and further, req
uires that all registers holding temporary trace operands have flushed to the native stack before execution).
JS::Rooted
req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
...this is typically used for local variables, or for non-rooted values being passed to a function that req
uires a handle, e.g.
... rootedid; typedef rooted<js::value> rootedvalue; } see also mxr id search for js::rooted mxr id search for js::rootedobject mxr id search for js::rootedfunction mxr id search for js::rootedscript mxr id search for js::rootedstring mxr id search for js::rootedsymbol mxr id search for js::rootedid mxr id search for js::rootedvalue js::handle js::mutablehandle gc rooting g
uide bug 756823 bug 761391 - added js::rootedscript bug 645416 - added js::rootedsymbol ...
JSClass
syntax struct jsclass { const char *name;
uint32_t flags; /* optional since spidermonkey 37 */ jspropertyop addproperty; jsdeletepropertyop delproperty; jspropertyop getproperty; jsstrictpropertyop setproperty; jsenumerateop enumerate; jsresolveop resolve; jsconvertop convert; /* obsolete since spidermonkey 44 */ /* optional since spidermonkey 25 */ jsfinalizeop finalize; /* optional */ jsclassinternal reserved0; /* obsolete since spidermonkey 13 ...
...sxdrobjectop xdrobject; /* obsolete since spidermonkey 13 */ jstraceop trace; /* added in spidermonkey 17 */ jsclassinternal reserved1; /* obsolete since spidermonkey 13 */ void *reserved[n]; /* sizeof 'reserved' depends on version */ }; name type description name const char * class name flags
uint32_t class flags.
...obsolete since jsapi 44 use null or js_convertstub (spidermonkey 31 or older) for default behavior, which is eq
uivalent to that defined by ecmascript in §8.12.8.
... simple classes a simple custom class does not req
uire any special jsclass callbacks.
JSFunctionSpec
syntax struct jsfunctionspec { const char *name; jsnativewrapper call;
uint16_t nargs;
uint16_t flags; const char *selfhostedname; }; typedef struct jsnativewrapper { jsnative op; const jsjitinfo *info; } jsnativewrapper; name type description name const char * the function's name.
... call jsnativewrapper the b
uilt-in js call wrapped by this function.
... nargs
uint16_t the value used for function.length.
... flags
uint16_t the bitwise or of any number of function flags.
JSProtoKey
ierror urierror mxr search for jsproto_urierror jsproto_iterator iterator mxr search for jsproto_iterator jsproto_stopiteration stopiteration mxr search for jsproto_stopiteration jsproto_arraybuffer arraybuffer mxr search for jsproto_arraybuffer jsproto_int8array int8array mxr search for jsproto_int8array jsproto_
uint8array
uint8array mxr search for jsproto_
uint8array jsproto_int16array int16array mxr search for jsproto_int16array jsproto_
uint16array
uint16array mxr search for jsproto_
uint16array jsproto_int32array int32array mxr search for jsproto_int32array jsproto_
uint32array
uint32array mxr search for jsproto_
uint32array ...
... jsproto_float32array float32array mxr search for jsproto_float32array jsproto_float64array float64array mxr search for jsproto_float64array jsproto_
uint8clampedarray
uint8clampedarray mxr search for jsproto_
uint8clampedarray jsproto_proxy proxy mxr search for jsproto_proxy jsproto_weakmap weakmap mxr search for jsproto_weakmap jsproto_map map mxr search for jsproto_map jsproto_set set mxr search for jsproto_set jsproto_dataview dataview mxr search for jsproto_dataview jsproto_symbol symbol added in spidermonkey 38 mxr search for jsproto_symbol jsproto_sharedarraybuffer sharedarraybuffer (nightly only) mxr search for jsproto_sharedar...
... generatorfunction added in spidermonkey 31 mxr search for jsproto_generatorfunction jsproto_simd simd (nightly only) mxr search for jsproto_simd jsproto_weakset weakset added in spidermonkey 38 mxr search for jsproto_weakset jsproto_sharedint8array sharedint8array (nightly only) mxr search for jsproto_sharedint8array jsproto_shared
uint8array shared
uint8array (nightly only) mxr search for jsproto_shared
uint8array jsproto_sharedint16array sharedint16array (nightly only) mxr search for jsproto_sharedint16array jsproto_shared
uint16array shared
uint16array (nightly only) mxr search for jsproto_shared
uint16array jsproto_sharedint32array sharedint32array (nightly only) mxr se...
...arch for jsproto_sharedint32array jsproto_shared
uint32array shared
uint32array (nightly only) mxr search for jsproto_shared
uint32array jsproto_sharedfloat32array sharedfloat32array (nightly only) mxr search for jsproto_sharedfloat32array jsproto_sharedfloat64array sharedfloat64array (nightly only) mxr search for jsproto_sharedfloat64array jsproto_shared
uint8clampedarray shared
uint8clampedarray (nightly only) mxr search for jsproto_shared
uint8clampedarray jsproto_typedarray typedarray added in spidermonkey 38 mxr search for jsproto_typedarray jsproto_atomics atomics (nightly only) mxr search for jsproto_atomics description each of these types corresponds to standard objects in javascri...
JS_AlreadyHasOwnProperty
bool *foundp); boo js_alreadyhasownucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, bool *foundp); boo js_alreadyhasownpropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, bool *foundp); // added in spidermonkey 1.8.1 boo js_alreadyhasownelement(jscontext *cx, js::handleobject obj,
uint32_t index, bool *foundp); name type description cx jscontext * pointer to a js context.
... req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
... index
uint32_t (in js_alreadyhasownelement only) the index of the element to search for.
JS_ConstructObject
req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
... neither of these functions is q
uite like the javascript new keyword.
...see the jsapi user g
uide.
JS_ConvertArguments
req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
...format can contain one or more instances of the following characters, as appropriate: character c type description b bool boolean c
uint16_t ecma
uint16_t, unicode character i int32_t ecma int32_t j int32_t ecma int32_t (used to be different, behaves like i now) obsolete since jsapi 28 u
uint32_t ecma
uint32_t d double ieee double i double integral ieee double s char * (c string) bug 607292 s jsstring * unicode string, a...
... if argc is less than the number of arguments req
uired by format, js_convertargument reports an error and returns false.
JS_DeleteElement
syntax bool js_deleteelement(jscontext *cx, js::handleobject obj,
uint32_t index); // added in spidermonkey 45 bool js_deleteelement(jscontext *cx, js::handleobject obj,
uint32_t index, js::objectopresult &result); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
... index
uint32_t index number of the element to delete.
JS_DeleteElement2
renamed to js_deleteelement in jsapi 39 syntax bool js_deleteelement2(jscontext *cx, js::handleobject obj,
uint32_t index, bool *succeeded); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
... index
uint32_t index number of the element to delete.
JS_Enumerate
req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
...(the term own property refers to a property that is not inherited from the object's prototype.) this is not q
uite the same behavior as a javascript for...in loop, which converts all property ids to strings and also enumerates inherited properties.
...therefore a program that loops over the property ids must either root them all, ensure that the properties are not deleted (in a multithreaded program this req
uires even greater care), or ensure that garbage collection does not occur.
JS_SetGCCallback
some q
uirky behavior follows from this: the javascript engine can call the gc callback reentrantly on a single thread.
... in a js_threadsafe b
uild, a jsgc_begin callback may happen on any thread, any time that thread triggers garbage collection (from almost any jsapi call).
... in a js_threadsafe b
uild, a jsgc_begin callback can happen on one thread before or while a jsgc_end callback for the previous gc cycle runs on another thread.
... in a js_threadsafe b
uild, the jsgc_end callback is called after each stop-the-world rendezvous during which one or more garbage collection cycles finished.
JS_SetOptions
syntax
uint32 js_setoptions(jscontext *cx,
uint32 options); name type description cx jscontext * a context on which to set options.
... options
uint32 the new set of options.
...this function returns a
uint32 value containing the previous values of the flags.
...this is only meaningful if spidermonkey is b
uilt with xpconnect.
JS_ValueToId
syntax bool js_valuetoid(jscontext *cx, js::handlevalue v, js::mutablehandleid idp); bool js_stringtoid(jscontext *cx, js::handlestring s, js::mutablehandleid idp); // added in spidermonkey 38 bool js_indextoid(jscontext *cx,
uint32_t index, js::mutablehandleid idp); // added in spidermonkey 17 bool js_charstoid(jscontext* cx, js::twobytechars chars, js::mutablehandleid idp); // added in spidermonkey 24 void js::protokeytoid(jscontext *cx, jsprotokey key, js::mutablehandleid idp); // added in spidermonkey 38 name type description cx jscontext * a context.
... req
uires request.
... in a js_threadsafe b
uild, the caller must be in a request on this jscontext.
... index
uint32_t an unsigned integer index of array to convert.
TPS History Lists
the history list used for operations other than delete has the following properties: uri: req
uired.
...visits: req
uired.
... an array of objects representing visits to the page, each object has the following properties: type: req
uired.
...date: req
uired.
compare-locales
if you want to run compare-locales on windows, be sure to first install mozillab
uild.
... installation compare-locales needs to be installed, and it req
uires that you have python 2.7 or 3.5+ installed on your machine.
...if you want to test the localization for de, run $ compare-locales browser/locales/l10n.toml ./l10n/ de to check mobile, replace the previous line with: $ compare-locales mobile/android/locales/l10n.toml ./l10n/ zh-tw to check mail, s
uite, calendar that lives on comm-central, you can either rely on the check-out of mozilla within comm-central repository that the regular comm-central b
uild instructions generate: $ compare-locales ./comm-central/mail/locales/l10n.toml ./l10n/ zh-tw if you don't want to use a copy of mozilla-central in comm-central, you can run them separately: $ compare-locales -dmozilla=$pwd/mozilla-central ...
...single result across the projects, specify the --unified flag: $ compare-locales --unified browser/locales/l10n.toml mobile/android/locales/l10n.toml ./l10n/ de cross-channel and compare-locales if you're working against the gecko-strings cross-channel repository, the toml configuration files are in the _configs subdirectory, browser.toml, mobile_android.toml, mail.toml and calendar.toml, and s
uite.toml.
Task graph
these tasks include b
uild and test tasks, along with lots of other kinds of tasks to b
uild docker images, b
uild toolchains, perform analyses, check syntax, and so on.
... these tasks are arranged in a "task graph", with some tasks (e.g., tests) depending on others (b
uilds).
... once its prereq
uisite tasks complete, a dependent task begins.
... the details of task-graph generation are documented in the source code itself, including a some q
uick recipes for common changes.
Gecko object attributes
applied to: any visible accessible id any value, defined by
ui/content developers.
...if not specified, the default should be considered "additions text", which indicates that newly created objects and changes to text and text eq
uivalents should be considered relevant, and that the hiding or removal of items is not.
...for example, a heading, paragraph, or list item is typically formatted as a block, but there is no req
uirement to do so.
... value attributes valuetext a text eq
uivalent to the current value, such as "high" in a slider or "unzipping files" in a progress meter.
extIApplication
method overview boolean q
uit() boolean restart() void getextensions(extiextensionscallback acallback) attributes the following interfaces are available to all applications: attribute type description id readonly attribute astring the id of the application.
...supports: "load", "ready", "q
uit", "unload" the following interfaces are only available to firefox: attribute type description bookmarks readonly attribute fuelibookmarkroots the root bookmarks object for the application.
... methods q
uit() attempts to shutdown the application.
... boolean q
uit() return value boolean value indicating whether the shutdown was successful.
Binary compatibility
if mozilla decides to upgrade to a compiler that does not have the same abi as the current version, any b
uilt component may fail.
...if you b
uild a component and it works fine in version 1.0 of mozilla.
... if and when mozilla upgrades the compiler they use, your component will have to be reb
uilt against the same compiler.
... when you see a @status frozen, note that this means it should work as long as the component and xpcom are b
uilt with the same compiler abi.
XPCOM glue
extension and application authors currently using internal linkage should read the g
uide on migrating from internal linkage to frozen linkage.
...glue_s.lib xpcom.lib nspr4.lib for recent versions of the firefox sdk (at least version 42, but possibly earlier versions as well): -libpath:c/path/to/sdk/lib xpcomglue_s.lib xul.lib nss3.lib mozcrt.lib -libpath:c:/path/to/sdk/lib xpcomglue.lib mac -l/path/to/sdk/lib -l/path/to/sdk/bin -wl,-executable-path,/path/to/sdk/bin -lxpcomglue_s -lxpcom -lnspr4 when b
uilding against a xulrunner derived sdk, use: -l/path/to/sdk/lib -l/path/to/xulrunner-bin -wl,-executable_path,/path/to/xulrunner-bin -lxpcomglue_s -lxpcom -lnspr4 where 'xulrunner-bin' is either /library/frameworks/xul.framework/versions/current/ or /path/to/xulrunner-b
uild/[platform]/dist/bin -l/path/to/sdk/lib -lxpcomglue linux -l/path/to/sdk/lib -l/path/to/sdk/b...
...at runtime (not compile time) (in debug b
uilds) or your module just won't load (in optimized b
uilds).
...this is because nspr is now merged into nss during the b
uild process.
Creating XPCOM components
next » this g
uide is about gecko, and about creating xpcom components for gecko-based applications.
...xpcom registry manifests registration methods in xpcom autoregistration the shutdown process three parts of a xpcom component library xpcom glue the glue library xpcom string classes creating the component code what we'll be working on component registration the regxpcom program registration alternatives overview of the weblock module source digging in: req
uired includes and constants identifiers in xpcom coding for the registration process the registration methods creating an instance of your component weblock1.cpp using xpcom utilities to make things easier xpcom macros generic xpcom module macros common implementation macros declaration macros weblock2.cpp string classes in xpcom using strings nsembedstring ...
... the iweblock interface the directory service modifying paths with nsifile manipulating files with nsifile using nsilocalfile for reading data processing the white list data iweblock method by method lock and unlock addsite removesite setsites getnext getsites hasmoreelements finishing the component using frozen interfaces copying interfaces into your b
uild environment implementing the nsicontentpolicy interface receiving notifications implementing the nsicontentpolicy uniform resource locators checking the white list creating nsiuri objects b
uilding the weblock
ui user interface package list client code overview xul the xul document the locking
ui site adding
ui weblock.xul overlaying new user interface ...
...into mozilla weblockoverlay.xul other resources weblock.css image resources packaging weblock component installation overview archiving resources the weblock installation script the weblock trigger script distributing your component appendix a - setting up the gecko sdk downloading and setting the sdk b
uilding a microsoft visual cpp project creating a new project adding the gecko sdk to the project settings b
uilding a windows project a makefile for unix appendix b - resources weblock resources gecko resources xpcom resources general development resources next » copyright (c) 2003 by doug turner and ian oeschger.
IAccessibleTable2
the behavior should mimic that of the application, but for those applications which do not have a means in the g
ui to select a full column of cells the behavior should be as follows: first any selected columns in the table are unselected.
...the behavior should mimic that of the application, but for those applications which do not have a means in the g
ui to select a full row of cells the behavior should be as follows: first any selected rows in the table are unselected.
...the behavior should mimic that of the application, but for those applications which do not have a means in the g
ui to unselect a full column of cells the behavior should be as follows: the entire column of cells for the specified column is unselected.
...the behavior should mimic that of the application, but for those applications which do not have a means in the g
ui to unselect a full row of cells the behavior should be as follows: the entire row of cells for the specified row is unselected.
amIWebInstallListener
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview boolean onwebinstallblocked(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pr
uint32 acount); void onwebinstalldisabled(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pr
uint32 acount); boolean onwebinstallrequested(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pr
uint32 acount); note: prior to gecko 8.0, all references to nsidomwindow u...
...boolean onwebinstallblocked( in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, in pr
uint32 acount optional ); parameters awindow the window that triggered the installs.
...void onwebinstalldisabled( in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, in pr
uint32 acount optional ); parameters awindow the window that triggered the installs.
...boolean onwebinstallrequested( in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, in pr
uint32 acount optional ); parameters awindow the window that triggered the installs.
mozISpellCheckingEngine
the b
uilt in hunspell engine has contract id "@mozilla.org/spellchecker/engine;1".
...method overview void adddirectory(in nsifile dir); boolean check(in wstring word); void getdictionarylist([array, size_is(count)] out wstring dictionaries, out pr
uint32 count); void removedirectory(in nsifile dir); void suggest(in wstring word,[array, size_is(count)] out wstring suggestions, out pr
uint32 count); attributes attribute type description copyright wstring a string indicating the copyright of the engine.
...void getdictionarylist( [array, size_is(count)] out wstring dictionaries, out pr
uint32 count ); parameters dictionaries a list of dictionaries supported by this spell checker.
...void suggest( in wstring word, [array, size_is(count)] out wstring suggestions, out pr
uint32 count ); parameters word a word, which is misspelled according to check.
nsIAuthPrompt
to create an instance, use: var authprompt = components.classes["@mozilla.org/login-manager/prompter;1"] .createinstance(components.interfaces.nsiauthprompt); method overview boolean prompt(in wstring dialogtitle, in wstring text, in wstring passwordrealm, in pr
uint32 savepassword, in wstring defaulttext, out wstring result); boolean promptpassword(in wstring dialogtitle, in wstring text, in wstring passwordrealm, in pr
uint32 savepassword, inout wstring pwd); boolean promptusernameandpassword(in wstring dialogtitle, in wstring text, in wstring passwordrealm, in pr
uint32 savepassword, inout wstring user, inout wstring pwd); constant...
... boolean prompt( in wstring dialogtitle, in wstring text, in wstring passwordrealm, in pr
uint32 savepassword, in wstring defaulttext, out wstring result ); parameters dialogtitle the title of the dialog.
... boolean promptpassword( in wstring dialogtitle, in wstring text, in wstring passwordrealm, in pr
uint32 savepassword, inout wstring pwd ); parameters dialogtitle the title of the dialog.
... boolean promptusernameandpassword( in wstring dialogtitle, in wstring text, in wstring passwordrealm, in pr
uint32 savepassword, inout wstring user, inout wstring pwd ); parameters dialogtitle the title of the dialog.
nsIAuthPrompt2
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) this interface is usually acq
uired using getinterface on notification callbacks or similar.
...to create an instance, use: var authprompt2 = components.classes["@mozilla.org/login-manager/prompter;1"] .createinstance(components.interfaces.nsiauthprompt2); method overview nsicancelable asyncpromptauth(in nsichannel achannel, in nsiauthpromptcallback acallback, in nsisupports acontext, in pr
uint32 level, in nsiauthinformation authinfo); boolean promptauth(in nsichannel achannel, in pr
uint32 level, in nsiauthinformation authinfo); constants constant value description level_none 0 the password will be sent unencrypted.
... nsicancelable asyncpromptauth( in nsichannel achannel, in nsiauthpromptcallback acallback, in nsisupports acontext, in pr
uint32 level, in nsiauthinformation authinfo ); parameters achannel the channel that req
uires authentication.
... boolean promptauth( in nsichannel achannel, in pr
uint32 level, in nsiauthinformation authinfo ); parameters achannel the channel that req
uires authentication.
nsICache
req
uires the cache entry to reside in non-persistent storage.
...req
uires the cache entry to reside in persistent storage.
...req
uires the cache entry to reside in persistent storage, and in a separate file.
...req
uires the cache entry to reside in persistent, reliable storage for offline use.
nsIChannel
load_call_content_sniffers 21 if this flag is set, the channel should call the content sniffers as described in netwerk/b
uild/nsnetcid.h about ns_content_sniffer_category.
... if the channel's and loadgroup's notification callbacks do not provide an nsichanneleventsink when onchannelredirect would be called, that's eq
uivalent to having called onchannelredirect.
... note: extensions should not call this method, because it tends to fail when a request is redirected, rather than redirecting transparentlynote: nsichannel implementations are not req
uired to implement this method.
... moreover, since this method may block the calling thread, it should not be called on a thread that processes
ui events.
nsIClipboardDragDropHooks
widget/public/nsiclipboarddragdrophooks.idlscriptable interfaces for overriding the b
uilt-in drag, drop, copy, and paste implementations in the content area and editors.
...onpasteordrop() provide an alternative action to the b
uilt-in behavior when something is dropped on the browser or in an editor.
... return value true to indicate the action was handled, do not perform b
uilt-in behavior.
... otherwise, false to indicate the action was not overridden, do b
uilt-in behavior.
nsIConsoleService
upports last changed in gecko 19 (firefox 19 / thunderbird 19 / seamonkey 2.16) implemented by: @mozilla.org/consoleservice;1 as a service: var consoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice); method overview void getmessagearray([array, size_is(count)] out nsiconsolemessage messages, out
uint32_t count);obsolete since gecko 19 void getmessagearray([optional] out
uint32_t count, [retval, array, size_is(count)] out nsiconsolemessage messages); void logmessage(in nsiconsolemessage message); void logstringmessage(in wstring message); void registerlistener(in nsiconsolelistener listener); void reset(); void unregisterlistener(in nsiconsol...
... void getmessagearray( [array, size_is(count)] out nsiconsolemessage messages, out pr
uint32 count ); parameters messages an array of logged messages.
... void getmessagearray( [optional] out pr
uint32 count, [retval, array, size_is(count)] out nsiconsolemessage messages ); parameters count the number of messages in the array.
...there are q
uite a few category strings and they do not currently seem to be listed in a single place.
getFile
this change was req
uired in order to comply with apple's new gatekeeper v2 rules; without this change, firefox would not work on any mac os x newer than 10.9.4.
...ns_osx_user_preferences_dir "usrprfs" ns_osx_local_preferences_dir "locprfs" ns_osx_picture_documents_dir "pct" ns_osx_movie_documents_dir "mov" ns_osx_music_documents_dir "music" ns_osx_internet_sites_dir "intrntsts" available on windows only these locations are supported only on microsoft windows b
uilds of gecko.
...rams_dir "cmprgs" ns_win_common_startup_dir "cmstrt" ns_win_common_desktop_directory "cmdeskp" ns_win_appdata_dir "appdata" ns_win_local_appdata_dir "localappdata" ns_win_printhood "prnthd" ns_win_cookies_dir "cookd" available on unix only these locations are supported only on unix b
uilds of firefox os.
... c constant string value notes ns_unix_local_dir "locl" ns_unix_lib_dir "libd" ns_unix_home_dir ns_os_home_dir the following locations are provided only on os/2 b
uilds of gecko.
nsIDownload
use the g
uid property instead for safe, database-agnostic searching and manipulation.
... deprecated since gecko 19.0 g
uid astring the g
uid of the download that is stored in the database.
... size long long the total size of the file in bytes, or ll_max
uint if the file's size is unknown.
... see also nsidownloadmanager nsidownloadprogresslistener nsixpinstallmanager
ui ...
nsIEditorSpellCheck
overview void addwordtodictionary(in wstring word); boolean canspellcheck(); void checkcurrentdictionary(); boolean checkcurrentword(in wstring suggestedword); boolean checkcurrentwordnosuggest(in wstring suggestedword); astring getcurrentdictionary(); void getdictionarylist([array, size_is(count)] out wstring dictionarylist, out pr
uint32 count); wstring getnextmisspelledword(); void getpersonaldictionary(); wstring getpersonaldictionaryword(); wstring getsuggestedword(); void ignorewordalloccurrences(in wstring word); void initspellchecker(in nsieditor editor, in boolean enableselectionchecking); void removewordfromdictionary(in wstring word); void replac...
...void getdictionarylist( [array, size_is(count)] out wstring dictionarylist, out pr
uint32 count ); parameters dictionarylist an array into which the list of dictionary name strings are placed.
...subsequent calls iterate through all suggestions, allowing you to b
uild a list.
...for spell checking clients with no modal
ui (such as inline spell checkers), this flag is not relevant.
nsIException
inherits from: nsisupports last changed in gecko 1.7 method overview string tostring(); attributes attribute type description columnnumber pr
uint32 valid column numbers begin at 0.
... linenumber pr
uint32 valid line numbers begin at '1'.
... methods tostring() a generic formatter - make it s
uitable to print, etc.
... return value a string s
uitable for output.
nsILoginManagerStorage
ile); void modifylogin(in nsilogininfo oldlogin, in nsisupports newlogindata); void removealllogins(); void removelogin(in nsilogininfo alogin); void searchlogins(out unsigned long count, in nsipropertybag matchdata, [retval, array, size_is(count)] out nsilogininfo logins); void setloginsavingenabled(in astring ahost, in boolean isenabled); attributes attribute type description
uibusy boolean true when a master password prompt is being shown.
...the user interface allows this to be done without getting each login first (which might req
uire knowing the master password).
... no password should be req
uired in order to remove all logins.
...this does not follow the same req
uirements as findlogins() for those fields; wildcard matches are not specified.
nsIMsgDBView
available in the mozilla codebase are types "q
uicksearch", "threadswithunread", "watchedthreadswithunread", "xfvf" (virtual folders), "search", "group", and "threaded" each with their own implementation of nsimsgdbview that provides a different sorting/view of the data.
... docommandwithfolder() perform a command that req
uires a folder.
...used by the thunderbird
ui to determine if the command is available.
... addcolumnhandler() attaches a nsimsgcustomcolumnhandler to a specific column (can be a new column or a b
uilt in).+ void addcolumnhandler(in astring acolumn, in nsimsgcustomcolumnhandler ahandler); parameters acolumn the name of the column to add the handler for.
nsIMsgIncomingServer
(in string relpref, in string abspref); nsimsgfilterlist getfilterlist(in nsimsgwindow amsgwindow); long getintattribute(in string name); long getintvalue(in string attr); nsimsgfolder getmsgfolderfromuri(in nsimsgfolder afolderresource, in acstring auri); void getnewmessages(in nsimsgfolder afolder, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener); acstring getpasswordwith
ui(in astring apromptstring, in astring aprompttitle, in nsimsgwindow amsgwindow, out boolean okayvalue); astring getunicharattribute(in string name); astring getunicharvalue(in string attr); boolean isnewhdrduplicate(in nsimsgdbhdr anewhdr); void onuserorhostnamechanged(in acstring oldname, in acstring newname); void performbiff(in nsimsgwindow amsgwindow); void performexpand(in nsimsg...
... loginatstartup boolean logonfallback boolean maxmessagesize long offlinesupportlevel long password acstring passwordpromptreq
uired boolean if the password for the server is available either via authentication in the current session or from password manager stored entries, return false.
... serverbusy boolean serverreq
uirespasswordforbiff boolean read only.
...eturn value missing description exceptions thrown missing exception missing description getnewmessages() void getnewmessages( in nsimsgfolder afolder, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener ); parameters afolder missing description amsgwindow missing description aurllistener missing description exceptions thrown missing exception missing description getpasswordwith
ui() acstring getpasswordwith
ui( in astring apromptstring, in astring aprompttitle, in nsimsgwindow amsgwindow, out boolean okayvalue ); parameters apromptstring missing description aprompttitle missing description amsgwindow missing description okayvalue missing description return value missing description exceptions thrown missing exception missing description getunicharattribute() th...
nsIProfileUnlocker
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void unlock(in unsigned long aseverity); constants constant value description attempt_q
uit 0 politely ask the process currently holding the profile's lock to q
uit.
... force_q
uit 1 forcibly terminate the process holding the profile lock.
... methods unlock() tries to unlock the profile by attempting or forcing the process that currently holds the lock to q
uit.
... void unlock( in unsigned long aseverity ); parameters aseverity either attempt_q
uit or force_q
uit.
nsIPromptService
logtitle, in wstring atext, inout wstring ausername, inout wstring apassword, in wstring acheckmsg, inout boolean acheckstate); boolean promptpassword(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring apassword, in wstring acheckmsg, inout boolean acheckstate); boolean select(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in pr
uint32 acount, [array, size_is(acount)] in wstring aselectlist, out long aoutselection); constants the following flags are combined to form the abuttonflags parameter passed to confirmex.
...it is eq
uivalent to pressing the escape key (or cmd+.
...the implementation may interpret this loosely, as the intent is to ensure that the user does not click through a security dialog too q
uickly.
...boolean select( in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in pr
uint32 acount, [array, size_is(acount)] in wstring aselectlist, out long aoutselection ); aparent the parent window for the dialog.
nsITextInputProcessor
{ key: "enter", // req
uired.
... keycode: keyboardevent.dom_vk_return, // req
uired if printable key, but optional if non-printable key.
...this is useful if your ime doesn't generate composing string but provides some
ui to select commit string.
... key req
uired.
nsIToolkitProfileService
to access the service, you can use the following code: var toolkitprofileservice = components.classes["@mozilla.org/toolkit/profile-service;1"] .createinstance(components.interfaces.nsitoolkitprofileservice); prior to gecko 1.9.1 only the b
uilt-in profile manager was able to access the toolkit profile service.
... to access the b
uilt-in profile manager in versions of firefox up to 4.0 and thunderbird up to 3.3 you can launch with the -profilemanager command line flag.
... future versions will req
uire the separate profile manager application.
...may be null, in which case a s
uitable default will be chosen based on the profile name.
nsIUpdate
b
uildid astring the b
uild id of this update.
... this is used to identify a particular b
uild, down to the hour, minute, and second of its creation.
... this lets the system differentiate between several nightly b
uilds with the same version, for example.
... showprompt boolean whether to show the update prompt which req
uires user confirmation when an update is found during a background update check.
nsIXFormsModelElement
1.0 66 introduced gecko 1.8 obsolete gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsidomdocument getinstancedocument(in domstring instanceid); void reb
uild(); void recalculate(); void refresh(); void revalidate(); methods getinstancedocument() nsidomdocument getinstancedocument( in domstring instanceid ); parameters instanceid the id of the instance element to be returned.
... reb
uild() signals the xforms processor to reb
uild any internal data structures used to track computational dependencies within the given xforms model.
... void reb
uild(); parameters none.
...note: script invocation is not necessarily eq
uivalent to performing the recalculate action handler.
NS_StringCutData
#include "nsstringapi.h" nsresult ns_stringcutdata( nsastring& astring, pr
uint32 acutstart, pr
uint32 acutlength ); parameters astring [in] a nsastring instance to be modified.
...pass pr_
uint32_max to specify the length from acutstart to the end of the string.
... note: gcc req
uires the -fshort-wchar option to compile this example since prunichar is an unsigned short.
... example code nsstringcontainer str; ns_stringcontainerinit(str); ns_stringsetdata(str, l"hello world"); // remove " world" portion of string ns_stringcutdata(str, 5, pr_
uint32_max); const prunichar* data; ns_stringgetdata(str, &data); // data now ponts to the string: l"hello" ns_stringcontainerfinish(str); history this function was frozen for mozilla 1.7.
Storage
file->append(ns_literal_string("my_db_file_name.sqlite")); ns_ensure_success(rv, rv); nscomptr<mozistorageservice> dbservice = do_getservice(moz_storage_service_contractid, &rv); ns_ensure_success(rv, rv); nscomptr<mozistorageconnection> dbconn; rv = dbservice->opendatabase(dbfile, getter_addrefs(dbconn)); ns_ensure_success(rv, rv); note: moz_storage_service_contractid is defined in storage/b
uild/mozstoragecid.h.
...this is eq
uivalent to calling mozistoragestatement.executestep() and then mozistoragestatement.reset().
...the latter takes one of three constants to describe the type of transaction: mozistorageconnection.transaction_deferred mozistorageconnection.transaction_immediate mozistorageconnection.transaction_exclusive mozistorageconnection.begintransaction() is eq
uivalent to calling mozistorageconnection.begintransactionas() and passing mozistorageconnection.transaction_deferred.
... you can use them q
uite simply in your select queries, like this: var stmt = aconn.createstatement("select * from foo order by name collate locale asc"); var results = []; while (stmt.executestep()) { results.push(stmt.row.t); } stmt.finalize(); how to corrupt a database sqlite is very good about maintaining database integrity, but there are a few things you can do that can lead to database corruption.
Frequently Asked Questions
this section will help you if you're fixing a broken b
uild, or have what you think is a q
uick obvious question, and you don't have time to read the reference manual.
...if you're looking here just to learn about nscomptrs, you'll get a better introduction in the getting started g
uide.
... b
uildtime errors the b
uild just broke.
... some com ownership g
uidelines.
Using the Gecko SDK
this g
uide explains how to b
uild xpcom components in c++ using the gecko sdk.
...(more information on xpcom is available at the xpcom project page.) the intent of this g
uide is to help you b
uild your components "the right way" such that they will remain compatible with future versions of mozilla.
...(<tt>about:b
uildconfig</tt> can be loaded in mozilla to reveal details about the compiler that was used.) for the remainder of this g
uide, we'll assume you are developing components under linux.
... (ports of this g
uide are welcome.) a "frozen" interface or function is guaranteed to be supported by future versions of same major version of the platform.
Using the clipboard
the clipboard model in mozilla req
uires you to perform the following steps to copy data: create an xpcom wrapper for the data which you want to put on the clipboard.
...components.utils.import('resource://gre/modules/services.jsm'); // create a constructor for the b
uilt-in supports-string class.
... const nssupportsstring = components.constructor("@mozilla.org/supports-string;1", "nsisupportsstring"); function supportsstring(str) { // create an instance of the supports-string class var res = nssupportsstring(); // store the javascript string that we want to wrap in the new nsisupportsstring object res.data = str; return res; } // create a constructor for the b
uilt-in transferable class const nstransferable = components.constructor("@mozilla.org/widget/transferable;1", "nsitransferable"); // create a wrapper to construct an nsitransferable instance and set its source to the given window, when necessary function transferable(source) { var res = nstransferable(); if ('init' in res) { // when passed a window object, find a s
uitable privacy context for...
...here, the length is multiplied by two because we are using a unicode string which req
uires two bytes per character.
Working with Multiple Versions of Interfaces
the problem arises when one tries to run an extension b
uilt with the latest sdk in an older version of firefox, say firefox 2.
...we b
uild construct our xpcom component so that first tries to get the interface by it's new iid, then if that fails, attempts plan b.
...getwindowhandle is the tenth method declared in the nsiaccessibledocument.h that firefox 2 was b
uilt with, but actually the eighth method in the sdk that i used to b
uild my extension (and hence xpcom component).
...mine date back to august of 2006, which is when i first b
uilt the lizard.
pyxpidl
the pyxpidl tool s
uite has been b
uilt to replace the older xpidl tool which, in the past, was used to turn xpidl files into c++ headers and xpcom typelibs (xpt files).
... pyxpidl req
uires a directory to cache certain information in.
... xpidl option description pyxpidl eq
uivalent -a emit annotations to typelib n/a (feature removed) -w turn on warnings n/a (this is now the default and can't be turned off) -v verbose mode (nyi) n/a (feature removed) -t creates a typelib of a specific version number n/a (feature removed, and probably never actually worked) -i add an entry to start of include path f...
...or #include "nsifoo.idl" -i (unchanged) -o specify the base name for output (-o /tmp/nsifoo for example) -o outputfile (this isn't just the base name, but needs to include the extension; for example -o /tmp/nsifoo.idl) -e specify an explicit output file name (-e /tmp/nsifoo.idl for example) n/a (this is subsumed by -o now) -d write dependencies (req
uires -e) -d (unchanged) -m specify output mode n/a (feature removed; use header.py or typelib.py specifically) it's worth noting that the old output mode options for generating documentation and java interfaces (-m doc and -m java) have no eq
uivalents in pyxpidl.
xpidl
the xpidl compiler is now part of the b
uild process, allowing us to generate headers used by the xpcom components.
... please check the b
uild documentation for further information on where to get libidl and glib.
... using xpidl to add an idl file to the b
uild, use the xpidlsrcs makefile variable.
...``/tmp/nsithing) for output -e use explicit output filename -d write dependencies (req
uires -e) -m specify output mode: header generate c++ header (.h) typelib generate xpconnect typelib (.xpt) doc generate html documentation (.html) java generate java interface (.java) ...
Xray vision
instead of filtering out modifications made by content, the xray short-circ
uits the content completely.
... xrays for javascript objects until recently, b
uilt-in javascript objects that are not part of the dom, such as date, error, and object, did not get xray vision when accessed by more-privileged code.
... so, in gecko 31 and 32 we've added xray support for most javascript b
uilt-in objects.
... like dom objects, most javascript b
uilt-in objects have an underlying c++ state that is separate from their javascript representation, so the xray implementation can go straight to the c++ state and guarantee that the object will behave as its specification defines: // chrome code var sandboxscript = 'date.prototype.getfullyear = function() {return 1000};' + 'var date = new date(); '; var sandbox = components.utils.sandbox("https://example.org/"); components.utils.evalinsandbox(sandboxscript, sandbox); // date objects are xrayed console.log(sandbox.date.getfullyear()); // -> 2014 // but you can waive xray vision console.log(components.utils.waivexrays(sandbox.date).getfullyear()); // -> 1000 to test out examples like this, you can use the scratchpad in browser co...
Mozilla technologies
apng is a simpler alternative to mng, providing a spec s
uitable for the most common usage of animated images on the internet.docshelldocshell is the second iteration of what originally started out as webshell.
... at the moment, the transition from webshell to docshell is not fully completed, but the long-term goal is to remove webshell and switch over entirely to docshell.embedded dialog apifeed content access apifirefox 2 and thunderbird 2 introduce a series of interfaces that make it easy for extension authors to access rss and atom feeds.life after xul: b
uilding firefox interfaces with htmlthis page gathers technical solutions to common problems encountered by teams shipping html-based interfaces inside firefox.morkmork is a database file format invented by david mccusker for the mozilla code since the original netscape database information was proprietary and could not be released open source.
... toolkit apithe mozilla toolkit is a set of programming interfaces (apis) b
uilt on top of gecko which provide advanced services to xul applications.
...the xml extras module is b
uilt by default on all platforms, and is included in the browser installers so it is available in the nightly b
uilds.xpcomxpcom is a cross platform component object model, similar to microsoft com.
Testing Mozilla code
asan nightly projectthe asan nightly project involves b
uilding a firefox nightly browser with the popular addresssanitizer tool and enhancing it with remote crash reporting capabilities for any errors detected.clang static analysisthis document is split in two parts.
... the first part will focus on the modern and robust way of static-analysis and the second part will present the b
uild-time static-analysis.debugging mozilla with valgrindthis page describes how to use valgrind (specifically, its memcheck tool) to find memory errors.firefox and address sanitizeraddress sanitizer (asan) is a fast memory error detector that detects use-after-free and out-of-bound bugs in c/c++ programs.
...this type of coverage is only concerned with hit counts for lines and branches.the valgrind test jobthe valgrind test job b
uilds the browser and runs it under valgrind, which can detect various common memory-related errors.
... this job only runs on linux64, which is the platform best s
uited to running valgrind.
Address book sync client design
the general architecture for the sync component is the following: mozilla
ui ab sync logic mork ab database sync protocol encoding sync protocol decoding http "post" api mozilla networking client side sync logic the client synchronization logic defe...
...this interface is defined in mozilla/mailnews/addrbook/public/nsiabsyncdriver.idl #include "nsrootidl.idl" #include "nsiabsynclistener.idl" [scriptable, u
uid(91fdfee1-efbc-11d3-8f97-000073757374)] interface nsiabsyncdriver : nsiabsynclistener { void kickit(); }; as you can see, this is a very simple interface which allows for the starting of the address book sync operation.
...this interface is as follows: #include "nsisupports.idl" #include "nsrootidl.idl" #include "nsifilespec.idl" [scriptable, u
uid(e0ed29e0-098a-11d4-8fd6-00a024a7d144)] interface nsiabsynclistener : nsisupports { /** * notify the observer that the ab sync authorization operation has begun.
...this method is * called only once, at the beginning of a sync transaction * */ void onstartoperation(in print32 atransactionid, in pr
uint32 amsgsize); /** * notify the observer that progress as occurred for the ab sync operation */ void onprogress(in print32 atransactionid, in pr
uint32 aprogress, in pr
uint32 aprogressmax); /** * notify the observer with a status message for sync operation */ void onstatus(in print32 atransactionid, in wstring amsg); /** * notify the observer ...
nsIMsgCloudFileProvider
inherits from: nsisupports method overview void init(in string aaccountkey); void uploadfile(in nsilocalfile afile, in nsirequestobserver acallback); acstring urlforfile(in nsilocalfile afile); void cancelfileupload(in nsilocalfile afile); void refreshuserinfo(in boolean awith
ui, in nsirequestobserver acallback); void deletefile(in nsilocalfile afile, in nsirequestobserver acallback); void createnewaccount(in acstring aemailaddress, in acstring apassword, in acstring afirstname, in acstring alastname, in nsirequestobserver acallback); void createexistingaccount(in nsirequestobserver acallback)...
... void refreshuserinfo(in boolean awith
ui, in nsirequestobserver acallback); parameters awith
ui whether or not the provider should prompt the user for credentails in the event that the stored credentials have gone stale.
... if awith
ui is false, and the credentials are stale, the onstoprequest of the acallback nsirequestlistener will get the autherr status code passed to it.
... note: this function is not directly called by the filelink
ui.
MailNews fakeserver
this area will be the most diverse of all components, as edge cases with q
uirky servers being liberal with the specs will req
uire different handlers.
... server.start(port); // set up a nsimsgincomingserver locally localserver.someactionreq
uiringconnection(); server.performtest(); // nothing will be executed until the connection is closed // localserver.closecachedconnections() is generally a good way to do so server.resettest(); // set up second test server.performtest(); transaction = server.playtransaction(); // finished with tests server.stop(); } currently, fakeserver provides no means to keep a persistent co...
...nnection past a test, req
uiring connections to be closed, possibly forcibly.
... specific fakeserver g
uidelines pop imap smtp nntp nntpd.js defines a few different classes of nntp servers: compliance for rfc 977, rfc 2980, and rfc 3977, as well as a giganews and an inn server.
Mail and RDF
datasources and the
ui mail does not link the
ui to datasources in a "traditional" manner.
... instead of having a singleton datasource that is shared across all
ui components, we have per-view datasources.
... reflecting data to rdf in order to have a dynamic
ui that updates when the underlying content changes, a datasource must implement two key methods of reflecting data into rdf.
... content observers update
ui.
Creating a Custom Column
if you are unfamiliar with the setup and creation of an extension please read b
uilding a thunderbird extension.
...note that an object that implements this interface can also take control of an existing, b
uilt-in column, but more about that later.
...this function is a simple one liner along the lines of: function addcustomcolumnhandler() { gdbview.addcolumnhandler("colreplyto", columnhandler); } wrap up as you have seen it is q
uite easy to add your own custom column handler.
...rkent's junq
uilla) use i).
Using the Multiple Accounts API
the
ui will act slighty strange when you share information between accounts.
... the current plans prevent sharing of information between accounts using the
ui.
...use lsub instead of list) preference: mail.server.server.cleanup_inbox_on_exit - boolean, should we purge the inbox when we q
uit?
... preference: mail.server.server.empty_trash_on_exit boolean, (should not be imap-specific) - should we empty this server's trash when we q
uit?
DOM Inspector - Firefox Developer Tools
if you are looking for the dom inspector that's b
uilt into firefox, see the documentation for the page inspector.
... documentation introduction to dom inspector a g
uided tutorial that will help you get started with dom inspector.
... how to b
uild the dom inspector blog post on b
uilding the dom inspector from source.
...or, b
uild thunderbird yourself with the following options: ac_add_options --enable-extensions="default inspector" ac_add_options --enable-inspector-apis mozilla s
uite and seamonkey select tools > web development > dom inspector.
Debugger.Script - Firefox Developer Tools
the two cases are disting
uished by their format property being "js" or "wasm".
... debugger.script for jsscripts for debugger.script instances referring to a jsscript, they are disting
uished by their format property being "js".
... note that spidermonkey may use the same debugger.script instances for eq
uivalent functions or evaluated code—that is, scripts representing the same source code, at the same position in the same source file, evaluated in the same lexical environment.
... debugger.script for webassembly for debugger.script instances referring to a block of webassembly code, they are disting
uished by their format property being "wasm".
Debugger - Firefox Developer Tools
setting this to false prevents this debugger instance from req
uiring any code coverage instrumentation, but it does not guarantee that the instrumentation is not present.
...for example, an uncaught exception hook may have access to browser-level features like the alert function, which this api’s implementation does not, making it possible to present debugger errors to the developer in a way s
uited to the context.) debugger handler functions each debugger instance inherits accessor properties with which you can store handler functions for spidermonkey to call when given events occur in debuggee code.
... adoptdebuggeevalue(value) given a debuggee value value owned by an arbitrary debugger, return an eq
uivalent debuggee value owned by this debugger.
...if value is a debugger.object owned by an arbitrary debugger, return an eq
uivalent debugger.object owned by this debugger.
Dominators view - Firefox Developer Tools
if you already know what shallow size, retained size, and dominators are, skip to the dominators
ui section.
... dominators
ui to see the dominators view for a snapshot, select "dominators" in the "view" drop-down list.
... in the main part of the
ui, the first row is labeled "gc roots".
... in this way you can q
uickly get a sense of which objects retain the most memory in the snapshot.
Call Tree - Firefox Developer Tools
the screenshot below shows the output of a program that compares three sorting algorithms - bubble sort, selection sort, and q
uicksort.
...we have about six times as many samples in bubble sort as in selection sort, and 13 times as many as in q
uicksort.
... with this kind of digging, we can figure out the whole call graph, with associated sample count: sortall() // 8 -> sort() // 37 -> bubblesort() // 1345 -> swap() // 252 -> selectionsort() // 190 -> swap() // 1 -> q
uicksort() // 103 -> partition() // 12 platform data you'll also see some rows labeled gecko, input & events, and so on.
...if we look at the code for sort(), it should be fairly obvious that the high platform data cost is coming from repeated calls to console.log(): function sort(unsorted) { console.log(bubblesort(unsorted)); console.log(selectionsort(unsorted)); console.log(q
uicksort(unsorted)); } it would certainly be worthwhile considering more efficient ways of implementing this.
Flame Chart - Firefox Developer Tools
functions are color-coded to make them easier to disting
uish.
...e call tree page, we figured out that the program call graph in that profile, and the associated sample count, looked like this: sortall() // 8 -> sort() // 37 -> bubblesort() // 1345 -> swap() // 252 -> selectionsort() // 190 -> swap() // 1 -> q
uicksort() // 103 -> partition() // 12 first, we'll just select the whole section in which the program was active: at the top, colored purple, is the sortall() call, running throughout the program from start to finish.
...the sort() code is just this: function sort(unsorted) { console.log(bubblesort(unsorted)); console.log(selectionsort(unsorted)); console.log(q
uicksort(unsorted)); } the markers labeled "bubb..." and colored olive-green are presumably bubblesort().
... we can also see that two of the green markers are for selectionsort() and q
uicksort(), but we're also seeing calls to platform (gecko) code in between our calls to the sorting functions.
AnalyserNode.getByteFrequencyData() - Web APIs
the getbytefrequencydata() method of the analysernode interface copies the current frequency data into a
uint8array (unsigned byte array) passed into it.
... syntax var audioctx = new audiocontext(); var analyser = audioctx.createanalyser(); var dataarray = new
uint8array(analyser.frequencybincount); //
uint8array should be the same length as the frequencybincount void analyser.getbytefrequencydata(dataarray); // fill the
uint8array with data returned from getbytefrequencydata() parameters array the
uint8array that the frequency domain data will be copied to.
... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new
uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { drawvisual = requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, width, height); var barwidth = (width / bufferlength) * 2.5; var barheight; var x = 0; for(var i = 0; i < bufferlength; i++) { barheight = data...
...array[i]; canvasctx.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillrect(x,height-barheight/2,barwidth,barheight/2); x += barwidth + 1; } }; draw(); parameters array the
uint8array that the frequency domain data will be copied to.
AnalyserNode - Web APIs
analysernode.getbytefrequencydata() copies the current frequency data into a
uint8array (unsigned byte array) passed into it.
... analysernode.getbytetimedomaindata() copies the current waveform, or time-domain, data into a
uint8array (unsigned byte array) passed into it.
... examples note: see the g
uide visualizations with web audio api for more information on creating audio visualizations.
... analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new
uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // get a canvas defined with id "oscilloscope" var canvas = document.getelementbyid("oscilloscope"); var canvasctx = canvas.getcontext("2d"); // draw an oscilloscope of the current audio source function draw() { requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = "rgb(200, 200, ...
Bluetooth.requestDevice() - Web APIs
if there is no chooser
ui, this method returns the first device matching the criteria.
...this filter consists of an array of bluetoothserviceu
uids, a name parameter, and a nameprefix parameter.
... optionalservices[]: an array of bluetoothserviceu
uids.
...a proprietary 128-bit u
uid service c48e6067-5295-48d3-8d5c-0395f61792b1.
CanvasRenderingContext2D.lineCap - Web APIs
two g
uides to see the exact differences between the three are added.
... each of these lines starts and ends exactly on these g
uides.
...it's drawn completely flush with the g
uides.
... <canvas id="canvas" width="150" height="150"></canvas> const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const linecap = ['butt', 'round', 'square']; // draw g
uides ctx.strokestyle = '#09f'; ctx.beginpath(); ctx.moveto(10, 10); ctx.lineto(140, 10); ctx.moveto(10, 140); ctx.lineto(140, 140); ctx.stroke(); // draw lines ctx.strokestyle = 'black'; for (let i = 0; i < linecap.length; i++) { ctx.linewidth = 15; ctx.linecap = linecap[i]; ctx.beginpath(); ctx.moveto(25 + i * 50, 10); ctx.lineto(25 + i * 50, 140); ctx.stroke(); } screenshotlive sam...
Pixel manipulation with canvas - Web APIs
data a
uint8clampedarray representing a one-dimensional array containing the data in the rgba order, with integer values between 0 and 255 (included).
... the data property returns a
uint8clampedarray which can be accessed to look at the raw pixel data; each pixel is represented by four one-byte values (red, green, blue, and alpha, in that order; that is, "rgba" format).
... the
uint8clampedarray contains height × width × 4 bytes of data, with index values ranging from 0 to (height×width×4)-1.
...nst ycoord = 100; const canvaswidth = 1024; const getcolorindicesforcoord = (x, y, width) => { const red = y * (width * 4) + x * 4; return [red, red + 1, red + 2, red + 3]; }; const colorindices = getcolorindicesforcoord(xcoord, ycoord, canvaswidth); const [redindex, greenindex, blueindex, alphaindex] = colorindices; you may also access the size of the pixel array in bytes by reading the
uint8clampedarray.length attribute: var numbytes = imagedata.data.length; creating an imagedata object to create a new, blank imagedata object, you should use the createimagedata() method.
CompositionEvent - Web APIs
75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/
uievent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">
uievent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#d4dde4" fill="none"/><line x1="201" y1="25" x2="231"...
... properties this interface also inherits properties of its parent,
uievent, and its ancestor — event.
... methods this interface also inherits methods of its parent,
uievent, and its ancestor — event.
... specifications specification status comment
ui eventsthe definition of 'compositionevent' in that specification.
Constraint validation API - Web APIs
concepts and usage certain html form controls, such as <input>, <select> and <textarea>, can restrict the format of allowable values, using attributes like req
uired and pattern to set basic constraints.
...client side validation is a tool for giving q
uick feedback to the user.
...this will be displayed in the
ui if the element is the only form control with a validity problem; if a custom error message is set using setcustomvalidity(), this will be shown.
... examples take the following form: <form> <label for="name">enter username (upper and lowercase letters): </label> <input type="text" name="name" id="name" req
uired pattern="[a-za-z]+"> <button>submit</button> </form> the basic html form validation features will cause this to produce a default error message if you try to submit the form with either no valid filled in, or a value that does not match the pattern.
Document.compatMode - Web APIs
the document.compatmode property indicates whether the document is rendered in q
uirks mode or standards mode.
... syntax const mode = document.compatmode value an enumerated value that can be: "backcompat" if the document is in q
uirks mode.
... "css1compat" if the document is in no-q
uirks (also known as "standards") mode or limited-q
uirks (also known as "almost standards") mode.
... example if (document.compatmode == "backcompat") { // in q
uirks mode } specifications specification status comment domthe definition of 'compatmode' in that specification.
EventTarget.addEventListener() - Web APIs
because older browsers (as well as some not-too-old browsers) still assume the third parameter is a boolean, you need to b
uild your code to handle this scenario intelligently.
... const mybutton = document.getelementbyid('my-button-id'); const somestring = 'data'; mybutton.addeventlistener('click', function () { console.log(this); // expected value: 'data' }.bind(somestring)); this method is s
uitable when you don't need to know which html element the event listener fired on programmatically from within the event listener.
...this ie 8 polyfill only works in standards mode: a doctype declaration is req
uired.
... because it was essentially part of dom 0, this technique for adding event listeners is very widely supported and req
uires no special cross-browser code.
FocusEvent - Web APIs
75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/
uievent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">
uievent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#d4dde4" fill="none"/><line x1="201" y1="25" x2="231"...
... properties this interface also inherits properties from its parent
uievent, and indirectly from event.
...it inherits methods from its parent
uievent, and indirectly from event.
... specifications specification status comment
ui eventsthe definition of 'focusevent' in that specification.
HTMLTextAreaElement - Web APIs
req
uired boolean: returns / sets the element's req
uired attribute, indicating that the user must specify a value before submitting the form.
...praesent tristique commodo lorem q
uis fringilla.
...phasellus mattis, elit id fringilla semper, orci magna cursus ligula, non venenatis lacus augue sit amet d
ui.
... the following attributes have been added: autofocus, placeholder, dirname, wrap, maxlength, req
uired, textlength, labels, selectionstart, selectionend, selectiondirection, validity, validationmessage, and willvalidate.
ImageData() - Web APIs
the imagedata() constructor returns a newly instantiated imagedata object b
uilt from the typed array given and having the specified width and height.
... syntax new imagedata(array, width [, height]); new imagedata(width, height); parameters array optional a
uint8clampedarray containing the underlying pixel representation of the image.
... let imagedata = new imagedata(200, 100); // imagedata { width: 200, height: 100, data:
uint8clampedarray[80000] } initializing imagedata with an array this example instantiates an imagedata object with pixel colors defined by an array.
... const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const arr = new
uint8clampedarray(40000); // iterate through every pixel for (let i = 0; i < arr.length; i += 4) { arr[i + 0] = 0; // r value arr[i + 1] = 190; // g value arr[i + 2] = 0; // b value arr[i + 3] = 255; // a value } // initialize a new imagedata object let imagedata = new imagedata(arr, 200); // draw image data to the canvas ctx.putimagedata(imagedata, 20, 20); result specification ...
InputEvent - Web APIs
75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/
uievent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">
uievent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#d4dde4" fill="none"/><line x1="201" y1="25" x2="231"...
... properties this interface inherits properties from its parents,
uievent and event.
... methods this interface inherits methods from its parents,
uievent and event.
... working draft
ui eventsthe definition of 'inputevent' in that specification.
compareVersion - Web APIs
method of installtrigger object syntax int compareversion ( string registryname, installversion version); int compareversion ( string registryname, string version); int compareversion ( string registryname, int major, int minor, int release, int b
uild); parameters the compareversion method has the following parameters: registryname the pathname in the client version registry for the component whose version is to be compared.
... version an installversion object containing version information or a string in the format major.minor.release.b
uild, where major, minor, release, and b
uild are integer values representing version information.
... -1 registryname has a smaller (earlier) b
uild number than version.
... 1 registryname has a larger (newer) b
uild number than version.
KeyboardEvent.initKeyEvent() - Web APIs
favor the modern constructor structure as the only cross-browser way of b
uilding events.
... viewarg specifies the
uievent.view; this value may be null.
... example var event = document.createevent('keyboardevent'); // create a key event // define the event event.initkeyevent("keypress", // typearg, true, // canbubblearg, true, // cancelablearg, null, // viewarg, specifies
uievent.view.
... the initkeyevent is the current gecko eq
uivalent of the dom level 3 events (initially drafted and also deprecated in favor of keyboardevent() keyboard.initkeyboardevent() method with the following arguments : typearg of type domstring canbubblearg of type boolean cancelablearg of type boolean viewarg of type views::abstractview keyidentifierarg of type domstring keylocationarg of type unsigned long modifierslist of type domstring); ...
MSCandidateWindowShow - Web APIs
on internet explorer in the new windows
ui, this event is supported in windows 8.1 imes of all languages.
... example in ie11, developers can detect the opening of the ime candidate window by listening to mscandidatewindowshow event, then call getcandidatewindowclientrect() function to find out where the candidate window is and position the suggestion
ui away from it: var context = document.getelementbyid("mysearchbox").msgetinputcontext(); context.addeventlistener("mscandidatewindowshow", candidatewindowshowhandler); function candidatewindowshowhandler(e) { var imerect = context.getcandidatewindowclientrect(); var suggestionrect = document.getelementbyid("mysuggestionlist").getboundingclientrect(); // check if the two rects intersect,...
...developers could listen to them and shift the suggestion
ui accordingly.
... see also microsoft api extensions ime handling g
uide for gecko ...
Using the MediaStream Recording API - Web APIs
this article aims to provide a basic g
uide on how to use the mediarecorder interface, which provides this api.
... a sample application: web dictaphone to demonstrate basic usage of the mediarecorder api, we have b
uilt a web-based dictaphone.
... for example, in web dictaphone we have three main
ui areas, stacked vertically.
...st of all, we style the <label> how we want it, making sure that it has enough z-index to always sit above the other elements and therefore be focusable/clickable: label { font-family: 'notocoloremoji'; font-size: 3rem; position: absolute; top: 2px; right: 3px; z-index: 5; cursor: pointer; } then we hide the actual checkbox, because we don't want it cluttering up our
ui: input[type=checkbox] { position: absolute; top: -100px; } next, we style the information screen (wrapped in an <aside> element) how we want it, give it fixed position so that it doesn't appear in the layout flow and affect the main
ui, transform it to the position we want it to sit in by default, and give it a transition for smooth showing/hiding: aside { position: fixed; top: 0; ...
Navigator - Web APIs
navigatorlanguage.language read only returns a domstring representing the preferred language of the user, usually the language of the browser
ui.
... non-standard navigator.b
uildid returns the b
uild identifier of the browser.
... navigator.mediasession returns mediasession object which can be used to provide metadata that can be used by the browser to present information about the currently-playing media to the user, such as in a global media controls
ui.
... navigator.productsub returns the b
uild number of the current browser (e.g., "20060909").
PaymentAddress.toJSON() - Web APIs
to change preferences in chrome, visit chrome://flags.edge full support 15firefox full support 62notes disabled full support 62notes disabled notes available only in nightly b
uilds.
... req
uires the comma-delineated list in dom.payments.request.supportedregions to contain one or more of the supported 2-character iso locales, currently us and ca.disabled from version 62: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...to change preferences in chrome, visit chrome://flags.firefox android full support 62notes disabled full support 62notes disabled notes available only in nightly b
uilds.
... req
uires the comma-delineated list in dom.payments.request.supportedregions to contain one or more of the supported 2-character iso locales, currently us and ca.disabled from version 62: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
Using the Performance API - Web APIs
a fundamental req
uirement of web performance is a precise and consistent definition of time.
... web performance interfaces are defined in a s
uite of standards.
...this g
uide describes how to use the performance interfaces that are defined in the high-resolution time standard.
... other web performance g
uides (listed in the see also section) describe how to use additional methods and properties of the performance interface.
PublicKeyCredentialCreationOptions.authenticatorSelection - Web APIs
req
uireresidentkeyoptional a boolean which indicated that the credential private key must be stored in the authenticator, the client or in a client device.
...the values may be: "req
uired": user verification is req
uired, the operation will fail if the response does not have the uv flag (as part of the authenticatordata property of authenticatorattestationresponse.attestationobject) "preferred": user verification is prefered, the operation will not fail if the response does not have the uv flag (as part of the authenticatordata property of authenticatorattestationresponse.attestationobject) "discouraged": user verification should not be employed as to minimize the user interaction during the process.
... the authenticator used for the creation of the public key credential must comply with the req
uirements.
... examples var publickey = { authenticatorselection:{ authenticatorattachment: "cross-platform", req
uireresidentkey: true, userverification: "req
uired" }, challenge: new
uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new
uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response...
RTCPeerConnection - Web APIs
however, browsers are not req
uired to provide any default ice servers at all.iceconnectionstate read only the read-only property rtcpeerconnection.iceconnectionstate returns an enum of type rtciceconnectionstate which state of the ice agent associated with the rtcpeerconnection.icegatheringstate read only the read-only property rtcpeerconnection.icegatheringstate returns an enum of type rtcicegatheringstate that describes con...
...this event is fired when a change has occurred which req
uires session negotiation.
...if something happens that req
uires collecting new candidates, such as a new interface being added or the addition of a new ice server, the state will revert to "gathering" to gather those candidates.
... "req
uire" tells the ice agent to gather ice candidates for only rtp, and to multiplex rtcp atop them.
ReadableStream - Web APIs
while the stream is locked, no other reader can be acq
uired until this one is released.
...while the stream is locked, no other reader can be acq
uired until this one is released.
... it demonstrates the usage of a readablestream in combination with a
uint8array.
... fetch("https://www.example.org/").then((response) => { const reader = response.body.getreader(); const stream = new readablestream({ start(controller) { // the following function handles each data chunk function push() { // "done" is a boolean and value a "
uint8array" reader.read().then(({ done, value }) => { // is there no more data to read?
TouchEvent - Web APIs
the touchevent interface represents an
uievent which is sent when the state of contacts with a touch-sensitive surface changes.
...75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/
uievent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">
uievent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#d4dde4" fill="none"/><line x1="201" y1="25" x2="231"...
... properties this interface inherits properties from its parent,
uievent and event.
... the touch point has left the document window and moved into the browser's
ui area, a plug-in, or other external content.
Touch events - Web APIs
("touchstart:" + i + "..."); ongoingtouches.push(copytouch(touches[i])); var color = colorfortouch(touches[i]); ctx.beginpath(); ctx.arc(touches[i].pagex, touches[i].pagey, 4, 0, 2 * math.pi, false); // a circle at the start ctx.fillstyle = color; ctx.fill(); console.log("touchstart:" + i + "."); } } this calls event.preventdefault() to keep the browser from contin
uing to process the touch event (this also prevents a mouse event from also being delivered).
... function handlemove(evt) { evt.preventdefault(); var el = document.getelementbyid("canvas"); var ctx = el.getcontext("2d"); var touches = evt.changedtouches; for (var i = 0; i < touches.length; i++) { var color = colorfortouch(touches[i]); var idx = ongoingtouchindexbyid(touches[i].identifier); if (idx >= 0) { console.log("contin
uing touch "+idx); ctx.beginpath(); console.log("ctx.moveto(" + ongoingtouches[idx].pagex + ", " + ongoingtouches[idx].pagey + ");"); ctx.moveto(ongoingtouches[idx].pagex, ongoingtouches[idx].pagey); console.log("ctx.lineto(" + touches[i].pagex + ", " + touches[i].pagey + ");"); ctx.lineto(touches[i].pagex, touches[i].pagey); ctx.linewidth = 4; ctx.strokesty...
... handling canceled touches if the user's finger wanders into browser
ui, or the touch otherwise needs to be canceled, the touchcancel event is sent, and we call the handlecancel() function below.
...it is only intended as a g
uide.) function ontouch(evt) { evt.preventdefault(); if (evt.touches.length > 1 || (evt.type == "touchend" && evt.touches.length > 0)) return; var newevt = document.createevent("mouseevents"); var type = null; var touch = null; switch (evt.type) { case "touchstart": type = "mousedown"; touch = evt.changedtouches[0]; break; case "touchmove": type = "...
TransformStream - Web APIs
methods none examples anything-to-
uint8array stream in the following example, a transform stream passes through all chunks it receives as
uint8array values.
... const transformcontent = { start() {}, // req
uired.
... async transform(chunk, controller) { chunk = await chunk switch (typeof chunk) { case 'object': // just say the stream is done i guess if (chunk === null) controller.terminate() else if (arraybuffer.isview(chunk)) controller.enqueue(new
uint8array(chunk.buffer, chunk.byteoffset, chunk.bytelength)) else if (array.isarray(chunk) && chunk.every(value => typeof value === 'number')) controller.enqueue(new
uint8array(chunk)) else if ('function' === typeof chunk.valueof && chunk.valueof() !== chunk) this.transform(chunk.valueof(), controller) // hack else if ('tojson' in chunk) this.transform(json.stringify(chunk), controller) break case 'symbol': controller.error("cannot send a symb...
...examples include b
uilding a pwa with progressive loading and progressive streaming.
WebGLRenderingContext.readPixels() - Web APIs
syntax // webgl1: void gl.readpixels(x, y, width, height, format, type, pixels); // webgl2: void gl.readpixels(x, y, width, height, format, type, glintptr offset); void gl.readpixels(x, y, width, height, format, type, arraybufferview pixels, gl
uint dstoffset); parameters x a glint specifying the first horizontal pixel that is read from the lower left corner of a rectangular block of pixels.
...
uint8array for gl.unsigned_byte.
...
uint16array for gl.unsigned_short_5_6_5, gl.unsigned_short_4_4_4_4, or gl.unsigned_short_5_5_5_1.
... examples var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var pixels = new
uint8array(gl.drawingbufferwidth * gl.drawingbufferheight * 4); gl.readpixels(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight, gl.rgba, gl.unsigned_byte, pixels); console.log(pixels); //
uint8array specifications specification status comment webgl 1.0the definition of 'readpixels' in that specification.
WebGL types - Web APIs
gl
uint unsigned long 32-bit twos complement unsigned integer.
... type web idl type description gl
uint64ext long long unsigned 64-bit integer number.
... ext_disjoint_timer_querythe definition of 'gl
uint64ext' in that specification.
... working draft adds gl
uint64ext ...
Lifetime of a WebRTC session - Web APIs
webrtc lets you b
uild peer-to-peer communication of arbitrary data, audio, or video—or any combination thereof—into a browser application.
... this article doesn't get into details of the actual apis involved in establishing and handling a webrtc connection; it simply reviews the process in general with some information about why each step is req
uired.
... this page is currently under construction, and some of the content will move to other pages as the webrtc g
uide material is b
uilt out.
... signaling signaling is the process of sending control information between two devices to determine the communication protocols, channels, media codecs and formats, and method of data transfer, as well as any req
uired routing information.
A simple RTCDataChannel sample - Web APIs
the html first, let's take a q
uick look at the html that's needed.
...getelementbyid('sendbutton'); messageinputbox = document.getelementbyid('message'); receivebox = document.getelementbyid('receivebox'); // set event listeners for user interface widgets connectbutton.addeventlistener('click', connectpeers, false); disconnectbutton.addeventlistener('click', disconnectpeers, false); sendbutton.addeventlistener('click', sendmessage, false); } this is q
uite straightforward.
...now the remoteconnection knows about the connection that's being b
uilt.
... in a real application, this would req
uire a signaling server to exchange the description object.
WebXR permissions and security - Web APIs
in this g
uide, we'll cover how to ensure your app has the permissions it needs to provide a secure and private xr experience.
... immersive presentation of vr first, any requests to activate the immersive-vr mode are rejected if the domain iss
uing the request does not have permission to enable an immersive session.
... inline presentation when you request an xrsession with the mode set to inline, and any features are req
uired or requested, the browser will only allow the session to be created if the call to requestsession() was made by code which is executing expressly due to user intent.
... note: additional req
uirements may be put into effect due to the specific features requested by the options object when calling requestsession().
Rendering and the WebXR frame animation callback - Web APIs
this figure goes by a number of different names, but they're all eq
uivalent or nearly so: refresh rate vertical refresh rate vertical blanking rate (vbl) vertical sync rate vertical refresh rate there are other similar terms used as well, but regardless of what it's called, the unit of measurement applied is the hertz, or hz.
...see the webxr performance g
uide for recommendations and tips that will help you ensure your performance is as good as it can be.
... that distance (or whatever pupillary distance the xr system is configured to use) is eno
uigh to allow our minds to see just enough difference due to retinal disparity (the difference in what each retina sees) and the parallax effect to allow our brains to calculate the distance to and depth of objects, thus enabling us to percieve three dimensions despite our retinas only being 2d surfaces.
... when the loop that's iterating over the views ends, every image req
uired to represent the scene to the viewer has been rendered, and upon return, the framebuffer makes its way through the gpu and eventually to the xr device's display or displays.
Web Audio API best practices - Web APIs
in this article, we'll share a number of best practices — g
uidelines, tips, and tricks for working with the web audio api.
...it provides advanced scheduling capabilities, synths, and effects, and int
uitive musical abstractions b
uilt on top of the web audio api.
... r-audio, from the bbc's research & development department, is a library of react components aiming to provide a "more int
uitive, declarative interface to web audio".
... bearing this in mind, if your website or application req
uires timing and scheduling, it's best to stick with the audioparam methods for setting values.
Web audio spatialization basics - Web APIs
3d boombox demo to demonstrate 3d spatialization we've created a modified version of the boombox demo we created in our basic using the web audio api g
uide.
...when we move the boombox, the sound it produces changes accordingly, panning as it moves to the left or right of the room, or becoming q
uieter as it is moved away from the user or is rotated so the speakers are facing away from them, etc.
...we can keep that at the default value of 1 as well: const refdistance = 1; then there's the roll-off factor (rollofffactor) — how q
uickly does the volume reduce as the panner moves away from the listener.
... } moving = moveboombox(direction); }, false); window.addeventlistener('mouseup', function() { if (moving && moving.frameid) { window.cancelanimationframe(moving.frameid); } }, false) }) summary hopefully, this article has given you an insight into how web audio spatialization works, and what each of the pannernode properties do (there are q
uite a few of them).
WheelEvent - Web APIs
75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/
uievent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="153.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">
uievent</text></a><polyline points="191,25 201,20 201,30 191,25" stroke="#d4dde4" fill="none"/><line x1="201" y1="25" x2="231"...
... properties this interface inherits properties from its ancestors, mouseevent,
uievent, and event.
... methods this interface doesn't define any specific methods, but inherits methods from its ancestors, mouseevent,
uievent, and event.
... specifications specification status comment
ui eventsthe definition of 'the wheelevent interface' in that specification.
WritableStream.getWriter() - Web APIs
while the stream is locked, no other writer can be acq
uired until this one is released.
... it shows the creation of the writablestream with a custom sink and an api-supplied que
uing strategy.
... defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const que
uingstrategy = new countque
uingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new
uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = docume...
...nt.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, que
uingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
WritableStream - Web APIs
this object comes with b
uilt-in backpressure and que
uing.
...while the stream is locked, no other writer can be acq
uired until this one is released.
... defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const que
uingstrategy = new countque
uingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new
uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = docume...
...nt.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, que
uingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
WritableStreamDefaultWriter - Web APIs
writablestreamdefaultwriter.desiredsizeread only returns the desired size req
uired to fill the stream's internal queue.
... examples the following example shows the creation of a writablestream with a custom sink and an api-supplied que
uing strategy.
... defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const que
uingstrategy = new countque
uingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new
uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listite...
...eateelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, que
uingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
XRPermissionDescriptor.mode - Web APIs
syntax xrpermissiondescriptor = { mode: xrsessionmode, req
uiredfeatures: reqfeaturelist, optionalfeatures: optfeaturelist }; xrpermissiondescriptor.mode = xrsessionmode; xrmode = xrpermissiondescriptor.mode; value a domstring whose value is one of the strings found in the xrsessionmode enumerated type: immersive-ar the session's output will be given exclusive access to the immersive device, but the rendered content will be blended with the real-world environment.
...the environmentblendmode is expected to be opaque if possible, but might be additive if the hardware req
uires it.
...inline sessions don't req
uire special hardware and should be avalable on any user agent offering webxr api support.
...no specific features are specified during this query; see req
uiredfeatures and optionalfeatures for more information on specifying features during a webxr permission check.
XRPermissionDescriptor - Web APIs
optionalfeatures an array of strings, each specifying the name of a webxr feature which is requested but not req
uired for the app to function.
... req
uiredfeatures an array of strings giving the names of the webxr features for which permission must be obtained in order to use your app or site.
... examples the example below demonstrates performing the permission request for an application that req
uires the local-floor reference space in an immersive-vr environment.
... let xrpermissiondesc = { name: "xr", mode: "immersive-vr", req
uiredfeatures: [ "local-floor" ] }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({state}) => { switch(state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr...
XRReferenceSpace: reset event - Web APIs
the reset event is sent to an xrreferencespace object when a discontin
uity is detected in either the native origin or the effective origin, causing a jump in the position or orientation of objects oriented using the reference space.
... handling discontin
uities you can handle jumps in the viewer's position by watching the boolean xrpose property emulatedposition.
... the effect of discontin
uity size the reset event won't be fired when the discontin
uity is small enough that the device is able to regain tracking within the same tracking area.
... nor will be be fired at an unbounded reference space as it makes small adjustments to its native origin over time to maintain the space's stability in the vicinity of the user; only large discontin
uities will trigger a reset.
XRSystem: requestSession() - Web APIs
the environmentblendmode is expected to be opaque if possible, but might be additive if the hardware req
uires it.
...inline sessions don't req
uire special hardware and should be avalable on any user agent offering webxr api support.
... notsupportederror there is no webxr-compatible device available, or the device does not support the specified sessionmode; this can also be thrown if any of the req
uired options are unsupported.
...adding controls is a necessary step because entering xr req
uires a user action.
ARIA: List role - Accessibility
req
uired javascript features none.
... unlike the html <ol> and <ul>, the aria list roles doesn't disting
uish between ordered and unordered lists.
... for example, our above example should be rewritten as follows: <ul> <li>list item 1</li> <li>list item 2</li> <li>list item 3</li> </ul> or use an ordered list if the order of the list items matters: <ol> <li>list item 1</li> <li>list item 2</li> <li>list item 3</li> </ol> note: the aria list/listitem roles don't disting
uish between ordered and unordered lists.
... as an aside, note that if you are using the semantic html elements of ol or ul and apply a role of presentation, each child li element inherits the presentation role because aria req
uires the listitem elements to have the parent list element.
ARIA: switch role - Accessibility
utton" role="switch" aria-checked="true" id="speakerpower" class="switch"> <span>off</span> <span>on</span> </button> <label for="speakerpower" class="switch">speaker power</label> description the aria switch role is identical to the checkbox role, except instead of being "checked" or "unchecked", it is either "on" and "off." like the checkbox role, the aria-checked attribute is req
uired.
...the developer is req
uired to change the value of the aria-checked attribute dynamically when the switch is toggled.
... associated aria roles, states, and properties aria-checked attribute the aria-checked attribute is req
uired when using the switch role, as it represents the current state of the widget that the switch role is applied to.
... req
uired javascript features handler for click events when the user clicks on the switch widget, a click event is fired, which must be handled in order to change the state of the widget.
ARIA: table role - Accessibility
aria-colcount attribute this attribute is only req
uired if the columns are not present in the dom all the time.
... aria-rowcount attribute this attribute is only req
uired if the rows are not present in the dom all the time, such as scrollable tables that reuse rows to minimize the number of dom nodes.
... keyboard interactions none req
uired javascript features none.
... the first rule of aria use is if you can use a native feature with the semantics and behavior you req
uire already b
uilt in, instead of re-purposing an element and adding an aria role, state or property to make it accessible, then do so.
ARIA: textbox role - Accessibility
ut field --> <div id="txtboxlabel">enter your five-digit zipcode</div> <div role="textbox" contenteditable="true" aria-placeholder="5-digit zipcode" aria-labelledby="txtboxlabel"></div> <!-- multi-line text area --> <div id="txtboxmultilinelabel">enter the tags for the article</div> <div role="textbox" contenteditable="true" aria-multiline="true" aria-labelledby="txtboxmultilinelabel" aria-req
uired="true"></div> semantic elements are more concise and req
uire no javascript to support textbox features.
... <label for="txtbox">enter your five-digit zipcode</label> <input type="text" placeholder="5-digit zipcode" id="txtbox"/> <!-- multi-line text area --> <label for="txtboxmultiline">enter the tags for the article</label> <textarea id="txtboxmultiline" req
uired></textarea> where a text field is read-only, indicated this by setting aria-readonly="true" on the element.
... aria-req
uired attribute indicates that a value must be provided for the field before it is submitted.
... instead of using aria-req
uired, use the semantic <input type="text"> or <textarea> with a req
uired attribute.
WAI-ARIA Roles - Accessibility
this section is commonly called a footer.aria: dialog rolethe dialog role is used to mark up an html based application dialog or window that separates content or
ui from the rest of the web application or page.
...a figure is generally considered to be one or more images, code snippets, or other content that puts across information in a different way to a regular flow of text.aria: form rolethe form landmark role can be used to identify a group of elements on a page that provide eq
uivalent functionality to an html form.aria: grid rolethe grid role is for a widget that contains one or more rows of cells.
...this is semantically eq
uivalent to the html <mark> element.
... alertdialog banner combobox command columnheader (estelle) complementary composite definition directory feed gridcell (eric e) group input landmark link - old page listbox log - old page marquee math menu menubar men
uitem men
uitemcheckbox men
uitemradio none note option presentation progressbar - old page radio - old page radiogroup range region roletype rowheader(estelle) scrollbar searchbox section sectionhead select separator slider - old page spinbutton status - old page structure tab tablist (michiel) tabpanel (michiel) term timer toolbar tooltip tree treegrid treeitem wid...
Accessibility: What users can do to browse more safely - Accessibility
this article discusses making web content accessible for those with vestibular disorders, and those who support them, by taking advantage of personalization and accessibility settings b
uilt into the operating systems.
...there is a github repository for it at https://github.com/0
ui/gif-scrubber beeline reader beeline reader has a browser extension that allows you to set up for grayscale and dyslexi font, among other things take advantage operating system accessibility features most operating systems such as windows 10, have accessibility options that are surprisingly powerful.
... usually they are q
uite easy to find by simply typing ( or saying) in the word, "accessibility" in the search finder of the operating system.
... grayscale those who have sufferred traumatic brain injury (tbi) may be highly sensitive to color; it can req
uire such a great "investment of cognitive energy" on their part, there's no energy for other daily tasks.
Web accessibility for seizures and physical reactions - Accessibility
the specifications also note the difference in technology, such as e-ink, which remains readable in bright daylight, versus liq
uid crystals, which do not.
... personalization help and support the req
uirement for the literal property is taken from section 23 non-literal text and images req
uirement: some users cannot understand non-literal text and icons such as metaphors, idioms etc.
...editor harding along with the peat tool, is generaly recognized to be one of the two "gold standards" for analyzing flashes harding flash and pattern analyzer iso iec 61966-2-2:2003(en) multimedia systems and eq
uipment — colour measurement and management — part 2-2: colour management — extended rgb colour space — scrgb photosensitive epilepsy analysis tool along with the harding tool, is generaly recognized to be one of the two "gold standards" for analyzing flashes trace research and development center using peat to create seizureless web animations w3c css color module level 3 person...
...w threshhold understanding sc 2.3.1 understanding wcag 2.0 (older, but contains some explanations of references made in the wcag 2.1 criteria) three flashes or below threshold understanding success criterion 2.3.1 understanding wcag 2.1 understanding success criteria 1.4.3: contrast (minimum) web accessibility initiative (wai) web animations model w3c working draft web content accessibility g
uidelines (wcag) 2.0 definition of relative luminance web content accessibility g
uidelines (wcag) 2.1 contributers: heartfelt thanks to teal; wayne dick of the low vision task force of the w3c; tom jewett and eric eggert from knowbility; jim allan of the diagram center; and dr.
Accessibility
wai-aria basics following on from the previous article, sometimes making complex
ui controls that involve unsemantic html and dynamic javascript-updated content can be difficult.
... other documentation understanding the web content accessibility g
uidelines this set of articles provides q
uick explanations to help you understand the steps that need to be taken to conform to the recommendations outlined in the w3c web content accessibility g
uidelines 2.0 (wcag 2.0 or just wcag, for the purposes of this writing).
...keyboard accessibility is part of the minimum accessibility req
uirements which a developer should be aware of.
... assistive technology (at) development a collection of articles intended for at developers mobile accessibility checklist this document provides a concise checklist of accessibility req
uirements for mobile app developers.
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
one of the reasons that flexbox q
uickly caught the interest of web developers is that it brought proper alignment capabilities to the web for the first time.
...in this g
uide, we will take a thorough look at how the alignment and justification properties work in flexbox.
... properties that control alignment the properties we will look at in this g
uide are as follows.
... for align-content to work you need more height in your flex container than is req
uired to display the items.
Basic concepts of flexbox - CSS: Cascading Style Sheets
this article gives an outline of the main features of flexbox, which we will be exploring in more detail in the rest of these g
uides.
... find out more about wrapping flex items in the g
uide mastering wrapping of flex items.
...we do this by way of three properties: flex-grow flex-shrink flex-basis we will take a brief look at these properties in this overview, and you can gain a fuller understanding in the g
uide controlling ratios of flex items on the main axis.
... using flex: auto is the same as using flex: 1 1 auto; everything is as with flex:initial but in this case the items can grow and fill the container as well as shrink if req
uired.
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
in this g
uide i will explain how this works, what it is designed for and what situations really req
uire css grid layout rather than flexbox.
... it is this req
uirement that the gap properties, once implemented, will solve for us.
...the third item has more content than the others yet is set to visibility: collapse and therefore the flex container is retaining a strut of the height req
uired to display this item.
... if this causes a problem for your layout it may req
uire a rethinking of the structure, for example putting each row into a separate flex container in order that they can’t shift rows.
Introduction to formatting contexts - CSS: Cascading Style Sheets
as explained in the g
uide to in-flow and out of flow elements, the float has been taken out of flow so the background and border of the div only contain the content and not the float.
... other formatting contexts this g
uide covers flow layout and is therefore not referring to other possible formatting contexts.
... summary in this g
uide, we have looked in more detail at the block and inline formatting contexts and the important subject of creating a block formatting context (bfc).
... in the next g
uide, we will find out how normal flow interacts with different writing modes.
CSS Fonts - CSS: Cascading Style Sheets
nt-variant-ligatures: normal; font-size: 2rem; letter-spacing: 1px; } <p>three hundred years ago<br> i thought i might get some sleep<br> i stretched myself out onna antique bed<br> an' my spirit did a midnite creep</p> the result is as follows: variable fonts examples you can find a number of variable fonts examples at v-fonts.com and axis-praxis.org; see also our variable fonts g
uide for more information and usage information.
... font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-variation-settings font-weight line-height at-rules @font-face font-family font-feature-settings font-style font-variant font-weight font-stretch src unicode-range @font-feature-values g
uides fundamental text and font styling in this beginner's learning article we go through all the basic fundamentals of text/font styling in detail, including setting font weight, family and style, font shorthand, text alignment and other effects, and line and letter spacing.
... opentype font features g
uide font features or variants refer to different glyphs or character styles contained within an opentype font.
... variable fonts g
uide variable fonts are an evolution of the opentype font specification that enables many different variations of a typeface to be incorporated into a single file, rather than having a separate font file for every width, weight, or style.
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
re-ordering content in css grid layout we’ve already seen in these g
uides that grid gives us power to re-order the content of our page in various ways.
...as is noted in the css grid layout specification, this is q
uite often going to give you a good structure for your smallest screen devices too.
... if a user is scrolling through a long document on mobile, the priorities for that user q
uite often map to what should be a priority in the source.
...for more information about this interaction see the g
uide on the relationship of grid layout to other layout methods and the section on display: contents.
Mozilla CSS extensions - CSS: Cascading Style Sheets
fixed version still accepted] -moz-transition-property [prefixed version still accepted] -moz-transition-timing-function [prefixed version still accepted] -moz-user-select values global values -moz-initial -moz-appearance button button-arrow-down button-arrow-next button-arrow-previous button-arrow-up button-bevel checkbox checkbox-container checkbox-label checkmen
uitem dialog groupbox listbox menuarrow menucheckbox men
uimage men
uitem men
uitemtext menulist menulist-button menulist-text menulist-textfield menupopup menuradio menuseparator -moz-mac-unified-toolbar -moz-win-borderless-glass -moz-win-browsertabbar-toolbox -moz-win-communications-toolbox -moz-win-glass -moz-win-media-toolbox -moz-window-button-box -moz-window-button-box-maxi...
...mized -moz-window-button-close -moz-window-button-maximize -moz-window-button-minimize -moz-window-button-restore -moz-window-titlebar -moz-window-titlebar-maximized progressbar progresschunk radio radio-container radio-label radiomen
uitem resizer resizerpanel scale-horizontal scalethumb-horizontal scalethumb-vertical scale-vertical scrollbarbutton-down scrollbarbutton-left scrollbarbutton-right scrollbarbutton-up scrollbar-small scrollbarthumb-horizontal scrollbarthumb-vertical scrollbartrack-horizontal scrollbartrack-vertical separator spinner spinner-downbutton spinner-textfield spinner-upbutton statusbar statusbarpanel tab tabpanels tab-scroll-arrow-back tab-scroll-arrow-forward textfield textfield-multiline toolbar toolbarbutton-dropdown toolbo...
...gecko 62 -moz-inline-stackobsolete since gecko 62 -moz-inline-table -moz-gridobsolete since gecko 62 -moz-grid-groupobsolete since gecko 62 -moz-grid-lineobsolete since gecko 62 -moz-groupbox -moz-deckobsolete since gecko 62 -moz-popupobsolete since gecko 62 -moz-stackobsolete since gecko 62 -moz-markerobsolete since gecko 62 empty-cells -moz-show-background (default value in q
uirks mode) font -moz-button -moz-info -moz-desktop -moz-dialog (also a color) -moz-document -moz-workspace -moz-window -moz-list -moz-pull-down-menu -moz-field (also a color) font-family -moz-fixed image-rendering -moz-crisp-edges <length> -moz-calc list-style-type -moz-arabic-indic -moz-bengali -moz-cjk-earthly-branch -moz-cjk-heavenly-stem -moz-deva...
...able-column-group ::-moz-table-outer ::-moz-table-row ::-moz-table-row-group :-moz-tree-cell :-moz-tree-cell-text :-moz-tree-cell-text(hover) :-moz-tree-checkbox :-moz-tree-column :-moz-tree-drop-feedback :-moz-tree-image :-moz-tree-indentation :-moz-tree-line :-moz-tree-progressmeter :-moz-tree-row :-moz-tree-row(hover) :-moz-tree-separator :-moz-tree-twisty u – x :-moz-
ui-invalid :-moz-
ui-valid :-moz-user-disabled ::-moz-viewport ::-moz-viewport-scroll :-moz-window-inactive ::-moz-xul-anonymous-block at-rules @-moz-document media features -moz-mac-graphite-theme -moz-maemo-classic -moz-device-pixel-ratio -moz-os-version -moz-scrollbar-end-backward -moz-scrollbar-end-forward -moz-scrollbar-start-backward -moz-scrollbar-start-forward -moz...
Syntax - CSS: Cascading Style Sheets
the css syntax reflects this goal and its basic b
uilding blocks are: the property which is an identifier, that is a human-readable name, that defines which feature is considered.
... css statements rulesets are the main b
uilding blocks of a style sheet, which often consists of only a big list of them.
... a statement is a b
uilding block that begins with any non-space characters and ends at the first closing brace or semi-colon (outside a string, non-escaped and not included into another {}, () or [] pair).
... at-rules that start with an at sign, '@' (u+0040 commercial at), followed by an identifier and then contin
uing up to the end of the statement, that is up to the next semi-colon (;) outside of a block, or the end of the next block.
Value definition syntax - CSS: Cascading Style Sheets
note: juxtaposition has precedence over the double ampersand, meaning that bold thin && <length> is eq
uivalent to [ bold thin ] && <length>.
... note: the double ampersand has precedence over the double bar, meaning that bold || thin && <length> is eq
uivalent to bold || [ thin && <length> ].
... note: the double bar has precedence over the single bar, meaning that bold | thin || <length> is eq
uivalent to bold | [ thin || <length> ].
... exclamation point (!) the exclamation point multiplier after a group indicates that the group is req
uired, and must produce at least one value; even if the grammar of the items within the group would otherwise allow the entire contents to be omitted, at least one component value must not be omitted.
break-inside - CSS: Cascading Style Sheets
q
uisque commodo eget nisi sed pretium.
...fusce iaculis urna id neque dapibus, eu lacinia lectus dictum.</p> <figure> <img src="https://udn.realityripple.com/samples/fe/4508d88f78.png"> <figcaption>the firefox logo — fox wrapped around the world</figcaption> </figure> <p>praesent condimentum d
ui d
ui, sit amet rutrum diam tincidunt eu.
...q
uisque consequat velit eu orci malesuada, ut interdum tortor molestie.
...d
uis suscipit faucibus d
ui sed ultricies.</p> </article> css html { font-family: helvetica, arial, sans-serif; } body { width: 80%; margin: 0 auto; } h1 { font-size: 3rem; letter-spacing: 2px; column-span: all; } h1 + p { margin-top: 0; } p { line-height: 1.5; break-after: column; } figure { break-inside: avoid; } img { max-width: 70%; display: block; margin: 0 auto; } figcaption { font-style: italic; font-size: 0.8rem; width: 70%; } article { column-width: 200px; gap: 20px; } result specifications specification status comment css fragmentation module level 3the definitio...
conic-gradient() - CSS: Cascading Style Sheets
syntax /* a conic gradient rotated 45 degrees, starting blue and finishing red */ conic-gradient(from 45deg, blue, red); /* a a bl
uish purple box: the gradient goes from blue to red, but as only the bottom right quadrant is visible, as the center of the conic gradient is in at the top left corner */ conic-gradient(from 90deg at 0 0, blue, red); /* colorwheel */ background: conic-gradient( hsl(360, 100%, 50%), hsl(315, 100%, 50%), hsl(270, 100%, 50%), hsl(225, 100%, 50%), hsl(180, 100%, 50%), hsl(...
...the following two gradients are eq
uivalent conic-gradient(red, orange, yellow, green, blue); conic-gradient(red 0deg, orange 90deg, yellow 180deg, green 270deg, blue 360deg); by default, colors transition smoothly from the color at one color stop to the color at the subsequent color stop, with the midpoint between the colors being the half way point between the color transition.
...the following two declarations are eq
uivalent: conic-gradient(#fff 0.09turn, #bbb 0.09turn, #bbb 0.27turn, #666 0.27turn, #666 0.54turn, #000 0.54turn); conic-gradient(#fff 0turn 0.09turn, #bbb 0.09turn 0.27turn, #666 0.27turn 0.54turn, #000 0.54turn 1turn); color stops should be listed in ascending order.
... mdn understanding wcag, g
uideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 examples gradient at 40-degrees div { width: 100px; height: 100px; } <div></div> div { background-image: conic-gradient(from 40deg, #fff, #000); } off-centered gradient div { width: 100px; height: 100px; } <div></div> div { background: conic-gradient(from 0deg at 0% 25%, ...
linear-gradient() - CSS: Cascading Style Sheets
the values to top, to bottom, to left, and to right are eq
uivalent to the angles 0deg, 180deg, 270deg, and 90deg, respectively.
...a value of 0deg is eq
uivalent to to top; increasing values rotate clockwise from there.
...the following two gradients are eq
uivalent.
...the following three gradients are eq
uivalent: linear-gradient(red 0%, orange 10%, orange 30%, yellow 50%, yellow 70%, green 90%, green 100%); linear-gradient(red, orange 10% 30%, yellow 50% 70%, green 90%); linear-gradient(red 0%, orange 10% 30%, yellow 50% 70%, green 90% 100%); by default, if there is no color with a 0% stop, the first color declared will be at that point.
outline-color - CSS: Cascading Style Sheets
note that browsers are not req
uired to support this value; if they don't, this keyword is considered invalid.
...in order to meet current web content accessibility g
uidelines (wcag), a ratio of 4.5:1 is req
uired for text content and 3:1 for larger text such as headings.
... webaim: color contrast checker mdn understanding wcag, g
uideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal definition initial valueinvert, for browsers supporting it, currentcolor for the otherapplies toall elementsinheritednocomputed valuefor the keyword invert, the computed value is invert.
... no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no supportreq
uires a vendor prefix or different name for use.req
uires a vendor prefix or different name for use.
text-align - CSS: Cascading Style Sheets
mdn understanding wcag, g
uideline 1.4 explanations understanding success criterion 1.4.8 | understanding wcag 2.0 formal definition initial valuestart, or a nameless value that acts as left if direction is ltr, right if direction is rtl if start is not supported by the browser.applies toblock containersinheritedyescomputed valueas specified, except for the match-parent value which is calculated against its parent's dire...
... nullam est eros, suscipit sed dictum q
uis, accumsan a ligula.
... nullam est eros, suscipit sed dictum q
uis, accumsan a ligula.
... nullam est eros, suscipit sed dictum q
uis, accumsan a ligula.
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
fleshing out the palette once you have decided on your base color, there are plenty of online tools that can help you b
uild out a palette of appropriate colors to use along with your base color by applying color theory to your base color to determine appropriate added colors.
... color blindness & web design (usability.gov: united states department of health and human services) palette design example let's consider a q
uick example of selecting an appropriate color palette for a site.
... imagine that you're b
uilding a website for a new game that takes place on the planet mars.
... having selected our base color, we need to b
uild out our palette.
HTML attribute: multiple - HTML: Hypertext Markup Language
when multiple is set on the email input type, the user can inlclude zero (if not also req
uired), one or more comma-separated email addresses.
... examples email input <label for="emails">who do you want to email?</label> <input type="email" multiple name="emails" id="emails" list="drawfemails" req
uired size="64"> <datalist id="drawfemails"> <option value="grumpy@woodworkers.com">grumpy</option> <option value="happy@woodworkers.com">happy</option> <option value="sleepy@woodworkers.com">sleepy</option> <option value="bashful@woodworkers.com">bashful</option> <option value="sneezy@woodworkers.com">sneezy</option> <option value="dopey@woodworkers.com">dopey</option> <option value=...
...if the req
uired attribute is present, at least one email address is req
uired.
...indicate any req
uired and optional input, data formats, and other relevant information.
<link>: The External Resource Link element - HTML: Hypertext Markup Language
under xhtml 1.0, empty elements such as <link> req
uire a trailing slash: <link />.
... value applies to audio <audio> elements document <iframe> and <frame> elements embed <embed> elements fetch fetch, xhr this value also req
uires <link> to contain the crossorigin attribute.
...ico is more ubiq
uitous, so you should use this format if cross-browser support is a concern (especially for old ie versions).
... prefetch secure context this attribute identifies a resource that might be req
uired by the next navigation and that the user agent should retrieve it.
<tbody>: The Table Body element - HTML: Hypertext Markup Language
tag omission the <tbody> element is not a req
uired child element for a parent <table> element to graphically render.
... permitted parents within the req
uired parent <table> element, the <tbody> element can be added after a <caption>, <colgroup>, and a <thead> element.
... note: the eq
uivalent text-align property for the align="char" is not implemented in any browsers yet.
... result first, the resulting table, so you know what we're b
uilding: html the revised html looks like this: <table> <thead> <tr> <th>student id</th> <th>name</th> </tr> </thead> <tbody> <tr> <th colspan="2">computer science</th> </tr> <tr> <td>3741255</td> <td>jones, martha</td> </tr> <tr> <td>4077830</td> <td>pierce, benjamin</td> </tr> <tr> <td>5151701</td> ...
Preloading content with rel="preload" - HTML: Hypertext Markup Language
this article provides a basic g
uide to how <link rel="preload"> works.
...8"> <title>js and css preload example</title> <link rel="preload" href="style.css" as="style"> <link rel="preload" href="main.js" as="script"> <link rel="stylesheet" href="style.css"> </head> <body> <h1>bouncing balls</h1> <canvas></canvas> <script src="main.js" defer></script> </body> here we preload our css and javascript files so they will be available as soon as they are req
uired for the rendering of the page later on.
...because of various reasons, these have to be fetched using anonymous mode cors (see font fetching req
uirements).
... other resource preloading mechanisms other preloading features exist, but none are q
uite as fit for purpose as <link rel="preload">: <link rel="prefetch"> has been supported in browsers for a long time, but it is intended for prefetching resources that will be used in the next navigation/page load (e.g.
HTTP caching - HTTP
without req
uiring an additional trip to the server.
... responses other than get if something s
uitable for use as a cache key is defined.
...this is typical of the technical resources included and linked from each web pages: javascript and css files change infrequently, but when they change you want them to be updated q
uickly.
... the revision version added to revved resources doesn't need to be a classical revision string like 1.1.3, or even a monotonously growing s
uite of number.
CSP: default-src - HTTP
the colon is req
uired.
...the single quotes are req
uired.
...the single quotes are req
uired.
... 'report-sample' req
uires a sample of the violating code to be included in the violation report.
CSP: img-src - HTTP
the colon is req
uired.
...the single quotes are req
uired.
...the single quotes are req
uired.
... 'report-sample' req
uires a sample of the violating code to be included in the violation report.
CSP: script-src-attr - HTTP
the colon is req
uired.
...the single quotes are req
uired.
...the single quotes are req
uired.
... 'report-sample' req
uires a sample of the violating code to be included in the violation report.
CSP: script-src-elem - HTTP
the colon is req
uired.
...the single quotes are req
uired.
...the single quotes are req
uired.
... 'report-sample' req
uires a sample of the violating code to be included in the violation report.
CSP: style-src-attr - HTTP
the colon is req
uired.
...the single quotes are req
uired.
...the single quotes are req
uired.
... 'report-sample' req
uires a sample of the violating code to be included in the violation report.
CSP: style-src-elem - HTTP
the colon is req
uired.
...the single quotes are req
uired.
...the single quotes are req
uired.
... 'report-sample' req
uires a sample of the violating code to be included in the violation report.
Expect-CT - HTTP
the expect-ct header lets sites opt in to reporting and/or enforcement of certificate transparency req
uirements, to prevent the use of misissued certificates for that site from going unnoticed.
... ct req
uirements can be satisfied via any one of the following mechanisms: x.509v3 certificate extension to allow embedding of signed certificate timestamps issued by individual logs a tls extension of type signed_certificate_timestamp sent during the handshake supporting ocsp stapling (that is, the status_request tls extension) and providing a signedcertificatetimestamplist when a site enables the expect-ct header, they are requesting that the browser check that any certificate for that site appears in public ct logs.
... browsers will not remember an expect-ct policy, unless the site has 'proven' it can serve a certificate satisfying the certificate transparency req
uirements.
... b
uilds of chrome are designed to stop enforcing the expect-ct policy 10 weeks after the installation's b
uild date.
Link prefetching FAQ - HTTP
when the user visits one of the prefetched documents, it can be served up q
uickly out of the browser's cache.
...this header enables caching, but req
uires an if-modified-since or if-none-match validation request before the serving the document out of the browser's cache.
... as a server admin, can i disting
uish prefetch requests from normal requests?
...camino b
uilds as of march 2003 are based on mozilla 1.0.1, and therefore do not support prefetching.
An overview of HTTP - HTTP
though http doesn't req
uire the underlying transport protocol to be connection-based; only req
uiring it to be reliable, or not lose messages (so at minimum presenting an error).
... before a client and server can exchange an http request/response pair, they must establish a tcp connection, a process which req
uires several round-trips.
... experiments are in progress to design a better transport protocol more s
uited to http.
... for example, google is experimenting with q
uic which b
uilds on udp to provide a more reliable and efficient transport protocol.
Redirections in HTTP - HTTP
308 was created to remove the ambig
uity of the behavior when using non-get methods.
...307 was created to remove the ambig
uity of the behavior when using non-get methods.
...in that case, try a <meta> element with its http-eq
uiv attribute set to refresh in the <head> of the page.
... <head> <meta http-eq
uiv="refresh" content="0; url=https://example.com/"> </head> the content attribute should start with a number indicating how many seconds the browser should wait before redirecting to the given url.
Numbers and dates - JavaScript
0xfffffffffffffffff // 295147905179352830000 0x123456789abcdef // 81985529216486900 0xa // 10 exponentiation 1e3 // 1000 2e6 // 2000000 0.1e2 // 10 number object the b
uilt-in number object has properties for numerical constants, such as maximum value, not-a-number, and infinity.
... math object the b
uilt-in math object has properties and methods for mathematical constants and functions.
...you always use the b
uilt-in math object.
... the next four statements b
uild a string value based on the time.
Using Promises - JavaScript
since most people are consumers of already-created promises, this g
uide will explain consumption of returned promises before explaining how to create them.
... this symmetry with asynchronous code culminates in the async/await syntactic sugar in ecmascript 2017: async function foo() { try { const result = await dosomething(); const newresult = await dosomethingelse(result); const finalresult = await dothirdthing(newresult); console.log(`got the final result: ${finalresult}`); } catch(error) { failurecallback(error); } } it b
uilds on promises, e.g.
... like this: promise.all([func1(), func2(), func3()]) .then(([result1, result2, result3]) => { /* use result1, result2 and result3 */ }); sequential composition is possible using some clever javascript: [func1, func2, func3].reduce((p, f) => p.then(f), promise.resolve()) .then(result3 => { /* use result3 */ }); basically, we reduce an array of asynchronous functions down to a promise chain eq
uivalent to: promise.resolve().then(func1).then(func2).then(func3); this can be made into a reusable compose function, which is common in functional programming: const applyasync = (acc,val) => acc.then(val); const composeasync = (...funcs) => x => funcs.reduce(applyasync, promise.resolve(x)); the composeasync() function will accept any number of functions as arguments, and will return a new func...
... if you think microtasks may help solve this problem, see the microtask g
uide to learn more about how to use queuemicrotask() to enqueue a function as a microtask.
Arrow function expressions - JavaScript
arrow function expressions are ill s
uited as methods, and they cannot be used as constructors.
... syntax basic syntax (param1, param2, …, paramn) => { statements } (param1, param2, …, paramn) => expression // eq
uivalent to: => { return expression; } // parentheses are optional when there's only one parameter name: (singleparam) => { statements } singleparam => { statements } // the parameter list for a function with no parameters should be written with a pair of parentheses.
... function foo(n) { var f = (...args) => args[0] + n; return f(10); } foo(1); // 11 arrow functions used as methods as stated previously, arrow function expressions are best s
uited for non-method functions.
... var func = () => { foo: function() {} }; // syntaxerror: function statement req
uires a name this is because the code inside braces ({}) is parsed as a sequence of statements (i.e.
Array.prototype.map() - JavaScript
when not to use map() since map b
uilds a new array, using it when you aren't using the returned array is an anti-pattern; use foreach or for-of instead.
...let len be to
uint32(lenvalue).
...let a be a new array created as if by the expression new array(len) // where array is the standard b
uilt-in constructor with that name and // len is the value of len.
...ue: 30}] let reformattedarray = kvarray.map(obj => { let robj = {} robj[obj.key] = obj.value return robj }) // reformattedarray is now [{1: 10}, {2: 20}, {3: 30}], // kvarray is still: // [{key: 1, value: 10}, // {key: 2, value: 20}, // {key: 3, value: 30}] mapping an array of numbers using a function containing an argument the following code shows how map works when a function req
uiring one argument is used with it.
BigInt - JavaScript
bigint is a b
uilt-in object that provides a way to represent whole numbers larger than 253 - 1, which is the largest number javascript can reliably represent with the number primitive and represented by the number.max_safe_integer constant.
... // ↪ 9007199254740991n const hugestring = bigint("9007199254740991") // ↪ 9007199254740991n const hugehex = bigint("0x1fffffffffffff") // ↪ 9007199254740991n const hugebin = bigint("0b11111111111111111111111111111111111111111111111111111") // ↪ 9007199254740991n bigint is similar to number in some ways, but also differs in a few key matters — it cannot be used with methods in the b
uilt-in math object and cannot be mixed with instances of number in operations; they must be coerced to the same type.
... bigint.as
uintn() wraps a bigint value to an unsigned integer between 0 and 2width - 1.
...bigint is therefore uns
uitable for use in cryptography.
Date - JavaScript
instead, it is defined in ecma-262 that a maximum of ±100,000,000 (one hundred million) days relative to january 1, 1970 utc (that is, april 20, 271821 bce ~ september 13, 275760 ce) can be represented by the standard date object (eq
uivalent to ±8,640,000,000,000,000 milliseconds).
... examples several ways to create a date object the following examples show several ways to create javascript dates: note: parsing of date strings with the date constructor (and date.parse, they are eq
uivalent) is strongly discouraged due to browser differences and inconsistencies.
... due to the differing lengths of days (due to daylight saving changeover), months, and years, expressing elapsed time in units greater than hours, minutes, and seconds req
uires addressing a number of issues, and should be thoroughly researched before being attempted.
... // using date objects let start = date.now() // the event to time goes here: dosomethingforalongtime() let end = date.now() let elapsed = end - start // elapsed time in milliseconds // using b
uilt-in methods let start = new date() // the event to time goes here: dosomethingforalongtime() let end = new date() let elapsed = end.gettime() - start.gettime() // elapsed time in milliseconds // to test a function and get back its return function printelapsedtime(ftest) { let nstarttime = date.now(), vreturn = ftest(), nendtime = date.now() console.log(`elapsed time: ${ string(nendtime - nstarttime) } milliseconds`) return vreturn } let yourfunctionreturn = printelapsedtime(yourfunction) note: in browsers that support the web performance api's high-resolution time feat...
JSON.stringify() - JavaScript
ar"]' json.stringify({ x: [10, undefined, function(){}, symbol('')] }); // '{"x":[10,null,null,null]}' // standard data structures json.stringify([new set([1]), new map([[1, 2]]), new weakset([{a: 1}]), new weakmap([[{a: 1}, 2]])]); // '[{},{},{},{}]' // typedarray json.stringify([new int8array([1]), new int16array([1]), new int32array([1])]); // '[{"0":1},{"0":1},{"0":1}]' json.stringify([new
uint8array([1]), new
uint8clampedarray([1]), new
uint16array([1]), new
uint32array([1])]); // '[{"0":1},{"0":1},{"0":1},{"0":1}]' json.stringify([new float32array([1]), new float64array([1])]); // '[{"0":1},{"0":1}]' // tojson() json.stringify({ x: 5, y: 6, tojson(){ return this.x + this.y; } }); // '11' // symbols: json.stringify({ x: undefined, y: object, z: symbol('') }); // '{}' json.stringify...
... note: if you wish the replacer to disting
uish an initial object from a key with an empty string property (since both would give the empty string as key and potentially an object as value), you will have to keep track of the iteration count (if it is beyond the first iteration, it is a gen
uine empty string key).
...cycle.js by douglas crockford) or implement a solution by yourself, which will req
uire finding and replacing (or removing) the cyclic references by serializable values.
... therefore, if compatibility with older javascript engines is req
uired, it is perilous to directly substitute the string returned by json.stringify into a javascript string to be passed to eval or new function or as part of a jsonp url, and the following utility can be used: function jsfriendlyjsonstringify (s) { return json.stringify(s).
RegExp.prototype.exec() - JavaScript
description consider the following example: // match "q
uick brown" followed by "jumps", ignoring characters in between // remember "brown" and "jumps" // ignore case let re = /q
uick\s(brown).+?(jumps)/ig; let result = re.exec('the q
uick brown fox jumps over the lazy dog'); the following table shows the results for this script: object property/index description example result [0] the full string of characters m...
...atched "q
uick brown fox jumps" [1], ...[n] the parenthesized substring matches, if any.
... "the q
uick brown fox jumps over the lazy dog" re lastindex the index at which to start the next match.
... "q
uick\s(brown).+?(jumps)" examples finding successive matches if your regular expression uses the "g" flag, you can use the exec() method multiple times to find successive matches in the same string.
Planned changes to shared memory - JavaScript
new http header bonanza as a baseline req
uirement, documents will need to be in a secure context.
... for top-level documents, two headers will need to be set: cross-origin-opener-policy with same-origin as value (protects your origin from attackers) cross-origin-embedder-policy with req
uire-corp as value (protects victims from your origin) with these two headers set, postmessage() will no longer throw for sharedarraybuffer objects and shared memory across threads is therefore available.
... api changes as a result of this newly req
uired environment, there are a couple api implications: the atomics object is always available.
...therefore, the req
uirements listed above for sharing a sharedarraybuffer between workers also apply to sharing a webassembly.memory.
String.prototype.replace() - JavaScript
note: see this g
uide for more explanations about regular expressions.
... let re = /apples/gi; let str = 'apples are round, and apples are j
uicy.'; let newstr = str.replace(re, 'oranges'); console.log(newstr); // oranges are round, and oranges are j
uicy.
... this logs 'oranges are round, and oranges are j
uicy'.
... replacing a fahrenheit degree with its celsius eq
uivalent the following example replaces a fahrenheit degree with its eq
uivalent celsius degree.
encodeURIComponent() - JavaScript
this will encode "&" symbols that may inadvertently be generated during data entry for special html entities or other characters that req
uire encoding/decoding.
..., (, ), and *), even though these characters have no formalized uri delimiting uses, the following can be safely used: function fixedencodeuricomponent(str) { return encodeuricomponent(str).replace(/[!'()*]/g, function(c) { return '%' + c.charcodeat(0).tostring(16); }); } examples encoding for content-disposition and link headers the following example provides the special encoding req
uired within utf-8 content-disposition and link server response header parameters (e.g., utf-8 filenames): var filename = 'my file(2).txt'; var header = "content-disposition: attachment; filename*=utf-8''" + encoderfc5987valuechars(filename); console.log(header); // logs "content-disposition: attachment; filename*=utf-8''my%20file%282%29.txt" function encoderfc5987valuechars(str) { ...
... // the following are not req
uired for percent-encoding per rfc5987, // so we can allow for a little better readability over the wire: |`^ replace(/%(?:7c|60|5e)/g, unescape); } // here is an alternative to the above function function encoderfc5987valuechars2(str) { return encodeuricomponent(str).
...// i.e., %27 %28 %29 %2a (note that valid encoding of "*" is %2a // which necessitates calling touppercase() to properly encode) // the following are not req
uired for percent-encoding per rfc5987, // so we can allow for a little better readability over the wire: |`^ replace(/%(7c|60|5e)/g, (str, hex) => string.fromcharcode(parseint(hex, 16))); } specifications specification ecmascript (ecma-262)the definition of 'encodeuricomponent' in that specification.
Logical OR assignment (||=) - JavaScript
syntax expr1 ||= expr2 description short-circ
uit evaluation the logical or operator works like this: x || y; // returns x when x is truthy // returns y when x is not truthy the logical or operator short-circ
uits: the second operand is only evaluated if the first operand doesn’t already determine the result.
... logical or assignment short-circ
uits as well, meaning it only performs an assignment if the logical operation would evaluate the right-hand side.
... in other words, x ||= y is eq
uivalent to: x || (x = y); and not eq
uivalent to the following which would always perform an assignment: x = x || y; note that this behavior is different to mathematical and bitwise assignment operators.
... examples setting default content if the "lyrics" element is empty, set the innerhtml to a default value: document.getelementbyid('lyrics').innerhtml ||= '<i>no lyrics.</i>' here the short-circ
uit is especially beneficial, since the element will not be updated unnecessarily and won't cause unwanted side-effects such as additional parsing or rendering work, or loss of focus, etc.
with - JavaScript
see the "ambig
uity contra" paragraph in the "description" section below for details.
...the parentheses around the expression are req
uired.
...the scope chain change req
uired by 'with' is not computationally expensive.
... ambig
uity contra contra: the with statement makes it hard for a human reader or javascript compiler to decide whether an unqualified name will be found along the scope chain, and if so, in which object.
MathML documentation index - MathML
3 examples beginner, example, g
uide, mathml, needsbeginnerupdate below you'll find some examples you can look at to help you to understand how to use mathml to display increasingly complex mathematical concepts in web content.
... 4 mathml: deriving the quadratic formula beginner, education, example, g
uide, html5, mathml, needsbeginnerupdate this page outlines the derivation of the quadratic formula.
... 5 proving the pythagorean theorem beginner, example, g
uide, html5 math, math education, mathml, needsbeginnerupdate we will now prove the pythagorean theorem: 6 mathml attribute reference mathml, mathml reference this is an alphabetical list of mathml attributes.
... 7 values g
uide, mathml, mathml reference several mathml presentation elements have attributes that accept length values used for size or spacing.
Using images in HTML - Web media technologies
in this g
uide you'll find links to resources that deal with adding images to websites.
... g
uides these articles provide g
uidance on selecting and configuring image types.
... image file type and format g
uide a g
uide to the various image file types commonly supported by web browsers including details about their individual use cases, capabilities, and compatibility factors.
... additionally, this article provides g
uidance for selecting the best image file type for a given situation.
<a> - SVG: Scalable Vector Graphics
try the @namespace rule to disting
uish the two.
...may be req
uired for backwards compatibility for older browsers.
... value type: <url> ; default value: none; animatable: yes global attributes core attributes most notably: id, lang, tabindex styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage event attributes global event attributes, document element event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes most notably: xlink:title aria attributes aria-ac...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clip...
<svg> - SVG: Scalable Vector Graphics
note: the xmlns attribute is only req
uired on the outermost svg element of svg documents.
...html,body,svg { height:100% } <svg viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg" stroke="red" fill="grey"> <circle cx="50" cy="50" r="40" /> <circle cx="150" cy="50" r="4" /> <svg viewbox="0 0 10 10" x="200" width="100"> <circle cx="5" cy="5" r="4" /> </svg> </svg> attributes baseprofile deprecated since svg 2 the minimum svg language profile that the document req
uires.
... global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage event attributes global event attributes, graphical event attributes, document event attributes, document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, ...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, ...
Introduction - SVG: Scalable Vector Graphics
svg does offer benefits, some of which include having a dom interface available for it, and not req
uiring third-party extensions.
...a simple svg document consists of nothing more than the <svg> root element and several basic shapes that b
uild a graphic together.
...if you are not too familiar with xml, here are some g
uidelines to keep in mind: svg elements and attributes should all be entered in the case shown here since xml is case-sensitive (unlike html).
...it b
uilds on top of svg 1.0, but adds more modularization to ease implementation.
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
it can also be used to q
uickly format a number.
... syntax <xsl:number count=expression level="single" | "multiple" | "any" from=expression value=expression format=format-string lang=xml:lang-code letter-value="alphabetic" | "traditional" grouping-separator=character grouping-size=number /> req
uired attributes none.
...this is a q
uick way to format a user-supplied number (as opposed to a node sequence number) in any of the standard <xsl:number> formats.
...if both systems begin with the same token, ambig
uity can arise.
<xsl:stylesheet> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:stylesheet> element (or the eq
uivalent <xsl:transform> element) is the outermost element of a stylesheet.
... namespace declaration a pseudo-attribute req
uired to identify the document as an xslt stylesheet.
... syntax <xsl:stylesheet version="number" xmlns:xsl="http://www.w3.org/1999/xsl/transform" id="name" extension-element-prefixes="list-of-names" exclude-result-prefixes="list-of-names"> entire stylesheet </xsl:stylesheet> req
uired attributes version specifies the version of xslt req
uired by this stylesheet.
... type req
uired outermost element of stylesheet.
Web technology for developers
web developer g
uide the web developer g
uide provides useful how-to content to help you actually use web technologies to do what you want or need to do.
... code snippets this is a q
uick list of useful code snippets (small code samples) available for developers of extensions for the various mozilla applications.
... web technology references web apis reference material for each of the individual apis that comprise the web's powerful scriptability, including the dom and all of the related apis and interfaces you can use to b
uild web content and apps.
... accessibilitycss houdinicss: cascading style sheetsdemos of open web technologiesdeveloper g
uidesexsltevent referencehtml: hypertext markup languagehttpjavascriptmathmlopensearch description formatprivacy, permissions, and information securityprogressive web apps (pwas)svg: scalable vector graphicstutorialsweb apisweb componentsweb performanceweb app manifestsweb media technologiesweb securityweb technology referencexml: extensible markup languagexpathxslt: extensible stylesheet language t...
Compiling a New C/C++ Module to WebAssembly - WebAssembly
emscripten environment setup first, let's set up the req
uired development environment.
... prereq
uisites get the emscripten sdk, using these instructions: https://emscripten.org/docs/getting_started/downloads.html compiling an example with the environment set up, let's look at how to use it to compile a c example to emscripten.
...you could then b
uild your custom html completely from scratch, although this is an advanced approach; it is usually easier to use the provided html template.
... emscripten req
uires a large variety of javascript "glue" code to handle memory allocation, memory leaks, and a host of other problems calling a custom function defined in c if you have a function defined in your c code that you want to call as needed from javascript, you can do this using the emscripten ccall() function, and the emscripten_keepalive declaration (which adds your functions to the exported functions list (see why do functions in my c/c++ source code vanish when i compile to javascript, and/or i get no functions to process?)).
addon-page - Archive of obsolete content
usage with the add-on sdk you can present information to the user, such as a g
uide to using your add-on, in a browser tab.
... to use the module import it using req
uire().
... after this, the page loaded from "data/index.html" will not contain navigational elements: var addontab = req
uire("sdk/addon-page"); var data = req
uire("sdk/self").data; req
uire("sdk/tabs").open(data.url("index.html")); this only affects the page at "data/index.html": all other pages are displayed normally.
base64 - Archive of obsolete content
var base64 = req
uire("sdk/base64"); var encodeddata = base64.encode("hello, world"); var decodeddata = base64.decode(encodeddata); globals functions encode(data, charset) creates a base-64 encoded ascii string from a string of binary data.
...in order to encode and decode unicode strings, the charset parameter needs to be set: var base64 = req
uire("sdk/base64"); var encodeddata = base64.encode(unicodestring, "utf-8"); returns string : the encoded string decode(data, charset) decodes a string of data which has been encoded using base-64 encoding.
...in order to encode and decode unicode strings, the charset parameter needs to be set: var base64 = req
uire("sdk/base64"); var decodeddata = base64.decode(encodeddata, "utf-8"); returns string : the decoded string ...
indexed-db - Archive of obsolete content
so you can use the indexed-db module to access the same api: var { indexeddb } = req
uire('sdk/indexed-db'); var request = indexeddb.open('mydatabase'); request.onerror = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; most of the objects that implement the indexeddb api, such as idbtransaction, idbopendbrequest, and idbobjectstore, are accessible through the indexeddb object itself.
... var { indexeddb, idbkeyrange } = req
uire('sdk/indexed-db'); var database = {}; database.onerror = function(e) { console.error(e.value) } function open(version) { var request = indexeddb.open("stuff", version); request.onupgradeneeded = function(e) { var db = e.target.result; e.target.transaction.onerror = database.onerror; if(db.objectstorenames.contains("items")) { db.deleteobjectstore("items"); } ...
...yrange = idbkeyrange.lowerbound(0); var cursorrequest = store.opencursor(keyrange); cursorrequest.onsuccess = function(e) { var result = e.target.result; if(!!result == false) return; items.push(result.value.name); result.continue(); }; cursorrequest.onerror = database.onerror; }; function listitems(itemlist) { console.log(itemlist); } open("1"); var add = req
uire("sdk/
ui/button/action").actionbutton({ id: "add", label: "add", icon: "./add.png", onclick: function() { additem(req
uire("sdk/tabs").activetab.title); } }); var list = req
uire("sdk/
ui/button/action").actionbutton({ id: "list", label: "list", icon: "./list.png", onclick: function() { getitems(listitems); } }); note that to run this add-on you'll need to provide ico...
notifications - Archive of obsolete content
var notifications = req
uire("sdk/notifications"); notifications.notify({ title: "jabberwocky", text: "'twas brillig, and the slithy toves", data: "did gyre and gimble in the wabe", onclick: function (data) { console.log(data); // console.log(this.data) would produce the same result.
... var notifications = req
uire("sdk/notifications"); var self = req
uire("sdk/self"); var myiconurl = self.data.url("myicon.png"); notifications.notify({ text: "i have an icon!", iconurl: myiconurl }); from firefox 34, you can use "./myicon.png" as an alias for self.data.url("myicon.png").
... so you can rewrite the above code like this: var notifications = req
uire("sdk/notifications"); var myiconurl = "./myicon.png"; notifications.notify({ text: "i have an icon!", iconurl: myiconurl }); this module depends on the underlying system's notification service.
self - Archive of obsolete content
this uri can be used for apis which req
uire a valid uri string, such as the passwords module.
...the url can be passed to a content frame constructor, such as the panel: var self = req
uire("sdk/self"); var mypanel = req
uire("sdk/panel").panel({ contenturl: self.data.url("myfile.html") }); mypanel.show(); from firefox 34, you can use "./myfile.html" as an alias for self.data.url("myfile.html").
... so you can rewrite the above code like this: var mypanel = req
uire("sdk/panel").panel({ contenturl: "./myfile.html" }); mypanel.show(); parameters name : string the filename to be read, relative to the package's data directory.
core/namespace - Archive of obsolete content
let { ns } = req
uire('sdk/core/namespace'); let anamespace = ns(); anamespace(publicapi).secret = secret; one namespace may be used with multiple objects: let { ns } = req
uire('sdk/core/namespace'); let dom = ns(); function view(element) { let view = object.create(view.prototype); dom(view).element = element; // ....
... also, multiple namespaces can be used with one object: // ./widget.js let { cu } = req
uire('chrome'); let { ns } = req
uire('sdk/core/namespace'); let { view } = req
uire('./view'); // note this is completely independent from view's internal namespace object.
... let { dom } = req
uire('./view'); widget.prototype.setinnerhtml = function setinnerhtml(html) { dom(this).element.innerhtml = string(html); }; ...
frame/hidden-frame - Archive of obsolete content
the following code creates a hidden frame, loads a web page into it, and then logs its title: var hiddenframes = req
uire("sdk/frame/hidden-frame"); let hiddenframe = hiddenframes.add(hiddenframes.hiddenframe({ onready: function() { this.element.contentwindow.location = "http://www.mozilla.org/"; let self = this; this.element.addeventlistener("domcontentloaded", function() { console.log(self.element.contentdocument.title); }, true, true); } })); see the panel module for a real-world exam...
... parameters options : object req
uired options: name type onready function,array functions to call when the frame is ready to load content.
...it is eq
uivalent to the domcontentloaded event for the content page in a hidden frame.
system/child_process - Archive of obsolete content
however, there are a few differences to be aware of: you need to req
uire() the module using req
uire("sdk/system/child_process") fork() is not supported gid and
uid are not supported in node.js, spawn() and exec() inherit the environment variables from the parent process, by default.
... child.stdin has no write() method (see example below for writing to child process stdin) examples adaption of node's documentation for spawn(): var child_process = req
uire("sdk/system/child_process"); var ls = child_process.spawn('/bin/ls', ['-lh', '/usr']); ls.stdout.on('data', function (data) { console.log('stdout: ' + data); }); ls.stderr.on('data', function (data) { console.log('stderr: ' + data); }); ls.on('close', function (code) { console.log('child process exited with code ' + code); }); writing to child process' stdin because the sdk implementation does not include a write() method for child processes, ...
... const { emit } = req
uire('sdk/event/core'); const { spawn } = req
uire('sdk/system/child_process'); var proc = spawn("/bin/cat"); emit(proc.stdin, 'data', "hello from add-on code"); emit(proc.stdin, 'end'); using child_process in non-jpm extensions // import sdk stuff const commonjs_uri = 'resource://gre/modules/commonjs'; const { req
uire } = cu.import(commonjs_uri + '/toolkit/req
uire.js', {}); var child_process = req
uire('sdk/system/child_process'); // use it in the same way as in the example above ...
util/object - Archive of obsolete content
let { merge } = req
uire("sdk/util/object"); var a = { jetpacks: "are yes", foo: 10 } var b = merge(a, { foo: 5, bar: 6 }, { foo: 50, location: "sf" }); b === a // true b.jetpacks // "are yes" b.foo // 50 b.bar // 6 b.location // "sf" // merge also translates property descriptors var c = { "type": "addon" }; var d = {}; object.defineproperty(d, "name", { value: "jetpacks", configurable: false }); mer...
... extend(source1, source2, source3) is the eq
uivalent of merge(object.create(source1), source2, source3).
... let { extend } = req
uire("sdk/util/object"); var a = { alpha: "a" }; var b = { beta: "b" }; var g = { gamma: "g", alpha: null }; var x = extend(a, b, g); console.log(a); // { alpha: "a" } console.log(b); // { beta: "b" } console.log(g); // { gamma: "g", alpha: null } console.log(x); // { alpha: null, beta: "b", gamma: "g" } parameters arguments : object n arguments that get merged into a new object.
Release notes - Archive of obsolete content
"./my-file" introduced everywhere as an alias for req
uire("sdk/self").data.url("my-file") added the ability to attach stylesheets to individual tabs.
... firefox 29 highlights added new
ui modules for australis: actionbutton, togglebutton, frame and toolbar.
... deprecated widget in favor of the new
ui modules.
Tools - Archive of obsolete content
cfx to jpm a g
uide to working with jpm if you're already familiar with cfx.
... jpmignore use .jpmignore to ignore files from your xpi b
uilds created via jpm.
... package.json the package.json file contains manifest data for your add-on, providing not only descriptive information about the add-on for presentation in the add-ons manager, but other metadata req
uired of add-ons.
Creating annotations - Archive of obsolete content
please see the
ui module for replacements.
... at the top of the file import the page-mod module and declare an array for the workers: var pagemod = req
uire('sdk/page-mod'); var selectors = []; add detachworker(): function detachworker(worker, workerarray) { var index = workerarray.indexof(worker); if(index != -1) { workerarray.splice(index, 1); } } edit toggleactivation() to notify the workers of a change in activation state: function activateselectors() { selectors.foreach( function (selector) { selector.postmessage(anno...
...first, import the panel module: var panels = req
uire('sdk/panel'); then add the following code to the main() function: var annotationeditor = panels.panel({ width: 220, height: 220, contenturl: data.url('editor/annotation-editor.html'), contentscriptfile: data.url('editor/annotation-editor.js'), onmessage: function(annotationtext) { if (annotationtext) { console.log(this.annotationanchor); console.log(annotationtext); ...
Implementing the widget - Archive of obsolete content
please see the
ui module for replacements.
... because the widget's click event does not disting
uish left and right mouse clicks, we'll use a content script to capture the click events and send the corresponding message back to our add-on.
... main.js now in the lib directory open main.js and add the following code: var widgets = req
uire('sdk/widget'); var data = req
uire('sdk/self').data; var annotatorison = false; function toggleactivation() { annotatorison = !annotatorison; return annotatorison; } exports.main = function() { var widget = widgets.widget({ id: 'toggle-switch', label: 'annotator', contenturl: data.url('widget/pencil-off.png'), contentscriptwhen: 'ready', contentscriptfile: data.url(...
Annotator - Archive of obsolete content
please see the
ui module for replacements.
... in this tutorial we'll b
uild an add-on that uses many of the sdk's high-level apis.
... next we'll give a q
uick overview of the annotator's design, then go through the implementation, step by step.
Logging - Archive of obsolete content
you don't have to req
uire() anything to get access to the console.
...the following add-on logs the html content of every tab the user loads, by calling console.log() inside a content script: req
uire("sdk/tabs").on("ready", function(tab) { tab.attach({ contentscript: "console.log(document.body.innerhtml);" }); }); console output if you are running your add-on from the command line (for example, executing jpm run or jpm test) then the console's messages appear in the command shell you used.
... but note that by default, calls to console.log() will not result in any output in the error console for any installed add-ons: this includes add-ons installed using the add-on b
uilder or using tools like the extension auto-installer.
Open a Web Page - Archive of obsolete content
to open a new web page, you can use the tabs module: var tabs = req
uire("sdk/tabs"); tabs.open("http://www.example.com"); this function is asynchronous, so you don't immediately get back a tab object which you can examine.
...the callback is assigned to the onready property, and will be passed the tab as an argument: var tabs = req
uire("sdk/tabs"); tabs.open({ url: "http://www.example.com", onready: function onready(tab) { console.log(tab.title); } }); even then, you don't get direct access to any content hosted in the tab.
...this add-on loads a page, then attaches a script to the page which adds a red border to it: var tabs = req
uire("sdk/tabs"); tabs.open({ url: "http://www.example.com", onready: runscript }); function runscript(tab) { tab.attach({ contentscript: "document.body.style.border = '5px solid red';" }); } learning more to learn more about working with tabs in the sdk, see the tabs api reference.
Using XPCOM without chrome - Archive of obsolete content
examples bookmarks observer normally, a bookmark observer would req
uire chrome components and xpcomutils as described in the following links: (observing changes to bookmarks and tags) , (creating event targets).
... // this removes the need to import ci and the xpcomutils const { class } = req
uire("sdk/core/heritage"); const { unknown } = req
uire('sdk/platform/xpcom'); const { placesutils } = req
uire("resource://gre/modules/placesutils.jsm"); let bmlistener = class({ extends: unknown, interfaces: [ "nsinavbookmarkobserver" ], //this event most often handles all events onitemchanged: function(bid, prop, an, nv, lm, type, parentid, ag
uid, aparentg
uid) { console.log("onitemchange...
...d", "bid: "+bid, "property: "+prop, "isanno: "+an, "new value: "+nv, "lastmod: "+lm, "type: "+type, "parentid:"+parentid, "ag
uid:"+ag
uid);0 // code to handle the event here } }); //we just have a class, but need an object.
File I/O - Archive of obsolete content
an exception is thrown only when methods that req
uire the file to exist are called, e.g., isdirectory(), moveto(), and so on.
... // file is the given directory (nsifile) var entries = file.directoryentries; var array = []; while(entries.hasmoreelements()) { var entry = entries.getnext(); entry.queryinterface(components.interfaces.nsifile); array.push(entry); } reading from a file read into a stream or a string this will allow you to read a file without locking up the
ui thread while reading.
... please note that some i/o, such as getting file information and opening the file can still happen on the main thread and therefore block the
ui for periods of time.
Examples and demos from articles - Archive of obsolete content
.[article] pure-css web gallery based on the :hover pseudoclass [zip] you can use the :hover pseudo-class in order to b
uild an image gallery with full-size images shown only when mouse goes over previews.
... .[article] pure-css web gallery based on the :checked pseudoclass [zip] you can also use the :checked pseudo-class applied to hidden radioboxes in order to b
uild, for example, an image gallery with full-size images shown only when mouse clicks on previews.
...it g
uides you through the basic features of the language with practical examples that you can try for yourself on your own computer and illustrates the standard features of css that work in modern browsers.
Sidebar - Archive of obsolete content
opening and closing the sidebar firefox provides a b
uilt-in sidebar
ui object function defined in browser-sidebar.js.
... // toggle the bookmarks sidebar (close it if it's open or // open it if it's currently closed) sidebar
ui.toggle("viewbookmarkssidebar"); // show the history sidebar, whether it's hidden or already showing sidebar
ui.show("viewhistorysidebar"); // hide the sidebar, if one is showing sidebar
ui.hide(); avoid opening the sidebar on startup.
...to open a page in the "viewwebpanelssidebar" from chrome code (browser/addon/extension) such as from men
uitem, it can call: openwebpanel(atitle, auri); accessing the sidebar from a browser.xul script the sidebar content is always in a document separate from the main browser document (the sidebar is actually implemented as a xul browser element).
Developing add-ons - Archive of obsolete content
this page will help g
uide you to the information you need in order to create add-ons for firefox, thunderbird, or other software based on the mozilla platform, as well as how to distribute your add-ons.
... addons.mozilla.org (amo) api developers' g
uide the amo developers' g
uide describes how to use the amo api to fetch information about add-ons from the addons.mozilla.org site.
... performance performance g
uides and utilities to help you make your add-on perform well (and to play nicely with others).
Displaying web content in an extension without security issues - Archive of obsolete content
it won’t harm disabling everything else as well unless it is really req
uired: frame.docshell.allowauth = false; frame.docshell.allowimages = false; frame.docshell.allowjavascript = false; frame.docshell.allowmetaredirects = false; frame.docshell.allowplugins = false; frame.docshell.allowsubframes = false; but what about interactivity, for example if you want a certain reaction to mouse clicks?
...well, not q
uite.
...so properly sanitizing input is still req
uired when using innerhtml and it is far from trivial.
Installing Extensions and Themes From Web Pages - Archive of obsolete content
this property is req
uired.
...because so many sites installed extensions by direct-linking the xpi file and relying on content handling to invoke the confirmation
ui, many sites are (incorrectly) doing so for theme jar files too and wondering why they aren't auto-detected and installed.
... (* by all means don't let this stop you from developing more ambitious install systems, i am providing this documentation only as a g
uide that i hope most extension distributors will use since it handles most cases well) ...
Appendix A: Add-on Performance - Archive of obsolete content
add-on developers need to make sure that they minimize their add-ons' performance impact, and here are a few simple g
uidelines that should be followed to achieve that.
... luckily, minimizing your startup time is easy, if you follow these g
uidelines: do not load or run code before it’s needed.
...keep as much of your code in jsm, make it as modular as you can, and only load modules as you req
uire them.
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
it is also common for an add-on to req
uire to run a script only when it is installed for the first time, or every time it is updated.
...a few others req
uire cleanup code to be run after the add-on is uninstalled.
...for this, you need to add an observer for the q
uit-application topic.
Appendix D: Loading Scripts - Archive of obsolete content
each of these means has its own advantages and disadvantages, as well as its own q
uirks which may trap the unwary.
... below is an overview of the more common means of loading scripts, along with some of their primary advantages, disadvantages, q
uirks, and use cases.
... disadvantages namespacing: as modules always execute with their own namespace, they have no direct access to the dom or window properties of windows or documents, and therefore must often pass around references to these objects and any document-specific state data that they req
uire.
Performance best practices in extensions - Archive of obsolete content
general performance tips avoid creating memory leaks memory leaks req
uire the garbage collector and the cycle collector to work harder, which can significantly degrade performance.
... avoid writing slow css read the "writing efficient css" g
uide.
... any kind of i/o on the main thread, be it disk or network i/o, can cause serious
ui responsiveness issues.
Security best practices in extensions - Archive of obsolete content
this document is intended as a g
uide for developers to promote best practices in securing your extension.
...some items mentioned are strict g
uidelines, meaning that if you don't follow them then your add-on will not be approved on mozilla add-ons.
... using eval() in an extension using the b
uilt-in javascript eval function is frowned upon in the context of extensions.
Session store API - Archive of obsolete content
in other words, it's now possible for sessions to be restored even without the browser q
uitting and being relaunched.
... new windows are opened as req
uired (one for each window that was saved in the session store), and cookies and the list of recently closed tabs are restored.
... using the session store api in seamonkey there are a number of differences between the session store api in firefox and the api in seamonkey 2.0: the class name is @mozilla.org/s
uite/sessionstore;1 var ss = components.classes["@mozilla.org/s
uite/sessionstore;1"] .getservice(components.interfaces.nsisessionstore); when restoring a window, closed tabs in that window are not currently restored.
Creating a dynamic status bar extension - Archive of obsolete content
« previousnext » this article b
uilds upon the article creating a status bar extension, which creates a static status bar panel in the firefox status bar, by dynamically updating its content with information fetched from the web every few minutes.
...function inforeceived() { var samplepanel = document.getelementbyid('stockwatcher'); var output = httprequest.responsetext; if (output.length) { // remove whitespace from the end of the string; // this gets rid of the end-of-line characters output = output.replace(/\w*$/, ''); // b
uild the tooltip string var fieldarray = output.split(','); // assert that fieldarray[0] == 'goog' samplepanel.label = 'goog: ' + fieldarray[1]; samplepanel.tooltiptext = 'chg: ' + fieldarray[4] + ' | ' + 'open: ' + fieldarray[5] + ' | ' + 'low: ' + fieldarray[6] + ' | ' + 'high: ' + fieldarray[7] + ' | ' + 'vol: ' + fieldarray[8]; } } the first th...
...the string is b
uilt from a combination of static strings and various elements from the fieldarray array.
Automated testing tips and tricks - Archive of obsolete content
todo: check example code in to the tree somewhere how to q
uit the browser on all platforms window.close() of the last open window does not q
uit the application on mac http://people.mozilla.com/~davel/scripts/ - look at q
uit.js and q
uit.xul install manifest file in appdir/chrome to map chrome://tests/content to directory containing q
uit.js and q
uit.xul example: content tests file:///users/davel/work/tests/ start app with command line flag -chrome chrome://tests/content/q
uit.xul how to create a new profile from the command line first, use the -createprofile command line flag to add a profile entry to profiles.ini and populate the new profile directory with a prefs.js file firefox-bin -createprofile "testprofile ${pro...
...file_dir}/testprofile" next, start firefox to populate the new profile directory with the rest of the default settings firefox-bin -p testprofile -chrome chrome://tests/content/q
uit.xul<code> the above process may exit before the profile is completely created.
... how to enable dump in a new profile add user_pref("browser.dom.window.dump.enabled", true); to profiledir/user.js how to execute test code with chrome privileges using a chrome doc - see sbtests.xul in http://people.mozilla.com/~davel/scripts/ for an example firefox-bin -p sbtestprofile -chrome chrome://sbtests/content/ above code calls the q
uit function in q
uit.js to exit after test is finished how to detect content onload event from chrome use the domcontentloaded event chromewindow.addeventlistener('domcontentloaded',callbackfunction,false); ...
Bookmark Keywords - Archive of obsolete content
for example, a keyworded bookmark could be set up so that a user could type <tt>google spam and eggs</tt> and thereby trigger a google search for the words "spam and eggs." because these tools req
uire bookmarks with specific keywords in order to work, they will be referred to hereafter as keymarks, as distinct from regular bookmarks.
...the q
uickest way to start is to simply look up any random bug in the bugzilla system-- the actual number doesn't matter.
... to file this bookmark open the "bookmarks" menu in the browser and select "add bookmark," or by of use the keyboard eq
uivalent (e.g., <tt>cmd-d</tt> on macintosh).
Conclusion - Archive of obsolete content
future directions for development of the tutorial and/or coursework: in addition to b
uild status, tinderbox also tells you if the cvs tree is open or closed for check-ins.
... mozilla has a fourth
ui layer--localized text--that wasn't discussed in the tutorial because there is no text to localize.
...firefox has slightly different chrome registry req
uirements, so you may need to modify the contents.rdf files.
Getting Started - Archive of obsolete content
skin\classic\global global contains almost all of the important css files that define the appearance of the s
uite.
... <description about="urn:mozilla:install-manifest"> <em:id>{themes_u
uid}</em:id> <em:version>themes_version</em:version> the first section req
uires that you establish a u
uid for your theme and that you give your theme a version number.
...you will also have to update the minimum and maximum compatible versions for the target application (seamonkey) in the following section: <em:targetapplication> <description> <!-- seamonkey's u
uid --> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>min_sm_version</em:minversion> <em:maxversion>max_sm_version</em:maxversion> </description> </em:targetapplication> establishing both minimum and maximum compatible versions lets you avoid conflicts with versions of seamonkey your theme wasn't designed for -- or wasn't tested on.
Download Manager improvements in Firefox 3 - Archive of obsolete content
in addition, you can augment or replace the download manager's user interface by implementing the new nsidownloadmanager
ui interface.
... note: these changes will req
uire some modest revisions to code using the download manager; several methods have had minor changes.
... nsidownloadmanager
ui implement this interface to replace or augment the download manager user interface.
Nanojit - Archive of obsolete content
#include <stdio.h> #include <stdint.h> #include "jsapi.h" #include "jstracer.h" #include "nanojit.h" using namespace nanojit; const
uint32_t cache_size_log2 = 20; static avmplus::gc gc = avmplus::gc(); static avmplus::avmcore core = avmplus::avmcore(); int main() { logcontrol lc; #ifdef debug lc.lcbits = lc_readlir | lc_assembly; #else lc.lcbits = 0; #endif // set up the basic nanojit objects.
... need guards are req
uired in a cross platform dynamic language like javascript.
...the interpreter is then eq
uipped to handle the overflow.
FAQ - Archive of obsolete content
prism is b
uilt on top of the mozilla platform and its gecko rendering engine, just like mozilla firefox, so it provides the same capabilities to web applications that firefox provides, including support for html, javascript, css, and <canvas>.
...prism is b
uilt on top of xulrunner.
... prism is a simple xulrunner application with the main portion of the
ui consisting of a xul <browser> element.
Remote debugging - Archive of obsolete content
the crash victim should at least know how to run a debugger, if not how to use it, and should have a debug b
uild of firefox handy.
... this req
uires q
uite a bit of trust, in both directions.
...since debugging usually req
uires printing many objects, this is much faster than debugging over bugzilla.
File object - Archive of obsolete content
if you are b
uilding a standalone version of spidermonkey (see: spidermonkey b
uild documentation), this variable can be added on the make command line, like so: cd mozilla/js/src make -f makefile.ref js_has_file_object=1 alternatively, if you are b
uilding a larger product (such as a browser) and want to include the file object, you may need to perform minor makefile surgery.
...creating a pipeline involves spawning arbitrary processes; this means that giving a script access to the file object is exactly eq
uivalent to giving the script access to the unix shell or dos command interpreter.
... examples example: hello, world file.output.writeln("hello, world"); example: writing a new file var file = new file("myfile.txt"); file.open("write,create", "text"); file.writeln("the q
uick brown fox jumped over the lazy dogs"); file.close(); example: reading from a file var data; var file = new file("myfile.txt"); file.open("read", "text"); data = file.readln(); file.close(); example: sending mail through a pipeline var mail = new file("|/usr/lib/sendmail foo@bar.com"); mail.writeln("i love javascript.\npipe support is especially good!"); mail.close(); ...
Supporting per-window private browsing - Archive of obsolete content
as an example, if an add-on adds a context menu item that accesses an api that req
uires an nsiloadcontext, the most relevant window is the one that owns the element being targeted by the context menu (element.ownerdocument.defaultview).
... if some action triggered by a chrome element (such as a button) req
uires an api that takes a privacy context, the most relevant window is the one that contains the chrome element.
...var channel = services.io.newchannel("http://example.org", null, null); channel.queryinterface(components.interfaces.nsiprivatebrowsingchannel); channel.setprivate(true); // force the channel to be loaded in private mode similarly, xmlhttprequest objects created via createinstance(ci.nsixmlhttprequest) will often req
uire explicit adjustment, since they have no context from which to derive a privacy status.
Table Layout Strategy - Archive of obsolete content
the words the table layout is width oriented and knows the following widths: minimum content width - min the minimum width that is req
uired to layout the content, all linebreak possibilities will be used percent width - pct the cell width specified in percent, fixed width - fix the cell width specified as px, mm etc., proportional width - prop the cell width specified via 1*, 2* etc.
... min_con des_con fix min_adj des_adj fix_adj pct pct_adj min_pro final the width parameter have the following meaning: #define width_not_set -1 #define num_widths 10 #define num_major_widths 3 // min, des, fix #define min_con 0 // minimum width req
uired of the content + padding #define des_con 1 // desired width of the content + padding #define fix 2 // fixed width either from the content or cell, col, etc.
...the second table has <col width="33%"><col> lets return to the first case but now but with more than 100%: <col width="40%"><col width="80%"><tbody></tbody>foobar <col width="40%"><col><tbody></tbody>foobar <table border width="200px"> <col width="40%"><col width="80%"> <tbody> <tr><td>foo</td><td>bar</td></tr> </tbody> </table> the algorithm tries to satisfy the req
uirements on a first come first serve base.
Actionscript Performance Tests - Archive of obsolete content
similar to the acceptance tests set the environment variables avm, asc, b
uiltinabc.
...# compare 2 b
uilds $ ./runtests.py --avm2=b
uild2/avmshell sunspider/*.as test avm avm2 %sp metric sunspider/access-binary-trees.as 565 564 0.2 time sunspider/access-fannkuch.as 366 362 1.1 time ...
... # compare 2 b
uilds with > 2 iterations $ ./runtests.py --iterations=10 --avm2=b
uild2/avmshell sunspider/*.as test avm avm2 min : max avg min : max avg %diff metric ----------------------- ----------------------- ----- sunspider/access-binary-trees.as [ 567.0 : 585] 575.9 [ 564.0 : 580] 572.0 0.5 time sunspider/access-fannkuch.as [ 363.0 : 386] 370.0 [ 362.0 : 399] 371.8 0.3 time ...
Cmdline tests - Archive of obsolete content
the cmdline tests
uite is located in test/cmdline.
... the tests
uite allows more flexibility by coding scripts in python allowing any executable to run, sending commands to stdin, and asserting output using regular expressions.
... two use cases for the cmdline tests
uite: use case 1: test the interactive cmdline debugger test contents: start avmshell -d test.abc, set breakpoint on a line, show local variable value, q
uit from cmdutils import * def run(): r=runtestlib() r.run_test( 'debugger locals', '%s -d testdata/debug.abc'%r.avmrd, input='break 53\ncontinue\nnext\ninfo locals\nnext\ninfo locals\nq
uit\n', expectedout=['local1 = undefined','local2 = 10','local2 = 15'] ) use case 2: test -memstats returns memory logs to stdout test contents: start avmshell -memstats test.abc, assert stdout contains 'gross stats', 'sweep m reclaimed n pages.' from cmdutils import * def run(): r=runtestlib() r.run_test(name='memstats', ...
Tamarin Acceptance Testing - Archive of obsolete content
in order to ensure that changes to the tamarin code base are high quality before submitting, all developers are req
uired to complete the following steps.
... successfully b
uild release and debug versions of the shell with the debugger enabled [info] successfully run the following test s
uites: acceptance test s
uite [info] self tests [info] submit a sandbox b
uild request to test against platforms that you may not have locally [info] available tamarin acceptance test s
uites actionscript acceptance tests: actionscript acceptance tests running tamarin acceptance tests abc assembler tests cmdline tests performance tests actionscript performance tests running tamarin performance tests b
uilt-in self tests see instructions in doc/selftest.html in the tamarin repository.
... to b
uild and setup the tools see b
uilding_tamarin_windows_mobile_utilities.
Treehydra Manual - Archive of obsolete content
req
uire({ after_gcc_pass: "cfg" }); include('gcc_util.js'); // for function_decl_cfg include('gcc_print.js'); function process_tree(fn) { print("function " + decl_name(fn)); // fn is a function_decl let cfg = function_decl_cfg(fn); for (let bb in cfg_bb_iterator(cfg)) { print(" basic block " + bb_label(cfg, bb)); for (let isn in bb_isn_iterator(bb)) { ...
...req
uire({ after_gcc_pass: "einline" + (isgcc42 ?
...esp uses a b
uilt-in join function where join(a,a) -> a and join(a,b) -> top for a != b.
Using cross commit - Archive of obsolete content
using the script q
uick overview there are a couple of common ways to use cross-commit: land something simultaneously on the trunk and mozilla_1_8_branch # modify the files (probably by applying the patch) patch -p0 < ~/caret.patch # commit on trunk and branch at once # make sure to use -m "commit message" when doing so tools/cross-commit -m "fix some sort of security bug" layout/base/nscaret.h land somethi...
...this is eq
uivalent to --branch head.
...this is eq
uivalent to --branch mozilla_1_8_branch.
Venkman Internals - Archive of obsolete content
note also that this is just my knowledge of venkman, which is q
uite limited.
...gijskr
uitbosch 05:41, 7 march 2007 (pst) venkman-debugger.js sets hooks in to the jsdidebuggerservice.
...if you set the breakpoint right from the jsdscript instead, you wouldn't see it in the venkman
ui, and you might confuse venkman when the actual breakpoint was hit and it couldn't find a matching breakpoint object.
XPCOM Examples - Archive of obsolete content
we can use this as in the following example: example 1 : source <toolbox> <menubar id="windowlist-menubar"> <menu label="window"> <menupopup id="window-menu" datasources="rdf:window-mediator" ref="nc:windowmediatorroot"> <template> <rule> <men
uitem uri="rdf:*" label="rdf:http://home.netscape.com/nc-rdf#name"/> </rule> </template> </menupopup> </menu> </menubar> </toolbox> a window menu will be created with a list of all the open windows.
...the template generates an id attribute on each men
uitem element.
... the example below shows how we might do this: <toolbox> <menubar id="windowlist-menubar"> <menu label="window" oncommand="switchfocus(event.target);"> <menupopup id="window-menu" datasources="rdf:window-mediator" ref="nc:windowmediatorroot"> <template> <rule> <men
uitem uri="rdf:*" label="rdf:http://home.netscape.com/nc-rdf#name"/> </rule> </template> </menupopup> </menu> </menubar> </toolbox> <script> function switchfocus(elem) { var mediator = components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"].getservice(); mediator.queryinterface(components.interfaces.nsiwindowdatasource); var resource = elem.getattribute('id');...
XPCOM Interfaces - Archive of obsolete content
calling native objects by using xul we can b
uild a complex user interface.
...however, there are q
uite a number of things that cannot be performed directly with javascript.
...after learning this section, you can search s
uitable interfaces using xulplanet xpcom reference about xpcom mozilla is constructed from a collection of components, each of which performs a certain task.
checkbox - Archive of obsolete content
for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
... visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
description - Archive of obsolete content
for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
... visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not req
uire validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
dialog - Archive of obsolete content
the buttons will be placed in s
uitable locations for the user's platform and basic event handling will be performed automatically.
...the buttons will be placed in s
uitable locations for the user's platform and basic event handling will be performed automatically.
... movetoalertposition() return type: no return value moves and resizes the dialog to a position and size s
uitable for an alert box.
label - Archive of obsolete content
for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
... visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...req
uires the class attribute to include text-link.
listheader - Archive of obsolete content
visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
... inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
menubar - Archive of obsolete content
attributes grippyhidden, statusbar properties accessibletype, statusbar examples <menubar id="sample-menubar"> <menu id="action-menu" label="action"> <menupopup id="action-popup"> <men
uitem label="new"/> <men
uitem label="save" disabled="true"/> <men
uitem label="close"/> <menuseparator/> <men
uitem label="q
uit"/> </menupopup> </menu> <menu id="edit-menu" label="edit"> <menupopup id="edit-popup"> <men
uitem label="undo"/> <men
uitem label="redo"/> </menupopup> </menu> </menubar> attributes grippyhidden seamonkey only type...
... inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
...sertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements menu, men
uitem, menulist, menupopup, menuseparator interfaces nsiaccessibleprovider ...
prefwindow - Archive of obsolete content
the buttons will be placed in s
uitable locations for the user's platform and basic event handling will be performed automatically.
...the buttons will be placed in s
uitable locations for the user's platform and basic event handling will be performed automatically.
...for example the permissions manager
ui in firefox uses the same window for three dialogs: images, software installation and popups.
richlistitem - Archive of obsolete content
visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not req
uire validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
...this property is available for men
uitem and menuseparator elements in firefox 3.
<statusbarpanel> - Archive of obsolete content
for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } image type: uri the uri of the image to appear on the element.
...for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
... inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenod...
tabbrowser - Archive of obsolete content
attributes autocompleteenabled, autocompletepopup, autoscroll, contentcontextmenu, contenttooltip, handlectrlpageupdown, onbookmarkgroup, onnewtab, tabmodalpromptshowing properties browsers, cangoback, cangoforward, contentdocument, contenttitle, contentvieweredit, contentviewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, security
ui, selectedbrowser, selectedtab, sessionhistory, tabcontainer, tabs, visibletabs, webbrowserfind, webnavigation, webprogress methods addprogresslistener, addtab, addtabsprogresslistener,appendgroup, getbrowseratindex, getbrowserindexfordocument, getbrowserfordocument, getbrowserfortab, geticon, getnotificationbox, gettabforbrowser, gettabmodalpromptbox, goback, gobackgroup, goforward, goforwardgr...
... security
ui type: nsisecurebrowser
ui the read-only property holds an object which may be used to determine the security level of the loaded document.
... stop() return type: no return value eq
uivalent to pressing the stop button, this method stops the currently loading document.
treecell - Archive of obsolete content
for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not req
uire validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
... properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispat...
window - Archive of obsolete content
this is used to hide chrome when showing in-browser
ui such as the about:addons page, and causes the toolbars to be hidden, with only the tab strip (and, if currently displayed, the add-on bar) left showing.
...this might be used, for example, to disting
uish between a browser window and an editor window.
... values for window type as found on mxr: http://mxr.mozilla.org/mozilla-release/search?string=windowtype navigator:browser - looks like if window has gbrowser it has this window type devtools:scratchpad - scratchpad windows navigator:view-source - the view source windows properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
XULRunner 1.9.1 Release Notes - Archive of obsolete content
xulrunner 1.9.1.x is b
uilt from the same source code snapshot as firefox 3.5.x.
...system req
uirements before installing, make sure your computer meets the system req
uirements.
... the system req
uirements for xulrunner are the same as the system req
uirements for firefox.
NPAPI plugin reference - Archive of obsolete content
np_port contains information req
uired by the window field of an npwindow structure.
... npanycallbackstruct contains information req
uired during embedded mode printing.
... npprintcallbackstruct contains information req
uired by the platformprint field of the npembedprint structure during embedded mode printing on unix systems.
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
com</em:id> <em:name>my plugin</em:name> <em:version>1.0</em:version> <em:targetapplication> <description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>1.5</em:minversion> <em:maxversion>4.0.*</em:maxversion> </description> </em:targetapplication> <em:unpack>true</em:unpack> </description> </rdf> this contains 5 req
uired pieces of information.
...this can be in a g
uid form but the simpler email form is preferred now.
... providing updates when plugins are packaged in this way they can make use of the b
uilt in add-on update system.
Plugins - Archive of obsolete content
for example, the adobe reader plugin lets the user open pdf files directly inside the browser, and the q
uicktime and realplayer plugins are used to play special format videos in a web page.
... plugins can be written completely from scratch using c apis (usually in c or c++) or they may be b
uilt on a plugin framework such as firebreath, juce, or qtbrowserplugin.
... site author g
uide for click-to-activate plugins these g
uidelines will help website authors use plugins when they are blocked by default with the firefox click-to-activate feature.
Confidentiality, Integrity, and Availability - Archive of obsolete content
integrity integrity refers to ensuring the authenticity of information—that information is not altered, and that the source of the information is gen
uine.
...in this case, the site you are directed to is not gen
uine.
... original document information author(s): karen scarfone, wayne jansen, and miles tracy title: nist special publication 800-123, g
uide to general server security last updated date: july 2008 copyright information: this document is not subject to copyright.
Table Reflow Internals - Archive of obsolete content
absolutely positioned elements) reflows reflowee and passes a reflow state (in) and a reflow metrics (in/out) review of reflow the reflow state: is a node in a tree structurally eq
uivalent to the frame tree of reflow participants contains: reflow type, avail size, various computed values, resolved style structs possible request for preferred size and more.
...this is eq
uivalent to preferred size if the avail size is not constrained.
...multiple resize reflows may req
uire special handling if a frame split previously.
Using Firebug and jQuery (Screencast) - Archive of obsolete content
we're going to take an introductory look at the firebug firefox extension and the jquery javascript library - combining the two to b
uild a reusable bookmarklet that can manipulate digg posts and comments.
...you can use the ability to q
uickly analyze and inspect a page that firebug and jquery affords you, using the results to b
uild a greasemonkey script, instead of a simple bookmarklet.
... i only really intended this to be a q
uick introduction to the subject, so please feel free to explore it more!
Using IO Timeout And Interrupt On NT - Archive of obsolete content
due to a limitation of the present implementation of nspr io on nt, programs must follow the following g
uideline: if a thread calls an nspr io function on a file descriptor and the io function fails with <tt>pr_io_timeout_error</tt> or <tt>pr_pending_interrupt_error</tt>, the file descriptor must be closed before the thread exits.
... in this memo we explain the problem this g
uideline is trying to work around and discuss its limitations.
... conclusions as long as we need to support nt 3.51, we need to program under the g
uideline that after an io timeout or interrupt error, the thread must make sure the file descriptor is closed before it exits.
Developing cross-browser and cross-platform pages - Archive of obsolete content
it req
uires from the web author to have knowledge of the capabilities of all current browsers that may visit the page and then to code appropriately for these.
... it req
uires from the web author to make assumptions about what will happen with future browsers or to decide to provide future browsers a safe fallback service.
...this method has the advantage of not req
uiring you to test for anything except whether the particular features you code are supported in the visiting browser.
-ms-hyphenate-limit-chars - Archive of obsolete content
if the word does not meet the req
uired minimum number of characters in the word, before the hyphen, or after the hyphen, then the word is not hyphenated.
... initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values auto corresponds to a value of 5 2 2, indicating a 5-character word limit, 2 characters req
uired before a hyphenation break, and 2 characters req
uired following a hyphenation break.
... <integer>{1,3} one to three integer values, corresponding to the word limit, the minimum number of characters req
uired before a hyphenation break, and the minimum number of characters req
uired following a hyphenation break, respectively.
display-outside - Archive of obsolete content
layout-specific internal types these display types req
uire their parent and children to be of particular display types.
... for example, a table-row box req
uires its parent to be a table row group box and its children to be table-cell boxes.
... layout-specific leaf types these display types req
uire their parent to be of a particular display type, but can accept any display-inside value.
Error.stackTraceLimit - Archive of obsolete content
the error.stacktracelimit property gets or sets the stack trace limit, which is eq
uivalent to the number of error frames to display.
...otherwise, to
uint32 is used to convert the value.
... try { var err = new error("my error"); error.stacktracelimit = 7; throw err; } catch(e) { document.write("error stack trace limit: ") document.write(error.stacktracelimit); } req
uirements supported in internet explorer 10 and in windows 8.x store apps.
Archived JavaScript Reference - Archive of obsolete content
this property has been removed and no longer works.array comprehensionsthe array comprehension syntax was a javascript expression which allowed you to q
uickly assemble a new array based on an existing one.
...it's eq
uivalent to object.observe() invoked with the accept type list ["add", "update", "delete", "splice"].
...it has been removed from firefox starting with version 58.generator comprehensionsthe generator comprehension syntax was a javascript expression which allowed you to q
uickly assemble a new generator function based on an existing iterable object.
RFE to the Custom Controls Interfaces - Archive of obsolete content
in short, we have the following interfaces: nsixformsaccessors - serves to get/set the value of the instance data node that the xforms element is bound to as well as getting the various states of that node nsixformsdelegate - used to obtain the nsixformsaccessors interface nsixforms
uiwidget - used by the xforms processor to update the value/state of an xforms element when its bound node's value/state is changed our current mechanism that allows authors to b
uild custom controls assumes that the controls will be bound to instance nodes of simple content type.
...if you need to have a custom control that works with complext content or you find our interfaces too limiting to create the type of control that you have in mind, then this is the right place to pass along your req
uirements and any usecase that you are trying to solve.
... rfe put your req
uirements here.
Describing microformats in JavaScript - Archive of obsolete content
req
uired an array indicating the names of any properties that must be specified.
... property specifications each property in the properties structure is specified by its name, and may include additional attributes if the property so req
uires.
...sname: "adr", properties: { "type" : { plural: true, types: ["work", "home", "pref", "postal", "dom", "intl", "parcel"] }, "post-office-box" : { }, "street-address" : { plural: true }, "extended-address" : { }, "locality" : { }, "region" : { }, "postal-code" : { }, "country-name" : { } } }; the properties are q
uite simple here.
XUL Booster - Archive of obsolete content
xul booster is a third party eclipse / webtools b
uild that offers some support for xul editing and awesome support for extension packaging.
... extension q
uick start xul booster makes creating and packaging an extension very easy.
...create an extension you'll need an extension id; see generating g
uids.
Examples - Game development
star citadel a new take on star castle, cinematronics' classic 1980 arcade game, b
uilt with canvas 2d.
... classic platformer canvas 2d game based on `visual-ts game engine` - physics based on matter.js commercial games oort online a mmo exploration, b
uilding, and battle game (currently in development.) a wizard's lizard top down zelda-esque exploration/rpg.
... volumetric particle flow physics simulation of flowing liq
uid.
3D collision detection - Game development
axis-aligned bounding boxes as with 2d collision detection, axis-aligned bounding boxes (aabb) are the q
uickest algorithm to determine whether the two game entities are overlapping or not.
...the overlapping area between two non-rotated boxes can be checked with logical comparisons alone, whereas rotated boxes req
uire additional trigonometric operations, which are slower to calculate.
...aminy<=bmaxy∧amaxy>=bminy)∧(aminz<=bmaxz∧amaxz>=bminz)f(a,b) = and in javascript, we'd use this: function intersect(a, b) { return (a.minx <= b.maxx && a.maxx >= b.minx) && (a.miny <= b.maxy && a.maxy >= b.miny) && (a.minz <= b.maxz && a.maxz >= b.minz); } bounding spheres using bounding spheres to detect collisions is a bit more complex than aabb, but still fairly q
uick to test.
Mobile touch controls - Game development
note: the game captain rogers: battle at andromeda is b
uilt with phaser and managing the controls is phaser-based, but it could also be done in pure javascript.
... pure javascript approach we could implement touch events on our own — setting up event listeners and assigning relevant functions to them would be q
uite straightforward: var el = document.getelementsbytagname("canvas")[0]; el.addeventlistener("touchstart", handlestart); el.addeventlistener("touchmove", handlemove); el.addeventlistener("touchend", handleend); el.addeventlistener("touchcancel", handlecancel); this way, touching the game's <canvas> on the mobile screen would emit events, and thus we could manipulate the game in any way we want (for example, moving the space ship around).
... you can q
uickly get the coordinates of the most recently active pointer via the this.game.input.x and this.game.input.y variables.
Tiles and tilemaps overview - Game development
tilemaps are a very popular technique in 2d game development, consisting of b
uilding the game world or level map out of small, regular-shaped images called tiles.
...this is simply all of the req
uired tiles grouped together in a single image file.
... if characters or other game sprites are drawn in the middle of the layer stack, this allows for interesting effects such as having characters walking behind trees or b
uildings.
Techniques for game development - Game development
optimizing startup performance how to make sure your game starts up q
uickly, smoothly, and without appearing to lock up the user's browser or device.
...this article provides a detailed g
uide to implementing audio for web games, looking at what works currently across as wide a range of platforms as possible.
... tilemaps tiles are a very popular technique in 2d games for b
uilding the game world.
2D breakout game using pure JavaScript - Game development
after working through this tutorial you should be able to b
uild your own simple web games.
... lesson details all the lessons — and the different versions of the mdn breakout game we are b
uilding together — are available on github: create the canvas and draw on it move the ball bounce off the walls paddle and keyboard controls game over b
uild the brick field collision detection track the score and win mouse controls finishing up starting with pure javascript is the best way to get a solid knowledge of web game development.
...frameworks are just tools b
uilt with the javascript language; so even if you plan on working with them, it's good to learn about the language itself first to know what exactly is going on under the hood.
Initialize the framework - Game development
this can be done using html — the phaser framework will generate the req
uired <canvas> element.
... the game's html the html document structure is q
uite simple, as the game will be rendered entirely on the <canvas> element generated by the framework.
... choose an option that s
uits you best — i would recommend the min.js option as it keeps the source code smaller, and you are unlikely need to go through the source code anyway.
Gecko FAQ - Gecko Redirect 1
why was gecko b
uilt?
...now that the web has evolved, a new generation layout engine was needed upon which future products could be b
uilt.
... used in hebrew and arabic (ibm has begun work to add bidi support in a future release) style sheets css 1 - full support, except for: the application of styles to html column elements the ability to turn off author styles the names of certain mozilla extension pseudo-classes lack the moz- prefix css 2 - partial support is expected and has already been b
uilt into gecko, including support for css2 positioning, but no commitment has been made to achieve a specific level of support dom level 0 level 1 core: full support making entityreferences available through dom1; per a provision of the dom1 spec for xml implementations, entities will be automatically expanded inline and therefore not available through dom1; our implementat...
Compile - MDN Web Docs Glossary: Definitions of Web-related terms
compiling is the process of transforming a computer program written in a given language into an eq
uivalent program of another language.
...sometimes, this task is also referred to as "assembling" or "b
uild", which typically indiciates more than just compilation is done, e.g.
...for instance in the browser: firefox' spidermonkey javascript engine has a jit b
uilt-in that will compile javascript in a website to machine code while you're viewing it so it runs faster.
Doctype - MDN Web Docs Glossary: Definitions of Web-related terms
in html, the doctype is the req
uired "<!doctype html>" preamble found at the top of all documents.
... its sole purpose is to prevent a browser from switching into so-called “q
uirks mode” when rendering a document; that is, the "<!doctype html>" doctype ensures that the browser makes a best-effort attempt at following the relevant specifications, rather than using a different rendering mode that is incompatible with some specifications.
... learn more general knowledge definition of the doctype in the html specification q
uirks mode and standards mode technical reference document.doctype, a javascript method that returns the doctype ...
Domain sharding - MDN Web Docs Glossary: Definitions of Web-related terms
as browsers limit the number of active connections per domain, serving all the req
uired resources from a single domain could be slow as assets need to be downloaded sequentially.
... with domain sharding, the req
uired downloads are served from more than one domain, enabling the browser to simultaneously download needed resources.
... http2 supports unlimited concurrent requests making domain sharding an obsolete req
uirement when http/2 is enabled.
MVC - MDN Web Docs Glossary: Definitions of Web-related terms
these actions req
uire the model to be updated, so the input is sent to the controller, which then manipulates the model as appropriate, which then sends updated data to the view.
... mvc on the web as a web developer, this pattern will probably be q
uite familiar even if you've never consciously used it before.
...however, these days, more of the logic is pushed to the client with the advent of client-side data stores, and xmlhttprequest allowing partial page updates as req
uired.
Semantics - MDN Web Docs Glossary: Definitions of Web-related terms
would you need to look at the code to understand what the function did if it was called b
uild('peach'), or createliwithcontent('peach')?
... semantics in css in css, consider styling a list with li elements representing different types of fr
uits.
... would you know what part of the dom is being selected with div > ul > li, or .fr
uits__item?
Symbol - MDN Web Docs Glossary: Definitions of Web-related terms
note: if you are familiar with ruby's (or another language) that also has a feature called "symbols", please don’t be misg
uided.
...there is no ecmascript 5 eq
uivalent for symbol.
...the global symbol registry is mostly b
uilt by javascript's compiler infrastructure, and the global symbol registry's content is not available to javascript's run-time infrastructure, except through these reflective methods.
Syntax - MDN Web Docs Glossary: Definitions of Web-related terms
syntax specifies the req
uired combination and sequence of characters making up correctly structured code.
... syntax generally includes grammar and the rules that apply to writing it, such as indentation req
uirements in python.
...if a codebase uses "a lot of syntax", it req
uires more characters to achieve the same functionality.
Accessibility - Learn web development
get started prereq
uisites to get the most out of this module, it would be a good idea to either work through at least the first two modules of the html, css, and javascript topics, or perhaps even better, work through the relevant parts of the accessibility module as you work through the related technology topics.
... g
uides what is accessibility?
... wai-aria basics following on from the previous article, sometimes making complex
ui controls that involve unsemantic html and dynamic javascript-updated content can be difficult.
Advanced styling effects - Learn web development
prereq
uisites: html basics (study introduction to html) and an idea of how css works (study css first steps.) objective: to get an idea about how to use some of the advanced styling effects available in modern browsers.
...for more information and example code for css shapes see the g
uides to css shapes on mdn.
...when used in this context, both of the properties would req
uire a -webkit- vendor prefix, even for non-webkit/chrome-based browsers: .text-clip { -webkit-background-clip: text; -webkit-text-fill-color: transparent; } so why have other browsers implemented a -webkit- prefix?
Attribute selectors - Learn web development
previous overview: b
uilding blocks next as you know from your study of html, elements can have attributes that give further detail about the element being marked up.
... prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn what attribute selectors are and how to use them.
... previous overview: b
uilding blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css or...
Combinators - Learn web development
previous overview: b
uilding blocks next the final selectors we will look at are called combinators, because they combine other selectors in a way that gives them a useful relationship to each other and the location of content in the document.
... prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn about the different combinator selectors that can be used in css.
... previous overview: b
uilding blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css or...
CSS selectors - Learn web development
previous overview: b
uilding blocks next in css, selectors are used to target the html elements on our web pages that we want to style.
... prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn how css selectors work in detail.
... previous overview: b
uilding blocks next reference table of selectors the below table gives you an overview of the selectors you have available to use, along with links to the pages in this g
uide which will show you how to use each type of selector.
Sizing items in CSS - Learn web development
previous overview: b
uilding blocks next in the various lessons so far you have come across a number of ways to size items on a web page using css.
... prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to understand the different ways we can size things in css.
... previous overview: b
uilding blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css or...
Getting started with CSS - Learn web development
prereq
uisites: basic computer literacy, basic software installed, basic knowledge of working with files, and html basics (study introduction to html.) objective: to understand the basics of linking a css document to an html file, and be able to do simple text formatting with css.
...i have added the rules above to it, and now realise that the pink color is q
uite light and hard to read — why not change that to a better color?
...when we talk about accessibility we are referring to the req
uirement for our webpages to be understandable and usable by everyone.
CSS FAQ - Learn web development
modern browsers have two main rendering modes: q
uirks mode: also called backwards-compatibility mode, allows legacy webpages to be rendered as their authors intended, following the non-standard rendering rules used by older browsers.
... documents with an incomplete, incorrect, or missing doctype declaration or a known doctype declaration in common use before 2001 will be rendered in q
uirks mode.
... gecko-based browsers, have a third almost standards mode that has only a few minor q
uirks.
Styling lists - Learn web development
prereq
uisites: basic computer literacy, html basics (study introduction to html), css basics (study introduction to css), css text and font fundamentals.
...wash and chop the salad.</li> <li>fill pita with salad, hummus, and fried halloumi.</li> </ol> <h2>ingredient description list</h2> <p>paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference.</p> <dl> <dt>hummus</dt> <dd>a thick dip/sauce generally made from chick peas blended with tahini, lemon j
uice, salt, garlic, and other ingredients.</dd> <dt>pita</dt> <dd>a soft, slightly leavened flatbread.</dd> <dt>halloumi</dt> <dd>a semi-hard, unripened, brined cheese with a higher-than-usual melting point, usually made from goat/sheep milk.</dd> <dt>green salad</dt> <dd>that green healthy stuff that many of us just use to garnish kebabs.</dd> </dl> if you go to the live example now an...
...alue="2">toast pita, leave to cool, then slice down the edge.</li> <li value="4">fry the halloumi in a shallow, non-stick pan, until browned on both sides.</li> <li value="6">wash and chop the salad.</li> <li value="8">fill pita with salad, hummus, and fried halloumi.</li> </ol> gives you this output: note: even if you are using a non-number list-style-type, you still need to use the eq
uivalent numerical values in the value attribute.
Styling text - Learn web development
get started prereq
uisites before starting this module, you should already have basic familiarity with html, as discussed in the introduction to html module, and be comfortable with css fundamentals, as discussed in introduction to css.
... g
uides this module contains the following articles, which will teach you all of the essentials behind styling html text content.
... assessments the following assessments will test your understanding of the text styling techniques covered in the g
uides above.
Learn to style HTML using CSS - Learn web development
get started prereq
uisites you should learn the basics of html before attempting any css.
... css b
uilding blocks this module carries on where css first steps left off — now you've gained familiarity with the language and its syntax, and got some basic experience with using it, its time to dive a bit deeper.
...we have covered the necessary prereq
uisites so we can now dive deep into css layout, looking at different display settings, modern layout tools like flexbox, css grid, and positioning, and some of the legacy techniques you might still want to know about.
How do you make sure your website works properly? - Learn web development
prereq
uisites: you need to know how to upload files to a web server.
... a distant web server often behaves q
uite differently from a local one, so it's a good idea to test your website once it's online.
... open the console (tools ➤ web developer ➤ web console) and reload the page: in this example, we learn (q
uite clearly) what the error is, and we can go fix it (we will cover javascript in another series of articles).
How do you host your website on Google App Engine? - Learn web development
google app engine is a powerful platform that lets you b
uild and run applications on google’s infrastructure — whether you need to b
uild a multi-tiered web application from scratch or host a static website.
... here's a step-by-step g
uide to hosting your website on google app engine.
...this req
uires having a google account.
What is the difference between webpage, website, web server, and search engine? - Learn web development
prereq
uisites: you should know how the internet works.
... we'll cover these terms and technologies in more detail as we explore further, but these q
uick definitions will be a great start for you: web page a document which can be displayed in a web browser such as firefox, google chrome, opera, microsoft internet explorer or edge, or apple's safari.
...the distinction will help you q
uite a bit, but even some professionals speak loosely, so don't feel anxious about it.
What are browser developer tools? - Learn web development
every modern web browser includes a powerful s
uite of developer tools.
... note: before you run through the examples below, open the beginner's example site that we b
uilt during the getting started with the web article series.
... click the little arrow next to each shorthand property to show the property's longhand eq
uivalents.
What are hyperlinks? - Learn web development
prereq
uisites: you should know how the internet works and be familiar with the difference between a webpage, a website, a web server, and a search engine.
... before the web, it was q
uite hard to access documents and move from one to another.
... when you're b
uilding a website, focus on internal links, since those make your site usable.
What is accessibility? - Learn web development
prereq
uisites: none.
...this b
uilding has to be accessible, so it must follow these regulations for door width and toilet size and elevator placement.
... accessibility champions since 1999, the w3c has operated a working group called the web accessibility initiative (wai) promoting accessibility through g
uidelines, support material, and international resources.
Example 2 - Learn web development
this is the second example that explain how to b
uild custom form widgets.
... js html content <form class="no-widget"> <select name="myfr
uit"> <option>cherry</option> <option>lemon</option> <option>banana</option> <option>strawberry</option> <option>apple</option> </select> <div class="select"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> <form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* req
uired styles */ /* --------------- */ .select { position: relative; display : inline-block; } ...
... auto; overflow-x: hidden; } .select .option { padding: .2em .3em; } .select .highlight { background: #000; color: #ffffff; } javascript content window.addeventlistener("load", function () { var form = document.queryselector('form'); form.classlist.remove("no-widget"); form.classlist.add("widget"); }); result for js no js html content <form class="no-widget"> <select name="myfr
uit"> <option>cherry</option> <option>lemon</option> <option>banana</option> <option>strawberry</option> <option>apple</option> </select> <div class="select"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">str...
Example 5 - Learn web development
this is the last example that explain how to b
uild custom form widgets.
... change states html content <form class="no-widget"> <select name="myfr
uit"> <option>cherry</option> <option>lemon</option> <option>banana</option> <option>strawberry</option> <option>apple</option> </select> <div class="select" role="listbox"> <span class="value">cherry</span> <ul class="optlist hidden" role="presentation"> <li class="option" role="option" aria-selected="true">cherry</li> <li class="option" role="option">lemon</li> <li class="option" role="option">banana</li> <li class="option" role="option">strawberry</li> <li class="option" role="option">apple</li> </ul> </div> </form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden;...
... } /* --------------- */ /* req
uired styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ width : 10em; /* 100px */ border : 0.2em solid #000; /* 2px */ border-radius : 0.4em; /* 4px */ box-shadow : 0 0.1em 0.2em rgba(0,0,0,.45); /* 0 1px 2...
Example - Learn web development
a payment form html content <form method="post"> <h1>payment form</h1> <p>req
uired fields are followed by <strong><abbr title="req
uired">*</abbr></strong>.</p> <section> <h2>contact information</h2> <fieldset> <legend>title</legend> <ul> <li> <label for="title_1"> <input type="radio" id="title_1" name="title" value="a"> ace </label> </li> <li> <label for="title_2"> <input type="radio" id="title_2" name="title" value="k" > king </label> </li> <li> <label for="title_3"> <input type="radio" id="title_3" name="title" value="...
...q"> queen </label> </li> </ul> </fieldset> <p> <label for="name"> <span>name: </span> <strong><abbr title="req
uired">*</abbr></strong> </label> <input type="text" id="name" name="username"> </p> <p> <label for="mail"> <span>e-mail: </span> <strong><abbr title="req
uired">*</abbr></strong> </label> <input type="email" id="mail" name="usermail"> </p> <p> <label for="pwd"> <span>password: </span> <strong><abbr title="req
uired">*</abbr></strong> </label> <input type="password" id="pwd" name="password"> </p> </section> <section> <h2>payment information</h2> <p> <label for="card"> <span>card type:</span> ...
... </label> <select id="card" name="usercard"> <option value="visa">visa</option> <option value="mc">mastercard</option> <option value="amex">american express</option> </select> </p> <p> <label for="number"> <span>card number:</span> <strong><abbr title="req
uired">*</abbr></strong> </label> <input type="tel" id="number" name="cardnumber"> </p> <p> <label for="date"> <span>expiration date:</span> <strong><abbr title="req
uired">*</abbr></strong> <em>formatted as mm/dd/yyyy</em> </label> <input type="date" id="date" name="expiration"> </p> </section> <section> <p> <button type="submit">validate the payment</button> </p> </section> </form> css content h1 {...
Sending form data - Learn web development
prereq
uisites: basic computer literacy, an understanding of html, and basic knowledge of http and server-side programming.
...because http is a text protocol, there are special req
uirements for handling binary data.
...this is a topic far beyond this g
uide, but there are a few rules to keep in mind.
Test your skills: Form validation - Learn web development
change the type of the "email address" and "phone number" fields to make the browser apply some more specific validation s
uitable for the data being asked for.
... give the "user name" field a req
uired length of between 5 and 20 characters, the "phone number" field a maximum length of 15 characters, and the "comment" field a maximum length of 200 characters.
... try submitting your form — it should refuse to submit until the above constaints are followed, and give s
uitable error messages.
Getting started with the Web - Learn web development
you won't b
uild another facebook right away, but it's not hard to get your own simple website online, so we'll start there.
... installing basic software when it comes to tools for b
uilding a website, there's a lot to pick from.
...when you're b
uilding a website, you need to assemble these files into a sensible structure and make sure they can talk to one another.
Advanced text formatting - Learn web development
prereq
uisites: basic html familiarity, as covered in getting started with html.
...for example, the below bit of markup contains a quotation from the mdn <q> page: <p>the quote element — <code><q></code> — is <q cite="/docs/web/html/element/q">intended for short quotations that don't req
uire paragraph breaks.</q></p> browser default styling will render this as normal text put in quotes to indicate a quotation, like so: citations the content of the cite attribute sounds useful, but unfortunately browsers, screenreaders, etc.
.../cite></a>: </p> <blockquote cite="/docs/web/html/element/blockquote"> <p>the <strong>html <code><blockquote></code> element</strong> (or <em>html block quotation element</em>) indicates that the enclosed text is an extended quotation.</p> </blockquote> <p>the quote element — <code><q></code> — is <q cite="/docs/web/html/element/q">intended for short quotations that don't req
uire paragraph breaks.</q> -- <a href="/docs/web/html/element/q"> <cite>mdn q page</cite></a>.</p> citations are styled in italic font by default.
Structuring a page of content - Learn web development
previous overview: introduction to html structuring a page of content ready for laying it out using css is a very important skill to master, so in this assessment you'll be tested on your ability to think about how a page might end up looking, and choose appropriate structural semantics to b
uild a layout on top of.
... prereq
uisites: before attempting this assessment you should have already worked through the rest of the course, with a particular emphasis on document and website structure.
... you need to add a s
uitable wrapper for: the header the navigation menu the main content the welcome text the image sidebar the footer you should also: apply the provided css to the page by adding another <link> element just below the existing one provided at the start.
What’s in the head? Metadata in HTML - Learn web development
prereq
uisites: basic html familiarity, as covered in getting started with html.
...in the above example, the head is q
uite small: <head> <meta charset="utf-8"> <title>my test page</title> </head> in larger pages however, the head can get q
uite full.
... summary that marks the end of our q
uickfire tour of the html head — there's a lot more you can do in here, but an exhaustive tour would be boring and confusing at this stage, and we just wanted to give you an idea of the most common things you'll find in there for now!
Multimedia and Embedding - Learn web development
get started prereq
uisites before starting this module, you should have a reasonable understanding of the basics of html, as previously covered in introduction to html.
... g
uides this module contains the following articles which will take you through all the fundamentals of embedding multimedia on webpages.
... assessments the following assessments will test your understanding of the html basics covered in the g
uides above: mozilla splash page in this assessment, we'll test your knowledge of some of the techniques discussed in this module's articles, getting you to add some images and video to a funky splash page all about mozilla!
Structuring the web with HTML - Learn web development
to b
uild websites, you should know about html — the fundamental technology used to define the structure of a webpage.
... get started prereq
uisites before starting this topic, you should have at least basic familiarity with using computers and using the web passively (i.e.
... can then move on to learning about more advanced topics such as: css, and how to use it to style html (for example alter your text size and fonts used, add borders and drop shadows, layout your page with multiple columns, add animations and other visual effects.) javascript, and how to use it to add dynamic functionality to web pages (for example find your location and plot it on a map, make
ui elements appear/disappear when you toggle a button, save users' data locally on their computers, and much much more.) modules this topic contains the following modules, in a suggested order for working through them.
Image gallery - Learn web development
previous overview: b
uilding blocks now that we've looked at the fundamental b
uilding blocks of javascript, we'll test your knowledge of loops, functions, conditionals and events by getting you to b
uild a fairly common item you'll see on a lot of websites — a javascript-powered image gallery.
... prereq
uisites: before attempting this assessment you should have already worked through all the articles in this module.
... previous overview: b
uilding blocks in this module making decisions in your code — conditionals looping code functions — reusable blocks of code b
uild your own function function return values introduction to events image gallery ...
Silly story generator - Learn web development
prereq
uisites: before attempting this assessment you should have already worked through all the articles in this module.
... converts the default us weight and temperature quantities and units in the story into uk eq
uivalents if the uk radio button is checked before the generate button is pressed.
...the following for example turns the background of the <html> element red — so the entire browser window should go red if the javascript is applied properly: document.queryselector('html').style.backgroundcolor = 'red'; math.round() is a b
uilt-in javascript method that simply rounds the result of a calculation to the nearest whole number.
Useful string methods - Learn web development
previous overview: first steps next now that we've looked at the very basics of strings, let's move up a gear and start thinking about what useful operations we can do on strings with b
uilt-in methods, such as finding the length of a text string, joining and splitting strings, substituting one character in a string for another, and more.
... prereq
uisites: basic computer literacy, a basic understanding of html and css, an understanding of what javascript is.
...but there are a few that you'll potentially use q
uite often that we'll look at here.
Multimedia: video - Learn web development
prereq
uisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies.
... <video autoplay="" loop="" muted="true" playsinline="" src="backgroundvideo.mp4"> while the loop and autoplay make sense for a looping and autoplaying video, the muted attribute is req
uired for autoplay in mobile browsers.
... playsinline is req
uired for mobile safari, allowing videos to play without forcing fullscreen mode.
Properly configuring server MIME types - Learn web development
mime types describe the media type of content either in email or served by web servers or web applications and are intended to help g
uide a web browser in how the content is to be processed and displayed.
... note: historically, firefox has loaded css files even if they had the wrong mime type, as long as the html document that requested them was being processed in q
uirks mode.
... according to the standards, a meta tag that gives the mime type such as <meta http-eq
uiv="content-type" content="text/html"> should be ignored if there's a content-type line in the header.
Beginning our React todo list - Learn web development
for a running live version, see https://mdn.github.io/todo-react-b
uild/.
... prereq
uisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line.
...the
ui for editing a task is conspicuously absent for now.
Tools and testing - Learn web development
get started prereq
uisites you should really learn the basics of the core html, css, and javascript languages first before attempting to use many the tools detailed here.
... understanding client-side javascript frameworks javascript frameworks are an essential part of modern front-end web development, providing developers with tried and tested tools for b
uilding scalable, interactive web applications.
... many modern companies use frameworks as a standard part of their tooling, so many front-end development jobs now req
uire framework experience.
Information for Governments and Other Organizations Evaluating Mozilla
mozilla's section 508 compliance section 508 is a set of accessibility req
uirements that help us federal agencies decide what software applications they can use.
... mozilla's w3c user agent g
uidelines evaluation report w3c's wai is advancing another important set of accessibility standards called uaag.
... these g
uidelines go much further than section 508 does and mozilla is further from doing a good job at satisfying them.
Theme concepts
defining a theme to create a theme (in this example a simple, single image theme): create a folder in a s
uitable location on your computer.
...next, you b
uild a json object containing the same information you would use in a static theme’s manifest.json, finally, pass the json object in a theme.update() call.
... return; } currenttheme = theme; browser.theme.update(themes[theme]); } learn more about dynamic themes and see an additional example in the following video: if you have not b
uilt a browser extension before, check out your first extension for a step-by-step g
uide.
Adding a new event
in such cases, you may need to add new paramtraits for the new event class in nsg
uieventipc.h.
...if it's possible, you just need to add an entry to generated_events_webidl_files in dom/webidl/moz.b
uild.
...add the header file to exports.mozilla.dom in dom/events/moz.b
uild.
Adding a new word to the en-US dictionary
the process is pretty straight-forward: get a clone of uxp, if you don't already have one, and make sure you can b
uild it successfully.
... add and remove words in the dictionary file, then q
uit the editor.
... b
uild firefox and test your updated dictionary.
Debugging Chrome
unfortunately, it req
uires using --single-process which crashes on startup for me.
...i copied the d3d9.dll into both c:\users\jrm
uizel\appdata\local\google\chrome sxs\application\22.0.1186.0 and c:\users\jrm
uizel\appdata\local\google\chrome sxs\application\.
...i did trace_file=foo.txt and it created the trace file in "c:\users\jrm
uizel\appdata\local\google\chrome sxs\application\22.0.1183.0\foo.txt".
Debugging JavaScript
browser debugger (b
uilt-in) on firefox 19 or later, it's possible to use the b
uilt-in js debugger on the browser itself.
...(note that before firefox 28, only the script debugger was available.) the use of these tools are the same as the b
uilt-in tools.
...in debug b
uilds this also dumps a stack trace to the console, even when the debugger is not running.
Debugging OpenGL
opengl debug mode when running a debug b
uild, you can enable the opengl debug mode by defining the environment variable moz_gl_debug.
... note: you can download debug b
uilds from mozilla taskcluster — click an appropriate platform's debug b
uild on the left, e.g.
... linux64-debug, then find the b
uild link on the right hand side (this would be target.tar.bz2 for linux, target.dmg for macos, and target.zip for windows).
Creating Custom Events That Can Pass Data
(see bug 427537) req
uirements in order to do this you must be able to do all of the following: download mozilla source code b
uild mozilla creating custom firefox extensions with the mozilla b
uild system.
...mozilla/content/events/src/nseventdispatcher.cpp note: in the mozilla 1.8.x branch this code is actually in mozilla/content/events/src/nseventlistenermanager.cpp this is q
uite an important file since this holds the createevent method which acts as a factory method dom events.
... #include "nsidomevent.idl" [scriptable, u
uid(08bea243-8a7b-4554-9ee9-70d7785d741b)] interface nsidommyevent: nsidomevent { //put members here!
Experimental features in Firefox
these nightly b
uilds of firefox typically include experimental or partially-implemented features, including those for proposed or cutting-edge web platform standards.
...this feature is available in nightly b
uilds effective in firefox for android 81 or later.
... nightly 80 yes developer edition 80 yes beta 80 no release 80 no preference name devtools.netmonitor.features.serversentevents
ui desktop zooming this feature lets you enable smooth pinch zooming on desktop computers without req
uiring layout reflows, just like mobile devices do.
Multiple Firefox profiles
third-party tools in addition to the b
uilt-in profile manager and the external profile manager, there are a few third-party tools that make working with multiple profiles easy.
... launching firefox into a desired profile although it is possible in some cases to have multiple instances of firefox running in different profiles, to avoid confusion, you might want to first exit/q
uit/terminate all running instances of firefox, firefox developer edition or nightly.
... windows in windows, the developer and nightly b
uilds get their own directory in the "programs" folder, so you don't have to worry about where to store the downloaded files.
Performance
ameglobal = message.target result = helper(frameglobal.content, message.data) frameglobal.sendasyncmessage("my-addon:response-from-child", {something: result}) } function addframe(frameglobal) { frameglobal.addmessagelistener("my-addon:request-from-parent", dosomething) } javascript modules are per-process singletons and thus all their objects are only initialized once, which makes them s
uitable for stateless callbacks.
...not only does that increase memory footprint but the deserialization also has to be executed seperately for each tab, thus req
uiring more cpu time.
...remove interactive
ui elements that would be inert with the addon ...
Message manager
these g
uides explain how to use message managers in multiprocess firefox.
... note that none of this req
uires multiprocess firefox: everything described here will work with single-process firefox, so the same code will work on both variants.
... g
uides message manager overview frame script loading and lifetime communicating with frame scripts performance best practices frame script environment limitations of frame scripts process scripts api reference nsiframescriptloader nsimessagelistenermanager nsimessagebroadcaster nsimessagesender nsisyncmessagesender nsicontentframemessagemanager nsiprocessscriptloader ...
Storage access policy: Block cookies from trackers
firefox uses the b
uilt-in tracking protection url classifier to determine which resources match the tracking protection list.
... storage access grants in order to improve web compatibility and permit third-party integrations that req
uire storage access, firefox will grant storage access scoped to the first party for a particular third-party origin as described in this section.
...if we discover that an origin is abusing this heuristic to gain tracking access, that origin will have the additional req
uirement that it must have received user interaction as a first party within the past 30 days.
Firefox and the "about" protocol
here is a complete list of urls in the about: pseudo protocol: about: page description about:about provides an overview of all about: pages available for your current firefox version about:addons add-ons manager about:b
uildconfig displays the configuration and platform used to b
uild firefox about:cache displays information about the memory, disk, and appcache about:checkerboard switches to the checkerboarding measurement page, which allows to detect checkerboarding issues about:config provides a way to inspect and change firefox preferences and settings about:compat ...
... about:preferences firefox settings (also available through firefox menu > options) about:privatebrowsing start page when opening a private window about:profiles display and manage firefox profiles about:protections privacy protections report consisting of enhanced tracking protection, firefox monitor and firefox lockwise data about:restartreq
uired a page users are sent to when firefox req
uires a restart due to an update about:reader indicates a web page has firefox reader view turned on.
... the about location information is duplicated in docshell/b
uild/nsdocshellmodule.cpp.
How to get a process dump with Windows Task Manager
req
uirements windows to get a process dump, you need to be using windows vista or above.
...you can use any official nightly b
uild or released version of firefox from mozilla.
... you can find the latest trunk nightly b
uilds under http://ftp.mozilla.org/pub/mozilla.o.../latest-trunk/.
JavaScript Tips
some xpcom methods expect an object that implements several interfaces thus req
uiring you to write a queryinterface method.
... however, in javascript this is q
uite simple even in the case of a weak reference which in c++ req
uires a helper class: var weakobserver = { queryinterface: function queryinterface(aiid) { if (aiid.equals(components.interfaces.nsiobserver) || aiid.equals(components.interfaces.nsisupportsweakreference) || aiid.equals(components.interfaces.nsisupports)) return this; throw components.results.ns_nointerface; }, observe: function observe(asubject, atopic, astate) { } } when declaring xpcom methods, try to use the same names for method parameters as are used in the interface definition.
... references this was started as a reprint of neil's g
uide some more current info on this blog post how to remove duplicate objects from an array javascript ...
InstallListener
ninstall install) void oninstallended(in addoninstall install, in addon addon) void oninstallcancelled(in addoninstall install) void oninstallfailed(in addoninstall install) void onexternalinstall(in addon install, in addon existingaddon, in boolean needsrestart) methods onnewinstall() called when a new instance of addoninstall is created, primarily so
ui can display some kind of progress for all installs.
...the newly installed add-on may req
uire a restart in order to become active.
... void onexternalinstall( in addon addon, in addon existingaddon, in boolean needsrestart ) parameters addon the newly installed addon existingaddon an addon that will be replaced by this install or null if no add-on is being replaced needsrestart true if the installation req
uires a restart ...
OSFile.jsm
if the operation is called on the main thread, this means that the whole user experience is stuck for several seconds, which is q
uite bad.
...smartphones, tablets) and because, regardless of the platforms, doing too much i/o penalizes not just your application but potentially all the applications running on the system, which is q
uite bad for the user experience.
...from a worker thread in some cases, the main thread api for os.file is not appropriate as it would req
uire too much message passing, or because the code that req
uires file i/o is already executed on a worker thread.
WebRequest.jsm
in particular, "blocking" may be passed to several event types, and will make the event dispatch synchronous, so the browser will wait for the event listener to return before contin
uing with the request.
...this tells the browser to wait for your event listener to return before contin
uing with the request.
... the onauthreq
uired, onbeforeredirect, and onerroroccurred events are not supported.
XPCOMUtils.jsm
to use this, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/xpcomutils.jsm"); using xpcomutils exposing a javascript class as a component using these utility methods req
uires four key steps: import xpcomutils.jsm, as explained previously.
... constructor the constructor is a simple method that handles any req
uired initialization tasks.
... mycomponent.prototype = { // properties req
uired for xpcom registration: classdescription: "unique text description", classid: components.id("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"), contractid: "@example.com/xxx;1", // [optional] custom factory (an object implementing nsifactory).
Setting up the infrastructure
req
uirements: php with gettext support, apache and some unix experience.
... review the english content following the web content localizability g
uidelines.
... review your code following the web applications localizability g
uidelines.
Extras
they are not portable and are meant to showcase a few interesting upshots from b
uilding natively upon the browser environment.
...#grad1)"/> <g transform="translate(150,125)"> <g> <animatetransform attributename="transform" attributetype="xml" type="rotate" from="0" to="360" dur="6s" repeatcount="indefinite"/> <g transform="translate(-50,-35)"> <rect width="100" height="70" fill="url(#grad2)"/> <switch> <foreignobject width="100" height="70" req
uiredextensions="http://www.w3.org/1998/math/mathml"> <math display="block"> <mrow> <mo>(</mo> <mtable> <mtr> <mtd><mi>cos</mi><mi>θ</mi></mtd> <mtd><mo>−</mo><mi>sin</mi><mi>θ</mi></mtd> </mtr> <mtr> <mtd><mi>sin</mi><mi>θ</mi></mtd> <mtd><mi>cos</mi><mi>θ</mi></mtd> </mtr> </mtable> <mo>)</mo> </mrow> </math> </foreignobject> <text>rotation matrix</text> </switch> </g></g></g> <g> <animatemo...
...,69 z" begin="0s" dur="20s" repeatcount="indefinite"/> <animatetransform attributename="transform" attributetype="xml" type="scale" values="1;2;.5;1" keytimes="0;.25;.75;1" dur="20s" repeatcount="indefinite"/> <circle fill="url(#grad3)" r="30"/> <g transform="translate(-30,-30)"> <switch> <foreignobject width="60" height="60" req
uiredextensions="http://www.w3.org/1998/math/mathml"> <math display="block"> <mrow> <munderover> <mo>∑</mo> <mrow> <mi>n</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mo>+</mo> <mi>∞</mi> </mrow> </munderover> <mfrac> <msup> <mi>α</mi> <mi>n</mi> </msup> <mrow> <mi>n</mi> <mo>!</mo> </mrow> </mfrac> </mrow> </math> </foreignobject> <text>exp(α)</text> </switch> </g> </g> </svg> </div> inline...
MathML Demo: <mo> - operator, fence, separator, or accent
fixed sized fences are useful with nested fences as in the following example [ [ a b ] + [ b a ] ] + [ a b ] latex fences that are b
uilt into fractions (\binom, etc.) are not stretchy, but they are taller in displays.
... emulating this behavior in mathml would req
uire a context sensitive transaltion.
...some examples of inline fractions ( 8 - 5 8 ) + [ 1 2 ] + ⌊ 1 2 2 ⌋ + ⌈ 1 x y x + 1 ⌉ + | e - 2 π t θ | with b
uilt in fences.
Mozilla Port Blocking
each protocol's handler can override this blocking for itself in order to enable the req
uired access for that protocol.
... potential problems caused by port blocking port blocking can cause problems if a site or web application req
uires access to one of the ports which is blocked in mozilla.
... better user interface allow the user to decide if the blocking is really req
uired.
Mozilla Development Tools
the tools needed to b
uild mozilla are described on the b
uild page for your platform.
...it is our home-grown web-based tool for watching the progress of the continuous b
uilds that we run on multiple platforms.
... it is how we are able to tell when a checkin has broken the b
uild on some platform, and how we know which person needs to be viciously flogged.
Activity Monitor, Battery Status Menu and top
activity monitor this is a b
uilt-in os x tool that shows real-time process measurements.
...task_power_info::task_interrupt_wakeups obtained from the task_info function.) req
uires high perf gpu: many macs have two gpus: a low-power, low-performance integrated gpu, and a high-power, high-performance external gpu.
...and it appears that a program with an “energy impact” of roughly 20 or more will eventually show up as significant, and programs that have much higher “energy impact” values tend to show up more q
uickly.
Reporting a Performance Problem
this article will g
uide you in reporting a performance problem using the b
uilt-in gecko profiler tool.
...when it runs out of space in its buffer, it discards old entries so you may want to increase the buffer size if you find you are unable to capture the profile q
uickly enough after you notice a performance problem.
... using the keyboard shortcuts is often more convenient than using the mouse to interact with the
ui: ctrl+shift+1 - start/stop the profiler ctrl+shift+2 - take a profile and launch the viewer to view it capturing and sharing a profile while the profiler is recording, reproduce the performance problem.
Phishing: a short definition
phishing is an attempt to collect sensitive information, such as usernames, passwords, and financial details by disg
uising as a trustworthy entity online.
... shifting blame to users some q
uick-to-implement, and cost-effective solutions, hold users accountable for their actions instead of restricting what’s technically possible.
...the ss7 telephony system is vulnerable, making eavesdropping, or rerouting text messages q
uite trivial.
Preference reference
changes req
uire an application restart.browser.download.lastdir.savepersitebrowser.download.lastdir.savepersite controls whether the directory preselected in the file picker for saving a file download is being remembered on a per-website (host) base.
...by default, the reader mode in firefox mobile is only enabled if the memory is greater than 384mb.
ui.alertnotificationorigin
ui.alertnotificationorigin controls the position and direction from which popup notifications invoked by nsialertsservice are sliding in.
ui.spellcheckerunderline
ui.spellcheckerunderline holds the colour which is used to underline words not recognized by the spellchecker.
ui.spellcheckerunderlinestyle
ui.spellcheckerunderlinestyle holds the style which is used to underline wor...
...ds not recognized by the spellchecker.
ui.textselectbackground
ui.textselectbackground saves the color in which the background of a text selection in the user interface or in content will be styled.
ui.textselectforeground
ui.textselectforeground saves the color in which the text of a text selection in the user interface or the content will be styled.
ui.tooltipdelay
ui.tooltipdelay stores the delay in milliseconds between the mouse stopping over an element and the appearing of its tooltip.view_source.syntax_highlightthe preference view_source.syntax_highlight controls whether markup in the view source view is syntax highlighted.
Localization Use Cases
this article documents a few opportunities to improve the localization of gaia (the
ui layer of firefox os) by using l20n.
... english: availablesize = {[ plural(size) ]} availablesize[other] = {{$size}} {{$unit}} available an italian translation might look like this: availablesize = {[ plural(size) ]} availablesize[one] = {{$size}} {{$unit}} disponibile availablesize[other] = {{$size}} {{$unit}} disponibili it's easy to imagine how developers might forget to pluralize some strings that in other languages might req
uire pluralization (or other grammatical features that the framework supports).
... solution l20n isolates each language so that grammatical req
uirements of one don't affect others.
MailNews automated testing
it allows reviewers to q
uickly pick up regressions in patches and helps developers to think about different cases.
...xpcshell-tests are the q
uickest tests to run.
... performance testing mail leak and bloat tests these tests start up thunderbird or seamonkey and record any leaks found, as well as the total memory req
uirement.
NSPR Poll Method
the prototype of the poll method is print16 poll_method(prfiledesc *fd, print16 in_flags, print16 *out_flags); the purpose of the poll method is to allow a layer to modify that flags that will ultimately be used in the call to the underlying network transport's select (or eq
uivalent) function, and to indicate that a layer is already able to make progress in the manner suggested by the polling flags.
...the current implementation of pr_poll (the primary user of the poll method) req
uires that the events in *out_flags reflect the caller's view.
... this req
uirement may be relaxed in a future nspr release.
NSPR release procedure
before you run repackage.sh, you need to have b
uilt the binary distributions using the "gmake release" makefile target.
... these binary distributions are jar files, which are really zip files, and they are published in the directory /share/b
uilds/components.
...note: for nss, the script eq
uivalent to nspr's repackage.sh is /u/robobld/bin/sbsinit/nss/push/b
uildbindist.sh in the "svb
uild" source tree.
NSPR's Position On Abrupt Thread Termination
in the situation where it was defined (unix), which has only a single thread of execution, that is eq
uivalent to terminating the process.
...certain people have been disappointed when nspr did not provide a functional eq
uivalent to exit just a particular thread.
...to make this solution work req
uires that a function that encounters an error be designed such that it first repairs its immediate state, and then reports that error to its caller.
Logging
logging is compiled into the nspr debug b
uilds; logging is not compiled into the nspr optimized b
uilds.
... to enable nspr logging and/or the debugging aids in your application, compile using the nspr debug b
uild headers and runtime.
... set one of the compile-time defines when you b
uild your application.
PRNetAddr
syntax #include <prio.h> union prnetaddr { struct { pr
uint16 family; char data[14]; } raw; struct { pr
uint16 family; pr
uint16 port; pr
uint32 ip; char pad[8]; } inet; #if defined(_pr_inet6) struct { pr
uint16 family; pr
uint16 port; pr
uint32 flowinfo; pripv6addr ip; } ipv6; #endif /* defined(_pr_inet6) */ }; typedef union prnetaddr prnetaddr; fields the structure has the following fields: family address family: pr_af_inet|pr_af_inet6 for raw.family, pr_af_inet for inet.family, pr_af_inet6 for ipv6.family.
...by default, nspr is b
uilt to support only ipv4, but it's possible to b
uild the nspr library to support both ipv4 and ipv6.
...the raw member of the union is eq
uivalent to struct sockaddr, the inet member is eq
uivalent to struct sockaddr_in, and if the binary is b
uilt with ipv6 support, the ipv6 member is eq
uivalent to struct sockaddr_in6.
PR_WaitCondVar
timeout the value pr_interval_no_timeout req
uires that a condition be notified (or the thread interrupted) before it will resume from the wait.
... the value pr_interval_no_wait causes the thread to release the lock, possibly causing a rescheduling within the runtime, then immediately attempt to reacq
uire the lock and resume.
...when scheduled, the thread attempts to reacq
uire the lock that it held when pr_waitcondvar was called.
NSPR release process
make sure the nss tinderboxes (which also b
uild and test nspr) are all green.
... the b
uild+test cycles of the nss tinderboxes are very long, so you usually need to wait half a day for them to cycle through.
... push the beta tag to mozilla-central for testing in firefox trunk b
uilds.
NSPR
nspr b
uild instructions how to checkout and b
uild from source.
... legacy nspr content older nspr content is available in svn for browsing and/or migration to this site getting nspr nspr is available in various source and binary packages, depending on your platform: windows: b
uild the source package, using the nspr b
uild instructions.
... opensuse linux: install one or more of the following via yast or zypper : mozilla-nspr : binary libraries for your platform mozilla-nspr-32bit : binary libraries needed to run 32-bit programs on a 64-bit os mozilla-nspr-devel : files needed (in addition to the above libraries) to compile programs using nspr mozilla-nspr-debuginfo : debug information (including b
uild symbols) for package mozilla-nspr mozilla-nspr-debuginfo-32bit : debug information (including b
uild symbols) for package mozilla-nspr-32bit mozilla-nspr-debugsource : debug sources for all of the above community view mozilla forums...
Getting Started With NSS
its b
uild system and the automated tests are based on makefiles and bash scripts.
... learn about getting the nss sources, b
uilding, and testing.
... creating your patch seee our section on nss sources, b
uilding, and testing to get started making your patch.
nsIArray
method overview nsisimpleenumerator enumerate(); unsigned long indexof(in unsigned long startindex, in nsisupports element); void queryelementat(in unsigned long index, in nsiidref u
uid, [iid_is(u
uid), retval] out nsqiresult result); attributes attribute type description length unsigned long the number of elements in the array.
...void queryelementat( in unsigned long index, in nsiidref u
uid, [iid_is(u
uid), retval] out nsqiresult result ); parameters index position of element.
... u
uid the iid of the requested interface.
nsIBrowserHistory
attributes attribute type description count obsolete since gecko 15.0 pr
uint32 indicates if there are entries in global history.
...this method is called by the
ui when the user deletes a history entry.
...it is called from the
ui when the user deletes a group associated with a host or domain.
nsICacheEntryInfo
expirationtime pr
uint32 get the expiration time of the cache entry (in seconds since the epoch).
... lastfetched pr
uint32 get the last time the cache entry was opened (in seconds since the epoch).
... lastmodified pr
uint32 get the last time the cache entry was modified (in seconds since the epoch).
nsICryptoHash
passing pr_
uint32_max indicates that all data available will be used to update the hash.
...ream;1"] .createinstance(components.interfaces.nsifileinputstream); // open for reading istream.init(f, 0x01, 0444, 0); var ch = components.classes["@mozilla.org/security/hash;1"] .createinstance(components.interfaces.nsicryptohash); // we want to use the sha256 algorithm ch.init(ch.sha256); // this tells updatefromstream to read the entire file const pr_
uint32_max = 0xffffffff; ch.updatefromstream(istream, pr_
uint32_max); // pass false here to get binary data back var hash = ch.finish(false); // return the two-digit hexadecimal code for a byte function tohexstring(charcode) { return ("0" + charcode.tostring(16)).slice(-2); } // convert the binary hash data to a hex string.
...passing pr_
uint32_max here indicates that you want the entire file read.
nsIDBChangeListener
oldparent, in nsmsgkey newparent, in nsidbchangelistener ainstigator); void onannouncergoingaway(in nsidbchangeannouncer instigator); void onreadchanged(in nsidbchangelistener ainstigator); void onjunkscorechanged(in nsidbchangelistener ainstigator); void onhdrpropertychanged(in nsimsgdbhdr ahdrtochange, in unsigned long aoldflags, in prbool aprechange, inout pr
uint32 astatus, in nsidbchangelistener ainstigator); void onevent(in nsimsgdatabase adb, in string aevent); methods onhdrflagschanged() called when a message's flags change.
...onhdrpropertychanged saves any req
uired status in astatus (such as a filter match).
... void onhdrpropertychanged(in nsimsgdbhdr ahdrtochange, in prbool aprechange, inout pr
uint32 astatus, in nsidbchangelistener ainstigator); parameters ahdrtochange the nsimsgdbhdr of the message that is changing.
nsIDOMXULElement
b
uilder nsixultemplateb
uilder read only.
... retrives the element's template b
uilder, if it has a template.
...returns the template b
uilder's database, if it is an rdf template.
nsIDebug2
xpcom/base/nsidebug2.idlscriptable adds access to additional information in debug b
uilds of mozilla code by expanding upon the features in nsidebug 1.0 66 introduced gecko 1.9.2 inherits from: nsidebug last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type description assertioncount long the number of assertions since process start.
... this is normally zero in release b
uilds, but does include calls to nsidebug.assertion().
... isdebugb
uild boolean whether xpcom was compiled with debug defined.
nsIFocusManager
nsidomelement getfocusedelementforwindow(in nsidomwindow awindow, in prbool adeep, out nsidomwindow afocusedwindow); pr
uint32 getlastfocusmethod(in nsidomwindow window); void movecarettofocus(in nsidomwindow awindow); void elementisfocusable(in nsidomelement aelement, in unsigned long aflags); nsidomelement movefocus(in nsidomwindow awindow, in nsidomelement astartelement, in unsigned long atype, in unsigned long aflags); void setfocus(in nsidomelement aelement, in unsigned long a...
... getlastfocusmethod() pr
uint32 getlastfocusmethod( in nsidomwindow window ); parameters window if null, then the current focusedwindow will be used by default.
...this method is eq
uivalent to setting the focusedelement to the new element.
nsIHTMLEditor
ffset, in boolean adeleteselection); void insertlinkaroundselection(in nsidomelement aanchorelement); boolean isanonymouselement(in nsidomelement aelement); void makeorchangelist(in astring alisttype, in boolean entirelist, in astring abullettype); boolean nodeisblock(in nsidomnode node); void pastenoformatting(in long aselectiontype); void reb
uilddocumentfromsource(in astring asourcestring); void removealldefaultproperties(); void removeallinlineproperties(); void removedefaultproperty(in nsiatom aproperty, in astring aattribute, in astring avalue); void removeinlineproperty(in nsiatom aproperty, in astring aattribute); void removeinsertionlistener(in nsicontentfilter infilter); void ...
... void pastenoformatting( in long aselectiontype ); parameters aselectiontype reb
uilddocumentfromsource() reb
uild the entire document from source html needed to be able to edit head and other outside-of-body content.
... void reb
uilddocumentfromsource( in astring asourcestring ); parameters asourcestring html source string of the entire new document.
nsIInterfaceRequestor
the main difference is that interfaces returned are not req
uired to provide a way back to the object implementing nsiinterfacerequestor.
...method overview void getinterface(in nsiidref u
uid, [iid_is(u
uid),retval] out nsqiresult result); methods getinterface() retrieves the specified interface pointer.
... void getinterface( in nsiidref u
uid, [iid_is(u
uid),retval] out nsqiresult result ); parameters u
uid the iid of the interface being requested.
nsIJSID
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) the following methods return objects that implement this interface: components.interfaces.name components.classes[contract] components.interfacesbyid[u
uid] components.classesbyid[cid] the first two cases create a named jsid while the last two cases create an unnamed jsid.
...method overview boolean equals(in nsijsid other); const nsid* getid(); violates the xpcom interface g
uidelines void initialize(in string idstring); string tostring(); attributes attribute type description id nsidptr read only.
... violates the xpcom interface g
uidelines getid() const nsid* getid(); parameters none.
nsIJSON
when the original instance req
uiring this function is removed, this method will be removed.
... when the original instance req
uiring this function is removed, this method will be removed.
... when the original instance req
uiring this function is removed, this method will be removed.
nsIMimeConverter
unsigned long get
uint32property(in string propertyname); parameters propertyname the name of the property to retrieve.
... thunderbird stored
uint32 properties (not a complete list): indexed used for spotlight integration on osx.
... qpencoderinit() void set
uint32property(in string propertyname, in unsigned long propertyval); parameters propertyname the name of the property to set.
nsINavHistoryQuery
toolkit/components/places/public/nsinavhistoryservice.idlscriptable encapsulates all the query parameters you're likely to need when b
uilding up history
ui.
...setting this is eq
uivalent to listing all bookmark folders in the folders parameter.
...this optional parameter was req
uired prior to gecko 2.0.
nsINavHistoryResultObserver
invalidatecontainer() called when something has happened that req
uires that the contents of a container be reb
uilt.
... void invalidatecontainer( in nsinavhistorycontainerresultnode acontainernode ); parameters acontainernode the container that should be reb
uilt.
... sortingchanged() this is called to indicate to the
ui that the sort has changed to the given mode.
nsINavHistoryService
this can be used in
ui to determine whether the "clear history" button should be enabled or not.
... queriestoquerystring() this method converts a query into an eq
uivalent string that can be persisted.
... return value returns the converted query into an eq
uivalent string query.
nsIParserUtils
astring converttoplaintext( in astring src, in unsigned long flags, in unsigned long wrapcol ); parameters src the html source to parse (c++ callers are allowed but not req
uired to use the same string for the return value.) flags conversion option flags defined in nsidocumentencoder.
... the sanitizer is designed to protect against xss when sanitized content is inserted into a different-origin context without an iframe-eq
uivalent sandboxing mechanism.
... astring sanitize( in astring src, in unsigned long flags ); parameters src the html source to parse (c++ callers are allowed but not req
uired to use the same string for the return value).
nsIPrincipal
in string capability, inout voidptr annotation ); parameters capability missing description annotation missing description native code only!enablecapability void enablecapability( in string capability, inout voidptr annotation ); parameters capability missing description annotation missing description equals() returns whether the other principal is eq
uivalent to this principal.
... return value true if the two principals are eq
uivalent; otherwise false.
... native code only!getjsprincipals returns the js eq
uivalent of the principal.
nsIScriptError2
method overview void initwithwindowid(in wstring message, in wstring sourcename, in wstring sourceline, in pr
uint32 linenumber, in pr
uint32 columnnumber, in pr
uint32 flags, in string category, in unsigned long long innerwindowid); attributes attribute type description innerwindowid unsigned long long the inner window id with which the error is associated.
... methods initwithwindowid() void init( in wstring message, in wstring sourcename, in wstring sourceline, in pr
uint32 linenumber, in pr
uint32 columnnumber, in pr
uint32 flags, in string category, in unsigned long long innerwindowid ); parameters message the text of the message to add to the log.
...there are q
uite a few category strings and they don't seem to be listed in a single place.
nsISocketTransport
they do overlap with existing error codes in necko, these status codes are confined within a very limited context where no error codes may appear, so there is no ambig
uity.
...a value of pr_
uint32_max is eq
uivalent to no timeout.
... avalue defines the timeout in seconds, pass pr_
uint32_max to specify no timeout.
nsIStackFrame
language pr
uint32 see nsiprogramminglanguage for a list of language constants.
... example to output the stack at a particular location: var s = components.stack; while(s) { console.log(s.name); s = s.caller; } methods tostring() a generic formatter - make it s
uitable to print, and so forth.
...return value a string s
uitable for output.
nsISupports
last changed in gecko 1.0 method overview nsrefcnt addref();violates the xpcom interface g
uidelines void queryinterface(in nsiidref u
uid, [iid_is(u
uid),retval] out nsqiresult result); nsrefcnt release();violates the xpcom interface g
uidelines methods violates the xpcom interface g
uidelines addref() notifies the object that an interface pointer has been duplicated.
... void queryinterface( in nsiidref u
uid, [iid_is(u
uid),retval] out nsqiresult result ); parameters u
uid the u
uid of the requested interface result the resulting interface pointer.
... violates the xpcom interface g
uidelines release() notifies the object that an interface pointer has been destroyed and any resources the object held on behalf of the client can be released.
nsITaskbarTabPreview
method overview void ensureregistration(); violates the xpcom interface g
uidelines nativewindow gethwnd(); violates the xpcom interface g
uidelines void move(in nsitaskbartabpreview anext); attributes attribute type description icon imgicontainer the icon displayed next to the title in the preview.
... methods violates the xpcom interface g
uidelines ensureregistration() used internally to ensure that the taskbar knows about this preview.
... violates the xpcom interface g
uidelines gethwnd() used internally to obtain the handle to the proxy window for the preview.
nsITelemetry
erits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) implemented by: @mozilla.org/base/telemetry;1 as a service: let telemetry = components.classes["@mozilla.org/base/telemetry;1"] .getservice(components.interfaces.nsitelemetry); method overview jsval gethistogrambyid(in acstring id); jsval snapshothistograms(in
uint32_t adataset, in boolean asubsession, in boolean aclear); jsval getkeyedhistogrambyid(in acstring id); void capturestack(in acstring name); jsval snapshotcapturedstacks([optional] in boolean clear); nsisupports getloadedmodules(); jsval snapshotkeyedhistograms(in
uint32_t adataset, in boolean asubsession, in boolean aclear); void sethistogr...
...cordingenabled(in acstring id, in boolean enabled); void asyncfetchtelemetrydata(in nsifetchtelemetrydatacallback acallback); double mssinceprocessstart(); void scalaradd(in acstring aname, in jsval avalue); void scalarset(in acstring aname, in jsval avalue); void scalarsetmaximum(in acstring aname, in jsval avalue); jsval snapshotscalars(in
uint32_t adataset, [optional] in boolean aclear); void keyedscalaradd(in acstring aname, in astring akey, in jsval avalue); void keyedscalarset(in acstring aname, in astring akey, in jsval avalue); void keyedscalarsetmaximum(in acstring aname, in astring akey, in jsval avalue); jsval snapshotkeyedscalars(in
uint32_t adataset, [optional] in boolean aclear); ...
... void clearscalars(); test only void flushbatchedchildtelemetry(); void recordevent(in acstring acategory, in acstring amethod, in acstring aobject, [optional] in jsval avalue, [optional] in jsval extra); void seteventrecordingenabled(in acstring acategory, in boolean aenabled); jsval snapshotevents(in
uint32_t adataset, [optional] in boolean aclear); void registerevents(in acstring acategory, in jsval aeventdata); void registerscalars(in acstring acategoryname, in jsval ascalardata); void clearevents(); test only attributes attribute type description canrecordbase boolean a flag indicating if telemetry can record base data (fhr data).
nsIWritablePropertyBag2
autf8string value); void setpropertyasbool(in astring prop, in boolean value); void setpropertyasdouble(in astring prop, in double value); void setpropertyasint32(in astring prop, in print32 value); void setpropertyasint64(in astring prop, in print64 value); void setpropertyasinterface(in astring prop, in nsisupports value); void setpropertyas
uint32(in astring prop, in pr
uint32 value); void setpropertyas
uint64(in astring prop, in pr
uint64 value); methods setpropertyasacstring() void setpropertyasacstring( in astring prop, in acstring value ); parameters prop property to set the value of.
... setpropertyas
uint32() void setpropertyas
uint32( in astring prop, in pr
uint32 value ); parameters prop property to set the value of.
... setpropertyas
uint64() void setpropertyas
uint64( in astring prop, in pr
uint64 value ); parameters prop property to set the value of.
nsIXULRuntime
browsertabsremoteautostart boolean if true, browser tabs may be opened by default in a different process from the main browser
ui.
... is64bit boolean indicates whether the current firefox b
uild is 64-bit.
...if a component encounters startup errors that might prevent the app from showing proper
ui, it should set this flag to true.
nsIXULTemplateResult
mayprocesschildren boolean true if the template b
uilder may use this result as the reference point for additional recursive processing of the template.
... the template b
uilder will reprocess the template using this result as the reference point and generate output content that is expected to be inserted as children of the output generated for this result.
...hasbeenremoved() indicate that the output for a result has been removed and that the result is no longer being used by the b
uilder.
nsIXULWindow
this signals the application in case it needs to q
uit.
...center(in nsixulwindow arelative, in boolean ascreen, in boolean aalert); nsixulwindow createnewwindow(in print32 achromeflags, in nsiappshell aappshell); nsidocshelltreeitem getcontentshellbyid(in wstring id); void removechildwindow(in nsixulwindow achild); void showmodal(); attributes attribute type description chromeflags pr
uint32 chromeflags are from nsiwebbrowserchrome.
... contextflags pr
uint32 contextflags are from nsiwindowcreator2.
NS_CStringContainerInit2
#include "nsstringapi.h" nsresult ns_cstringcontainerinit2( nscstringcontainer& acontainer, const char* adata = nsnull, pr
uint32 adatalength = pr_
uint32_max, pr
uint32 aflags = 0 ); parameters acontainer [in] the nscstringcontainer instance to initialize.
...pass pr_
uint32_max to indicate that adata's length may be determined by scanning the string for a terminating null.
...the ns_cstringcontainerinit function is eq
uivalent to calling ns_cstringcontainerinit with adata=nsnull and aflags=0.
NS_CStringCutData
#include "nsstringapi.h" nsresult ns_cstringcutdata( nsacstring& astring, pr
uint32 acutstart, pr
uint32 acutlength ); parameters astring [in] a nsacstring instance to be modified.
...pass pr_
uint32_max to specify the length from acutstart to the end of the string.
... example code nscstringcontainer str; ns_cstringcontainerinit(str); ns_cstringsetdata(str, "hello world"); // remove " world" portion of string ns_cstringcutdata(str, 5, pr_
uint32_max); const char* data; ns_cstringgetdata(str, &data); printf("%s\n", data); // prints out "hello" ns_cstringcontainerfinish(str); history this function was frozen for mozilla 1.7.
NS_CStringGetMutableData
#include "nsstringapi.h" pr
uint32 ns_cstringgetmutabledata( nsacstring& astring, pr
uint32 adatalength, char** adata ); parameters astring [in] a nsacstring instance to modify.
... adatalength [in] the number of characters to resize the string's internal buffer to or pr_
uint32_max to return the buffer as-is.
...example // convert any uppercase ascii letters to lowercase void tolowercase(nscstring &str) { char *iter; pr
uint32 len = ns_cstringgetmutabledata(str, pr_
uint32_max, &iter); char *end = iter + len; while (iter != end) { char c = *iter; if (c >= 'a' && c <= 'z') *iter = c + ('a' - 'a'); ++iter; } } history this function was finalized for mozilla 1.8.
NS_CStringSetDataRange
#include "nsstringapi.h" nsresult ns_cstringsetdatarange( nsacstring& astring, pr
uint32 acutstart, pr
uint32 acutlength, const char* adata, pr
uint32 adatalength = pr_
uint32_max ); parameters astring [in] a nsacstring instance to modify.
...if equal to pr_
uint32_max, then adata is assumed to be null-terminated.
... example // replace all occurances of |matchval| with |newval| void replacesubstring(nsacstring& str, const nsacstring& matchval, const nsacstring& newval) { const char* sp, *mp, *np; pr
uint32 sl, ml, nl; sl = ns_cstringgetdata(str, &sp); ml = ns_cstringgetdata(matchval, &mp); nl = ns_cstringgetdata(newval, &np); for (const char* iter = sp; iter <= sp + sl - ml; ++iter) { if (memcmp(iter, mp, ml) == 0) { pr
uint32 offset = iter - sp; ns_cstringsetdatarange(str, offset, ml, np, nl); sl = ns_cstringgetdata(str, &sp); iter = sp + offset + ...
NS_StringAppendData
#include "nsstringapi.h" nsresult ns_stringappenddata( nsastring& astring, const prunichar* adata, pr
uint32 adatalength = pr_
uint32_max ); parameters astring [in] a nsastring instance to be modified.
...if equal to pr_
uint32_max, then adata is assumed to be null-terminated.
... remarks this function is defined inline as a wrapper around ns_stringsetdatarange note: gcc req
uires the -fshort-wchar option to compile this example since prunichar is an unsigned short.
NS_StringInsertData
#include "nsstringapi.h" nsresult ns_stringinsertdata( nsacstring& astring, pr
uint32 aoffset, const prunichar* adata, pr
uint32 adatalength = pr_
uint32_max ); parameters astring [in] a nsacstring instance to be modified.
...if equal to pr_
uint32_max, then adata is assumed to be null-terminated.
... note: gcc req
uires the -fshort-wchar option to compile this example since prunichar is an unsigned short.
NS_StringSetDataRange
#include "nsstringapi.h" nsresult ns_stringsetdatarange( nsastring& astring, pr
uint32 acutstart, pr
uint32 acutlength, const prunichar* adata, pr
uint32 adatalength = pr_
uint32_max ); parameters astring [in] a nsastring instance to modify.
...if equal to pr_
uint32_max, then adata is assumed to be null-terminated.
... example code // replace all occurances of |matchval| with |newval| void replacesubstring(nsastring& str, const nsastring& matchval, const nsastring& newval) { const prunichar* sp, *mp, *np; pr
uint32 sl, ml, nl; sl = ns_stringgetdata(str, &sp); ml = ns_stringgetdata(matchval, &mp); nl = ns_stringgetdata(newval, &np); for (const prunichar* iter = sp; iter <= sp + sl - ml; ++iter) { if (memcmp(iter, mp, ml) == 0) { pr
uint32 offset = iter - sp; ns_stringsetdatarange(str, offset, ml, np, nl); sl = ns_stringgetdata(str, &sp); ...
XPCOM reference
see the xpcom internal string g
uide for documentation of the internal string api used within the mozilla codebase.
...eq
uivalent flags are also defined in nsmsgmessageflags.h.
...it is now a strongly typed enum when xpcom is b
uilt using a c++11 compiler.
Performance
when transactions are committed, sqlite does journaling which req
uires syncing data to disk.
...some operations req
uire walking this queue to see what operations have been pending, and they will be slower.
... the problem is that these req
uirements make some operations, especially commits, very slow.
Using nsIDirectoryService
second, you must acq
uire the implementation and call get() passing the known string key.
...you may wish that you could have mozilla use these locations rather than req
uiring the same disk layout as seamonkey.
...once the service finds a location, if the provider says that the location is persistent, the service will cache that location so it is very q
uick on subsequent calls.
The Valgrind Test Job
the valgrind test job b
uilds the browser and runs it under valgrind, which can detect various common memory-related errors.
... this job only runs on linux64, which is the platform best s
uited to running valgrind.
... b
uilding you need a valgrind-enabled b
uild of firefox.
Thunderbird Configuration Files
config editor many of the tips and tricks mentioned on this site can be applied by using the b
uilt-in config editor.
... some preferences may req
uire that you restart thunderbird in order to take effect.
... configuration files some tips and tricks req
uire that you edit configuration files manually.
Theme Packaging
pre-req
uisites making a theme for thunderbird req
uires knowledge of cascading stylesheets (css), probably xbl, and some graphic design and aesthetic skill (...or maybe not).
... 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> req
uired install.rdf properties your install.rdf file must have the following properties.
...:description>a test theme for thunderbird</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 g
uids that you can use in your targetapplication properties: thunderbird {3550f703-e582-4d05-9a08-453d09bdfdc6} seamonkey {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} pale moon {8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4} official references for toolkit api official references.
Thunderbird extensions
b
uilding a thunderbird extension step-by-step explanation on how to b
uild an extension for thunderbird.
... start by reading the tutorial and learn how to b
uild a thunderbird extension.
... also see thunderbird 57-60 add-ons g
uide for changes introduced in thunderbird 60.
Thunderbird
thunderbird is b
uilt on the same technical platform as the firefox web browser.
...(from early 2007 to early 2011 thunderbird was developed by mozilla messaging, a subsidiary owned by mozilla.) documentation b
uilding thunderbird information about b
uilding thunderbird with the comm-central repository.
... thunderbird api documentation thunderbird api documentation extension documentation tutorials and tips for b
uilding thunderbird extensions view all...
Using the Mozilla source server
the nightly debug b
uilds are now also source indexed so that by following a couple of simple steps you can also have the source code served to you for debugging without a local b
uild what you'll need windbg or visual studio (note: express editions will not work, but windbg is a free download) a nightly b
uild that was created after april 15, 2008; go to the /pub/firefox/nightly/latest-mozilla-central/ folder and grab the installer for b
uilds predating the switch to mercurial, you'll need cvs.exe, added to your path (the cvs.exe from mozillab
uild has problems, use this one instead) note: do not use the cvs from mozillab
uild, it will not work!
...also, disable (uncheck) the box that says "req
uire source files to exactly match the original version".
...symbols will load and then, if you're using a cvs b
uild, when you try to step into or step over a confirmation window will appear asking if you trust the cvs command that source server is trying to run.
Zombie compartments
for example, for an add-on that remembers passwords, visit a site that req
uires a password; for an add-on that performs an operation involving a specific page element such as an image or a chunk of text, perform that operation.
... the more you exercise the add-on, the more thorough the testing will be, but in practice a lot of problems show up q
uickly.
...(please note that you may need to close the about:addons
ui before changes are made).
Using Objective-C from js-ctypes
this g
uide explains how to convert objective-c code into js-ctypes code.
...take the following function call: id text = objc_msgsend(tmp2, initwithcstring_encoding, "hello, firefox!", nsutf8stringencoding); [nsstring initwithcstring:encoding:] is defined as: - (instancetype)initwithcstring:(const char *)nullterminatedcstring encoding:(nsstringencoding)encoding and nsstringencoding is defined as: typedef unsigned long ns
uinteger; typedef ns
uinteger nsstringencoding; so, our function call can be converted into the following js-ctypes code: let text = objc_msgsend(tmp2, initwithcstring_encoding, ctypes.char.array()("hello, firefox!"), ctypes.unsigned_long(nsutf8stringencoding)); converted js-ctypes code finally, we have our converted code.
...while (objc_msgsend_bool(synth, isspeaking)) {} let release = sel_registername("release"); objc_msgsend(synth, release); objc_msgsend(text, release); lib.close(); creating objective-c blocks objective-c api calls sometimes req
uire you to pass in a block.
Initialization and Destruction - Plugins
nperror npp_new(npmimetype plugintype, npp instance,
uint16 mode, int16 argc, char *argn[], char *argv[], npsaveddata *saved); the plugintype parameter represents the mime type of this instance of the plug-in.
...the browser calls npp_destroy when a plug-in instance is deleted, usually because the user has left the page containing the instance, closed the window, or q
uit the application.
...r* mydata = "here is some saved data.\n"; int32 mylength = strlen(mydata) + 1; *save = (npsaveddata*) npn_memalloc(sizeof(npsaveddata)); (*save)->len = mylength; (*save)->buf = (void*) npn_memalloc(mylength); strcpy((*save)->buf, mydata); if you allocate saved instance data in npp_destroy, be sure to allocate memory with this function, since the browser can delete the saved data with the eq
uivalent of npn_memalloc at any time.
Memory - Plugins
npn_memflush requests the browser to free up a specified amount of memory if not enough is currently available for the plug-in's req
uirements.
... the npn_memalloc method has the following syntax: void *npn_memalloc (
uint32 size); the size parameter is an unsigned long integer that represents the amount of memory, in bytes, to allocate in the browser's memory space.
...
uint32 npn_memflush (
uint32 size); the size parameter is an unsigned long integer that represents the amount of memory, in bytes, to free in the browser's memory space.
Structures - Plugins
structure summary npanycallbackstruct contains information req
uired during embedded mode printing.
... np_port contains information req
uired by the window field of an npwindow structure.
... npprintcallbackstruct contains information req
uired by the platformprint field of the npembedprint during embedded mode printing.
Introduction to DOM Inspector - Firefox Developer Tools
inspecting arbitrary urls you may also inspect the dom of arbitrary urls by using the inspect a url men
uitem in the file menu, or by just entering a url into the dom inspector's address bar and clicking inspect or pressing enter.
...(note that there are bugs which prevent the flasher from dom inspector apis from working correctly on certain platforms.) if you inspect the main browser window, for example, and select nodes in the dom nodes viewer (other than the elements which have no visible
ui as is the case with the endless list of script elements that are loaded into browser.xul), you will see the various parts of the browser interface being highlighted with a blinking red border.
...the javascript object viewer also allows javascript to be evaluated by selecting the appropriate men
uitem in the context menu.
Debugger-API - Firefox Developer Tools
both firefox’s b
uilt-in developer tools and the firebug add-on use debugger to implement their javascript debuggers.
... however, debugger is q
uite general, and can be used to implement other kinds of tools like tracers, coverage analysis, patch-and-continue, and so on.
...(firefox’s b
uiltin tools have a protocol defined for this purpose.) in gecko, the debugger api is available to chrome code only.
Edit Shape Paths in CSS - Firefox Developer Tools
this g
uide walks you through all of the available options.
... activate / deactivate the shape path editor the shape path editor is accessed via the css rules panel, which can be opened as described in the g
uide to opening the inspector.
...to understand the margin box, and other boxes used by css shapes see our g
uide to shapes from box values.
Examine and edit HTML - Firefox Developer Tools
html tree the rest of the pane shows you the page's html as a tree (this
ui is also called the markup view).
...this is eq
uivalent to holding the alt key and clicking the disclosure triangle next to an element.
...this is eq
uivalent to clicking the disclosure arrow next to an element that's expanded.
Validators - Firefox Developer Tools
firefox extensions for validation q
uick reference sidebar tabs install devedge toolbox sidebars for q
uick access to web development references.
... applications and services devedge web tune-up wizard this interface to w3c services g
uides beginning-to-intermediate web authors through the process of updating content to support netscape 7.x, mozilla and other browsers that support w3c standards.
...(some authoring software, such as html-kit, b
uilds in html tidy which makes validation q
uick and easy.) html validator pro this is an automated html5 checker using the same validator as the w3c.
about:debugging - Firefox Developer Tools
the major advantages of this method, compared with installing an add-on from an xpi, are: you don't have to reb
uild an xpi and reinstall when you change the add-on's code; you can load an add-on without signing it and without needing to disable signing.
... internal u
uid the internal u
uid assigned to the extension.
...for each one, you see something like the following: the inspect button, and the extension id and internal u
uid fields are the same as for temporary extensions.
AddressErrors - Web APIs
try to avoid asking the user to make corrections to things they can't change, and there may be situations in which you need to allow validation errors to be accepted anyway (for example, if you validate addresses against a postal service database and a new home has been b
uilt and its address is not yet in the database).
... request.show().then(function(instrumentresponse) { // do something with the response from the
ui.
... after that, we set up the handler for the shippingaddresschange event so we can validate address information and call the request's show() method to start running the payment
ui.
AnalyserNode.getByteTimeDomainData() - Web APIs
the getbytetimedomaindata() method of the analysernode interface copies the current waveform, or time-domain, data into a
uint8array (unsigned byte array) passed into it.
... syntax const audioctx = new audiocontext(); const analyser = audioctx.createanalyser(); const dataarray = new
uint8array(analyser.fftsize); //
uint8array should be the same length as the fftsize analyser.getbytetimedomaindata(dataarray); // fill the
uint8array with data returned from getbytetimedomaindata() parameters array the
uint8array that the time domain data will be copied to.
... analyser.fftsize = 2048; const bufferlength = analyser.fftsize; const dataarray = new
uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscilloscope of the current audio source function draw() { drawvisual = requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; const slic...
BasicCardResponse.billingAddress - Web APIs
request.show().then(function(instrumentresponse) { // do something with the response from the
ui.
...or androidfirefox for androidopera for androidsafari on iossamsung internetbillingaddresschrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... webview android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BasicCardResponse.cardNumber - Web APIs
request.show().then(function(instrumentresponse) { // do something with the response from the
ui.
...me for androidfirefox for androidopera for androidsafari on iossamsung internetcardnumberchrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... webview android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BasicCardResponse.cardSecurityCode - Web APIs
request.show().then(function(instrumentresponse) { // do something with the response from the
ui.
... androidfirefox for androidopera for androidsafari on iossamsung internetcardsecuritycodechrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... webview android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BasicCardResponse.cardholderName - Web APIs
request.show().then(function(instrumentresponse) { // do something with the response from the
ui.
...or androidfirefox for androidopera for androidsafari on iossamsung internetcardholdernamechrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... webview android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BasicCardResponse.expiryMonth - Web APIs
request.show().then(function(instrumentresponse) { // do something with the response from the
ui.
...e for androidfirefox for androidopera for androidsafari on iossamsung internetexpirymonthchrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... webview android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BasicCardResponse.expiryYear - Web APIs
request.show().then(function(instrumentresponse) { // do something with the response from the
ui.
...me for androidfirefox for androidopera for androidsafari on iossamsung internetexpiryyearchrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... webview android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BluetoothRemoteGATTDescriptor - Web APIs
interface interface bluetoothremotegattdescriptor { readonly attribute bluetoothgattcharacteristic characteristic; readonly attribute u
uid u
uid; readonly attribute arraybuffer?
... bluetoothremotegattdescriptor.u
uidread only returns the u
uid of the characteristic descriptor, for example '00002902-0000-1000-8000-00805f9b34fb' for theclient characteristic configuration descriptor.
... nochrome android full support 57firefox android no support noopera android full support 44safari ios no support nosamsung internet android full support 7.0u
uid experimentalchrome full support 57notes full support 57notes notes macos only.
BluetoothRemoteGATTServer.getPrimaryService() - Web APIs
the bluetoothremotegattserver.getprimaryservice() method returns a promise to the primary bluetoothgattservice offered by the bluetooth device for a specified bluetoothserviceu
uid.
... syntax bluetoothremotegattserver.getprimaryservice(bluetoothserviceu
uid).then(function(bluetoothgattservice) { ...
... parameters bluetoothserviceu
uid a bluetooth service universally unique identifier for a specified device.
BluetoothRemoteGATTServer.getPrimaryServices() - Web APIs
the bluetoothremotegattserver.getprimaryservices() method returns a promise to a list of primary bluetoothgattservice objects offered by the bluetooth device for a specified bluetoothserviceu
uid.
... syntax bluetoothremotegattserver.getprimaryservices(bluetoothserviceu
uid).then(function(bluetoothgattservices) { ...
... parameters bluetoothserviceu
uid a bluetooth service universally unique identifier for a specified device.
BluetoothRemoteGATTServer - Web APIs
interface interface bluetoothremotegattserver { readonly attribute bluetoothdevice device; readonly attribute boolean connected; promise<bluetoothremotegattserver> connect(); void disconnect(); promise<bluetoothremotegattservice> getprimaryservice(bluetoothserviceu
uid service); promise<sequence<bluetoothremotegattservice>> getprimaryservices(optional bluetoothserviceu
uid service); }; properties bluetoothremotegattserver.connectedread only a boolean value that returns true while this script execution environment is connected to this.device.
... bluetoothremotegattserver.getprimaryservice() returns a promise to the primary bluetoothgattservice offered by the bluetooth device for a specified bluetoothserviceu
uid.
... bluetoothremotegattserver.getprimaryservices() returns a promise to a list of primary bluetoothgattservice objects offered by the bluetooth device for a specified bluetoothserviceu
uid.
CSSStyleSheet.insertRule() - Web APIs
(in older implementations, this was req
uired.
... restrictions css has some int
uitive and not-so-int
uitive restrictions affecting where rules can be inserted.
... mystyle.insertrule('#blanc { color: white }', 0); function to add a stylesheet rule /** * add a stylesheet rule to the document (it may be better practice * to dynamically change classes, so style information can be kept in * gen
uine stylesheets and avoid adding extra elements to the dom).
Cache - Web APIs
so matching a new key req
uires looking at both key and value for entries in the cache.
...this is functionally eq
uivalent to calling fetch(), then using put() to add the results to the cache.
... console.error(' error in fetch handler:', error); throw error; }); }) ); }); storing cookies in caches the fetch api req
uires set-cookie headers to be stripped before returning a response object from fetch().
Optimizing canvas - Web APIs
for example, let's say you have a game with a
ui on top, the gameplay action in the middle, and a static background on the bottom.
...the
ui would change only upon user input, the gameplay layer would change with every new frame, and the background would remain generally unchanged.
... <div id="stage"> <canvas id="
ui-layer" width="480" height="320"></canvas> <canvas id="game-layer" width="480" height="320"></canvas> <canvas id="background-layer" width="480" height="320"></canvas> </div> <style> #stage { width: 480px; height: 320px; position: relative; border: 2px solid black; } canvas { position: absolute; } #
ui-layer { z-index: 3; } #game-layer { z-index: 2; } #background-layer { z-index: 1; } </style> use plain css for large background images if you have a static background image, you can draw it onto a plain <div> element using the css background property and position it under the canvas.
ChildNode - Web APIs
domstring objects are inserted as eq
uivalent text nodes.
...domstring objects are inserted as eq
uivalent text nodes.
...domstring objects are inserted as eq
uivalent text nodes.
Content Index API - Web APIs
// our content const item = { id: 'post-1', url: '/posts/amet.html', title: 'amet consectetur adipisicing', description: 'repellat et q
uia iste possimus ducimus aliq
uid a aut eaque nostrum.', icons: [{ src: '/media/dark.png', sizes: '128x128', type: 'image/png', }], category: 'article' }; // our asynchronous function to add indexed content async function registercontent(data) { const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) { return; } ...
... // register content try { await registration.index.add(data); } catch (e) { console.log('failed to register content: ', e.message); } } retrieving items within the current index the below example shows an asynchronous function that retrieves items within the content index and iterates over each entry, b
uilding a list for the interface.
... self.addeventlistener('contentdelete', (event) => { console.log(event.id); // logs content index id, which can then be used to determine what content to delete from your cache }); the contentdelete event is only fired when the deletion happens due to interaction with the browser's b
uilt-in user interface.
Binary strings - Web APIs
this means that each code unit req
uires two bytes of memory and is able to represent 65535 different code points.
...however at least one native function req
uires binary strings as its input, btoa(): invoking it on a string that contains codepoints greater than 255 will cause a character out of range error.
... the reason that brought to use utf-16 code units as placeholders for
uint8 numbers is that as web applications become more and more powerful (adding features such as audio and video manipulation, access to raw data using websockets, and so forth) it has become clear that there are times when it would be helpful for javascript code to be able to q
uickly and easily manipulate raw binary data.
Document.requestStorageAccess() - Web APIs
assuming all of the req
uirements above are satisfied, firefox will automatically grant storage access to the requesting origin on up to a threshold number of first-party origins in the current session for the duration of user’s session, up to a maximum of 24 hours.
... when the promise gets resolved, the resolve handler will run as if a user gesture is being processed, whether the promise was fulfilled or rejected: in the former case, code can then start to call apis that req
uire user activation and things can move forward.
... in the latter case, code can run to inform the user of why the request failed and what they can do to continue (for example asking them to log in, if that is a req
uirement).
Element.clientLeft - Web APIs
ut enim ad minim veniam, q
uis nostrud exercitation ullamco laboris nisi ut aliq
uip ex ea commodo consequat.
... d
uis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
... excepteur sint occaecat cupidatat non proident, sunt in culpa q
ui officia deserunt mollit anim id est laborum.
Element.clientTop - Web APIs
ut enim ad minim veniam, q
uis nostrud exercitation ullamco laboris nisi ut aliq
uip ex ea commodo consequat.
... d
uis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
... excepteur sint occaecat cupidatat non proident, sunt in culpa q
ui officia deserunt mollit anim id est laborum.
Element.scrollTop - Web APIs
ut enim ad minim veniam, q
uis nostrud exercitation ullamco laboris nisi ut aliq
uip ex ea commodo consequat.
... if you can see this, scrolltop is > 0 d
uis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
... excepteur sint occaecat cupidatat non proident, sunt in culpa q
ui officia deserunt mollit anim id est laborum.
FileError - Web APIs
in fact, many of the powerful storage apis (such as file system, blobb
uilder, and filereader) throw errors if you run the app locally from file://.
... not_found_err 1 a req
uired file or directory could not be found at the time an operation was processed.
... not_readable_err 4 the file or directory cannot be read, typically due to permission problems that occur after a reference to a file has been acq
uired (for example, the file or directory is concurrently locked by another application).
FileException - Web APIs
not_found_err 1 a req
uired file or directory could not be found at the time an operation was processed.
... not_readable_err 4 the file or directory cannot be read, typically due to permission problems that occur after a reference to a file has been acq
uired (for example, the file or directory is concurrently locked by another application).
...not for use in new websites.req
uires a vendor prefix or different name for use.req
uires a vendor prefix or different name for use.
GeolocationPositionError.code - Web APIs
the following values are possible: value associated constant description 1 permission_denied the acq
uisition of the geolocation information failed because the page didn't have the permission to do it.
... 2 position_unavailable the acq
uisition of the geolocation failed because one or several internal sources of position returned an internal error.
... 3 timeout the time allowed to acq
uire the geolocation, defined by positionoptions.timeout information that was reached before the information was obtained.
GeolocationPositionError - Web APIs
the following values are possible: value associated constant description 1 permission_denied the acq
uisition of the geolocation information failed because the page didn't have the permission to do it.
... 2 position_unavailable the acq
uisition of the geolocation failed because at least one internal source of position returned an internal error.
... 3 timeout the time allowed to acq
uire the geolocation, defined by positionoptions.timeout information was reached before the information was obtained.
GestureEvent - Web APIs
gestureevent derives from
uievent, which in turn derives from event.
... properties this interface also inherits properties of its parents,
uievent and event.
...initial value: 1.0 methods this interface also inherits methods of its parents,
uievent and event.
HTMLCanvasElement.getContext() - Web APIs
these implementations have either not reached test s
uite conformance, or the graphics drivers on the platform are not yet stable.
... powerpreference: a hint to the user agent indicating what configuration of gpu is s
uitable for the webgl context.
... possible values are: "default": let the user agent decide which gpu configuration is most s
uitable.
HTMLMediaElement.play() - Web APIs
this may happen, for example, if the browser req
uires the user to explicitly start media playback by clicking a "play" button.
...for example, a site should not present a user interface that assumes playback has begun automatically, but should instead update their
ui based on whether the returned promise is resolved or rejected.
... for even more in-depth information about autoplay and autoplay blocking, see our article autoplay g
uide for media and web audio apis.
The HTML DOM API - Web APIs
lement htmltablesectionelement htmltemplateelement htmltextareaelement htmltimeelement htmltitleelement htmltrackelement htmlulistelement htmlunknownelement htmlvideoelement deprecated html element interfaces htmlmarqueeelement obsolete html element interfaces htmlbasefontelement htmlfontelement htmlframeelement htmlframesetelement htmlisindexelement htmlmen
uitemelement web app and browser integration interfaces these interfaces offer access to the browser window and document that contain the html, as well as to the browser's state, available plugins (if any), and various configuration options.
... barprop navigator window deprecated web app and browser integration interfaces external obsolete web app and browser integration interfaces applicationcache plugin pluginarray form support interfaces these interfaces provide structure and functionality req
uired by the elements used to create and manage forms, including the <form> and <input> elements.
...items marked with "*" are req
uired.</p> <form action="" method="get"> <p> <label for="username" req
uired>your name:</label> <input type="text" id="username"> (*) </p> <p> <label for="email">email:</label> <input type="email" id="useremail"> </p> <input type="submit" value="send" id="sendbutton"> </form> result specifications specification status comment html living sta...
Dragging and Dropping Multiple Items - Web APIs
using 0 as the index is eq
uivalent to calling setdata().
...although not req
uired, you should always add the same formats for each item.
...types property is eq
uivalent to retrieving the list of types for the item at index 0.
IDBCursor.update() - Web APIs
note that you cannot change primary keys using cursor.update(), hence us not changing the album title; this would r
uin the integrity of the data.
... the cursor does not req
uire us to select the data based on a key; we can just grab all of it.
...support 14safari ios full support 8samsung internet android full support yeslegend full support full support partial support partial supportreq
uires a vendor prefix or different name for use.req
uires a vendor prefix or different name for use.
IDBDatabase.transaction() - Web APIs
therefore the following lines are eq
uivalent: var transaction = db.transaction(['my-store-name']); var transaction = db.transaction('my-store-name'); if you need to access all object stores in the database, you can use the property idbdatabase.objectstorenames: var transaction = db.transaction(db.objectstorenames); passing an empty array will throw an exception.
...the complete event may thus be delivered q
uicker than before, however, there exists a small chance that the entire transaction will be lost if the os crashes or there is a loss of system power before the data is flushed to disk.
...support 14safari ios full support 8samsung internet android full support 1.5legend full support full support partial support partial supportreq
uires a vendor prefix or different name for use.req
uires a vendor prefix or different name for use.
IDBTransaction - Web APIs
the complete event may thus be delivered q
uicker than before, however, there exists a small chance that the entire transaction will be lost if the os crashes or there is a loss of system power before the data is flushed to disk.
...transactions in this mode are known as "upgrade transactions." even if these constants are now deprecated, you can still use them to provide backward compatibility if req
uired (in chrome the change was made in version 21).
...d full support yeslegend full support full support partial support partial support no support no support compatibility unknown compatibility unknownreq
uires a vendor prefix or different name for use.req
uires a vendor prefix or different name for use.
Keyboard API - Web APIs
a list of valid code values is found in the writing system keys section of the
ui events keyboardevent code values spec.
...} keyboard locking richly interactive web pages, games, and remote-streaming experiences often req
uire access to special keys and keyboard shortcuts while in full-screen mode.
... “writing system keys” are defined in the writing system keys section of the
ui events keyboardevent code values spec as the physical keys that change meaning based on the current locale and keyboard layout.
MSGestureEvent - Web APIs
msgestureevent derives from
uievent, which in turn derives from event.
... properties this interface also inherits properties of its parents,
uievent and event.
... methods this interface also inherits methods of its parents,
uievent and event.
MediaDeviceInfo.groupId - Web APIs
two devices have the same group identifier if they belong to the same physical device; for example, a monitor with both a b
uilt-in camera and microphone.
...this might be used to produce a user interface that gathers associated devices together for presentation purposes, or to make it easy for the user to choose to use the b
uilt-in camera and microphone on the same display at the same time.
...cegroup = maindevinfo => { let devlist = []; navigator.mediadevices.enumeratedevices() .then(devices => { devices.foreach(device => { if (device.groupid === maindevinfo.groupid) { devlist.push(device); } }); }); return devlist; }; the getdevicegroup() function takes as input the mediadeviceinfo object describing the device for which a group list is to be b
uilt.
MediaDevices.getDisplayMedia() - Web APIs
syntax var promise = navigator.mediadevices.getdisplaymedia(constraints); parameters constraints optional an optional mediastreamconstraints object specifying req
uirements for the returned mediastream.
... since getdisplaymedia() req
uires a video track, the returned stream will have one even if no video track is expressly requested by the constraints object.
...for that reason, the specification details measures browsers are req
uired to take in order to fully support getdisplaymedia().
MediaStreamConstraints.audio - Web APIs
mediatrackconstraints a constraints dictionary detailing the preferable and/or req
uired values or ranges of values for the track's constrainable properties.
... if you specify constraints, an audio track meeting the constraints is req
uired.
...this tells getusermedia() that we req
uire an audio track, but we don't care about any specifics beyond that.
MediaStreamConstraints.video - Web APIs
mediatrackconstraints a constraints dictionary detailing the preferable and/or req
uired values or ranges of values for the track's constrainable properties.
... if you specify constraints, a video track meeting these constraints is req
uired.
...this tells getusermedia() that we req
uire a video track, but we don't care about any specifics beyond that.
MediaStreamTrack.applyConstraints() - Web APIs
constraints can be used to ensure that the media meets certain g
uidelines you prefer.
... for example, you may prefer high-density video but req
uire that the frame rate be a little low to help keep the data rate low enough not overtax the network.
...the object may contain an advanced property containing an array of additional mediatrackconstrants objects, which are treated as exact req
uires.
MediaStreamTrack.getConstraints() - Web APIs
these constraints indicate values and ranges of values that the web site or application has specified are req
uired or acceptable for the included constrainable properties.
... constraints can be used to ensure that the media meets certain g
uidelines you prefer.
... for example, you may prefer high definition video but req
uire that the frame rate be a little low to help keep the data rate low enough not overtax the network.
MediaTrackSettings.sampleSize - Web APIs
other common sample sizes are 8 (for reduced bandwidth req
uirements) and 24 (for high-resolution professional audio).
... each audio channel on the track req
uires samplesize bits.
...for example, 16-bit stereo audio req
uires (16/8)*2 or 4 bytes per sample.
Using the Media Capabilities API - Web APIs
the configuration req
uires the type of media being tested — e.g.
...mber of channels and sample rate, leaving out the properties that apply only to video—namely, the dimensions and the frame rate: const audioconfiguration = { type: "file", audio: { contenttype: "audio/ogg", channels: 2, bitrate: 132700, samplerate: 5200 } }; had we been testing encoding capabilities, we would have created a mediaencodingconfiguration, which req
uires the type of media being tested — either record (for recording media, i.e.
...there are a few reasons why an error might occur, including: the specified type isn't one of the two permtited values: file or media-source the contenttype given is the error can be due to the type not being one of the two possible values, the contenttype not being a valid codec mime type, or invalid or omitted definitions req
uired in the videoconfiguration.
Media Session API - Web APIs
media session concepts and usage the mediametadata interface lets a web site provide rich metadata to the platform
ui for media that is playing.
...for example, to set the current state of the media session to playing: navigator.mediasession.playbackstate = "playing"; interfaces mediametadata allows a web page to provide rich media metadata, for display in a platform
ui.
...*/ }); } some user agents disable autoplay for media elements on mobile devices and req
uire a user gesture to start media.
Navigator.registerProtocolHandler() - Web APIs
note: the title has been removed from the spec due to spoofing concerns, but all current browsers still req
uire it.
... the browser req
uires that this function is called from a secure context.
... the browser req
uires that the handler's url be over https.
OES_standard_derivatives - Web APIs
in webgl 2, the constant is available as gl.fragment_shader_derivative_hint and it req
uires glsl #version 300 es.
... ext.fragment_shader_derivative_hint_oes a glenum indicating the accuracy of the derivative calculation for the glsl b
uilt-in functions: dfdx, dfdy, and fwidth.
... glsl b
uilt-in functions the following new functions can be used in glsl shader code, if this extension is enabled: gentype dfdx(gentype) gentype dfdy(gentype) gentype fwidth(gentype) examples enabling the extensions: gl.getextension('oes_standard_derivatives'); gl.getextension('ext_shader_texture_lod'); shader code that avoids artifacts when wrapping texture coordinates: <script type="x-shader/x-fragment"> #extension gl_ext_shader_texture_lod : enable #extension gl_oes_standard_derivatives : enable uniform sampler2d mytexture; varying vec2 texcoord; void main(){ gl_fragcolor = texture2dgradext(mytexture, mod(texcoord, vec2(0.1, 0.5)), dfdx(texcoord), dfdy(texcoord)); } </script> specifications specification status comment ...
OfflineAudioContext.OfflineAudioContext() - Web APIs
all user agents are req
uired to support a range of 22050hz to 96000hz, and may support a wider range than that.
... it is important to note that, whereas you can create a new audiocontext using the new audiocontext() constructor with no arguments, the offlineaudiocontext() constructor req
uires three arguments, since it needs to create an audiobuffer.
...for more detail, read audio buffers: frames, samples and channels from our basic concepts g
uide.
PaymentRequest.canMakePayment() - Web APIs
parameters none examples in the following example, is excerpted from a demo that asynchronously b
uilds a paymentrequest object for both apple pay and credit cards.
...ox for androidopera for androidsafari on iossamsung internetcanmakepayment()chrome full support 61edge full support 16firefox full support 55notes disabled full support 55notes disabled notes available only in nightly b
uilds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... full support 11.1webview android no support nochrome android full support 53firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly b
uilds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentRequest.prototype.id - Web APIs
if none is provided, the browser automatically sets the id value to a u
uid.
...r androidfirefox for androidopera for androidsafari on iossamsung internetidchrome full support 61edge full support 16firefox full support 55notes disabled full support 55notes disabled notes available only in nightly b
uilds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... full support 11.1webview android no support nochrome android full support 60firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly b
uilds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentRequest.show() - Web APIs
syntax paymentpromise = paymentrequest.show(detailspromise); parameters detailspromise optional an optional promise that you can provide if your architecture req
uires that the payment request's details need to be updated between instantiating the payment interface and the user beginning to interact with it.
... processspayment() { const payrequest = new paymentrequest(methoddata, details, options); payrequest.onshippingaddresschange = ev => ev.updatewith(checkaddress(payrequest)); payrequest.onshippingoptionchange = ev => ev.updatewith(checkshipping(payrequest)); payrequest.show() .then(response => validateresponse(response)) .catch(err => handleerror(err)); } this is functionally eq
uivalent to the processpayment() method using the await syntax.
...this method triggers the user agent's b
uilt-in process for retrieving payment information from the user.
Multi-touch interaction - Web APIs
<style> div { margin: 0em; padding: 2em; } #target1 { background: white; border: 1px solid black; } #target2 { background: white; border: 1px solid black; } #target3 { background: white; border: 1px solid black; } </style> global state to support multi-touch interaction, preserving a pointer's event state during various event phases is req
uired.
... function pointerup_handler(ev) { if (logevents) log(ev.type, ev); // remove this touch point from the cache and reset the target's // background and border remove_event(ev); update_background(ev); ev.target.style.border = "1px solid black"; } application
ui the application uses <div> elements for the touch areas and provides buttons to enable logging and to clear the log.
... <body onload="init();" style="touch-action:none"> <div id="target1"> tap, hold or swipe me 1</div> <div id="target2"> tap, hold or swipe me 2</div> <div id="target3"> tap, hold or swipe me 3</div> <!--
ui for logging/debugging --> <button id="log" onclick="enablelog(event);">start/stop event logging</button> <button id="clearlog" onclick="clearlog(event);">clear the log</button> <p></p> <output></output> </body> miscellaneous functions these functions support the application but aren't directly involved with the event flow.
Pinch zoom gestures - Web APIs
<style> div { margin: 0em; padding: 2em; } #target { background: white; border: 1px solid black; } </style> global state supporting a two-pointer gesture req
uires preserving a pointer's event state during various event phases.
... function pointerup_handler(ev) { log(ev.type, ev); // remove this pointer from the cache and reset the target's // background and border remove_event(ev); ev.target.style.background = "white"; ev.target.style.border = "1px solid black"; // if the number of pointers down is less than two then reset diff tracker if (evcache.length < 2) { prevdiff = -1; } } application
ui the application uses a <div> element for the touch area and provides buttons to enable logging and to clear the log.
... <body onload="init();" style="touch-action:none"> <div id="target">touch and hold with 2 pointers, then pinch in or out.<br/> the background color will change to pink if the pinch is opening (zoom in) or changes to lightblue if the pinch is closing (zoom out).</div> <!--
ui for logging/debugging --> <button id="log" onclick="enablelog(event);">start/stop event logging</button> <button id="clearlog" onclick="clearlog(event);">clear the log</button> <p></p> <output></output> </body> miscellaneous functions these functions support the application but aren't directly involved in the event flow.
Using Pointer Events - Web APIs
this g
uide demonstrates how to use pointer events and the html <canvas> element to b
uild a multi-touch enabled drawing application.
... function handlemove(evt) { var el = document.getelementsbytagname("canvas")[0]; var ctx = el.getcontext("2d"); var color = colorfortouch(evt); var idx = ongoingtouchindexbyid(evt.pointerid); log("contin
uing touch: idx = " + idx); if (idx >= 0) { ctx.beginpath(); log("ctx.moveto(" + ongoingtouches[idx].pagex + ", " + ongoingtouches[idx].pagey + ");"); ctx.moveto(ongoingtouches[idx].pagex, ongoingtouches[idx].pagey); log("ctx.lineto(" + evt.clientx + ", " + evt.clienty + ");"); ctx.lineto(evt.clientx, evt.clienty); ctx.linewidth = 4; ctx.strokestyle = color; ctx.st...
... handling canceled touches if the user's finger wanders into browser
ui, or the touch otherwise needs to be canceled, the pointercancel event is sent, and we call the handlecancel() function below.
PublicKeyCredentialCreationOptions - Web APIs
_w_sha256 = -7; const cose_alg_ecdsa_w_sha512 = -36; var createcredentialoptions = { // format of new credentials is publickey publickey: { // relying party rp: { name: "example corp", id: "login.example.com", icon: "https://login.example.com/login.ico" }, // cryptographic challenge from the server challenge: new
uint8array(26), // user user: { id: new
uint8array(16), name: "john.p.smith@example.com", displayname: "john p.
... }], // timeout after 1 minute timeout: 60000, // do not send the authenticator's origin attestation attestation: "none", extensions: { uvm: true, exts: true }, // filter out authenticators which are bound to the device authenticatorselection:{ authenticatorattachment: "cross-platform", req
uireresidentkey: true, userverification: "preferred" }, // exclude already existing credentials for the user excludecredentials: [ { type: "public-key", // the id for john.doe@example.com id : new
uint8array(26) /* this actually is given by the server */ }, { type: "public-key", ...
... // the id for john-doe@example.com id : new
uint8array(26) /* another id */ } ] } }; // create the new credential with the options above navigator.credentials.create(createcredentialoptions) .then(function (newcredentialinfo) { var attestationresponse = newcredentialinfo.response; var clientextensionsoutputs = newcredentialinfo.getclientextensionsresults(); // send the response to the relying party server // it will verify the content and integrity before // creating a new credential }).catch(function (err) { // deal with any error properly console.error(err); });; specifications specification status comment web authentication: an api for accessing public key credentials level 1the defini...
Push API - Web APIs
in comparison, chrome applies no limit, but req
uires that every push message causes a notification to be displayed.
... note: chrome versions earlier than 52 req
uire you to set up a project on google cloud messaging to send push messages, and use the associated project number and api key when sending push notifications.
... it also req
uires an app manifest, with some special parameters to use this service.
RTCDataChannel.label - Web APIs
these labels are not req
uired to be unique.
...it's entirely up to the design decisions made when b
uilding your site or app.
... example this sample creates a data channel on an rtcpeerconnection, then, some time later, sets the content of a
ui element to display the channel's name.
RTCIceCredentialType - Web APIs
values oauth the rtciceserver req
uires the use of oauth 2.0 to authenticate in order to use the ice server described.
... password the rtciceserver req
uires a username and password to authenticate prior to using the described ice server.
... token authenticating with the ice server req
uires the use of an oauth 2.0 token as defined in rfc 7635.
RTCIceServer - Web APIs
urls this req
uired property is either a single domstring or an array of domstrings, each specifying a url which can be used to connect to the server.
...the first one, stun:stun.services.mozilla.com, req
uires authentication, so the username and password are provided.
... var configuration = { iceservers: [{ urls: "stun:stun.services.mozilla.com", username: "lo
uis@mozilla.com", credential: "webrtcdemo" }, { urls: [ "stun:stun.example.com", "stun:stun-1.example.com" ] }] }; var pc = new rtcpeerconnection(configuration); once the configuration object has been created, it is passed into the rtcpeerconnection() constructor to use it as the configuration for the new peer connection.
ReadableStream.getReader() - Web APIs
while the stream is locked, no other reader can be acq
uired until this one is released.
...each chunk is read sequentially and output to the
ui, until the stream has finished being read, at which point we return out of the recursive function and print the entire stream to another part of the
ui.
... if (done) { console.log("stream complete"); para.textcontent = value; return; } // value for fetch streams is a
uint8array charsreceived += value.length; const chunk = value; let listitem = document.createelement('li'); listitem.textcontent = 'received ' + charsreceived + ' characters so far.
ReadableStreamDefaultReader.read() - Web APIs
each chunk is read sequentially and output to the
ui as an array of utf-8 bytes, until the stream has finished being read, at which point we return out of the recursive function and print the entire stream to another part of the
ui.
... if (done) { console.log("stream complete"); para.textcontent = result; return; } // value for fetch streams is a
uint8array charsreceived += value.length; const chunk = value; let listitem = document.createelement('li'); listitem.textcontent = 'received ' + charsreceived + ' characters so far.
...it deals with stream chunks not ending on line boundaries and converting from
uint8array to strings.
SVGTests - Web APIs
properties svgtests.req
uiredfeatures read only an svgstringlist corresponding to the req
uiredfeatures attribute of the given element.
... svgtests.req
uiredextensions read only an svgstringlist corresponding to the req
uiredextensions attribute of the given element.
... candidate recommendation removed req
uiredfeatures property and hasextension() method.
Sensor APIs - Web APIs
the sensor apis are a set of interfaces b
uilt to a common design that expose device sensors in a consistent way to the web platform.
...defensive programming req
uires three strategies.
... const sensor = new absoluteorientationsensor(); sensor.start(); sensor.onerror = event => { if (event.error.name === 'securityerror') console.log("no permissions to use absoluteorientationsensor."); }; the following table describes for each sensor type, the name req
uired for the permissions api, the <iframe> element's allow attribute and the feature-policy directive.
Storage Access API - Web APIs
these cookie blocking policies are known to break embedded cross-origin content that req
uires access to its first-party storage.
... as an example, federated logins often req
uire access to authentication cookies stored in first-party storage, and will req
uire the user to sign in on each site separately (or completely break) if those cookies are not available.
... note: user interaction propagates to the promise returned by both of these methods, allowing the callers to take actions that req
uire user interaction without req
uiring a second click from the user.
SubtleCrypto.deriveBits() - Web APIs
notsupported raised when trying to use an algorithm that is either unknown or isn't s
uitable for derivation, or if the algorithm requested for the derived key doesn't define a key length.
... async function derivesharedsecret(privatekey, publickey) { const sharedsecret = await window.crypto.subtle.derivebits( { name: "ecdh", namedcurve: "p-384", public: publickey }, privatekey, 128 ); const buffer = new
uint8array(sharedsecret, 0, 5); const sharedsecretvalue = document.queryselector(".ecdh .derived-bits-value"); sharedsecretvalue.classlist.add("fade-in"); sharedsecretvalue.addeventlistener("animationend", () => { sharedsecretvalue.classlist.remove("fade-in"); }); sharedsecretvalue.textcontent = `${buffer}...[${sharedsecret.bytelength} bytes total]`; } // generate 2 ecdh key pairs: on...
...*/ async function getderivedbits() { const keymaterial = await getkeymaterial(); salt = window.crypto.getrandomvalues(new
uint8array(16)); const derivedbits = await window.crypto.subtle.derivebits( { "name": "pbkdf2", salt: salt, "iterations": 100000, "hash": "sha-256" }, keymaterial, 256 ); const buffer = new
uint8array(derivedbits, 0, 5); const derivedbitsvalue = document.queryselector(".pbkdf2 .derived-bits-value"); derivedbitsvalue.classlist.add("fade-in"); deriv...
SubtleCrypto.deriveKey() - Web APIs
it's worth noting that the three key derivation algorithms you can use have q
uite different characteristics and are appropriate in q
uite different situations.
... notsupported raised when trying to use an algorithm that is either unknown or isn't s
uitable for derivation, or if the algorithm requested for the derived key doesn't define a key length.
... supported algorithms the three algorithms supported by derivekey() have q
uite different characteristics and are appropriate in different situations.
TextDecoder - Web APIs
examples representing text with typed arrays this example shows how to decode a chinese/japanese character , as represented by five different typed arrays:
uint8array, int8array,
uint16array, int16array, and int32array.
... let utf8decoder = new textdecoder(); // default 'utf-8' or 'utf8' let u8arr = new
uint8array([240, 160, 174, 183]); let i8arr = new int8array([-16, -96, -82, -73]); let u16arr = new
uint16array([41200, 47022]); let i16arr = new int16array([-24336, -18514]); let i32arr = new int32array([-1213292304]); console.log(utf8decoder.decode(u8arr)); console.log(utf8decoder.decode(i8arr)); console.log(utf8decoder.decode(u16arr)); console.log(utf8decoder.decode(i16arr)); console.log(utf8decoder.decode(i32arr)); handling non-utf8 text in this example, we decode the russian text "Привет, мир!", which means "hello, world." in our textdecoder() constructor, we specify the windows-1251 character encoding, which is appropriate for cyrillic script.
... let win1251decoder = new textdecoder('windows-1251'); let bytes = new
uint8array([207, 240, 232, 226, 229, 242, 44, 32, 236, 232, 240, 33]); console.log(win1251decoder.decode(bytes)); // Привет, мир!
Multi-touch interaction - Web APIs
the application described in this g
uide shows how to use touch events for simple single and multi-touch interactions, the basics needed to b
uild application-specific gestures.
... function end_handler(ev) { ev.preventdefault(); if (logevents) log(ev.type, ev, false); if (ev.targettouches.length == 0) { // restore background and border to original values ev.target.style.background = "white"; ev.target.style.border = "1px solid black"; } } application
ui the application uses <div> elements for the touch areas and provides buttons to enable logging and clear the log.
... <div id="target1"> tap, hold or swipe me 1</div> <div id="target2"> tap, hold or swipe me 2</div> <div id="target3"> tap, hold or swipe me 3</div> <div id="target4"> tap, hold or swipe me 4</div> <!--
ui for logging/bebugging --> <button id="log" onclick="enablelog(event);">start/stop event logging</button> <button id="clearlog" onclick="clearlog(event);">clear the log</button> <p></p> <output></output> miscellaneous functions these functions support the application but aren't directly involved with the event flow.
URLSearchParams - Web APIs
an object implementing urlsearchparams can directly be used in a for...of structure, for example the following two lines are eq
uivalent: for (const [key, value] of mysearchparams) {} for (const [key, value] of mysearchparams.entries()) {} note: this feature is available in web workers.
... urlsearchparams.tostring() returns a string containing a query string s
uitable for use in a url.
... var paramsstring1 = "http://example.com/search?query=%40"; var searchparams1 = new urlsearchparams(paramsstring1); searchparams1.has("query"); // false searchparams1.has("http://example.com/search?query"); // true searchparams1.get("query"); // null searchparams1.get("http://example.com/search?query"); // "@" (eq
uivalent to decodeuricomponent('%40')) var paramsstring2 = "?query=value"; var searchparams2 = new urlsearchparams(paramsstring2); searchparams2.has("query"); // true var url = new url("http://example.com/search?query=%40"); var searchparams3 = new urlsearchparams(url.search); searchparams3.has("query") // true specifications specification status comment urlthe defin...
WakeLockSentinel.type - Web APIs
the read-only type property of the wakelocksentinel interface returns a string representation of the currently acq
uired wakelocksentinel type.
... syntax var type = wakelocksentinel.type; value a string representation of the currently acq
uired wake lock type.
... examples this example shows an asynchronous function that acq
uires a wakelocksentinel, then logs the type to the console.
WebGL2RenderingContext.clearBuffer[fiuv]() - Web APIs
syntax void gl.clearbufferfv(buffer, drawbuffer, values, optional srcoffset); void gl.clearbufferiv(buffer, drawbuffer, values, optional srcoffset); void gl.clearbuffer
uiv(buffer, drawbuffer, values, optional srcoffset); void gl.clearbufferfi(buffer, drawbuffer, depth, stencil); parameters buffer a glenum specifying the buffer to clear.
... values an array of glint, gl
uint or glfloat values or an int32array,
uint32array or float32array specifying the values to clear to.
... examples gl.clearbufferiv(gl.color, 0, new int32array([r, g, b, a])); gl.clearbuffer
uiv(gl.color, 0, new
uint32array([r, g, b, a])); gl.clearbufferfv(gl.color, 0, new float32array([r, g, b, a])); gl.clearbufferfv(gl.color, 0, [0.0, 0.0, 0.0, 0.0]); gl.clearbufferfi(gl.depth_stencil, 0, 1.0, 0); specifications specification status comment webgl 2.0the definition of 'clearbuffer[fiuv]()' in that specification.
WebGL2RenderingContext.getQueryParameter() - Web APIs
possible values: gl.query_result: returns a gl
uint containing the query result.
... return value depends on the pname parameter, either a gl
uint or a glboolean.
... opengl es 3.0the definition of 'glgetqueryobject
uiv' in that specification.
WebGL2RenderingContext.texSubImage3D() - Web APIs
gl.r8 gl.r16f gl.r32f gl.r8
ui gl.rg8 gl.rg16f gl.rg32f gl.rg
ui gl.rgb8 gl.srgb8 gl.rgb565 gl.r11f_g11f_b10f gl.rgb9_e5 gl.rgb16f gl.rgb32f gl.rgb8
ui gl.rgba8 gl.srgb_aplha8 gl.rgb5_a1 gl.rgba4444 gl.rgba16f gl.rgba32f gl.rgba8
ui type a glenum specifying the data type of the texel data.
... gl.byte gl.unsigned_short gl.short gl.unsigned_int gl.int gl.half_float gl.float gl.unsigned_int_2_10_10_10_rev gl.unsigned_int_10f_11f_11f_rev gl.unsigned_int_5_9_9_9_rev gl.unsigned_int_24_8 gl.float_32_unsigned_int_24_8_rev (pixels must be null) pixels one of the following objects can be used as a pixel source for the texture: arraybufferview, a
uint8array must be used if type is gl.unsigned_byte.
... a
uint16array must be used if type is either gl.unsigned_short_5_6_5, gl.unsigned_short_4_4_4_4, gl.unsigned_short_5_5_5_1, or ext.half_float_oes.
WebGLActiveInfo - Web APIs
program, gl
uint index); webglactiveinfo?
...program, gl
uint index); webglactiveinfo?
...program, gl
uint index) specifications specification status comment webgl 1.0the definition of 'webglactiveinfo' in that specification.
WebGL constants - Web APIs
0x8c41 srgb8_alpha8 0x8c43 compare_ref_to_texture 0x884e rgba32f 0x8814 rgb32f 0x8815 rgba16f 0x881a rgb16f 0x881b texture_2d_array 0x8c1a texture_binding_2d_array 0x8c1d r11f_g11f_b10f 0x8c3a rgb9_e5 0x8c3d rgba32
ui 0x8d70 rgb32
ui 0x8d71 rgba16
ui 0x8d76 rgb16
ui 0x8d77 rgba8
ui 0x8d7c rgb8
ui 0x8d7d rgba32i 0x8d82 rgb32i 0x8d83 rgba16i 0x8d88 rgb16i 0x8d89 rgba8i 0x8d8e rgb8i 0x8d8f red_integer 0x8d94 ...
... rgb_integer 0x8d98 rgba_integer 0x8d99 r8 0x8229 rg8 0x822b r16f 0x822d r32f 0x822e rg16f 0x822f rg32f 0x8230 r8i 0x8231 r8
ui 0x8232 r16i 0x8233 r16
ui 0x8234 r32i 0x8235 r32
ui 0x8236 rg8i 0x8237 rg8
ui 0x8238 rg16i 0x8239 rg16
ui 0x823a rg32i 0x823b rg32
ui 0x823c r8_snorm 0x8f94 rg8_snorm 0x8f95 rgb8_snorm 0x8f96 rgba8_snorm 0x8f97 rgb10_a2
ui 0x906f texture_immutable_f...
... oes_standard_derivatives constant name value description fragment_shader_derivative_hint_oes 0x8b8b indicates the accuracy of the derivative calculation for the glsl b
uilt-in functions: dfdx, dfdy, and fwidth.
Adding 2D content to a WebGL context - Web APIs
a simple thing we can do is draw a simple square untextured plane, so let's start there, by b
uilding code to draw a square plane.
... let's take a q
uick look at the two types of shader, with the example in mind of drawing a 2d shape into the webgl context.
... const positions = [ -1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0, ]; // now pass the list of positions into webgl to b
uild the // shape.
Lighting in WebGL - Web APIs
« previousnext » as should be clear by now, webgl doesn't have much b
uilt-in knowledge.
... b
uilding the normals for the vertices the first thing we need to do is generate the array of normals for all the vertices that comprise our cube.
...alse; const stride = 0; const offset = 0; gl.bindbuffer(gl.array_buffer, buffers.normal); gl.vertexattribpointer( programinfo.attriblocations.vertexnormal, numcomponents, type, normalize, stride, offset); gl.enablevertexattribarray( programinfo.attriblocations.vertexnormal); } finally, we need to update the code that b
uilds the uniform matrices to generate and deliver to the shader a normal matrix, which is used to transform the normals when dealing with the current orientation of the cube in relation to the light source: const normalmatrix = mat4.create(); mat4.invert(normalmatrix, modelviewmatrix); mat4.transpose(normalmatrix, normalmatrix); ...
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
however you make the determination, once these roles are assigned to the two peers, they can then work together to manage signaling in a way that doesn't deadlock and doesn't req
uire a lot of extra code to manage.
... since there isn't a single "roll back and use this offer instead", performing this change on the polite peer req
uires two steps, executed in the context of promise.all(), which is used to ensure that both statements execute completely before contin
uing to handle the received offer.
...sending the restart request thus req
uired directly invoking the negotiationneeded event's handler.
Using WebRTC data channels - Web APIs
in this g
uide, we'll examine how to add a data channel to a peer connection, which can then be used to securely exchange arbitrary data; that is, any kind of data we wish, in any format we choose.
... since all webrtc components are req
uired to use encryption, any data transmitted on an rtcdatachannel is automatically secured using datagram transport layer security (dtls).
...this feature req
uires that each piece of the message have consecutive sequence numbers, so they have to be transmitted one after another, without any other data interleaved between them.
WebSocket.send() - Web APIs
the string is added to the buffer in utf-8 format, and the value of bufferedamount is increased by the number of bytes req
uired to represent the utf-8 string.
... arraybuffer you can send the underlying binary data used by a typed array object; its binary data contents are queued in the buffer, increasing the value of bufferedamount by the req
uisite number of bytes.
... arraybufferview you can send any javascript typed array object as a binary frame; its binary data contents are queued in the buffer, increasing the value of bufferedamount by the req
uisite number of bytes.
Using the Web Animations API - Web APIs
for b
uilding custom animation libraries and creating interactive animations, the web animations api might be the perfect tool for the job.
... representing timing properties we’ll also need to create an object of timing properties (an animationeffecttimingproperties object) corresponding to the values in alice’s animation: var alicetiming = { duration: 3000, iterations: infinity } you’ll notice a few differences here from how eq
uivalent values are represented in css: for one, the duration is in milliseconds as opposed to seconds — 3000 not 3s.
... and we can do the same thing when setting the cake and bottle durations: var drinking = document.getelementbyid('liq
uid').animate( [ { height: '100%' }, { height: '0' } ], { fill: 'forwards', duration: alicechange.effect.getcomputedtiming().duration / 2 }); drinking.pause(); now all three animations are linked to just one duration, which we can change easily from one place.
Web Animations API Concepts - Web APIs
it can be used in automated tests to ensure that your
ui animations are running correctly.
... it opens up the browser’s rendering engine for b
uilding animation development tools like timelines.
... it is also a performant base on which to b
uild a custom or commercial animation library.
Basic concepts behind Web Audio API - Web APIs
via the nyq
uist–shannon sampling theorem, the sampling frequency must be greater than twice the maximum frequency one wishes to reproduce.
... analysernode.getbytefrequencydata() copies the current frequency data into a
uint8array (unsigned byte array) passed into it.
... analysernode.getbytetimedomaindata() copies the current waveform, or time-domain, data into a
uint8array (unsigned byte array) passed into it.
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
examples the following example shows the creation of a writablestream with a custom sink and an api-supplied que
uing strategy.
... defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const que
uingstrategy = new countque
uingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new
uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = docume...
...nt.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, que
uingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
WritableStreamDefaultWriter.close() - Web APIs
examples the following example shows the creation of a writablestream with a custom sink and an api-supplied que
uing strategy.
... defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const que
uingstrategy = new countque
uingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new
uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = docume...
...nt.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, que
uingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
WritableStreamDefaultWriter.write() - Web APIs
examples the following example shows the creation of a writablestream with a custom sink and an api-supplied que
uing strategy.
... defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const que
uingstrategy = new countque
uingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new
uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = docume...
...nt.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, que
uingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
XRInputSourceArray.length - Web APIs
examples in this example, a game that req
uires at least one input source uses length to check this before proceeding to allow the user to play the game.
... let sources = xrsession.inputsources; if (sources.length === 0) { showalertdialog("you need to have at least one controller to play super duper shark jump fest 9000.", [ { label: "shop now", url: "https://www.amazon.com/s?k=vr+controllers" }, { label: "q
uit" handler: q
uitgame } ]); } here, if length is 0, a hypothetical showalertdialog() function is called with a prompt string explaining the need for a controller, and an array of objects, each describing a button and what should happen when it's clicked.
... the first takes the user to an amazon.com search for vr controllers, and the second calls a q
uitgame() function to start shutting the game program down.
ARIA: application role - Accessibility
the ats b
uild their own representation of it that makes the most sense for a blind user to consume the content.
... in addition, a set of so-called q
uick navigation keys has been established over the years that allows blind users to skim through a page via a certain element type.
... req
uired javascript features keypress used to handle keyboard input and control the focus click, touch handle as appropriate for your widget as well changing attribute values aria-activedescendant is used to manage the focus inside the application container.
ARIA: Complementary role - Accessibility
landmarks can be used by assistive technology to q
uickly identify and navigate to large sections of the document.
...this label will allow an assistive technology user to be able to q
uickly understand the purpose of each landmark.
... added benefits certain technologies such as browser extensions can generate lists of all landmark roles present on a page, allowing non-screen reader users to also q
uickly identify and navigate to large sections of the document.
ARIA: contentinfo role - Accessibility
landmarks can be used by assistive technology to q
uickly identify and navigate to large sections of the document.
...this label will allow assitive technology users to q
uickly understand the purpose of each landmark.
... added benefits certain technologies such as browser extensions can generate lists of all landmark roles present on a page, allowing non-screen reader users to also q
uickly identify and navigate to large sections of the document.
ARIA: gridcell role - Accessibility
<div role="row"> <div role="gridcell">jane</div> <div role="gridcell">smith</div> <div role="gridcell">496-619-5098</div> … </div> the first rule of aria is if a native html element or attribute has the semantics and behavior you req
uire, use it instead of re-purposing an element and adding aria.
... row req
uired to communicate the gridcell is part of a row of a table-style grouping of information.
... best practices the first rule of aria is: if a native html element or attribute has the semantics and behavior you req
uire, use it instead of re-purposing an element and adding an aria role, state or property to make it accessible.
ARIA: Main role - Accessibility
landmarks can be used by assistive technology to q
uickly identify and navigate to large sections of the document.
... skip navigation skip navigation, also known as "skipnav", is a technique that allows an assistive technology user to q
uickly bypass large sections of repeated content (main navigation, info banners, etc.).
... <body> <a href="#main-content">skip to main content</a> <!-- navigation and header content --> <div id="main-content" role="main"> <!-- main page content --> </div> </body> webaim: "skip navigation" links added benefits certain technologies such as browser extensions can generate lists of all landmark roles present on a page, allowing non-screen reader users to also q
uickly identify and navigate to large sections of the document.
ARIA: Navigation Role - Accessibility
req
uired javascript features none.
...this label will allow an assitive technology user to be able to q
uickly understand the purpose of each landmark.
... added benefits certain technologies such as browser extensions can generate lists of all landmark roles present on a page, allowing non-screen reader users to also q
uickly identify and navigate to large sections of the document.
ARIA: Region role - Accessibility
req
uired javascript features none.
...this label will allow an assitive technology user to be able to q
uickly understand the purpose of each landmark.
... added benefits certain technologies such as browser extensions can generate lists of all landmark roles present on a page, allowing non-screen reader users to also q
uickly identify and navigate to large sections of the document.
ARIA: rowgroup role - Accessibility
</div> </div> <div role="rowgroup"> <div role="row"> <span role="cell">finland</span> <span role="cell">5.5 million</span> </div> <div role="row"> <span role="cell">france</span> <span role="cell">67 million</span> </div> </div> </div> description rowgroup establishes a relationship between owned row elements and is a structural eq
uivalent to the thead, tfoot and tbody elements in html.
... keyboard interactions none req
uired javascript features none.
... the first rule of aria use is if you can use a native feature with the semantics and behavior you req
uire already b
uilt in, instead of re-purposing an element and adding an aria role, state or property to make it accessible, then do so.
ARIA: search role - Accessibility
landmarks can be used by assistive technology to q
uickly identify and navigate to large sections of the document.
...this label will allow an assitive technology user to be able to q
uickly understand the purpose of each landmark.
... added benefits certain technologies such as browser extensions can generate lists of all landmark roles present on a page, allowing non-screen reader users to also q
uickly identify and navigate to large sections of the document.
ARIA: button role - Accessibility
req
uired javascript features req
uired event handlers buttons can be operated by mouse, touch, and keyboard users.
...because a <span> element is used, the tabindex attribute is req
uired to make the button focusable and part of the page's tab order.
... where possible, it is recommended to use native html buttons (<button>, <input type="button">, <input type="submit">, <input type="reset"> and <input type="image">) rather than the button role, as native html buttons are supported by all user agents and assistive technology and provide keyboard and focus req
uirements by default, without need for additional customization.
ARIA: heading role - Accessibility
keyboard interactions this role does not req
uire any special keyboard navigation.
... req
uired javascript features req
uired event handlers none.
... changing attribute values usually not req
uired, unless dynamically inserting content.
Color contrast - Accessibility
when designing readable interfaces for different vision capabilities, the wcag g
uidelines recommend the following contrast ratios: type of content minimum ratio (aa rating) enhanced ratio (aaa rating) body text 4.5 : 1 7 : 1 large-scale text (120-150% larger than body text) 3 : 1 4.5 : 1 active user interface components and graphical objects such as icons and graphs 3 : 1 not defined these ratios do not apply to "incidental" text, such as inactive controls, logotypes, or purely decorative text.
... you can also check color contrast on the fly using firefox's developer tools — see our accessibility inspector g
uide, and in particular the section check for accessibility issues.
... 1.4.6 enhanced contrast (aaa) this follows, and b
uilds on, criterion 1.4.3.
::first-letter (:first-letter) - CSS: Cascading Style Sheets
css3 introduced the ::first-letter notation (with two colons) to disting
uish pseudo-classes from pseudo-elements.
...stet clita kasd gubergren, no sea takimata sanctus est.</p> <p>d
uis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat.</p> css p { width: 500px; line-height: 1.5; } h2 + p::first-letter { color: white; background-color: black; border-radius: 2px; box-shadow: 3px 3px 0 red; font-size: 250%; padding: 6px 3px; margin-right: 6px; float: left; } result effect on special punctuation and non-latin characters ...
... html <p>d
uis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat.</p> <p>-the beginning of a special punctuation mark.</p> <p>_the beginning of a special punctuation mark.</p> <p>"the beginning of a special punctuation mark.</p> <p>'the beginning of a special punctuation mark.</p> <p>*the beginning of a special punctuation mark.</p> <p>#the beginning of a special punctuation mark.</p> <p>「特殊的汉字标点符号开头。</p> <p>《特殊的汉字标点符号开头。</p> <p>“特殊的汉字标点符号开头。</p> css p::first-letter { color: red; font-size: 150%; } result specifications specification status comment ...
::selection - CSS: Cascading Style Sheets
te; background-color: blue; } /* make selected text gold on a red background */ ::selection { color: gold; background-color: red; } /* make selected text in a paragraph white on a blue background */ p::selection { color: white; background-color: blue; } result accessibility concerns don't override selected text styles for purely aesthetic reasons — users can customize them to s
uit their needs.
...to meet current web content accessibility g
uidelines (wcag), text content must have a contrast ratio of 4.5:1, or 3:1 for larger text such as headings.
... (wcag defines large text as between 18.66px and 24px and bold, or 24px or larger.) webaim: color contrast checker mdn understanding wcag, g
uideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 specifications specification status comment css pseudo-elements level 4the definition of '::selection' in that specification.
:invalid - CSS: Cascading Style Sheets
html <form> <div class="field"> <label for="url_input">enter a url:</label> <input type="url" id="url_input"> </div> <div class="field"> <label for="email_input">enter an email address:</label> <input type="email" id="email_input" req
uired> </div> </form> css label { display: block; margin: 1px; padding: 1px; } .field { margin: 1px; padding: 1px; } input:invalid { background-color: #ffdddd; } form:invalid { border: 5px solid #ffdddd; } input:valid { background-color: #ddffdd; } form:valid { border: 5px solid #ddffdd; } input:req
uired { border-color: #800000; border-width: 3px; } input:req
uired:in...
... mdn understanding wcag, g
uideline 1.4 explanations understanding success criterion 1.4.1 | w3c understanding wcag 2.0 notes radio buttons if any one of the radio buttons in a group is req
uired, the :invalid pseudo-class is applied to all of them if none of the buttons in the group is selected.
...however, it does apply a style (a red "glow" using the box-shadow property) to the :-moz-
ui-invalid pseudo-class, which applies in a subset of cases for :invalid.
size - CSS: Cascading Style Sheets
letter this keyword is a eq
uivalent to the dimensions of letter paper in north america i.e.
... legal this keyword is a eq
uivalent to the dimensions of legal papers in north america i.e.
... ledger this keyword is a eq
uivalent to the dimensions of ledger pages in north america i.e.
@supports - CSS: Cascading Style Sheets
to combine it with other operators, like and and or, the parentheses are req
uired.
...the following are both eq
uivalent: @supports (display: table-cell) and (display: list-item) and (display:run-in) {} @supports (display: table-cell) and ((display: list-item) and (display:run-in)) {} the or operator the or operator creates a new expression from the disjunction of two shorter expressions.
...the following are both eq
uivalent: @supports (transform-style: preserve) or (-moz-transform-style: preserve) or (-o-transform-style: preserve) or (-webkit-transform-style: preserve) {} @supports (transform-style: preserve-3d) or ((-moz-transform-style: preserve-3d) or ((-o-transform-style: preserve-3d) or (-webkit-transform-style: preserve-3d))) {} note: when using both and and or operators, the parentheses must be used to define the order in which the...
Alternative style sheets - CSS: Cascading Style Sheets
chrome req
uires an extension to use the feature (as of version 48).
... living standard html living standardthe definition of 'meta http-eq
uiv="default-style")' in that specification.
... it defines how these are determined, and lets the html specification define the html-specific behaviors by req
uiring it to define when to create a css style sheet.
Basic Concepts of Multicol - CSS: Cascading Style Sheets
this g
uide explains how the specification works with some common use case examples.
... .container { columns: 2 200px; } next steps in this g
uide we've learned the basic use of multiple-column layout.
... in the next g
uide, we will look at how much we can style the columns themselves.
Spanning and Balancing Columns - CSS: Cascading Style Sheets
in this g
uide we look at how to make elements span across columns inside the multicol container and how to control how the columns are filled.
... note the spanning and balancing functionality covered in this g
uide is not as well supported across browsers as the functionality covered in the previous two sections in this g
uide.
... in the next g
uide you will learn how multicol handles overflow, both within columns and where there are more columns than will fit the container.
Using feature queries - CSS: Cascading Style Sheets
in this g
uide you will learn how to implement progressive enhancement using feature queries.
...you may not test for a bare property name such as display; the rule req
uires a property name and a value: @supports (property: value) { css rules to apply } if you want to check if a browser supports the row-gap property, for example, you would write the following feature query.
...to do so, you can include a list of features to test for, separated by and keywords: @supports (property1: value) and (property2: value) { css rules to apply } for example, if the css you want to run req
uires that the browser supports css shapes and css grid, you could create a rule which checks for both of these things.
Ordering Flex Items - CSS: Cascading Style Sheets
the specification continues with a warning not to use reordering to fix issues in your source: “authors must not use order or the *-reverse values of flex-flow/flex-direction as a substitute for correct source ordering, as that can r
uin the accessibility of the document.” note: for some years firefox had a bug whereby it would attempt to follow the visual order and not the source order, making it behave differently to other browsers.
... you can also use negative values with order, which can be q
uite useful.
...you will q
uickly see if your development choices make getting around the content difficult.
In Flow and Out of Flow - CSS: Cascading Style Sheets
in the previous g
uide i explained block and inline layout in normal flow.
... summary in this g
uide we have covered the ways to take an element out of flow in order to achieve some very specific types of positioning.
... in the next g
uide we will look at a related issue, that of creating a block formatting context, in formatting contexts explained.
Basic Shapes - CSS: Cascading Style Sheets
css shapes can be defined using the <basic-shape> type, and in this g
uide i’ll explain how each of the different values accepted by this type work.
...you have already met the reference box in the g
uide on creating shapes from box values, which directly uses the reference box to create the shape.
... the keyword values of closest-side and farthest-side are useful to create a q
uick ellipse based on the size of the floated element reference box.
Using CSS transitions - CSS: Cascading Style Sheets
linearly or q
uick at the beginning, slow at the end).
...some user agents, like those based on gecko, implement this req
uirement and others, like those based on webkit, are less strict.
... first, we set up the menu using html: <nav> <a href="#">home</a> <a href="#">about</a> <a href="#">contact us</a> <a href="#">links</a> </nav> then we b
uild the css to implement the look and feel of our menu.
animation - CSS: Cascading Style Sheets
the order within each animation definition is also important for disting
uishing animation-name values from other keywords.
...furthermore, when serialized, default values of other properties must be output in at least the cases necessary to disting
uish an animation-name that could be a value of another property, and may be output in additional cases.
... designing safer web animation for motion sensitivity · an a list apart article an introduction to the reduced motion media query | css-tricks responsive design for motion | webkit mdn understanding wcag, g
uideline 2.2 explanations understanding success criterion 2.2.2 | w3c understanding wcag 2.0 formal definition initial valueas each of the properties of the shorthand:animation-name: noneanimation-duration: 0sanimation-timing-function: easeanimation-delay: 0sanimation-iteration-count: 1animation-direction: normalanimation-fill-mode: noneanimation-play-state: runningapplies toall elements, ::befo...
<blend-mode> - CSS: Cascading Style Sheets
this blend mode is eq
uivalent to hard-light but with the layers swapped.
... this blend mode is eq
uivalent to overlay but with the layers swapped.
... this blend mode is eq
uivalent to color, but with the layers swapped.
<color> - CSS: Cascading Style Sheets
for example, #ff0000 is eq
uivalent to #ff0000ff.
... many designers find hsl more int
uitive than rgb, since it allows hue, saturation, and lightness to each be adjusted independently.
... accessibility considerations some people have difficulty disting
uishing colors.
cursor - CSS: Cascading Style Sheets
e.g., eq
uivalent to text when hovering text.
... in some environments, an eq
uivalent bidirectional resize cursor is shown.
... | alias | copy | move | no-drop | not-allowed | e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out | grab | grabbing ] ] examples setting cursor types .foo { cursor: crosshair; } .bar { cursor: zoom-in; } /* a fallback keyword value is req
uired when using a url */ .baz { cursor: url("hyper.cur"), auto; } specifications specification status comment css basic user interface module level 3the definition of 'cursor' in that specification.
<custom-ident> - CSS: Cascading Style Sheets
it is case-sensitive, and certain values are forbidden in various contexts to prevent ambig
uity.
... to prevent ambig
uity, each property that uses <custom-ident> forbids the use of specific values: animation-name forbids the global css values (unset, initial, and inherit), as well as none.
...also, q
uite a few predefined values are implemented by the different browsers: disc, circle, square, decimal, cjk-decimal, decimal-leading-zero, lower-roman, upper-roman, lower-greek, lower-alpha, lower-latin, upper-alpha, upper-latin, arabic-indic, armenian, bengali, cambodian, cjk-earthly-branch, cjk-heavenly-stem, cjk-ideographic, devanagari, ethiopic-numeric, georgian, gujarati, gurmukhi, hebrew, hiragana, hiragana-iroha, japanese-formal, japanese-informal, kannada, katakana, katakana-iroha, khmer, korean-hangul-formal, korean-hanja-f...
flex - CSS: Cascading Style Sheets
this is eq
uivalent to setting "flex: 0 1 auto".
...this is eq
uivalent to setting "flex: 1 1 auto".
...this is eq
uivalent to setting "flex: 0 0 auto".
justify-items - CSS: Cascading Style Sheets
reas on the inline axis (more about alignment in grid layouts) syntax /* basic keywords */ justify-items: auto; justify-items: normal; justify-items: stretch; /* positional alignment */ justify-items: center; /* pack items around the center */ justify-items: start; /* pack items from the start */ justify-items: end; /* pack items from the end */ justify-items: flex-start; /* eq
uivalent to 'start'.
...*/ justify-items: flex-end; /* eq
uivalent to 'end'.
... stretch if the combined size of the items is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or eq
uivalent functionality), so that the combined size exactly fills the alignment container.
justify-self - CSS: Cascading Style Sheets
its grid area on the inline axis (more about alignment in grid layouts) syntax /* basic keywords */ justify-self: auto; justify-self: normal; justify-self: stretch; /* positional alignment */ justify-self: center; /* pack item around the center */ justify-self: start; /* pack item from the start */ justify-self: end; /* pack item from the end */ justify-self: flex-start; /* eq
uivalent to 'start'.
...*/ justify-self: flex-end; /* eq
uivalent to 'end'.
... stretch if the combined size of the items is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or eq
uivalent functionality), so that the combined size exactly fills the alignment container.
max-width - CSS: Cascading Style Sheets
mdn understanding wcag, g
uideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 formal definition initial valuenoneapplies toall elements but non-replaced inline elements, table rows, and row groupsinheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute length or noneanimation typea length, percentage or calc(); form...
... html <div id="parent"> <div id="child"> fusce pulvinar vestibulum eros, sed luctus ex lobortis q
uis.
...expect behavior to change in the future.see implementation notes.see implementation notes.uses a non-standard name.uses a non-standard name.req
uires a vendor prefix or different name for use.req
uires a vendor prefix or different name for use.
outline-width - CSS: Cascading Style Sheets
typically eq
uivalent to 1px in desktop browsers (including firefox).
...typically eq
uivalent to 3px in desktop browsers (including firefox).
...typically eq
uivalent to 5px in desktop browsers (including firefox).
rotate - CSS: Cascading Style Sheets
eq
uivalent to a rotate() (2d rotation) function.
...eq
uivalent to a rotatex()/rotatey()/rotatez() (3d rotation) function.
...eq
uivalent to a rotate3d() (3d rotation) function.
scale - CSS: Cascading Style Sheets
eq
uivalent to a scale() (2d scaling) function with a single value specified.
...eq
uivalent to a scale() (2d scaling) function with two values specified.
...eq
uivalent to a scale3d() (3d scaling) function.
shape-image-threshold - CSS: Cascading Style Sheets
saepe optio accusamus doloribus sint facilis itaque ab nulla, dolor molestiae assumenda cum sit placeat adipisci, libero quae nihil porro debitis laboriosam inventore animi impedit nostrum nesciunt q
uisquam expedita!
... dolores consectetur iure atque a mollitia dicta repudiandae illum exercitationem aliquam repellendus ipsum porro modi, id nemo eligendi, architecto ratione q
uibusdam iusto nisi soluta?
... totam inventore ea eum sed velit et eligendi suscipit accusamus iusto dolore, at provident eius alias maxime pariatur non deleniti ipsum seq
ui rem eveniet laboriosam magni expedita?
text-transform - CSS: Cascading Style Sheets
in some cases, a hyphen is also removed upon uppercasing: an t-
uisce transforms to an t
uisce (and the hyphen is correctly reinserted by text-transform: lowercase).
... full-size-kana generally used for <ruby> annotation text, the keyword converts all small kana characters to the eq
uivalent full-size kana, to compensate for legibility issues at the small font sizes typically used in ruby.
... mdn understanding wcag, g
uideline 1.4 explanations w3c understanding wcag 2.1 formal definition initial valuenoneapplies toall elements.
text-underline-position - CSS: Cascading Style Sheets
nullam volutpat pharetra lorem, sit amet feugiat tortor volutpat q
uis.
...nullam volutpat pharetra lorem, sit amet feugiat tortor volutpat q
uis.
... in the text with a vertical writing-mode set, we can then use values of left or right to make the underline appear on the left or right of the text as req
uired.
translate - CSS: Cascading Style Sheets
eq
uivalent to a translate() (2d translation) function with a single value specified.
...eq
uivalent to a translate() (2d translation) function with two values specified.
...eq
uivalent to a translate3d() (3d translation) function.
CSS: Cascading Style Sheets
get started tutorials our css learning area features multiple modules that teach css from the ground up — no previous knowledge req
uired.
... css b
uilding blocks this module carries on where css first steps left off — now you've gained familiarity with the language and its syntax, and got some basic experience with using it, its time to dive a bit deeper.
...we have covered the necessary prereq
uisites so we can now dive deep into css layout, looking at different display settings, modern layout tools like flexbox, css grid, and positioning, and some of the legacy techniques you might still want to know about.
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
<h1>heading elements</h1> <h2>summary</h2> <p>some text here...</p> <h2>examples</h2> <h3>example 1</h3> <p>some text here...</p> <h3>example 2</h3> <p>some text here...</p> <h2>see also</h2> <p>some text here...</p> here is the result of this code: accessibility concerns navigation a common navigation technique for users of screen reading software is jumping from heading to heading to q
uickly determine the content of the page.
...most screen readers can also generate an ordered list of all the headings on a page, which can help a person q
uickly determine the hierarchy of the content: h1 beetles h2 etymology h2 distribution and diversity h2 evolution h3 late paleozoic h3 jurassic h3 cretaceous h3 cenozoic h2 external morphology h3 head h4 mouthparts h3 thorax h4 prothorax h4 pterothorax h3 legs h3...
... headings • page structure • wai web accessibility tutorials mdn understanding wcag, g
uideline 1.3 explanations understanding success criterion 1.3.1 | w3c understanding wcag 2.0 mdn understanding wcag, g
uideline 2.4 explanations understanding success criterion 2.4.1 | w3c understanding wcag 2.0 understanding success criterion 2.4.6 | w3c understanding wcag 2.0 understanding success criterion 2.4.10 | w3c understanding wcag 2.0 labeling section content another common navigation technique for users of screen reading software is to generate a list of sectioning content and use it to determine the page's layout.
<input type="button"> - HTML: Hypertext Markup Language
<input> elements of type button are rendered as simple push buttons, which can be programmed to control custom functionality anywhere on a webpage as req
uired when assigned an event handler function (typically for the click event).
... adding keyboard shortcuts to buttons keyboard shortcuts, also known as access keys and keyboard eq
uivalents, let the user trigger a button using a key or combination of keys on the keyboard.
... <div class="toolbar"> <input type="color" aria-label="select pen color"> <input type="range" min="2" max="50" value="30" aria-label="select pen size"><span class="output">30</span> <input type="button" value="clear canvas"> </div> <canvas class="mycanvas"> <p>add s
uitable fallback here.</p> </canvas> body { background: #ccc; margin: 0; overflow: hidden; } .toolbar { background: #ccc; width: 150px; height: 75px; padding: 5px; } input[type="color"], input[type="button"] { width: 90%; margin: 0 auto; display: block; } input[type="range"] { width: 70%; } span { position: relative; bottom: 5px; } var canvas = document.queryselecto...
<input type="file"> - HTML: Hypertext Markup Language
events change and input supported common attributes req
uired additional attributes accept, capture, files, multiple idl attributes files and value dom interface htmlinputelement properties properties that apply only to elements of type file methods select() value a file input's value attribute contains a domstring that represents the path to the selected file(s).
... the accept attribute doesn't validate the types of the selected files; it simply provides hints for browsers to g
uide users towards selecting the correct file types.
...there are some historical reasons for this q
uirk, but it is supported across all modern browsers, and in fact is defined in the spec.
Standard metadata names - HTML: Hypertext Markup Language
mdn understanding wcag, g
uideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 see also the @viewport css at-rule.
... other metadata names the whatwg wiki metaextensions page contains a large set of non-standard metadata names that have not been formally accepted yet; however, some of the names included there are already used q
uite commonly in practice — including the following: creator: the name of the creator of the document, such as an organization or institution.
... all all eq
uivalent to index, follow google none eq
uivalent to noindex, nofollow google noarchive requests the search engine not to cache the page content.
<select>: The HTML Select element - HTML: Hypertext Markup Language
it also accepts most of the general form input attributes such as req
uired, disabled, autofocus, etc.
... req
uired a boolean attribute indicating that an option with a non-empty string value must be selected.
...browsers are not req
uired to present a select element as a scrolled list box.
<title>: The Document Title element - HTML: Hypertext Markup Language
tag omission both opening and closing tags are req
uired.
... a few g
uidelines and tips for composing good titles: avoid one- or two-word titles.
... example <title>2 errors - your order - blue house chinese food - foodyum: online takeout today!</title> mdn understanding wcag, g
uideline 2.4 explanations understanding success criterion 2.4.2 | w3c understanding wcag 2.0 specifications specification status comment html living standardthe definition of '<title>' in that specification.
contextmenu - HTML: Hypertext Markup Language
example html <body contextmenu="share"> <menu type="context" id="share"> <menu label="share"> <men
uitem label="twitter" onclick="shareviatwitter()"></men
uitem> <men
uitem label="facebook" onclick="shareviafacebook()"></men
uitem> </menu> </menu> <ol> <li> anywhere in the example you can share the page on twitter and facebook using the share menu from your context menu.
... </li> <li contextmenu="changefont" id="fontsizing"> on this specific list element, you can change the size of the text by using the "increase/decrease font" actions from your context menu </li> <menu type="context" id="changefont"> <men
uitem label="increase font" onclick="incfont()"></men
uitem> <men
uitem label="decrease font" onclick="decfont()"></men
uitem> </menu> <li contextmenu="changeimage" id="changeimage"> on the image below, you can fire the "change image" action in your context menu.<br /> <img src="https://udn.realityripple.com/samples/a2/b601bdfc0c.png" contextmenu="changeimage" id="promobutton" /> <menu type="context" id="changeimage"> <men
uitem label="change image" onclick="changeimage()"><...
.../men
uitem> </menu> </li> </ol> </body> javascript function shareviatwitter() { window.open("https://twitter.com/intent/tweet?text=" + "hurray!
itemprop - HTML: Hypertext Markup Language
an item with two properties, "favorite-color" and "favorite-fr
uit", both set to the value "orange" <div itemscope> <span itemprop="favorite-color favorite-fr
uit">orange</span> </div> note: there is no relationship between the microdata and the content of the document where the microdata is marked up.
... note: the rules above disallow ":" characters in non-url values because otherwise they could not be disting
uished from urls.
... in the following example, the "a" property has the values "1" and "2", in that order, but whether the "a" property comes before the "b" property or not is not important <div itemscope> <p itemprop="a">1</p> <p itemprop="a">2</p> <p itemprop="b">test</p> </div> the following is eq
uivalent <div itemscope> <p itemprop="b">test</p> <p itemprop="a">1</p> <p itemprop="a">2</p> </div> as is the following <div itemscope> <p itemprop="a">1</p> <p itemprop="b">test</p> <p itemprop="a">2</p> </div> and the following <div id="x"> <p itemprop="a">1</p> </div> <div itemscope itemref="x"> <p itemprop="b">test</p> <p itemprop="a">2</p> </div> other examples html <dl items...
Using the application cache - HTML: Hypertext Markup Language
safari has a similar "empty cache" setting in its preferences but a browser restart may also be req
uired.
... network: files listed under the network: section header in the cache manifest file are white-listed resources that req
uire a connection to the server.
... network entries the network section of a cache manifest file specifies resources for which a web application req
uires online access.
Data URLs - HTTP
note that the closing script tag is req
uired.
... length limitations although firefox supports data urls of essentially unlimited length, browsers are not req
uired to support any particular maximum length of data.
...to mitigate such issues, top-level navigation to data:// urls has been blocked in firefox 59+ (release version, nightly/beta from 58), and we hope to see other browsers follow s
uit soon.
Resource URLs - HTTP
in this article, we focus on resource uris, which are used internally by firefox to point to b
uilt-in resources.
... furthermore, some default values of preferences differ between b
uild configurations, such as platform and locale, which means web sites could identify individual users using this information.
... for example, if you open the view source page (view page source or view selection source), you will find it req
uires viewsource.css through a resource: uri.
Content negotiation - HTTP
in http, content negotiation is the mechanism that is used for serving different representations of a resource at the same uri, so that the user agent can specify which is best s
uited for the user (for example, which language of a document, which image format, or which content encoding).
... the determination of the best s
uited representation is made through one of two mechanisms: specific http headers by the client (server-driven negotiation or proactive negotiation), which is the standard way of negotiating a specific kind of resource.
... the information by the client is q
uite verbose (http/2 header compression mitigates this problem) and a privacy risk (http fingerprinting) as several representations of a given resource are sent, shared caches are less efficient and server implementations are more complex.
CSP: connect-src - HTTP
the colon is req
uired.
...the single quotes are req
uired.
...the single quotes are req
uired.
CSP: style-src - HTTP
the colon is req
uired.
...the single quotes are req
uired.
...the single quotes are req
uired.
Large-Allocation - HTTP
for complex games, for example, these allocations can be q
uite large, sometimes as large as 1gb.
... firefox has moved to a multiprocess architecture, and this architecture is req
uired in order to support the large-allocation header.
... firefox currently only supports the large-allocation header in our 32-bit windows b
uilds, as memory fragmentation is not an issue in 64-bit b
uilds.
Firefox user agent string reference - HTTP
firefoxversion will generally represent the eq
uivalent firefox release corresponding to the given gecko version.
... form factor gecko user agent string phone mozilla/5.0 (android 4.4; mobile; rv:41.0) gecko/41.0 firefox/41.0 tablet mozilla/5.0 (android 4.4; tablet; rv:41.0) gecko/41.0 firefox/41.0 focus for android from version 1, focus is powered by android webview and uses the following user agent string format: mozilla/5.0 (linux; <android version> <b
uild tag etc.>) applewebkit/<webkit rev> (khtml, like gecko) version/4.0 focus/<focusversion> chrome/<chrome rev> mobile safari/<webkit rev> tablet versions on webview mirror mobile, but do not contain a mobile token.
...if this is the case, the firefox os ua string will look like the device-specific string in the table above, where nnnn; is the manufacturer's code for the device (see g
uidelines).
HTTP Messages - HTTP
the http/2 binary framing mechanism has been designed to not req
uire any alteration of the apis or config files applied: it is broadly transparent to the user.
...the whole header, including the value, consist of one single line, which can be q
uite long.
...the http/2 framing mechanism adds a new intermediate layer between the http/1.x syntax and the underlying transport protocol, without fundamentally modifying it: b
uilding upon proven mechanisms.
HTTP range requests - HTTP
you can check this by iss
uing a head request with curl, for example.
...each part contains its own content-type and content-range fields and the req
uired boundary parameter specifies the boundary string used to separate each body-part.
... http/1.1 206 partial content content-type: multipart/byteranges; boundary=3d6b6a416f9b5 content-length: 282 --3d6b6a416f9b5 content-type: text/html content-range: bytes 0-50/1270 <!doctype html> <html> <head> <title>example do --3d6b6a416f9b5 content-type: text/html content-range: bytes 100-150/1270 eta http-eq
uiv="content-type" content="text/html; c --3d6b6a416f9b5-- conditional range requests when resuming to request more parts of a resource, you need to guarantee that the stored resource has not been modified since the last fragment has been received.
501 Not Implemented - HTTP
the hypertext transfer protocol (http) 501 not implemented server error response code means that the server does not support the functionality req
uired to fulfill the request.
...the only methods that servers are req
uired to support (and therefore that must not return 501) are get and head.
... a 501 error is not something you can fix, but req
uires a fix by the web server you are trying to access.
HTTP
rudp — the reliable update of udp — is a s
uitable alternative.
... tutorials learn how to use http with g
uides and tutorials.
... mozilla web security g
uidelines a collection of tips to help operational teams with creating secure web applications.
About JavaScript - JavaScript
the basic syntax is intentionally similar to both java and c++ to reduce the number of new concepts req
uired to learn the language.
... the javascriptcore (sq
uirrelfish/nitro) used in some webkit browsers such as apple safari.
... a re-introduction to javascript javascript g
uide and javascript reference.
Enumerability and ownership of properties - JavaScript
there are a number of b
uilt-in means of detecting, iterating/enumerating, and retrieving object properties, with the chart showing below which are available.
... property enumerability and ownership - b
uilt-in methods of detection, retrieval, and iteration functionality own object own object and its prototype chain prototype chain only detection enumerable nonenumerable enumerable and nonenumerable propertyisenumerable hasownproperty hasownproperty – filtered to exclude enumerables using propertyisenumerable hasownproperty enumerable nonenumerable enumerable and nonenumerable not available without extra code ...
... enumerable and nonenumerable for..in (excluding symbols) not available without extra code not available without extra code not available without extra code obtaining properties by enumerability/ownership note that this is not the most efficient algorithm for all cases, but useful for a q
uick demonstration.
Control flow and error handling - JavaScript
(in c or java, the eq
uivalent code would have outputted 1.) since ecmascript2015, the let and const variable declarations are block-scoped.
... example in the following example, if fr
uittype evaluates to 'bananas', the program matches the value with case 'bananas' and executes the associated statement.
... switch (fr
uittype) { case 'oranges': console.log('oranges are $0.59 a pound.'); break; case 'apples': console.log('apples are $0.32 a pound.'); break; case 'bananas': console.log('bananas are $0.48 a pound.'); break; case 'cherries': console.log('cherries are $3.00 a pound.'); break; case 'mangoes': console.log('mangoes are $0.56 a pound.'); break; case 'papayas': console.log('mangoes and papayas are $2.79 a pound.'); break; default: console.log(`sorry, we are out of ${fr
uittype}.`); } console.log("is there anything else you'd like...
Details of the object model - JavaScript
below are eq
uivalent: function engineer(name, projs, mach) { this.base = workerbee; this.base(name, 'engineering', projs); this.machine = mach || ''; } function engineer(name, projs, mach) { workerbee.call(this, name, 'engineering', projs); this.machine = mach || ''; } using the javascript call() method makes a cleaner implementation because the base is not needed anymore.
..., constructor) { object = object.__proto__; while (object != null) { if (object == constructor.prototype) return true; if (typeof object == 'xml') { return constructor.prototype == xml.prototype; } object = object.__proto__; } return false; } note: the implementation above checks the type of the object against "xml" in order to work around a q
uirk of how xml objects are represented in recent versions of javascript.
...however, assume you then add a property to the hobbyist constructor's prototype: hobbyist.prototype.eq
uipment = ['mask', 'fins', 'regulator', 'bcd']; the dennis object does not inherit this new property.
Iterators and generators - JavaScript
generator functions while custom iterators are a useful tool, their creation req
uires careful programming due to the need to explicitly maintain their internal state.
...some b
uilt-in types, such as array or map, have a default iteration behavior, while other types (such as object) do not.
...enerator object, (it) // can iterate many times it[symbol.iterator] = function* () { yield 2; yield 1; }; user-defined iterables you can make your own iterables like this: const myiterable = { *[symbol.iterator]() { yield 1; yield 2; yield 3; } } for (let value of myiterable) { console.log(value); } // 1 // 2 // 3 or [...myiterable]; // [1, 2, 3] b
uilt-in iterables string, array, typedarray, map and set are all b
uilt-in iterables, because their prototype objects all have a symbol.iterator method.
About the JavaScript reference - JavaScript
if you're learning javascript, or need help understanding some of its capabilities or features, check out the javascript g
uide.
... where to find javascript information javascript documentation of core language features (pure ecmascript, for the most part) includes the following: the javascript g
uide the javascript reference if you are new to javascript, start with the g
uide.
... structure of the reference in the javascript reference you can find the following chapters: standard b
uilt-in objects this chapter documents all the javascript standard b
uilt-in objects, along with their methods and properties.
TypeError: invalid arguments - JavaScript
typed array constructors req
uire either a length, another typed array, array-like objects, iterable objects or an arraybuffer object to create a new typed array.
... examples no strings in typed arrays typed arrays, for example a
uint8array, can't be constructed from a string.
... var ta = new
uint8array("nope"); // typeerror: invalid arguments different ways to create a valid
uint8array: // from a length var
uint8 = new
uint8array(2);
uint8[0] = 42; console.log(
uint8[0]); // 42 console.log(
uint8.length); // 2 console.log(
uint8.bytes_per_element); // 1 // from an array var arr = new
uint8array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new
uint8array([21, 31]); var y = new
uint8array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new
uint8array(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var
uint8 = new
uint8array(iterable); //
uint8array[1, 2, 3] ...
Array() constructor - JavaScript
examples array literal notation arrays can be created using the literal notation: let fr
uits = ['apple', 'banana']; console.log(fr
uits.length); // 2 console.log(fr
uits[0]); // "apple" array constructor with a single parameter arrays can be created using a constructor with a single number parameter.
... let fr
uits = new array(2); console.log(fr
uits.length); // 2 console.log(fr
uits[0]); // undefined array constructor with multiple parameters if more than one argument is passed to the constructor, a new array with the given elements is created.
... let fr
uits = new array('apple', 'banana'); console.log(fr
uits.length); // 2 console.log(fr
uits[0]); // "apple" specifications specification ecmascript (ecma-262)the definition of 'array constructor' in that specification.
Array.prototype.filter() - JavaScript
this algorithm is exactly eq
uivalent to the one specified in ecma-262, 5th edition, assuming that fn.call evaluates to the original value of function.prototype.bind(), and that array.prototype.push() has its original value.
... let fr
uits = ['apple', 'banana', 'grapes', 'mango', 'orange'] /** * filter array items based on search criteria (query) */ function filteritems(arr, query) { return arr.filter(function(el) { return el.tolowercase().indexof(query.tolowercase()) !== -1 }) } console.log(filteritems(fr
uits, 'ap')) // ['apple', 'grapes'] console.log(filteritems(fr
uits, 'an')) // ['banana', 'mango', 'orange'] e...
...s2015 implementation const fr
uits = ['apple', 'banana', 'grapes', 'mango', 'orange'] /** * filter array items based on search criteria (query) */ const filteritems = (arr, query) => { return arr.filter(el => el.tolowercase().indexof(query.tolowercase()) !== -1) } console.log(filteritems(fr
uits, 'ap')) // ['apple', 'grapes'] console.log(filteritems(fr
uits, 'an')) // ['banana', 'mango', 'orange'] affecting initial array (modifying, appending and deleting) the following examples tests the behavior of the filter method when the array is modified.
Intl.Collator() constructor - JavaScript
implementations are not req
uired to support this property.
...implementations are not req
uired to support this property.
...that is, the specification req
uires only that the before and after values are negative and positive.
Map - JavaScript
for this reason (and because there were no b
uilt-in alternatives), objects have been used as maps historically.
... iterating over an object req
uires obtaining its keys in some fashion and iterating over them.
...even though every nan is not equal to itself (nan !== nan is true), the following example works because nans are indisting
uishable from each other: let mymap = new map() mymap.set(nan, 'not a number') mymap.get(nan) // "not a number" let othernan = number('foo') mymap.get(othernan) // "not a number" iterating map with for..of maps can be iterated using a for..of loop: let mymap = new map() mymap.set(0, 'zero') mymap.set(1, 'one') for (let [key, value] of mymap) { console.log(key + ' = ' + value) } // 0 = zero...
Object - JavaScript
examples using object given undefined and null types the following examples store an empty object object in o: let o = new object() let o = new object(undefined) let o = new object(null) using object to create boolean objects the following examples store boolean objects in o: // eq
uivalent to o = new boolean(true) let o = new object(true) // eq
uivalent to o = new boolean(false) let o = new object(boolean()) object prototypes when altering the behavior of existing object.prototype methods, consider injecting code by wrapping your extension before or after the existing logic.
... for example, this (untested) code will pre-conditionally execute custom logic before the b
uilt-in logic or someone else's extension is executed.
... var bob = new employee('bob', 'b
uilder'); var joe = new customer('joe'); var rg = new employee('red green', 'handyman'); var mike = new customer('mike'); var mime = new mime('mime'); bob.greet(); // hi, i am bob, the b
uilder joe.greet(); // hi, i am joe rg.greet(); // hi, i am red green, the handyman mike.greet(); // hi, i am mike mime.greet(); specifications specification ecmascript (ecma-262)the defi...
Reflect - JavaScript
reflect is a b
uilt-in object that provides methods for interceptable javascript operations.
...eq
uivalent to calling new target(...argumentslist).
...eq
uivalent to calling delete target[propertykey].
RegExp - JavaScript
for an introduction to regular expressions, read the regular expressions chapter in the javascript g
uide.
... for example, the following are eq
uivalent: let re = /\w+/ let re = new regexp('\\w+') perl-like regexp properties note that several of the regexp properties have both long and short (perl-like) names.
... extracting sub-domain name from url let url = 'http://xxx.domain.com' console.log(/[^.]+/.exec(url)[0].substr(7)) // logs 'xxx' instead of using regular expressions for parsing urls, it is usually better to use the browsers b
uilt-in url parser by using the url api.
String.fromCharCode() - JavaScript
because fromcharcode() only works with 16-bit values (same as the \u escape sequence), a surrogate pair is req
uired in order to return a supplementary character.
...0x1f303) and both surrogate values that represent it (e.g., 0xd83c and 0xdf03), it does req
uire an extra step to either calculate or look up the surrogate pair values every time a supplementary code point is to be used.
... supplementary characters, in utf-16, req
uire two code units (i.e.
String - JavaScript
some of the most-used operations on strings are to check their length, to b
uild and concatenate them using the + and += string operators, checking for the existence or location of substrings with the indexof() method, or extracting substrings with the substring() method.
... string primitives and string objects note that javascript disting
uishes between string objects and primitive string values.
... string.prototype.localecompare(comparestring [, locales [, options]]) returns a number indicating whether the reference string comparestring comes before, after, or is eq
uivalent to the given string in sort order.
Symbol.asyncIterator - JavaScript
description the symbol.asynciterator symbol is a b
uiltin symbol that is used to access an object's @@asynciterator method.
... b
uilt-in async iterables there are currently no b
uilt-in javascript objects that have the [symbol.asynciterator] key set by default.
... however, whatwg streams are set to be the first b
uilt-in object to be async iterable, with [symbol.asynciterator] recently landing in the spec.
TypedArray.from() - JavaScript
syntax typedarray.from(source[, mapfn[, thisarg]]) where typedarray is one of: int8array
uint8array
uint8clampedarray int16array
uint16array int32array
uint32array float32array float64array bigint64array big
uint64array parameters source an array-like or iterable object to convert to a typed array.
...this means that the following are eq
uivalent: typedarray.from(obj, mapfn, thisarg) typedarray.from(array.prototype.map.call(obj, mapfn, thisarg)).
... copy_data.push(obj[i]); } copy_data = copy_data.map(func, thisobj); var typed_array = new this(copy_data.length); for(var i = 0; i < typed_array.length; i++) { typed_array[i] = copy_data[i]; } return typed_array; } })(); } examples from an iterable object (set) const s = new set([1, 2, 3]);
uint8array.from(s); //
uint8array [ 1, 2, 3 ] from a string int16array.from('123'); // int16array [ 1, 2, 3 ] use with arrow function and map using an arrow function as the map function to manipulate the elements float32array.from([1, 2, 3], x => x + x); // float32array [ 2, 4, 6 ] generate a sequence of numbers
uint8array.from({length: 5}, (v, k) => k); //
uint8array [ 0, 1, 2, 3, 4 ] s...
TypedArray.name - JavaScript
the first part can be int for "integer" or
uint for an "unsigned integer", also float for "floating point" is used.
...please see
uint8clampedarray for more details.
... examples using name int8array.name; // "int8array"
uint8array.name; // "
uint8array"
uint8clampedarray.name; // "
uint8clampedarray" int16array.name; // "int16array"
uint16array.name; // "
uint16array" int32array.name; // "int32array"
uint32array.name; // "
uint32array" float32array.name; // "float32array" float64array.name; // "float64array" specifications specification ecmascript (ecma-262)the definition of 'typedarray.name' in that specification.
TypedArray.prototype.some() - JavaScript
// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some if (!
uint8array.prototype.some) { object.defineproperty(
uint8array.prototype, 'some', { value: array.prototype.some }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable.
... function isbiggerthan10(element, index, array) { return element > 10; } new
uint8array([2, 5, 8, 1, 4]).some(isbiggerthan10); // false new
uint8array([12, 5, 8, 1, 4]).some(isbiggerthan10); // true testing typed array elements using arrow functions arrow functions provide a shorter syntax for the same test.
... new
uint8array([2, 5, 8, 1, 4]).some(elem => elem > 10); // false new
uint8array([12, 5, 8, 1, 4]).some(elem => elem > 10); // true specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.some' in that specification.
Logical OR (||) - JavaScript
short-circ
uit evaluation the logical or expression is evaluated left to right, it is tested for possible "short-circ
uit" evaluation using the following rule: (some truthy expression) || expr is short-circ
uit evaluated to the truthy expression.
... short circ
uit means that the expr part above is not evaluated, hence any side effects of doing so do not take effect (e.g., if expr is a function call, the calling never takes place).
...see example: function a(){ console.log('called a'); return false; } function b(){ console.log('called b'); return true; } console.log( b() || a() ); // logs "called b" due to the function call, // then logs true (which is the resulting value of the operator) operator precedence the following expressions might seem eq
uivalent, but they are not, because the && operator is executed before the || operator (see operator precedence).
delete operator - JavaScript
this includes properties of b
uilt-in objects like math, array, object and properties that are created as non-configurable with methods like object.defineproperty().
... if you want to use an ordered associative array in a cross-browser environment, use a map object if available, or simulate this structure with two separate arrays (one for the keys and the other for the values), or b
uild an array of single-property objects, etc.
...delete employeedetails.salary; // returns true // delete does not affect b
uilt-in static properties.
new operator - JavaScript
the new operator lets developers create an instance of a user-defined object type or of one of the b
uilt-in object types that has a constructor function.
... creating a user-defined object req
uires two steps: define the object type by writing a function.
...new foo is eq
uivalent to new foo(), i.e.
for...in - JavaScript
objects created from b
uilt–in constructors like array and object have inherited non–enumerable properties from object.prototype and string.prototype, such as string's indexof() method or object's tostring() method.
...alternatively, if you know there won't be any outside code interference, you can extend b
uilt-in prototypes with a check method.
... given that for...in is b
uilt for iterating object properties, not recommended for use with arrays, and options like array.prototype.foreach() and for...of exist, what might be the use of for...in at all?
var - JavaScript
the list of names in [[varnames]] enables the runtime to disting
uish between global variables and straightforward properties on the global object.
... var hoisting because variable declarations (and declarations in general) are processed before any code is executed, declaring a variable anywhere in the code is eq
uivalent to declaring it at the top.
...mething() { console.log(bar); // undefined var bar = 111; console.log(bar); // 111 } // ...is implicitly understood as: function do_something() { var bar; console.log(bar); // undefined bar = 111; console.log(bar); // 111 } examples declaring and initializing two variables var a = 0, b = 0; assigning two variables with single string value var a = 'a'; var b = a; // ...is eq
uivalent to: var a, b = a = 'a'; be mindful of the order: var x = y, y = 'a'; console.log(x + y); // undefineda here, x and y are declared before any code is executed, but the assignments occur later.
Transitioning to strict mode - JavaScript
while making web browsers interpret code as strict is easy (just add 'use strict'; at the top of your source code), transitioning an existing code base to strict mode req
uires a bit more work.
... this article aims at providing g
uidance for developers.
...it's possible that a test s
uite doesn't catch this kind of subtle difference.
Strict mode - JavaScript
ypeerror // assignment to a new property on a non-extensible object var fixed = {}; object.preventextensions(fixed); fixed.newprop = 'ohai'; // throws a typeerror third, strict mode makes attempts to delete undeletable properties throw (where before the attempt would simply have no effect): 'use strict'; delete object.prototype; // throws a typeerror fourth, strict mode prior to gecko 34 req
uires that all properties named in an object literal be unique.
...syntax error fifth, strict mode req
uires that function parameter names be unique.
...a few strict mode tweaks, plus req
uiring that user-submitted javascript be strict mode code and that it be invoked in a certain manner, substantially reduce the need for those runtime checks.
display - Web app manifests
the display mode changes how much of browser
ui is shown to the user and can range from browser (when the full browser window is shown) to fullscreen (when the app is full-screened).
...in this mode, the user agent will exclude
ui elements for controlling navigation, but can include other
ui elements such as a status bar.
... minimal-
ui minimal-
ui the application will look and feel like a standalone application, but will have a minimal set of
ui elements for controlling navigation.
Handling media support issues in web content - Web media technologies
the availability of choices is good for the user, in that they can choose the format that s
uits their needs best.
...this g
uide covers techniques you can use to develop web content that meets your media needs while providing the most broadly compatible experience possible.
...this req
uires creating your images using progressive formats, such as progressive jpeg or interlaced png.
Using audio and video in HTML - Web media technologies
in this g
uide, we'll review the media elements and how to use them in html content.
... note: this g
uide is a planned update to integrate content from various scattered places on mdn into one cohesive document or document set.
... we don't have a particularly good g
uide to using these objects offscreen at this time, although audio and video manipulation may be a good start.
Lazy loading - Web Performance
this enables sending the minimal code req
uired to provide value upfront, improving page-load times.
...css must be thin, delivered as q
uickly as possible, and the usage media types and queries are advised to unblock rendering.
...most of those images are off-screen (non-critical), req
uiring user interaction (an example being scroll) in order to view them.
Performance Monitoring: RUM vs synthetic monitoring - Web Performance
rum is generally best s
uited for understanding long-term trends whereas synthetic monitoring is very well s
uited to regression testing and mitigating shorter-term performance issues during development.
... by leveraging rum, a business can better understand its users and identify the areas on its site that req
uire the most attention.
... rum v synthetic synthetic is well s
uited for catching regressions during development life cycles, especially with network throttling.
Web technology reference
if you're new to web development, consider starting with our learning area, which is filled with step-by-step tutorials that will g
uide you from total webdev newbie to at least semi-pro!
... introduction to html | learn html | html5 | developer g
uide | element reference | reference css — styling the web cascading style sheets are used to describe the appearance of web content.
... learn javascript | developer g
uide | reference ...
SVG Conditional Processing Attributes - SVG: Scalable Vector Graphics
externalresourcesreq
uired req
uiredextensions req
uiredfeatures systemlanguage attributes externalresourcesreq
uired deprecated since svg 2 if set to true, it indicates that the browser must wait for all the external resources necessary to render that element to be loaded before processing the associated element.
... value: false|true; animatable: no req
uiredextensions list all the browser specific capabilities that must be supported by the borwser to be allowed to render the associated element.
... value: a list of space-separated uri; animatable: no req
uiredfeatures deprecated since svg 2 list all the features, as defined is the svg 1.1 specification, that must be supported by the borwser to be allowed to render the associated element..
x - SVG: Scalable Vector Graphics
if there are less values than glyphes, the remaining glyphes are placed in the contin
uity of the last positioned glyph.
...if there are less values than glyphes, the remaining glyphes are placed in the contin
uity of the last positioned glyph.
...if there are less values than glyphes, the remaining glyphes are placed in the contin
uity of the last positioned glyph.
y - SVG: Scalable Vector Graphics
if there are less values than glyphes, the remaining glyphes are placed in the contin
uity of the last positioned glyph.
...if there are less values than glyphes, the remaining glyphes are placed in the contin
uity of the last positioned glyph.
...if there are less values than glyphes, the remaining glyphes are placed in the contin
uity of the last positioned glyph.
SVG Attribute reference - SVG: Scalable Vector Graphics
cmode cap-height class clip clippathunits clip-path clip-rule color color-interpolation color-interpolation-filters color-profile color-rendering contentscripttype contentstyletype cursor cx cy d d decelerate descent diffuseconstant direction display divisor dominant-baseline dur dx dy e edgemode elevation enable-background end exponent externalresourcesreq
uired f fill fill-opacity fill-rule filter filterres filterunits flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight format from fr fx fy g g1 g2 glyph-name glyph-orientation-horizontal glyph-orientation-vertical glyphref gradienttransform gradientunits h hanging height href hreflang horiz-adv-...
...tor order orient orientation origin overflow overline-position overline-thickness p panose-1 paint-order path pathlength patterncontentunits patterntransform patternunits ping pointer-events points pointsatx pointsaty pointsatz preservealpha preserveaspectratio primitiveunits r r radius referrerpolicy refx refy rel rendering-intent repeatcount repeatdur req
uiredextensions req
uiredfeatures restart result rotate rx ry s scale seed shape-rendering slope spacing specularconstant specularexponent speed spreadmethod startoffset stddeviation stemh stemv stitchtiles stop-color stop-opacity strikethrough-position strikethrough-thickness string stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-mit...
...channelselector xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type xml:base xml:lang xml:space y y y1 y2 ychannelselector z z zoomandpan svg attributes by category generic attributes core attributes id, lang, tabindex, xml:base, xml:lang, xml:space style attributes class, style conditional processing attributes externalresourcesreq
uired, req
uiredextensions, req
uiredfeatures, systemlanguage.
<foreignObject> - SVG: Scalable Vector Graphics
nullam magna ipsum, porta vel d
ui convallis, rutrum imperdiet eros.
... global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage event attributes global event attributes, graphical event attributes, document event attributes, document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, ...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<foreignobject>' in t...
<image> - SVG: Scalable Vector Graphics
usage context categoriesgraphics element, graphics referencing elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes xlink attributes class style externalresourcesreq
uired transform specific attributes x: positions the image horizontally from the origin.
...unlike html's <img>, this attribute is req
uired.
...unlike html's <img>, this attribute is req
uired.
<polygon> - SVG: Scalable Vector Graphics
://www.w3.org/2000/svg"> <!-- example of a polygon with the default fill --> <polygon points="0,100 50,25 50,75 100,0" /> <!-- example of the same polygon shape with stroke and no fill --> <polygon points="100,100 150,25 150,75 200,0" fill="none" stroke="black" /> </svg> attributes points this attribute defines the list of points (pairs of x,y absolute coordinates) req
uired to draw the polygon.
... value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification...
<polyline> - SVG: Scalable Vector Graphics
ww.w3.org/2000/svg"> <!-- example of a polyline with the default fill --> <polyline points="0,100 50,25 50,75 100,0" /> <!-- example of the same polyline shape with stroke and no fill --> <polyline points="100,100 150,25 150,75 200,0" fill="none" stroke="black" /> </svg> attributes points this attribute defines the list of points (pairs of x,y absolute coordinates) req
uired to draw the polyline value type: <number>+ ; default value: ""; animatable: yes pathlength this attribute lets specify the total length for the path, in user units.
... value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colco...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification...
<textPath> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- to hide the path, it is usually wrapped in a <defs> element --> <!-- <defs> --> <path id="mypath" fill="none" stroke="red" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <!-- </defs> --> <text> <textpath href="#mypath"> q
uick brown fox jumps over the lazy dog.
... value type: <length>|<percentage>|<number> ; default value: auto; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-mit...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role xlink attributes xlink:title usage notes categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altgly...
<use> - SVG: Scalable Vector Graphics
however, xlink:href can still be req
uired in practice for cross-browser compatibility (see the compatibility table below).
... global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-mit...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role xlink attributes xlink:href, xlink:title usage notes categoriesgraphics element, graphics referencing element, structural elementpermitted contentany number of the following elements, in any order:animation elementsde...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
svgexternalresourcesreq
uired removed never implemented svgelement.viewportelement and svgelement.ownersvgelement nullable implementation status unknown svgelement.getpresentationattribute() removed never implemented (prototype removed in bug 921456) svgcolor and svgicccolor removed never implemented svgelement.focus(), svgelement.blur() not implemented (bug 778654) ...
... moved pathlength attribute and gettotallength() and getpointatlength() methods from svgpathelement to svggeometryelement implemented (bug 1239100) document structure change notes svgsvgelement.suspendredraw(), svgsvgelement.unsuspendredraw(), and svgsvgelement.unsuspendredrawall() deprecated turned into no-ops (bug 734079) externalresourcesreq
uired attribute removed implementation status unknown auto value for width and height in <image> implementation status unknown referencing entire document with <use> implementation status unknown lang attribute on <desc> and <title> implemented (bug 721920) css transforms on outermost <svg> not affecting svgsvgelement.currentscale or svgsvgelement.curr...
...tributes of <svg> implementation status unknown baseprofile and version attributes removed from <svg> implementation status unknown svgsvgelement.forceredraw() deprecated turned into a no-op (bug 733764) svgsvgelement.deselectall() deprecated not yet deprecated (bug 1302705) <switch> not affecting <style> implementation status unknown req
uiredfeatures attribute removed implementation status unknown svgsvgelement.currentview and svgsvgelement.usecurrentview removed svgsvgelement.currentview was never implemented, svgsvgelement.usecurrentview not removed yet (bug 1174097) svgunknownelement not implemented (bug 1239218) lang attribute without namespace implemented (bug 721920) svgsvgeleme...
SVG fonts - SVG: Scalable Vector Graphics
defining a font there are some ingredients req
uired for embedding a font in svg.
... the <font-face> element is the svg eq
uivalent of the css @font-face declaration.
...the font-weight and font-style attributes have the same purpose as the eq
uivalent descriptors in css.
Tools for SVG - SVG: Scalable Vector Graphics
adobe illustrator url: www.adobe.com/products/illustrator/ before adobe acq
uired macromedia, it was the most prominent promoter of svg.
...however, the resulting svg often shows some q
uirks, that make it necessary to post-process it for general applicability.
... batik offers a viewer (sq
uiggle), a rasterizer for png output, an svg pretty printer to format svg files, and a truetype-to-svg-font converter.
Referer header: privacy and security concerns - Web security
security-conscious server-side frameworks tend to have b
uilt in mitigations for such problems, for example: security in django (especially see cross site request forgery (csrf) protection).
... policy and req
uirements it would make sense to write a set of security and privacy req
uirements for your project team(s) that specify usage of such features to mitigate the associated risks.
... you should enlist the help of a web security expert to write these req
uirements, and consider both user needs and welfare, as well as other issues like policy and regulation enforced by legislation such as the eu general data protection regulation (gdpr).
Types of attacks - Web security
the variety of attacks based on xss is almost limitless, but they commonly include transmitting private data like cookies or other session information to the attacker, redirecting the victim to a webpage controlled by the attacker, or performing other malicious operations on the user's machine under the g
uise of the vulnerable site.
...for endpoints that req
uire a post request, it's possible to programmatically trigger a <form> submit (perhaps in an invisible <iframe>) when the page is loaded: <form action="https://bank.example.com/withdraw" method="post"> <input type="hidden" name="account" value="bob"> <input type="hidden" name="amount" value="1000000"> <input type="hidden" name="for" value="mallory"> </form> <script>window.addeventlistener('d...
...omcontentloaded', (e) => { document.queryselector('form').submit(); }</script> there are a few techniques that should be used to prevent this from happening: get endpoints should be idempotent—actions that enact a change and do not simply retrieve data should req
uire sending a post (or other http method) request.
current - XPath
the following two are symantically eq
uivalent.
...moreover, the latter two are semantically eq
uivalent.
... <xsl:value-of select="current()"/> <xsl:value-of select="foo/bar[current() = x]"/> <xsl:variable name="current" select="current()"/> <xsl:value-of select="foo/bar[$current = x]"/> and the next code is also semantically eq
uivalent to the latter two, since the .
Introduction to using XPath in JavaScript - XPath
note that you still have to use some namespace prefix in your xpath expression, so that the resolver function will be able to change it to your req
uired namespace.
... e.g.: function resolver() { return 'http://www.w3.org/2005/atom'; } doc.evaluate('//myns:entry', doc, resolver, xpathresult.any_type, null) note that a more complex resolver will be req
uired if the document uses multiple namespaces.
... getting specifically namespaced elements and attributes regardless of prefix if one wishes to provide flexibility in namespaces (as they are intended) by not necessarily req
uiring a particular prefix to be used when finding a namespaced element or attribute, one must use special techniques.
XPath
this extensive introduction to xslt and xpath assumes no prior knowledge of the technologies, and g
uides the reader through background, context, structure, concepts, and introductory terminology.
... xmlq
uire (formerly known as sketchpath) a graphical xpath b
uilder/debugger(.net).
... xpath tester an online xpath b
uilder/debugger.
<xsl:apply-imports> - XSLT: Extensible Stylesheet Language Transformations
import precedence req
uires that template rules in main stylesheets have higher precedence than template rules in imported stylesheets.
... sometimes, however, it is useful to be able to force the processor to use a template rule from the (lower precedence) imported stylesheet rather than an eq
uivalent rule in the main stylesheet.
... syntax <xsl:apply-imports/> req
uired attributes none.
Loading and running WebAssembly code - WebAssembly
the older webassembly.compile/webassembly.instantiate methods req
uire you to create an arraybuffer containing your webassembly module binary after fetching the raw bytes, and then compile/instantiate it.
... the q
uickest, most efficient way to fetch a wasm module is using the newer webassembly.instantiatestreaming() method, which can take a fetch() call as its first argument, and will handle fetching, compiling, and instantiating the module in one step, accessing the raw byte code as it streams from the server: webassembly.instantiatestreaming(fetch('simple.wasm'), importobject) .then(results => { // do s...
...your code might look something like this: webassembly.instantiatestreaming(fetch('mymodule.wasm'), importobject) .then(obj => { // call an exported function: obj.instance.exports.exported_func(); // or access the buffer contents of an exported memory: var i32 = new
uint32array(obj.instance.exports.memory.buffer); // or access the elements of an exported table: var table = obj.instance.exports.table; console.log(table.get(0)()); }) note: for more information on how exporting from a webassembly module works, have a read of using the webassembly javascript api, and understanding webassembly text format.
Cross-domain Content Scripts - Archive of obsolete content
//main.js var data = req
uire("sdk/self").data; var pageworker = req
uire("sdk/page-worker").page({ contenturl: data.url("page.html"), contentscriptfile: data.url("page-script.js") }); pageworker.on("message", function(message) { console.log(message); }); the "page.html" file embeds an iframe whose content is served from "http://en.m.wikipedia.org/": <!doctype html> <!-- page.html --> <html> <hea...
... the "main.js": creates a panel whose content is supplied by "panel.html" and adds a content script "panel-script.js" to it sends the panel a "show" message when it is shown adds a button which shows the panel when it is clicked // main.js var data = req
uire("sdk/self").data; var forecast_panel = req
uire("sdk/panel").panel({ height: 50, contenturl: data.url("panel.html"), contentscriptfile: data.url("panel-script.js") }); forecast_panel.on("show", function(){ forecast_panel.port.emit("show"); }); req
uire("sdk/
ui/button/action").actionbutton({ id: "get-forecast", label: "get the forecast", icon: "./icon-16.png", onclick: function(...
Loading Content Scripts - Archive of obsolete content
to supply the file "my-content-script.js", located in the /data subdirectory under your add-on's root directory, use a line like: // "data" is supplied by the "self" module var data = req
uire("sdk/self").data; ...
... contentscriptfile: data.url("my-content-script.js") both contentscript and contentscriptfile accept an array of strings, so you can load multiple scripts, which can also interact directly with each other in the content process: // "data" is supplied by the "self" module var data = req
uire("sdk/self").data; ...
Reddit Example - Archive of obsolete content
this is the complete add-on script: var data = req
uire("sdk/self").data; var button = req
uire("sdk/
ui/button/action").actionbutton({ id: "reddit-panel", label: "reddit panel", icon: "./icon-16.png", onclick: function() { reddit_panel.show(); } }); var reddit_panel = req
uire("sdk/panel").panel({ width: 240, height: 320, contenturl: "http://www.reddit.com/.mobile?keep_extension=true", contentscriptfile: [data.url("jquery-2.1.0...
....min.js"), data.url("panel.js")] }); reddit_panel.port.on("click", function(url) { req
uire("sdk/tabs").open(url); }); this code supplies two content scripts to the panel's constructor in the contentscriptfile option: the jquery library and the script that intercepts link clicks.
port - Archive of obsolete content
the button sends the content script a message called "get-first-para" when it is clicked: // main.js pageworker = req
uire("sdk/page-worker").page({ contentscriptfile: req
uire("sdk/self").data.url("listener.js"), contenturl: "http://en.wikipedia.org/wiki/chalk" }); req
uire("sdk/
ui/button/action").actionbutton({ id: "get-first-para", label: "get-first-para", icon: "./icon-16.png", onclick: function() { console.log("sending 'get-first-para'"); pageworker.port.emit("get-first-para"); } }); the ...
... for example, to include an array of strings in the payload: // main.js var pagemods = req
uire("sdk/page-mod"); var self = req
uire("sdk/self"); var pagemod = pagemods.pagemod({ include: ['*'], contentscriptfile: self.data.url("content-script.js"), onattach: setuplistener }); function setuplistener(worker) { worker.port.on('loaded', function(pageinfo) { console.log(pageinfo[0]); console.log(pageinfo[1]); }); } //content-script.js self.port.emit('loaded', [ ...
Classes and Inheritance - Archive of obsolete content
consider the following: let circle = circle(2, 3, 5); circle.draw(); // => typeerror: circle.draw is not a function this is not q
uite right.
...it is defined in the module “core/heritage”: const { class } = req
uire('sdk/core/heritage'); the function class is a meta-constructor: it creates constructors that behave properly with respect to inheritance.
Content Processes - Archive of obsolete content
in this model, the
ui would be rendered in one process (called the chrome process), whereas each tab and each add-on would run in their own dedicated process (called content and add-on processes, respectively).
... to avoid problems like this, content scripts should always see the b
uilt-in properties of the window object, even when they are overridden by another script.
Program ID - Archive of obsolete content
for example: addons.mozilla.org uses it to disting
uish between new add-ons and updates to existing add-ons, and the simple-storage module uses it to figure out which stored data belongs to which add-on.
... if the package.json does include an id field, and it does not contain "@", then jpm xpi raises an error and the xpi will not be b
uilt.
hotkeys - Archive of obsolete content
var { hotkey } = req
uire("sdk/hotkeys"); var showhotkey = hotkey({ combo: "accel-shift-o", onpress: function() { showmypanel(); } }); var hidehotkey = hotkey({ combo: "accel-alt-shift-o", onpress: function() { hidemypanel(); } }); choosing hotkeys hotkeys should be chosen with care.
... parameters options : object req
uired options: name type combo string any function key: "f1, f2, ..., f24" or key combination in the format of 'modifier-key': "accel-s" "meta-shift-i" "control-alt-d" all hotkeys req
uire at least one modifier as well as the key.
request - Archive of obsolete content
to force the response to be interpreted as latin-1, use overridemimetype: var request = req
uire("sdk/request").request; var q
uijote = request({ url: "http://www.latin1files.org/q
uijote.txt", overridemimetype: "text/plain; charset=latin1", oncomplete: function (response) { console.log(response.text); } }); q
uijote.get(); anonymous boolean if true, the request will be sent without cookies or authentication headers.
... the example below shows how to use request to get the most recent tweet from the @mozhacks account: var request = req
uire("sdk/request").request; var latesttweetrequest = request({ url: "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=mozhacks&count=1", oncomplete: function (response) { var tweet = response.json[0]; console.log("user: " + tweet.user.screen_name); console.log("tweet: " + tweet.text); } }); // be a good consumer and check for rate limiting before doing more.
selection - Archive of obsolete content
function mylistener() { console.log("a selection has been made."); } var selection = req
uire("sdk/selection"); selection.on('select', mylistener); // you can remove listeners too.
... examples log the current contiguous selection as text: var selection = req
uire("sdk/selection"); if (selection.text) console.log(selection.text); log the current discontiguous selections as html: var selection = req
uire("sdk/selection"); if (!selection.iscontiguous) { for (var subselection in selection) { console.log(subselection.html); } } surround html selections with delimiters: var selection = req
uire("sdk/selection"); selection.on('select', function ()...
High-Level APIs - Archive of obsolete content
modules listed on this page implement high-level apis for b
uilding add-ons: creating user interfaces, interacting with the web, and interacting with the browser.
...
ui provides access to button, toolbar, and sidebar
ui objects.
content/loader - Archive of obsolete content
provides one of the b
uilding blocks for those modules that use content scripts to interact with web content, such as panel and page-mod.
... example: the following code creates a wrapper on a hidden frame that reloads a web page in the frame every time the contenturl property is changed: var hiddenframes = req
uire("sdk/frame/hidden-frame"); var { loader } = req
uire("sdk/content/content"); var pageloader = loader.compose({ constructor: function pageloader(options) { options = options || {}; if (options.contenturl) this.contenturl = options.contenturl; this.on('propertychange', this._onchange = this._onchange.bind(this)); let self = this; hiddenframes.add(hiddenframes.hiddenfram...
content/mod - Archive of obsolete content
for example, the following code applies a style to a content window, adding a border to all divs in page: var attachto = req
uire("sdk/content/mod").attachto; var style = req
uire("sdk/stylesheet/style").style; var style = style({ source: "div { border: 4px solid gray }" }); // assuming window points to the content page we want to modify attachto(style, window); parameters modification : object the modification we want to apply to the target.
... for example, the following code applies and removes a style to a content window, adding a border to all divs in page: var { attachto, detachfrom } = req
uire("sdk/content/mod"); var style = req
uire("sdk/stylesheet/style").style; var style = style({ source: "div { border: 4px solid gray }" }); // assuming window points to the content page we want to modify attachto(style, window); // ...
content/worker - Archive of obsolete content
but unlike "web workers," these workers run in the same process as web content and browser chrome, so code within workers can block the
ui.
... parameters options : object req
uired options: name type window object the content window to create javascript sandbox for communication with.
frame/utils - Archive of obsolete content
usage module exports create function that takes the nsidomdocument of a privileged document and creates a browser element in its documentelement: let { open } = req
uire('sdk/window/utils'); let { create } = req
uire('sdk/frame/utils'); let window = open('data:text/html,foo'); let frame = create(window.document); optionally create can be passed set of options to configure created frame even further.
... execution of scripts may easily be enabled: let { open } = req
uire('sdk/window/utils'); let { create } = req
uire('sdk/frame/utils'); let window = open('data:text/html,top'); let frame = create(window.document, { uri: 'data:text/html,<script>console.log("running");</script>', allowjavascript: true }); } globals functions create(document, options) creates a xul browser element in a privileged document.
io/file - Archive of obsolete content
for now, you need to req
uire("chrome") and use the xpcom directory service as described in this article about file i/o.
... const fileio = req
uire("sdk/io/file"); let path = "/users/work/"; let list = fileio.list(path); for (i = 0; i < list.length; i++) { let item = fileio.join(path, list[i]); if (fileio.isfile(item)) { console.log(item + " is a file"); } else { console.log(item + " is a directory"); } } parameters path : string the path of the object.
preferences/event-target - Archive of obsolete content
globals constructor prefstarget(options) parameters options : object req
uired options: name type branchname string by default this is "", the root.
... example var { prefstarget } = req
uire("sdk/preferences/event-target"); // listen to the same branch which reqire("sdk/simple-prefs") does var target = prefstarget({ branchname: "extensions." + req
uire("sdk/self").preferencesbranch + "." }); target.once("test", function(prefname) { console.log(prefname) // logs "test" console.log(target.prefs[name]) // logs true }); target.once("", function() { console.log(prefname) // logs "test" console.log(target.prefs[name]) // logs true }) // changing a pref which our target listens to req
uire("sdk/simple-prefs").prefs.test = true; ...
test/httpd - Archive of obsolete content
usage the most basic usage is: var { startserverasync } = req
uire("sdk/test/httpd"); var srv = startserverasync(port, basepath); req
uire("sdk/system/unload").when(function cleanup() { srv.stop(function() { // you should continue execution from this point.
... you can also use nshttpserver to start the server manually: var { nshttpserver } = req
uire("sdk/test/httpd"); var srv = new nshttpserver(); // further documentation on developer.mozilla.org see http server for unit tests for general information.
util/list - Archive of obsolete content
experimental b
uilding blocks for composing lists.
... examples: var { list } = req
uire("sdk/util/list"); var mylist = list.compose({ add: function add(item1, item2, /*item3...*/) { array.slice(arguments).foreach(this._add.bind(this)); }, remove: function remove(item1, item2, /*item3...*/) { array.slice(arguments).foreach(this._remove.bind(this)); } }); mylist('foo', 'bar', 'baz').length == 3; // true new mylist('new', 'keyword').length == 2; // true m...
util/match-pattern - Archive of obsolete content
example pattern example matching urls "file://*" file://c:/file.html file:///home/file.png "resource://*" resource://my-addon-at-me-dot-org/my-addon/data/file.html "data:*" data:text/html,hi there regular expressions you can specify patterns using a regular expression: var { matchpattern } = req
uire("sdk/util/match-pattern"); var pattern = new matchpattern(/.*example.*/); the regular expression is subject to restrictions based on those applied to the html5 pattern attribute.
... /http.*moz.*/ http://foo.mozilla.org/ http://mozilla.org http://hemozoon.org/ https://anydomain.com/foomozbar/ ftp://http/mozilla.org /[^:/]+:\/\/[^/]*mozilla\.org\/.*/ ftp://foo.mozilla.org/ http://www.mozilla.org/ https://developer.mozilla.org/any ftp://http/mozilla.org http://anydomain.com/mozilla.org/ examples var { matchpattern } = req
uire("sdk/util/match-pattern"); var pattern = new matchpattern("http://example.com/*"); console.log(pattern.test("http://example.com/")); // true console.log(pattern.test("http://example.com/foo")); // true console.log(pattern.test("http://foo.com/")); // false!
jpmignore - Archive of obsolete content
use .jpmignore to ignore files from your xpi b
uilds created via jpm.
...by using this file you can let jpm know which files and directories you would like it to ignore when b
uilding a .xpi file with jpm xpi.
The Box Model - Archive of obsolete content
there is also a generic box element which defaults to horizontal orientation, meaning that it is eq
uivalent to the hbox.
...thus, the two lines below are eq
uivalent: <vbox></vbox> <box orient="vertical"></box> the following example shows how to place three buttons vertically.
Tree Box Objects - Archive of obsolete content
note: it is not necessary to run tree.boxobject.queryinterface(components.interfaces.nsitreeboxobject) as shown in the code examples on this page because: let boxobject = tree.treeboxobject; note: is eq
uivalent to: let boxobject = tree.boxobject; boxobject.queryinterface("components.interfaces.nsitreeboxobject"); scrolling the tree you can also scroll the tree using four different methods, similar to those available for listboxes.
...for example if the tree shows 10 rows at a time, a page will be eq
uivalent to 10 rows.
Updating Commands - Archive of obsolete content
<commandset id="globaleditmen
uitems" commandupdater="true" events="focus" oncommandupdate="goupdateglobaleditmen
uitems()"/> <commandset id="selecteditmen
uitems" commandupdater="true" events="select" oncommandupdate="goupdateselecteditmen
uitems()"/> <commandset id="undoeditmen
uitems" commandupdater="true" events="undo" onc...
...ommandupdate="goupdateundoeditmen
uitems()"/> <commandset id="clipboardeditmen
uitems" commandupdater="true" events="clipboard" oncommandupdate="goupdatepastemen
uitems()"/> next, we'll find out how to use observers.
XUL Accesskey FAQ and Policies - Archive of obsolete content
an accesskey is an underlined letter in a web page, menu or dialog that indicates to a user a q
uick, keyboard method of simulating a click on that element.
...our preference is to underline the first letter of one of the words, so it's important to be aware of this q
uirk.
XUL Reference - Archive of obsolete content
indings box broadcaster broadcasterset button browser checkbox caption clicktoscroll colorpicker column columns commandset command conditions content datepicker deck description dialog dialogheader dropmarker editor grid grippy groupbox hbox iframe image key keyset label listbox listcell listcol listcols listhead listheader listitem member menu menubar men
uitem menulist menupopup menuseparator notification notificationbox observes overlay page panel param popupset preference preferences prefpane prefwindow progressmeter query queryset radio radiogroup resizer richlistbox richlistitem row rows rule scale script scrollbar scrollbox scrollcorner separator spacer spinbuttons splitter stack statusbar statusbarpanel s...
...bel caption image lists --- trees --- layout --- templates --- scripting --- helper elements other xul lists dialog overlay page window wizard wizardpage preference preferences prefpane prefwindow browser tabbrowser editor iframe titlebar resizer statusbar statusbarpanel dialogheader notification notificationbox menubar menu men
uitem menuseparator menupopup panel tooltip popupset toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tabbox tabs tab tabpanels tabpanel groupbox caption separator spacer button checkbox colorpicker datepicker menulist progressmeter radio radiogroup scale splitter textbox textbox (firefo...
Accessibility/XUL Accessibility Reference - Archive of obsolete content
items are read per line as in "pearl female gray" listitem see listbox men
uitem see menulist and menubar menubar <menubar hidden="false"> <menu label="file" accesskey="f"> <menupopup> <men
uitem label="new" accesskey="n" key="file-new-key"/> </menupopup> </menu> </menubar> menulist <label value="<!--label text-->" control="comboid" /> <menulist id="comboid"> <menupopup> <men
uitem label="<!--option...
...1-->" /> <men
uitem label="<!--option2-->" selected="true" /> <men
uitem label="<!--option3-->" /> </menupopup> </menulist> menupopup see menulist and menubar popup see popupset popupset be careful regarding keyboard access of popups.
arrowscrollbox - Archive of obsolete content
visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
... properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width disabled type: boolean gets and sets the valu...
bbox - Archive of obsolete content
it is eq
uivalent to using an hbox element with an align attribute set to baseline.
...r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
bindings - Archive of obsolete content
more information is available in the template g
uide.
... properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
broadcaster - Archive of obsolete content
for men
uitems or buttons that just want to have their disabled status set when the feature should be disabled, you should use a command element instead.
...r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
caption - Archive of obsolete content
for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } image type: uri the uri of the image to appear on the element.
...for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
content - Archive of obsolete content
cuando use un árbol con los atributos flags ("banderas"), establezca dont-b
uild-content, ("no almacenar contenido"), use treeitem en su lugar.
...if set, the conditions will only match if the template b
uilder is parsing content for an element directly inside this tag.
dialogheader - Archive of obsolete content
for example, for a men
uitem in a menu you can add the following css rule when you want to use the value none: menupopup > men
uitem, menupopup > menu { max-width: none; } description type: string descriptive text to appear in addition to the dialog title.
... properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyatt...
grid - Archive of obsolete content
the second column is twice as big as the first column --> <groupbox> <caption label="details"/> <grid> <columns> <column flex="1"/> <column flex="2"/> </columns> <rows> <row> <label value="user name"/> <textbox id="user"/> </row> <row> <label value="group"/> <menulist> <menupopup> <men
uitem label="accounts"/> <men
uitem label="sales" selected="true"/> <men
uitem label="support"/> </menupopup> </menulist> </row> </rows> </grid> </groupbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir...
...r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
hbox - Archive of obsolete content
this is eq
uivalent to the box element, except it defaults to horizontal orientation.
...r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
keyset - Archive of obsolete content
visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
... properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytag...
listbox - Archive of obsolete content
visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not req
uire validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
listhead - Archive of obsolete content
visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
... inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
notification - Archive of obsolete content
for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not req
uire validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
popupset - Archive of obsolete content
examples <popupset> <menupopup id="clipmenu"> <men
uitem label="cut"/> <men
uitem label="copy"/> <men
uitem label="paste"/> </menupopup> </popupset> <label value="right click for popup" context="clipmenu"/> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxhe...
...ight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), com...
preference - Archive of obsolete content
visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...in this case the actual value to be displayed in the
ui is obtained from the defaultvalue property.
radiogroup - Archive of obsolete content
visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not req
uire validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
richlistbox - Archive of obsolete content
visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not req
uire validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
scale - Archive of obsolete content
visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not req
uire validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
separator - Archive of obsolete content
it is functionally eq
uivalent to a spacer except it defaults to a small size (usually 1.5 ems).
...r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
statusbar - Archive of obsolete content
it is virtually eq
uivalent to a standard box, but may be rendered differently.
... inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blu...
toolbaritem - Archive of obsolete content
examples <toolbaritem> <menulist label="bus"> <menupopup> <men
uitem label="car"/> <men
uitem label="taxi"/> <men
uitem label="bus" selected="true"/> <men
uitem label="train"/> </menupopup> </menulist> </toolbaritem> <toolbaritem id="sample-toolbutton-unified"> <toolbarbutton id="myext-button1" class="toolbarbutton-1" label="label1" /> <toolbarbutton id="myext-button2" class="toolbarbutton-1" label="labe2l" /...
...r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
toolbarseparator - Archive of obsolete content
it is functionally eq
uivalent to a normal separator but some themes may apply a different appearance.
... inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blu...
vbox - Archive of obsolete content
this is eq
uivalent to the box element, except it defaults to vertical orientation.
...r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
wizardpage - Archive of obsolete content
for an editable men
uitem element the value of this attribute is copied to the menulist.value property upon user selection of the men
uitem.
... inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlis...
NPStream - Archive of obsolete content
syntax typedef struct _npstream { void* pdata; /* plug-in private data */ void* ndata; /* netscape private data */ const char* url;
uint32 end;
uint32 lastmodified; void* notifydata; const char *headers; } npstream; fields the data structure has the following fields: plug-in-private value that the plug-in can use to store a pointer to private data associated with the instance; not modified by the browser.
... end offset in bytes of the end of the stream (eq
uivalent to the length of the stream in bytes).
Why Well-Formed Web RSS Module is Popular - Syndicating Your Comments - Archive of obsolete content
an example using the most popular element of the well-formed web rss module is shown below: <?xml version="1.0"> <rss version="2.0" xmlns:wfw="http://wellformedweb.org/commentapi/" > <channel> <title>example</title> <description>an rss example with wfw</description> <lastb
uilddate>sun, 15 may 2005 13:02:08 -0500</lastb
uilddate> <link>http://www.example.com</link> <item> <title>i like root beer</title> <g
uid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:article:54321</g
uid> <pubdate>sun, 15 may 2005 13:02:08 -0500</pubdate> <link>http://www.example.com/article/54321</link> <wfw:commentrss>http://www.example.com/feed/rss/54321/comments</wfw:commentrss> </i...
...tem> <item> <title>rain is wet</title> <g
uid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:article:54320</g
uid> <pubdate>sun, 15 may 2005 10:55:12 -0500</pubdate> <link>http://www.example.com/article/54320</link> <wfw:commentrss>http://www.example.com/feed/rss/54320/comments</wfw:commentrss> </item> <item> <title>huh?!</title> <g
uid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:article:54319</g
uid> <pubdate>sun, 15 may 2005 08:14:11 -0500</pubdate> <link>http://www.example.com/article/54319</link> <wfw:commentrss>http://www.example.com/feed/rss/54319/comments</wfw:commentrss> </item> </channel> </rss> the <wfw:commentrss> element is the reason that the well-formed web rss module is popular.
Syndicating content with RSS - Archive of obsolete content
this article provides a simple g
uide to using rss to syndicate web content.
...(other sizes and colors, along with their source files, are available too.) advanced syndication techniques although this advanced technique for syndication is not req
uired, support of this is recommended, especially for web sites and applications with high performance needs.
Getting Started - Archive of obsolete content
it g
uides you, step-by-step, through the basics of rss and shows you working examples in action.
...however, those experienced with rss may also find this useful as an aid in filling in any missing information about rss that they were not aware of, or as a refresher g
uide.
Proposal - Archive of obsolete content
draft exists source g
uid when an rss item is posted in response to a previous item (called the source item) rss 2.0 offers the source element which allows the item to refer to the rss feed which contains the source item.
... the sg
uid specification provides a more granular approach by offering an sourceref element which can reference the g
uid permalink of the source.
0.90 - Archive of obsolete content
ink> </item> <item> <title>bugzilla reorganized</title> <link>http://www.mozilla.org/bugs/</link> </item> <item> <title>mozilla party, 2.0!</title> <link>http://www.mozilla.org/party/1999/</link> </item> <item> <title>unix platform parity</title> <link>http://www.mozilla.org/b
uild/unix.html</link> </item> <item> <title>npl 1.0m published</title> <link>http://www.mozilla.org/npl/npl-1.0m.html</link> </item> </rdf:rdf> note that here, rss is being used to list sections of the web site.
... specification the original rss 0.90 specification has disappeared from its original location: http://my.netscape.com/publish/help/q
uickstart.html copies of it have been saved, and can be viewed at the following locations: http://www.purplepages.ie/rss/netscape/rss0.90.html http://web.archive.org/web/*/http://...
uickstart.html ...
Threats - Archive of obsolete content
link: red hat certificate system common criteria certification 8.1: deployment, planning, and installation original document information author(s): joint task force transformation initiative title: national institute of standards and technology (nist) special publication 800-30 revision 1, g
uide for conducting risk assessments last updated date: september 2012 copyright information: this document is not subject to copyright.
... original document information author(s): karen scarfone, wayne jansen, and miles tracy title: national institute of standards and technology (nist) special publication 800-123, g
uide to general server security last updated date: july 2008 copyright information: this document is not subject to copyright.
install.rdf - Archive of obsolete content
copy the following text and paste it into a text file, then save that file as "install.rdf": <?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>{themes_u
uid}</em:id> <em:version>themes_version</em:version> <!-- target application this extension can install into, with minimum and maximum supported versions.
... --> <em:targetapplication> <description> <!-- firefox's u
uid --> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>min_ff_version</em:minversion> <em:maxversion>max_ff_version</em:maxversion> </description> </em:targetapplication> <!-- front end metadata --> <!-- my_theme --> <em:name>my_theme</em:name> <em:description>my_theme</em:description> <em:creator>your_name</em:creator> <em:contributor>contributors_names</em:contributor> <em:homepageurl>themes_homepage</em:homepageurl> <em:updateurl> url_of_update_location </em:updateurl> <em:abouturl> url_of_about_page </em:abouturl> <!-- front end integration hooks (used by theme manager)--> <em:internalname>my_theme</em:internalname> </description> </rdf> ...
Theme changes in Firefox 3 - Archive of obsolete content
note: we could use an article called updating themes for firefox 3 that would serve as a how-to g
uide for updating themes.
... browser changes req
uiring theme updates there are a number of changed and deleted files in the browser that may req
uire you to make changes to your theme.
Using the W3C DOM - Archive of obsolete content
using w3c standards means that code will run in compliant browsers with minimal need for cross-browser support, whereas code based on proprietary standards req
uires much more effort to be compatible with multiple user agents.
... css 1 and css 2.x specifications req
uire that non-zero values must be specified with a length unit; otherwise, the css declaration will be ignored.
-ms-scroll-translation - Archive of obsolete content
remarks this property req
uires windows 8 or later.
... the default css templates for windows apps using javascript, "
ui-light.css" and "
ui-dark.css", set this property to vertical-to-horizontal by default on the <html> element.
-ms-scrollbar-arrow-color - Archive of obsolete content
; border-style: solid; border-width: thin; font-family: sans-serif; float: left; margin-right: 10px; } .bluescrollbox { scrollbar-face-color: blue; scrollbar-arrow-color: blue; } .greenscrollbox { scrollbar-face-color: green; scrollbar-arrow-color: green; } <body> <div class="bluescrollbox"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh e
uismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
... </div> <div class="greenscrollbox"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh e
uismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
-ms-scrollbar-base-color - Archive of obsolete content
w-y: scroll; font-family: sans-serif; float: left; margin-right: 10px; } .aquascroll { scrollbar-base-color: aqua; scrollbar-arrow-color: blue; border-color: blue; } .bisquescroll { scrollbar-base-color: bisque; scrollbar-arrow-color: red; border-color: red; } <body> <div class="aquascroll"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh e
uismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
... </div> <div class="bisquescroll"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh e
uismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
-ms-scrollbar-face-color - Archive of obsolete content
; border-style: solid; border-width: thin; font-family: sans-serif; float: left; margin-right: 10px; } .bluescrollbox { scrollbar-face-color: blue; scrollbar-arrow-color: blue; } .greenscrollbox { scrollbar-face-color: green; scrollbar-arrow-color: green; } <body> <div class="bluescrollbox"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh e
uismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
... </div> <div class="greenscrollbox"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh e
uismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
-ms-scrollbar-highlight-color - Archive of obsolete content
{ -ms-scrollbar-highlight-color: aqua; -ms-scrollbar-face-color: blue; -ms-scrollbar-arrow-color: blue; border-color: blue; } .redscroll { -ms-scrollbar-highlight-color: bisque; -ms-scrollbar-face-color: red; -ms-scrollbar-arrow-color: red; border-color: red; } <body> <div class="bluescroll"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh e
uismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
... </div> <div class="redscroll"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh e
uismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
-ms-scrollbar-track-color - Archive of obsolete content
{ -ms-scrollbar-highlight-color: aqua; -ms-scrollbar-face-color: blue; -ms-scrollbar-arrow-color: blue; border-color: blue; } .redscroll { -ms-scrollbar-highlight-color: bisque; -ms-scrollbar-face-color: red; -ms-scrollbar-arrow-color: red; border-color: red; } <body> <div class="bluescroll"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh e
uismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
... </div> <div class="redscroll"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh e
uismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
E4X for templating - Archive of obsolete content
security considerations, such as escaping with the above), e4x content using such functions can also be easily serialized inline (and then perhaps converted to the dom) as needed: var list = <>{_if(elems.length(), function () <> <markup/> <markup/> </>)}</>.toxmlstring(); iterating functions such as the following foreach (which can work with arrays, objects, or e4x objects) are q
uite convenient in iterating over complex structures such as e4x would not normally allow.
...llist[k]); } } arr.sort(h).foreach(function (item) { if (typeof item === 'xml') { ret += item; } else if (typeof item === 'string') { ret += new xml(item); } else { var ser = (new xmlserializer()).serializetostring(item); ret += new xml(ser); } }); return ret; } example: var fr
uits = <fr
uits> <item>pear</item> <item>banana</item> <item>grapes</item> </fr
uits>; alert( // using a javascript 1.8 expression closure <output> {sort(fr
uits.*, function (a, b) a.text() > b.text() /* text() call may not be necessary */ )} </output>.toxmlstring() ); /* <output> <item>banana</item> <item>grapes</item> <item>pear</item> </output> */ the above utility also wor...
Processing XML with E4X - Archive of obsolete content
var b = 'he said "don\'t go there."'; var el = <foo a={b}/>; alert(el.toxmlstring()); // gives: <foo a="he said "don't go there.""/> less than and ampersand signs are escaped into their entity eq
uivalents.
...contin
uing the above example, we can access an xmllist of the <lang> elements in the page as follows: var langs = languages.lang; xmllist provides a length() method which can be used to find the number of contained elements: alert(languages.lang.length()); note that unlike javascript arrays length is a method, not a property, and must be called using length().
ArrayBuffer.transfer() - Archive of obsolete content
this is not the exact eq
uivalent of this api because browsers that natively support it are be able to internally use the c++ function realloc() which extends the length of the memory and only copies it to a new location as-needed as opposed to the following pollyfill which always copies the whole thing to a new space of memory, but this function transfers data from one arraybuffer to another arraybuffer.
... if (!arraybuffer.transfer) { arraybuffer.transfer = function(source, length) { if (!(source instanceof arraybuffer)) throw new typeerror('source must be an instance of arraybuffer'); if (length <= source.bytelength) return source.slice(0, length); var sourceview = new
uint8array(source), destview = new
uint8array(new arraybuffer(length)); destview.set(sourceview); return destview.buffer; }; } specifications specification status comment arraybuffer.prototype.transfer proposal draft stage 2 draft ...
Array comprehensions - Archive of obsolete content
the array comprehension syntax was a javascript expression which allowed you to q
uickly assemble a new array based on an existing one.
... var numbers = [1, 2, 3, 4]; var doubled = [for (i of numbers) i * 2]; console.log(doubled); // logs 2,4,6,8 this is eq
uivalent to the following map() operation: var doubled = numbers.map(i => i * 2); comprehensions can also be used to select items that match a particular expression.
Generator comprehensions - Archive of obsolete content
the generator comprehension syntax was a javascript expression which allowed you to q
uickly assemble a new generator function based on an existing iterable object.
...generator comprehensions are syntactically almost identical to array comprehensions — they use parentheses instead of braces— but instead of b
uilding an array they create a generator that can execute lazily.
ActiveXObject - Archive of obsolete content
excelsheet.saveas("c:\\test.xls"); // close excel with the q
uit method on the application object.
... excelsheet.application.q
uit(); req
uirements supported in the following document modes: q
uirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards, internet explorer 11 standards.
Date.getVarDate() - Archive of obsolete content
syntax dateobj.getvardate() parameters the req
uired dateobj reference is a date object.
... req
uirements supported in the following document modes: q
uirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, and internet explorer 10 standards.
Debug.debuggerEnabled - Archive of obsolete content
syntax var dbgenabled = debug.debuggerenabled; req
uirements supported in the following document modes: internet explorer 10 standards and internet explorer 11 standards.
... not supported in the following document modes: q
uirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards.
Debug.msTraceAsyncCallbackStarting - Archive of obsolete content
}, function (error) { debug.mstraceasyncoperationcompleted(opid, debug.ms_async_op_status_error); debug.mstraceasynccallbackstarting(opid); }); debug.mstraceasynccallbackcompleted(); } function dosomethingasync() { return winjs.promise.as(true); } asyncwrapperfunction(); req
uirements supported in the internet explorer 11 standards document mode.
... not supported in the following document modes: q
uirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards.
Debug.msTraceAsyncCallbackCompleted - Archive of obsolete content
}, function (error) { debug.mstraceasyncoperationcompleted(opid, debug.ms_async_op_status_error); debug.mstraceasynccallbackstarting(opid); }); debug.mstraceasynccallbackcompleted(); } function dosomethingasync() { return winjs.promise.as(true); } asyncwrapperfunction(); req
uirements supported in the internet explorer 11 standards document mode.
... not supported in the following document modes: q
uirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards.
Debug.msUpdateAsyncCallbackRelation - Archive of obsolete content
req
uirements supported in the internet explorer 11 standards document mode.
... not supported in the following document modes: q
uirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards.
Debug.setNonUserCodeExceptions - Archive of obsolete content
} })(); req
uirements supported in the following document modes: internet explorer 10 standards and internet explorer 11 standards.
... not supported in the following document modes: q
uirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards.
Enumerator.atEnd - Archive of obsolete content
syntax myenum.atend() remarks the req
uired myenum reference is any enumerator object.
... + " - "; if (drv.isready) { var freegb = drv.freespace / bytespergb; var totalgb = drv.totalsize / bytespergb; s += freegb.tofixed(3) + " gb free of "; s += totalgb.tofixed(3) + " gb"; } else { s += "not ready"; } s += "<br />"; e.movenext(); } return(s); } req
uirements supported in the following document modes: q
uirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, and internet explorer 10 standards.
Enumerator.item - Archive of obsolete content
syntax enumobj.item() remarks the req
uired enumobj reference is any enumerator object.
... + " - "; if (drv.isready) { var freegb = drv.freespace / bytespergb; var totalgb = drv.totalsize / bytespergb; s += freegb.tofixed(3) + " gb free of "; s += totalgb.tofixed(3) + " gb"; } else { s += "not ready"; } s += "<br />"; e.movenext(); } return(s); } req
uirements supported in the following document modes: q
uirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, and internet explorer 10 standards.
nsIPushMessage
method overview domstring text(); jsval json(); void binary([optional] out
uint32_t datalen, [array, retval, size_is(datalen)] out
uint8_t data); methods text() extracts the message data as a utf-8 text string.
... void binary( [optional] out
uint32_t datalen, [array, retval, size_is(datalen)] out
uint8_t data ); parameters datalen the data size.
nsIPushSubscription
method overview void getkey(in domstring name, [optional] out
uint32_t keylen, [array, size_is(keylen), retval] out
uint8_t key); bool quotaapplies(); bool isexpired(); attributes attribute type description endpoint domstring the subscription url.
... void getkey( in domstring name, [optional] out
uint32_t keylen, [array, size_is(keylen), retval] out
uint8_t key ); parameters name the encryption key name.
nsIScriptableIO
file and stream g
uide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream g
uide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...for more details about how to use this object, see the file and stream g
uide.
nsIScriptableUnescapeHTML
this is eq
uivalent to calling nsiparserutils::parsefragment(fragment, 0, isxml, baseuri, element).
... this is eq
uivalent to calling nsiparserutils::converttoplaintext(src, nsidocumentencoder::outputselectiononly | nsidocumentencoder::outputabsolutelinks, 0).
nsISelection2
method overview void getrangesforinterval(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, out pr
uint32 resultcount, [retval, array, size_is(resultcount)] out nsidomrange results); void getrangesforintervalcomarray(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, in rangearray results); native code only!
... void getrangesforinterval( in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, out pr
uint32 resultcount, [retval, array, size_is(resultcount)] out nsidomrange results ); parameters beginnode beginoffset endnode endoffset these four parameters represent the range to compare against the selection.
nsISelectionPrivate
void getrangesforinterval(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, out pr
uint32 resultcount, [retval, array, size_is(resultcount)] out nsidomrange results); void getrangesforintervalarray(in nsinode beginnode, in print32 beginoffset, in nsinode endnode, in print32 endoffset, in boolean allowadjacent, in rangearray results); native code only!
... void getrangesforinterval( in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, out pr
uint32 resultcount, [retval, array, size_is(resultcount)] out nsidomrange results ); parameters beginnode beginoffset endnode endoffset these four parameters represent the range to compare against the selection.
nsISmsRequestManager
notifymarkedmessageread() req
uires gecko 15.0(firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) void notifymarkedmessageread( in long arequestid in bool aread ); parameters arequestid a number representing the id of the request.
... notifymarkmessagereadfailed() req
uires gecko 15.0(firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) void notifymarkmessagereadfailed( in long arequestid in long aerror ); parameters arequestid a number representing the id of the request.
nsIThread
threads have a b
uilt-in event queue, and a thread is an event target that can receive nsirunnable objects (events) to be processed on the thread.
... warning: calling nsithread.processnextevent allows network and
ui events to run which can modify data structures that your code isn't expecting to be modified during a synchronous method call.
nsIUpdateItem
id astring the g
uid of the item.
... void init( in astring id, in astring version, in astring installlocationkey, in astring minappversion, in astring maxappversion, in astring name, in astring downloadurl, in astring xpihash, in astring iconurl, in astring updateurl, in astring updatekey, in long type, in astring targetappid ); parameters id the item's g
uid.
nsIUploadChannel
most implementations of this interface req
uire that the stream: implement threadsafe addref and release implement nsiinputstream.readsegments() implement nsiseekablestream.seek().
...acontenttype if acontenttype is empty, the protocol will assume that no content headers are to be added to the uploaded stream and that any req
uired headers are already encoded in the stream.
nsIWeakReference
method overview void queryreferent( in nsiidref u
uid, [iid_is(u
uid), retval] out nsqiresult result ); methods queryreferent() this method queries an interface on the referent if it exists, and like nsisupports.queryinterface(), produces an owning reference to the desired interface.")}} it is designed to look and act exactly like (a proxied) nsisupports.queryinterface().
...void queryreferent( in nsiidref u
uid, [iid_is(u
uid), retval] out nsqiresult result ); parameters u
uid the u
uid of the requested interface.
nsIWebContentHandlerRegistrar
var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); var htmlcontentwindow = undefined; var registeruri = 'http://mail.live.com/secure/start?action=compose&to=%s'; var myurihostname = services.io.newuri(registeruri, null, null).host; // this section here is long and daunting, but its just finding a s
uitable contentwindow var domwindows = services.wm.getenumerator(null); while (domwindows.hasmoreelements()) { var adomwindow = domwindows.getnext(); if (adomwindow.gbrowser) { if (adomwindow.gbrowser.tabcontainer) { //adomwindow has tabs var tabs = adomwindow.gbrowser.tabcontainer.childnodes; for (var i = 0; i < tabs.length; i++) { ...
....hostname == myurihostname) { htmlcontentwindow = adomwindow.contentwindow; break; } } } else { //adomwindow is a popup window if (adomwindow.location.hostname == myurihostname) { htmlcontentwindow = adomwindow; break; } } } // this section here is long and daunting, but its just finding a s
uitable contentwindow if (!htmlcontentwindow) { throw new error('no s
uitable content window found, will not reigsterprotocolhandler.
nsIWebSocketListener
1.0 66 introduced gecko 8.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void onacknowledge(in nsisupports acontext, in pr
uint32 asize); void onbinarymessageavailable(in nsisupports acontext, in acstring amsg); void onmessageavailable(in nsisupports acontext, in autf8string amsg); void onserverclose(in nsisupports acontext, in unsigned short acode, in autf8string areason); void onstart(in nsisupports acontext); void onstop(in nsisupports acontext, in nsresult astatuscode); ...
...void onacknowledge( in nsisupports acontext, in pr
uint32 asize ); parameters acontext user defined context.
nsIWindowCreator
inherits from: nsisupports last changed in gecko 0.9.6 method overview nsiwebbrowserchrome createchromewindow(in nsiwebbrowserchrome parent, in pr
uint32 chromeflags); methods createchromewindow() create a new window.
...nsiwebbrowserchrome createchromewindow( in nsiwebbrowserchrome parent, in pr
uint32 chromeflags ); parameters parent the nsiwebbrowserchrome of the parent window, if any.
ContentIndex.add() - Web APIs
// our content const item = { id: 'post-1', url: '/posts/amet.html', title: 'amet consectetur adipisicing', description: 'repellat et q
uia iste possimus ducimus aliq
uid a aut eaque nostrum.', icons: [{ src: '/media/dark.png', sizes: '128x128', type: 'image/png', }], category: 'article' }; // our asynchronous function to add indexed content async function registercontent(data) { const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) { return; } ...
... // our content const item = { id: 'post-1', url: '/posts/amet.html', title: 'amet consectetur adipisicing', description: 'repellat et q
uia iste possimus ducimus aliq
uid a aut eaque nostrum.', icons: [{ src: '/media/dark.png', sizes: '128x128', type: 'image/png', }], category: 'article' }; self.registration.index.add(item); specifications specification status comment unknownthe definition of 'add' in that specification.
ContentIndex - Web APIs
// our content const item = { id: 'post-1', url: '/posts/amet.html', title: 'amet consectetur adipisicing', description: 'repellat et q
uia iste possimus ducimus aliq
uid a aut eaque nostrum.', icons: [{ src: '/media/dark.png', sizes: '128x128', type: 'image/png', }], category: 'article' }; // our asynchronous function to add indexed content async function registercontent(data) { const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) { return; } ...
... // register content try { await registration.index.add(data); } catch (e) { console.log('failed to register content: ', e.message); } } retrieving items within the current index the below example shows an asynchronous function that retrieves items within the content index and iterates over each entry, b
uilding a list for the interface.
Credential - Web APIs
the credential interface of the the credential management api provides information about an entity as a prereq
uisite to a trust decision.
...this might be any one of a g
uid, username, or email address.
DOMParser - Web APIs
in the case of an html document, you can also replace portions of the dom with new dom trees b
uilt from html by setting the value of the element.innerhtml and outerhtml properties.
... parameters this method has 2 parameters (both req
uired): string the domstring to be parsed.
Document.getElementsByClassName() - Web APIs
html <span class="orange fr
uit">orange fr
uit</span> <span class="orange j
uice">orange j
uice</span> <span class="apple j
uice">apple j
uice</span> <span class="foo bar">something random</span> <textarea id="resultarea" style="width:98%;height:7em"></textarea> javascript // getelementsbyclassname only selects elements that have both given classes var allorangej
uicebyclass = document.getelementsbyclassname('orange j
uice'); var r...
...esult = "document.getelementsbyclassname('orange j
uice')"; for (var i=0, len=allorangej
uicebyclass.length|0; i<len; i=i+1|0) { result += "\n " + allorangej
uicebyclass[i].textcontent; } // queryselector only selects full complete matches var allorangej
uicequery = document.queryselectorall('.orange.j
uice'); result += "\n\ndocument.queryselectorall('.orange.j
uice')"; for (var i=0, len=allorangej
uicequery.length|0; i<len; i=i+1|0) { result += "\n " + allorangej
uicequery[i].textcontent; } document.getelementbyid("resultarea").value = result; result specifications specification status comment domthe definition of 'document.getelementsbyclassname' in that specification.
DocumentFragment - Web APIs
functionally eq
uivalent to document.getelementbyid().
... example html <ul id="list"></ul> javascript var list = document.queryselector('#list') var fr
uits = ['apple', 'orange', 'banana', 'melon'] var fragment = new documentfragment() fr
uits.foreach(function (fr
uit) { var li = document.createelement('li') li.innerhtml = fr
uit fragment.appendchild(li) }) list.appendchild(fragment) result specifications specification status comment domthe definition of 'documentfragment' in that specification.
DocumentOrShadowRoot.activeElement - Web APIs
donec tincidunt, lorem a porttitor molestie, odio nibh iaculis libero, et accumsan nunc orci eu d
ui.</textarea> <textarea name="ta-example-two" id="ta-example-two" rows="7" cols="40">this is text area two.
...morbi sed e
uismod diam.</textarea> </form> <p>active element id: <b id="output-element"></b></p> <p>selected text: <b id="output-text"></b></p> javascript function onmouseup(e) { const activetextarea = document.activeelement; const selection = activetextarea.value.substring( activetextarea.selectionstart, activetextarea.selectionend ); const outputelement = document.getelementbyid('output-element'); const outputtext = document.getelementbyid('output-text'); outputelement.innerhtml = activetextarea.id; outputtext.innerhtml = selection; } const textarea1 = document.getelementbyid('ta-example-one'); const textarea2 = document.getelementbyid('ta-example-two'); t...
How to create a DOM tree - Web APIs
you can use dom trees to model data which isn't well-s
uited for rdf (or perhaps you just don't like rdf).
... another application is that, since xul is xml, the
ui of your application can be dynamically manipulated, downloaded, uploaded, saved, loaded, converted, or transformed q
uite easily.
Using the W3C DOM Level 1 Core - Web APIs
due to the ubiq
uity of the dom, this api is supported in all major browsers, including mozilla firefox and microsoft internet explorer, and serves as a base for scripting on the web.
...for example, the following document <html> <head> <title>my document</title> </head> <body> <h1>header</h1> <p>paragraph</p> </body> </html> has a dom tree that looks like this: (note that, although the above tree is similar to the above document's dom tree, it's not identical, as the actual dom tree preserves whitespace.) when a web browser parses an html document, it b
uilds a dom tree and then uses it to display the document.
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
in fact, much of our source code is full of these whitespace characters, and we only tend to get rid of it in a production b
uild step to reduce code download sizes.
...these elements behave like inline elements on the outside, and blocks on the inside, and are often used to display more complex pieces of
ui than just text, side-by-side on the same line, for example navigation menu items.
DynamicsCompressorNode.attack - Web APIs
the attack property of the dynamicscompressornode interface is a k-rate audioparam representing the amount of time, in seconds, req
uired to reduce the gain by 10 db.
... it defines how q
uickly the signal is adapted when its volume is increased.
DynamicsCompressorNode.release - Web APIs
the release property of the dynamicscompressornode interface is a k-rate audioparam representing the amount of time, in seconds, req
uired to increase the gain by 10 db.
... it defines how q
uick the signal is adapted when its volume is reduced.
DynamicsCompressorNode - Web APIs
dynamicscompressornode.attack read only is a k-rate audioparam representing the amount of time, in seconds, req
uired to reduce the gain by 10 db.
... dynamicscompressornode.release read only is a k-rate audioparam representing the amount of time, in seconds, req
uired to increase the gain by 10 db.
EXT_disjoint_timer_query - Web APIs
types this extension exposes a new type: gl
uint64ext unsigned 64-bit integer number.
... ext.query_result_ext a gl
uint64ext containing the query result.
EXT_shader_texture_lod - Web APIs
it req
uires glsl #version 300 es.
... glsl b
uilt-in functions the following new functions can be used in glsl shader code, if this extension is enabled: vec4 texture2dlodext(sampler2d sampler, vec2 coord, float lod) vec4 texture2dprojlodext(sampler2d sampler, vec3 coord, float lod) vec4 texture2dprojlodext(sampler2d sampler, vec4 coord, float lod) vec4 texturecubelodext(samplercube sampler, vec3 coord, float lod) vec4 texture2dgradext(sampler2d sampler, vec2 p, vec2 dpdx, vec2 dpdy) vec4 texture2dprojgradext(sampler2d sampler, vec3 p, vec2 dpdx, vec2 dpdy) vec4 texture2dprojgradext(sampler2d sampler, vec4 p, vec2 dpdx, vec2 dpdy) vec4 texturecubegradext(samplercube sampler, vec3 p, vec3 dpdx, vec3 dpdy) examples enabling the extensions: gl.getextension('ext_shader_texture_lod'); shader code that avoids artifacts when ...
EffectTiming.fill - Web APIs
"auto" if the animation effect the fill mode is being applied to is a keyframe effect (keyframeeffect or keyframeeffectreadonly), "auto" is eq
uivalent to "none".
... in order to avoid leaking memory when many filling animations overlap, the browser is req
uired to remove overlapped animations which can lead to surprising results in some cases.
Element.animate() - Web APIs
add dictates an additive effect, where each successive iteration b
uilds on the last.
... iterationcomposite optional determines how values b
uild from iteration to iteration in this animation.
Element.closest() - Web APIs
ere it is the div-03 itself var r3 = el.closest("article > div"); // returns the closest ancestor which is a div and has a parent article, here it is the div-01 var r4 = el.closest(":not(div)"); // returns the closest ancestor which is not a div, here it is the outmost article polyfill for browsers that do not support element.closest(), but carry support for element.matches() (or a prefixed eq
uivalent, meaning ie9+), a polyfill exists: if (!element.prototype.matches) { element.prototype.matches = element.prototype.msmatchesselector || element.prototype.webkitmatchesselector; } if (!element.prototype.closest) { element.prototype.closest = function(s) { var el = this; do { if (element.prototype.matches.call(el, s)) return el; el = el.parentelement || el.p...
...arentnode; } while (el !== null && el.nodetype === 1); return null; }; } however, if you really do req
uire ie 8 support, then the following polyfill will do the job very slowly, but eventually.
Element: error event - Web APIs
bubbles no cancelable no interface event or
uievent event handler property onerror the event object is a
uievent instance if it was generated from a user interface element, or an event instance otherwise.
....queryselector('.bad-img'); badimg.addeventlistener('error', (event) => { log.textcontent = log.textcontent + `${event.type}: loading image\n`; console.log(event) }); const imgerror = document.queryselector('#img-error'); imgerror.addeventlistener('click', () => { badimg.setattribute('src', 'i-dont-exist'); }); result specifications specification status
ui events working draft ...
Element.innerHTML - Web APIs
javascript function log(msg) { var logelem = document.queryselector(".log"); var time = new date(); var timestr = time.tolocaletimestring(); logelem.innerhtml += timestr + ": " + msg + "<br/>"; } log("logging mouse events inside this container..."); the log() function creates the log output by getting the current time from a date object using tolocaletimestring(), and b
uilding a string with the timestamp and the message text.
...e this as the event handler for a number of mouse events on the box that contains our log: var boxelem = document.queryselector(".box"); boxelem.addeventlistener("mousedown", logevent); boxelem.addeventlistener("mouseup", logevent); boxelem.addeventlistener("click", logevent); boxelem.addeventlistener("mouseenter", logevent); boxelem.addeventlistener("mouseleave", logevent); html the html is q
uite simple for our example.
Element: mouseenter event - Web APIs
with deep hierarchies, the number of mouseenter events sent can be q
uite huge and cause significant performance problems.
...using the supplied text var newtextnode = document.createtextnode(text); // create a new li element var newlistitem = document.createelement("li"); // add the text node to the li element newlistitem.appendchild(newtextnode); // add the newly created list item to list unorderedlist.appendchild(newlistitem); } result specifications specification status
ui eventsthe definition of 'mouseenter' in that specification.
Element.requestFullscreen() - Web APIs
currently, the only option is navigation
ui, which controls whether or not to show navigation
ui while the element is in full-screen mode.
... usage notes compatible elements an element that you wish to place into full-screen mode has to meet a small number of simple req
uirements: it must be one of the standard html elements or <svg> or <math>.
Element: select event - Web APIs
bubbles yes cancelable no interface
uievent if generated from a user interface, event otherwise event handler property onselect the event is not available for all elements in all languages.
...lecting some text in this element."> <p id="log"></p> function logselection(event) { const log = document.getelementbyid('log'); const selection = event.target.value.substring(event.target.selectionstart, event.target.selectionend); log.textcontent = `you selected: ${selection}`; } const input = document.queryselector('input'); input.addeventlistener('select', logselection); onselect eq
uivalent you can also set up the event handler using the onselect property: input.onselect = logselection; specifications specification status
ui eventsthe definition of 'select' in that specification.
Comparison of Event Targets - Web APIs
todo: only s
uitable for extension-developers?
... examples <!doctype html> <html> <head> <meta charset="utf-8"> <meta http-eq
uiv="x-ua-compatible" content="ie=edge"> <title>comparison of event targets</title> <style> table { border-collapse: collapse; height: 150px; width: 100%; } td { border: 1px solid #ccc; font-weight: bold; padding: 5px; min-height: 30px; } .standard { background-color: #99ff99; } .non-standard { background-color: #902d37; } </style> </head> <body> <table> <thead> <tr> <td class="standard">original target dispatching the event <small>event.target</small></td> <td class="standard">target w...
Using Fetch - Web APIs
formdata.append('photos', photos.files[i]); } fetch('https://example.com/posts', { method: 'post', body: formdata, }) .then(response => response.json()) .then(result => { console.log('success:', result); }) .catch(error => { console.error('error:', error); }); processing a text file line by line the chunks that are read from a response are not broken neatly at line boundaries and are
uint8arrays, not strings.
...a body is an instance of any of the following types: arraybuffer arraybufferview (
uint8array and friends) blob/file string urlsearchparams formdata the body mixin defines the following methods to extract a body (implemented by both request and response).
FileSystemFileEntry - Web APIs
var bb = new blobb
uilder(); bb.append('meow'); filewriter.write(bb.getblob('text/plain')); }, errorhandler); }, errorhandler); } window.requestfilesystem(window.temporary, 1024*1024, oninitfs, errorhandler); specifications specification status comment file and directory entries apithe definition of 'filesystemfileentry' in that specification.
...not for use in new websites.see implementation notes.see implementation notes.uses a non-standard name.uses a non-standard name.req
uires a vendor prefix or different name for use.req
uires a vendor prefix or different name for use.
FileSystemFlags.exclusive - Web APIs
the exclusive property on the filesystemflags dictionary is used in tandem with the create property to determine whether or not it's acceptable to req
uire that the file not already exist when the reference to it is created by calling filesystemdirectoryentry.getfile() or filesystemdirectoryentry.getdirectory().
...expect behavior to change in the future.see implementation notes.see implementation notes.req
uires a vendor prefix or different name for use.req
uires a vendor prefix or different name for use.
FileSystemFlags - Web APIs
exclusive optional if true, and the create option is also true, the file must not exist prior to iss
uing the call.
...expect behavior to change in the future.see implementation notes.see implementation notes.req
uires a vendor prefix or different name for use.req
uires a vendor prefix or different name for use.
FocusEvent() - Web APIs
syntax var focusevent = new focusevent(typearg[, focuseventinit]); properties the focusevent() constructor also inherits arguments from
uievent() and from event().
... the focuseventinit dictionary also accepts fields from the
uieventinit and eventinit dictionaries.
PaymentResponse.requestId - Web APIs
idfirefox for androidopera for androidsafari on iossamsung internetrequestidchrome full support 61edge full support 16firefox full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... full support yeswebview android no support nochrome android full support 60firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentResponse.shippingAddress - Web APIs
fox for androidopera for androidsafari on iossamsung internetshippingaddresschrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...to change preferences in chrome, visit chrome://flags.firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentResponse.shippingOption - Web APIs
efox for androidopera for androidsafari on iossamsung internetshippingoptionchrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...to change preferences in chrome, visit chrome://flags.firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly b
uilds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
Payment processing concepts - Web APIs
the payer authenticates themselves, then authorizes payment, as req
uired by the payment method.
... functions of a payment handler a user agent may provide b
uilt-in support for certain types of payments.
performance.clearMarks() - Web APIs
performance.mark("sq
uirrel"); performance.mark("sq
uirrel"); performance.mark("monkey"); performance.mark("monkey"); performance.mark("dog"); performance.mark("dog"); logmarkcount() // "found this many entries: 6" // delete just the "sq
uirrel" performancemark entries.
... performance.clearmarks('sq
uirrel'); logmarkcount() // "found this many entries: 4" // delete all of the performancemark entries.
PeriodicWave.PeriodicWave() - Web APIs
options optional a periodicwaveoptions dictionary object defining the properties you want the periodicwave to have (it also inherits the options defined in the periodicwaveconstraints dictionary.): real: a float32array containing the cosine terms that you want to use to form the wave (eq
uivalent to the real parameter of audiocontext.createperiodicwave).
... imag: a float32array containing the sine terms that you want to use to form the wave (eq
uivalent to the imag parameter of audiocontext.createperiodicwave).
Pointer Lock API - Web APIs
more than that, the api is useful for any applications that req
uire significant mouse input to control movements, rotate objects, and change entries, for example allowing users to control the viewing angle simply by moving the mouse around without any button clicking.
...it also includes a check whether a requestanimationframe() call has previously been made, and if so, calls it again as req
uired, and calls the canvasdraw() function that updates the canvas scene.
PublicKeyCredential - Web APIs
var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new
uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var response = newcredentialinfo.response; var clientextensionsresults = newcredentialinfo.getclientextensionresults(); }).catch(function (err) { ...
... var options = { challenge: new
uint8array([/* bytes sent from the server */]) }; navigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'publickeycredential interface' in that specification.
PublicKeyCredentialCreationOptions.pubKeyCredParams - Web APIs
though those elements are sorted by preference (the first element being the most prefered), it is up to the client to choose among those elements for b
uilding the credential.
... examples var publickey = { pubkeycredparams: [ // we would like an elliptic curve to be used if possible { type: "public-key", alg: -7 }, // if not, then we will fallback on an rsa algorithm { type: "public-key", alg: -37 } ], challenge: new
uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new
uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", } }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(functi...
PublicKeyCredentialCreationOptions.user - Web APIs
"jdoe@example.com").this property is intended for display and may be use to disting
uish different account with the same displayname.
... examples var publickey = { challenge: new
uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { // to be changed for each user id: new
uint8array.from(window.atob("laegmlkjnrlkgnamlafalfka="), c=>c.charcodeat(0)); name: "jdoe@example.com", displayname: "john doe", icon: "https://gravatar.com/avatar/jdoe.png" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications ...
PublicKeyCredentialRequestOptions.userVerification - Web APIs
the values may be: "req
uired": user verification is req
uired, the operation will fail if the response does not have the uv flag (as part of authenticatorassertionresponse.authenticatordata) "preferred": user verification is prefered, the operation will not fail if the response does not have the uv flag (as part of authenticatorassertionresponse.authenticatordata) "discouraged": user verification should not be employed a...
... examples var options = { userverification: "preferred", challenge: new
uint8array([/* bytes sent from the server */]), }; navigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'userverification' in that specification.
PublicKeyCredentialRequestOptions - Web APIs
examples var options = { challenge: new
uint8array([/* bytes sent from the server */]), rpid: "example.com", /* will only work if the current domain is something like foo.example.com */ userverification: "preferred", timeout: 60000, // wait for a minute allowcredentials: [ { transports: "usb", type: "public-key", id: new
uint8array(26) // actually provided by the server }, ...
... { transports: "internal", type: "public-key", id: new
uint8array(26) // actually provided by the server } ], extensions: { uvm: true, // rp wants to know how the user was verified loc: false, txauthsimple: "could you please verify yourself?" } }; navigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'publickeycredentialrequestoptions dictionary' in that specification.
PushManager.getSubscription() - Web APIs
serviceworkerregistration.pushmanager.getsubscription() .then(function(subscription) { // enable any
ui which subscribes / unsubscribes from // push messages.
... var pushbutton = document.queryselector('.js-push-button'); pushbutton.disabled = false; if (!subscription) { // we aren’t subscribed to push, so set
ui // to allow the user to enable push return; } // keep your server in sync with the latest subscriptionid sendsubscriptiontoserver(subscription); showcurlcommand(subscription); // set your
ui to show they have subscribed for // push messages pushbutton.textcontent = 'disable push messages'; ispushenabled = true; }) .catch(function(err) { window.demo.debug.log('error during getsubscription()', err); }); }); specifications specification status comment push apithe defi...
PushSubscription.getKey() - Web APIs
example reg.pushmanager.getsubscription() .then(function(subscription) { // enable any
ui which subscribes / unsubscribes from // push messages.
... subbtn.disabled = false; if (!subscription) { console.log('not yet subscribed to push') // we aren't subscribed to push, so set
ui // to allow the user to enable push return; } // set your
ui to show they have subscribed for // push messages subbtn.textcontent = 'unsubscribe from push messaging'; ispushenabled = true; // initialize status, which includes setting
ui elements for subscribed status // and updating subscribers list via push var endpoint = subscription.endpoint; var key = subscription.getkey('p256dh'); var auth = subscription.getkey('auth'); ...
RTCConfiguration.certificates - Web APIs
the rtcconfiguration dictionary's optional certificates property is an array of rtccertificate objects providing the security certificates available for use when authenticating d
uing the connection process.
...one obvious benefit to providing your own is identity key contin
uity—if you use the same certificate for subsequent calls, the remote peer can tell you're the same caller.
WindowOrWorkerGlobalScope.btoa() - Web APIs
for example: // convert a unicode string to a string in which // each 16-bit unit occupies only one byte function tobinary(string) { const codeunits = new
uint16array(string.length); for (let i = 0; i < codeunits.length; i++) { codeunits[i] = string.charcodeat(i); } return string.fromcharcode(...new
uint8array(codeunits.buffer)); } // a string that contains characters occupying > 1 byte const mystring = "☸☹☺☻☼☾☿"; const converted = tobinary(mystring); const encoded = btoa(converted); console.log(encoded); // o...
...cy5jjomoyy8jj4mpyy= if you do this, of course you'll have to reverse the conversion on the decoded string: function frombinary(binary) { const bytes = new
uint8array(binary.length); for (let i = 0; i < bytes.length; i++) { bytes[i] = binary.charcodeat(i); } return string.fromcharcode(...new
uint16array(bytes.buffer)); } const decoded = atob(encoded); const original = frombinary(decoded); console.log(original); // ☸☹☺☻☼☾☿ polyfill you can use a polifill from https://github.com/maxart2501/base64-js/blob/master/base64.js for browsers that don't support it.
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
this[sproperty] : this); }; myarray.mymethod(); // prints "zero,one,two" myarray.mymethod(1); // prints "one" the above works because when mymethod is called, its this is set to myarray by the call, so within the function, this[sproperty] is eq
uivalent to myarray[sproperty].
... settimeout.call(myarray, myarray.mymethod, 2.0*1000); // error: "ns_error_xpc_bad_op_on_wn_proto: illegal operation on wrappednative prototype object" settimeout.call(myarray, myarray.mymethod, 2.5*1000, 2); // same error possible solutions a common way to solve the problem is to use a wrapper function that sets this to the req
uired value: settimeout(function(){myarray.mymethod()}, 2.0*1000); // prints "zero,one,two" after 2 seconds settimeout(function(){myarray.mymethod('1')}, 2.5*1000); // prints "one" after 2.5 seconds arrow functions are a possible alternative, too: settimeout(() => {myarray.mymethod()}, 2.0*1000); // prints "zero,one,two" after 2 seconds settimeout(() => {myarray.mymethod('1')}, 2.5*1000); // prin...
WritableStream.abort() - Web APIs
} }, que
uingstrategy); ...
... // abort the stream later on, when req
uired writablestream.abort(); specifications specification status comment streamsthe definition of 'abort()' in that specification.
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
notes: this code req
uires elevated privileges to run; you can only call it from a browser extension or from a xulrunner application.
... const {cc,ci} = req
uire("chrome"); function createtcperrorfromfailedxhr(xhr) { let status = xhr.channel.queryinterface(ci.nsirequest).status; let errtype; if ((status & 0xff0000) === 0x5a0000) { // security module const nsinsserrorsservice = ci.nsinsserrorsservice; let nsserrorsservice = cc['@mozilla.org/nss_errors_service;1'].getservice(nsinsserrorsservice); let errorclass; // geterrorclass w...
Sending and Receiving Binary Data - Web APIs
var oreq = new xmlhttprequest(); oreq.open("get", "/myfile.png", true); oreq.responsetype = "arraybuffer"; oreq.onload = function (oevent) { var arraybuffer = oreq.response; // note: not oreq.responsetext if (arraybuffer) { var bytearray = new
uint8array(arraybuffer); for (var i = 0; i < bytearray.bytelength; i++) { // do something with each byte in the array } } }; oreq.send(null); you can also read a binary file as a blob by setting the string "blob" to the responsetype property.
... var myarray = new arraybuffer(512); var longint8view = new
uint8array(myarray); // generate some data for (var i=0; i< longint8view.length; i++) { longint8view[i] = i % 256; } var xhr = new xmlhttprequest; xhr.open("post", url, false); xhr.send(myarray); this is b
uilding a 512-byte array of 8-bit integers and sending it; you can use any binary data you'd like, of course.
XMLHttpRequest() - Web APIs
mozsystem boolean: setting this flag to true allows making cross-site connections without req
uiring the server to opt-in using cors.
... req
uires setting mozanon: true, i.e.
XMLHttpRequest.sendAsBinary() - Web APIs
/*\ |*| |*| :: xmlhttprequest.prototype.sendasbinary() polyfill :: |*| |*| https://developer.mozilla.org/docs/dom/xmlhttprequest#sendasbinary() |*| \*/ if (!xmlhttprequest.prototype.sendasbinary) { xmlhttprequest.prototype.sendasbinary = function (sdata) { var nbytes = sdata.length,
ui8data = new
uint8array(nbytes); for (var nidx = 0; nidx < nbytes; nidx++) {
ui8data[nidx] = sdata.charcodeat(nidx) & 0xff; } /* send as arraybufferview...: */ this.send(
ui8data); /* ...or as arraybuffer (legacy)...: this.send(
ui8data.buffer); */ }; } note: it's possible to b
uild this polyfill putting two types of data as argument for send(): an arraybuffer (
ui8data.buf...
...fer – the commented code) or an arraybufferview (
ui8data, which is a typed array of 8-bit unsigned integers – uncommented code).
XRBoundedReferenceSpace.boundsGeometry - Web APIs
syntax bounds = xrreferencespace.boundsgeometry; value the boundsgeometry property is an array of dompointreadonly objects, each of which defines one vertex in a polygon inside which the viewer is req
uired to remain.
... it's important that your content not be designed to req
uire the user to exit the bounds specified by boundsgeometry.
XRInputSource.handedness - Web APIs
this may indicate, for example, an input source which isn't hand-held, such as controls b
uilt into a headset or an input device attached to the head or body.
...ion, frame, refspace) { for (let source of session.inputsources) { if (source.gripspace) { let grippose = frame.getpose(source.gripspace, refspace); if (grippose) { myrenderhandobject(grippose, inputsource.handedness); } } } } this function, which would be called every animation frame (or possibly just periodically, depending on the degree of smoothness req
uired and any performance constraints), scans the list of input sources looking for any which have a gripspace which isn't null.
XRPermissionDescriptor.optionalFeatures - Web APIs
syntax xrpermissiondescriptor = { mode: xrsessionmode, req
uiredfeatures: reqfeaturelist, optionalfeatures: optfeaturelist }; xrpermissiondescriptor.optionalfeatures = optfeaturelist; optfeaturelist = xrpermissiondescriptor.optionalfeatures; value an array of strings taken from the xrreferencespacetype enumerated type, indicating set of features that your app would like to use, but can operate without if permission to use them isn't available.
... while further features may be defined in future editions of webxr, currently all permitted values come from the xrreferencespacetype enumerated type, indicating reference spaces the app rq
uires to be available.
XRReferenceSpace - Web APIs
reset the reset event is sent to an xrreferencespace object when the browser detects a discontin
uity has occurred wherein the tracked object's origin relative to the user's environment or location.
...*/ }); the other situation in which you may need to acq
uire a new reference space is if you need to move the origin to a new position; this is commonly done, for example, when your project allows the user to move through the environment using input devices such as the keyboard, mouse, touchpad, or game controls that are not connected through the xr device.
XRSessionMode - Web APIs
the environmentblendmode is expected to be opaque if possible, but might be additive if the hardware req
uires it.
...inline sessions don't req
uire special hardware and should be avalable on any user agent offering webxr api support.
Using the group role - Accessibility
<div role="menu"> <ul role="group"> <li role="men
uitem">inbox</li> <li role="men
uitem">archive</li> <li role="men
uitem">trash</li> </ul> <ul role="group"> <li role="men
uitem">custom folder 1</li> <li role="men
uitem">custom folder 2</li> <li role="men
uitem">custom folder 3</li> </ul> <ul role="group"> <li role="men
uitem">new folder</li> </ul> </div> working examples: file directory treeview example using com...
... aria attributes used group related aria techniques region role compatibility tbd: add support information for common ua and at product combinations additional resources aria authoring practices – accessible name g
uidance by role – group ...
Using ARIA: Roles, states, and properties - Accessibility
roles widget roles button checkbox gridcell link men
uitem men
uitemcheckbox men
uitemradio option progressbar radio scrollbar searchbox separator (when focusable) slider spinbutton switch tab tabpanel textbox treeitem composite roles the techniques below describe each composite role as well as their req
uired and optional child roles.
...og marquee status timer window roles alertdialog dialog states and properties widget attributes aria-autocomplete aria-checked aria-current aria-disabled aria-errormessage aria-expanded aria-haspopup aria-hidden aria-invalid aria-label aria-level aria-modal aria-multiline aria-multiselectable aria-orientation aria-placeholder aria-pressed aria-readonly aria-req
uired aria-selected aria-sort aria-valuemax aria-valuemin aria-valuenow aria-valuetext live region attributes aria-live aria-relevant aria-atomic aria-busy drag & drop attributes aria-dropeffect aria-dragged relationship attributes aria-activedescendant aria-colcount aria-colindex aria-colspan aria-controls aria-describedby aria-details aria-errormessage aria-f...
column-width - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toblock containers except table wrapper boxesinheritednocomputed valuethe absolute length, zero or largeranimation typea length formal syntax <length> | auto examples setting column width in pixels html <p class="content-box"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh e
uismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
... ut wisi enim ad minim veniam, q
uis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliq
uip ex ea commodo consequat.
content - CSS: Cascading Style Sheets
accessibility support for css generated content – tink explanation of wcag, g
uideline 1.3 – mdn understanding success criterion 1.3.1 | w3c understanding wcag 2.0 formal definition initial valuenormalapplies to::before and ::after pseudo-elementsinheritednocomputed valueon elements, always computes to normal.
... html <h1>5</h1> <p>according to sir tim berners-lee, <q cite="http://www.w3.org/people/berners-lee/faq.html#internet">i was lucky enough to invent the web at the time when the internet already existed - and had for a decade and a half.</q> we must understand that there is nothing fundamentally wrong with b
uilding on the contributions of others.
cross-fade() - CSS: Cascading Style Sheets
fade(url(white.png), url(black.png), 25%); /* 25% white, 75% black */ cross-fade(url(white.png), url(black.png), 50%); /* 50% white, 50% black */ cross-fade(url(white.png), url(black.png), 75%); /* 75% white, 25% black */ cross-fade(url(white.png), url(black.png), 100%); /* fully white */ in the implemented syntax, the two comma-separated images are declared first, followed by a comma and req
uired percent value.
... mdn understanding wcag, g
uideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 formal syntax cross-fade( <cf-mixing-image> , <cf-final-image>?
element() - CSS: Cascading Style Sheets
examples these examples can be viewed live in b
uilds of firefox that support -moz-element().
...expect behavior to change in the future.see implementation notes.see implementation notes.req
uires a vendor prefix or different name for use.req
uires a vendor prefix or different name for use.
flex-wrap - CSS: Cascading Style Sheets
the cross-start is either eq
uivalent to start or before depending on the flex-direction value.
...the cross-start is either eq
uivalent to start or before depending flex-direction value and the cross-end is the opposite of the specified cross-start.
font-variant-east-asian - CSS: Cascading Style Sheets
possible values are: keyword standard defining the glyphs opentype eq
uivalent jis78 jis x 0208:1978 jp78 jis83 jis x 0208:1983 jp83 jis90 jis x 0208:1990 jp90 jis04 jis x 0213:2004 jp04 simplified none, use the simplified chinese glyphs smpl traditional none, use the traditional chinese glyphs trad <east-asian-width-values> these values...
...letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | [ <east-asian-variant-values> || <east-asian-width-values> || ruby ]where <east-asian-variant-values> = [ jis78 | jis83 | jis90 | jis04 | simplified | traditional ]<east-asian-width-values> = [ full-width | proportional-width ] examples setting east asian glyph variants this example req
uire font "yu gothic" installed in your os, other fonts may not support opentype features.
image-set() - CSS: Cascading Style Sheets
mdn understanding wcag, g
uideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 specifications specification status comment css images module level 4the definition of 'the image-set() notation' in that specification.
... prefixed implemented with the vendor prefix: -webkit-legend full support full support partial support partial support no support no supportsee implementation notes.see implementation notes.req
uires a vendor prefix or different name for use.req
uires a vendor prefix or different name for use.
list-style-type - CSS: Cascading Style Sheets
note that: some types req
uire a s
uitable font installed to display as expected.
... ul { list-style: none; } ul li::before { content: "\200b"; } voiceover and list-style-type: none – unfettered thoughts mdn understanding wcag, g
uideline 1.3 explanations understanding success criterion 1.3.1 | w3c understanding wcag 2.0 formal definition initial valuediscapplies tolist itemsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax <counter-style> | <string> | nonewhere <counter-style> = <counter-style-name> | symbols()where <counter-style-name> = <custom-ident> examples setting list item markers ht...
mask-size - CSS: Cascading Style Sheets
contain a keyword that scales the image as large as possible and maintains image aspect ratio (image doesn't get sq
uished).
...scales the image as large as possible and maintains image aspect ratio (image doesn't get sq
uished).
max-block-size - CSS: Cascading Style Sheets
that is, if the writing direction is horizontal, then max-block-size is eq
uivalent to max-height; if the writing direction is vertical, max-block-size is the same as max-width.
... how writing-mode affects directionality the values of writing-mode affect the mapping of max-block-size to max-width or max-height as follows: values of writing-mode max-block-size is eq
uivalent to horizontal-tb, lr , lr-tb , rl , rb , rb-rl max-height vertical-rl, vertical-lr, sideways-rl , sideways-lr , tb , tb-rl max-width the writing-mode values sideways-lr and sideways-rl were removed from the css writing modes level 3 specification late in its design process.
max-height - CSS: Cascading Style Sheets
mdn understanding wcag, g
uideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 formal definition initial valuenoneapplies toall elements but non-replaced inline elements, table columns, and column groupsinheritednopercentagesthe percentage is calculated with respect to the height of the generated box's containing block.
...expect behavior to change in the future.see implementation notes.see implementation notes.uses a non-standard name.uses a non-standard name.req
uires a vendor prefix or different name for use.req
uires a vendor prefix or different name for use.
opacity - CSS: Cascading Style Sheets
in order to meet current web content accessibility g
uidelines (wcag), a ratio of 4.5:1 is req
uired for text content and 3:1 for larger text such as headings.
... webaim: color contrast checker mdn understanding wcag, g
uideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal definition initial value1.0applies toall elementsinheritednocomputed valuethe specified value, clipped in the range [0,1]animation typea number formal syntax <alpha-value>where <alpha-value> = <number> | <percentage> examples setting background opacity html <div class="light">you can barely see this.</div> <div class="medium">this is easier to see.</div> <div class="heavy">this is very easy to see.</div> css div { background-color: yellow; } .light { opacity: 0.2; /* barely see the text over the background */ } .medium { opacity: 0.5; /* see the t...
repeating-conic-gradient() - CSS: Cascading Style Sheets
the following two gradients are eq
uivalent repeating-conic-gradient(red, orange, yellow, green, blue 50%); repeating-conic-gradient(from -45deg, red 45deg, orange, yellow, green, blue 225deg) by default, colors transition smoothly from the color at one color stop to the color at the subsequent color stop, with the midpoint between the colors being the half way point between the color transition.
... mdn understanding wcag, g
uideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 examples black and white starburst div { width: 200px; height: 200px; } <div></div> div { background-image: repeating-conic-gradient(#fff 0 9deg, #000 9deg 18deg); } off-centered gradient this gradient repeats 18 times, but since we only see the right half, we only see 9 repeats.
<resolution> - CSS: Cascading Style Sheets
due to the 1:96 fixed ratio of css in to css px, 1dppx is eq
uivalent to 96dpi, which corresponds to the default resolution of images displayed in css as defined by image-resolution.
...0 the unit is req
uired.
ruby-position - CSS: Cascading Style Sheets
erimentalchrome no support noedge no support 12 — 79firefox full support 38ie no support nonotes no support nonotes notes internet explorer 9 and later support an old draft values: inline (eq
uivalent of having display: inline on the ruby), and above (synonym of the modern over).opera no support nosafari no support nonotes no support nonotes notes safari implements a non-standard, prefixed, version of ruby-position, -webkit-ruby-position: it has two prop...
...erties: before and after (both eq
uivalent, for ltr and rtl scripts to the standard over value used with ruby-align: start).webview android no support nochrome android no support nofirefox android full support 38opera android no support nosafari ios no support nonotes no support nonotes notes safari implements a non-standard, prefixed, version of ruby-position, -webkit-ruby-position: it has two properties: before and after (both eq
uivalent, for ltr and rtl scripts to the standard over value used with ruby-align: start).samsung...
text-combine-upright - CSS: Cascading Style Sheets
] examples digits the digits value req
uires less markup than the all value when digits are being combined, but it is currently not very widely supported by browsers.
... html <p lang="ja" class="exampletext">平成20年4月16日に</p> css .exampletext { writing-mode: vertical-lr; text-combine-upright: digits 2; font: 36px serif; } results screenshotlive sample all the all value req
uires markup around every piece of horizontal text, but it is currently supported by more browsers than the digits value.
text-indent - CSS: Cascading Style Sheets
&& each-line?where <length-percentage> = <length> | <percentage> examples simple indent html <p>lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh e
uismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p> <p>lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh e
uismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p> css p { text-indent: 5em; background: powderblue; } result percentage indent html <p>lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy n...
...ibh e
uismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p> <p>lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh e
uismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p> css p { text-indent: 30%; background: plum; } result specifications specification status comment css text module level 3the definition of 'text-indent' in that specification.
touch-action - CSS: Cascading Style Sheets
the touch-action css property sets how an element's region can be manipulated by a touchscreen user (for example, by zooming features b
uilt into the browser).
... mdn understanding wcag, g
uideline 1.4 explanations understanding success criterion 1.4.4 | understanding wcag 2.0 formal definition initial valueautoapplies toall elements except: non-replaced inline elements, table rows, row groups, table columns, and column groupsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | none | [ [ pan-x | pan-left | pan-right ] | [ pan-y | pan-up | pan-down ] ...
matrix3d() - CSS: Cascading Style Sheets
quos quaerat sit soluta, q
uisquam exercitationem delectus q
ui unde in facere necessitatibus aut q
uia porro dolorem nesciunt enim, at consequuntur aliquam esse?
... </div> css html { width: 100%; } body { height: 100vh; /* centering content */ display: flex; flex-flow: row wrap; justify-content: center; align-content: center; } .foo { width: 50%; padding: 1em; color: white; background: #ff8c66; border: 2px dashed black; text-align: center; font-family: system-
ui, sans-serif; font-size: 14px; /* setting up animation for better demonstration */ animation: motionscale 2s alternate linear infinite; } @keyframes motionscale { from { /* identity matrix is used as basis here.
transition-timing-function - CSS: Cascading Style Sheets
ease-out equal to cubic-bezier(0, 0, 0.58, 1.0), starts transitioning q
uickly, slowing down the transition continues.
... step-start equal to steps(1, jump-start) step-end equal to steps(1, jump-end) accessibility concerns some animations can be helpful such as to g
uide users to understand what actions are expected, to show relationships within the user interface, and to inform users as to what actions have occurred.
url() - CSS: Cascading Style Sheets
quotes are req
uired if the url includes parentheses, whitespace, or quotes, unless these characters are escaped, or if the address includes control characters above 0x7e.
...the following are all valid and eq
uivalent: <css_property>: url("https://example.com/image.png") <css_property>: url('https://example.com/image.png') <css_property>: url(https://example.com/image.png) path references the id of an svg shape -- circle, ellipse, line, path, polygon, polyline, or rect -- using the shape's geometry as the path.
will-change - CSS: Cascading Style Sheets
these kinds of optimizations can increase the responsiveness of a page by doing potentially expensive work before they are actually req
uired.
...then the browser can choose to apply any ahead-of-time optimizations req
uired for the property change before the property change actually happens.
Demos of open web technologies
graphics canvas blob sallad: an interactive blob using javascript and canvas (code demos) 3d raycaster processing.js p5js 3d on 2d canvas minipaint: image editor (source code) zen photon garden (source code) multi touch in canvas demo (source code) svg bubblemenu (visual effects and interaction) html transformations using foreignobject (visual effects and transforms) phonetics g
uide (interactive) 3d objects demo (interactive) blobular (interactive) video embedded in svg (or use the local download) summer html image map creator (source code) video video 3d animation "mozilla constantly evolving" video 3d animation "floating dance" streaming anime, movie trailer and interview billy's browser firefox flick virtual barber shop transformers movie trailer a scanne...
...r darkly movie trailer (with b
uilt in controls) events firing and volume control dragable and sizable videos 3d graphics webgl web audio fireworks ioquake3 (source code) escher puzzle (source code) kai 'opua (source code) virtual reality the polar sea (source code) sechelt fly-through (source code) css css zen garden css floating logo "mozilla" paperfold css blockout rubik's cube pure css slides planetarium (source code) loader with blend modes text reveal with clip-path ambient shadow with custom properties luminiscent vial css-based single page application (source code) transformations impress.js (source code) games ioquake3 (source code) kai 'opua (source code) web apis notifications api html5 notifications (source code) web audio ...
HTML attribute: accept - HTML: Hypertext Markup Language
wordprocessingml.document"> whereas if you're accepting a media file, you may want to be include any format of that media type: <input type="file" id="soundfile" accept="audio/*"> <input type="file" id="videofile" accept="video/*"> <input type="file" id="imagefile" accept="image/*"> the accept attribute doesn't validate the types of the selected files; it simply provides hints for browsers to g
uide users towards selecting the correct file types.
... because of this, you should make sure that expected req
uirement is validated server-side.
disabled - HTML: Hypertext Markup Language
because a disabled field cannot have it's value changed, req
uired does not have any effect on inputs with the disabled attribute also specified.
... note: the req
uired attribute is not permitted on inputs with the disabled attribute specified.
HTML attribute: minlength - HTML: Hypertext Markup Language
once submission fails, some browsers will display an error message indicating the minimum length req
uired and the current length.
... <label for="fr
uit">enter a fr
uit name that is at least 5 letters long</label> <input type="text" minlength="5" id="fr
uit"> we can use pseudoclasses to style the element based on whether the value is valid.
Closures - JavaScript
at first glance, it might seem unint
uitive that this code still works.
...ll name'}, {'id': 'age', 'help': 'your age (you must be over 16)'} ]; for (let i = 0; i < helptext.length; i++) { let item = helptext[i]; document.getelementbyid(item.id).onfocus = function() { showhelp(item.help); } } } setuphelp(); this example uses let instead of var, so every closure binds the block-scoped variable, meaning that no additional closures are req
uired.
Concurrency model and the event loop - JavaScript
this model is q
uite different from models in other languages like c and java.
...in the example below, the message ''this is just a message'' will be written to the console before the message in the callback gets processed, because the delay is the minimum time req
uired for the runtime to process the request (not a guaranteed time).
Grammar and types - JavaScript
parseint('101', 2) // 5 an alternative method of retrieving a number from a string is with the + (unary plus) operator: '1.1' + '1.1' // '1.11.1' (+'1.1') + (+'1.1') // 2.2 // note: the parentheses are added for clarity, not req
uired.
...to learn more about javascript's language constructs, see also the following chapters in this g
uide: control flow and error handling loops and iteration functions expressions and operators in the next chapter, we will have a look at control flow constructs and error handling.
Loops and iteration - JavaScript
« previousnext » loops offer a q
uick and easy way to do something repeatedly.
... this chapter of the javascript g
uide introduces the different iteration statements available to javascript.
Text formatting - JavaScript
'\xa9' // "©" unicode escape sequences the unicode escape sequences req
uire at least four hexadecimal digits following \u.
... you should use string literals unless you specifically need to use a string object, because string objects can have counterint
uitive behavior.
Working with objects - JavaScript
// two variables, two distinct objects with the same properties var fr
uit = {name: 'apple'}; var fr
uitbear = {name: 'apple'}; fr
uit == fr
uitbear; // return false fr
uit === fr
uitbear; // return false // two variables, a single object var fr
uit = {name: 'apple'}; var fr
uitbear = fr
uit; // assign fr
uit object reference to fr
uitbear // here fr
uit and fr
uitbear are pointing to same object fr
uit == fr
uitbear; // return true fr
uit === fr
uitbear; // return true fr
uit.nam...
...e = 'grape'; console.log(fr
uitbear); // output: { name: "grape" }, instead of { name: "apple" } for more information about comparison operators, see comparison operators.
JavaScript technologies overview - JavaScript
a prototype-based inheritance mechanism b
uilt-in objects and functions (json, math, array.prototype methods, object introspection methods, etc.) strict mode browser support as of october 2016, the current versions of the major web browsers implement ecmascript 5.1 and ecmascript 2015, but older versions (still in use) implement ecmascript 5 only.
... the html specification also defines restrictions on documents; for example, it req
uires all children of a <ul> element, which represents an unordered list, to be <li> elements, as those represent list items.
extends - JavaScript
} description the extends keyword can be used to subclass custom classes as well as b
uilt-in objects.
... this.name = 'square'; } get area() { return this.height * this.width; } } using extends with b
uilt-in objects this example extends the b
uilt-in date object.
Classes - JavaScript
classes in js are b
uilt on prototypes but also have some syntax and semantics that are not shared with es5 classalike semantics.
...support in browsers is limited, but the feature can be used through a b
uild step with systems like babel.
TypeError: More arguments needed - JavaScript
message typeerror: argument is not an object and is not null (edge) typeerror: object.create req
uires at least 1 argument, but only 0 were passed typeerror: object.setprototypeof req
uires at least 2 arguments, but only 0 were passed typeerror: object.defineproperties req
uires at least 1 argument, but only 0 were passed error type typeerror.
... examples req
uired arguments not provided the object.create() method req
uires at least one argument and the object.setprototypeof() method req
uires at least two arguments: var obj = object.create(); // typeerror: object.create req
uires at least 1 argument, but only 0 were passed var obj = object.setprototypeof({}); // typeerror: object.setprototypeof req
uires at least 2 arguments, but only 1 were passed you can fix this by setting null as the prototype, for example: var obj = object.create(null); var obj = object.setprototypeof({}, null); ...
TypeError: "x" is (not) "y" - JavaScript
also, certain methods, such as object.create() or symbol.keyfor(), req
uire a specific type, that must be provided.
... examples invalid cases // undefined and null cases on which the substring method won't work var foo = undefined; foo.substring(1); // typeerror: foo is undefined var foo = null; foo.substring(1); // typeerror: foo is null // certain methods might req
uire a specific type var foo = {} symbol.keyfor(foo); // typeerror: foo is not a symbol var foo = 'bar' object.create(foo); // typeerror: "foo" is not an object or null fixing the issue to fix null pointer to undefined values, you can use the typeof operator, for example.
JavaScript error reference - JavaScript
errors displayed in the web console may include a link to the corresponding page below to help you q
uickly comprehend the problem in your code.
...use //# insteadsyntaxerror: a declaration in the head of a for-of loop can't have an initializersyntaxerror: applying the "delete" operator to an unqualified name is deprecatedsyntaxerror: for-in loop head declarations may not have initializerssyntaxerror: function statement req
uires a namesyntaxerror: identifier starts immediately after numeric literalsyntaxerror: illegal charactersyntaxerror: invalid regular expression flag "x"syntaxerror: missing ) after argument listsyntaxerror: missing ) after conditionsyntaxerror: missing : after property idsyntaxerror: missing ; before statementsyntaxerror: missing = in const declarationsyntaxerror: missing ] after element listsynta...
Array.prototype.flatMap() - JavaScript
it is identical to a map() followed by a flat() of depth 1, but flatmap() is often q
uite useful, as merging both into one method is slightly more efficient.
... alternative reduce() and concat() var arr = [1, 2, 3, 4]; arr.flatmap(x => [x, x * 2]); // is eq
uivalent to arr.reduce((acc, x) => acc.concat([x, x * 2]), []); // [1, 2, 2, 4, 3, 6, 4, 8] note, however, that this is inefficient and should be avoided for large arrays: in each iteration, it creates a new temporary array that must be garbage-collected, and it copies elements from the current accumulator array into a new array instead of just adding the new elements to the existing array.
Array.prototype.forEach() - JavaScript
early termination may be accomplished with: a simple for loop a for...of / for...in loops array.prototype.every() array.prototype.some() array.prototype.find() array.prototype.findindex() array methods: every(), some(), find(), and findindex() test the array elements with a predicate returning a truthy value to determine if further iteration is req
uired.
...if you want to flatten an array using b
uilt-in methods you can use array.prototype.flat().
Array.from() - JavaScript
in es2015, the class syntax allows sub-classing of both b
uilt-in and user-defined classes.
... if (arraylikeoriterator == null && !isiterator) { throw new typeerror( 'array.from req
uires an array-like object or iterator - not null or undefined' ); } // 4.
Array.prototype.indexOf() - JavaScript
// this version tries to optimize by only checking for "in" when looking for undefined and // skipping the definitely fr
uitless nan search.
...let len be to
uint32(lenvalue).
Array.prototype.push() - JavaScript
although strings are native, array-like objects, they are not s
uitable in applications of this method, as strings are immutable.
... let vegetables = ['parsnip', 'potato'] let morevegs = ['celery', 'beetroot'] // merge the second array into the first one // eq
uivalent to vegetables.push('celery', 'beetroot') array.prototype.push.apply(vegetables, morevegs) console.log(vegetables) // ['parsnip', 'potato', 'celery', 'beetroot'] using an object in an array-like fashion as mentioned above, push is intentionally generic, and we can use that to our advantage.
Array.prototype.some() - JavaScript
[2, 5, 8, 1, 4].some(x => x > 10); // false [12, 5, 8, 1, 4].some(x => x > 10); // true checking whether a value exists in an array to mimic the function of the includes() method, this custom function returns true if the element exists in the array: const fr
uits = ['apple', 'banana', 'mango', 'guava']; function checkavailability(arr, val) { return arr.some(function(arrval) { return val === arrval; }); } checkavailability(fr
uits, 'kela'); // false checkavailability(fr
uits, 'banana'); // true checking whether a value exists using an arrow function const fr
uits = ['apple', 'banana', 'mango', 'guava']; function checkavailability(arr, val) { ...
... return arr.some(arrval => val === arrval); } checkavailability(fr
uits, 'kela'); // false checkavailability(fr
uits, 'banana'); // true converting any value to boolean const truthy_values = [true, 'true', 1]; function getboolean(value) { 'use strict'; if (typeof value === 'string') { value = value.tolowercase().trim(); } return truthy_values.some(function(t) { return t === value; }); } getboolean(false); // false getboolean('false'); // false getboolean(1); // true getboolean('true'); // true specifications specification ecmascript (ecma-262)the definition of 'array.prototype.some' in that specification.
Array.prototype.splice() - JavaScript
(in this case, the origin -1, meaning -n is the index of the nth last element, and is therefore eq
uivalent to the index of array.length - n.) if array.length + start is less than 0, it will begin from index 0.
... examples remove 0 (zero) elements before index 2, and insert "drum" let myfish = ['angel', 'clown', 'mandarin', 'sturgeon'] let removed = myfish.splice(2, 0, 'drum') // myfish is ["angel", "clown", "drum", "mandarin", "sturgeon"] // removed is [], no elements removed remove 0 (zero) elements before index 2, and insert "drum" and "g
uitar" let myfish = ['angel', 'clown', 'mandarin', 'sturgeon'] let removed = myfish.splice(2, 0, 'drum', 'g
uitar') // myfish is ["angel", "clown", "drum", "g
uitar", "mandarin", "sturgeon"] // removed is [], no elements removed remove 1 element at index 3 let myfish = ['angel', 'clown', 'drum', 'mandarin', 'sturgeon'] let removed = myfish.splice(3, 1) // myfish is ["angel", "clown", "drum", "st...
ArrayBuffer() constructor - JavaScript
compatibility notes starting with ecmascript 2015, arraybuffer constructors req
uire to be constructed with a new operator.
... var dv = arraybuffer(10); // typeerror: calling a b
uiltin arraybuffer constructor // without new is forbidden var dv = new arraybuffer(10); examples creating an arraybuffer in this example, we create a 8-byte buffer with a int32array view referring to the buffer: var buffer = new arraybuffer(8); var view = new int32array(buffer); specifications specification ecmascript (ecma-262)the definition of 'arraybuffer' in that specification.
Atomics.add() - JavaScript
one of int8array,
uint8array, int16array,
uint16array, int32array,
uint32array, bigint64array, or big
uint64array.
... examples using add() const sab = new sharedarraybuffer(1024); const ta = new
uint8array(sab); atomics.add(ta, 0, 12); // returns 0, the old value atomics.load(ta, 0); // 12 specifications specification ecmascript (ecma-262)the definition of 'atomics.add' in that specification.
Atomics.and() - JavaScript
one of int8array,
uint8array, int16array,
uint16array, int32array,
uint32array, bigint64array, or big
uint64array.
... 5 0101 1 0001 ---- 1 0001 examples using and() const sab = new sharedarraybuffer(1024); const ta = new
uint8array(sab); ta[0] = 5; atomics.and(ta, 0, 1); // returns 0, the old value atomics.load(ta, 0); // 1 specifications specification ecmascript (ecma-262)the definition of 'atomics.and' in that specification.
Atomics.compareExchange() - JavaScript
one of int8array,
uint8array, int16array,
uint16array, int32array,
uint32array, bigint64array, or big
uint64array.
... examples using compareexchange() const sab = new sharedarraybuffer(1024); const ta = new
uint8array(sab); ta[0] = 7; atomics.compareexchange(ta, 0, 7, 12); // returns 7, the old value atomics.load(ta, 0); // 12 specifications specification ecmascript (ecma-262)the definition of 'atomics.compareexchange' in that specification.
Atomics.exchange() - JavaScript
one of int8array,
uint8array, int16array,
uint16array, int32array,
uint32array, bigint64array, or big
uint64array.
... examples using exchange() const sab = new sharedarraybuffer(1024); const ta = new
uint8array(sab); atomics.exchange(ta, 0, 12); // returns 0, the old value atomics.load(ta, 0); // 12 specifications specification ecmascript (ecma-262)the definition of 'atomics.exchange' in that specification.
Atomics.load() - JavaScript
one of int8array,
uint8array, int16array,
uint16array, int32array,
uint32array, bigint64array, or big
uint64array.
... examples using load const sab = new sharedarraybuffer(1024); const ta = new
uint8array(sab); atomics.add(ta, 0, 12); atomics.load(ta, 0); // 12 specifications specification ecmascript (ecma-262)the definition of 'atomics.load' in that specification.
Atomics.or() - JavaScript
one of int8array,
uint8array, int16array,
uint16array, int32array,
uint32array, bigint64array, or big
uint64array.
... 5 0101 1 0001 ---- 5 0101 examples using or const sab = new sharedarraybuffer(1024); const ta = new
uint8array(sab); ta[0] = 2; atomics.or(ta, 0, 1); // returns 2, the old value atomics.load(ta, 0); // 3 specifications specification ecmascript (ecma-262)the definition of 'atomics.or' in that specification.
Atomics.store() - JavaScript
one of int8array,
uint8array, int16array,
uint16array, int32array,
uint32array, bigint64array, or big
uint64array.
... examples using store() var sab = new sharedarraybuffer(1024); var ta = new
uint8array(sab); atomics.store(ta, 0, 12); // 12 specifications specification ecmascript (ecma-262)the definition of 'atomics.store' in that specification.
Atomics.sub() - JavaScript
one of int8array,
uint8array, int16array,
uint16array, int32array,
uint32array, bigint64array, or big
uint64array.
... examples using sub const sab = new sharedarraybuffer(1024); const ta = new
uint8array(sab); ta[0] = 48; atomics.sub(ta, 0, 12); // returns 48, the old value atomics.load(ta, 0); // 36 specifications specification ecmascript (ecma-262)the definition of 'atomics.sub' in that specification.
Atomics.xor() - JavaScript
one of int8array,
uint8array, int16array,
uint16array, int32array,
uint32array, bigint64array, or big
uint64array.
... 5 0101 1 0001 ---- 4 0100 examples using xor const sab = new sharedarraybuffer(1024); const ta = new
uint8array(sab); ta[0] = 5; atomics.xor(ta, 0, 1); // returns 5, the old value atomics.load(ta, 0); // 4 specifications specification ecmascript (ecma-262)the definition of 'atomics.xor' in that specification.
Date() constructor - JavaScript
time value or timestamp number value an integer value representing the number of milliseconds since january 1, 1970, 00:00:00 utc (the ecmascript epoch, eq
uivalent to the unix epoch), with leap seconds ignored.
... examples several ways to create a date object the following examples show several ways to create javascript dates: note: parsing of date strings with the date constructor (and date.parse, they are eq
uivalent) is strongly discouraged due to browser differences and inconsistencies.
Date.UTC() - JavaScript
syntax since ecmascript 2017: date.utc(year[, month[, day[, hour[, minute[, second[, millisecond]]]]]]) ecmascript 2016 and earlier: (month used to be req
uired) date.utc(year, month[, day[, hour[, minute[, second[, millisecond]]]]]) parameters year a full year.
...(up through ecmascript 2016, month was a req
uired parameter.
Date.prototype.toUTCString() - JavaScript
sun, mon, ...) dd day of month, as two digits with leading zero if req
uired mmm month, as three letters (e.g.
... jan, feb, ...) yyyy year, as four or more digits with leading zeroes if req
uired hh hour, as two digits with leading zero if req
uired mm minute, as two digits with leading zero if req
uired ss seconds, as two digits with leading zero if req
uired prior to ecmascript 2018, the format of the return value varied according to the platform.
Function.prototype.apply() - JavaScript
this argument is req
uired.
... const array = ['a', 'b']; const elements = [0, 1, 2]; array.push.apply(array, elements); console.info(array); // ["a", "b", 0, 1, 2] using apply and b
uilt-in functions clever usage of apply allows you to use b
uilt-in functions for some tasks that would probably have otherwise been written by looping over the array values.
Intl.ListFormat.prototype.formatToParts() - JavaScript
the type property may be either "element", which refers to a value from the list, or "literal" which refers to a ling
uistic construct.
... examples using formattoparts const fr
uits = ['apple', 'orange', 'pineapple']; const mylistformat = new intl.listformat('en-gb', { style: 'long', type: 'conjunction' }); console.table(mylistformat.formattoparts(fr
uits)); // [ // { "type": "element", "value": "apple" }, // { "type": "literal", "value": ", " }, // { "type": "element", "value": "orange" }, // { "type": "literal", "value": ", and " }, // { "type": "element", "value": "pineapple" } // ] specifications specification intl.listformatthe definition of 'formattoparts()' in that specification.
JSON.parse() - JavaScript
the "{" operator is subject to a syntactic ambig
uity // in javascript: it can begin a block or an object literal.
... we wrap the text // in parens to eliminate the ambig
uity.
Math.clz32() - JavaScript
if (!math.clz32) math.clz32 = (function(log, ln2){ return function(x) { // let n be to
uint32(x).
... var as
uint = x >>> 0; if (as
uint === 0) { return 32; } return 31 - (log(as
uint) / ln2 | 0) |0; // the "| 0" acts like math.floor }; })(math.log, math.ln2); examples using math.clz32() math.clz32(1); // 31 math.clz32(1000); // 22 math.clz32(); // 32 var stuff = [nan, infinity, -infinity, 0, -0, false, null, undefined, 'foo', {}, []]; stuff.every(n => math.clz32(n) == 32); // true math.clz32(true); // 31 math.clz32(3.5); // 30 specifications specification ecmascript (ecma-262)the definition of 'math.clz32' in that specification.
Math.max() - JavaScript
getmaxofarray([1, 2, 3]) is eq
uivalent to math.max(1, 2, 3), but you can use getmaxofarray() on programmatically constructed arrays.
...see using apply and b
uilt-in functions for more details.
Math - JavaScript
math is a b
uilt-in object that has properties and methods for mathematical constants and functions.
... math.sqrt1_2 square root of ½ (or eq
uivalently, 1/√2); approximately 0.707.
Number.prototype.toLocaleString() - JavaScript
to check for support in es5.1 and later implementations, the req
uirement that illegal language tags are rejected with a rangeerror exception can be used: function tolocalestringsupportslocales() { var number = 0; try { number.tolocalestring('i'); } catch (e) { return e.name === 'rangeerror'; } return false; } prior to es5.1, implementations were not req
uired to throw a range error exception if tolocalestring is called with arguments.
... a check that works in all hosts, including those supporting ecma-262 prior to ed 5.1, is to test for the features specified in ecma-402 that are req
uired to support regional options for number.prototype.tolocalestring directly: function tolocalestringsupportsoptions() { return !!(typeof intl == 'object' && intl && typeof intl.numberformat == 'function'); } this tests for a global intl object, checks that it's not null and that it has a numberformat property that is a function.
Object.defineProperty() - JavaScript
// this is eq
uivalent to: // get: function() { return bvalue; }, // set: function(newvalue) { bvalue = newvalue; }, get() { return bvalue; }, set(newvalue) { bvalue = newvalue; }, enumerable: true, configurable: true }); o.b; // 38 // 'b' property exists in the o object and its value is 38 // the value of o.b is now always identical to bvalue, // unless o.b is redefined // you cannot try to mix both...
... var o = {}; o.a = 1; // is eq
uivalent to: object.defineproperty(o, 'a', { value: 1, writable: true, configurable: true, enumerable: true }); // on the other hand, object.defineproperty(o, 'a', { value: 1 }); // is eq
uivalent to: object.defineproperty(o, 'a', { value: 1, writable: false, configurable: false, enumerable: false }); custom setters and getters the example below shows how to implement a self-archi...
Object.prototype.propertyIsEnumerable() - JavaScript
b
uilt-in objects the following example demonstrates the enumerability of user-defined vs.
... b
uilt-in properties: var a = ['is enumerable']; a.propertyisenumerable(0); // returns true a.propertyisenumerable('length'); // returns false math.propertyisenumerable('random'); // returns false this.propertyisenumerable('math'); // returns false direct vs.
Object.prototype.__proto__ - JavaScript
for objects created using new fun, where fun is one of the b
uilt-in constructor functions provided by javascript (array, boolean, date, number, object, string, and so on — including new constructors added as javascript evolves), this value is always fun.prototype.
... to understand how prototypes are used for inheritance, see g
uide article inheritance and the prototype chain.
Object.prototype.toLocaleString() - JavaScript
to print array values as a string, optionally with locale-specific identifiers (such as currency symbols) appended to them: for example: const testarray = [4, 7, 10]; let europrices = testarray.tolocalestring('fr', { style: 'currency', currency: 'eur'}); // "4,00 €,7,00 €,10,00 €" date tolocalestring() override on date objects, tolocalestring() is used to print out date displays more s
uitable for specific locales: for example: const testdate = new date(date.now()); // "date fri may 29 2020 18:04:24 gmt+0100 (british summer time)" let dedate = testdate.tolocalestring('de'); // "29.5.2020, 18:04:24" var frdate = testdate.tolocalestring('fr'); //"29/05/2020 à 18:04:24" number tolocalestring() override on number objects, tolocalestring() is used to print out number displays mo...
...re s
uitable for specific locales, e.g.
Object.prototype.toSource() - JavaScript
description the tosource() method returns the following values: for the b
uilt-in object object, tosource() returns the following string indicating that the source code is not available: function object() { [native code] } for instances of object, tosource() returns a string representing the source code.
...for example: function person(name) { this.name = name; } person.prototype.tosource = function person_tosource() { return 'new person(' + uneval(this.name) + ')'; }; console.log(new person('joe').tosource()); // ---> new person("joe") b
uilt-in tosource() methods each core javascript type has its own tosource() method.
Object.prototype.valueOf() - JavaScript
every b
uilt-in core object overrides this method to return an appropriate value.
... you can use valueof within your own code to convert a b
uilt-in object into a primitive value.
Promise.any() - JavaScript
it short-circ
uits after a promise fulfils, so it does not wait for the other promises to complete once it finds one.
... const perr = new promise((resolve, reject) => { reject("always fails"); }); const pslow = new promise((resolve, reject) => { settimeout(resolve, 500, "done eventually"); }); const pfast = new promise((resolve, reject) => { settimeout(resolve, 100, "done q
uick"); }); promise.any([perr, pslow, pfast]).then((value) => { console.log(value); // pfast fulfils first }) // expected output: "done q
uick" rejections with aggregateerror promise.any() rejects with an aggregateerror if no promise fulfils.
SharedArrayBuffer() constructor - JavaScript
examples always use the new operator to create a sharedarraybuffer sharedarraybuffer constructors are req
uired to be constructed with a new operator.
... var sab = sharedarraybuffer(1024); // typeerror: calling a b
uiltin sharedarraybuffer constructor // without new is forbidden var sab = new sharedarraybuffer(1024); specifications specification ecmascript (ecma-262)the definition of 'sharedarraybuffer constructor' in that specification.
String.fromCodePoint() - JavaScript
polyfill: if (!string.fromcodepoint) (function(stringfromcharcode) { var fromcodepoint = function(_) { var codeunits = [], codelen = 0, result = ""; for (var index=0, len = arguments.length; index !== len; ++index) { var codepoint = +arguments[index]; // correctly handles all cases including `nan`, `-infinity`, `+infinity` // the surrounding `!(...)` is req
uired to correctly handle `nan` cases // the (codepoint>>>0) === codepoint clause handles decimals and negatives if (!(codepoint < 0x10ffff && (codepoint>>>0) === codepoint)) throw rangeerror("invalid code point: " + codepoint); if (codepoint <= 0xffff) { // bmp code point codelen = codeunits.push(codepoint); } else { // astral code point; split in...
...instead, it req
uires the utf-16 surrogate pair in order to return a supplementary character: string.fromcharcode(0xd83c, 0xdf03); // code point u+1f303 "night with string.fromcharcode(55356, 57091); // stars" == "\ud83c\udf03" string.fromcodepoint(), on the other hand, can return 4-byte supplementary characters, as well as the more common 2-byte bmp characters, by specifying their code point (which is eq
uival...
String.raw() - JavaScript
string.raw() is the only b
uilt-in tag function of template strings.
...// the following is eq
uivalent to // `t${0}e${1}s${2}t`: string.raw({ raw: 'test' }, 0, 1, 2); // 't0e1s2t' specifications specification ecmascript (ecma-262)the definition of 'string.raw' in that specification.
Symbol.iterator - JavaScript
some b
uilt-in types have a default iteration behavior, while other types (such as object) do not.
... the b
uilt-in types with a @@iterator method are: array.prototype[@@iterator]() typedarray.prototype[@@iterator]() string.prototype[@@iterator]() map.prototype[@@iterator]() set.prototype[@@iterator]() see also iteration protocols for more information.
get TypedArray[@@species] - JavaScript
examples species in ordinary objects the species property returns the default constructor function, which is one of the typed array constructors for a given typed array object: int8array[symbol.species]; // function int8array()
uint8array[symbol.species]; // function
uint8array() float32array[symbol.species]; // function float32array() species in derived objects in a derived collection object (e.g.
...however, you might want to overwrite this, in order to return a parent typed array object in your derived class methods: class mytypedarray extends
uint8array { // overwrite mytypedarray species to the parent
uint8array constructor static get [symbol.species]() { return
uint8array; } } specifications specification ecmascript (ecma-262)the definition of 'get %typedarray% [ @@species ]' in that specification.
TypedArray.prototype.every() - JavaScript
function isbigenough(element, index, array) { return element >= 10; } new
uint8array([12, 5, 8, 130, 44]).every(isbigenough); // false new
uint8array([12, 54, 18, 130, 44]).every(isbigenough); // true testing typed array elements using arrow functions arrow functions provide a shorter syntax for the same test.
... new
uint8array([12, 5, 8, 130, 44]).every(elem => elem >= 10); // false new
uint8array([12, 54, 18, 130, 44]).every(elem => elem >= 10); // true specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.every' in that specification.
TypedArray.prototype.fill() - JavaScript
// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.fill if (!
uint8array.prototype.fill) {
uint8array.prototype.fill = array.prototype.fill; } examples using fill new
uint8array([1, 2, 3]).fill(4); //
uint8array [4, 4, 4] new
uint8array([1, 2, 3]).fill(4, 1); //
uint8array [1, 4, 4] new
uint8array([1, 2, 3]).fill(4, 1, 2); //
uint8array [1, 4, 3] new
uint8array([1, 2, 3]).fill(4, 1, 1); //
uint8array [1, 2, 3] new
uint8array([1, 2, 3]).f...
...ill(4, -3, -2); //
uint8array [4, 2, 3] specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.fill' in that specification.
TypedArray.prototype.filter() - JavaScript
function isbigenough(element, index, array) { return element >= 10; } new
uint8array([12, 5, 8, 130, 44]).filter(isbigenough); //
uint8array [ 12, 130, 44 ] filtering typed array elements using arrow functions arrow functions provide a shorter syntax for the same test.
... new
uint8array([12, 5, 8, 130, 44]).filter(elem => elem >= 10); //
uint8array [ 12, 130, 44 ] specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.filter' in that specification.
TypedArray.prototype.join() - JavaScript
// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join if (!
uint8array.prototype.join) { object.defineproperty(
uint8array.prototype, 'join', { value: array.prototype.join }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable.
... examples using join var
uint8 = new
uint8array([1,2,3]);
uint8.join(); // '1,2,3'
uint8.join(' / '); // '1 / 2 / 3'
uint8.join(''); // '123' specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.join' in that specification.
TypedArray.prototype.map() - JavaScript
const numbers = new
uint8array([1, 4, 9]); const roots = numbers.map(math.sqrt); // roots is now:
uint8array [1, 2, 3], // numbers is still
uint8array [1, 4, 9] mapping a typed array of numbers using a function containing an argument the following code shows how map works when a function req
uiring one argument is used with it.
... const numbers = new
uint8array([1, 4, 9]); const doubles = numbers.map(function(num) { return num * 2; }); // doubles is now
uint8array [2, 8, 18] // numbers is still
uint8array [1, 4, 9] specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.map' in that specification.
TypedArray.of() - JavaScript
syntax typedarray.of(element0[, element1[, ...[, elementn]]]) where typedarray is one of: int8array
uint8array
uint8clampedarray int16array
uint16array int32array
uint32array float32array float64array bigint64array big
uint64array parameters elementn elements of which to create the typed array.
... examples using of
uint8array.of(1); //
uint8array [ 1 ] int8array.of('1', '2', '3'); // int8array [ 1, 2, 3 ] float32array.of(1, 2, 3); // float32array [ 1, 2, 3 ] int16array.of(undefined); // int16array [ 0 ] specifications specification ecmascript (ecma-262)the definition of '%typedarray%.of' in that specification.
TypedArray.prototype.slice() - JavaScript
if (!
uint8array.prototype.slice) { object.defineproperty(
uint8array.prototype, 'slice', { value: function (begin, end) { return new
uint8array(array.prototype.slice.call(this, begin, end)); } }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them n...
... examples return a portion of an existing typed array const
uint8 = new
uint8array([1,2,3]);
uint8.slice(1); //
uint8array [ 2, 3 ]
uint8.slice(2); //
uint8array [ 3 ]
uint8.slice(-2); //
uint8array [ 2, 3 ]
uint8.slice(0,1); //
uint8array [ 1 ] specifications specification ecmascript (ecma-262)the definition of '%typedarray%.prototype.slice' in that specification.
TypedArray.prototype.sort() - JavaScript
let numbers = new
uint8array([40, 1, 5, 200]); numbers.sort(); //
uint8array [ 1, 5, 40, 200 ] // unlike plain arrays, a compare function is not req
uired // to sort the numbers numerically.
... // regular arrays req
uire a compare function to sort numerically: numbers = [40, 1, 5, 200]; numbers.sort(); // [1, 200, 40, 5] numbers.sort((a, b) => a - b); // compare numbers // [ 1, 5, 40, 200 ] specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.sort' in that specification.
TypedArray.prototype.toString() - JavaScript
var numbers = new
uint8array([2, 5, 8, 1, 4]) numbers.tostring(); // "2,5,8,1,4" javascript calls the tostring method automatically when a typed array is to be represented as a text value or when an array is referred to in a string concatenation.
... compatibility if a browser doesn't support the typedarray.prototype.tostring() method yet, javascript will call the tostring method of object: var numbers = new
uint8array([2, 5, 8, 1, 4]) numbers.tostring(); // "[object
uint8array]" specifications specification ecmascript (ecma-262)the definition of 'array.prototype.tostring' in that specification.
eval() - JavaScript
function test() { var x = 2, y = 4; console.log(eval('x + y')); // direct call, uses local scope, result is 6 var geval = eval; // eq
uivalent to calling eval in the global scope console.log(geval('x + y')); // indirect call, uses global scope, throws referenceerror because `x` is undefined (0, eval)('x + y'); // another example of indirect call } never use eval()!
... var str = 'if ( a ) { 1 + 1; } else { 1 + 2; }'; var a = true; var b = eval(str); // returns 2 console.log('b is : ' + b); a = false; b = eval(str); // returns 3 console.log('b is : ' + b); eval as a string defining function req
uires "(" and ")" as prefix and suffix var fctstr1 = 'function a() {}' var fctstr2 = '(function a() {})' var fct1 = eval(fctstr1) // return undefined var fct2 = eval(fctstr2) // return a function specifications specification ecmascript (ecma-262)the definition of 'eval' in that specification.
Lexical grammar - JavaScript
code points u+10000 to u+10ffff req
uire two escape sequences representing the two code units (a surrogate pair) used to encode the character; the surrogate pair is distinct from the code point.
... /ab+c/g // an "empty" regular expression literal // the empty non-capturing group is necessary // to avoid ambig
uity with single-line comments.
Conditional (ternary) operator - JavaScript
"beer" : "j
uice"; console.log(beverage); // "beer" handling null values one common usage is to handle a value that may be null: let greeting = person => { let name = person ?
...value3 : value4; } // eq
uivalent to: function example(…) { if (condition1) { return value1; } else if (condition2) { return value2; } else if (condition3) { return value3; } else { return value4; } } specifications specification ecmascript (ecma-262)the definition of 'conditional operator' in that specification.
Destructuring assignment - JavaScript
without destructuring assignment, swapping two values req
uires a temporary variable (or, in some low-level languages, the xor-swap trick).
...) around the assignment statement are req
uired when using object literal destructuring assignment without a declaration.
Logical AND (&&) - JavaScript
short-circ
uit evaluation the logical and expression is evaluated left to right, it is tested for possible "short-circ
uit" evaluation using the following rule: (some falsy expression) && expr is short-circ
uit evaluated to the falsy expression; short circ
uit means that the expr part above is not evaluated, hence any side effects of doing so do not take effect (e.g., if expr is a function call, the calling ne...
...see example: function a(){ console.log('called a'); return false; } function b(){ console.log('called b'); return true; } console.log( a() && b() ); // logs "called a" due to the function call, // then logs false (which is the resulting value of the operator) operator precedence the following expressions might seem eq
uivalent, but they are not, because the && operator is executed before the || operator (see operator precedence).
Logical AND assignment (&&=) - JavaScript
syntax expr1 &&= expr2 description short-circ
uit evaluation the logical and operator is evaluated left to right, it is tested for possible short-circ
uit evaluation using the following rule: (some falsy expression) && expr is short-circ
uit evaluated to the falsy expression; short circ
uit means that the expr part above is not evaluated, hence any side effects of doing so do not take effect (e.g., if expr is a function call, the calling never takes place).
... logical and assignment short-circ
uits as well meaning that x &&= y is eq
uivalent to: x && (x = y); and not eq
uivalent to the following which would always perform an assignment: x = x && y; examples using logical and assignment let x = 0; let y = 1; x &&= 0; // 0 x &&= 1; // 0 y &&= 1; // 1 y &&= 0; // 0 specifications specification logical assignment operatorsthe definition of 'assignment operators' in that specification.
Object initializer - JavaScript
examples creating objects an empty object with no properties can be created like this: let object = {} however, the advantage of the literal or initializer notation is, that you are able to q
uickly create objects with properties inside the curly braces.
... } }; which is eq
uivalent to this es5-like notation (but note that ecmascript 5 has no generators): let o = { generator: function* () { ...........
Property accessors - JavaScript
=== 77.0, no ambig
uity bracket notation in the object[property_name] syntax, the property_name is just a string or symbol.
...also, strformcontrol would have to hold an identifier, which is not req
uired for names and ids of form controls.
this - JavaScript
// when called as a listener, turns the related element blue function bl
uify(e) { // always true console.log(this === e.currenttarget); // true when currenttarget and target are the same object console.log(this === e.target); this.style.backgroundcolor = '#a5d9f3'; } // get a list of every element in the document var elements = document.getelementsbytagname('*'); // add bl
uify as a click listener so when the // element is clicked on, it turns blue for (var i...
... = 0; i < elements.length; i++) { elements[i].addeventlistener('click', bl
uify, false); } in an inline event handler when the code is called from an inline on-event handler, its this is set to the dom element on which the listener is placed: <button onclick="alert(this.tagname.tolowercase());"> show this </button> the above alert shows button.
typeof - JavaScript
(logical not) operator are eq
uivalent to boolean() // symbols typeof symbol() === 'symbol' typeof symbol('foo') === 'symbol' typeof symbol.iterator === 'symbol' // undefined typeof undefined === 'undefined'; typeof declaredbutundefinedvariable === 'undefined'; typeof undeclaredvariable === 'undefined'; // objects typeof {a: 1} === 'object'; // use array.isarray or object.prototype.tostring.call // to differentiate regula...
... typeof document.all === 'undefined'; although the specification allows custom type tags for non-standard exotic objects, it req
uires those type tags to be different from the predefined ones.
empty - JavaScript
syntax ; description the empty statement is a semicolon (;) indicating that no statement will be executed, even if javascript syntax req
uires one.
...see the following example with an empty loop body: let arr = [1, 2, 3]; // assign all array values to 0 for (let i = 0; i < arr.length; arr[i++] = 0) /* empty statement */ ; console.log(arr); // [0, 0, 0] unintentional usage it is a good idea to comment intentional use of the empty statement, as it is not really obvious to disting
uish from a normal semicolon.
for...of - JavaScript
the for...of statement creates a loop iterating over iterable objects, including: b
uilt-in string, array, array-like objects (e.g., arguments or nodelist), typedarray, map, set, and user-defined iterables.
... const iterable = [10, 20, 30]; for (let value of iterable) { value += 1; console.log(value); } // 11 // 21 // 31 iterating over a string const iterable = 'boo'; for (const value of iterable) { console.log(value); } // "b" // "o" // "o" iterating over a typedarray const iterable = new
uint8array([0x00, 0xff]); for (const value of iterable) { console.log(value); } // 0 // 255 iterating over a map const iterable = new map([['a', 1], ['b', 2], ['c', 3]]); for (const entry of iterable) { console.log(entry); } // ['a', 1] // ['b', 2] // ['c', 3] for (const [key, value] of iterable) { console.log(value); } // 1 // 2 // 3 iterating over a set const iterable = new set([1, ...
for - JavaScript
for example, in the initialization block it is not req
uired to initialize variables: var i = 0; for (; i < 9; i++) { console.log(i); // more statements } like the initialization block, the condition block is also optional.
... var i = 0; for (;;) { if (i > 3) break; console.log(i); i++; } using for without a statement the following for cycle calculates the offset position of a node in the final-expression section, and therefore it does not req
uire the use of a statement section, a semicolon is used instead.
import - JavaScript
there is also a function-like dynamic import(), which does not req
uire scripts of type="module".
...certain bundlers may permit or req
uire the use of the extension; check your environment.
Trailing commas - JavaScript
parameter definitions the following function definition pairs are legal and eq
uivalent to each other.
... function f(p) {} function f(p,) {} (p) => {}; (p,) => {}; the trailing comma also works with method definitions for classes or objects: class c { one(a,) {} two(a, b,) {} } var obj = { one(a,) {}, two(a, b,) {}, }; function calls the following function invocation pairs are legal and eq
uivalent to each other.
JavaScript reference - JavaScript
b
uilt-ins javascript standard b
uilt-in objects, along with their methods and properties.
...component() encodeuri() encodeuricomponent() fundamental objects object function boolean symbol error objects error aggregateerror evalerror internalerror rangeerror referenceerror syntaxerror typeerror urierror numbers & dates number bigint math date text processing string regexp indexed collections array int8array
uint8array
uint8clampedarray int16array
uint16array int32array
uint32array float32array float64array bigint64array big
uint64array keyed collections map set weakmap weakset structured data arraybuffer sharedarraybuffer atomics dataview json control abstraction promise generator generatorfunction asyncfunction reflection reflect ...
serviceworker - Web app manifests
examples "serviceworker": { "src": "./serviceworker.js", "scope": "/app", "type": "", "update_via_cache": "none" } values service worker contain the following values (only src is req
uired): member description src the url to download the service worker script from.
... this is the only req
uired member of the serviceworker member.
Web app manifests
the web app manifest provides information about a web application in a json text file, necessary for the web app to be downloaded and be presented to the user similarly to a native app (e.g., be installed on the homescreen of a device, providing users with q
uicker access and a richer experience).
... note: if the manifest req
uires credentials to fetch - the crossorigin attribute must be set to use-credentials, even if the manifest file is in the same origin as the current page.
OpenSearch description format
(see image, the green plus sign.) thus if a search box is not shown in the user's
ui, they will receive no indication.
... reference material opensearch documentation safari 8.0 release notes: q
uick website search microsoft edge dev g
uide: search provider discovery the chromium projects: tab to search imdb.com has a working osd.xml opensearch plugin generator ready2search - create opensearch plugins.
CSS and JavaScript animation performance - Web Performance
this can occur because css transitions/animations are simply resampling element styles in the main
ui thread before each repaint event happens, which is almost the same as resampling element styles via a requestanimationframe() callback, also triggered before the next repaint.
... if both animations are made in the main
ui thread, there is no difference performance-wise.
Progressive loading - Progressive web apps (PWAs)
the js13kpwa app uses a placeholder image instead, which is small and lightweight, while the final paths to target images are stored in data-src attributes: <img src='data/img/placeholder.png' data-src='data/img/slug.jpg' alt='name'> those images will be loaded via javascript after the site finishes b
uilding the html structure.
... feel free to experiment with the code, enhance your existing app with pwa features, or b
uild something entirely new on your own.
accumulate - SVG: Scalable Vector Graphics
it is frequently useful for repeated animations to b
uild upon the previous results, accumulating with each iteration.
... four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> usage notes value none | sum default value none animatable no sum specifies that each repeat iteration after the first b
uilds upon the last value of the previous iteration.
numOctaves - SVG: Scalable Vector Graphics
a turbulence is b
uilt by accumulating several octaves with increasing frequencies and decreasing amplitudes.
...though more octaves also req
uire more calculations, resulting in a negative impact on performance.
startOffset - SVG: Scalable Vector Graphics
<svg viewbox="0 0 220 100" xmlns="http://www.w3.org/2000/svg"> <path id="path1" fill="none" stroke="red" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <path id="path2" fill="none" stroke="red" d="m130,90 q210,90 210,45 q210,10 170,10 q130,10 130,40 q130,70 165,70 q190,70 195,50" /> <text> <textpath href="#path1" startoffset="0"> q
uick brown fox jumps over the lazy dog.
... </textpath> </text> <text> <textpath href="#path2" startoffset="40"> q
uick brown fox jumps over the lazy dog.
xml:space - SVG: Scalable Vector Graphics
svg supports the b
uilt-in xml xml:space attribute to handle whitespace characters inside elements.
... this attribute influences how browsers parse text content and therefore changes the way the dom is b
uilt.
<circle> - SVG: Scalable Vector Graphics
global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-mit...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification...
<clipPath> - SVG: Scalable Vector Graphics
*/ @keyframes openyourheart {from {r: 0} to {r: 60px}} #myclip circle { animation: openyourheart 15s infinite; } a clipping path is conceptually eq
uivalent to a custom viewport for the referencing element.
... value type: userspaceonuse|objectboundingbox ; default value: userspaceonuse; animatable: yes global attributes core attributes most notably: id styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, display, fill, fill-opacity, fill-rule, filter, mask, opacity, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility usage notes categoriesnonepermitted contentany number ...
<ellipse> - SVG: Scalable Vector Graphics
global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-mit...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification...
<g> - SVG: Scalable Vector Graphics
ing g to inherit presentation attributes --> <g fill="white" stroke="green" stroke-width="5"> <circle cx="40" cy="40" r="25" /> <circle cx="60" cy="60" r="25" /> </g> </svg> attributes this element only includes global attributes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-mit...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, ...
<line> - SVG: Scalable Vector Graphics
value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-mit...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification...
<marker> - SVG: Scalable Vector Graphics
value type: <list-of-numbers> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibi...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clip...
<path> - SVG: Scalable Vector Graphics
value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-mit...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesgraphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment...
<rect> - SVG: Scalable Vector Graphics
global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-mit...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification...
<switch> - SVG: Scalable Vector Graphics
the <switch> svg element evaluates any req
uiredfeatures, req
uiredextensions and systemlanguage attributes on its direct child elements in order, and then renders the first child where these attributes evaluate to true.
...age context categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elements<a>, <foreignobject>, <g>, <image>, <svg>, <switch>, <text>, <use> attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes class style externalresourcesreq
uired transform dom interface this element implements the svgswitchelement interface.
<text> - SVG: Scalable Vector Graphics
value type: <length>|<percentage> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style, font-family, font-size, font-size-adjust, font-stretch, font-style, font-variant, font-weight conditional processing attributes most notably: req
uiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-l...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesgraphics element, text content elementpermitted contentcharacter data and any number of the following elements, in any order:animation elementsdescriptive elementstext content elements<a> specifica...
<tspan> - SVG: Scalable Vector Graphics
value type: <length>|<percentage> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: req
uiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-l...
...ia-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-req
uired, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altglyph>, <animate>, <animatecolor>,...
SVG: Scalable Vector Graphics
mailing list newsgroup rss feed tools svg test s
uite markup validator more tools...
... other resources: xml, css, dom, canvas examples google maps (route overlay) & docs (spreadsheet charting) svg bubble menus svg authoring g
uidelines an overview of the mozilla svg project frequently asked questions regarding svg and mozilla svg as an image svg animation with smil svg art gallery animation and interactions like html, svg has a document model (dom) and events, and is accessible from javascript.
How to turn off form autocompletion - Web security
note that the wcag 2.1 success criterion 1.3.5: identify input purpose does not req
uire that autocomplete/autofill actually work - merely that form fields that relate to specific personal user information are programmatically identified.
... this is a hint, which browsers are not req
uired to comply with.
Subdomain takeovers - Web security
unless the hosting provider is very careful to verify that the entity who sets up the virtual host actually is the owner of the subdomain name, an attacker who is q
uicker than you could create a virtual host with the same hosting provider, using your subdomain name.
...depending on the size of the organization, this may req
uire communication and coordination across multiple departments, which can only increase the likelihood for a vulnerable misconfiguration.
Web security
clickjacking protection in clickjacking, a user is fooled into clicking on a
ui element that performs some action other than what the user expects.
... security-related glossary terms block cipher mode of operation certificate authority challenge-response authentication cipher cipher s
uite ciphertext cors cors-safelisted request header cors-safelisted response header cross-site scripting cryptanalysis cryptographic hash function cryptography csp csrf decryption digital certificate dtls encryption forbidden header name forbidden response header name hash hmac hpkp ...
Tabboxes - Archive of obsolete content
</description> <spacer style="height: 10px"/> <groupbox orient="horizontal"> <caption label="search criteria"/> <menulist id="searchtype"> <menupopup> <men
uitem label="name"/> <men
uitem label="size"/> <men
uitem label="date modified"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <menulist id="searchmode"> <menupopup> <men
uitem label="is"/> <men
uitem label="is not"/> </menupopup> </menulist> <spacer style="height: 10px"/> <textbox id="find-te...
XBL Inheritance - Archive of obsolete content
(you can also use the value addrbook to look up addresses in the address book.) firefox uses a different autocomplete mechanism than the mozilla s
uite, see xul:textbox (firefox autocomplete) in the next section, we'll see an example xbl-defined widget.
Widget Cheatsheet - Archive of obsolete content
menu <menu value="menu widget"> <menupopup> <men
uitem value="foo" /> <men
uitem value="shoo" /> <menu value="sub"> <menupopup> <men
uitem value="subitem" /> </menupopup> </menu> </menupopup> </menu> <menulist value="menulist element"> <menupopup> <men
uitem value="foo" /> <men
uitem value="shoo" /> <men
uitem value="boo" /> </menupopup> </menulist> <menubutton src="back.gif"> <menupopup> <men
uitem value="foo" /> <men
uitem value="shoo" /> <men
uitem value="boo" /> </menupopup> </menubutton> ...
action - Archive of obsolete content
er, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), bl...
assign - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
binding - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blu...
box - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
broadcasterset - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
colorpicker - Archive of obsolete content
visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
column - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
columns - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
commandset - Archive of obsolete content
properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
conditions - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
datepicker - Archive of obsolete content
visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
deck - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
dropmarker - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
elements - Archive of obsolete content
oadcasterset button browser c checkbox caption colorpicker column columns commandset command conditions content d deck description dialog dialogheader e editor grid grippy groupbox h hbox i iframe image k key keyset l label listbox listcell listcol listcols listhead listheader listitem m member menu menubar men
uitem menulist menupopup menuseparator o observes overlay p page popup popupset preference preferences prefpane prefwindow progressmeter r radio radiogroup resizer richlistbox richlistitem resizer row rows rule s script scrollbar scrollbox scrollcorner separator spacer splitter stack statusbar statusbarpanel stringbundle str...
grippy - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
groupbox - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
iframe - Archive of obsolete content
attributes showcaret, src, type, transparent properties accessibletype, contentdocument, contentwindow, docshell, webnavigation examples <iframe src="table.php" flex="2" id="browsertable" name="table_frame"/> selecting an url from a menu <menulist oncommand="donav(this);"> <menupopup> <men
uitem label="mozilla" value="http://mozilla.org" /> <men
uitem label="slashdot" value="http://slashdot.org"/> <men
uitem label="sourceforge" value="http://sf.net" /> <men
uitem label="freshmeat" value="http://freshmeat.net"/> </menupopup> </menulist> <iframe id="myframe" flex="1"/> <script> function donav(obj) { var url = obj.selecteditem.value; // note the firstchild is the menupo...
image - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
listcol - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
listcols - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
member - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
observes - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
page - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
param - Archive of obsolete content
type type: one of the values below the type of the parameter's value integer 32 bit integer int64 64 bit integer double double-precision floating-point number string string literal, the default value properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
preferences - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods void firechangedevent(in domelement preference); creat...
progressmeter - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
query - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
queryset - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
resizer - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
row - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
rows - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
rule - Archive of obsolete content
properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
script - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
scrollbar - Archive of obsolete content
properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
scrollbox - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
scrollcorner - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
spacer - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
spinbuttons - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
splitter - Archive of obsolete content
properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
stack - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
stringbundleset - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
tabpanel - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
tabs - Archive of obsolete content
visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
template - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
textbox - Archive of obsolete content
visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
textnode - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
timepicker - Archive of obsolete content
visible controls have a disabled property which, except for menus and men
uitems, is normally preferred to use of the attribute, as it may need to update additional state.
titlebar - Archive of obsolete content
properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
toolbargrippy - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
toolbarpalette - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
toolbarset - Archive of obsolete content
ter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blu...
toolbarspacer - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
toolbarspring - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blu...
treechildren - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
treecols - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
treerow - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
treeseparator - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
triple - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
where - Archive of obsolete content
r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, b
uilder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), b...
Components - Archive of obsolete content
for new components or interface changes of existing ones to be noticed at all, you need to change the b
uildid in application.ini to trigger a re-registration of the components.
Custom app bundles for Mac OS X - Archive of obsolete content
irectory contains your application's chrome) example.manifest defaults/ preferences/ app-prefs.js (this provides some default values for preferences) application bundle contents in addition to the standard directory hierarchy that's req
uired of all mac os x applications, as shown above in application bundle layout, there are some specific rules for what content goes where: the top-level directory is given a name that ends with .app which designates the whole package as an application bundle.
XULRunner FAQ - Archive of obsolete content
xul was always the original language of choice for
ui in mozilla applications and the main library is called libxul, mostly the name is a hangover from that that has now stuck.
xulauncher - Archive of obsolete content
me/chrome.manifest" xulprefs="$wd/$xulname/defaults/preferences/prefs.js" # make minimal directory structure ############################################################################## mkdir -p $xuldir mkdir -p $xulprefdir # create application.ini file ############################################################################## echo " [app] vendor=xulauncher.sh name=$xulname version=0.0.1 b
uildid=`date +%y%m%d` [gecko] minversion=1.8 maxversion=1.9 ">$xulappini # create chrome.manifest file ############################################################################## echo " content $xulname file:$xulname/ ">$xulmanifest # create prefs.js file ############################################################################## echo " pref(\"toolkit.defaultchromeuri\", \"chrome://$xulname...