Search completed in 0.94 seconds.
import - JavaScript
the static
import statement is used to
import read only live bindings which are exported by another module.
...
imported modules are in strict mode whether you declare them as such or not.
... the
import statement cannot be used in embedded scripts unless such script has a type="module".
...And 37 more matches
SubtleCrypto.importKey() - Web APIs
the
importkey() method of the subtlecrypto interface
imports a key: that is, it takes as input a key in an external, portable format and gives you a cryptokey object that you can use in the web crypto api.
... the function accepts several
import formats: see supported formats for details.
... syntax const result = crypto.subtle.
importkey( format, keydata, algorithm, extractable, usages ); parameters format is a string describing the data format of the key to
import.
...And 24 more matches
nsIPlacesImportExportService
toolkit/components/places/nsiplaces
importexportservice.idlscriptable provides methods for exporting places data.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) in the past, this interface also offered methods for
importing places data, but those methods are now part of the bookmarkhtmlutils.jsm javascript code module.
... implemented by: @mozilla.org/
import-export-service;1 as a service: var places
importexportservice = components.classes["@mozilla.org/
import-export-service;1"] .getservice(components.interfaces.nsiplaces
importexportservice); method overview void backupbookmarksfile(); void exporthtmltofile(in nsilocalfile afile); void
importhtmlfromfile(in nsilocalfile afile, in boolean aisinitial
import); obsolete since gecko 14.0 void
importhtmlfromfiletofolder(in nsilocalfile afile, in print64 afolder, in boolean aisinitial
import); obsolete since gecko 14.0 void
importhtmlfromuri(in nsiuri auri, in boolean aisinitial
import); obsolete sin...
...And 22 more matches
@import - CSS: Cascading Style Sheets
the @
import css at-rule is used to
import style rules from other style sheets.
... syntax @
import url; @
import url list-of-media-queries; @
import url supports( supports-query ); @
import url supports( supports-query ) list-of-media-queries; where: url is a <string> or a <url> representing the location of the resource to
import.
... description
imported rules must precede all other types of rules, except @charset rules; as it is not a nested statement, @
import cannot be used inside conditional group at-rules.
...And 11 more matches
PR ImportTCPSocket
imports a native tcp socket into nspr.
... syntax #include "private/pprio.h" prfiledesc* pr_
importtcpsocket(prosfd osfd); parameters the function has the following parameters: osfd the native file descriptor for the tcp socket to
import.
... returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly
imported native tcp socket.
...And 8 more matches
Components.utils.importGlobalProperties
imports various objects into a system scope.
...using this api you can
import these objects into such a system scope.
...to
import these objects into a sandbox, use the wantglobalproperties option in the sandbox constructor.
...And 8 more matches
Document.importNode() - Web APIs
the document object's
importnode() method creates a copy of a node or documentfragment from another document, to be inserted into the current document later.
... the
imported node is not yet included in the document tree.
...the
imported node is a clone of the original.
...And 8 more matches
Components.utils.import
components.utils.
import was introduced in firefox 3 and is used for sharing code between different scopes easily.
... for example, you can
import xpcomutils.jsm to avoid copy/pasting long xpcom component registration boilerplate in your component files.
... syntax components.utils.
import(url [, scope]); // or, if you use a tool such as jslint which reports compiler errors for the above, components.utils["
import"](url [, scope]); parameters url a string of the url of the script to be loaded.
...And 7 more matches
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
the html strong
importance element (<strong>) indicates that its contents have strong
importance, seriousness, or urgency.
... usage notes the <strong> element is for content that is of "strong
importance," including things of great seriousness or urgency (such as warnings).
... this could be a sentence that is of great
importance to the whole page, or you could merely try to point out that some words are of greater
importance compared to nearby content.
...And 6 more matches
import.meta - JavaScript
the
import.meta object exposes context-specific metadata to a javascript module.
... syntax
import.meta description the syntax consists of the keyword
import, a dot, and the identifier meta.
... normally the left-hand side of the dot is the object on which property access is performed, but here
import is not really an object.
...And 5 more matches
WebAssembly.Module.imports() - JavaScript
the webassembly.
imports() function returns an array containing descriptions of all the declared
imports of the given module.
... syntax webassembly.module.
imports(module); parameters module a webassembly.module object.
... return value an array containing objects representing the
imported functions of the given module.
...And 4 more matches
importUserCertificates - Archive of obsolete content
resultstring = crypto.
importusercertificates("nicknamestring","certstring",forcebackup); argument description "nicknamestring" this is the nickname that will be used to describe the certificate in the client's certificate management ui.
... the
importusercertificates() method is used to
import newly issued certificates for the user.
...the request id in the response being
imported must match the request id in the associated certification request or recovery request.
...And 2 more matches
WorkerGlobalScope.importScripts() - Web APIs
the
importscripts() method of the workerglobalscope interface synchronously
imports one or more scripts into the worker's scope.
... syntax self.
importscripts('foo.js'); self.
importscripts('foo.js', 'bar.js', ...); parameters a comma-separated list of domstring objects representing the scripts to be
imported.
... exceptions networkerror
imported scripts were not served with a valid javascript mime type (i.e.
...And 2 more matches
HTML Imports - Web Components
firefox will not ship html
imports in its current form.
... html
imports is intended to be the packaging mechanism for web components, but you can also use html
imports by itself.
... you
import an html file by using a <link> tag in an html document like this: <link rel="
import" href="myfile.html"> the
import link type is new.
... specification specification status comment html
imports working draft initial definition.
<xsl:apply-imports> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:apply-
imports> element is fairly arcane, used mostly in complex stylesheets.
...
import precedence requires 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 equivalent rule in the main stylesheet.
... syntax <xsl:apply-
imports/> required attributes none.
<xsl:import> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:
import> element is a top-level element that serves to
import the contents of one stylesheet into another stylesheet.
... generally speaking, the contents of the
imported stylesheet have a lower
import precedence than that of the
importing stylesheet.
... syntax <xsl:
import href=uri /> required attributes href specifies the uri of the stylesheet to
import.
... type top-level, must appear before any other child of <xsl:stylesheet> or <xsl:transform> in the
importing stylesheet.
Window.importDialog() - Archive of obsolete content
summary because opening windows on mobile isn't necessarily appropriate, the firefox mobile team designed the
importdialog() method to replace window.opendialog().
... syntax newdialog =
importdialog(aparent, asrc, aarguments) newdialog the opened window aparent the dialog's parent; can be null.
... example var dialog =
importdialog(null, "chrome://myextension/content/dialog.xul", myobject); notes the xul passed to
importdialog() is very similar to xul passed to window.opendialog(), with some limitations and caveats: only <dialog> top level elements are permitted.
EcKeyImportParams - Web APIs
the eckey
importparams dictionary of the web crypto api represents the object that should be passed as the algorithm parameter into subtlecrypto.
importkey() or subtlecrypto.unwrapkey(), when generating any elliptic-curve-based key pair: that is, when the algorithm is identified as either of ecdsa or ecdh.
...this may be any of the following names for nist-approved curves: p-256 p-384 p-521 examples see the examples for subtlecrypto.
importkey().
... specifications specification status comment web cryptography apithe definition of 'subtlecrypto.eckey
importparams' in that specification.
HmacImportParams - Web APIs
the hmac
importparams dictionary of the web crypto api represents the object that should be passed as the algorithm parameter into subtlecrypto.
importkey() or subtlecrypto.unwrapkey(), when generating a key for the hmac algorithm.
... examples see the examples for subtlecrypto.
importkey().
... specifications specification status comment web cryptography apithe definition of 'subtlecrypto.hmac
importparams' in that specification.
RsaHashedImportParams - Web APIs
the rsahashed
importparams dictionary of the web crypto api represents the object that should be passed as the algorithm parameter into subtlecrypto.
importkey() or subtlecrypto.unwrapkey(), when
importing any rsa-based key pair: that is, when the algorithm is identified as any of rsassa-pkcs1-v1_5, rsa-pss, or rsa-oaep.
... examples see the examples for subtlecrypto.
importkey().
... specifications specification status comment web cryptography apithe definition of 'subtlecrypto.rsahashed
importparams' in that specification.
PR_ImportFileMapFromString
syntax #include <prshma.h> nspr_api( prfilemap * ) pr_
importfilemapfromstring( const char *fmstring ); parameter the function has the following parameter: fmstring a pointer to string created by pr_exportfilemapasstring.
... description pr_
importfilemapfromstring creates a prfilemap object from a string previously created by pr_exportfilemapasstring.
JavaScript modules - JavaScript
it has therefore made sense in recent years to start thinking about providing mechanisms for splitting javascript programs up into separate modules that can be
imported when needed.
... browser support use of native javascript modules is dependent on the
import and export statements; these are supported in browsers as follows:
import desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.js
importchrome full support 61edge full support 16 ...
...see node's ecmascript modules documentation for more details.disabled from version 8.5.0: this feature is behind the --experimental-modules runtime flag.dynamic
importchrome full support 63edge full support 79firefox full support 67 full support 67 no support 66 — 67disabled disabled from version 66 until version 67 (exclusive): this feature is behind the j...
...And 37 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.
... mostly myth: msaa is too expensive to implement reality: *too* expensive is relative, and depends on how
important accessibility is for your project.
... this document's deciding which msaa features to support section attempts to lower the cost by showing which parts of msaa are not very
important to work on.
...And 27 more matches
TypeScript support in Svelte - Learn web development
you'll also have to update any corresponding
import statements (don't include the .ts in your
import statements; typescript chose to omit the extensions).
...from that version onward you have to use export/
import type syntax to
import types and interfaces.
... let's
import the type and use it to declare the todo property.
...And 25 more matches
Index
nss offers lots of functionality; we'll walk through the list of modules, design principles, and
important relevant standards.
...(note that it's
important to look at the number 11, as there are other pkcs standards with different numbers that define quite 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.
...once you have
imported certificates and keys into the nss database, you can easily look them up and use them again.
...And 23 more matches
sslfnc.html
important: this nss function is not intended for use with ssl, which requires that the certificate and key database files be opened.
...
important: turning this option off means that your code will not comply with the tls 3.1 and ssl 3.0 specifications regarding rollback attack and will therefore be vulnerable to this form of attack.
... as mentioned in communication, when an application
imports a socket into ssl after the tcp connection on that socket has already been established, it must call ssl_resethandshake to determine whether the socket is for a client or server.
...And 22 more matches
Understanding WebAssembly text format - WebAssembly
nally equivalent 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 functions from javascript we have already seen javascript calling webassembly functions, but what about webassembly calling javascript functions?
... webassembly doesn’t actually have any built-in knowledge of javascript, but it does have a general way to
import functions that can accept either javascript or wasm functions.
... let’s look at an example: (module (
import "console" "log" (func $log (param i32))) (func (export "logit") i32.const 13 call $log)) webassembly has a two-level namespace so the
import statement here is saying that we’re asking to
import the log function from the console module.
...And 22 more matches
Using JavaScript code modules
the module is loaded into a specific javascript scope, such as xul script or javascript xpcom script, using components.utils.
import() or components.utils["
import"]().
...any javascript item named in exported_symbols will be exported from the module and injected into the
importing scope.
... 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 build id (e.g., the version) before your next test run; otherwise, you may find yourself running the previous version of your module's code.
...And 19 more matches
Working with Svelte stores - Learn web development
give it the following content:
import { writable } from 'svelte/store' export const alert = writable('welcome to the to-do list app!') note: stores can be defined and used outside of svelte components, so you can organize them in any way you please.
... in the above code we
import the writable() function from svelte/store and use it to create a new store called alert with an initial value of "welcome to the to-do list app!".
... give it the following content: <script>
import { alert } from '../stores.js'
import { ondestroy } from 'svelte' let alertcontent = '' const unsubscribe = alert.subscribe(value => alertcontent = value) ondestroy(unsubscribe) </script> {#if alertcontent} <div on:click={() => alertcontent = ''}> <p>{ alertcontent }</p> </div> {/if} <style> div { position: fixed; cursor: pointer; margin-right: 1.5rem; margin-left: 1.5rem; margin-top: 1rem; right: 0; display: flex; align-items: center; border-radius: 0.2rem; background-color: #565656; color: #fff; ...
...And 18 more matches
Index - Learn web development
beyond mechanical use, it's
important to learn how to use these technologies responsibly so that all readers might use your creations on the web.
... at, accessibility, article, beginner, css, codingscripting, html, javascript, learn, tools, users, assistive technology, keyboard, screan reader, screenreader this article should have given you a useful high-level overview of accessibility, shown you why it's
important, and looked at how you can fit it into your workflow.
... 49 asynchronous javascript beginner, codingscripting, guide, javascript, landing, promises, async, asynchronous, await, callbacks, requestanimationframe, setinterval, settimeout in this module we take a look at asynchronous javascript, why it is
important, and how it can be used to effectively handle potential blocking operations such as fetching resources from a server.
...And 17 more matches
sslerr.html
sec_error_
importing_certificates -8115 error attempting to
import certificates.
... sec_error_pkcs12_decoding_pfx -8114 unable to
import.
... sec_error_pkcs12_invalid_mac -8113 unable to
import.
...And 16 more matches
Index - Web APIs
it is especially
important in games and musical applications where large numbers of individual sounds are played simultaneously, where you want to control the overall signal level and help avoid clipping (distorting) of the audio output.
... 474 cssstylesheet.ownerrule @
import, api, css, cssom, cssom api, cssstylesheet, layout, object model, property, read-only, reference, stylesheet,
import, ownerrule the read-only cssstylesheet property ownerrule returns the css
importrule corresponding to the @
import at-rule which
imported the stylesheet into the document.
...if we want to apply colors to a shape, there are two
important properties we can use: fillstyle and strokestyle.
...And 16 more matches
Getting started with React - Learn web development
the public directory contains files that will be read by your browser while you're developing the app; the most
important of these is index.html.
...accurate page titles are
important for accessibility!
...this file contains our first component, app, and a few other lines of code:
import react from 'react';
import logo from './logo.svg';
import './app.css'; function app() { return ( <div classname="app"> <header classname="app-header"> <img src={logo} classname="app-logo" alt="logo" /> <p> edit <code>src/app.js</code> and save to reload.
...And 15 more matches
Specificity - CSS: Cascading Style Sheets
the !
important exception when an
important rule is used on a style declaration, this declaration overrides any other declarations.
... although technically !
important has nothing to do with specificity, it interacts directly with it.
... using !
important, however, is bad practice and should be avoided because it makes debugging more difficult by breaking the natural cascading in your stylesheets.
...And 15 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
put the following content into your moreactions.svelte file: <script>
import { createeventdispatcher } from 'svelte' const dispatch = createeventdispatcher() let completed = true const checkall = () => { dispatch('checkall', completed) completed = !completed } const removecompleted = () => dispatch('removecompleted') </script> <div class="btn-group"> <button type="button" class="btn btn__primary" on:click={checkall}>{completed ?
... back over in todos.svelte, we are going to
import our moreactions component and create two functions to handle the events emitted by the moreactions component.
... add the following
import statement below the existing ones:
import moreactions from './moreactions.svelte' then add the described functions at the end of the <script> section: const checkalltodos = (completed) => todos.foreach(t => t.completed = completed) const removecompletedtodos = () => todos = todos.filter(t => !t.completed) now go to the bottom of the todos.svelte markup section and replace the btn-group <div> that we copied into moreactions.svelte with a call to the moreactions component, like so: <!-- moreactions --> <moreactions on:checkall={e => checkalltodos(e.detail)} on:removecompleted={removecompletedtodos} /> ok, let's go back into the app and try it out!
...And 14 more matches
Index - Archive of obsolete content
unfortunately, javascript does not yet have native support for modules: it has to rely on the host application to provide it with functionality such as loading subscripts, and exporting/
importing names.
... 311 bookmarks.
import() api, add-ons, bookmarks, extensions, method, non-standard, reference, webextensions,
import imports bookmarks from an html bookmark file.
... 496
importusercertificates nss the
importusercertificates() method is used to
import newly issued certificates for the user.
...And 13 more matches
NSS Certificate Download Specification
the only significant field in the signeddata object is the certificates field, which may contain multiple certificates to be
imported together.
... netscape certificate sequence: this is another pkcs#7 object format, and like the signeddata format, it allows multiple certificates to be
imported together.
... text formats any of the above binary formats can also be
imported in text form.
...And 13 more matches
Writing Skinnable XUL and CSS - Archive of obsolete content
if inheriting the global skin, a skin file must
import the global skin explicitly.
... if your skin file wishes to inherit the global skin, then it should
import the global skin explicitly.
... this is done using an @
import directive placed at the top of the file.
...And 12 more matches
HTML text fundamentals - Learn web development
search engines indexing your page consider the contents of headings as
important keywords for influencing the page's search rankings.
...more
importantly, its semantic value will be used in multiple ways, for example by search engines and screen readers (as mentioned above).
... emphasis and
importance in human language, we often emphasise certain words to alter the meaning of a sentence, and we often want to mark certain words as
important or different in some way.
...And 10 more matches
Scripting Java
rhino provides a top-level function
importpackage that serves the same purpose as java's
import declaration.
... for example, we could
import all of the classes in the java.io package and access class java.io.file using just the name file: js>
importpackage(java.io) js> file [javaclass java.io.file] here
importpackage(java.io) makes all the classes in the java.io package (such as file) available at the top level.
... it's equivalent in effect to the java declaration
import java.io.*;.
...And 10 more matches
Using the WebAssembly JavaScript API - WebAssembly
now, to help us understand what is going on here, let’s look at the text representation of our wasm module (which we also meet in converting webassembly format to wasm): (module (func $i (
import "
imports" "
imported_func") (param i32)) (func (export "exported_func") i32.const 42 call $i)) in the second line, you will see that the
import has a two-level namespace — the internal function $i is
imported from
imports.
imported_func.
... we need to reflect this two-level namespace in javascript when writing the object to be
imported into the wasm module.
... create a <script></script> element in your html file, and add the following code to it: var
importobject = {
imports: {
imported_func: arg => console.log(arg) } }; streaming the webassembly module new in firefox 58 is the ability to compile and instantiate webassembly modules directly from underlying sources.
...And 10 more matches
Python binding for NSS
the source code to python-nss was first
imported into the mozilla cvs repository on june 9th 2009.
...all prior cvs information (including release tags) were
imported into the new mercurial repositories, as such there is no need to utilize the deprecated cvs repositories, use mercurial instead.
... fix bug #922247, pkcs12decoder.database_
import() method.
...And 9 more matches
Index
in this case it can be
important to be able to force a garbage collection cycle from javascript.
... 40 components.utils.
import needscontent, xpcom:language bindings, xpconnect components.utils.
import was introduced in firefox 3 and is used for sharing code between different scopes easily.
... for example, you can
import xpcomutils.jsm to avoid copy/pasting long xpcom component registration boilerplate in your component files.
...And 9 more matches
Cascade and inheritance - Learn web development
conflicting rules css stands for cascading style sheets, and that first word cascading is incredibly
important to understand — the way that the cascade behaves is key to understanding css.
... there are three factors to consider, listed here in increasing order of
importance.
... later ones overrule earlier ones: source order specificity
importance we will look at these to see how browsers figure out exactly what css should be applied.
...And 8 more matches
Componentizing our React app - Learn web development
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.
...open it up and give it its first line:
import react from "react"; since we're going to make a component called todo, you can start adding the code for that to todo.js too, as follows.
...in app.js, add the following line near the top of the file to
import todo:
import todo from "./components/todo"; with this component
imported, you can replace all of the <li> elements in app.js with <todo /> component calls.
...And 8 more matches
Examples
components.utils.
import("resource://gre/modules/osfile.jsm") let path = os.path.join(os.constants.path.tmpdir, "file.txt"); let promise = os.file.exists(path); let newpromise = promise.then(function onfulfill(aexists) { if (aexists) { console.log("you have file.txt in your temporary directory."); } else { throw new error("you don't have file.txt in your temporary directory."); } }); // unexpected errors should always be reported at the end of a promise chain.
... components.utils.
import("resource://gre/modules/osfile.jsm") let path = os.path.join(os.constants.path.tmpdir, "file.txt"); let promise = os.file.exists(path); let newpromise = promise.then(function onfulfill(aexists) { if (aexists) { console.log("you have file.txt in your temporary directory."); } else { console.log("you don't have file.txt in your temporary directory."); } }); // unexpected errors should always be reported at the end of a promise chain.
... using a promise returned by a function (compact) the same code as the previous example is usually written with a more compact syntax: components.utils.
import("resource://gre/modules/osfile.jsm") let path = os.path.join(os.constants.path.tmpdir, "file.txt"); os.file.exists(path).then(exists => { console.log(exists ?
...And 8 more matches
An overview of NSS Internals
nss offers lots of functionality; we'll walk through the list of modules, design principles, and
important relevant standards.
...(note that it's
important to look at the number 11, as there are other pkcs standards with different numbers that define quite 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.
...once you have
imported certificates and keys into the nss database, you can easily look them up and use them again.
...And 8 more matches
SubtleCrypto.unwrapKey() - Web APIs
it decrypts the key and then
imports it, returning a cryptokey object that can be used in the web crypto api.
... as with subtlecrypto.
importkey(), you specify the key's
import format and other attributes of the key to
import details such as whether it is extractable, and which operations it can be used for.
... but because unwrapkey() also decrypts the key to be
imported, you also need to pass in the key that must be used to decrypt it.
...And 8 more matches
WebAssembly.instantiate() - JavaScript
important: this method is not the most efficient way of fetching and instantiating wasm modules.
... syntax primary overload — taking wasm binary code promise<resultobject> webassembly.instantiate(buffersource,
importobject); parameters buffersource a typed array or arraybuffer containing the binary code of the .wasm module you want to compile.
...
importobject optional an object containing the values to be
imported into the newly-created instance, such as functions or webassembly.memory objects.
...And 8 more matches
Appendix D: Loading Scripts - Archive of obsolete content
the examples below which make use of the services global assume that you're previously
imported the services.jsm module.
...because these scripts are loaded from a bytecode cache, and the same scripts are loaded only once per session no matter how many times they are
imported, this is one of the most performant methods of script loading.
...additionally, scripts are loaded only once globally per session, and therefore have virtually no overhead for multiple
imports.
...And 7 more matches
Code snippets - Archive of obsolete content
components.utils.
import("resource://services-sync/main.js"); // obtain a reference to the main firefox window.
... mainwindow.gbrowser.addtab(url); } } partially corrupt a server components.utils.
import("resource://services-sync/main.js"); components.utils.
import("resource://services-sync/resource.js"); function deletepath(path) { let resource = new resource(weave.service.storageurl + path); resource.setheader("x-confirm-delete", "1"); return resource.delete(); } // delete meta/global: deletepath("meta/global"); // delete keys: deletepath("crypto/keys"); // delete server: deletepath(""...
...); corrupt a single engine on the server let engine = "bookmarks"; components.utils.
import("resource://services-sync/main.js"); components.utils.
import("resource://services-sync/resource.js"); components.utils.
import("resource://services-sync/util.js"); let r = new resource(weave.service.storageurl + "meta/global"); let g = r.get(); let envelope = json.parse(g); let payload = json.parse(envelope.payload); payload.engines[engine].syncid = weave.utils.makeguid(); // or any other guid you like.
...And 7 more matches
nsIContentPolicy - Archive of obsolete content
important: this type is mapped to type_script before being passed to content policy implementations, and should not be used outside gecko core code.
...
important: this type is mapped to type_script before being passed to content policy implementations, and should not be used outside gecko core code.
...
important: this type is mapped to type_script before being passed to content policy implementations, and should not be used outside gecko core code.
...And 7 more matches
export - JavaScript
the export statement is used when creating javascript modules to export live bindings to functions, objects, or primitive values from the module so they can be used by other programs with the
import statement.
... bindings that are exported can still be modified locally; when
imported, although they can only be read by the
importing module the value updates whenever it is updated by the exporting module.
... // default exports export default expression; export default function (…) { … } // also class, function* export default function name1(…) { … } // also class, function* export { name1 as default, … }; // aggregating modules export * from …; // does not set the default export export * as name1 from …; // draft ecmascript® 2o21 export { name1, name2, …, namen } from …; export {
import1 as name1,
import2 as name2, …, namen } from …; export { default } from …; namen identifier to be exported (so that it can be
imported via
import in another script).
...And 7 more matches
Web Performance
it is
important to minimize the loading and response times and add additional features to conceal latency by making the experience as available and interactive as possible, as soon as possible, while asynchronously loading in the longer tail parts of the experience.
...instead, we're going to look at a more
important issue when building web apps: starting up as asynchronously as possible.
...s to understand how the browser works.recommended web performance timings: how long is too long?there are no clear set rules as to what constitutes a slow pace when loading pages, but there are specific guidelines for indicating content will load (1 second), idling (50ms), animating (16.7s) and responding to user input (50 to 200ms).the business case for web performanceyou know web performance is
important, but how do you convince clients and management to invest in performance and make it a priority.
...And 7 more matches
Index - XSLT: Extensible Stylesheet Language Transformations
once instantiated, an xsltprocessor has an xsltprocessor.
importstylesheet() method that takes as an argument the xslt stylesheet to be used in the transformation.
... the stylesheet has to be passed in as an xml document, which means that the .xsl file has to be loaded by the page before calling xsltprocessor.
importstylesheet().
...the structure of an xml document is designed to reflect and clarify
important relationships among the individual aspects of the content itself, unhindered by a need to provide any indication about how this data should eventually be presented.
...And 7 more matches
Module structure of the SDK - Archive of obsolete content
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 require which a module can use to
import the exports object of another module.
... to
import a local module, specify a path relative to the
importing module.
... for example, the following add-on contains an additional module directly under "lib", and other modules under subdirectories of "lib": my-addon lib main.js password-dialog.js secrets hash.js storage password-store.js to
import modules into main: // main.js code var dialog = require("./password-dialog"); var hash = require("./secrets/hash"); to
import modules into password-store: // password-store.js code var dialog = require("../password-dialog"); var hash = require("../secrets/hash"); external modules as well as using the sdk's modules and writing your own, you can use modules that have been developed outside the sdk and made available to other add-on authors.
...And 6 more matches
File I/O - Archive of obsolete content
creating an nsifile object components.utils.
import("resource://gre/modules/fileutils.jsm"); var file = new fileutils.file("/home"); or the same without using fileutils.jsm: var file = components.classes["@mozilla.org/file/local;1"].
... getting files in special directories components.utils.
import("resource://gre/modules/fileutils.jsm"); // get the "data.txt" file in the profile directory var file = fileutils.getfile("profd", ["data.txt"]); or the same without using fileutils.jsm: // get profile directory.
...however, you can enumerate available drives using the following code: components.utils.
import("resource://gre/modules/fileutils.jsm"); var root = new fileutils.file("\\\\."); var drivesenum = root.directoryentries, drives = []; while (drivesenum.hasmoreelements()) { drives.push(drivesenum.getnext().
...And 6 more matches
Finding window handles - Archive of obsolete content
recall that nsibasewindow -> nativehandle returns the following in the different operating systems: windows - hwnd mac os x - nswindow* linux - gdkwindow* (it will be gdkwindow* no matter what desktop/window manager) is in use, for explanation why see the article: standard os libraries - unix section) windows components.utils.
import('resource://gre/modules/services.jsm'); var browserwindow = services.wm.getmostrecentwindow('navigator:browser'); if (!browserwindow) { throw new error('no browser window found'); } var basewindow = browserwindow.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) ...
... .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var hwndstring = basewindow.nativehandle; components.utils.
import('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('no browser window found'); } var basewindow = browserwindow.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var nswindowstring = basewindow.nativehandle; components.utils.
import('resource://gre/modules/ctypes.jsm'); var objc = ctypes.open(ctypes.libraryname('obj...
...And 6 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
the xslt document,
imported by the xsltprocessor, allows you to manipulate xslt parameters.
...below is an example: var xslstylesheet; var xsltprocessor = new xsltprocessor(); // load the xslt file, example1.xsl var myxmlhttprequest = new xmlhttprequest(); myxmlhttprequest.open("get", "example1.xsl", false); myxmlhttprequest.send(null); // get the xml document and
import it xslstylesheet = myxmlhttprequest.responsexml; xsltprocessor.
importstylesheet(xslstylesheet); // load the xml file, example1.xml myxmlhttprequest = new xmlhttprequest(); myxmlhttprequest.open("get", "example1.xml", false); myxmlhttprequest.send(null); var xmlsource = myxmlhttprequest.responsexml; var resultdocument = xsltprocessor.transformtodocument(xmlsource); after creating an xsltproc...
...the xmlhttprequest's responsexml member contains the xml document of the xslt file, which is passed to
importstylesheet.
...And 6 more matches
HTML: A good basis for accessibility - Learn web development
— you'll keep seeing a common theme: the
importance of using semantic html (sometimes called posh, or plain old semantic html).
... you might wonder why this is so
important.
... good for seo — search engines give more
importance to keywords inside headings, links, etc.
...And 6 more matches
HTML: A good basis for accessibility - Learn web development
— you'll keep seeing a common theme: the
importance of using semantic html (sometimes called posh, or plain old semantic html).
... you might wonder why this is so
important.
... good for seo — search engines give more
importance to keywords inside headings, links, etc.
...And 6 more matches
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 requires four key steps:
import xpcomutils.jsm, as explained previously.
...verview function definelazygetter(aobject, aname, alambda); function definelazymodulegetter(aobject, aname, aresource, [optional] asymbol); function definelazyservicegetter(aobject, aname, acontract, ainterfacename); function generatensgetfactory(componentsarray); function generateci(classinfo); function generateqi(interfaces); void
importrelative(that, path, scope); generator itersimpleenumerator(enumerator, interface); generator iterstringenumerator(enumerator); attributes attribute type description categorymanager nsicategorymanager returns a reference to nsicategorymanager.
...the module will not be
imported until first use.
...And 6 more matches
NSS tools : pk12util
nss tools : pk12util name pk12util — export and
import keys and certificate to or from a pkcs #12 file and the nss database synopsis pk12util [-i p12file|-l p12file|-o p12file] [-d [sql:]directory] [-h tokenname] [-p dbprefix] [-r] [-v] [-k slotpasswordfile|-k slotpassword] [-w p12filepasswordfile|-w p12filepassword] description the pkcs #12 utility, pk12util, enables sharing certificates among any server that supports pkcs#12.
... the tool can
import certificates and keys from pkcs#12 files into security databases, export certificates, and list certificates and keys.
... options and arguments options -i p12file
import keys and certificates from a pkcs#12 file into a security database.
...And 6 more matches
NSS tools : pk12util
name pk12util — export and
import keys and certificate to or from a pkcs #12 file and the nss database synopsis pk12util [-i p12file [-h tokenname] [-v] [common-options] ] [ -l p12file [-h tokenname] [-r] [common-options] ] [ -o p12file -n certname [-c keycipher] [-c certcipher] [-m|--key_len keylen] [-n|--cert_key_len certkeylen] [common-options] ] [ common-options are: [-d [sql:]directory] [-p dbprefix] [-k slotpasswordfile|-k slotpassword] [-w p12filepasswordfile|-w p12filepassword] ] description the pkcs #12 utility, pk12util, enables sharing certificates among any server that supports pkcs#12.
... the tool can
import certificates and keys from pkcs#12 files into security databases, export certificates, and list certificates and keys.
... options and arguments options -i p12file
import keys and certificates from a pkcs#12 file into a security database.
...And 6 more matches
Web Accessibility: Understanding Colors and Luminance - Accessibility
understaning color, luminance, and saturation is
important in meeting wcag 2 accessibility guidelines 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.
... luminance is of particular
importance, however, because at the end of the day, understanding of what it is and how it is employed enables accessibility for those who are color-blind, as well as those who can perceive color.
..."luminance" and "saturation" are particularly
important to get right.
...And 6 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
step 1: use services.jsm if you load one of mozilla's internal jsm files, for example services.jsm, you'll do so via privileged javascript code like this: components.utils.
import("resource://gre/modules/services.jsm"); from here on out, it is assumed you've
imported services.jsm somewhere at the top of whatever file you're in and will be using it in all code examples.
...you can use chrome:// uris with "components.utils.
import()" just fine; in fact you've been able to since firefox 4.
... step 2a: load your jsm from chrome:// now with that preface out of the way, this part is easy: drop support for firefox 3.x if you haven't already, move your jsm files to wherever you've got your chrome mapping to for your xul overlay and/or windows,
import your files from that new chrome mapped path instead of the old resource one, and remove your "resource" line from your chrome.manifest file.
...And 5 more matches
Adding Style Sheets - Archive of obsolete content
<spacer class="titlespace"/> <hbox> <progressmeter id="progmeter" value="50%" style="display:none;"/> the new xml-stylesheet line is used to
import the style sheet.
...
importing style sheets we've already seen how to
import style sheets for use.
...it
imports the bookmarks style sheet, which is bookmarks.css.
...And 5 more matches
Introducing a complete toolchain - Learn web development
the latest built-in javascript features (at time of writing), such as
import.
...there might be
important decorations or music that help with your mental state — these are all
important to doing your best work possible, and they should also only need to be set up once, if done properly.
...this lets you get on with what's
important: the creative work.
...And 5 more matches
Package management basics - Learn web development
in addition, package managers handle duplicate dependencies (something that becomes
important and common in front-end development).
...although there tend to be more pros for installing globally, the pros for installing locally are more
important — such as code portability and version locking.
... what is
important is that you ensure you've chosen the best registry for you.
...And 5 more matches
WebRequest.jsm
usage to
import webrequest, use code like: let {webrequest} = cu.
import("resource://gre/modules/webrequest.jsm", {}); the webrequest object has the following properties, each of which corresponds to a specific stage in executing a web request: onbeforerequest onbeforesendheaders onsendheaders onheadersreceived onresponsestarted oncompleted each of these objects defines two functions: addlistener(c...
... to specify match patterns, first
import the "matchpattern.jsm" module, then construct a matchpattern.
... the matchpattern constructor accepts: either: a string defining a single pattern or: an array of such strings cu.
import("resource://gre/modules/matchpattern.jsm"); let pattern = new matchpattern("https:/developer.mozilla.org/*"); cu.
import("resource://gre/modules/matchpattern.jsm"); let pattern = new matchpattern(["https://mozorg.cdn.mozilla.net/*", "https://mdn.mozillademos.org/*", "https://developer.cdn.mozilla.net/*"]); see the match patterns article for details on the syntax of the strings you supply.
...And 5 more matches
Promises - Archive of obsolete content
a task example like the following: components.utils.
import("resource://gre/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 p...
... representative example usage components.utils.
import("resource://gre/modules/osfile.jsm"); task.spawn(function* () { // retrieve file metadata to check modification time.
... representative example usage components.utils.
import("resource://gre/modules/downloads.jsm"); task.spawn(function* () { // fetch a file in the background.
...And 4 more matches
Search Extension Tutorial (Draft) - Archive of obsolete content
while the technical details below are
important to understand, a library which encapsulates the appropriate logic is provided along with the example add-on at the end, and should be used where possible.
...the following example bootstrap.js file illustrates the method: const { classes: cc, interfaces: ci, utils: cu, results: cr } = components; //
import the services module.
... cu.
import("resource://gre/modules/services.jsm"); // keep track of whether this is the first run.
...And 4 more matches
JavaScript crypto - Archive of obsolete content
services are provided to enable: smart card events, generating certificate requests,
importing user certs, generating random numbers, logging out of your tokens, and signing text.
... generating keys and issuing user certificates there are several crypto object methods used in generating keys for certificates: generatecrmfrequest(),
importusercertificates().
... the
importusercertificates() function loads certificates into the nss database or smartcard if the corresponding key is found there.
...And 4 more matches
Modularization techniques - Archive of obsolete content
queryinterface() has several
important characteristics that must be maintained.
...this
important behavior is the only reliable mechanism for determining whether interfaces a and b are implemented by the same object.for simple objects, maintaining these behaviors is easy.
...a factory allows an implementor to hide both the class declaration and creation details of an object, an extremely
important step for allowing maximum flexibility in the implementation of a class and reducing compile time dependencies.
...And 4 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
most
importantly, a certificate always includes the digital signature of the issuing ca.
...however, it's
important to note that these two assumptions are true only if unauthorized personnel have not gained access to the user's machine or password, the password for the client software's private key database has been set, and the software is set up to request the password at reasonable frequent intervals.
...this is
important for many forms of business communication.
...And 4 more matches
Web fonts - Learn web development
there are two
important things to bear in mind about web fonts: browsers support different font formats, so you'll need multiple font formats for decent cross-browser support.
... open up the stylesheet.css file and copy both the @font-face blocks contained inside into your web-font-start.css file — you need to put them at the very top, before any of your css, as the fonts need to be
imported before you can use them on your site.
... each of the url() functions points to a font file that we want to
import into our css — we need to make sure the paths to the files are correct, so add fonts/ to the start of each path (adjust as necessary).
...And 4 more matches
How to build custom form controls - Learn web development
in particular, it's
important to clearly define all the states of your control.
... once we know how to change states, it is
important to define how to change the control's value: the value changes when: the user clicks on an option when the control is in the open state.
...this is
important to make sure that we don't bind our css and javascript to a strong html structure, so that we can make implementation changes later without breaking code that uses the control.
...And 4 more matches
Ember interactivity: Events, classes and state - Learn web development
to create a header class to go with your header component, type this in to your terminal: ember generate component-class header this will create the following empty class file — todomvc/app/components/header.js:
import component from '@glimmer/component'; export default class headercomponent extends component { } inside this file we will implement the event handler code.
... update the content to the following:
import component from '@glimmer/component';
import { action } from '@ember/object'; export default class headercomponent extends component { @action onkeydown({ target, key }) { let text = target.value.trim(); let hasvalue = boolean(text); if (key === 'enter' && hasvalue) { alert(text); target.value = '' } } } the @action decorator is the only ember-specific code here (aside from extending from the component superclass, and the ember-specific items we are
importing using javascript module syntax) — the rest of the file is vanilla javascript, and would work in any application.
...d to generate a service for us to store our todo-list data in: ember generate service todo-data this should give you a terminal output like so: installing service create app/services/todo-data.js installing service-test create tests/unit/services/todo-data-test.js this creates a todo-data.js file inside the todomvc/app/services directory to contain our service, which initially contains an
import statement and an empty class:
import service from '@ember/service'; export default class tododataservice extends service { } first of all, we want to define what a todo is.
...And 4 more matches
React interactivity: Events and state - Learn web development
there are a couple of other things to note: the camel-cased nature of onclick is
important — jsx will not recognize onclick (again, it is already used in javascript for a specific purpose, which is related but different — standard onclick handler properties).
... to use a react hook, we need to
import it from the react module.
... in form.js, change your very first line so that it reads like this:
import react, { usestate } from "react"; this allows us to
import the usestate() function by itself, and utilize it anywhere in this file.
...And 4 more matches
Getting started with Svelte - Learn web development
first steps with svelte being a compiler, you can't just add a <script src="svelte.js"> tag to your page and
import it into your app.
...variables declared (or
imported) at the top level are 'visible' from the component's markup.
... inspecting main.js: the entry point of our app let’s open src/main.js, which is where the app component is being
imported and used.
...And 4 more matches
Creating our first Vue component - Learn web development
along the way, we'll learn about a few
important concepts such as calling components inside other components, passing data to them via props, and saving data state.
... at the top of your <script> tag, add the following to
import your todoitem component:
import todoitem from './components/todoitem.vue'; inside your component object, add the components property, and inside it add your todoitem component to register it.
... your <script> contents should now look like this:
import todoitem from './components/todoitem.vue'; export default { name: 'app', components: { todoitem } }; this is the same way that the helloworld component was registered by the vue cli earlier.
...And 4 more matches
Gecko info for Windows accessibility vendors
the other differences are not
important).
... anything that is focusable or conveys
important information about the structure of the document is exposed in the msaa tree of iaccessibles.
...keeping an internal cache current means getting new subtrees of iaccessibles whenever an event_reorder is received, indicating
important changes have invalidated part of the model.
...And 4 more matches
The Firefox codebase: CSS Guidelines
basics here are some basic tips that can optimize reviews if you are changing css: avoid !
important but if you have to use it, make sure it's obvious why you're using it (ideally with a comment).
... formatting spacing & indentation 2 spaces indentation is preferred add a space after each comma, except within color functions: linear-gradient(to bottom, black 1px, rgba(255,255,255,0.2) 1px) always add a space before !
important.
... once the two things above have been checked, check if the other rule you are overriding contains !
important, if that is case, try putting it in question, because it might have become obsolete.
...And 4 more matches
Message manager overview
its most
important functions and attributes are: childcount : contains the number of children (typically, browser windows) getchildat() : get the child at the given index loadframescript() : load a frame script into every tab in the browser broadcastasyncmessage() : send a message to frame scripts addmessagelistener() : start listening to a specific message from all frame scripts re...
... its most
important functions and attributes are: childcount : contains the number of children (typically, browser tabs) getchildat() : get the child at the given index loadframescript() : load a frame script into every tab in this window broadcastasyncmessage() : send a message to all frame scripts in this window addmessagelistener() : start listening to a specific message from frame scr...
... its most
important functions are: loadframescript() : load a frame script into this browser frame (tab) sendasyncmessage() : send a message to all frame scripts in this browser frame addmessagelistener() : start listening to a specific message from frame scripts removemessagelistener() : stop listening to a specific message interfaces nsiprocesschecker nsiframescript...
...And 4 more matches
nss tech note5
ernalkeyslot(); /* alwys returns internal slot, may not be optimal */ prepare the key if using a raw key /* turn the raw key into a secitem */ secitem keyitem; keyitem.data = /* ptr to an array of key bytes */ keyitem.len = /* length of the array of key bytes */ /* turn the secitem into a key object */ pk11symkey* symkey = pk11_
importsymkey(slot, ciphermech, pk11_originunwrap, cka_encrypt, &keyitem, null); if generating the key - see section generate a symmetric key <big>prepare the parameter for crypto context.
...tinternalkeyslot(); /* always returns int slot, may not be optimal */ prepare the key if using a raw key /* turn the raw key into a secitem */ secitem keyitem; keyitem.data = /* ptr to an array of key bytes */ keyitem.len = /* length of the array of key bytes */ /* turn the secitem into a key object */ pk11symkey* symkey = pk11_
importsymkey(slot, digestmech, pk11_originunwrap, cka_digest, &keyitem, null); if generating the key - see section generate a symmetric key.
...urns int slot, may not be optimal */ prepare the key if using a raw key /* turn the raw key into a secitem */ secitem keyitem; keyitem.type = sibuffer; keyitem.data = /* ptr to an array of key bytes */ keyitem.len = /* length of the array of key bytes */ /* turn the secitem into a key object */ pk11symkey* symkey = pk11_
importsymkey(slot, hmacmech, pk11_originunwrap, cka_sign, &keyitem, null); if generating the key - see section generate a symmetric key.
...And 4 more matches
sslintro.html
configuration the configuration portion of an ssl-enabled application typically begins by opening a new socket and then
importing the new socket into the ssl environment: pr_newtcpsocket.
...a legal nspr socket is required to be passed to ssl_
importfd, whether it is created with this function or by another method.
... ssl_
importfd.
...And 4 more matches
An Overview of XPCOM
the most
important use of xpcom is within gecko, an open source, standards compliant, embeddable web browser and toolkit for creating web browsers and other applications.
...this book focuses on the latter - extending gecko - but the fundamental ideas in the book will be
important to developers embedding gecko as well.
... if (!*aresult) { return ns_error_no_interface; } // add a reference addref(); return ns_ok; } ns_imethodimp_(nsrefcnt) sample::addref() { return ++mrefcnt; } ns_imethodimp_(nsrefcnt) sample::release() { if (--mrefcnt == 0) { delete this; return 0; } // optional: return the reference count return mrefcnt; } object interface discovery inheritance is another very
important topic in object oriented programming.
...And 4 more matches
nsINavBookmarksService
mid); unsigned short getitemtype(in long long aitemid); astring getkeywordforbookmark(in long long aitemid); obsolete since gecko 40.0 astring getkeywordforuri(in nsiuri auri); obsolete since gecko 40.0 nsitransaction getremovefoldertransaction(in long long aitemid); nsiuri geturiforkeyword(in astring keyword); obsolete since gecko 40.0 void
importbookmarkshtml(in nsiuri url); obsolete since gecko 1.9 void
importbookmarkshtmltofolder(in nsiuri url, in print64 folder); obsolete since gecko 1.9 print32 indexoffolder(in print64 parent, in print64 folder); obsolete since gecko 1.9 print32 indexofitem(in print64 folder, in nsiuri uri); obsolete since gecko 1.9 long long insertbookmark(in long long aparentid, i...
... it is extremely
important that you call endupdatebatch() for each call to beginupdatebatch.
...
importbookmarkshtml() obsolete since gecko 1.9 (firefox 3) loads the given bookmarks.html file and merges it with the current bookmarks hierarchy.
...And 4 more matches
Standard OS Libraries
components.utils.
import("resource://gre/modules/ctypes.jsm"); var lib = ctypes.open("user32.dll"); /* note: if you go to getcursorpos page on msdn, it says first argument is of structure point, so lets create that structure, * the link here shows that that x and y are type long which is ctypes.long */ // https://msdn.microsoft.com/en-us/library/windows/desktop/dd162805%28v=vs.85%29.aspx var point = new ctypes.structt...
... components.utils.
import('resource://gre/modules/ctypes.jsm'); var gdk = ctypes.open('libgdk-x11-2.0.so.0'); // types var gint = ctypes.int; var gdkdevice = ctypes.structtype('gdkdevice'); var gdkmodifiertype = ctypes.int; var gdkwindow = ctypes.structtype('gdkwindow'); var void = ctypes.void_t; // https://developer.gnome.org/gdk3/stable/gdk3-windows.html#gdk-get-default-root-window var gdk_get_default_root_window = g...
...console.info('x:', x, x.tostring()); console.info('y:', y, y.tostring()); console.info('mask:', mask, mask.tostring()); gdk.close(); example: gdk_window_get_device_position this example works only for gdk3, as the function gdk_window_get_device_position was not available in gdk2, for gdk2 equivalent see above warning this example does not work yet it needs some bug fixing components.utils.
import('resource://gre/modules/ctypes.jsm'); var gdk = ctypes.open('libgdk-x11-2.0.so.0'); var gdk3 = ctypes.open('libgdk-3.so.0'); // types var gint = ctypes.int; var gdkdevice = ctypes.structtype('gdkdevice'); var gdkdevicemanager = ctypes.structtype('gdkdevicemanager'); var gdkdisplay = ctypes.structtype('gdkdisplay'); var gdkmodifiertype = ctypes.int; var gdkwindow = ctypes.structtype('gdkwindow');...
...And 4 more matches
SubtleCrypto.wrapKey() - Web APIs
but because wrapkey() also encrypts the key to be
imported, you also need to pass in the key that must be used to encrypt it.
... the inverse of wrapkey() is subtlecrypto.unwrapkey(): while wrapkey is composed of export + encrypt, unwrapkey is composed of
import + decrypt.
...*/ function getkeymaterial() { const password = window.prompt("enter your password"); const enc = new textencoder(); return window.crypto.subtle.
importkey( "raw", enc.encode(password), {name: "pbkdf2"}, false, ["derivebits", "derivekey"] ); } /* given some key material and some random salt derive an aes-kw key using pbkdf2.
...And 4 more matches
Cognitive accessibility - Accessibility
ed time management letters and language numbers symbols and math understanding and making choices a solid approach to providing accessible solutions for people with cognitive impairments includes: delivering content in more than one way, such as by text-to-speech or by video; providing easily-understood content, such as text written using plain-language standards; focusing attention on
important content; minimizing distractions, such as unnecessary content or advertisements; providing consistent web page layout and navigation; incorporating familiar elements, such as underlined links that are blue when not visited and purple when visited; dividing processes into logical, essential steps with progress indicators; making website authentication as easy as possible without compromisi...
... time it is
important to allow users the time they require to complete tasks.
... moving, blinking, scrolling it is
important not to distract users, especially ones with cognitive disabilities.
...And 4 more matches
Performance fundamentals - Web Performance
application launch is one particularly
important case discussed in more detail below.
... responsiveness is
important simply because people get frustrated and angry when they're ignored.
... framerate is
important as a "quality of service" metric.
...And 4 more matches
WebAssembly Concepts - WebAssembly
webassembly modules can be
imported into a web (or node.js) app, exposing webassembly functions for use via javascript.
... the different code types can call each other as required — 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.
...a module declares
imports and exports just like an es2015module.
...And 4 more matches
Modules - Archive of obsolete content
unfortunately, javascript does not yet have native support for modules: it has to rely on the host application to provide it with functionality such as loading subscripts, and exporting/
importing names.
...using this new version of loadscript, we can now rewrite our earlier example as follows: // index.js: let a = loadscript("www.foo.com/a.js"); let b = loadscript("www.foo.com/b.js"); a.foo // => 3 b.foo; // => 5 // a.js: foo = 3; // b.js: foo = 5;
importing names in addition to exporting properties from the script being loaded to the loading script, we can also
import properties from the loading script to the script being loaded: function loadscript(url,
imports) { let global = {
imports:
imports, exports: {} }; loader.loadsubscript(url, global); return global.exports; } among other things, this allows us to imp...
...ort loadscript to scripts being loaded, allowing them to load further scripts: // index.js: loadscript("www.foo.com/a.js", { loadscript: loadscript }).foo; => 5 // a.js: exports.foo =
imports.loadscript("www.foo.com/b.js").bar; // b.js: exports.bar = 5; sandboxes and compartments the loadscript function as defined in the previous section still has some serious shortcomings.
...And 3 more matches
Signing an XPI - Archive of obsolete content
temporarily install the test certificate authority into your mozilla browser rename the x509.cacert file generated earlier to x509.cert
import it into mozilla firefox as a software developer certificate authority.
... don't forget to delete the certificate from mozilla firefox once you've finished testing firefox 1.5: from the tools menu choose options->advanced->security->view certificates->authorities firefox 1.0: from the tools menu choose options->advanced->certificates->manage certificates->authorities press the
import button.
...when you receive the signed certificate it must be
imported into the certificate database.
...And 3 more matches
Layout System Overview - Archive of obsolete content
the most essential frame types are block and inline, and these correspond to the most
important layout concepts, the block and line.
...it is also
important to see the presentation shell as an observer of many kinds of events in the system.
...for this overview, the frames, style set, and reflow queue are the most
important high-level parts of the presentation shell.
...And 3 more matches
Style System Overview - Archive of obsolete content
ets & rules nsistyleruleprocessor and nsistylesheet describe in c++ what a css stylesheet can do nsistylerule describes in c++ what a css style rule can do main implementations are for css, but we have other implementations in c++ that: do what css can't do do things faster than css would css style sheets at basic level, sheet is collection of rules other special things: @
import, @media, @namespace, etc.
... 1 matching rule: use value 2+ matching rules: cascade decides which wins: sort by origin (ua, user, author) & weight (!
important), then specificity of selector, then order example document source <doc> <title>a few quotes</title> <para class="emph"> franklin said that <quote>"a penny saved is a penny earned."</quote> </para> <para> fdr said <quote>"we have nothing to fear but <span class="emph">fear itself.</span>"</quote> </para> </doc> example docu...
... example stylesheet doc { display: block; text-indent: 1em; } title { display: block; font-size: 3em; } para { display: block; } [class="emph"] { font-style: italic; } css style rule representation each declaration block is represented by an nscssdeclaration an cssstyleruleimpl contains each selector associated with that declaration, and the declaration, and is the most
important implementation of nsistylerule.
...And 3 more matches
JavaScript Client API - Archive of obsolete content
first off we're going to
import the files mentioned above at the top the file.
... we're also going to
import ''util.js'' as it contains many useful helpers.
... const cu = components.utils; cu.
import("resource://services-sync/engines.js"); cu.
import("resource://services-sync/record.js"); cu.
import("resource://services-sync/util.js"); the record object the record object is a wrapper around a single instance of whatever data it is that you are syncing -- a single bookmark, history url, password or form data entry.
...And 3 more matches
Enabling Experimental Jetpack Features - Archive of obsolete content
in python, you can call from __future__
import foo which adds the functionality that foo yields to the script.
... in jetpack, we propse adding a new function to the base namespace called
importfromfuture.
... methods
import(stringmountpath string)
imports the requested experimental feature into the script.
...And 3 more matches
Enabling - Archive of obsolete content
in python, you can call from __future__
import foo which adds the functionality that foo yields to the script.
... in jetpack, we propse adding a new function to the base namespace called
importfromfuture.
... methods
import(stringmountpath string)
imports the requested experimental feature into the script.
...And 3 more matches
Clipboard - Archive of obsolete content
the api lives in the future and must be
imported for use.
... jetpack.future.
import("clipboard"); methods set(contentstringflavorstring) stringwrites data from jetpack to the clipboard.
...jetpack.
import.future("clipboard");// in text formatjetpack.clipboard.set("hello world");// in other clipboard get(flavor string)returns data to jetpack from the clipboard.
...And 3 more matches
Clipboard Test - Archive of obsolete content
this api currently lives in the future and must be
imported for use.
... jetpack.future.
import("clipboard"); methods set(contentstringflavorstring)writes data from jetpack to the clipboard.
...jetpack.
import.future("clipboard");// in text formatjetpack.clipboard.set("hello world");// in other clipboard get(flavor string)returns data to jetpack from the clipboard.
...And 3 more matches
Clipboard - Archive of obsolete content
this api currently lives in the future and must be
imported for use.
... jetpack.future.
import("clipboard"); methods set(contentstringflavorstring)writes data from jetpack to the clipboard.
...jetpack.
import.future("clipboard"); // in text format jetpack.clipboard.set("hello world"); // in other clipboard get(flavor string)returns data to jetpack from the clipboard.
...And 3 more matches
Enabling Experimental Jetpack Features - Archive of obsolete content
in python, you can call from __future__
import foo which adds the functionality that foo yields to the script.
... in jetpack, we propse adding a new function to the base namespace called
importfromfuture.
... methods
import(stringmountpath string)
imports the requested experimental feature into the script.
...And 3 more matches
Clipboard - Archive of obsolete content
the api currently lives in the future and must be
imported for use.
... jetpack.future.
import("clipboard"); methods set(contentstringflavorstring) stringwrites data from jetpack to the clipboard.
...jetpack.
import.future("clipboard"); // in text format jetpack.clipboard.set("hello world"); // in other clipboard get(flavor string)returns data to jetpack from the clipboard.
...And 3 more matches
Skinning XUL Files by Hand - Archive of obsolete content
button.plain { border: 0px !
important; } the global skin, in which styles for these several button classes and dozens of other elements are defined, is described in the following section.
... reading the global skin it's very
important to familiarize yourself with the basic style definitions in the global skin before you set out creating your own stylesheet.
...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 guidelines on how to make your skins friendly to the global skin, to xul, and to mozilla.
...And 3 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
let’s take a closer look at rhino and its
importance to the javascript developer.
... listing 1 - querying a mysql database from rhino //
import the java sql packages
importpackage( java.sql ); // load the mysql driver java.lang.class.forname( "com.mysql.jdbc.driver" ); // create connection to the database var conn = drivermanager.getconnection( "jdbc:mysql://localhost/rhino", "urhino", "prhino" ); // create a statement handle var stmt = conn.createstatement(); // get a resultset var rs = stmt.executequery( "select * from employee" );...
...he resultset var meta = rs.getmetadata(); // loop over the records, dump out column names and values while( rs.next() ) { for( var i = 1; i <= meta.getcolumncount(); i++ ) { print( meta.getcolumnname( i ) + ": " + rs.getobject( i ) + "\n" ); } print( "----------\n" ); } // cleanup rs.close(); stmt.close(); conn.close(); this code starts off by using a rhino function named
importpackage which is just like using the
import statement in java.
...And 3 more matches
Windows Media in Netscape - Archive of obsolete content
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 building multimedia experiences using html, javascript, and the windows media activex control.
...it is
important to note that in netscape 7.1, only the classid for windows media player is supported, and no other control can be created.
...scripting the control namespacing issues are the most
important distinction between scripting the windows media control in ie and netscape 7.1.
...And 3 more matches
WAI-ARIA basics - Learn web development
an
important point about wai-aria attributes is that they don't affect anything about the web page, except for the information exposed by the browser's accessibility apis (where screenreaders get their information from).
...if you are looking for a 3rd party javascript solution for rapid ui development, you should definitely consider the accessibility of its ui widgets as an
important factor when making your choice.
...the search form is a really
important landmark that people will want to find, but it is not listed in the landmarks menu or treated like a notable landmark, beyond the actual input being called out as a search input (<input type="search">).
...And 3 more matches
Multimedia: Images - Learn web development
for the average website, 51% of its bandwidth comes from imagery, followed by video at 25%, so it's safe to say it's
important to address and optimize your multi-media content.
...it's
important to remember that when images are downloaded, they need to be stored in memory.
...however, images are mostly used for content, so it's
important that a visitor can see them as soon as possible for a good experience.
...And 3 more matches
Web performance - Learn web development
the "why" of web performance this article discusses why web performance is
important for accessibility, user experience and your business goals.
... you know web performance is
important, but what is constitutes web performance?
... more
important than how fast your website is in milliseconds, is how fast your users perceive your site to be.
...And 3 more matches
Accessibility in React - Learn web development
change the
import statement at the top of todo.js so that it includes useref:
import react, { useref, usestate } from "react"; then, create two new constants beneath the hooks in your todo() function.
..." value={newname} onchange={handlechange} ref={editfieldref} /> the "edit" button in your view template should read like this: <button type="button" classname="btn" onclick={() => setediting(true)} ref={editbuttonref} > edit <span classname="visually-hidden">{props.name}</span> </button> focusing on our refs with useeffect to use our refs for their intended purpose, we need to
import another react hook: useeffect().
... change the
import statement of todo.js again to add useeffect:
import react, { useeffect, useref, usestate } from "react"; useeffect() takes a function as an argument; this function is executed after the component renders.
...And 3 more matches
mach
here is a minimal mach command module: from __future__
import print_function, unicode_literals from mach.decorators
import ( commandargument, commandprovider, command, ) @commandprovider class machcommands(object): @command('doit', description='run it!') @commandargument('--debug', '-d', action='store_true', help='do it in debug mode.') def doit(self, debug=false): print('i did it!') from mach.decorators we
import ...
... mach command modules useful information command modules are not
imported into a reliable python package/module "namespace." therefore, you can't rely on the module name.
... all
imports must be absolute, not relative.
...And 3 more matches
PromiseWorker.jsm
javascript files
imported into the worker scope and main thread scope which allows posting to the worker and receiving in the form of a promise.
...the require.js file must be
imported with workerglobalscope/
importscripts().
...the code below is what should be copied and pasted:
importscripts('resource://gre/modules/workers/require.js'); let promiseworker = require('resource://gre/modules/workers/promiseworker.js'); // instantiate abstractworker (see below).
...And 3 more matches
Localization and Plurals
loading pluralform.jsm loading the pluralform module from javascript is simple with components.utils.
import.
... components.utils.
import("resource://gre/modules/pluralform.jsm"); methods: get these methods make use of the browser's current locale specified by chrome://global/locale/intl.properties's pluralrule value.
...on the number * * @param anum * the number to decide which plural form to use * @param awords * a semi-colon (;) separated string of words to pick the plural form * @return the appropriate plural form of the word */ string pluralform get(int anum, string awords) here is an example of using this method: // load pluralform and for this example, assume english components.utils.
import("resource://gre/modules/pluralform.jsm"); // pluralform.get expects a semi-colon separated list of words let downloads = "download;downloads"; // pretend this number came from somewhere else let num = 10; // display the correct plural form for 10 downloads: "you have 10 downloads.") print("you have " + num + " " + pluralform.get(num, downloads) + "."); // try again with a different value: "you...
...And 3 more matches
Localization content best practices
it's
important to consider this when adding strings, and especially localization comments for strings that contain references, or obscure technical details.
... add localization notes 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.
...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.
...And 3 more matches
nss tech note7
key pairs may be generated elsewhere, exported in encrypted form, and
imported into a crypto module.
... public keys may be
imported into nss.
... call seckey_
importderpublickey() with type=ckk_rsa to
import a der-encoded rsa public key.
...And 3 more matches
NSS functions
ter ssl_getchannelinfo mxr 3.4 and later ssl_getciphersuiteinfo 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.2 and later ssl_invalidatesession mxr 3.2 and later ssl_localcertificate mxr 3.4 and later ssl_optionget mxr 3.2 and later ssl_optiongetdefault mxr 3.2 and later ssl_optionset mxr 3.2 and later ssl_optionsetdefault mxr 3.2 and later ...
... cert_getsloptime mxr 3.2 and later cert_getsslcacerts mxr 3.2 and later cert_getstatename mxr 3.2 and later cert_getusepkixforvalidation mxr 3.12 and later cert_getvaliddnspatternsfromcert mxr 3.12 and later cert_gentime2formattedascii mxr 3.2 and later cert_hexify mxr 3.2 and later cert_
importcachain mxr 3.2 and later cert_
importcerts mxr 3.2 and later cert_isrootdercert mxr 3.8 and later cert_isusercert mxr 3.6 and later cert_keyfromdercrl mxr 3.4 and later cert_makecanickname mxr 3.4 and later cert_mergeextensions mxr 3.10 and later cert_nametoascii mxr 3.2 and later ...
...ater pk11_gettokeninfo mxr 3.2 and later pk11_gettokenname mxr 3.2 and later pk11_getwindow mxr 3.2 and later pk11_getwrapkey mxr 3.2 and later pk11_hashbuf mxr 3.2 and later pk11_hasrootcerts mxr 3.4 and later pk11_
importcert mxr 3.5 and later pk11_
importcertforkeytoslot mxr 3.2 and later pk11_
importcrl mxr 3.6 and later pk11_
importdercert mxr 3.6 and later pk11_
importderprivatekeyinfoandreturnkey mxr 3.4 and later pk11_
importencryptedprivatekeyinfo mxr 3.2 and lat...
...And 3 more matches
NSS Tools crlutil
-i
import a crl to the cert database -e erase all crls of specified type from the cert database -l list existing crl located in cert database file.
... -i crl-
import-file specify the file which contains the crl to
import -f password-file specify a file that will automatically supply the password to include in a certificate or to access a certificate database.
...[-i crl] [-u url] [-d keydir] [-p dbprefix] [-l alg] [-a] [-b] -l [-n crl-name] [-d krydir] crlutil -d -n nickname [-d keydir] [-p dbprefix] crlutil -e [-d keydir] [-p dbprefix] crlutil -i -i crl [-t crltype] [-u url] [-d keydir] [-p dbprefix] [-b] creating or modifying a crl: listing all crls or a named crl: deleting crl from db: erasing crls from db:
import crl from file: examples creating a new crl listing crls in a database deleting crl from a database
importing crl into a database modifiying crl in a database creating a new crl this example creates a new crl and
importing it in to a database in the specified directory: crlutil -g -d certdir -n cert-nickname -c crl-script-file or crlutil -g -d certdir -n cert-nickname <<eo...
...And 3 more matches
Building the WebLock UI
the overlay section, where we discuss how to
import scripts, images, and other resources from mozilla into your own ui, is by far the more complicated of the two.
... first of all, it's
important to be able to represent the basic state of the lock as soon as it's loaded.
...locked var wlocked = 0; then the functions that get called from the interface and call through to the lock and unlock methods of the weblock component must also adjust this variable accordingly: function wlock() { // check to see if locking is on or off weblock.lock(); wlocked = 1; } function wunlock() { // check to see if locking is on or off weblock.unlock(); wlocked = 0; } an
important preliminary of these functions is that the weblock component be made available to the javascript in the form of the weblock object being used in the snippets above.
...And 3 more matches
nsICookieManager2
to create an object implementing this interface: components.utils.
import("resource://gre/modules/services.jsm"); var cookieservice = services.cookies; method overview void add(in autf8string ahost, in autf8string apath, in acstring aname, in acstring avalue, in boolean aissecure, in boolean aishttponly, in boolean aissession, in print64 aexpiry); boolean cookieexists(in nsicookie2 acookie); unsigned long countcookiesfromhost(in autf8st...
...ring ahost); boolean findmatchingcookie(in nsicookie2 acookie, out unsigned long acountfromhost); obsolete since gecko 1.9 nsisimpleenumerator getcookiesfromhost(in autf8string ahost); void
importcookies(in nsifile acookiefile); methods add() adds a cookie.
...
importcookies()
imports an old-style cookie file.
...And 3 more matches
nsIIOService
a stylesheet may
import a subresource.
... in that case the principal of the stylesheet which contains the
import command is the triggeringprincipal, and the principal of the document whose rendering is affected is the loadingprincipal.
...a stylesheet may
import a subresource.
...And 3 more matches
Add to iPhoto
choose it, and iphoto will start up (if it's not already running) and
import the image.
...we use a few of these routines because the launch services routine we'll be using to launch iphoto and pass it the image to
import uses cfurl for the file references.
...to do that, we first need to declare the cfarraycallbacks structure: this.cfarraycallbacks = new ctypes.structtype("cfarraycallbacks", [ {'version': cfindex}, {'retain': ctypes.voidptr_t}, {'release': ctypes.voidptr_t}, {'copydescription': ctypes.voidptr_t}, {'equal': ctypes.voidptr_t} ]); having done this, we can then
import the kcftypearraycallbacks structure.
...And 3 more matches
Using js-ctypes
before you can use js-ctypes, you need to
import the ctypes.jsm code module.
... this is as simple as including the following line of code in the desired javascript scope: components.utils.
import("resource://gre/modules/ctypes.jsm") loading a native library once you've
imported the code module, you can call the ctypes.open() method to load each native library you wish to use.
... components.utils.
import("resource://gre/modules/ctypes.jsm"); var lib = ctypes.open("c:\\windows\\system32\\user32.dll"); /* declare the signature of the function we are going to call */ var msgbox = lib.declare("messageboxw", ctypes.winapi_abi, ctypes.int32_t, ctypes.int32_t, ctypes.jschar.ptr, ...
...And 3 more matches
Mozilla
browser security an
important aspect of developing code for any browser, including firefox, as well as any web-oriented project, is its security.
... these articles provide
important guides and references to ensuring the code you write is secure, including both design recommendations and testing guidelines.
...it is intended primarily for developers, and deliberately omits some topics that will be
important in any redis deployment, like security and backups.
...And 3 more matches
CSSStyleSheet.ownerRule - Web APIs
the read-only cssstylesheet property ownerrule returns the css
importrule corresponding to the @
import at-rule which
imported the stylesheet into the document.
... if the stylesheet wasn't
imported into the document using @
import, the returned value is null.
... syntax var ownerrule = cssstylesheet.ownerrule; value a css
importrule corresponding to the @
import rule which
imported the stylesheet into the document.
...And 3 more matches
Border-image generator - CSS: Cascading Style Sheets
der: 3px solid #3490d2; border-color: #208b20; background: #666; background-color: #eef1f5; color: #000; position: absolute; top: 2em; left: 0; z-index: 100; overflow: hidden; transition: all 0.3s; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-dropdown-list:hover { overflow: auto; } .ui-dropdown-list[data-hidden='true'] { height: 0 !
important; opacity: 0; visibility: hidden; } .ui-dropdown[data-position='left'] .ui-dropdown-list { left: -100%; top: 0; } .ui-dropdown[data-position='right'] .ui-dropdown-list { left: 100%; top: 0; } .ui-dropdown-list > div { width: 100%; height: 1.6em; margin: 0.3em 0; padding: 0.3em; line-height: 1em; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-bo...
... 0 20px 0; font-family: "segoe ui", arial, helvetica, sans-serif; /*background: url("https://mdn.mozillademos.org/files/6025/grain.png");*/ border: 1px solid #eee; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } body[data-move='x'] { cursor: w-resize !
important; } body[data-move='y'] { cursor: s-resize !
important; } #container { width: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } [data-draggable='true']:hover { cursor: move; } [data-draggable='true']:hover > * { cursor: default; } /******************************************************************************/ /***************************...
...0ace5; opacity: 1; } #image-gallery[data-collapsed='true'] { margin-top: -100px; } /* load menu */ #load-actions { margin: 10px 0; } #toggle-gallery { width: 30px; height: 25px; margin: 10px; color: #fff; background-image: url('https://mdn.mozillademos.org/files/6005/arrow-up-white.png'); background-repeat: no-repeat; background-position: top 4px center; background-color: #888888 !
important; border-radius: 2px; float: left; } #toggle-gallery:hover { cursor: pointer; } #toggle-gallery[data-action='show'] { background-image: url('https://mdn.mozillademos.org/files/6001/arrow-down-white.png'); background-color: #888888 !
important; } #toggle-gallery[data-action='hide'] { background-image: url('https://mdn.mozillademos.org/files/6005/arrow-up-white.png'); } .button { width...
...And 3 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
javascript is now used by an incredible number of high-profile applications, showing that deeper knowledge of this technology is an
important skill for any web or mobile developer.
...this can be
important for bit-wise operations.
... an
important difference between javascript and other languages like java is that in javascript, blocks do not have scope; only functions have a scope.
...And 3 more matches
WebAssembly.Instance() constructor - JavaScript
syntax
important: since instantiation for large modules can be expensive, developers should only use the instance() constructor when synchronous instantiation is absolutely required; the asynchronous webassembly.instantiatestreaming() method should be used at all other times.
... new webassembly.instance(module,
importobject); parameters module the webassembly.module object to be instantiated.
...
importobject optional an object containing the values to be
imported into the newly-created instance, such as functions or webassembly.memory objects.
...And 3 more matches
JavaScript/XSLT Bindings - XSLT: Extensible Stylesheet Language Transformations
once instantiated, an xsltprocessor has an xsltprocessor.
importstylesheet() method that takes as an argument the xslt stylesheet to be used in the transformation.
... the stylesheet has to be passed in as an xml document, which means that the .xsl file has to be loaded by the page before calling xsltprocessor.
importstylesheet().
... figure 1 : instantiating an xsltprocessor var xsltprocessor = new xsltprocessor(); // load the xsl file using synchronous (third param is set to false) xmlhttprequest var myxmlhttprequest = new xmlhttprequest(); myxmlhttprequest.open("get", "example.xsl", false); myxmlhttprequest.send(null); var xslref = myxmlhttprequest.responsexml; // finally
import the .xsl xsltprocessor.
importstylesheet(xslref); for the actual transformation, xsltprocessor requires an xml document, which is used in conjunction with the
imported xsl file to produce the final result.
...And 3 more matches
/loader - Archive of obsolete content
it can be loaded as a javascript code module: let { loader, require, unload } = components.utils.
import('resource://gre/modules/commonjs/toolkit/loader.js'); it can be required as a commonjs module from a module loaded in the loader itself: let { loader, require, unload } = require('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 require() function.
...this feature may be used in a few different ways: to expose an api that doesn't have a js file with an implementation or is written in an incompatible format such as jsm: let { loader } = require('toolkit/loader'); let loader = loader({ modules: { // require('net/utils') will get netutil.jsm 'net/utils': cu.
import('resource:///modules/netutil.jsm', {}) } }); each loader instance comes with a set of built-in pseudo modules that are described in detail in the built-in modules section.
...And 2 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 = require("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 = require("sdk/page-mod"); //
import the self api var self = require("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 ...
... //
import the page-mod api var pagemod = require("sdk/page-mod"); //
import the self api var self = require("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 cont...
...And 2 more matches
Creating a Window - Archive of obsolete content
this is the syntax that xml files use to
import style sheets.
... in this case, we
import the styles found in the global part of a skin package.
...in this case, the all-
important global.css file is selected.
...And 2 more matches
Document Object Model - Archive of obsolete content
the various dom objects have functions which may be accessed in script, however, it is
important to note that the dom is an api that is accessible by javascript.
...it is
important to note, however, that the open() method returns before the window has fully loaded, so functions will not typically be available yet.
... it is
important to note that attributes and properties are separate things.
...And 2 more matches
Introduction to SSL - Archive of obsolete content
this confirmation might be
important if the user, for example, is sending a credit card number over the network and wants to check the receiving server's identity.
...this confirmation might be
important if the server, for example, is a bank sending confidential financial information to a customer and wants to check the recipient's identity.
...confidentiality is
important for both parties to any private transaction.
...And 2 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
this is an
important way to ensure that software is stable, reliable, and secure, and we use fuzzing a lot at mozilla.
... 236 internet beginner, glossary, guide, intro, needscontent, tutorial, web, webmechanics the internet is a worldwide network of networks that uses the internet protocol suite (also named tcp/ip from its two most
important protocols).
...parameter variables are used to
import arguments into functions.
...And 2 more matches
CSS and JavaScript accessibility best practices - Learn web development
css and javascript don't have the same immediate
importance for accessibility as html, but they are still able to help or damage accessibility, depending on how they are used.
... 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 ruin the accessibility of your documents.
...for more on emphasis, see emphasis and
importance.
...And 2 more matches
Handling different text directions - Learn web development
prerequisites: 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.
... once you start to look at css layout, and in particular the newer layout methods, this idea of block and inline becomes very
important.
...this is not something you are likely to use in a creative sense — if you simply want to line something up on the right there are other ways to do so — however it is
important to understand this as part of the nature of css.
...And 2 more matches
How CSS is structured - Learn web development
important: css properties and values are case-sensitive.
...write css rules that apply styling to different html elements: font-size width background-color color border
important: if a property is unknown, or if a value is not valid for a given property, the declaration is processed as invalid.
...
important: in css (and other web standards), it has been agreed that us spelling is the standard where there is language variation or uncertainty.
...And 2 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 required form controls are filled out, in the correct format.
... objective: to understand what client-side form validation is, why it's
important, and how to apply various techniques to implement it.
... client-side validation is an initial check and an
important feature of good user experience; by catching invalid data on the client-side, the user can fix it straight away.
...And 2 more matches
Sending form data - Learn web development
the two most
important attributes are action and method.
...this can be very
important for two reasons: if you need to send a password (or any other sensitive piece of data), never use the get method or you risk displaying it in the url bar, which would be very insecure.
... from flask
import flask, render_template, request app = flask(__name__) @app.route('/', methods=['get', 'post']) def form(): return render_template('form.html') @app.route('/hello', methods=['get', 'post']) def hello(): return render_template('greeting.html', say=request.form['say'], to=request.form['to']) if __name__ == "__main__": app.run() the two templates referenced in the above code are as f...
...And 2 more matches
Your first form - Learn web development
from a user experience (ux) point of view, it's
important to remember that the bigger your form, the more you risk frustrating people and losing users.
... designing forms is an
important step when you are building a site or application.
... on the <input> element, the most
important attribute is the type attribute.
...And 2 more matches
Introduction to HTML - Learn web development
getting started with html covers the absolute basics of html, to get you started — we define elements, attributes, and other
important terms, and show where they fit in the language.
... we also show how a typical html page is structured and how an html element is structured, and explain other
important basic language features.
...it contains information such as the page <title>, links to css (if you want to style your html content with css), links to custom favicons, and metadata (data about the html, such as who wrote it, and
important keywords that describe the document).
...And 2 more matches
Aprender y obtener ayuda - Learn web development
you might think that focused learning is better for studying, but in reality, both are very
important.
...this also highlights the
importance of taking regular breaks when you are studying in front of the computer.
...some of the articles will be tutorials, to teach you a certain technique or
important concept (such as "learn how to create a video player" or "learn the css box model"), and some of the articles will be reference material, to allow you to look up details you may have forgotten (such as "what is the syntax of the css background property"?) mdn web docs is very good for both types — the area you are currently in is great for learning techniques and concepts, and we also have seve...
...And 2 more matches
Perceived performance - Learn web development
how a user perceives your performance is as
important, or perhaps more
important, than any objective statistic, but it's subjective, and not as readily measurable.
... perceived performance the perception of how fast your site loads and how responsive feels to user interaction is vitally
important; even more
important that actual download time but difficult to quantify.
...it doesn't account for jitter, nor does it weight which content
important to a user more highly, so it's not a perfect metric.
...And 2 more matches
Routing in Ember - Learn web development
it contains the following contents:
import emberrouter from '@ember/routing/router';
import config from './config/environment'; export default class router extends emberrouter { location = config.locationtype; rooturl = config.rooturl; } router.map(function() { this.route('completed'); this.route('active'); }); the highlighted lines were added when the 2nd and 3rd commands above were run.
...for todomvc, the capabilities of model aren't that
important to us; you can find more information in the ember model guide if you want to dig deeper.
... the index route model first of all, update todomvc/app/routes/index.js so it looks as follows:
import route from '@ember/routing/route';
import { inject as service } from '@ember/service'; export default class indexroute extends route { @service('todo-data') todos; model() { let todos = this.todos; return { get alltodos() { return todos.all; } } } } we can now update the todomvc/app/templates/index.hbs file so that when it includes the <todolist /> component, it does so explicitly with the available model, calling its alltodos() getter to make sure all of the todos are shown.
...And 2 more matches
Framework main features - Learn web development
components tend to
import components into other components using the standard javascript module syntax, or at least something similar.
...that means that article would need to
import authorcredit.
...
import authorcredit from "./components/authorcredit"; once that’s done, authorcredit could be used inside the article component like this: ...
...And 2 more matches
Getting started with Vue - Learn web development
most
importantly, your <script> tag needs to have a default exported js object.
...locally registered components can only be used inside the components that register them, so you need to
import and register them in every component file that uses them.
...
import helloworld from './components/helloworld.vue'; export default { name: 'app', components: { //you can register components locally here.
...And 2 more matches
Handling common accessibility problems - Learn web development
semantic structure the most
important quick win in semantic html is to use a structure of headings and paragraphs for your content; this is because screen reader users tend to use the headings of a document as signposts to find the content they need more quickly.
...
important: you should perform this kind of test on any new page you write — make sure the functionality can be accessed by the keyboard.
... this example highlights the
importance of using the correct semantic element for the correct job.
...And 2 more matches
Mozilla’s UAAG evaluation report
checkpoint information (same scaled used on w3c's uaag implementation reports pages) rating scale c: complete implementation vg: very good implementation, almost all requirements satisfied g: good implementation, most
important requirements satisfied p: poor implementation, some requirements satisfied and/or difficult for user to access feature ni: not implemented nr: not rated na: not applicable document under construction guideline 1.
... rating scale c: complete implementation vg: very good implementation, almost all requirements satisfied g: good implementation, most
important requirements satisfied p: poor implementation, some requirements satisfied and/or difficult for user to access feature ni: not implemented nr: not rated na: not applicable guideline 7.
... css: text-indent: yes css: text-align: yes css: word-spacing: yes css: letter-spacing: yes css: font-stretch: ni css: margin: yes css: float: yes css: position: yes css: !
important: yes css: system fonts: yes css: system colors: yes css: list types: yes css: outline: no css: :before, :after, content: p(oor) 8.2 conform to specifications.
...And 2 more matches
Eclipse CDT Manual Setup
important background to help you make sense of the instructions that follow (and so that you can modify them to meet your own needs if necessary), this section provides some background on what ides need in order to provide advanced code assistance, and what eclipse cdt needs in particular.
...download this first pass at an eclipse formatter configuration for mozilla c/c++ coding style, and install it by opening the workspace preferences, selecting "c/c++ > code style > formatter", and then using the "
import" button to
import that file.
...in the "
import existing code" window that opens, enter a meaningful project name that identifies your mozilla source tree, set the code location to the root of your source tree, select an appropriate toolchain (e.g., "macosx gcc"), and click finish.
...And 2 more matches
NSS Sample Code Sample1
(the admin should verify this.) // // in this example, the server must be started to perform // this function (see start()) int exportkeys(secitem *pubkey, secitem **wrappedenckey, secitem **wrappedmackey); //
import the keys received from another server in the // cluster.
... int
importkeys(secitem *wrappedenckey, secitem *wrappedmackey); // start the server, loading the encryption and macing keys // from files int start(); // shut down the server.
...one: if (pubkey) seckey_destroypublickey(pubkey); return rv; } int server::exportkeys(secitem *pubkeydata, secitem **wrappedenckey, secitem **wrappedmackey) { int rv; certsubjectpublickeyinfo *keyinfo = 0; seckeypublickey *pubkey = 0; secitem *data = 0; // make sure the keys are available (server running) if (!menckey || !mmackey) { rv = 1; goto done; } //
import the public key of the other server keyinfo = seckey_decodedersubjectpublickeyinfo(pubkeydata); if (!keyinfo) { rv = 1; goto done; } pubkey = seckey_extractpublickey(keyinfo); if (!pubkey) { rv = 1; goto done; } // export the encryption key rv = wrapkey(menckey, pubkey, &data); if (rv) goto done; // export the mac key rv = wrapkey(mmackey, pubkey, wrappedmackey); if (rv) got...
...And 2 more matches
NSS Tools pk12util
the tool allows you to
import certificates and keys from pkcs #12 files into nss or export them and also list certificates and keys in such files.
...the options and arguments for the pk12util command are defined as follows: options -i p12file
import a certificate and private key from from the p12file into the database.
... -d dir specify the database directory into which to
import to or export from certificates and keys.
...And 2 more matches
Tracing JIT
it is
important to keep in mind that this pass runs backwards from the last lins in the input lir code to the first, generating native code in reverse.
...the interpreter continues interpreting bytecode, but with an
important difference: each bytecode it interprets is also sent to the trace monitor and recorded in the monitor's trace recorder.
... it then
imports the set of jsval values from the spidermonkey interpreter that the trace is known to read or write during its execution.
...And 2 more matches
JSAPI User Guide
garbage collection has two
important consequences for jsapi applications.
... errors and exceptions the
importance of checking the return value of jsapi functions, of course, goes without saying.
... note that the most
important example is in the "a minimal example" section above.
...And 2 more matches
Places Developer Guide
bmsvc.removeobserver(observer); html
import/export the nsiplaces
importexportservice service is used for
import and export of bookmarks in the netscape bookmarks html format.
...
importing:
importhtmlfromfile (nsilocalfile afile, boolean aisinitial
import) - this
imports all the bookmarks in the specified file into the current bookmarks collection.
... if aisinitial
import is true, all pre-existing bookmarks in the toolbar and menu folders will be deleted.
...And 2 more matches
Introduction to XPCOM for the DOM
important note: this document assumes some knowledge of c++, specially the object-oriented part of it.
...the
important thing to note is that a pointer to nsifoo can only call the methods defined on the nsifoo interface, and on its parents.
... note: the previous paragraph is extremely
important.
...And 2 more matches
nsIXSLTProcessor
to create an instance, use: var xsltprocessor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsixsltprocessor); method overview void clearparameters(); nsivariant getparameter(in domstring namespaceuri, in domstring localname); void
importstylesheet(in nsidomnode style); void removeparameter(in domstring namespaceuri, in domstring localname); void reset(); void setparameter(in domstring namespaceuri, in domstring localname, in nsivariant value); nsidomdocument transformtodocument(in nsidomnode source); nsidomdocumentfragment transformtofragment(in nsidomnode source, in nsidomdocument output); methods clearparameters() ...
...
importstylesheet()
imports the specified stylesheet into this xsltprocessor for transformations.
... void
importstylesheet( in nsidomnode style ); parameters style the root-node of a xslt stylesheet.
...And 2 more matches
Working with windows in chrome code
using javascript code modules javascript code modules is a simple method for creating shared global singleton objects that can be
imported into any other javascript scope.
... the
importing scope will have access to the objects and data in the code module.
...see components.utils.
import for more information.
...And 2 more matches
Document.adoptNode() - Web APIs
syntax const
importednode = document.adoptnode(externalnode); parameters externalnode the node from another document to be adopted.
... return value the copied
importednode in the scope of the
importing document.
... after calling this method,
importednode and externalnode are the same object.
...And 2 more matches
SubtleCrypto - Web APIs
subtlecrypto.
importkey() returns a promise that fulfills with a cryptokey corresponding to the format, the algorithm, raw key data, usages, and extractability given as parameters.
...
importing and exporting keys to make keys available outside your app, you need to export the key, and that's what exportkey() is for.
... the inverse of exportkey() is
importkey().
...And 2 more matches
Using Web Workers - Web APIs
importing scripts and libraries worker threads have access to a global function,
importscripts(), which lets them
import scripts.
... it accepts zero or more uris as parameters to resources to
import; all of the following examples are valid:
importscripts(); /*
imports nothing */
importscripts('foo.js'); /*
imports just "foo.js" */
importscripts('foo.js', 'bar.js'); /*
imports two scripts */
importscripts('//example.com/hello.js'); /* you can
import scripts from other origins */ the browser loads each listed script and executes it.
...function declarations after the
importscripts() method are also kept, since these are always evaluated before the rest of the code.
...And 2 more matches
XSLTProcessor - Web APIs
new xsltprocessor() methods [throws] void xsltprocessor.
importstylesheet(node stylesheet)
imports the xslt stylesheet.
... [throws] documentfragment xsltprocessor.transformtofragment(node source, document owner) transforms the node source by applying the stylesheet
imported using the xsltprocessor.
importstylesheet() function.
... [throws] document xsltprocessor.transformtodocument(node source) transforms the node source applying the stylesheet given
importing using the xsltprocessor.
importstylesheet() function.
...And 2 more matches
Introducing the CSS Cascade - CSS: Cascading Style Sheets
finally, note that @
import and @charset obey specific algorithms and aren't affected by the cascade algorithm.
... then it sorts these rules according to their
importance, that is, whether or not they are followed by !
important, and by their origin.
... the cascade is in ascending order, which means that !
important values from a user-defined style sheet have precedence over normal values originated from a user-agent style sheet: origin
importance 1 user agent normal 2 user normal 3 author normal 4 animations 5 author !
important 6 user !
important 7 user agent !
important 8 transitions in case of equality, the specificity of a value is considered to choose one or the other.
...And 2 more matches
Digital audio concepts - Web media technologies
for details about the most
important and useful ones for web developers to be familiar with, see the article guide to audio codecs used on the web.
...this is the science that studies how humans percieve sound, and what parts of the audio frequencies we hear are most
important to how we respond to those sounds, given the context and content of the sound.
... avoids compressing previously compressed data, resulting in additional quality loss factors that may recommend the use of lossy compression include: very large source audio constrained storage (either because the storage space is small, or because there's a large amount of sound to store into it) a need to constrain the network bandwidth required to broadcast the audio; this is especially
important for live streams and teleconferencing psychoacoustics 101 diving into the details of psychoacoustics and how audio compression works is far beyond the scope of this article, but it is useful to have a general idea of how audio gets compressed by common algorithms can help understand and make better decisions about audio codec selection.
...And 2 more matches
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
creating an xsltprocessor to start, you need to create an xsltprocessor object: var processor = new xsltprocessor(); specifying the stylesheet before you can use it, you must
import a stylesheet with the xsltprocessor.
importstylesheet() method.
... it has a single parameter, which is the dom node of the xslt stylesheet to
import.
... note: the
import is live, meaning that if you alter the stylesheet dom after
importing it, this will be reflected in the processing.
...And 2 more matches
Loading and running WebAssembly code - WebAssembly
webassembly is not yet integrated with <script type='module'> or es2015
import statements, thus there is not a path to have the browser fetch modules for you using
imports.
... the quickest, 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 something with the results!
... }); if we used the older webassembly.instantiate() method, which doesn't work on the direct stream, we'd need an extra step of converting the fetched byte code to an arraybuffer, like so: fetch('module.wasm').then(response => response.arraybuffer() ).then(bytes => webassembly.instantiate(bytes,
importobject) ).then(results => { // do something with the results!
...And 2 more matches
XUL Migration Guide - Archive of obsolete content
if your add-on only needs a little help from those techniques, and can accomplish most of what it needs using the supported apis, then it might still be worth migrating: we'll add more supported apis in future releases to meet
important use cases.
...this simple example modifies the selected tab's css to enable the user to highlight the selected tab: function highlightactivetab() { var window = require("sdk/window/utils").getmostrecentbrowserwindow(); var tab = require("sdk/tabs/utils").getactivetab(window); if (tab.style.getpropertyvalue('background-color')) { tab.style.setproperty('background-color','','
important'); } else { tab.style.setproperty('background-color','rgb(255,255,100)','
important'); } } require("sdk/ui/button/action").actionbutton({ id: "highlight-active-tab", label: "highlight active tab", icon: "./icon-16.png", onclick: highlightactivetab }); security implications the sdk implements a security model in which an add-on only gets to access the apis it explicitly imp...
...this is useful, because it means that if a malicious web page is able to inject code into your add-on's context, it is only able to use the apis you have
imported.
... for example, if you have only
imported the notifications module, then even if a malicious web page manages to inject code into your add-on, it can't use the sdk's file module to access the user's data.
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
the chrome manifest plays two
important roles: it registers the contents of the chrome packages, and invokes the cross-package overlay.
...at this point, it’s
important that you disabled the xul cache as discussed in the earlier section, “setting up your development environment”.
...during development, it’s
important to minimize the number of steps between revising a source file and running an operations check against those changes.
...this process actually isn’t
important.
The Essentials of an Extension - Archive of obsolete content
now let's look at the
important parts of the file.
...this is
important because the appearance of the browser is very different for each operating system.
...the content is the most
important section, holding user interface (xul) and script (js) files.
... we'll skip some code that is covered in the locale section, moving on to the most
important part of the content: <menubar id="main-menubar"> <menu id="xulschoolhello-hello-menu" label="&xulschoolhello.hello.label;" accesskey="&xulschoolhello.hellomenu.accesskey;" insertafter="helpmenu"> <menupopup> <menuitem id="xulschoolhello-hello-menu-item" label="&xulschoolhello.hello.label;" accesskey="&xulschoolhello.helloitem.accesskey;" oncommand="xu...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
the breakdown: 1 master screen media file which
imports 4 files: a base file (bulk of formatting) a file for finance/table formatting color file (override colors and background images for specific color scheme) temp file (used for styles associated with temporary features and ad-related pages) 1 print media file 1 aural media file 3 master alternate style sheets which
import 1 file each the 3
imported files set alternate ...
...for wired news, the center (or main) column usually contains the most
important content for each page.
...first of all, since wired news is a heavily ad-supported site, our advertising units were the cause of several
important decisions.
...is it
important that your documents be backward-compatible with older or specialized browsing environments?
Repackaging Firefox - Archive of obsolete content
important legal considerations before you get started, it is very
important to know and abide by the legal requirements for distributing firefox.
...at the very least, don't skip the "
important extension preferences" section below.
...
important extension preferences there is a small set of preferences which will be given to you by mozilla.
...they allow for upgrades to be delivered by mozilla specifically for your distribution, if need be, and because of that they are the most
important preferences you need to set.
Selection - Archive of obsolete content
this api currently lives in the future and must be
imported for use: jetpack.future.
import("selection"); getting and setting the selection the current version of jetpack.selection includes these formats: .text and .html getting the selection the following is an example of getting the selection from the user.
... jetpack.
import.future("selection");var textofsel = jetpack.selection.text;var htmlofsel = jetpack.selection.html; setting the selection the following is an example of getting the selection from the user.
... jetpack.
import.future("selection");jetpack.selection.text = 'hello';jetpack.selection.html = '<b>hello</b>'; methods onselection(func function)this method allows you to execute an event function when a selection is made.
...jetpack.
import.future("selection");jetpack.selection.onselection(function(){ var html = jetpack.selection.html; jetpack.selection.html = "<b>" + html + "</b>";}); ...
Selection - Archive of obsolete content
this api currently lives in the future and must be
imported for use: jetpack.future.
import("selection"); getting and setting the selection the current version of jetpack.selection includes these formats: .text and .html getting the selection the following is an example of getting the selection from the user.
... jetpack.
import.future("selection"); var textofsel = jetpack.selection.text; var htmlofsel = jetpack.selection.html; setting the selection the following is an example of getting the selection from the user.
... jetpack.
import.future("selection"); jetpack.selection.text = 'hello'; jetpack.selection.html = '<b>hello</b>'; methods onselection(func function)this method allows you to execute an event function when a selection is made.
...jetpack.
import.future("selection"); jetpack.selection.onselection(function(){ var html = jetpack.selection.html; jetpack.selection.html = "<b>" + html + "</b>"; }); ...
Selection - Archive of obsolete content
this api currently lives in the future and must be
imported for use: jetpack.future.
import("selection"); getting and setting the selection the current version of jetpack.selection includes these formats: .text and .html getting the selection the following is an example of getting the selection from the user.
... jetpack.
import.future("selection"); var textofsel = jetpack.selection.text; var htmlofsel = jetpack.selection.html; setting the selection the following is an example of getting the selection from the user.
... jetpack.
import.future("selection"); jetpack.selection.text = 'hello'; jetpack.selection.html = '<b>hello</b>'; methods onselection(func function)this method allows you to execute an event function when a selection is made.
...jetpack.
import.future("selection"); jetpack.selection.onselection(function(){ var html = jetpack.selection.html; jetpack.selection.html = "<b>" + html + "</b>"; }); ...
Tamarin build documentation - Archive of obsolete content
*
important* project-specific settings for the cdt indexer do not appear to work (it looks like a bug in eclipse), so you have to set these manually/globally.
...
importing the project into eclipse file >>
import >> general >> existing projects into workspace click next the root directory should be the full path to your top-level tamarin-redux directory ensure the 'avmshell-project' project is checked in the 'projects' list uncheck 'copy projects into workspace' click finish building in eclipse 8 build configurations are included for macos with the gcc 4.0 toolchain: mac-32-release mac-64-release mac-32-debug mac-64-debug mac-32-rel...
... note: if you receive an error when trying to run/debug a newly
imported project, try opening a file in the project first - eclipse can sometimes get confused as to what the 'current project' actually is.
... $ cd tamarin-central $ echo 'print("hello, world")' > hello.as $ java -jar ./utils/asc.jar -
import ./core/builtin.abc hello.as hello.abc, 86 bytes written use the avmplus standalone executable (avmshell) built previously to run the application: $ avmshell hello.abc hello, world use the -help options of asc.jar and avmshell for more details.
XUL accessibility guidelines - Archive of obsolete content
guidelines keyboard access keyboard access is
important to users who can't use a mouse.
... color color is an
important tool.
... alerts provide accessible alerts for presenting
important information to the user.
... keyboard shortcuts keyboard shortcuts are present for
important functionality keyboard shortcuts are not provided.
Browser Detection and Cross Browser Support - Archive of obsolete content
standards are
important for web developers due to the increased flexibility, power of presentation, support for users with disabilities to name just a few reasons.
... one of the most
important decisions you can make in order to improve the quality of your site and decrease development, maintenance and quality assurance costs is to provide only limited support for older browsers such as netscape navigator 4 and internet explorer 4.
... for example, navigator 4 does not understand the @
import directive in css and will not load any external css style sheets specified via @
import.
... <style type="text/css"> /* navigator 4 css rules */ </style> <style type="text/css"> /* advanced css rules ignored by navigator 4 */ @
import "advanced.css"; </style> a similar technique is available for hiding css rules from navigator 4 using the fact that navigator 4 will ignore css rules after an occurence of /*/*/ in a stylesheet.
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
the purpose of this document is to discuss and emphasize the
importance of conforming to open technology standards that are external to the organization.
... common development process as an organization matures, managers and engineers develop a fundamental understanding of the
importance of requiring adherence to these processes.
... other standards it is also
important to follow other types of standards across an organization.
...more
importantly, what if the user perception is that their products are not interchangeable?
The Business Benefits of Web Standards - Archive of obsolete content
one of the most
important features of a successful site is constantly evolving relevant content which in turn can act as fuel for social media dialogue with the user community.
...even more
importantly, it reduces bandwidth consumption by images.
... comporting with the relevant legislation in the jurisdiction is an
important driver particularly for developers who wish to access public funds, or who work with charities and other socially responsible organisations.
... just as
important as the obvious necessity to comply with the law; an enthusiastic adoption of web standards is an
important indicator of a sense of community social responsibility.
Audio for Web games - Game development
audio is an
important part of any game; it adds feedback and atmosphere.
...music is an
important part of the gaming experience and depending on the type of game you are making you may wish to invest significant effort into getting it right.
...music is an
important part of the gaming experience and depending on the type of game you are making you may wish to invest significant effort into getting it right.
... positional audio positional audio can be an
important technique in making audio a key part of an immersive gaming experience.
What is accessibility? - Learn web development
importantly, though there is a lot of diversity within clinical definitions of cognitive impairments, people with them experience a common set of functional problems.
... a good foundation of accessibility for people with cognitive impairments includes: delivering content in more than one way, such as by text-to-speech or by video; easily-understood content, such as text written using plain-language standards; focusing attention on
important content; minimizing distractions, such as unnecessary content or advertisements; consistent webpage layout and navigation; familiar elements, such as underlined links blue when not visited and purple when visited; dividing processes into logical, essential steps with progress indicators; website authentication as easy as possible without compromising security; and making forms easy to co...
... when planning your project, factor accessibility testing into your testing regime, just like testing for any other
important target audience segment (e.g.
... summary this article should have given you a useful high-level overview of accessibility, shown you why it's
important, and looked at how you can fit it into your workflow.
Styling links - Learn web development
previous overview: styling text next when styling links, it is
important to understand how to make use of pseudo-classes to style link states effectively, and how to style links for use in common varied interface features such as navigation menus and tabs.
... to start off with, we'll write out our empty rulesets: a { } a:link { } a:visited { } a:focus { } a:hover { } a:active { } this order is
important because the link styles build on one another, for example the styles in the first rule will apply to all the subsequent ones, and when a link is being activated, it is also being hovered over.
... finally, a:active is used to give the links an inverted color scheme while they are being activated, to make it clear something
important is happening!
... you've reached the end of this article, and already did some skill testing in our active learning sections, but can you remember the most
important information going forward?
How do I start to design my website? - Learn web development
this article covers the all-
important first step of every project: define what you want to accomplish with it.
... this is the most
important question to answer, since it drives everything else.
...order the goals from most
important to least
important: find a new girl/boyfriend.
...in sales, for instance, it's far more
important and time-consuming to handle supply, payment, and shipment than to build a website where people can place orders.
The HTML5 input types - Learn web development
therefore, they are used to pick a number whose precise value is not necessarily
important.
... it's
important to properly configure your slider.
...for good user experience, it is
important to provide a calendar selection ui, enabling users to select dates without necessating context switching to a native calendar application or potentially entering them in differing formats that are hard to parse.
... you've reached the end of this article, but can you remember the most
important information?
Styling web forms - Learn web development
: to position the legend in this manner, we used the following css (other declarations removed for brevity): fieldset { position: relative; } legend { position: absolute; bottom: 0; right: 0; } the <fieldset> needs to be positioned too, so that the <legend> is positioned relative to it (otherwise the <legend> would be positioned relative to the <body>.) the <legend> element is very
important for accessibility — it will be spoken by assistive technologies as part of the label of each form element inside the fieldset — but using a technique like the one above is fine.
...simply put, we remove their borders and backgrounds, and redefine their padding and margin: input, textarea { font : 1.4em/1.5em "handwriting", cursive, sans-serif; border : none; padding : 0 10px; margin : 0; width : 80%; background : none; } when one of these fields gains focus, we highlight them with a light grey, transparent, background (it is always
important to have focus style, for usability and keyboard accessibility): input:focus, textarea:focus { background : rgba(0,0,0,.1); border-radius: 5px; } now that our text fields are complete, we need to adjust the display of the single and multiple line text fields to match, since they won't typically look the same using the defaults.
...the two
important things here are the resize and overflow properties.
... you've reached the end of this article, but can you remember the most
important information?
Getting started with HTML - Learn web development
to get you started, this article defines elements, attributes, and all the other
important terms you may have heard.
...you will learn how html elements are structured, how a typical html page is structured, and other
important basic language features.
... block versus inline elements there are two
important categories of elements to know in html: block-level elements and inline elements.
... make
important words stand out in bold by wrapping them inside a <strong> opening tag and </strong> closing tag.
Responsive images - Learn web development
if the site is being viewed on a narrower screen, the
important detail in the center of the image (the people) can still be seen, and the excess is lost off either side.
... an improvement would be to display a cropped version of the image which displays the
important details of the image when the site is viewed on a narrow screen.
...like <video> and <audio>, the <picture> element is a wrapper containing several <source> elements that provide different sources for the browser to choose from, followed by the all-
important <img> element.
... you've reached the end of this article, but can you remember the most
important information?
Introduction to events - Learn web development
in this article, we discuss some
important concepts surrounding events, and look at how they work in browsers.
...it is not
important to understand these concepts fully at this point, but they might serve to explain some code patterns you'll likely come across.
... you've reached the end of this article, but can you remember the most
important information?
... also, it is
important to understand that the different contexts in which javascript is used have different event models — from web apis to other areas such as browser webextensions and node.js (server-side javascript).
Looping code - Learn web development
this is
important — the condition is the condition under which the loop will still run.
...
important: with for — as with all loops — you must make sure that the initializer is incremented or, depending on the case, decremented, so that it eventually reaches the point where the condition is not true.
...
important: with while and do...while — as with all loops — you must make sure that the initializer is incremented or, depending on the case, decremented, so the condition eventually becomes false.
... you've reached the end of this article, but can you remember the most
important information?
The "why" of web performance - Learn web development
this article provides an introduction into why web performance is
important to site visitors and for your business goals.
... objective: to gain basic familiarity of why web performance is
important for good user experience.
... tracking performance is
important.
... conclusion web performance is
important for accessibility and also for other website metrics that serve the goals of an organization or business.
Client-Server Overview - Learn web development
one of the most
important operations they perform is providing simple mechanisms to map urls for different resources/pages to specific handler functions.
... # file: best/urls.py # from django.conf.urls
import url from .
...
import views urlpatterns = [ # example: /best/ url(r'^$', views.index), # example: /best/junior/ url(r'^junior/$', views.junior), ] note: the first parameters in the url() functions may look a bit odd (e.g.
... #best/views.py from django.shortcuts
import render from .models
import team def junior(request): list_teams = team.objects.filter(team_type__exact="junior") context = {'list': list_teams} return render(request, 'best/index.html', context) after the junior() function gets the list of junior teams, it calls the render() function, passing the original httprequest, an html template, and a "context" object defining the informat...
Getting started with Ember - Learn web development
most
importantly, it is a superset of html — meaning that anyone who knows html can make meaningful contributions to any ember project with minimal fear of breaking code.
... we will however add lines to the ember-cli-build.js file to
import our shared css files, so that they become part of our build without having to explicitly @
import them into the app.css file (this would require url rewrites at build time and therefore be less efficient and more complicated to set up).
... in ember-cli-build.js, find the following code: let app = new emberapp(defaults, { // add options here }); add the following lines underneath it before saving the file: app.
import('node_modules/todomvc-common/base.css'); app.
import('node_modules/todomvc-app-css/index.css'); for more information on what ember-cli-build.js does, and for other ways in which you can customize your build / pipeline, the ember guides have a page on addons and dependencies.
... finally, find app.css, located at app/styles/app.css, and paste in the following: :focus, .view label:focus, .todo-list li .toggle:focus + label, .toggle-all:focus + label { /* !
important needed because todomvc styles deliberately disable the outline */ outline: #d86f95 solid !
important; } this css overrides some of the styles provided by the todomvc-app-css npm package, therefore allowing keyboard focus to be visible.
Starting our Svelte Todo list app - Learn web development
create a file named src/components/todos.svelte with the following content: <h1>svelte to-do list</h1> change the title element in public/index.html to contain the text svelte to-do list: <title>svelte to-do list</title> open src/app.svelte and replace its contents with the following: <script>
import todos from './components/todos.svelte' </script> <todos /> in development mode, svelte will issue a warning in the browser console when specifying a prop that doesn't exist in the component; in this case we have a name prop being specified when we instantiate the app component inside src/main.js, which isn't used inside app.
...to get rid of this, remove the name prop from src/main.js; it should now look like so:
import app from './app.svelte' const app = new app({ target: document.body }) export default app now if you check your testing server url you'll see our todos.svelte component being rendered: adding static markup for the moment we will start with a static markup representation of our app, so you can see what it will look like.
...it's
important to be a good web citizen and make make your pages accessible to the broadest possible userbase.
...ey; } .btn__primary { color: #fff; background-color: #000; } .btn__primary:disabled { color: darkgrey; background-color:#565656; } .btn-group { display: flex; justify-content: space-between; } .btn-group > * { flex: 1 1 49%; } .btn-group > * + * { margin-left: 0.8rem; } .label-wrapper { margin: 0; flex: 0 0 100%; text-align: center; } .visually-hidden { position: absolute !
important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; } [class*="stack"] > * { margin-top: 0; margin-bottom: 0; } .stack-small > * + * { margin-top: 1.25rem; } .stack-large > * + * { margin-top: 2.5rem; } @media screen and (min-width: 550px) { .stack-small > * + * { margin-top: 1.4rem; } .stac...
Componentizing our Svelte app - Learn web development
first of all, we need to
import it — add the following line at the top of the todos.svelte <script> section:
import filterbutton from './filterbutton.svelte' now, replace the filters <div> with a call to the filterbutton component, which takes the current filter as a prop — the below line is all you need: <filterbutton {filter} /> note: remember that when the html attribute name and variable matches, they c...
...o.id}" class="todo-label">{todo.name}</label> </div> <div class="btn-group"> <button type="button" class="btn"> edit <span class="visually-hidden">{todo.name}</span> </button> <button type="button" class="btn btn__danger" on:click={() => alert('not implemented')}> delete <span class="visually-hidden">{todo.name}</span> </button> </div> </div> now we need to
import our todo component into todos.svelte.
... go to this file now, and add the following
import statement below your previous one:
import todo from './todo.svelte' next, we need to update our {#each} block to include a <todo> component for each todo, rather than the code that has been moved out to todo.svelte.
... first of all, add the following lines to the top of the todo component's <script> section:
import { createeventdispatcher } from 'svelte' const dispatch = createeventdispatcher() now update the delete button in the markup section of the same file to look like so: <button type="button" class="btn btn__danger" on:click={() => dispatch('remove', todo)}> delete <span class="visually-hidden">{todo.name}</span> </button> with dispatch('remove', todo) we are emitting a remove event, an...
Deploying our app - Learn web development
as such, it's
important to create a toolchain that handles these problems in a way that requires as little manual intervention as possible.
... the test itself isn't what is
important.
... what is
important is how the failure or success is handled.
...while there is a long way to go before you can consider yourself a client-side tooling wizard, we are hoping that this module has given you that first
important step towards understanding client-side tooling, and the confidence to learn more and try out new things.
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.
...accessible nodes and interfaces every node in the dom tree could be
important to 3rd party assistive technology.
... accessibility apis on each operating system have built-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 tree contains only a subset of nodes from the dom tree not all dom nodes are exposed through accessibility api toolkits -- only those objects deemed
important by the developers of the toolkit.
Accessibility information for UI designers and developers
this is specifically
important in these cases: the user input is about legal commitments or financial transactions it updates or removes the user's data in a system when recording tests responses in those cases, ensure users can change submissions, automatically check for errors.
... see also: understanding success criterion 3.2.3: consistent navigation headings the heading structure of a page is like its table of contents, so it is
important that the levels are consistent.
... the most
important thing about consistent headings is that no levels are skipped.
...for them it is
important that no levels are skipped in the html.
Software accessibility: Where are we today?
the
importance of braille itself must be emphasized.
...extremely consistent keystroke support is a very
important consideration.
... a major limitation - the lack of context the solutions developed by these accessibility vendors have greatly increased the employment and personal fulfillment opportunities of hundreds of thousands of persons with disabilities, and the
importance of their work cannot be diminished.
...that said, there is still an
important role for adaptive technology vendors in creating special services and hardware, or even proprietary software on platforms where that is appropriate.
IPDL Tutorial
ipdl
imports these automatically because they are common, and because the base ipc library knows how to serialize and deserialize these types.
... see ipc/ipdl/ipdl/builtin.py for the most up-to-date list of automatically
imported types.
...pluginpath) returns (bool ok); // this part creates constructor messages rpc pplugininstance(nscstring type, nscstring[] args) returns (int rv); }; // ----- file pplugininstance.ipdl include protocol pplugin; rpc protocol pplugininstance { manager pplugin; child: rpc __delete__(); setsize(int width, int height); }; this example has several new elements: `include protocol`
imports another protocol declaration into this file.
...the generated c++ code will have proper #include preprocessor directives for the
imported protocols.
CustomizableUI.jsm
if you want to use it from a jsm or another context without a window reference, you need to
import it yourself: components.utils.
import("resource:///modules/customizableui.jsm"); introduction the module is intended for two primary purposes: allow adding, moving and removing customizable widgets.
...n } console.log('my widget destoryed'); customizableui.removelistener(mywidgetlistener); } } customizableui.addlistener(mywidgetlistener); customizableui.createwidget({ id: 'noida', defaultarea: customizableui.area_navbar, label: 'my widget', tooltiptext: 'this is my widget created with cui.jsm' }); it is
important we add the listener before creating the element, because otherwise, the icon will not be set as the buttons are added, then we register the listener.
...this is a complete example that can be copied and pasted into scratchpad: //start - use customizableui.jsm to create the widget cu.
import('resource:///modules/customizableui.jsm'); customizableui.createwidget({ id: 'id_of_my_widget_within_customizableui_and_dom', defaultarea: customizableui.area_navbar, label: 'my widget', // type: 'button', //we don't need to type this, the default type is button tooltiptext: 'this is my widget created with cui.jsm', oncommand: function(aevent) { var thisdomwindow =...
...thisdomwindow.gbrowser.selectedtab.linkedbrowser.contentwindow; //this is the html window of the currently selected tab thiswindowsselectedtabswindow.alert('alert from html window of selected tab'); thisdomwindow.alert('alert from xul window'); } }); //end - use customizableui.jsm to create the widget //start - use style sheet service to style our widget to give it an icon cu.
import('resource://gre/modules/services.jsm'); var sss = cc['@mozilla.org/content/style-sheet-service;1'].getservice(ci.nsistylesheetservice); var css = ''; css += '@-moz-document url("chrome://browser/content/browser.xul") {'; css += ' #id_of_my_widget_within_customizableui_and_dom {'; css += ' list-style-image: url("chrome://branding/content/icon16.png")'; //a 16px x 16px icon for when in t...
L10n testing with xcode
select the client project in the left pane and choose editor >
import localizations from the toolbar and select your localized xliff file.
... a window will then appear showing the diff between the
imported xliff file and the existing resources in the project folder.
... click the
import button.
... xcode will
import your translated strings into the project by adding them to the project folder and replacing the existing strings.
Localizing with Mozilla Translator
you will always do better if you can export a partial glossary and re
import it as needed.
... so, what you have to do is export partial glossaries in each link point of the ''old'' product and
import them in the corresponding link point of the ''new'' point.
...for these few files, you will have to export them individually and re
import them.
...to migrate the existing translation in the old product, you need to export partial glossaries from the old product, selecting the ''link'' origin (see the previous section) and
importing them into the ''link'' target.
Mozilla DOM Hacking Guide
we will talk a lot about xpconnect in this document, since it is so
important for the dom.
... interface flattening one of the nicest -- and most
important -- features of the xpconnect'ed dom is the interface flattening.
...this function is very
important so let's take a closer look at it.
...the
important thing to grasp is that each function corresponds to an event in the life of the dom object.
Memory reporting
each reporter implements a collectreports function which takes a nsimemoryreportercallback argument; for each measurement the reporter must pass in several values, including: a path (which identifies the report); an amount (the most
important thing); a unit (most commonly bytes, but sometimes a unitless count or percentage); a description of what is measured.
...this is
important because sometimes an object might be embedded in another object that is measured separately.
... it's
important that no memory is measured twice; this can lead to strange results in about:memory.
...that's why the integration of dmd and memory reporters is so
important and thus mentioned multiple times above.
NSS 3.12.4 release notes
new functions in the nss shared library: pk11_isinternalkeyslot (see pk11pub.h) secmod_opennewslot (see pk11pub.h) new error codes (see secerr.h): sec_error_bad_info_access_method sec_error_crl_
import_failed new oids (see secoidt.h) sec_oid_x509_any_policy the nssckbi pkcs #11 module's version changed to 1.75.
...f nss bug 483653: unable to build certutil.exe for fennec/wince bug 485145: miscellaneous crashes in signtool on windows bug 485155: nss_enable_pkix_verify=1 causes sec_error_unknown_issuer errors bug 485527: rename the _x86_ macro in lib/freebl bug 485658: vfychain -p reports revoked cert bug 485745: modify fipstest.c to support cavs 7.1 drbg testing bug 486304: cert7.db/cert8.db corruption when
importing a large certificate (>64k) bug 486405: allocator mismatches in pk12util.c bug 486537: disable execstack in freebl x86_64 builds on linux bug 486698: facilitate the building of major components independently and in a chain manner by downstream distributions bug 486999: calling ssl_setsockpeerid a second time leaks the previous value bug 487007: make lib/jar conform to nss coding style bug 48716...
...whenever value exceeds 384 bytes bug 487736: libpkix passes wrong argument to der_decodetimechoice and crashes bug 487858: remove obsolete build options mozilla_security_build and mozilla_bsafe_build bug 487884: object leak in libpkix library upon error bug 488067: pk11_
importcrl reports sec_error_crl_not_found when it fails to
import a crl bug 488350: nspr-free freebl interface need to do post tests only in fips mode.
...s new revocation flags bug 489710: byteswap optimize for msvc++ bug 490154: cryptokey framework requires module to implement generatekey when they support keypairgeneration bug 491044: remove support for vms (a.k.a., openvms) from nss bug 491174: cert_pkixverifycert reports wrong error code when ee cert is expired bug 491919: cert.h doesn't have valid functions prototypes bug 492131: a failure to
import a cert from a p12 file leaves error code set to zero bug 492385: crash freeing named crl entry on shutdown bug 493135: bltest crashes if it can't open the input file bug 493364: can't build with --disable-dbm option when not cross-compiling bug 493693: sse2 instructions for bignum are not implemented on os/2 bug 493912: sqlite3_reset should be invoked in sdb_findobjectsinit when error occurs bug ...
gtstd.html
before running the sample programs, it's
important to understand the relationships between the ssl interface, the pkcs #11 interface, pkcs #11 modules, and the default netscape security databases.
... >mkdir server_db >certutil -n -d server_db
import the new ca certificate into the server's certificate database, and mark it trusted for issuing certificates for ssl client and server authentication.
... >certutil -c -d ca_db -c "myco's root ca" -a -i server_db/server.req -o server_db/server.crt -2 -6 enter password or pin for "communicator certificate db":
import (add) the new server certificate to the server's certificate database in the server_db directory with the appropriate nickname.
... >mkdir client_db >certutil -n -d client_db
import the new ca certificate into the client's certificate database, and mark it trusted for issuing certificates for ssl client and server authentication.
Creating JavaScript jstest reftests
directory overview in the js/src/tests directory, there are a few
important subdirectories.
...mozilla manually
imports these tests into the js/src/tests/test262 directory.
... at the time of this writing, mozilla
imports test262 tests in to the directory js/src/tests/test262.
... when
importing test262, the test file's in-file metadata is translated from test262 format to a format readibly by the jstest harness.
Bytecode Descriptions
dynamic
import stack: moduleid ⇒ promise dynamic
import of the module specified by the string value on the top of the stack.
... implements:
import calls.
...
importmeta stack: ⇒
import.meta push the
import.meta object.
...format: jof_envcoord, jof_name, jof_typeset, jof_ic get
import operands: (uint32_t nameindex) stack: ⇒ val get the value of a module
import by name and pushes it onto the stack.
How to build an XPCOM component in JavaScript
ule = dom_apps # set to 1 if the module should be part of the gecko runtime common to all applications gre_module = 1 # the idl sources xpidlsrcs = \ helloworld.idl \ $(null) include $(topsrcdir)/config/rules.mk xpidl_flags += \ -i$(topsrcdir)/dom/interfaces/base \ -i$(topsrcdir)/dom/interfaces/events \ $(null) creating the component using xpcomutils in firefox 3 and later you can use
import xpcomutils.jsm using components.utils.
import to simplify the process of writing your component slightly.
... the
imported library contains functions for generating the module, factory, and the nsgetmodule and queryinterface functions for you.
...to begin, include a line at the top of your interface to
import the xpcomutils library: components.utils.
import("resource://gre/modules/xpcomutils.jsm"); then implement your interface the same way you did above, except with a few modifications so that xpcomutils can set it up properly: /*********************************************************** class definition ***********************************************************/ //class constructor function helloworld() { // if y...
...ory" in xpcomutils) var nsgetfactory = xpcomutils.generatensgetfactory(components); // firefox 4.0 and higher else var nsgetmodule = xpcomutils.generatensgetmodule(components); // firefox 3.x so the total simplified version of your component now looks like (of course documentation and comments aren't a bad thing, but as a template something smaller is nice to have): components.utils.
import("resource://gre/modules/xpcomutils.jsm"); function helloworld() { } helloworld.prototype = { classdescription: "my hello world javascript xpcom component", classid: components.id("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"), contractid: "@dietrich.ganx4.com/helloworld;1", queryinterface: xpcomutils.generateqi([components.interfaces.nsihelloworld]), hello: function() { retu...
nsITransferable
to create an instance, use: var transferable = components.classes["@mozilla.org/widget/transferable;1"] .createinstance(components.interfaces.nsitransferable); it's
important to note that a flavor, which specifies a type of data the transferable supports, is represented by a null-terminated string indicating the mime type of the format supported by the flavor.
... method overview void adddataflavor( in string adataflavor ); nsisupportsarray flavorstransferablecanexport( ); nsisupportsarray flavorstransferablecan
import( ); void getanytransferdata( out string aflavor, out nsisupports adata, out unsigned long adatalen ); void gettransferdata( in string aflavor, out nsisupports adata, out unsigned long adatalen ); void init(in nsiloadcontext acontext); boolean islargedataset( ); void removedataflavor( in string adataflavor ); void settransferdata( in string aflavor, in nsisupports adata, in unsigned long adatalen ); attributes attribute type description converter nsiformatconverter an nsiformatconverter instance which implements the code ...
... return value missing description flavorstransferablecan
import() computes a list of flavors (mime types as nsisupportscstring) that the transferable can accept into it, either through intrinsic knowledge or input data converters.
... nsisupportsarray flavorstransferablecan
import(); parameters none.
nsIZipWriter
(a forward slash is '/') detail: this azipentry is very
important, this example demonstrates its usage: var zw = cc['@mozilla.org/zipwriter;1'].createinstance(ci.nsizipwriter); var myzipfile = fu.file('c:\\myzipfile.zip'); //this file will be creatd in c drive var pr = {pr_rdonly: 0x01, pr_wronly: 0x02, pr_rdwr: 0x04, pr_create_file: 0x08, pr_append: 0x10, pr_truncate: 0x20, pr_sync: 0x40, pr_excl: 0x80}; zw.open(xpi, pr.pr_wronly | pr.pr_create_file | pr.
...if saveinzipas was equal to "add this file.txt" then in the zip file it will also be named "add this file.txt" further detail: this example gives futher detail on the
importance of forward slashes var filetoaddtozip = fileutils.file('c:\\add this file.txt'); var saveinzipas = 'sub folder/blah.txt'; //do not use backward slash for example do not do: 'sub folder\\blah.txt'.
...this example is also a good of example of the in autf8string azipentry argument of addentryfile and how it is used, this entry is very
important, it is basically what to save the file as in the zip, you can take a file "blah.exe" and make it save in the zip as "hi and no extension".
... var {cc: classes, ci: interfaces, cu: utils} = components; var zw = cc['@mozilla.org/zipwriter;1'].createinstance(ci.nsizipwriter); var pr = {pr_rdonly: 0x01, pr_wronly: 0x02, pr_rdwr: 0x04, pr_create_file: 0x08, pr_append: 0x10, pr_truncate: 0x20, pr_sync: 0x40, pr_excl: 0x80}; //https://developer.mozilla.org/docs/pr_open#parameters var fu = cu.
import('resource://gre/modules/fileutils.jsm').fileutils; var fp = cc['@mozilla.org/filepicker;1'].createinstance(ci.nsifilepicker); fp.init(window, 'select directory to compile', ci.nsifilepicker.modegetfolder); fp.appendfilters(ci.nsifilepicker.filterall | ci.nsifilepicker.filtertext); var rv = fp.show(); if (rv == ci.nsifilepicker.returnok) { var dir = fp.file; //dir must exist, as the user selected it.
CSSStyleSheet.insertRule() - Web APIs
if trying to insert an @
import at-rule after a style rule, the method aborts with a hierarchyrequesterror.
... if rule is @namespace and the rule-list has more than just @
import at-rules and/or @namespace at-rules, the method aborts with an invalidstateerror.
... * @param {array} rules accepts an array of json-encoded declarations * @example addstylesheetrules([ ['h2', // also accepts a second argument as an array of arrays instead ['color', 'red'], ['background-color', 'green', true] // 'true' for !
important rules ], ['.myclass', ['background-color', 'yellow'] ] ]); */ function addstylesheetrules (rules) { var styleel = document.createelement('style'); // append <style> element to <head> document.head.appendchild(styleel); // grab style element's sheet var stylesheet = styleel.sheet; for (var i = 0; i < rules.length; i++) { var j = 1, rule = rules[i], s...
...' !
important' : '') + ';\n'; } // insert css rule stylesheet.insertrule(selector + '{' + propstr + '}', stylesheet.cssrules.length); } } polyfill the below polyfill will correct the input of the arguments of insertrule() to standardize them in internet explorer 5–8.
CSSStyleSheet - Web APIs
for example, one rule might be a cssstylerule object containing a style such as: h1, h2 { font-size: 16pt; } another rule might be an at-rule such as @
import or @media, and so forth.
... ownerrule read only if this stylesheet is
imported into the document using an @
import rule, the ownerrule property returns the corresponding css
importrule; otherwise, this property's value is null.
...a specific style sheet can also be accessed from its owner object (node or css
importrule), if any.
... stylesheets list getting the owner element/rule given the style sheet object the interface for the owner object getting the cssstylesheet object from the owner <style> and <link> elements in the document yes .ownernode htmllinkelement, htmlstyleelement, or svgstyleelement .sheet css @
import rule in other style sheets applied to the document yes .ownerrule css
importrule .stylesheet <?xml-stylesheet ?> processing instruction in the (non-html) document yes .ownernode processinginstruction .sheet http link header yes n/a n/a n/a user agent (default) style sheets no n/a n/a n/a specifications spec...
Basic concepts - Web APIs
so keep the following
important concepts in mind: indexeddb databases store key-value pairs.
...this is quite
important, as error events abort whatever transactions they're running in, unless they are cancelled.
...this
important and fundamental difference affects the way you design and build your applications.
... because everything happens within a transaction, it is a very
important concept in indexeddb.
Node.setUserData() - Web APIs
note that such data will not be preserved when
imported via node.
importnode, as with node.clonenode() and node.renamenode() operations (though node.adoptnode does preserve the information), and equality tests in node.isequalnode() do not consider user data in making the assessment.
... this method offers the convenience of associating data with specific nodes without needing to alter the structure of a document and in a standard fashion, but it also means that extra steps may need to be taken if one wishes to serialize the information or include the information upon clone,
import, or rename operations.
... handler is a callback which will be called any time the node is being cloned,
imported, renamed, as well as if deleted or adopted; a function can be used or an object implementing the handle method (part of the userdatahandler interface).
... example var d = document.implementation.createdocument('', 'test', null); d.documentelement.setuserdata('key', 15, {handle:function (o, k, d, s, ds) {console.log(o+'::'+k+'::'+d+'::'+s+'::'+ds)}}); // 2::key::15::[object element]::[object element] console.log(d.documentelement.getuserdata('key')); // 15 var e = document.
importnode(d.documentelement, true); // causes handler to be called console.log(e.getuserdata('key')); // null since user data is not copied specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'node.setuserdata()' in that specification.
UserDataHandler - Web APIs
summary when associating user data with a key on a node, node.setuserdata() can also accept, in its third argument, a handler which will be called when the object is cloned,
imported, deleted, renamed, or adopted.
...in both document.
importnode() and node.clonenode(), although user data is not copied over, the handler will be called.
... methods handle (operation, key, data, src, dst) (no return value) this method is a callback which will be called if a node is being cloned,
imported, renamed and as well, if deleted or adopted.
... constants constant value operation node_cloned 1 node.clonenode() node_
imported 2 document.
importnode() node_deleted unimplemented (see bug 550400) 3 node_renamed unimplemented 4 node.renamenode() node_adopted 5 document.adoptnode() (node_renamed is currently not supported since node.renamenode() is not supported.) specification dom level 3 core: userdatahandler ...
Signaling and video calling - Web APIs
it's
important to note that the server doesn't need to understand or interpret the signaling data content.
... note: the
important thing to note is this: the only thing your code is responsible for during ice negotiation is accepting outgoing candidates from the ice layer and sending them across the signaling connection to the other peer when your onicecandidate handler is executed, and receiving ice candidate messages from the signaling server (when the "new-ice-candidate" message is received) and delivering them to your...
... note: it's
important to keep in mind that the icecandidate event is not sent when ice candidates arrive from the other end of the call.
...it's
important to note, however, that ice negotiation does not stop once media is flowing.
Fundamentals of WebXR - Web APIs
this is an
important fact to keep in mind; while webxr manages the timing, scheduling, and the various points of view relevant when drawing the scene, it does not actually know how to load and manage models, render and texture them, and so forth.
...
important health and safety reminders because the entire act of creating a virtual 3d world is, in essence, a trick which takes advantage of our understanding of how eyes collect light and how the brain interprets the collected data, it is
important to keep in mind that as such, software designers and developers have a responsibility to be even more careful than usual to ensure that the results are cor...
...it's also
important to be alert for anything you may display that may have the potential to trigger seizures, given the all-encompassing nature of a headset; the user may not be able to quickly look away from the imagery you're presenting if it's causing distress.
...unless they're in a safe environment, it's
important to provide cues to restrict their movement, such as by simulating a space that is known to be safe within their physical environment.
ARIA live regions - Accessibility
this attribute is by far the most
important.
...any region which receives updates that are
important for the user to receive, but not so rapid as to be annoying, should receive this attribute.
... for regions which are not
important, or would be annoying because of rapid updates or other reasons, silence them with aria-live="off".
...alerts are particularly
important for client side validation notices to users.
Syntax - CSS: Cascading Style Sheets
it is
important to note that even if a ruleset characterized by a group of selectors is a kind of shorthand replacing rulesets with a single selector each, this doesn't apply to the validity of the ruleset itself.
... this leads to an
important consequence: if one single basic selector is invalid, like when using an unknown pseudo-element or pseudo-class, the whole selector is invalid and therefore the entire rule is ignored (as invalid too).
...but there is other information that a web author wants to convey in the style sheet, like the character set, other external style sheets to
import, font face or list counter descriptions and many more.
...they are used to convey meta-data information (like @charset or @
import), conditional information (like @media or @document), or descriptive information (like @font-face).
Linear-gradient Generator - CSS: Cascading Style Sheets
er: 1px solid #3490d2; border-color: #208b20; background: #666; background-color: #eef1f5; color: #000; position: absolute; top: 100%; left: 0; z-index: 100; overflow: hidden; transition: all 0.3s; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-dropdown-list:hover { overflow: auto; } .ui-dropdown-list[data-hidden='true'] { height: 0 !
important; opacity: 0; visibility: hidden; } .ui-dropdown[data-position='left'] .ui-dropdown-list { left: -100%; top: 0; } .ui-dropdown[data-position='right'] .ui-dropdown-list { left: 100%; top: 0; } .ui-dropdown-list > div { width: 80%; height: 1.6em; margin: 0.3em 0; padding: 0.3em 10%; line-height: 1.6em; } .ui-dropdown-list > div:hover { background: #3490d2; color:#fff; border-rad...
... ui", arial, helvetica, sans-serif; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } body[data-dragging="true"] { } /** * resize handle */ .resize-handle { width: 10px; height: 10px; background: url("images/resize.png") center center no-repeat; position: absolute; bottom: 0; right: 0; } [data-resize='both']:hover { cursor: nw-resize !
important; } [data-resize='width']:hover { cursor: w-resize !
important; } [data-resize='height']:hover { cursor: n-resize !
important; } /** * main container */ #container { width: 1000px; height: 100%; display: table; margin: 0 auto; } #gradient-container { width: 450px; height: 250px; min-width: 8px; min-height: 8px; margin: 100px auto; border: 1px solid #ddd; position: relative; }...
...ls .property > * { float: left; } #controls .property .name { width: 90px; padding: 0px 10px 0px 0px; text-align: right; line-height: 150%; } /* button */ #controls .button { height: 24px; padding: 0 10px; background-color: #379b4a; border-radius: 3px; font-size: 14px; color: #fff; display: inline; float: left; } #controls .button[data-state='disabled'] { background-color: #ccc !
important; color: #777 !
important; } #controls .button[data-state='disabled']:hover { background-color: #ccc !
important; cursor: default !
important; } #controls .button:hover { cursor: pointer; background-color: #208b20; } /* active point */ .ui-input-slider { height: 24px; line-height: 20px; } #delete-point { margin: 0 58px 0 0; float: right !
important; } #controls .ui-color-picker[data...
...-topic="picker"] { margin: 20px 0 0 0; } #controls .ui-input-slider[data-topic="axis-rotation"] { } #controls .ui-dropdown { width: 130px; height: 24px; } #controls .ui-dropdown-select { line-height: 24px; } #controls .ui-dropdown-list { height: 66px; line-height: 2.5em; overflow: hidden; } #delete-axis { margin: 0 38px 0 0; float: right !
important; } /* tool controls */ #tool-section .property .name { width: 150px; } #canvas-bg { width: 16px; height: 16px; margin: 5px; background: url("images/toggle-background.png") center right no-repeat; } #canvas-bg:hover { cursor: pointer; } #canvas-bg[data-alpha='false'] { background-position: center left; } #canvas-bg[data-alpha='true'] { background-position: center right; } /* order gradients */ #order { margin-left: 24px; ...
WAI ARIA Live Regions/API Support - Developer guides
firefox 3 contains
important improvements to the way the mozilla engine exposes live changes in a document.
...text_inserted (use iaccessibletext::get_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 equivalent of those events.
...this is especially
important in atomic regions.
...if the screen reader doesn't read anything, then the user may miss
important information.
Index - Developer guides
5 wai aria live regions/api support ajax, accessibility firefox 3 contains
important improvements to the way the mozilla engine exposes live changes in a document.
... 23 orientation and motion data explained intermediate, mobile, motion, needscontent, orientation, páginas_a_traducir, rotation when using orientation and motion events, it's
important to understand what the values you're given by the browser mean.
... 36 optimization and performance landing, optimization, performance, web when building modern web apps and sites, it's
important to make your content perform well.
... this is especially
important for intranets and other non-public websites; if we can't see your code, we can't see that it broke.
<b>: The Bring Attention To element - HTML: Hypertext Markup Language
the html bring attention to element (<b>) is used to draw the reader's attention to the element's contents, which are not otherwise granted special
importance.
...however, you should not use <b> for styling text; instead, you should use the css font-weight property to create boldface text, or the <strong> element to indicate that text is of special
importance.
... usage notes use the <b> for cases like keywords in a summary, product names in a review, or other spans of text whose typical presentation would be boldfaced (but not including any special
importance).
...the <strong> element represents text of certain
importance, <em> puts some emphasis on the text and the <mark> element represents text of certain relevance.
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
<input type="radio" name="radio"/> range a control for entering a number whose exact value is not
important.
... <input type="datetime" name="datetime"/> html5 attributes the <input> element is so powerful because of its attributes; the type attribute, described with examples above, being the most
important.
...those with extra
importance as it relates to <input> are highlighted.
... as web developers, it's
important that we never assume that people will know all the things that we know.
<link>: The External Resource Link element - HTML: Hypertext Markup Language
font css @font-face image <img> and <picture> elements with srcset or imageset attributes, svg <image> elements, css *-image rules object <object> elements script <script> elements, worker
importscripts style <link rel=stylesheet> elements, css @
import track <track> elements video <video> elements worker worker, sharedworker crossorigin this enumerated attribute indicates whether cors must be used when fetching the resource.
...
importance indicates the relative
importance of the resource.
... note: the
importance attribute may only be used for the <link> element if rel="preload" or rel="prefetch" is present.
...> var mystylesheet = document.queryselector('#my-stylesheet'); mystylesheet.onload = function() { // do something interesting; the sheet has been loaded } mystylesheet.onerror = function() { console.log("an error occurred loading the stylesheet!"); } </script> <link rel="stylesheet" href="mystylesheet.css" id="my-stylesheet"> note: the load event fires once the stylesheet and all of its
imported content has been loaded and parsed, and immediately before the styles start being applied to the content.
<mark>: The Mark Text element - HTML: Hypertext Markup Language
the html mark text element (<mark>) represents text which is marked or highlighted for reference or notation purposes, due to the marked passage's relevance or
importance in the enclosing context.
... usage notes typical use cases for <mark> include: when used in a quotation (<q>) or block quote (<blockquote>), it generally indicates text which is of special interest but is not marked in the original source material, or material which needs special scrutiny even though the original author didn't think it was of particular
importance.
... don't confuse <mark> with the <strong> element; <mark> is used to denote content which has a degree of relevance, while <strong> indicates spans of text of
importance.
...because of this, it is
important to not abuse this technique and only apply it in situations where not knowing content has been highlighted would adversely affect understanding.
HTML elements reference - HTML: Hypertext Markup Language
important for accessibility and seo, these elements identify the purpose or structure of that content.
... <b> the html bring attention to element (<b>) is used to draw the reader's attention to the element's contents, which are not otherwise granted special
importance.
... <mark> the html mark text element (<mark>) represents text which is marked or highlighted for reference or notation purposes, due to the marked passage's relevance or
importance in the enclosing context.
... <strong> the html strong
importance element (<strong>) indicates that its contents have strong
importance, seriousness, or urgency.
HTML documentation index - HTML: Hypertext Markup Language
64 <b>: the bring attention to element attention, element, html, html text-level semantics, html:flow content, html:palpable content, html:phrasing content, reference, web the html bring attention to element (<b>) is used to draw the reader's attention to the element's contents, which are not otherwise granted special
importance.
...the precise value, however, is not considered
important.
... 153 <mark>: the mark text element element, html, html text-level semantics, html5, highlighting, highlighting text, marking text, reference, web, mark the html mark text element (<mark>) represents text which is marked or highlighted for reference or notation purposes, due to the marked passage's relevance or
importance in the enclosing context.
... 197 <strong>: the strong
importance element element, html, html text-level semantics, html:flow content, html:palpable content, html:phrasing content, reference, strong
importance, urgency, web, strong the html strong
importance element (<strong>) indicates that its contents have strong
importance, seriousness, or urgency.
MIME types (IANA media types) - HTTP
important: browsers use the mime type, not the file extension, to determine how to process a url, so it's
important that web servers send the correct mime type in the response's content-type header.
...
important mime types for web developers application/octet-stream this is the default for binary files.
... audio and video types as is the case for images, html doesn't mandate that web browsers support any specific file and codec types for the <audio> and <video> elements, so it's
important to consider your target audience and the range of browsers (and versions of those browsers) they may be using when choosing the file type and codecs to use for media.
...416f9b5 content-length: 385 --3d6b6a416f9b5 content-type: text/html content-range: bytes 100-200/1270 eta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="vieport" content --3d6b6a416f9b5 content-type: text/html content-range: bytes 300-400/1270 -color: #f0f0f2; margin: 0; padding: 0; font-family: "open sans", "helvetica --3d6b6a416f9b5--
importance of setting the correct mime type most web servers send unrecognized resources as the application/octet-stream mime type.
WebAssembly.Module - JavaScript
webassembly.module.
imports() given a module, returns an array containing descriptions of all the declared
imports.
... var worker = new worker("wasm_worker.js"); webassembly.compilestreaming(fetch('simple.wasm')) .then(mod => worker.postmessage(mod) ); in the worker (see wasm_worker.js) we define an
import object for the module to use, then set up an event handler to receive the module from the main thread.
... var
importobject = {
imports: {
imported_func: function(arg) { console.log(arg); } } }; onmessage = function(e) { console.log('module received from main thread'); var mod = e.data; webassembly.instantiate(mod,
importobject).then(function(instance) { instance.exports.exported_func(); }); }; specifications specification webassembly javascript interfacethe definition of 'webassembly.module()' in that specification.
... 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0
importschrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noo...
WebAssembly.instantiateStreaming() - JavaScript
syntax promise<resultobject> webassembly.instantiatestreaming(source,
importobject); parameters source a response object or a promise that will fulfill with one, representing the underlying source of a .wasm module you want to stream, compile, and instantiate.
...
importobject optional an object containing the values to be
imported into the newly-created instance, such as functions or webassembly.memory objects.
... there must be one matching property for each declared
import of the compiled module or else a webassembly.linkerror is thrown.
... var
importobject = {
imports: {
imported_func: arg => console.log(arg) } }; webassembly.instantiatestreaming(fetch('simple.wasm'),
importobject) .then(obj => obj.instance.exports.exported_func()); the resultobject's instance member is then accessed, and the contained exported function invoked.
Lexical grammar - JavaScript
keywords reserved keywords as of ecmascript 2015 break case catch class const continue debugger default delete do else export extends finally for function if
import in instanceof new return super switch this throw try typeof var void while with yield future reserved keywords the following are reserved as future keywords by the ecmascript specification.
... a.
import a['
import'] a = {
import: 'test' }.
... function
import() {} // illegal.
... `string text` `string text line 1 string text line 2` `string text ${expression} string text` tag `string text ${expression} string text` automatic semicolon insertion some javascript statements must be terminated with semicolons and are therefore affected by automatic semicolon insertion (asi): empty statement let, const, variable statement
import, export, module declaration expression statement debugger continue, break, throw return the ecmascript specification mentions three rules of semicolon insertion.
Responsive Navigation Patterns - Progressive web apps (PWAs)
you could rank the item priorities to ensure the most
important items always appear in the top navigation.
... pros: one button in header maximizes space for content on a small screen
important items stay visiblein most screen sizes and you decide the item priorities legibility of navigation items is maintained with adequate spacing, by automatically hiding items that don't fit cons: navigation items might be less discoverable because some items are hidden in the drop-down or toggle menu users may not notice the button contains a navigation menu in the smallest screen size one more step is needed to access the hidden navigation items pattern 2: expandable bottom menu similar to the first pattern, the top navigation items rearrange for smaller widths until there is not enough space.
...you could rank the item priorities to ensure the most
important items always appear in the top navigation.
... pros: expandable menu is easy to discover
important items are always visible and you decide the item priorities legibility of navigation items is maintained with adequate spacing, by automatically hiding items that don't fit cons: one more step is needed to access the navigation items that are hidden navigation items might be less discoverable because some items are hidden less space for content in the smallest screen size pattern 3: left hidden menu the main navigation is always on the left except in the smallest screen...
Caching compiled WebAssembly modules - WebAssembly
in our wasm-utils.js library script, you'll find instantiatecachedurl() — this function fetches the wasm module at url with a version of dbversion, instantiates it with the given
importobject, and returns a promise resolving to the finished wasm instance.
... the function starts off by defining some necessary constants: function instantiatecachedurl(dbversion, url,
importobject) { const dbname = 'wasm-cache'; const storename = 'wasm-cache'; setting up the database the first helper function contained inside instantiatecachedurl() — opendatabase() — creates an object store for storing wasm modules, and also handles clearing out the database if the dbversion is updated; it returns a promise resolving to the new database.
...we start by trying to open a database, then see if we already have a compiled module with the key url stored in the given db: return opendatabase().then(db => { return lookupindatabase(db).then(module => { if we do, we instantiate it with the given
import object: console.log(`found ${url} in wasm cache`); return webassembly.instantiate(module,
importobject); }, if not, we compile it from scratch and then store the compiled module in the database with a key of url, for next time we want to use it: errmsg => { console.log(errmsg); return webassembly.instantiatestreaming(fetch(url)).then(results => { storein...
... an
import object, if required.
Compiling from Rust to WebAssembly - WebAssembly
the third line contains a use command, which
imports code from a library into your code.
... in this case, we're
importing everything in the wasm_bindgen::prelude module.
...ame: "index.js", }, mode: "development" }; now we need an html file; create index.html and give it the following contents: <!doctype html> <html> <head> <meta charset="utf-8"> <title>hello-wasm example</title> </head> <body> <script src="./index.js"></script> </body> </html> finally, create the index.js referenced in the html file and give it these contents: const js =
import("./node_modules/hello-wasm/hello_wasm.js"); js.then(js => { js.greet("webassembly"); }); note that you need to fill in your npm username again.
... this
imports the new module from the node_modules folder.
Content Processes - Archive of obsolete content
afterwards, it was decided to keep the design the way it is: even though it's no longer necessary, it turns out that from a security point of view there are several
important advantages to thinking about content and add-on code as living in different processes.
... when a content script is first loaded, the content worker automatically
imports a messaging api that allows it to emit messages over a pipe.
...since both add-on modules and content scripts are currently loaded in sandboxes rather than separate processes, and sandboxes can communicate with each other directly (using
imports/exports), you might be wondering why we have to go through all the trouble of passing messages between add-on and content scripts.
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 require() function.
... to learn how to implement and
import your own modules, see the tutorial on implementing reusable modules.
...you use require() to
import functionality from another module, and exports to export functionality from your module.
Downloading Files - Archive of obsolete content
components.utils.
import("resource://gre/modules/privatebrowsingutils.jsm"); const webbrowserpersist = components.constructor("@mozilla.org/embedding/browser/nswebbrowserpersist;1", "nsiwebbrowserpersist"); var persist = webbrowserpersist(); var targetfile = services.dirsvc.get("desk", ci.nsifile); targetfile.append("file.bin"); // obtain the privacy context of the bro...
... downloading binary files with a progress listener to download a binary file with custom progress listener: components.utils.
import("resource://gre/modules/privatebrowsingutils.jsm"); const webbrowserpersist = components.constructor("@mozilla.org/embedding/browser/nswebbrowserpersist;1", "nsiwebbrowserpersist"); var persist = webbrowserpersist(); var targetfile = services.dirsvc.get("desk", ci.nsifile); targetfile.append("file.bin"); var obj_uri = services.io.newuri(aurltod...
... components.utils.
import("resource://gre/modules/privatebrowsingutils.jsm"); const webbrowserpersist = components.constructor("@mozilla.org/embedding/browser/nswebbrowserpersist;1", "nsiwebbrowserpersist"); var persist = webbrowserpersist(); // obtain the privacy context of the browser window that the url // we are downloading comes from.
Miscellaneous - Archive of obsolete content
var osstring = services.appinfo.os; detecting the 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-guid@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...pdat...
...put this code in the components/certsservice.js file: const cc = components.classes; const ci = components.interfaces; components.utils.
import("resource://gre/modules/xpcomutils.jsm"); const gobserver = cc['@mozilla.org/observer-service;1'].getservice(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": ...
... window.addeventlistener('fullscreen', function(){ alert('fullscreen mode on or off') }, false) getting addon install path first one using addon manager: components.utils.
import('resource://gre/modules/addonmanager.jsm'); addonmanager.getaddonbyid('example@addon', function(addon) { let path = addon.getresourceuri().path; // something like /home/username/....
JavaScript Daemons Management - Archive of obsolete content
r(nlen); } if (fonstart) { this.onstart = fonstart; } if (finit) { this.onstop = finit; finit.call(oowner, this.index, this.length, this.backw); } } /* create the daemon.blank() constructor and the global daemon.context object */ daemon.blank = function () {}; daemon.context = daemon.blank.prototype; /* make love with the gc :-) */ daemon.blank.prototype = /*
important!
... /* the "daemon.safe" constructor */ daemon.safe = function () { daemon.apply(this, arguments); }; /* create the daemon.safe.blank() constructor and the daemon.safe.context object */ daemon.safe.blank = function () {}; daemon.safe.context = daemon.safe.prototype; daemon.to_be_defined = daemon.safe.blank.prototype; /* make love with the gc :-) */ daemon.safe.blank.prototype = /*
important!
... */ daemon.safe.prototype = /*
important!
Appendix: What you should know about open-source software licenses - Archive of obsolete content
what is
important to us now is the following three rights: open source rights: a user can create and distribute copies of the source code; a user can obtain a program’s source code; a user can modify the source code.
... points to understand about oss licenses i’ll explain some
important aspects of oss licensing that you should be aware of.
...it’s
important to thoroughly understand the license you choose and make a choice that strikes a good balance in terms of utility to the creator and the user.
Adding Events and Commands - Archive of obsolete content
this is one of the most
important and commonly used events in xul.
...you can get information on key modifiers (in case the user was holding a modifier key like alt while performing the event), screen coordinates for mouse events, and most
importantly, the target element for the event.
... broadcasters keeping a consistent ui is another
important aspect of extension behavior.
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
tooltips are very
important for users that want to know what a button does before clicking it.
...this is very
important because the toolbar customization dialog won't work correctly without this.
...all of this is very
important to test because, when the dialog is opened, firefox changes the dom of the toolbar, adding wrapper elements that allow the customization.
Appendix A: Add-on Performance - Archive of obsolete content
nevertheless, loading pages is pretty
important in firefox, and users expect it to be fast.
...even if it is not as
important as other areas, firefox shutdown can also be slowed down because of add-ons.
... if there's anything you can unload before shutdown, or if there's anything you can do to unload things more efficiently, then it's
important that you do.
Appendix F: Monitoring DOM changes - Archive of obsolete content
it is
important to note, however, that this method can have severe performance implications for certain events, namely mouseover, mouseout, and friends, which are fired very often while the mouse is moving.
... let style = doc.createelementns(xhtml, 'style'); style.setattribute('type', 'text/css'); let preamble = ' @-moz-keyframes ' + event + ' { \n\ from { clip: rect(1px, auto, auto, auto); } to { clip: rect(0px, auto, auto, auto); } \n\ }\n'; let properties = [ 'animation-duration: 0.0001s;', 'animation-name: ' + event + ' !
important;' ]; properties = properties.map(function (prop) ' ' + watchnodes.namespace + prop) .join('\n'); doc.addeventlistener('animationstart', listener, false); function listener(event) { if (event.animationname == event) callback.call(this, event); } style.textcontent = ' ' + pream...
... as it is currently possible to attach only a single binding to a given dom node at once, it is
important when using this method to detach your binding from a node once your constructor has run.
Connecting to Remote Content - Archive of obsolete content
therefore, it is very
important that xmlhttprequest calls are always done asynchronously.
...after that, the xslt stylesheet can be
imported into an xslt processor as shown below.
...utstream); let xsltprocessor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsixsltprocessor); let xsldocument; filestream.init(somexslfile, -1, 0x01, 0444); // read only // parse from the xslt stylesheet file stream xsldocument = domparser.parsefromstream( filestream, null, filestream.available(), "text/xml"); //
import the xslt stylesheet to the xslt processor xsltprocessor.
importstylesheet(xsldocument); finally, you can either use nsixsltprocessor.transformtodocument() or nsixsltprocessor.transformtofragment() methods to transform the xml document.
Tabbed browser - Archive of obsolete content
xul: <menuitem oncommand="myextension.foo(event)" onclick="checkformiddleclick(this, event)" label="click me"/> js: var myextension = { foo: function(event) { openuilink("http://www.example.com", event, false, true); } } opening a url in an on demand tab cu.
import("resource://gre/modules/xpcomutils.jsm"); xpcomutils.definelazyservicegetter(this, "gsessionstore", "@mozilla.org/browser/sessionstore;1", "nsisessionstore"); // create new tab, but don't load the content.
... components.utils.
import('resource://gre/modules/services.jsm'); services.obs.addobserver(httpobs, 'http-on-modify-request', false); //services.obs.removeobserver(httpobs, 'http-on-modify-request'); //uncomment this line, or run this line when you want to remove the observer var httpobs = { observe: function (asubject, atopic, adata) { if (atopic == 'http-on-modify-request') { /*start - do not ed...
...but if its an ajax call you may end up here } } } }; here's a cleaner example of the same thing: cu.
import('resource://gre/modules/services.jsm'); var httprequestobserver = { observe: function (subject, topic, data) { var httpchannel, requesturl; if (topic == "http-on-modify-request") { httpchannel = subject.queryinterface(ci.nsihttpchannel); requesturl = httpchannel.uri.spec; var newrequesturl, i; if (/someurl/.test(requesturl)) ...
Index of archived content - Archive of obsolete content
gning an extension supporting search suggestions in search plugins tabbed browser techniques promises updating addons broken by private browsing changes using dependent libraries in extension components using the stylesheet service bookmarks.export() bookmarks.
import() adding preferences to an extension an interview with douglas bowman of wired news archived mozilla and build documentation activex control for hosting netscape plug-ins in ie archived spidermonkey docs file object open ...
...per apps (and a bit of save as) hidden prefs how to write and land nanojit patches io guide/directory keys introducing the audio api extension isp data java in firefox extensions javascript os.shared javascript crypto crmf request object generatecrmfrequest()
importusercertificates popchallengeresponse jetpack basics content page modifications extenders jetpack snippets libraries twitter ...
... reference server-side javascript back to the server: server-side javascript on the rise sharp variables in javascript standards-compliant authoring tools stopiteration styling the amazing netscape fish cam page using javascript generators in firefox window.
importdialog() writing javascript for xhtml xforms building mozilla xforms community developing mozilla xforms implementation status mozilla xforms specials mozilla xforms user interface xforms alert element xforms group element ...
In-Depth - Archive of obsolete content
possible are (this is probably an incomplete list): none - (!
important may be needed) will override the operating system default.
...using this, we can figure out what objects are where, what classes/id's they have applied to them, and most
importantly, which file the style is located in.
...to cut the pieces out you need to define rectangles in the css file like this: #button-send { -moz-image-region: rect(294px 23px 315px 0px); } #button-send:hover { -moz-image-region: rect(294px 46px 315px 23px); } #button-send:hover:active { -moz-image-region: rect(294px 69px 315px 46px); } #button-send[disabled="true"] { -moz-image-region: rect(294px 92px 315px 69px) !
important; } the properties for rect are listed in a clockwise fashion - top, right, bottom, left.
Creating a Help Content Pack - Archive of obsolete content
understanding the syntax is
important because small syntax errors can mean that a whole file won't be loaded correctly.
... the index file one
important note on the index file is that there is no automatically generated set of top-level letters (e.g., a for accessibility and automation or b for book and border).
... the table of contents file the table of contents file is the most
important data source you'll create.
Settings - Archive of obsolete content
because it is still under development, the api currently lives in the future and must be
imported before it is used: specifying settings in a manifest to specify its settings, a jetpack defines a variable named manifest in its global namespace before it
imports the settings api.
...facebook", type: "group", label: "facebook", settings: [ { name: "username", type: "text", label: "username", default: "jdoe" }, { name: "password", type: "password", label: "secret" } ] }, { name: "music", type: "boolean", label: "music", default: true }, { name: "volume", type: "range", label: "volume", min: 0, max: 10, default: 5 } ] }; //
import after defining manifest!
... jetpack.future.
import("storage.settings"); this definition will result in a user interface with an input field for each setting defined above.
Settings - Archive of obsolete content
because it is still under development, the api currently lives in the future and must be
imported before it is used: jetpack.future.
import("storage.settings"); specifying settings in a manifest to specify its settings, a jetpack defines a variable named manifest in its global namespace before it
imports the settings api.
...facebook", type: "group", label: "facebook", settings: [ { name: "username", type: "text", label: "username", default: "jdoe" }, { name: "password", type: "password", label: "secret" } ] }, { name: "music", type: "boolean", label: "music", default: true }, { name: "volume", type: "range", label: "volume", min: 0, max: 10, default: 5 } ] }; //
import after defining manifest!
... jetpack.future.
import("storage.settings"); this definition will result in a user interface with an input field for each setting defined above.
Simple Storage - Archive of obsolete content
the namespace currently lives in the future and must be
imported before it is used: jetpack.future.
import("storage.simple"); methods sync()as described above, the jetpack.storage.simple object is automatically written to disk, but a feature may force flush by calling jetpack.storage.simple.sync().
...examples this code persistently stores some data: jetpack.future.
import("storage.simple");var mystorage = jetpack.storage.simple;mystorage.fribblefrops = [1, 3, 3, 7];mystorage.heimelfarbs = { bar: "baz" }; and this code -- pretend it's in the same jetpack as the code above -- simply uses that data: mystorage.fribblefrops.foreach(function (elt) console.log(elt));var bar = mystorage.heimelfarbs.bar;jetpack.notifications.show(bar.baz); that's all there is to it!
...jetpack.future.
import("menu");jetpack.future.
import("selection");jetpack.future.
import("storage.simple");// create the persistent notes array if it doesn't already exist.jetpack.storage.simple.notes = jetpack.storage.simple.notes || [];var notes = jetpack.storage.simple.notes;// updates the jetpack menu with the current notes.
Simple Storage - Archive of obsolete content
the namespace currently lives in the future and must be
imported before it is used: jetpack.future.
import("storage.simple"); methods sync()as described above, the jetpack.storage.simple object is automatically written to disk, but a feature may force flush by calling jetpack.storage.simple.sync().
...examples this code persistently stores some data: jetpack.future.
import("storage.simple"); var mystorage = jetpack.storage.simple; mystorage.fribblefrops = [1, 3, 3, 7]; mystorage.heimelfarbs = { bar: "baz" }; and this code -- pretend it's in the same jetpack as the code above -- simply uses that data: mystorage.fribblefrops.foreach(function (elt) console.log(elt)); var bar = mystorage.heimelfarbs.bar; jetpack.notifications.show(bar.baz); that's all there is to it!
...jetpack.future.
import("menu"); jetpack.future.
import("selection"); jetpack.future.
import("storage.simple"); // create the persistent notes array if it doesn't already exist.
RDF Datasource How-To - Archive of obsolete content
an "address book" datasource could translate a database file into statements like "spammer128@hotmail.com's real name is 'billy dumple'" and "spammer128@hotmail.com is considered an '
important friend'." statements from one datasource can be combined with statements from another datasource using a composite datasource.
... by combining statements from the imap datasource and address book datasource, above, we'd be able to identify the sender of "message 126" as an "
important friend".
...l> <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 built _here_ --> </tree> </window> the
important "magic attributes" have been called out in bold, above: datasources="rdf:my-datasource".
Supporting per-window private browsing - Archive of obsolete content
detecting private browsing mode determining whether or not a given dom window is private is simple:
import resource://gre/modules/privatebrowsingutils.jsm and use privatebrowsingutils.iswindowprivate(window).
... try { // firefox 20+ components.utils.
import("resource://gre/modules/privatebrowsingutils.jsm"); if (!privatebrowsingutils.iswindowprivate(window)) { ...
...to do this,
import resource://gre/modules/privatebrowsingutils.jsm and use privatebrowsingutils.getprivacycontextfromwindow(win), passing a window object that is related to the content in question.
Creating XPI Installer Modules - Archive of obsolete content
keymaster/gat...re.is.only.xul" width="175" height="375" x="20" y="20" persist="width height x y" orient="vertical" autostretch="always"> <script src="barley.js"/> <image src="barley.gif" /> <box orient="horizontal" autostretch="never"> <button label="barley corn" /> <button label="show aphids" oncommand="bar();" /> </box> </window> the other files that the window
imports are defined in dark blue.
... note that the stylesheet processing instruction at the top of the xul file does not refer to any new skin, but
imports communicator.css to make use of that skin's basic widget styles.
...barley/ content/ barley.gif barley.js barley.xul creating the contents.rdf file one of the most
important ingredients of the software package is the contents.rdf file that describes the contents of the package in terms that the chrome registry can make sense of.
XUL Structure - Archive of obsolete content
it is
important to note that when accessing content through a chrome url, it gains the enhanced privileges described above that other kinds of urls do not.
... this distinction is
important.
... this distinction between documents is
important.
Using the Editor from XUL - Archive of obsolete content
the
important stuff in editorstartup() begins where we get or create an editorshell.
... editorstartup() does some other minor bits of setup before finally kicking off the url load, which the most
important part here.
...this parameter is more
important when the editor is in a text widget, where it points to the the subtree of the parent document that corresponds to widget content.
Using the standard theme - Archive of obsolete content
applying the standard theme in order to use the theme currently chosen by the user of the base application (the so called "global skin"), you have to add the following line to your xul file: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> this
imports the styles found in the <tt>global/skin</tt> chrome directory and will make the standard xul widgets of your application use the selected chosen theme.
...you can either add multiple <tt>xml-stylesheet</tt> processing instructions to your xul file, or create an <tt>@
import</tt> chain.
... multiple <tt>xml-stylesheet</tt> processing instructions simply add one <tt>xml-stylesheet</tt> processing instruction for every style sheet you want to associate with your xul file: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://myextension/skin/custom.css" type="text/css"?> <tt>@
import</tt> chains first,
import the global skin in your custom style sheet using the css <tt>@
import</tt> rule: @
import url("chrome://global/skin/"); you then have to associate your xul file with your custom style sheet only: <?xml-stylesheet href="chrome://myextension/skin/custom.css" type="text/css"?> applying different custom style sheets depending on the selected theme mozilla is able to automa...
calIFileType - Archive of obsolete content
califiletype is used in cali
importer and caliexporter to determine which file types are supported for
import/export.
...defined in calendar/base/public/cali
importexport.idl interface code [scriptable, uuid(efef8333-e995-4f45-bdf7-bfcabbd9793e)] interface califiletype : nsisupports { readonly attribute astring defaultextension; readonly attribute astring extensionfilter; readonly attribute astring description; }; attributes defaultextension the default extension that should be associated with files of this type.
...related interfaces cali
importer caliexporter example code see calhtmlexport.js.
Create Your Own Firefox Background Theme - Archive of obsolete content
the upper right-hand side of the image should have the most
important information—as a user increases the width of the browser window, the browser reveals more of the left-hand side of the image.
... the left-hand side of the image should have the most
important information—as a user increases the width of the browser window, the browser reveals more of the right-hand side of the image.
...
important: please be sure you have the rights to use the image in your theme!
LiveConnect Overview - Archive of obsolete content
java to javascript communication if you want to use javascript objects in java, you must
import the netscape.javascript package into your java file.
...as shown in the following code, the javadog constructor takes the javascript object jsdog, which is defined as type jsobject, as an argument:
import netscape.javascript.*; public class javadog{ public string dogbreed; public string dogcolor; public string dogsex; // define the class constructor public javadog(jsobject jsdog){ // use try...catch to handle jsexceptions here this.dogbreed = (string)jsdog.getmember("breed"); this.dogcolor = (string)jsdog.getmember("color"); this.dogsex = (stri...
...you can respond to either type of run-time error the evaluation causes by implementing an exception handler such as the following:
import netscape.javascript.jsobject;
import netscape.javascript.jsexception; public class etest { public static object doit(jsobject obj, string jscode) { try { obj.eval(jscode); } catch (jsexception e) { if (e.getwrappedexception() == null) return e; return e.getwrappedexception(); } return null; } } in this e...
Game promotion - Game development
promoting the game helps a lot when monetizing it later on too, so it's
important to do it correctly.
... social media your social media presence is very
important — follow the right hashtags, make friends, engage in conversations, help other devs in need.
...it's
important to focus on the knowledge part and tone down the marketing — devs are sensitive on this matter and you may end up with an angry crowd if you just try to sell them something.
Visual-js game engine - Game development
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 3.0 about gui for windows (canvas2d part only) : windows gui application version 1.0 (using visual-js 0.9 lib)
important : you will need net 4.5.2 minimum also redistribution pack for c++ how to start project ?
... 1) click create application 2) enter new application name in input prompt 3) select folder for server part of application (
important : www is not secure place) 4) select folder for client part of application ( any path in www) 5) new app name will appear in project list , select and click open application 6) open your server folder : install node.js modules one way - use windows bat-s file (in server root folder with prefix install_ ) second way - open cmd terminal and enter next command : npm install mysql npm install delivery npm install express npm install mkdirp npm install socket.io npm install nodemailer@0.7.0 very easy installation and project files generator .
...-
important safari not working at the moment chrome , firefox , opera tutorial - pencil (animation path) : how to use pencil tool to create path object .
Images, media, and form elements - Learn web development
important: you should take care when changing the styling of form elements to make sure it is still obvious to the user they are form elements.
...they are not as
important as they once were, as browsers are typically more consistent than in the past.
... we have covered a lot in this article, but can you remember the most
important information?
Organizing your CSS - Learn web development
there often isn't a right or wrong way to do things, but consistency is
important.
... keep it consistent if you get to set the rules for the project or are working alone, then the most
important thing to do is to keep things consistent.
... defining variables css now has native custom properties, making this feature increasingly less
important, however one of the reasons you might use sass is to be able to define all of the colors and fonts used in a project as settings, then use that variable around the project.
Sizing items in CSS - Learn web development
understanding how big the different features in your design will be is
important, and in this lesson we will summarize the various ways elements get a size via css and define a few terms around sizing that will help you in the future.
... we have covered a lot in this article, but can you remember the most
important information?
...when you move onto css layout, sizing will become very
important in mastering the different layout methods, so it is worth understanding the concepts here before moving on.
Introduction to CSS layout - Learn web development
starting with a well-structured html document is very
important, as you can then work with the way things are laid out by default rather than fighting against it.
...the two values most
important for our purposes when discussing layout are display: flex and display: grid.
... the rest of this guide covers other layout methods, which are less
important for the main layout structures of your page but can still help you achieve specific tasks.
CSS FAQ - Learn web development
it is
important to remember that a rule applied to a descendent overrides the style of the parent, in spite of any specificity or priority of css rules.
... explicitly re-defined style rule in css stylesheets, order is
important.
...</div> in the previous example the problem occurred on rules belonging to different elements, but it could happen also for the same element, because rule order is
important.
HTML forms in legacy browsers - Learn web development
chrome platform status site is also
important.
... feature detection and polyfills css and javascript are awesome technologies, but it's
important to ensure you don't break legacy browsers.
... conclusion as you can see, considering browser and operating system default form control appearance is
important.
How to structure a web form - Learn web development
the use case in this example is one of the most
important.
...this is the most
important element if you want to build accessible forms — when implemented properly, screenreaders will speak a form element's label along with any related instructions, as well as it being useful for sighted users.
... you've reached the end of this article, but can you remember the most
important information?
UI pseudo-classes - Learn web development
styling controls based on whether their data is valid the other really
important, fundamental concept in form validation is whether a form control's data is valid or not (in the case of numerical data, we can also talk about in-range and out-of-range data).
... see the live result below: note: you can also find the example live on github at radios-checked-default.html (also see the source code.) for the :indeterminate example, we've got no default selected radio button — this is
important — if there was, then there would be no indeterminate state to style.
... you've reached the end of this article, but can you remember the most
important information?
Creating hyperlinks - Learn web development
previous overview: introduction to html next hyperlinks are really
important — they are what makes the web a web.
...if a title's information is truly
important to the usability of page, then you should present it in a manner that will be accessible to all users, for example by putting it in the regular text.
... you've reached the end of this article, but can you remember the most
important information?
From object to iframe — other embedding technologies - Learn web development
this makes your page usable sooner and decreases your official page load time (an
important seo metric.) security concerns above we mentioned security concerns — let's go into this in a bit more detail now.
...one
important note is that you should never add both allow-scripts and allow-same-origin to your sandbox attribute — in that case, the embedded content could bypass the same-origin policy that stops sites from executing scripts, and use javascript to turn off sandboxing altogether.
... you've reached the end of this article, but can you remember the most
important information?
Graceful asynchronous programming with Promises - Learn web development
the
important thing here is that the getusermedia() call returns almost immediately, even if the camera stream hasn't been obtained yet.
... explaining basic promise syntax: a real example promises are
important to understand because most modern web apis use them for functions that perform potentially lengthy tasks.
...promises will be more and more
important as time goes on, so learning to use and understand them is an
important step in learning modern javascript.
Manipulating documents - Learn web development
objective: to gain familiarity with the core dom apis, and the other apis commonly associated with dom and document manipulation the
important parts of a web browser web browsers are very complicated pieces of software with a lot of moving parts, many of which can't be controlled or manipulated by a web developer using javascript.
...at this point you should understand what the
important parts of a web browser are with respect to controlling documents and other aspects of the user's web experience.
... most
importantly, you should understand what the document object model is, and how to manipulate it to create useful functionality.
Object-oriented JavaScript for beginners - Learn web development
this is known as abstraction — creating a simple model of a more complex thing, which represents its most
important aspects in a way that is easy to work with for our program's purposes.
...note that they are using their own name value that was assigned to them when they were created; this is one reason why it is very
important to use this, so each one uses its own value, and not some other value.
... you've reached the end of this article, but can you remember the most
important information?
Object prototypes - Learn web development
note: it's
important to understand that there is a distinction between an object's prototype (available via object.getprototypeof(obj), or via the deprecated __proto__ property) and the prototype property on constructor functions.
...
important: the prototype property is one of the most confusingly-named parts of javascript — you might think that this points to the prototype object of the current object, but it doesn't (that's an internal object that can be accessed by __proto__, remember?).
... you've reached the end of this article, but can you remember the most
important information?
The business case for web performance - Learn web development
previous overview: performance we've discussed the
importance of web performance.
...it highlights the
importance of understanding how cumulative experiences impact conversion and retention rates.
...kpis can be both a set of
important business metrics in measuring the impact of user experience and performance on the business's top line, and a way of demonstrating the benefits of prioritizing performance.
Server-side web frameworks - Learn web development
# django view function from django.http
import httpresponse def index(request): # get an httprequest (request) # perform operations using information from the request.
... #best/models.py from django.db
import models class team(models.model): team_name = models.charfield(max_length=40) team_levels = ( ('u09', 'under 09s'), ('u10', 'under 10s'), ('u11', 'under 11s'), ...
... #best/views.py from django.shortcuts
import render from .models
import team def youngest(request): list_teams = team.objects.filter(team_level__exact="u09") context = {'youngest_teams': list_teams} return render(request, 'best/index.html', context) rendering data web frameworks often provide templating systems.
Beginning our React todo list - Learn web development
we're not going to write per-component stylesheets, so first delete the app.css
import from the top of app.js.
... we are also not going to be using the logo.svg file, so remove that
import too.
...#ca3c3c; border-color: #bd2130; } .btn__filter { border-color: lightgrey; } .btn__primary { color: #fff; background-color: #000; } .btn-group { display: flex; justify-content: space-between; } .btn-group > * { flex: 1 1 49%; } .btn-group > * + * { margin-left: 0.8rem; } .label-wrapper { margin: 0; flex: 0 0 100%; text-align: center; } .visually-hidden { position: absolute !
important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; } [class*="stack"] > * { margin-top: 0; margin-bottom: 0; } .stack-small > * + * { margin-top: 1.25rem; } .stack-large > * + * { margin-top: 2.5rem; } @media screen and (min-width: 550px) { .stack-small > * + * { margin-top: 1.4rem; } .stac...
Vue conditional rendering: editing existing todos - Learn web development
it's
important to note that v-else and v-else-if blocks need to be the first sibling of a v-if/v-else-if block, otherwise vue will not recognize them.
... first of all add v-if="!isediting" to the root <div> in your todoitem component, <div class="stack-small" v-if="!isediting"> next, below that <div>'s closing tag add the following line: <to-do-item-edit-form v-else :id="id" :label="label"></to-do-item-edit-form> we also need to
import and register the todoitemeditform component, so we can use it inside this template.
... add this line at the top of your <script> element:
import todoitemeditform from "./todoitemeditform"; and add a components property about the props property inside the component object: components: { todoitemeditform }, now, if you go to your app and click a todo item's "edit" button, you should see the checkbox replaced with the edit form.
Rendering a list of Vue components - Learn web development
import lodash.uniqueid into your app component in the same way you did with your todoitem component, using
import uniqueid from 'lodash.uniqueid'; next, add an id field to each element in your todoitems array, and assign each of them a value of uniqueid('todo-').
... your app.vue <script> element contents should now look like this:
import todoitem from './components/todoitem.vue';
import uniqueid from 'lodash.uniqueid' export default { name: 'app', components: { todoitem }, data() { return { todoitems: [ { id: uniqueid('todo-'), label: 'learn vue', done: false }, { id: uniqueid('todo-'), label: 'create a vue project with the cli', done: true }, { id: uniqueid('todo-'), label: 'have fun', done: true }, { id: uniqueid('todo-'), label: 'create a to-do list', done: false } ] }; } }; now, add the v-for directive and key attribute to the <li> element in your app.vue template, like so: <ul> <li v-for="item in todoitems" :key="item.id"> <to-do-item label="my todo item" :done="tr...
... you are no longer using uniqueid, so you need to remove the
import uniqueid from 'lodash.uniqueid'; line, otherwise your app will throw an error.
Strategies for carrying out testing - Learn web development
instead, you should try to make sure your site works on the most
important target browsers and devices, and then code defensively to give your site the widest support reach it can be expected to have.
...this is fairly intuitive to set up; the most
important field to get right is the website url.
...
important: you need to make sure you have the operating system image you want to install on the virtual machine available at this point, and install it right away.
Setting up your own test automation environment - Learn web development
this shows the
importance of including some kind of result reporting mechanism!
... let's update our bstack_google_test.js demo, to show how these features work: first, we'll need to
import the node request module, so we can use it to send requests to the rest api.
...this shows the
importance of including some kind of result reporting mechanism!
Command line crash course - Learn web development
have a play with them in a test directory you’ve created somewhere so that you don’t accidentally delete anything
important, using the example commands below for guidance: mkdir — this creates a new directory inside the current directory you are in, with the name you provide after the command name.
...if you are not careful, then you might end up deleting something
important, losing you a load of your work in the process.
... but more
importantly, if you look back at your javascript file you’ll find it has been reformatted to something like this: const myobj = { a: 1, b: { c: 2 }, }; function printme(obj) { console.log(obj.b.c); } printme(myobj); depending on your workflow (or the workflow that you pick) you can make this an automated part of your process.
Chrome Worker Modules
start by
importing the module loader.
... you only need to do it once for each worker, from within the chrome worker itself:
importscripts("resource://gre/modules/workers/require.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 require(), that you may now use as follows: //
import the module // (here, we
import the core of os.file) let core = require("resource://gre/modules/osfile/osfile_shared_allthreads.jsm"); // we may now use module core.
Accessibility API cross-reference
in such a case, they should be wrapped in a <reference> pragmatically however, user agents should expect to find <link> tags as direct children of <toci> abstract role - a perceivable section containing content that is relevant to a specific, author-specified purpose and sufficiently
important that users will likely want to be able to navigate to the section easily and to have it listed in a summary of the page.
...in aria, a type of live region whose content is advisory information for the user but is not
important enough to justify an alert, often but not necessarily presented as a status bar.
... n/a accessible_active_descendant_property aria-activedescendant critical info to convey immediately alert_high n/a n/a aria-live=assertive info that's
important, but does not require immediacy alert_medium n/a n/a aria-live=polite low-priority info such as a tip or hint alert_low n/a n/a n/a this object is changing or moving rapidly animated n/a n/a n/a indicates that the user input is currently directed to that object and it is "armed for se...
Accessible Toolkit Checklist
the work when implementing a new toolkit it's
important to: implement standard keyboard behavior, which can vary from platform to platform.
...for example, a unique child id would be required for each tree item supporting the most
important basic iaccessible events get_accparent: get the parent of an iaccessible.
...[
important, but no need to implement up/down/left/right] accdodefaultaction: perform the action described by get_accdefaultaction.
Testopia
important notice: if you are upgrading on a case sensitive filesystem you must remove the existing testopia folder in the extensions directory.
...the main new features are: support xml export and
import of test plans and children support csv export of test cases and results.
... bugzilla 4.x mysql 5.0 or postgresql 8.3 mozilla compatible browser ;-) additional perl modules: text::csv xml::schema validator xml::schema::parser (for
importer) and json 2.10 todo user preferences notification emails more reports see the roadmap and bug list for more details.
Debugging JavaScript
you can also start the browser console when you launch firefox, by launching firefox from the command line and passing --jsconsole as a flag: /path/to/firefox --jsconsole log to the browser console using the standard console api after
importing console.jsm: let console = (cu.
import("resource://gre/modules/console.jsm", {})).console; console.log("hello from firefox code"); error console this is obsolete and is no longer enabled in firefox by default.
... console.log in browser console you can dump variables in the browser console from addon code, by adding this line to
import the console utility: const { console } = components.utils.
import("resource://gre/modules/devtools/console.jsm", {}); this has an advantage over dump in that you can list out properties of an object logged with console.log.
... components.utils.
import("resource://gre/modules/log.jsm"); "debugger" keyword you can halt venkman or chromebug at a line using the keyword debugger.
How Mozilla's build system works
however, the most
important file in terms of architecture is config.status.
... moz.build files cannot do the following:
import modules.
... the most
important actions of moz.build files are #1 and #2 from the above list.
Creating Custom Events That Can Pass Data
mozilla/dom/base/nsdomclassinfoclasses.h the change you make here is really rather small but it is incredibly
important.
...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 quite an
important file since this holds the createevent method which acts as a factory method dom events.
...you will find that there is a bunch of code like: if (aeventtype.lowercaseequalsliteral("{somethingsomething}event")) return ns_{somethingsomething}event(adomevent, aprescontext, nsnull); you can either have a function like this or write the code straight in nseventlistenermanager::createevent() like this: if (aeventtype.lowercaseequalsliteral("nsmyevent")){ //note: the lowercase is
important!
Code Samples
components.utils.
import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("yourextensionid", function(addon) { var addonlocation = addon.getresourceuri("").queryinterface(components.interfaces.nsifileurl).file.path; }); accessing file and version information components.utils.
import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("my-addon@foo.com", function(addon) { alert("my extension's version is " + addon.version); alert("did i remember to include that file.txt file in my xpi?
..."yes!" : "no"); alert("let's pretend i did, it's available from the url " + addon.getresourceuri("file.txt").spec); }); uninstall an add-on components.utils.
import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("youraddon@youraddon.com", function(addon) { addon.uninstall(); }); disable an add-on components.utils.
import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("youraddon@youraddon.com", function(addon) { if (addon.isactive) addon.userdisabled = addon.isactive; }); listening for add-on uninstall this example sets a variable beinguninstalled that you can check when you get a profile-before-change message to do cleanup for your add-on on uninstall.
... var beinguninstalled; let listener = { onuninstalling: function(addon) { if (addon.id == "youraddon@youraddon.com") { beinguninstalled = true; } }, onoperationcancelled: function(addon) { if (addon.id == "youraddon@youraddon.com") { beinguninstalled = (addon.pendingoperations & addonmanager.pending_uninstall) != 0; } } } try { components.utils.
import("resource://gre/modules/addonmanager.jsm"); addonmanager.addaddonlistener(listener); } catch (ex) {} ...
Add-on Manager
for example: components.utils.
import("resource://gre/modules/addonmanager.jsm"); addonmanager.getalladdons(function(aaddons) { // here aaddons is an array of addon objects }); // this code will execute before the code inside the callback notifications about changes to installed add-ons are dispatched to any registered addonlisteners.
...these will pass an addoninstall instance to the callback, which can then be used to install the add-on: components.utils.
import("resource://gre/modules/addonmanager.jsm"); addonmanager.getinstallforurl("http://www.foo.com/test.xpi", function(ainstall) { // ainstall is an instance of addoninstall ainstall.install(); }, "application/x-xpinstall"); the progress of addoninstalls can be monitored using an installlistener.
... for example, to take a look at the add-ons that were disabled at startup: components.utils.
import("resource://gre/modules/addonmanager.jsm"); let addonids = addonmanager.getstartupchanges(addonmanager.startup_change_disabled); if (addonids.length > 0) { // addonids is now an array of the add-on ids that have been disabled alert("note: " + addonids.length + " add-ons have been disabled."); } open add-on manager tab the add-on manager tab can be opened programatically with the function br...
Downloads.jsm
to use it, you first need to
import the code module into your javascript scope: components.utils.
import("resource://gre/modules/downloads.jsm"); method overview promise<download> createdownload(object aproperties); promise<void> fetch(asource, atarget, [optional] object aoptions); promise<downloadlist> getlist(atype); promise<downloadsummary> getsummary(atype); constants constant description public work on downloads that were not started from a private browsing window.
... components.utils.
import("resource://gre/modules/downloads.jsm"); components.utils.
import("resource://gre/modules/osfile.jsm") components.utils.
import("resource://gre/modules/task.jsm"); task.spawn(function () { yield downloads.fetch("http://www.mozilla.org/", os.path.join(os.constants.path.tmpdir, "example-download.html")); console.log("example-download...
... components.utils.
import("resource://gre/modules/downloads.jsm"); components.utils.
import("resource://gre/modules/osfile.jsm") components.utils.
import("resource://gre/modules/task.jsm"); task.spawn(function () { let list = yield downloads.getlist(downloads.all); let view = { ondownloadadded: download => console.log("added", download), ondownloadchanged: download => console.log("changed", download), ond...
JNI.jsm
to use it, you first need to
import the code module into your javascript scope: components.utils.
import("resource://gre/modules/jni.jsm"); this module was available in firefox since version 17.
... a note about firefox for android, this jsm file is already globally
imported and is available from the privileged window scope as window.jni.
...this shows how to get the paths to the "pictures" folder: components.utils.
import("resource://gre/modules/jni.jsm"); components.utils.
import("resource://gre/modules/osfile.jsm"); // because we use os.path.join in this example var my_jenv = null; try { my_jenv = jni.getforthread(); var sig = { environment: 'landroid/os/environment;', string: 'ljava/lang/string;', file: 'ljava/io/file;' }; var environment = jni.loadclass(my_jenv, sig.en...
Sqlite.jsm
before you can use this module, you need to
import it into your scope: components.utils.
import("resource://gre/modules/sqlite.jsm") obtaining a connection sqlite.jsm exports the sqlite symbol.
... here is an example: components.utils.
import("resource://gre/modules/sqlite.jsm"); try { const conn = await sqlite.openconnection({ path: "mydatabase.sqlite", sharedmemorycache: false }); // connection is the opened sqlite connection (see below for api).
...these are arguably the most
important apis in this type.
Task.jsm
to use it, you first need to
import the code module into your javascript scope: components.utils.
import("resource://gre/modules/task.jsm"); introduction for an introduction to tasks, you may start from the task.js documentation, keeping in mind that only the core subset is implemented in this module.
... examples general example cu.
import("resource://gre/modules/task.jsm"); task.spawn(function* () { // this is our task.
... }); exception handling components.utils.
import("resource://gre/modules/osfile.jsm") components.utils.
import("resource://gre/modules/task.jsm") task.spawn(function* () { let currentdir = yield os.file.getcurrentdirectory(); let path = os.path.join(currentdir, ".mozconfig"); try { let info = yield os.file.stat(path); console.log("the .mozconfig file is " + info.size + " bytes long."); } catch (ex if ex instanceof os.file.error...
source-editor.jsm
to use it, you first need to
import the code module into your javascript scope: components.utils.
import("resource:///modules/source-editor.jsm"); warning: much of the functionality of the source editor is implemented by a secondary code module (by default, source-editor-orion.jsm).
... you must not directly
import that code module; it is essentially an implementation detail.
... remarks it's
important to note that the character at offset aend is not included in the selection.
JavaScript code modules
see export and
import to learn more about how to use standard modules.
... components.utils.
import how to
import a javascript code module.
... bookmarkhtmlutils.jsm provides utility functions for
importing and exporting bookmarks from the old-school "bookmarks.html" style bookmark files.
Index
3 bootstrapping a new locale localization, mercurial, translate, bit bucket (see also https://developer.mozilla.org/en/create_a_new_localization) 4 encodings for localization files internationalization, localization when creating a localization for mozilla products, it’s
important to be aware of the encoding of the files that you generate.
... 10 localization notes guide, 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.
... the documentation is divided into 4 parts: 35 creating localizable web applications internationalization, localizability, localization, web development an
important step of developing a web application or creating web content is making sure that it can be localized.
Power profiling overview
this article covers
important background information about power profiling, with an emphasis on intel processors used in desktop and laptop machines.
... the
important points are as follows.
...the
important thing is that c0 is always the active state, and for the idle states a higher number always means less power consumption.
McCoy
it's
important that the update information retrieved has not been tampered with since being written by the add-on author.
...however, there are several external and unofficial tools which enable signing from command line: uhura - part of the mxtools package from softlights http://www.softlights.net/projects/mxtools/uhura.html signontheline - an extension to mccoy -
important: you have to checkout rev 222, later revisions are not working in mccoy!
...it's
important to note that if you change any information in the update file then it must be signed again.
PR_VersionCheck
compares the version of nspr assumed by the caller (the
imported version) with the version being offered by the runtime (the exported version).
... syntax #include <prinit.h> prbool pr_versioncheck(const char *
importedversion); parameter pr_versioncheck has one parameter:
importedversion the version of the shared library being
imported.
... description pr_versioncheck tests whether the version of the library being
imported (
importedversion) is compatible with the running version of the shared library.
NSS 3.17.2 release notes
this fixes a regression introduced in nss 3.16.2 that prevented nss from
importing some rsa private keys (such as in pkcs #12 files) generated by other crypto libraries.
... bug 1057161: check that an
imported elliptic curve public key is valid.
...now ec public keys are validated at
import time.
NSS sources building testing
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 building.
... it is
important to mention the difference between internal nss code and exported interfaces.
... running the nss test suite this is an
important part of development work, in order to ensure your changes don't introduce regressions.
NSS tools : crlutil
-i
import a crl to the cert database -e erase all crls of specified type from the cert database -l list existing crl located in cert database file.
... -i crl-
import-file specify the file which contains the crl to
import -f password-file specify a file that will automatically supply the password to include in a certificate or to access a certificate database.
...] [-p dbprefix] [-l alg] [-a] [-b] * listing all crls or a named crl: crlutil -l [-n crl-name] [-d krydir] * deleting crl from db: crlutil -d -n nickname [-d keydir] [-p dbprefix] * erasing crls from db: crlutil -e [-d keydir] [-p dbprefix] * deleting crl from db: crlutil -d -n nickname [-d keydir] [-p dbprefix] * erasing crls from db: crlutil -e [-d keydir] [-p dbprefix] *
import crl from file: crlutil -i -i crl [-t crltype] [-u url] [-d keydir] [-p dbprefix] [-b] see also certutil(1) see also additional resources nss is maintained in conjunction with pki and security-related projects through mozilla dn fedora.
TLS Cipher Suite Discovery
*/ ssl_
import const pruint16 ssl_implementedciphers[]; /* number of entries in the above table.
... */ ssl_
import const pruint16 ssl_numimplementedciphers; of course, the raw integer numbers of the cipher suites are not likely to be known to most users, so libssl provides a function by which the application can obtain a wealth of information about any supported cipher suite, by its number.
... this function is declared in "ssl.h" as follows: ssl_
import secstatus ssl_getciphersuiteinfo( pruint16 ciphersuite, sslciphersuiteinfo *info, pruintn len); the application provides the cipher suite number for which it wants information, the address of a block of memory allocated to receive that information, and the size in bytes of that block of memory.
NSS_3.12.3_release_notes.html
bug 464406: fix signtool regressions bug 465270: uninitialised value in devutil.c::create_object() bug 465273: dead assignment in devutil.c::nssslotarray_clone() bug 465926: during
import of pkcs #12 files bug 466180: ssl_configmpserversidcache with default parameters fails on {net bug 466194: cert_decodetruststring should take a const char * input trusts string.
... bug 466736: incorrect use of nss_use_64 in lib/libpkix/pkix_pl_nss/system/pkix_pl_object.c bug 466745: random number generator fails on windows ce bug 467298: sql db code uses local cache on local file system bug 468279: softoken crash
importing email cert into newly upgraded db bug 468532: trusted ca trust flags not being honored in cert_verifycert bug 469583: coverity: uninitialized variable used in sec_pkcs5createalgorithmid bug 469944: when built with microsoft compilers bug 470351: crlutil build fails on windows because it calls undeclared isatty bug 471539: stop honoring digital signatures in certificates and crls based on weak hashes bug 471665: nss reports incorrect sizes for (aes) symmetric keys bug 471715: add cert to nssckbi to override rogue md5-collision ca ce...
... bug 474532: softoken cannot
import certs with empty subjects and non-empty nicknames bug 474777: wrong deallocation when modifying crl.
NSS tools : crlutil
-i
import a crl to the cert database -e erase all crls of specified type from the cert database -l list existing crl located in cert database file.
... -i crl-
import-file specify the file which contains the crl to
import -f password-file specify a file that will automatically supply the password to include in a certificate or to access a certificate database.
... a named crl: crlutil -l [-n crl-name] [-d krydir] * deleting crl from db: crlutil -d -n nickname [-d keydir] [-p dbprefix] * erasing crls from db: crlutil -e [-d keydir] [-p dbprefix] * deleting crl from db: crlutil -d -n nickname [-d keydir] [-p dbprefix] * erasing crls from db: crlutil -e [-d keydir] [-p dbprefix] *
import crl from file: crlutil -i -i crl [-t crltype] [-u url] [-d keydir] [-p dbprefix] [-b] see also certutil(1) see also additional resources nss is maintained in conjunction with pki and security-related projects through mozilla dn fedora.
XPCOM Stream Guide
the actual data going in to and coming out of an object isn't usually
important to a stream.
... .getoutputstream(); var instream = components.classes["@mozilla.org/io/string-input-stream;1"] .createinstance(components.interfaces.nsistringinputstream); var data = "hello world"; instream.setdata(data, data.length); while (instream.available()) { outstream.writefrom(instream, instream.available()); } note this is an inefficient example: the only
important part is how to feed the output stream.
... "nsistringinputstream", "setdata"); var inputstream = components.constructor("@mozilla.org/scriptableinputstream;1", "nsiscriptableinputstream", "init"); function buildstream(data) { return new stringstream(data, data.length); } components.utils.
import("resource://gre/modules/netutil.jsm"); function run_test() { var check = "we will rock you!"; var baseinputstream = buildstream(check); var store = components.classes["@mozilla.org/storagestream;1"] .createinstance(components.interfaces.nsistoragestream); /* in practice, your storage streams shouldn't be this small.
Components.utils.Sandbox
importing functions or objects into the sandbox you can
import functions or objects into the sandbox simply by assigning them to the sandbox object.
...}; complex objects can be cloned into the sandbox using components.utils.cloneinto: mysandbox.someobject = components.utils.cloneinto({ a: 'string', b: 21 }, mysandbox); obviously you need to consider the security implications of the functions you
import.
... this technique isn't limited to functions - it can be used to
import objects or values.
Components.utils
import() loads a js module into the current script, without sharing a scope.
...
importglobalproperties() specify a list of constructors to
import into the scope.
... unload() unloads a js module loaded with
import().
Language bindings
in this case it can be
important to be able to force a garbage collection cycle from javascript.
...to obtain the object reference, you have to call get() on the resulting object.components.utils.
importcomponents.utils.
import was introduced in firefox 3 and is used for sharing code between different scopes easily.
... for example, you can
import xpcomutils.jsm to avoid copy/pasting long xpcom component registration boilerplate in your component files.components.utils.
importglobalproperties
imports various objects into a system scope.components.utils.isxraywrapperwhen privileged javascript in gecko accesses objects belonging to less-privileged code (such as untrusted web content), it does so, by default, with "xray vision": a mechanism that filters out certain changes to the objects that could cause them to behave in unexpected ways.
Observer Notifications
bookmarks-restore-begin html-initial sent just before bookmarks are restored from html on initial
import.
... bookmarks-restore-success html-initial sent just after bookmarks are restored from html on initial
import.
... bookmarks-restore-failed html-initial sent when bookmarks could not be successfully restored from html on intial
import.
nsICRLManager
inherits from: nsisupports last changed in gecko 1.7 method overview wstring computenextautoupdatetime(in nsicrlinfo info, in unsigned long autoupdatetype, in double noofdays); void deletecrl(in unsigned long crlindex); nsiarray getcrls(); void
importcrl([array, size_is(length)] in octet data, in unsigned long length, in nsiuri uri, in unsigned long type, in boolean dosilentdownload, in wstring crlkey); void reschedulecrlautoupdate(); boolean updatecrlfromurl(in wstring url, in wstring key); constants constant value description type_autoupdate_time_based 1 type_autoupdate_freq_based 2 methods computenextautoupdatetime() wstring computenextautoupdatetime( i...
...return value
importcrl()
import a crl into the certificate database.
... void
importcrl( [array, size_is(length)] in octet data, in unsigned long length, in nsiuri uri, in unsigned long type, in boolean dosilentdownload, in wstring crlkey ); parameters data length uri type dosilentdownload crlkey reschedulecrlautoupdate() this would reschedule the autoupdate of crls with auto update enable.
nsIDOMUserDataHandler
node_
imported 2 the node was cloned into a new document.
... methods handle() this method is a callback which will be called if a node with user data is being cloned,
imported or adopted.
...dst the new node, for clone and
import operations.
nsINavHistoryService
uerystring([array, size_is(aquerycount)] in nsinavhistoryquery aqueries, in unsigned long aquerycount, in nsinavhistoryqueryoptions options); void addobserver(in nsinavhistoryobserver observer, in boolean ownsweak); void removeobserver(in nsinavhistoryobserver observer); void runinbatchmode(in nsinavhistorybatchcallback acallback, in nsisupports aclosure); void
importhistory(in nsifile file); astring getcharsetforuri(in nsiuri auri); astring setcharsetforuri(in nsiuri auri, in astring acharset); attributes attribute type description hashistoryentries boolean true if there is any history.
...
importhistory() this method
imports the given mork history file.
... void
importhistory( in nsifile file ); parameters file the mork history file to
import.
Setting HTTP request headers
in addition to the actual content, some
important information is passed with http headers for both http requests and responses.
...note that the number of parameter that the observe method takes is
important.
...the name of this object -- httprequestobserver -- isn't
important.
Using the clipboard
//
import the services module for future use, if we're not in // a browser window where it's already loaded.
... components.utils.
import('resource://gre/modules/services.jsm'); // create a constructor for the built-in supports-string class.
... if (source instanceof ci.nsidomwindow) // note: in gecko versions >16, you can
import the privatebrowsingutils.jsm module // and use privatebrowsingutils.privacycontextfromwindow(sourcewindow) instead source = source.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation); res.init(source); } return res; } here, the string "text to copy" will be copied but you can replace this with the text s...
Using popup notifications
popup notifications, also known as "doorhanger notifications", are presented to notify the user of something that's
important but may not need immediate attention.
...this code module is
imported by the browser, so you don't need to do it explicitly yourself.
... components.utils.
import('resource://gre/modules/popupnotifications.jsm'); var notify = new popupnotifications(gbrowser, document.getelementbyid("notification-popup"), document.getelementbyid("notification-popup-box")); var notification = notify.show( // browser gbrowser.selectedbrowser, // popup id "pdes-popup", // message "hi, there!, i'm gonna show you something today!!", // ...
Debugging Tips
let { ctypes } = components.utils.
import("resource://gre/modules/ctypes.jsm", {}); let i = ctypes.int32_t(10); console.log(i); let point = ctypes.structtype("point", [{ x: ctypes.int32_t }, { y: ctypes.int32_t }]) let p = point(10, 20); console.log(p); let pp = p.address(); console.log(pp); the result will be as following: cdata { value: 10 } cdata { x: 10, y: 20 } cdata { contents: cdata } to see more descriptive information, you can use .tosource().
... let { ctypes } = components.utils.
import("resource://gre/modules/ctypes.jsm", {}); let i = ctypes.int32_t(10); console.log(i.tosource()); let point = ctypes.structtype("point", [{ x: ctypes.int32_t }, { y: ctypes.int32_t }]) let p = point(10, 20); console.log(p.tosource()); let pp = p.address(); console.log(pp.tosource()); the result will be : ctypes.int32_t(10) point(10, 20) point.ptr(ctypes.uint64("0x15fdafb08")) to see the complete type information, you can use .constructor.tosource(), to print the source of ctype.
... let { ctypes } = components.utils.
import("resource://gre/modules/ctypes.jsm", {}); let i = ctypes.int32_t(10); console.log(i.constructor.tosource()); let point = ctypes.structtype("point", [{ x: ctypes.int32_t }, { y: ctypes.int32_t }]) let p = point(10, 20); console.log(p.constructor.tosource()); let pp = p.address(); console.log(pp.constructor.tosource()); the result will be as per the following: ctypes.int32_t ctypes.structtype("point", [{ "x": ctypes.int32_t }, { "y": ctypes.int32_t }]) ctypes.structtype("point", [{ "x": ctypes.int32_t }, { "y": ctypes.int32_t }]).ptr ...
Browser Console - Firefox Developer Tools
components.utils.
import("resource://gre/modules/console.jsm"); console.log("hello from firefox code"); //output messages to the console learn more: console api reference console.jsm source code in the mozilla dxr hudservice there is also the hudservice which allows access to the browse console.
... 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.require("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.require("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.
Style Editor - Firefox Developer Tools
the style editor enables you to: view and edit all the stylesheets associated with a page create new stylesheets from scratch and apply them to the page
import existing stylesheets and apply them to the page to open the style editor choose the "style editor" option from the "web developer" menu (which is a submenu in the "tools" menu on the mac).
... the media sidebar works especially well with responsive design view for creating and debugging responsive layouts: from firefox 46 onwards, if an @media rule contains a screen size in a condition, then it is made clickable: clicking it then resizes the screen to that size using the responsive design view: creating and
importing style sheets you can create a new style sheet by clicking the new button in the toolbar.
... you can load a style sheet from disk and apply it to the page by clicking the
import button.
CSSRule - Web APIs
"h1,h2 { font-size: 16pt }" or "@
import 'url'".
...the relationships between these constants and the interfaces are: type value rule-specific interface comments and examples cssrule.style_rule 1 cssstylerule the most common kind of rule: selector { prop1: val1; prop2: val2; } cssrule.
import_rule 3 css
importrule an @
import rule.
... (until the documentation is completed, see the interface definition in the mozilla source code: nsidomcss
importrule.) cssrule.media_rule 4 cssmediarule cssrule.font_face_rule 5 cssfontfacerule cssrule.page_rule 6 csspagerule cssrule.keyframes_rule 7 csskeyframesrule cssrule.keyframe_rule 8 csskeyframerule reserved for future use 9 should be used to define color profiles in the future cssrule.namespace_rule 10 cssnamespacerule cssrule.counter_style_rule 11 csscounterstylerule cssrule.supports_rule 12 csssupportsrule cssrule.document_rule 13 cssdocumentrule cssrule.font_feature_values_rule ...
CSSStyleDeclaration.setProperty() - Web APIs
note: value must not contain "!
important" -- that should be set using the priority parameter.
... priority optional is a domstring allowing the "
important" css priority to be set.
...the following values are accepted: string value "
important" keyword undefined string empty value "" return value undefined exceptions domexception (nomodificationallowederror): if the property or declaration block is read only.
In depth: Microtasks and the JavaScript runtime environment - Web APIs
javascript execution contexts note: the details here are generally not
important to most javascript programmers.
... the event loop, then, drives everything that happens in the browser as it pertains to the interaction with the user, but more
importantly for our purposes here, it is responsible for the scheduling and execution of every piece of code that runs within its thread.
... the difference between the task queue and the microtask queue is simple but very
important: when executing tasks from the task queue, the runtime executes each task that is in the queue at the moment a new iteration of the event loop begins.
Using IndexedDB - Web APIs
important: the version number is an unsigned long long number, which means that it can be a very big integer.
...even though the parameter object is optional, it is very
important, because it lets you define
important optional properties and refine the type of object store you want to create.
... // thus the count text below will be displayed before the actual pub list // (not that it is algorithmically
important in this case).
Capabilities, constraints, and settings - Web APIs
the most
important thing to understand is that most constraints aren't requirements; instead, they're requests.
... retrieving current constraints and settings it's
important to remember the difference between constraints and settings.
... let videodefaultconstraintstring = '{\n "width": 320,\n "height": 240,\n "framerate": 30\n}'; let audiodefaultconstraintstring = '{\n "samplesize": 16,\n "channelcount": 2,\n "echocancellation": false\n}'; these defaults ask for a pretty common camera configuration, but don't insist on any property being of special
importance.
SubtleCrypto.deriveBits() - Web APIs
essentially derivekey() is composed of derivebits() followed by
importkey().
...otherwise it will be the initial key material for the derivation function: for example, for pbkdf2 it might be a password,
imported as a cryptokey using subtlecrypto.
importkey().
...*/ function getkeymaterial() { const password = window.prompt("enter your password"); const enc = new textencoder(); return window.crypto.subtle.
importkey( "raw", enc.encode(password), {name: "pbkdf2"}, false, ["derivebits", "derivekey"] ); } /* derive some bits from a password supplied by the user.
Writing WebSocket servers - Web APIs
the sec-websocket-accept header is
important in that the server must derive it from the sec-websocket-key that the client sent to it.
...this is
important because security issues might arise if the server accepts a websockets connection but interprets the data as a http request.
...that's why the payload length is
important to know.
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
the first and most
important thing to understand when considering the code to manage point-of-view and cameras in your application is this: webxr does not have cameras.
...
importantly, the effect of perspective on a vector can be represented by adding a fourth component to the vector: the perspective component, called w.
...tilting is good for capturing the scope of a tall object or scene, such as a forest or a mountain, but is also a popular way to introduce a character or locale of
importance or which inspires awe.
Movement, orientation, and motion: A WebXR example - Web APIs
this example also
imports the webxr polyfill maintained by the immersive web working group, which is the team responsible for the webxr api's specification.
... by
importing this polyfill, we allow the example to work on many browsers that don't yet have webxr implementations in place, and we smooth out any transient deviations from the specification that occur during these still somewhat experimental days of the webxr specification.
... displaying a matrix for instructive purposes, this example displays the contents of the
important matrices used while rendering the scene.
Web Authentication API - Web APIs
in order to understand how the create() and get() methods fit into the bigger picture, it is
important to understand that they sit between two components that are outside the browser: server - the web authentication api is intended to register new credentials on a server (also referred to as a service or a relying party) and later use those same credentials on that same server to authenticate a user.
...one of the most
important parameters is the origin, which is recorded as part of the clientdata so that the origin can be verified by the server later.
...one of the most
important parameters is the origin, which recorded as part of the clientdata so that the origin can be verified by the server later.
WorkerGlobalScope - Web APIs
standard methods workerglobalscope.
importscripts()
imports one or more scripts into the worker's scope.
...for example:
importscripts('foo.js', 'bar.js'); non-standard methods workerglobalscope.dump() allows you to write a message to stdout — i.e.
...for example, you could
import another script into the worker and print out the contents of the worker scope's navigator object using the following two lines:
importscripts('foo.js'); console.log(navigator); since the global scope of the worker script is effectively the global scope of the worker you are running (dedicatedworkerglobalscope or whatever) and all worker global scopes inherit methods, properties, etc.
Web APIs
nt documentfragment documentorshadowroot documenttimeline documenttouch documenttype doublerange dragevent dynamicscompressornode e 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 eckeygenparams eckey
importparams ecdhkeyderiveparams ecdsaparams effecttiming element elementcssinlinestyle elementtraversal errorevent event eventlistener eventsource eventtarget extendableevent extendablemessageevent f featurepolicy federatedcredential fetchevent file fileentrysync fileerror fileexception filelist filereader filereadersync filerequest filesystem filesystemdirectoryentry filesystemd...
...hadowelement htmlslotelement htmlsourceelement htmlspanelement htmlstyleelement htmltablecaptionelement htmltablecellelement htmltablecolelement htmltableelement htmltablerowelement htmltablesectionelement htmltemplateelement htmltextareaelement htmltimeelement htmltitleelement htmltrackelement htmlulistelement htmlunknownelement htmlvideoelement hashchangeevent headers history hkdfparams hmac
importparams hmackeygenparams i idbcursor idbcursorsync idbcursorwithvalue idbdatabase idbdatabaseexception idbdatabasesync idbenvironment idbenvironmentsync idbfactory idbfactorysync idbindex idbindexsync idbkeyrange idblocaleawarekeyrange idbmutablefile idbobjectstore idbobjectstoresync idbopendbrequest idbrequest idbtransaction idbtransactionsync idbversionchangeevent...
...ype rtctrackevent rtctrackeventinit radionodelist range readablebytestreamcontroller readablestream readablestreambyobreader readablestreambyobrequest readablestreamdefaultcontroller readablestreamdefaultreader relativeorientationsensor renderingcontext report reportingobserver reportingobserveroptions request requestdestination resizeobserver resizeobserverentry response rsahashed
importparams rsahashedkeygenparams rsaoaepparams rsapssparams s svgaelement svgaltglyphdefelement svgaltglyphelement svgaltglyphitemelement svgangle svganimatecolorelement svganimateelement svganimatemotionelement svganimatetransformelement svganimatedangle svganimatedboolean svganimatedenumeration svganimatedinteger svganimatedlength svganimatedlengthlist svganimatednumber svganimatednumberlis...
ARIA Test Cases - Accessibility
however, if the screen reader does not at least indicate that the description exists, users are likely to miss
important information.
... - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoomtext - - - - orca - - - - listbox and option dojo nightly build single select listbox using aria-activedescendant listbox in an iframe -- this is an
important case as it's an example of how a mashup widget can be built (the widget source simply comes from another url, and is tied in using an iframe) yui "carousel" listbox -- a more advanced test case expected at behavior: (mz) screen reader should announce the label and role of the listbox when it gains focus.
...however, if the screen reader does not at least indicate that the description exists, users are likely to miss
important information.
ARIA - Accessibility
it is also
important to acknowledge that some people who rely on assistive technology are reluctant to upgrade their software, for fear of losing the ability to interact with their computer and browser.
... because of this, it is
important to use semantic html elements whenever possible, as semantic html has far better support for assistive technology.
... it is also
important to test your authored aria with actual assistive technology.
Accessibility documentation index - Accessibility
10 basic form hints aria, accessibility, forms when implementing forms using traditional html form-related elements, it is
important to provide labels for controls, and explicitly associate a label with its control.
... 15 using the alert role aria, accessibility, advanced, css, example, html, needscontent, alert, alert role, alertrole, alerts, assitive technology, role configuration, wcag1.2.1, wcag3.3.1 the alert role is used to communicate an
important and usually time-sensitive message to the user.
... 104 web accessibility: understanding colors and luminance accessibility, photosensitve epilepsy analysis tool, color, epilepsy, photosensitivity, reflex epilepsy, saturation, seizure disorders, seizures understaning color, luminance, and saturation is
important in meeting wcag 2 accessibility guidelines 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.
Accessibility Information for Web Authors - Accessibility
web content accessibility guidelines (wcag) 1.0 another
important set of guidelines from the w3c web accessibility initiative (wai).
...(...) contrast is extremely
important in web design." wheel of color: pump up the contrast, robert hess, msdn "for this year's list of worst design mistakes, (...) i asked readers of my newsletter to nominate the usability problems they found the most irritating.
...effective color contrast and effective color brightness difference have a decisive
importance for reading, furthermore for people with partial color deficiency (see the excellent examples in effective color contrast by lighthouse international).
Color picker tool - CSS: Cascading Style Sheets
rder-box; box-sizing: border-box; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } /** * resize handle */ .resize-handle { width: 10px; height: 10px; background: url('https://mdn.mozillademos.org/files/6083/resize.png') center center no-repeat; position: absolute; bottom: 0; right: 0; } [data-resize='both']:hover { cursor: nw-resize !
important; } [data-resize='width']:hover { cursor: w-resize !
important; } [data-resize='height']:hover { cursor: n-resize !
important; } [data-hidden='true'] { display: none; } [data-collapsed='true'] { height: 0 !
important; } .block { display: table; } /** * container */ #container { width: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; d...
...ground-position: left 35px top 60%; text-align: right; border: 3px dashed rgb(221, 221, 221); border-radius: 15px; position: absolute; top: 50px; left: 20%; } #canvas[data-tutorial='drop']:after { content: "adjust, change or modify"; width: 40%; font-size: 24px; position: absolute; top: 130px; left: 32%; z-index: 2; } #canvas [data-tutorial='dblclick'] { background-color: #999 !
important; } #canvas [data-tutorial='dblclick']:before { content: "double click to activate"; width: 80px; color: #fff; position: absolute; top: 10%; left: 20%; z-index: 2; } #canvas .sample { width: 100px; height: 100px; min-width: 20px; min-height: 20px; position: absolute; border: 1px solid rgba(255, 255, 255, 0.3); } #canvas .sample:hover { cursor: move; } #canvas .sample[data-acti...
...ve='true']:after { content: ""; position: absolute; background: url('https://mdn.mozillademos.org/files/6065/arrow.png') center no-repeat; width: 100%; height: 12px; top: -12px; z-index: 2; } #canvas .sample:hover > * { cursor: pointer; display: block !
important; } #canvas .sample .resize-handle { display: none; } #canvas .sample .pick { width: 10px; height: 10px; margin: 5px; background: url('https://mdn.mozillademos.org/files/6079/pick.png') center no-repeat; position: absolute; top: 0; left: 0; display: none; } #canvas .sample .delete { width: 10px; height: 10px; margin: 5px; background: url('https://mdn.mozillademos.org/files/6069/close.png') center no-repeat; position: absolute; top: 0; right: 0; display: none; } /** * canvas controls */ #canvas .toggle-bg...
<input type="email"> - HTML: Hypertext Markup Language
it's
important, however, to note that this is not enough to ensure that the specified text is an e-mail address which actually exists, corresponds to the user of the site, or is acceptable in any other way.
...this can be especially
important if the page design doesn't offer descriptive labels for each <input>.
...
important: html form validation is not a substitute for scripts that ensure that the entered data is in the proper format.
<input type="number"> - HTML: Hypertext Markup Language
important: bear in mind that, logically, you should not be able to enter characters inside a number input other than numbers.
...this can be especially
important if the page design doesn't offer descriptive labels for each <input>.
...(read, for example, the section on <input type="date"> validation.)
important: html form validation is not a substitute for server-side scripts that ensure that the entered data is in the proper format!
<input type="url"> - HTML: Hypertext Markup Language
it's
important, however, to note that this is not enough to ensure that the specified text is a url which actually exists, corresponds to the user of the site, or is acceptable in any other way.
...this can be especially
important if the page design doesn't offer descriptive labels for each <input>.
...
important: html form validation is not a substitute for scripts that ensure that the entered data is in the proper format.
Browser detection using the user agent - HTTP
most
importantly, it assumed no other browsers would support the feature.
... also try to move less relevant/
important information down to the bottom and group the page's content together meaningfully.
...it is therefore
important to pay attention not to trigger false-positives when detecting the rendering engine.
HTTP caching - HTTP
on the other side, it has to be configured properly as not all resources stay identical forever: it is
important to cache a resource only until it changes, not longer.
... cache-control: private cache-control: public expiration the most
important directive here is "max-age=<seconds>" which is the maximum amount of time a resource will be considered fresh.
...this is very
important when web sites have css stylesheets or js scripts that have mutual dependencies, i.e., they depend on each other because they refer to the same html elements.
Connection management in HTTP/1.x - HTTP
it's
important point to note that connection management in http applies to the connection between two consecutive nodes, which is hop-by-hop and not end-to-end.
...without knowing these,
important messages may be delayed behind un
important ones.
... the notion of
important even evolves during page layout!
Date - JavaScript
note: it's
important to keep in mind that while the time value at the heart of a date object is utc, the basic methods to fetch the date and time or its components all work in the local (i.e.
... get the number of seconds since the ecmascript epoch let seconds = math.floor(date.now() / 1000) in this case, it's
important to return only an integer—so a simple division won't do.
... it's also
important to only return actually elapsed seconds.
WebAssembly.Table() constructor - JavaScript
var tbl = new webassembly.table({initial:2, element:"anyfunc"}); console.log(tbl.length); // "2" console.log(tbl.get(0)); // "null" console.log(tbl.get(1)); // "null" we then create an
import object that contains the table: var
importobj = { js: { tbl:tbl } }; finally, we load and instantiate a wasm module (table2.wasm) using the webassembly.instantiatestreaming() method.
... the table2.wasm module contains two functions (one that returns 42 and another that returns 83) and stores both into elements 0 and 1 of the
imported table (see text representation).
... webassembly.instantiatestreaming(fetch('table2.wasm'),
importobject) .then(function(obj) { console.log(tbl.length); console.log(tbl.get(0)()); console.log(tbl.get(1)()); }); note how you've got to include a second function invocation operator at the end of the accessor to actually invoke the referenced function and log the value stored inside it (e.g.
WebAssembly.Table - JavaScript
var tbl = new webassembly.table({initial:2, element:"anyfunc"}); console.log(tbl.length); // "2" console.log(tbl.get(0)); // "null" console.log(tbl.get(1)); // "null" we then create an
import object that contains the table: var
importobj = { js: { tbl:tbl } }; finally, we load and instantiate a wasm module (table2.wasm) using the webassembly.instantiatestreaming() method.
... the table2.wasm module contains two functions (one that returns 42 and another that returns 83) and stores both into elements 0 and 1 of the
imported table (see text representation).
... webassembly.instantiatestreaming(fetch('table2.wasm'),
importobject) .then(function(obj) { console.log(tbl.length); console.log(tbl.get(0)()); console.log(tbl.get(1)()); }); note how you've got to include a second function invocation operator at the end of the accessor to actually invoke the referenced function and log the value stored inside it (e.g.
Statements and declarations - JavaScript
export used to export functions to make them available for
imports in external modules, and other scripts.
...
import used to
import functions exported from an external module, another script.
...
import.meta an object exposing context-specific metadata to a javascript module.
Web audio codec guide - Web media technologies
lossy codecs, on the other hand, take advantage of the fact that the human ear is not a perfect interpreter of audio, and of the fact that the human brain can pluck the
important information out of imperfect or noisy audio.
... usually the latency is not particularly
important when streaming music.
...this can be particularly
important for classical music, theatrical soundtracks, and for background music during gameplay.
Codecs used by WebRTC - Web media technologies
while compression is always a necessity when dealing with media on the web, it's of additional
importance when videoconferencing in order to ensure that the participants are able to communicate without lag or interruptions.
... of secondary
importance is the need to keep the video and audio synchronized, so that the movements and any ancillary information (such as slides or a projection) are presented at the same time as the audio that corresponds.
...of special
importance in these objects: the payloadtype property, which is a one-byte value which uniquely identifies the described configuration.
Critical rendering path - Web Performance
understanding and optimizing the critical rendering path is
important to ensure reflows and repaints can happen at 60 frames per second, to ensure performant user interactions and avoid jank.
...some requests are blocking, which means the parsing of the rest of the html is halted until the
imported asset is handled.
...while painting is a very fast process, and therefore likely not the most impactful place to focus on in improving performance, it is
important to remember to allow for both layout and re-paint times when measuring how long an animation frame may take.
Optimizing startup performance - Web Performance
instead, we're going to look at a more
important issue when building web apps: starting up as asynchronously as possible.
... why is it
important to be asynchronous?
...the most
important thing to do to try to help with the main code's startup process is to refactor the code into small pieces that can be done in chunks interspersed across multiple calls to your app's main loop, so that the main thread gets to handle input and the like.
Progressive web app structure - Progressive web apps (PWAs)
being linkable, progressive and responsive by design it's
important to remember the pwa advantages and keep them in mind when designing the application.
...there are so many varied devices with browsers — it's
important to prepare your website so it works on different screen sizes, viewports or pixel densities, using technologies like viewport meta tag, css media queries, flexbox, and css grid.
... var notifbody = 'created by '+games[randomitem].author+'.'; var notifimg = 'data/img/'+games[randomitem].slug+'.jpg'; var options = { body: notifbody, icon: notifimg } var notif = new notification(notiftitle, options); settimeout(randomnotification, 30000); } the service worker the last file we will quickly look at is the service worker: sw.js — it first
imports data from the games.js file: self.
importscripts('data/games.js'); next, it creates a list of all the files to be cached, both from the app shell and the content: var cachename = 'js13kpwa-v1'; var appshellfiles = [ '/pwa-examples/js13kpwa/', '/pwa-examples/js13kpwa/index.html', '/pwa-examples/js13kpwa/app.js', '/pwa-examples/js13kpwa/style.css', '/pwa-examples/js13kpwa/fonts/graduat...
Structural overview of progressive web apps - Progressive web apps (PWAs)
being linkable, progressive, and responsive by design it's
important to remember the pwa advantages and keep them in mind when designing the application.
...there are so many varied devices with browsers — it's
important to prepare your website so it works on different screen sizes, viewports or pixel densities, using technologies like the viewport meta tag, css media queries, flexbox, and css grid.
...this script begins by
importing data from the file games.js in the data directory: self.
importscripts("data/games.js"); then it creates a list of all the files that the service worker needs to cache.
Namespaces crash course - SVG: Scalable Vector Graphics
it is
important to understand the concept of namespaces and how they are used if you plan to author svg content.
... note that namespace names are just strings, so the fact that the svg namespace name also looks like a uri isn't
important.
...when scripting svg, it is
important to use the namespace aware methods.
Tutorials
html tutorials introductory level introduction to html this module sets the stage, getting you used to
important concepts and syntax, looking at applying html to text, how to create hyperlinks, and how to use html to structure a webpage.
... advanced level html forms forms are a very
important part of the web — these provide much of the functionality you need for interacting with websites, e.g.
...the object-oriented nature of javascript is
important to understand if you want to go further with your knowledge of the language and write more efficient code, therefore we've provided this module to help you.
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
the structure of an xml document is designed to reflect and clarify
important relationships among the individual aspects of the content itself, unhindered by a need to provide any indication about how this data should eventually be presented.
... this intelligent structuring is particularly
important as more and more data transfers are automated and take place between highly heterogeneous machines linked by a network.
... xslt/xpath reference elements xsl:apply-
imports (supported) xsl:apply-templates (supported) xsl:attribute (supported) xsl:attribute-set (supported) xsl:call-template (supported) xsl:choose (supported) xsl:comment (supported) xsl:copy (supported) xsl:copy-of (supported) xsl:decimal-format (supported) xsl:element (supported) xsl:fallback (not supported) xsl:for-each (supported) xsl:if (supported) xsl:
import (mostly supported) xsl...
2015 MDN Fellowship Program - Archive of obsolete content
specific projects (we encourage you to target one of these in your application): testthewebforward brief project description mozilla participates in an
important w3c open testing initiative, testthewebforward.com.
...finding and addressing performance bottlenecks depends on tooling the browser networking and rendering but also, often more
important, user perception.
Creating annotations - Archive of obsolete content
at the top of the file
import the page-mod module and declare an array for the workers: var pagemod = require('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() {...
...first,
import the panel module: var panels = require('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...
Storing annotations - Archive of obsolete content
first,
import the simple-storage module with a declaration like: var simplestorage = require('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.
...add the following to your add-on's main function: simplestorage.on("overquota", function () { notifications.notify({ title: 'storage space exceeded', text: 'removing recent annotations'}); while (simplestorage.quotausage > 1) simplestorage.storage.annotations.pop(); }); because we use a notification to alert the user, we need to
import the notifications module: var notifications = require("sdk/notifications"); (it should be obvious that this is an incredibly unhelpful way to deal with the problem.
Creating Event Targets - Archive of obsolete content
it duplicates the previous code, but with a few changes:
import emit(), on(), once(), and off() from event/core replace listener functions with calls to emit(), passing the appropriate event type export its own event api.
...however: we're now
importing from four modules: event/core gives us emit(): note that we don't need on, once, or off, since we will use eventtarget for adding and removing listeners event/target gives us eventtarget, which implements the interface for adding and removing listeners core/heritage gives us class(), which we can use to inherit from eventtarget util/object gives us merge(), which just simplifies...
Creating Reusable Modules - Archive of obsolete content
you then
import and use these modules from other parts of your add-on using the require() statement, in exactly that same way that you
import core sdk modules like page-mod or panel.
... var s = array.from(hash, (c, i) => tohexstring(hash.charcodeat(i))).join(""); return s; } exports.hashfile = md5file; index.js finally, update index.js to
import these two new modules and use them: var filepicker = require("./filepicker.js"); var md5 = require("./md5.js"); require("sdk/ui/button/action").actionbutton({ id: "show-panel", label: "show panel", icon: { "16": "./icon-16.png" }, onclick: function() { console.log(md5.hashfile(filepicker.promptforfile())); } }); distributing modules with jpm, we use npm as the package mana...
Localization - Archive of obsolete content
import the l10n module, and assign its get function to "_" (underscore).
... primarily, this is
important because different languages have different rules for word order.
Customizing the download progress bar - Archive of obsolete content
the myextension.css file will look something like this: richlistitem progressmeter { %ifdef xp_win min-height: 17px !
important; %else %ifdef xp_macosx -moz-appearance: none !
important; background-image: url(chrome://myextension/skin/progress_bg_osx.png) !
important; %endif %endif } richlistitem .progress-bar { %ifdef xp_win -moz-appearance: none !
important; background-image: url(chrome://myextension/skin/progress_fd_win.png) !
important; %else %ifdef xp_macosx background-image: url(chrome://mye...
...xtension/skin/progress_fd_osx.gif) !
important; %endif %endif } note: this file only supports windows and mac, but it would be straightforward to add support for linux.
Custom about: URLs - Archive of obsolete content
it is
imported to queryinterface the components.manager otherwise this will not work.
... const {classes: cc, interfaces: ci, manager: cm, results: cr, utils: cu, constructor: cc} = components; cm.queryinterface(ci.nsicomponentregistrar); components.utils.
import("resource://gre/modules/services.jsm"); // globals const aboutpage_description = 'this is my custom about page'; const aboutpage_id = 'aa132730-2278-11e5-867f-0800200c9a66'; // make sure you generate a unique id from https://www.famkruithof.net/uuid/uuidgen const aboutpage_word = 'myaboutpage' const aboutpage_uri = 'data:text/html,hi this is the page that is shown when navigate to about:myaboutp...
Displaying web content in an extension without security issues - Archive of obsolete content
here it is most
important to disable javascript and plugins.
...="description"></div> </div> now to insert a new entry in the document you would do the following: var template = doc.getelementbyid("entrytemplate"); var entry = template.clonenode(true); entry.removeattribute("id"); entry.getelementsbyclassname("title")[0].textcontent = title; entry.getelementsbyclassname("description")[0].textcontent = description; template.parentnode.appendchild(entry); the
important difference here is that the result will always have the same structure as the template tag.
Extension Versioning, Update and Compatibility - Archive of obsolete content
it is
important to get the initial rdf:description's about attribute correct.
... the information page retrieved must currently be totally valid xhtml, including being delivered with the mime type application/xhtml+xml (
important: see problems section) you may include %app_locale% in your updateinfourl if you want to have locale information included in the url -- this allows you to customize the text based on the user's locale.
Custom XUL Elements with XBL - Archive of obsolete content
here are a couple of
important things to notice: the "xul:" namespace must be used for all xul tags you have in your content.
... one
important thing to take into account is that you shouldn't use the id attribute in any content nodes.
Handling Preferences - Archive of obsolete content
adding preferences to an extension extensions can read and write firefox preferences and, most
importantly, create and manage their own.
...get count() { return this._prefservice.getintpref("extensions.xulschoolhello.message.count"); }, increment : function() { let currentcount = this._prefservice.getintpref("extensions.xulschoolhello.message.count"); this._prefservice.setintpref("extensions.xulschoolhello.message.count", currentcount + 1); } one
important thing to keep in mind is that the "get" methods of the service can throw an exception if the preference is not found.
The Box Model - Archive of obsolete content
it is
important to know how it works in order to make interfaces that are easy to localize, skin and use in different types of operating systems, screen sizes and resolutions.
...so, in a flexed hbox, having center alignment and end packing results in this: one
important thing to notice is that aligment and flexibility can't be mixed in some cases.
User Notifications and Alerts - Archive of obsolete content
« previousnext » it is often the case that extensions need to notify users about
important events, often requiring some response.
... the bottom right corner of the browser is the recommended location for an alert, because it normally doesn't block the part of the content where the user is reading, or the most
important parts of page content, such as menus and titles.
XPCOM Objects - Archive of obsolete content
it is particularly
important to note that, for every member in the component, you'll see in what interface this member is defined.
... at mdc, you'll see stuff like this: void setcharpref(in string aprefname, in string avalue); one of the most
important details to notice is that both paratemers have the in keyword.
Case Sensitivity in class and id Names - Archive of obsolete content
it is also
important to avoid using class or id names which are a case-insensitive match within the same document.
... recommendation because of the flaws which are present in some existing implementations and the restrictions defined in html 4.01, it is doubly
important to ensure that your class and id names are of a consistent case throughout a document, and that you do not attempt to define names which are case-insensitive matches.
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
$ rm -rf ~/.thunderbird start it $ thunderbird if thunderbird ask you to
import your profile from netscape/mozilla/tb depending on you mail client history, don't
import anything, here we want to check the autoconfig job alone!
...pref("mcd.logging.console", "all"); pref("mcd.logging.dump", "all"); components.utils.
import("resource:///modules/gloda/log4moz.js"); var log = log4moz.getconfiguredlogger("mcd"); // enable alerts.
Source Navigator - Archive of obsolete content
one can check whether the installation is complete by executing: $ which snavigator /usr/bin/snavigator
importing the source execute the following: snavigator.
...this shows the "auto-create project" dialog: which allows you to decide your filename of the project file (which ends in .proj) and your source directory/directories that you want to
import into the project.
Clipboard Test - Archive of obsolete content
this api currently lives in the future and must be
imported for use.
... jetpack.future.
import("clipboard"); methods additional information can be found at clipboard api proposal ...
Menu - Archive of obsolete content
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 built-in firefox menus and menus that features create.
...examples before running any examples,
import the api from the future: jetpack.future.
import("menu"); snippets add a single, static menuitem to the jetpack menu that doesn't do anything: jetpack.menu.add("two drink holders and a captain's chair"); add a menuitem to the jetpack menu that displays the current date and time each time it's opened: jetpack.menu.add(function () new date().tostring()); click an item in the jetpack menu to be not...
How to Write and Land Nanojit Patches - Archive of obsolete content
it will also generate a commit that updates the nanojit-
import-rev file in your target repository; this file records which commits have been copied over from nanojit.
...you can explicitly manipulate the revision from which the copying process begins by writing a nanojit-central revision id to the file nanojit-
import-rev, held in your target repository.
Space Manager Detailed Design - Archive of obsolete content
overview the space manager and related classes and structures are an
important of the gecko layout system, specifically block layout.
...there are three
important parts to the space manager api: the parts that deal with the coordinate space of the space manager, the parts that deal with the regions managed by the space manager, and the parts that manage float impact intervals.
Actionscript Acceptance Tests - Archive of obsolete content
when the harness compiles the inheritclass.as test, the files in inheritclass will be included: java -jar asc.jar -
import builtin.abc -in shell.as -in inheritclass/a.as -in inheritclass/b.as inheritclass.as additional files required by a test: if a test requires additional files to run, but are not to be included when compiling, a testname_support directory can be created.
... if you do not wish to have shell.as included when compiling, you must create a dir.asc_args file with an override parameter: # the following line will override all compile arguments and just compile a .as file with -
import builtin.abc override| ...
Cmdline tests - Archive of obsolete content
two use cases for the cmdline testsuite: use case 1: test the interactive cmdline debugger test contents: start avmshell -d test.abc, set breakpoint on a line, show local variable value, quit 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\nquit\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 contain...
...s 'gross stats', 'sweep m reclaimed n pages.' from cmdutils
import * def run(): r=runtestlib() r.run_test(name='memstats', command="%s -memstats testdata/memstats.abc" % r.avm, expectedout=[ 'gross stats', 'managed fragmentation', 'gross stats end', 'sweep\\([0-9]+\\) reclaimed [0-9]+ whole pages' ] ...
Learn XPI Installer Scripting by Example - Archive of obsolete content
this installer script is relatively short, but it exercises most of the
important features of the xpinstall api, and it can easily be used as a template for other more general software installations.
... installation logging logging is an
important feature of the xpinstall api that can help you streamline and debug your installations.
Accessing Files - Archive of obsolete content
file and stream guide: [ 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 guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...it is
important to note that this file does not have to exist for a file reference to be valid.
Reading from Files - Archive of obsolete content
file and stream guide: [ 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 guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...it is
important to note that the newline characters themselves are not included in the returned string.
Moving, Copying and Deleting Files - Archive of obsolete content
file and stream guide: [ 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 guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
... var file = io.newfile("home", "
importantdata"); var destination = io.newfile("desktop", ""); destination.append("backups"); file.copyto(destination, ""); this example copies an item called '
importantdata' into a directory called 'backups' within the desktop directory.
How to implement a custom XUL query processor component - Archive of obsolete content
the querytype is
important.
... here is our sample javascript xpcom query processor: components.utils.
import("resource://gre/modules/xpcomutils.jsm"); // basic wrapper for nsixultemplateresult function templateresult(adata) { this._data = adata; // just make a random number for the id this._id = math.random(100000).tostring(); } templateresult.prototype = { queryinterface: xpcomutils.generateqi([components.interfaces.nsixultemplateresult]), // private storage _data: null, // right now our results are flat lists, so no containing/recursion take place iscontainer: false, isempty...
Manifest Files - Archive of obsolete content
note: starting in gecko 2.0, only the file named chrome.manifest is read automatically; if you need to read multiple manifest files, use the manifest command in that file to
import additional manifests.
... use manifest flags to configure the scenarios in which the secondary manifest is
imported.
Numeric Controls - Archive of obsolete content
a numeric textbox would normally be used when the value was
important to the user, for instance, a field to enter a number of days, or the maximum size of a file.
... a scale would be used when the actual value isn't
important, just that sliding the scale decreases or increases a state.
Debugging a XULRunner Application - Archive of obsolete content
add the following code to your xul app: components.utils.
import('resource://gre/modules/devtools/dbg-server.jsm'); if (!debuggerserver.initialized) { debuggerserver.init(); // don't specify a window type parameter below if "navigator:browser" // is suitable for your app.
... debuggerserver.addbrowseractors("myxulrunnerappwindowtype"); } debuggerserver.openlistener(6000); for xulrunner version 37+ the code to enable the debugger has changed: components.utils.
import('resource://gre/modules/devtools/dbg-server.jsm'); if (!debuggerserver.initialized) { debuggerserver.init(); debuggerserver.addbrowseractors(); debuggerserver.allowchromeprocess = true; } let dbglistener=debuggerserver.createlistener(); dbglistener.portorpath=6000; dbglistener.open(); add the following to your prefs.js: (in recent ffox, edit about:config instead) pref("devtools.debugger.remote-enabled", true); in firefox, go to tools > web developer > connect...
Mozprofile - Archive of obsolete content
api usage to use mozprofile as an api you can
import mozprofile.profile and/or the addonmanager.
...example: from mozprofile
import firefoxprofile # create new profile to pass to mozmill/mozrunner profile = firefoxprofile(addons=["adblock.xpi"]) setting preferences preferences can be set in several ways: using the api: you can pass preferences in to the profile class's constructor: obj = firefoxprofile(preferences=[("accessibility.typeaheadfind.flashbar", 0)]) using a json blob file: mozprofile --preferences myprefs.json using a .ini file: mozprofile --preferences myprefs.ini via the command line: mozprofile --pref key:value --pref key:val...
Gecko Compatibility Handbook - Archive of obsolete content
aol or compuserve problems even if your site works on netscape 7.x, it is
important to test your site in aol for macos and compuserve 7 to check for browser detection and network issues.
...this is of particular
importance since the early implementations of css found in internet explorer 4 and netscape navigator 4 had many bugs.
2006-10-26 - Archive of obsolete content
discussions should be easier to
import bookmark backups user asking for thoughts about having bookmarks manager's
import wizard
import from backups in the bookmarkbackups folder.
... bug in firefox when
import passwords from seamonkey a possible bug find - perhaps a version error instead?
2006-10-27 - Archive of obsolete content
discussions should be easier to
import bookmark backups user asking for thoughts about having bookmarks manager's
import wizard
import from backups in the bookmarkbackups folder.
... bug in firefox when
import passwords from seamonkey a possible bug find - perhaps a version error instead?
Encryption and Decryption - Archive of obsolete content
symmetric-key encryption plays an
important role in the ssl protocol, which is widely used for authentication, tamper detection, and encryption over tcp/ip networks.
...nevertheless, private-key encryption is useful, because it means you can use your private key to sign data with your digital signature-an
important requirement for electronic commerce and other commercial applications of cryptography.
Browser Feature Detection - Archive of obsolete content
ent() true true true document.createcdatasection() true false true document.createprocessinginstruction() true false true document.createattribute() true true true document.createentityreference()obsolete since gecko 7 true false false document.getelementsbytagname() true true true document.
importnode() true false true document.createelementns() true false true document.createattributens() true false true document.getelementsbytagnamens() true false true document.getelementbyid() true true true dom level 1 html support for properties/methods in document name firefox 1.5 ie 6 & 7 op...
..., 'supported': false}, {name: 'createtextnode', 'supported': false}, {name: 'createcomment', 'supported': false}, {name: 'createcdatasection', 'supported': false}, {name: 'createprocessinginstruction', 'supported': false}, {name: 'createattribute', 'supported': false}, {name: 'createentityreference', 'supported': false}, {name: 'getelementsbytagname', 'supported': false}, {name: '
importnode', 'supported': false}, {name: 'createelementns', 'supported': false}, {name: 'createattributens', 'supported': false}, {name: 'getelementsbytagnamens', 'supported': false}, {name: 'getelementbyid', 'supported': false} ], 'domcss1': [ {name: 'background', 'supported': false}, {name: 'backgroundattachment', 'supported': false}, {name: 'backgroundcolor', 'supported': false}, {...
Examples - Archive of obsolete content
if you wish to test these examples by yourself, please read the
important notes.
...
important notes if you plan to test these examples by yourself, you must use the right filename extension (it is written at the beginning of the code).
XForms Custom Controls Examples - Archive of obsolete content
d="content"></xhtml:div> <children/> </content> <implementation implements="nsixformsuiwidget"> <field name="_domparser">null</field> <property name="domparser" readonly="true"> <getter> if (!this._domparser) this._domparser = new domparser(); return this._domparser; </getter> </property> <method name="refresh"> <body> // get new value, parse, and
import it.
... var val = this.stringvalue; var newdom = this.domparser.parsefromstring(val, "text/xml"); var impnode = document.
importnode(newdom.firstchild, true); // get content node, clean it, and update it var content = document.getanonymouselementbyattribute(this, "anonid", "content"); if (content.firstchild) { content.removechild(content.firstchild); } content.appendchild(impnode); return true; </body> </method> </implementation> </binding> ...
Common causes of memory leaks in extensions - Extensions
the following example shows how to unload your modules again (bootstrap.js): components.utils.
import("resource://gre/modules/services.jsm"); function startup(data, reason) { // this assumes your add-on did register some chrome components.utils.
import("chrome://myaddon/content/mymodule.jsm"); } function shutdown(data, reason) { // no need to do regular clean up when the application is closed // unless you need to break circular references that might negatively // impact the shutdown p...
... if (reason == app_shutdown) return; // your add-on needs to unload all modules it ships and
imported!
Game monetization - Game development
you have to follow the market and do your own research — learning from your mistakes quickly is
important.
...that's why carefully managing your community is so
important.
Implementing controls using the Gamepad API - Game development
implementation there are two
important events to use along with the gamepad api — gamepadconnected and gamepaddisconnected.
... gamepad object there's lots of useful information contained in the gamepad object, with the states of buttons and axes being the most
important: id: a string containing information about the controller.
2D maze game with device orientation - Game development
without the framework, to add the canvas element to the page, you would have to write something like this inside the <body> tag: <canvas id='game' width='320' height='480'></canvas> the
important thing to remember is that the framework is setting up helpful methods to speed up a lot of things like image manipulation or assets management, which would be a lot harder to do manually.
... controlling the ball it’s cool to have the ball ready to be thrown around in the play area, but it’s also
important to be able to actually move it!
Visual typescript game engine - Game development
* default value is 9001 */ private broadcasterport: number = 9001; /** * @description
important note for this property: if you * disable (false) you cant use account system or any other * network.
... -run services database server (locally and leave it alive to develop process): npm run dataserver looks like this : mongod --dbpath ./server/database/data fix: "failed: address already in use" : netstat -ano | findstr :27017 taskkill /pid typeyourpidhere /f also
important "run visual studio code as administrator".
Mobile accessibility - Learn web development
previous overview: accessibility next with web access on mobile devices being so popular and renowned platforms such as ios and android having full-fledged accessibility tools, it is
important to consider the accessibility of your web content on these platforms.
... specific mobile considerations there are other
important issues to consider when making sites more accessible on mobile.
Accessibility - Learn web development
beyond mechanical use, it's
important to learn how to use these technologies responsibly so that all readers might use your creations on the web.
... mobile accessibility with web access on mobile devices being so popular, and popular platforms such as ios and android having fully-fledged accessibility tools, it is
important to consider the accessibility of your web content on these platforms.
Backgrounds and borders - Learn web development
screen readers cannot parse background images, therefore they should be purely decoration; any
important content should be part of the html page and not contained in a background.
... we have covered a lot in this article, but can you remember the most
important information?
Combinators - Learn web development
we have covered a lot in this article, but can you remember the most
important information?
...next we will move on to another
important part of css — the css box model.
Styling tables - Learn web development
to do this, add the following css to your style.css file: /* spacing */ table { table-layout: fixed; width: 100%; border-collapse: collapse; border: 3px solid purple; } thead th:nth-child(1) { width: 30%; } thead th:nth-child(2) { width: 20%; } thead th:nth-child(3) { width: 15%; } thead th:nth-child(4) { width: 35%; } th, td { padding: 20px; } the most
important parts to note are as follows: a table-layout value of fixed is generally a good idea to set on your table, as it makes the table behave a bit more predictably by default.
... we have covered a lot in this article, but can you remember the most
important information?
CSS values and units - Learn web development
it's
important to know the difference in order to understand how big things will become.
... we have covered a lot in this article, but can you remember the most
important information?
CSS building blocks - Learn web development
overflowing content in this lesson we will look at another
important concept in css — overflow.
...understanding how big the different features in your design will be is
important, and in this lesson, we will summarize the various ways elements get a size via css and define a few terms around sizing that will help you in the future.
Flexbox - Learn web development
we have covered a lot in this article, but can you remember the most
important information?
...next we'll have a look at another
important aspect of css layouts — css grids.
Beginner's guide to media queries - Learn web development
this is an
important first step and one which ensures that if the content were to be read out by a screen reader, it would be understandable.
... you've reached the end of this article, but can you remember the most
important information?
Getting started with CSS - Learn web development
leaving the underline in place, can be an
important clue for people to realize that some text inside a paragraph can be clicked on — this is the behavior they are used to.
... a plain html document is generally accessible to everyone — as you start to style that document it is
important that you don't make it less accessible.
Fundamental text and font styling - Learn web development
we just wanted to cover the most
important ones here.
... you've reached the end of this article, and already did some skill testing in our active learning section, but can you remember the most
important information going forward?
What text editors are available? - Learn web development
e setting for your needs check autosave and session saving settings configure any available plugins and investigate how to get new ones change color schemes adjust view settings and see how you can change the layout of the views check what programming languages/technologies your editor supports while you're learning the default settings of most text editors should be fine to use, but it is
important to become familiar with your chosen tools, so you can select the best one for your usage.
... you will learn more about customizing your editors and tools as you gain experience, and more
importantly you will learn what features are more useful to your purposes.
What are hyperlinks? - Learn web development
in the rest of this article, we discuss the various types of links and their
importance to modern web design.
... when you're starting out, you don't have to worry about external and incoming links as much, but they are very
important if you want search engines to find your site (see below for more details).
Common questions - Learn web development
in this article we go over how web servers work, and why they're
important.
... this article covers the all-
important first step of every project: define what you want to accomplish with it.
JavaScript basics - Learn web development
is the standard for introductory programming examples.)
important: if you haven't been following along with the rest of our course, download this example code and use it as a starting point.
...
important: in this article, try entering the example code lines into your javascript console to see what happens.
Debugging HTML - Learn web development
note: html is parsed permissively because when the web was first created, it was decided that allowing people to get their content published was more
important than making sure the syntax was absolutely correct.
... <ul> <li>unclosed elements: if an element is <strong>not closed properly, then its effect can spread to areas you didn't intend <li>badly nested elements: nesting elements properly is also very
important for code behaving correctly.
Marking up a letter - Learn web development
inline semantics the names of the sender and receiver (and tel and email) should be marked up with strong
importance.
... try to mark up at least two appropriate words in the text with strong
importance/emphasis.
What’s in the head? Metadata in HTML - Learn web development
it contains information such as the page <title>, links to css (if you choose to style your html content with css), links to custom favicons, and other metadata (data about the html, such as the author, and
important keywords that describe the document.) in this article we'll cover all of the above and more, in order to give you a good basis for working with markup.
... objective: to learn about the html head, its purpose, the most
important items it can contain, and what effect it can have on the html document.
Video and audio content - Learn web development
timed descriptions text which should be spoken by the media player in order to describe
important visuals to blind or otherwise visually impaired users.
... you've reached the end of this article, but can you remember the most
important information?
Asynchronous JavaScript - Learn web development
in this module we take a look at asynchronous javascript, why it is
important, and how it can be used to effectively handle potential blocking operations such as fetching resources from a server.
... guides general asynchronous programming concepts in this article we'll run through a number of
important concepts relating to asynchronous programming, and how this looks in web browsers and javascript.
Function return values - Learn web development
it's
important to understand what their values are, how to use them in your code, and how to make functions return useful values.
... you've reached the end of this article, but can you remember the most
important information?
JavaScript building blocks - Learn web development
it's
important to understand what their values are, how to make use of them in your code, and how to make your own custom functions return useful values.
...in this final article we will discuss some
important concepts surrounding events, and look at how they work in browsers.
Client-side storage - Learn web development
note: the version number is
important.
... finally for this section, we'll add probably the most
important event handler for setting up the database: request.onupgradeneeded.
Drawing graphics - Learn web development
this raises an
important point: graphics operations like drawing rectangles, lines, and so forth are performed in the order in which they occur.
...this illustrates another
important point of the canvas — if you try to fill an incomplete path (i.e.
Video and Audio APIs - Learn web development
trols-webfont.woff') format('woff'), url('fonts/heydings_controls-webfont.ttf') format('truetype'); font-weight: normal; font-style: normal; } button:before { font-family: heydingscontrolsregular; font-size: 20px; position: relative; content: attr(data-icon); color: #aaa; text-shadow: 1px 1px 0px black; } first of all, at the top of the css we use a @font-face block to
import a custom web font.
... playing and pausing the video let's implement probably the most
important control — the play/pause button.
A first splash into JavaScript - Learn web development
all we have left to do now in this article is talk about a few other
important code features that you've already seen, although you may have not realized it.
...loops are a very
important concept in programming, which allow you to keep running a piece of code over and over again, until a certain condition is met.
Useful string methods - Learn web development
you've reached the end of this article, but can you remember the most
important information?
... conclusion you can't escape the fact that being able to handle words and sentences in programming is very
important — particularly in javascript, as websites are all about communicating with people.
JavaScript object basics - Learn web development
try these in the js console: person.name.first person.name.last
important: at this point you'll also need to go through your method code and change any instances of name[0] name[1] to name.first name.last otherwise your methods will no longer work.
... you've reached the end of this article, but can you remember the most
important information?
Working with JSON - Learn web development
the order in which things are appended is
important, as this is the order they will be displayed inside the html.
... you've reached the end of this article, but can you remember the most
important information?
JavaScript — Dynamic client-side scripting - Learn web development
the object-oriented nature of javascript is
important to understand if you want to go further with your knowledge of the language and write more efficient code, therefore we've provided this module to help you.
... asynchronous javascript in this module we take a look at asynchronous javascript, why it is
important, and how it can be used to effectively handle potential blocking operations such as fetching resources from a server.
Web performance resources - Learn web development
if you do, have a backup plan for seo (e.g render full page for bot traffic); for example, by using the loading attribute on the <img> element it is also crucial to realize what is really
important to your users.
...the following snippet includes an onload attribute, requiring javascript, so it is
important to include a noscript tag with a traditional fallback.
What is web performance? - Learn web development
how a user perceives your performance is as
important, or perhaps more
important, than any objective statistic, but it's subjective, and not as readily measurable.
...it is
important to minimize the loading and response times, and add additional features to conceal latency by making the experience as available and interactive as possible, as soon as possible, while asynchronously loading in the longer tail parts of the experience.
Properly configuring server MIME types - Learn web development
why are correct mime types
important?
... serving content using the correct mime type can also be
important for security reasons; it's possible for malicious content to affect the user's computer by pretending to be a safe type of document when it is in fact not.
Website security - Learn web development
important: the single most
important lesson you can learn about website security is to never trust data from the browser.
...most
importantly, you should understand that a web application cannot trust any data from the web browser.
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
enter the following terminal command to do so: ember generate component-class footer next, go and find the newly-created todomvc/app/components/footer.js file and update it to the following:
import component from '@glimmer/component';
import { inject as service } from '@ember/service'; export default class footercomponent extends component { @service('todo-data') todos; } now we need to go back to our todo-data.js file and add some functionality that will allow us to return the number of incomplete todos (useful for showing how many are left), and clear the completed todos out of t...
... creating a todo class run the following command in your terminal: ember generate component-class todo now go to the newly-created todomvc/app/components/todo.js file and update the contents to look like so, to give the todo component access to the service:
import component from '@glimmer/component';
import { inject as service } from '@ember/service'; export default class todocomponent extends component { @service('todo-data') todos; } next, go back again to our todo-data.js service file and add the following action just below the previous ones, which will allow us to toggle a completion state for each todo: @action togglecompletion(todo) { ...
Ember resources and troubleshooting - Learn web development
using the design patterns provided by the framework, a route using fetch() would look something like this:
import route from '@ember/routing/route'; export default class myroute extends route { async model() { let response = await fetch('some/url/to/json/data'); let json = await response.json(); return { data: json }; } } see more information on specifying the route's model here.
... more concretely, using mut allows for template-only settings functions to be declared: <checkbox @value={{this.somedata}} @ontoggle={{fn (mut this.somedata) (not this.somedata)}} /> whereas, without mut, a component class would be needed:
import component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object'; export default class example extends component { @tracked somedata = false; @action setdata(newvalue) { this.somedata = newvalue; } } which would then be called in the template like so: <checkbox @data={{this.somedata}} @onchange={{this.setdata}} /> due to the...
React interactivity: Editing, filtering, conditional rendering - Learn web development
first,
import usestate into the todo component like we did before with the app component, by updating the first
import statement to this:
import react, { usestate } from "react"; we'll now use this to set an isediting state, the default state of which should be false.
... at the top of app.js, beneath our
imports but above our app() function, let's add an object called filter_map: const filter_map = { all: () => true, active: task => !task.completed, completed: task => task.completed }; the values of filter_map are functions that we will use to filter the tasks data array: the all filter shows all tasks, so we return true for all tasks.
React resources - Learn web development
create-react-app makes it possible to
import css files into javascript modules, so that css is only sent to your user when the corresponding component is rendered.
... for this app, we could have for example written a dedicated form.css file to house the styles of those respective components, then
imported the styles into their respective modules like this:
import form from './form';
import './form.css' this approach makes it easy to identify and manage the css that belongs to a specific component.
Deployment and next steps - Learn web development
if we have a look at the rollup.config.js file, we can see that the svelte compiler is just a rollup plugin:
import svelte from 'rollup-plugin-svelte'; [...]
import { terser } from 'rollup-plugin-terser'; const production = !process.env.rollup_watch; export default { input: 'src/main.js', output: { sourcemap: true, format: 'iife', name: 'app', file: 'public/build/bundle.js' }, plugins: [ svelte({ // enable run-time checks when not in production dev: !production, ...
... you can also
import a svelte git project into vercel from github, gitlab, or bitbucket.
Adding a new todo form: Vue events, methods, and models - Learn web development
go back to app.vue and add the following
import statement just below the previous one, inside your <script> element:
import todoform from './components/todoform'; you also need to register the new component in your app component — update the components property of the component object so that it looks like this: components: { todoitem, todoform } finally for this section, render your todoform component inside your app b...
...it's
important to know that event handlers are case sensitive and cannot include spaces.
Understanding client-side JavaScript frameworks - Learn web development
along the way, we'll learn about a few
important concepts such as calling components inside other components, passing data to them via props and saving data state.
...it is very
important to be able to get help with learning a complex subject, especially when you are just starting out.
Introduction to cross browser testing - Learn web development
the most
important thing is that you test each small part before committing it — don't leave all the testing till the end!
... reporting bugs just to reiterate on what was said above, if you discover bugs in browsers, you should report them: firefox bugzilla edgehtml issue tracker safari chrome opera summary this article should have given you a high-level understanding of the most
important concepts you need to know about cross browser testing.
Handling common JavaScript problems - Learn web development
it is not so
important now we have modern features like document.queryselector()/document.queryselectorall()/node methods available across browsers, but it can still be useful when older browsers need supporting.
... finding help there are many other issues you'll encounter with javascript; the most
important thing to know really is how to find answers online.
Lightweight themes
the upper right-hand side of the image should have the most
important information - as a user increases the width of the browser window, the browser reveals more of the left-hand side of the image.
...
important: please be sure you have the rights to use the image in your theme!
Adding a new CSS property
this is particularly
important in case the unexpected token is a parenthesis or something else that requires matching the other half of a pair.
... also, it's very
important not to touch the computed style data at all when there's no specified data provided (ecssunit_null); touching the computed style data in this case would break partial computation based on a start struct, which is when we computed style data on the basis of computed data we've already computed from a subset of the style rules that we're currently computing from.
Debugging on Mac OS X
one
important issue that the mozilla .lldbinit file fixes is that by default some breakpoints will be listed as "pending", and xcode will not stop at them.
... the .lldbinit file in the source tree
imports many useful mozilla specific lldb settings, commands and formatters into lldb, but you may need to take one of the following steps to make sure this file is used.
ESLint
here are some common issues: my script is
imported into the global browser.xul scope.
... you'll need to include the following just above it: /*
import-globals-from relative/path/to/file.js */ do_check_eq, add_task not defined in a test directory.
Eclipse CDT
more
importantly, unless you're willing to screw up eclipse's code assistance (in which case why bother using eclipse) you're going to have to set eclipse's "build" step to do a very slow, non-parallel, full rebuild.
... on mac, create a script called something like open-my-workspace.py, give it the following contents, replacing the bold paths as appropriate, and make it executable (chmod a+x open-my-workspace.py): #!/usr/bin/env python
import os, subprocess eclipse_app_path = "path/to/eclipse.app/contents/macos/eclipse" workspace_path = os.path.join(os.environ['home'], "home/relative/path/to/the/directory/of/the/workspace/you/want/to/open") subprocess.popen([eclipse_app_path, "-data", workspace_path]) # uncomment the following line to automatically close the terminal window # that opens if you run this script by double clicking it in ...
Performance
better: addon.js as above // framescript.js components.utils.
import("resource://my-addon/processmodule.jsm", {}).addframe(this) // processmodule.jsm const exported_symbols = ['addframe']; const precomputedconstants = // ...
...e() { services.ppmm.broadcastasyncmessage("my-addon:update-configuration", {newconfig: main.serialize()}) } // processmodule.jsm const exported_symbols = ['getmaincopy']; var maincopy; services.cpmm.addmessagelistener("my-addon:update-configuration", function(message) { maincopy = message.data.newconfig; }) funtion getmaincopy() { return maincopy; } // framescript.js components.utils.
import("resource://my-addon/processmodule.jsm") // getmaincopy() used by other functions don't register observers (and other callbacks to global services) in a frame script bad: //framescript.js services.obs.addobserver("document-element-inserted", { observe: function(doc, topic, data) { if(doc.ownerglobal.top != content) return; // bail out if this is for another tab decorat...
Performance best practices for Firefox front-end engineers
it's also
important to note that most of our javascript runs on the main thread, so it's easy for script to cause delays in event processing or painting.
...this allows you to put all of your dom writes (most
importantly, anything that could change the size or position of things in the dom) just before the style and layout steps of the pipeline, combining all the style and layout calculations into a single batch so it all happens once, in a single frame tick, instead of across multiple frames.
Geckoview-Junit Tests
for example:
import org.junit.ignore ...
...for example:
import org.junit.assume.assumethat ...
HTTP Cache
important difference in behavior from the old cache: when the cache entry object is already present in memory or open as “force-new” (a.k.a “open-truncate”) this callback is invoked sooner then the asyncopenuri method returns (i.e.
... concurrent read and write
important difference in behavior from the old cache: the cache now supports reading a cache entry data while it is still being written by the first consumer - the writer.
How to implement a custom autocomplete search component
const ci = components.interfaces; const cu = components.utils; cu.
import('resource://gre/modules/xpcomutils.jsm'); const class_id = components.id('x753d830-ba1e-11e0-962b-0800200c9a66'); // ← change this const class_name = "basic autocomplete"; const contract_id = '@mozilla.org/autocomplete/search;1?name=basic-autocomplete'; /** * @constructor * * @implements {nsiautocompleteresult} * * @param {string} searchstring * @param {number} searchresult * @param {n...
...the solution is to define a custom autocomplete panel as follows with the noautofocus="true" attribute (very
important, don't miss this part): <panel id="popup_autocomplete" type="autocomplete" noautofocus="true" /> <textbox type="autocomplete" autocompletesearch="custom-autocomplete" autocompletepopup="popup_autocomplete" /> there is another example of the use of an autocomplete panel in autocomplete code snippets.
Assert.jsm
to use it, you first need to
import the code module into your javascript scope: components.utils.
import("resource://testing-common/assert.jsm"); the assert class offers methods for performing common logical assertions.
...port( failed, actual, expected, message, operator ); parameters failed indicates if the assertion failed or not actual the result of evaluating the assertion expected expected result from the test author message short explanation of the expected result operator operation qualifier used by the assertion method (ex: '==') examples custom reporter example components.utils.
import("resource://testing-common/assert.jsm"); let assert = new assert(); assert.setreporter(function customreporter(err, message, stack) { if (err) { do_report_result(false, err.message, err.stack); } else { do_report_result(true, message, stack); } }); ...
Interfacing with the Add-on Repository
importing the repository code module before you can use the add-on repository api, you need to
import the code module: components.utils.
import("resource://gre/modules/addonrepository.jsm"); having done this, you can then access the api through the resulting addonrepository object.
...the
important thing to note is that this will handle the failure case.
Following the Android Toasts Tutorial from a JNI Perspective
in jni, there is the all-
important property called sig.
... let sig = { context: 'landroid/content/context;', charsequence; 'ljava/lang/charsequence;', int: 'i', toast: 'landroid/widget/toast;', void: 'v', }; get java environment before we go on to declare the other
important features, we need to load our environment variable.
Log.jsm
to use it, you first need to
import the code module into your javascript scope: components.utils.
import("resource://gre/modules/log.jsm"); basic usage components.utils.
import("resource://gre/modules/log.jsm"); // get a logger, give it a name unique to this chunk of code.
... config information regarding
important configuration options the system is using that affect how it runs.
OS.File for the main thread
using os.file from a jsm to
import os.file into your chrome code, add the following line at the start of your script: components.utils.
import("resource://gre/modules/osfile.jsm") promises before using os.file from the main thread, you need some understanding of the promise library.
... test.txt to testrenamed.txt if the file is located in directory c:\jean\ var promise = os.file.move(os.path.join('c:', 'jean', 'test.txt'), os.path.join('c:', 'jean', 'testrenamed.txt')); promise.then( function() { console.log('rename successful') }, function(arejectreason) { console.log('rename failed, arejectreason = ', arejectreason) } ) the nooverwrite true is
important, as default is false which means if a file in the directory exists already with the same name it will no longer be there after this "rename" operation, which is a "move".
OSFile.jsm
why is off main thread file i/o
important?
... why is i/o efficiency
important?
PopupNotifications.jsm
to use this, you first need to
import the code module into your javascript scope: components.utils.
import("resource://gre/modules/popupnotifications.jsm"); once you've
imported the module, you can then use the popupnotifications object it exports; this object provides methods for creating and displaying popup notification panels.
... note: this code module is
imported by firefox chrome windows, so you don't have to do it yourself in most extensions.
Promise.jsm
to use it, you first need to
import the code module into your javascript scope: components.utils.
import("resource://gre/modules/promise.jsm"); note: a preliminary promise module is also available starting from gecko 17, though it didn't conform to the promises/a+ proposal until gecko 25: components.utils.
import("resource://gre/modules/commonjs/promise/core.js"); // gecko 17 to 20 components.utils.
import("resource://gre/mod...
...while you may still
import this module from the above paths, the recommended way for loading it is through the add-on sdk loader.
Webapps.jsm
importing components.utils.
import("resource://gre/modules/webapps.jsm"); // exported symbol is domapplicationregistry method overview init: function() loadcurrentregistry: function() notifyappsregistrystart: function notifyappsregistrystart() notifyappsregistryready: function notifyappsregistryready() sanitizeredirects: function sanitizeredirects(asource) _savewidgetsfullpath: function(amanifest, adestapp) appkind: function(aapp, amanifest) updatepermissionsforapp: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid) removeifhttpsduplicate: function(aid) installsystemapps: function...
...essage: function(amessage) getappinfo: function getappinfo(aappid) broadcastmessage: function broadcastmessage(amsgname, acontent) registerupdatehandler: function(ahandler) unregisterupdatehandler: function(ahandler) notifyupdatehandlers: function(aapp, amanifest, azippath) _getappdir: function(aid) _writefile: function(apath, adata) dogetlist: function() doexport: function(amsg, amm) do
import: function(amsg, amm) doextractmanifest: function(amsg, amm) dolaunch: function (adata, amm) launch: function launch(amanifesturl, astartpoint, atimestamp, aonsuccess, aonfailure) close: function close(aapp) canceldownload: function canceldownload(amanifesturl, aerror) startofflinecachedownload: function(amanifest, aapp, aprofiledir, aisupdate) computemanifesthash: function(amanifest) upda...
Bootstrapping a new locale
this will familiarize you with our "hg" commands and will get us something that we can
import easily when you are done.
...$ hg pull -u # to pull changes and update $ hg push # to push changes to this repo
import existing data?
L10n Checks
ab-cd browser chrome/browser browser.dtd +backforwardmenu.tooltip +fullzoomenlargecmd.commandkey3 +fullzoomreducecmd.commandkey2 +fullzoomresetcmd.commandkey2 +organizebookmarks.label -showallbookmarkscmd2.label migration/migration.dtd -
importfromfile.accesskey -
importfromfile.label +
importfromhtmlfile.accesskey +
importfromhtmlfile.label you can assume changed strings when you see entities removed and added with a similar name.
...lete entities and files, by setting the -t parameter, e.g.: check-l10n-completeness -t suite/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 suite/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 suite/locales/l10n.ini ../l10n/ de spell checking requires enchant and pyenchant to be installed on the system.
Localization notes
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.
...it's
important to follow the format as closely as possible.
Initial setup
for now, simply be aware that these will become
important as your efforts progress.
...the svn for localizers guide will help you learn the most
important svn commands for l10n.
SVN for Localizers
it's very
important for you to update your working copy with the newest files from mozilla svn repository before you start making changes.
...it's very
important that you do this often.
Mozilla Development Strategies
work on the most
important bugs first everyone likes to check in.
... work on multiple bugs in parallel you should be working on the most
important bugs first.
Profiling with the Firefox Profiler
label stack the label stack (formerly called "pseudo stack") uses function entry/exit tags added by hand to
important points in the code base.
...each option will increase the performance overhead of profiling so it's
important to activate only options that will provide useful information for your particular problem to reduce the distortion.
L20n HTML Bindings
it is
important to note that applying translations doesn't replace dom elements, but only modifies their text nodes and their attributes.
... when all dom nodes are localized, the document element will fire a documentlocalized event, which you can listen to: document.addeventlistener('documentlocalized', function() { // the dom has been localized and the user sees it in their language yourapp.init(); }); exposing context data you can expose
important bits of data to the localization context in form of context data.
AsyncTestUtils extended framework
boilerplate add the following code to the top of your test file to
import everything you need: load("../../mailnews/resources/loghelper.js"); load("../../mailnews/resources/asynctestutils.js"); load("../../mailnews/resources/messagegenerator.js"); load("../../mailnews/resources/messagemodifier.js"); load("../../mailnews/resources/messageinjection.js"); if the directory where you are adding the tests does not have a head_*.js file that has the two following lines, add them at the top of your test file (before the lines shown above): load("../../mailnews/resources/maildirservice.js"); load("../.
...the messagescenariofactory produces specific pre-configured message threading configurations using fresh messages (
important in avoiding duplicate messages for code that cares, like gloda).
Anonymous Shared Memory
application specific technique to find fmstring from parent fm = pr_
importfilemapfromstring( fmstring ) addr = pr_memmap(fm); ...
...pr_memunmap(addr); pr_closefilemap(fm); anonymous shared memory functions pr_openanonfilemap pr_processattrsetinheritablefilemap pr_getinheritedfilemap pr_exportfilemapasstring pr_
importfilemapfromstring ...
I/O Functions
list of functions: pr_openudpsocket pr_newudpsocket pr_opentcpsocket pr_newtcpsocket pr_
importtcpsocket pr_connect pr_connectcontinue pr_accept pr_bind pr_listen pr_shutdown pr_recv pr_send pr_recvfrom pr_sendto pr_transmitfile pr_acceptread pr_getsockname pr_getpeername pr_getsocketoption pr_setsocketoption converting between host and network addresses pr_ntohs pr_ntohl pr_htons pr_htonl pr_familyinet memory-mapped i/o functions the memory-mapped i/o functions ...
... pr_createfilemap pr_memmap pr_memunmap pr_closefilemap anonymous pipe function pr_createpipe polling functions this section describes two of the most
important polling functions provided by nspr: pr_poll pr_getconnectstatus pollable events a pollable event is a special kind of file descriptor.
Cryptography functions
ater pk11_gettokeninfo mxr 3.2 and later pk11_gettokenname mxr 3.2 and later pk11_getwindow mxr 3.2 and later pk11_getwrapkey mxr 3.2 and later pk11_hashbuf mxr 3.2 and later pk11_hasrootcerts mxr 3.4 and later pk11_
importcert mxr 3.5 and later pk11_
importcertforkeytoslot mxr 3.2 and later pk11_
importcrl mxr 3.6 and later pk11_
importdercert mxr 3.6 and later pk11_
importderprivatekeyinfoandreturnkey mxr 3.4 and later pk11_
importencryptedprivatekeyinfo mxr 3.2 and lat...
...er pk11_
importprivatekeyinfo mxr 3.2 and later pk11_
importprivatekeyinfoandreturnkey mxr 3.4 and later pk11_
importpublickey mxr 3.4 and later pk11_
importsymkeywithflags mxr 3.4 and later pk11_initpin mxr 3.2 and later pk11_isfips mxr 3.2 and later pk11_isdisabled mxr 3.4 and later pk11_isfriendly mxr 3.2 and later pk11_ishw mxr 3.2 and later pk11_isinternal mxr 3.2 and later pk11_ispresent mxr 3.2 and later pk11_isreadonly mxr 3.2 and later pk11_isre...
Introduction to Network Security Services
r is a separate mozilla project; see netscape portable runtime for details.) figure 1 relationships among core nss libraries and nspr naming conventions and special libraries windows and unix use different naming conventions for static and dynamic libraries: windows unix static .lib .a dynamic .dll .so or .sl in addition, windows has "
import" libraries that bind to dynamic libraries.
... so the nss library has the following forms: libnss3.so - unix shared library libnss3.sl - hp-ux shared library libnss.a - unix static library nss3.dll - windows shared library nss3.lib - windows
import library binding to nss3.dll nss.lib - windows static library nss, ssl, and s/mime have all of the above forms.
JSS FAQ
import java.io.bytearrayinputstream; [...] certificate cert = (certificate) asn1util.decode( certificate.gettemplate(),x509cert.getencoded() ); how do i convert org.mozilla.jss.pkix.cert to org.mozilla.jss.crypto.x509certificate?
... cryptomanager.
importcertpackage() is it possible to use jss to acces cipher functionality from pkcs11 modules?
NSS_3.12.1_release_notes.html
tching bug 408847: pkix_ocspchecker_check does not support specified responder (and given signercert) bug 414003: crash [[@ cert_decodecertpackage] sometimes with this testcase bug 415167: memory leak in certutil bug 417399: arena allocation results are not checked in pkix_pl_infoaccess_parselocation bug 420644: improve ssl tracing of key derivation bug 426886: use const char* in pk11_
importcertforkey bug 428103: cert_encodesubjectkeyid is not defined in any public header file bug 429716: debug builds of libpkix unconditionally dump socket traffic to stdout bug 430368: vfychain -t option is undocumented bug 430369: vfychain -o succeeds even if -pp is not specified bug 430399: vfychain -pp crashes bug 430405: error log is not produced by cert_pkixverifycert bug 430743: u...
...ngs in lib/util and lib/freebl bug 433437: vfychain ignores the -a option bug 433594: crash destroying ocsp cert id [[@ cert_destroyocspcertid ] bug 434099: nss relies on unchecked pkcs#11 object attribute values bug 434187: fix the gcc compiler warnings in nss/lib bug 434398: libpkix cannot find issuer cert immediately after checking it with ocsp bug 434808: certutil -b deadlock when
importing two or more roots bug 434860: coverity 1150 - dead code in ocsp_createcertid bug 436428: remove unneeded assert from sec_pkcs7encryptlength bug 436430: make nss public headers compilable with no_nspr_10_support defined bug 436577: uninitialized variable in sec_pkcs5createalgorithmid bug 438685: libpkix doesn't try all the issuers in a bridge with multiple certs bug 438876: signtool...
NSS_3.12_release_notes.html
or on this policy extension bug 375019: cache-enable pkix_ocspchecker_check bug 391454: libpkix does not honor nss's override trust flags bug 403682: cert_pkixverifycert never succeeds bug 324744: add generation of policy extensions to certutil bug 390973: add long option names to secu_parsecommandline bug 161326: need api to convert dotted oid format to/from octet representation bug 376737: cert_
importcerts routinely sets valid_peer or valid_ca override trust flags bug 390381: libpkix rejects cert chain when root ca cert has no basic constraints bug 391183: rename libpkix error string number type to pkix error number types bug 397122: nss 3.12 alpha treats a key3.db with no global salt as having no password bug 405966: unknown signature oid 1.3.14.3.2.29 causes sec_error_bad_signature, 3.11 ign...
... p12 file bug 329067: nss encodes cert distinguished name attributes with wrong string type bug 339906: sec_pkcs12_install_bags passes uninitialized variables to functions bug 396484: certutil doesn't truncate existing temporary files when writing them bug 251594: certificate from pkcs#12 file with colon in friendlyname not selectable for signing/encryption bug 321584: nss pkcs12 decoder fails to
import bags without nicknames bug 332633: remove duplicate header files in nss/cmd/sslsample bug 335019: pk12util takes friendly name from key, not cert bug 339173: mem leak whenever secmod_handle_string_arg called in loop bug 353904: klocwork null ptr deref in secasn1d.c bug 366390: correct misleading function names in fipstest bug 370536: memory leaks in pointer tracker code in debug builds only bug 3...
NSS 3.16.2.2 release notes
this fixes a regression introduced in nss 3.16.2 that prevented nss from
importing some rsa private keys (such as in pkcs #12 files) generated by other crypto libraries.
... bugs fixed in nss 3.16.2.2 bug 1049435 -
importing an rsa private key fails if p < q compatibility nss 3.16.2.2 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.16.2.3 release notes
notable changes in nss 3.16.2.3 bug 1057161: check that an
imported elliptic curve public key is valid.
...now ec public keys are validated at
import time.
NSS 3.16.6 release notes
this fixes a regression introduced in nss 3.16.2 that prevented nss from
importing some rsa private keys (such as in pkcs #12 files) generated by other crypto libraries.
... bugs fixed in nss 3.16.6 bug 1049435 -
importing an rsa private key fails if p < q compatibility nss 3.16.6 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS API Guidelines
pkcs #12 can be used to to encode keys, and certificates, for export or
import into other applications.
...these rules are derived from existing coding practices inside the security library, since consistency is more
important than debates about what might look nice.
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
= (certcerttrust *)port_zalloc(sizeof(certcerttrust)); if (!trust) { pr_fprintf(pr_stderr, "unable to allocate cert trust\n"); rv = secfailure; goto cleanup; } rv = cert_decodetruststring(trust, trusts); if (rv) { pr_fprintf(pr_stderr, "unable to decode trust string\n"); rv = secfailure; goto cleanup; } rv = pk11_
importcert(slot, cert, ck_invalid_handle, name, pr_false); if (rv != secsuccess) { /* sigh, pk11_
import cert and cert_changecerttrust should have * been coded to take a password arg.
... == sec_error_token_not_logged_in) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s : %s\n", pk11_gettokenname(slot), port_errortostring(rv)); rv = secfailure; goto cleanup; } rv = pk11_
importcert(slot, cert, ck_invalid_handle, name, pr_false); } if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not add certificate to token or database : %s\n", port_errortostring(rv)); rv = secfailure; goto cleanup; } } rv = cert_changecerttrus...
sample2
cate from file\n"); rv = secfailure; goto cleanup; } /* create a cert trust */ trust = (certcerttrust *)port_zalloc(sizeof(certcerttrust)); if (!trust) { pr_fprintf(pr_stderr, "unable to allocate cert trust\n"); rv = secfailure; goto cleanup; } rv = cert_decodetruststring(trust, trusts); if (rv) { pr_fprintf(pr_stderr, "unable to decode trust string\n"); rv = secfailure; goto cleanup; } rv = pk11_
importcert(slot, cert, ck_invalid_handle, name, pr_false); if (rv != secsuccess) { /* sigh, pk11_
import cert and cert_changecerttrust should have * been coded to take a password arg.
... */ if (port_geterror() == sec_error_token_not_logged_in) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s : %s\n", pk11_gettokenname(slot), port_errortostring(rv)); rv = secfailure; goto cleanup; } rv = pk11_
importcert(slot, cert, ck_invalid_handle, name, pr_false); } if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not add certificate to token or database : %s\n", port_errortostring(rv)); rv = secfailure; goto cleanup; } } rv = cert_changecerttrust(handle, cert, trust); if (rv != secsuccess) { if (port_geterror() == sec_error_token_not_logged_in) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s : %s\n", pk11_gettokenname(slot), ...
PKCS11 FAQ
does the certificate need to be
imported into nss's internal certificate database?
...nss also does a similiar operation for
importing private keys and certificates through pkcs12.
NSPR functions
pr_getuniqueidentity pr_createiolayerstub pr_getdefaultiomethods pr_getidentitieslayer pr_getlayersidentity pr_pushiolayer pr_popiolayer wrapping a native file descriptor if your current tcp socket code uses the standard bsd socket api, a lighter-weight method than creating your own nspr i/o layer is to simply
import a native file descriptor into nspr.
... pr_
importtcpsocket socket i/o functions as mentioned above, the ssl library in nss implements the ssl protocol as an nspr i/o layer.
OLD SSL Reference
the certificate and key databases setting up the ca db and certificate setting up the server db and certificate setting up the client db and certificate verifying the server and client certificates building nss programs chapter 3 selected ssl types and structures this chapter describes some of the most
important types and structures used with the functions described in the rest of this document, and how to manage the memory used for them.
...rversidcache ssl export policy functions nss_setdomesticpolicy nss_setexportpolicy nss_setfrancepolicy ssl_cipherpolicyset ssl_cipherpolicyget ssl configuration functions ssl configuration ssl_
importfd ssl_optionset ssl_optionget ssl_cipherprefset ssl_cipherprefget ssl_configsecureserver ssl_seturl ssl_setpkcs11pinarg callback configuration ...
NSS tools : signtool
digital signatures allow ssl-enabled clients to perform two
important operations: * confirm the identity of the individual, company, or other entity whose digital signature is associated with the files * check whether the files have been tampered with since being signed if you have a signing certificate, you can use netscape signing tool to digitally sign files and package them as a jar file.
...when it is
imported into browser software such as communicator, it behaves like an object-signing ca and cannot be used to sign objects.
Rhino scopes and contexts
before using rhino in a concurrent environment, it is
important to understand the distinction between contexts and scopes.
... it's
important to understand that a scope is independent of the context that created it.
Shell global objects
setmoduleresolvehook(function(module, specifier) {}) set the hostresolve
importedmodule hook to function.
...the list of flags is available by calling this function with help as the flag's name wasmloop(filename,
imports) performs an afl-style persistent loop reading data from the given file and passing it to thewasmeval function together with the specified
imports object.
WebReplayRoadmap
one
important issue is that any side effects from evaluating expressions via the console or the debugger's watch expressions will not carry over when the tab resumes executing.
... dynamic analysis features an
important but as-yet unexploited advantage of being able to exactly replay a web replay recording is that the recording can be analyzed without overhead affecting the user's experience.
Redis Tips
it is intended primarily for developers, and deliberately omits some topics that will be
important in any redis deployment, like security and backups.
... (this is, for instance, how tj holowaychuk's implemented kue: https://github.com/learnboost/kue.) memory usage in redis is
important to think about.
A Web PKI x509 certificate primer
*.yourcompany.com) but you want others outside of your organization to be able to browse to your website using https without having to manually
import a root certificate, then you can get an ssl certificate from one of the cas who already have a root certificate included in the major browsers.
..._error_path_len_constraint_invalid sec_error_unknown_critical_extension a certificate contains an extension marked as critical that is not handled by mozilla::pkix re-generate the certificate without the extension or with it not marked as critical sec_error_unknown_issuer either a missing intermediate or root certificate is necessary to verify the certificate
import the root certificate into firefox or have the server send the intermediate sec_error_invalid_key sec_error_unsupported_keyalg sec_error_expired_issuer_certificate an issuer certificate is too old re-issue the issuer certificate mozilla_pkix_error_ca_cert_used_as_end_entity a certificate with a basic constraints extension with ca:true is...
Browser security
an
important aspect of developing code for any browser, including firefox, as well as any web-oriented project, is its security.
... these articles provide
important guides and references to ensuring the code you write is secure, including both design recommendations and testing guidelines.
Gecko object attributes
applied to: listitem, option exposed in aria: aria-setsize live region attribues atomic true when the entire region should be presented as a whole, when changes within it are considered
important enough to automatically present.
...this is especially
important in atomic regions.
Mork
the last
important point about tables is the meaning of the minuses.
...the first mid, as you should expect by now, is the row id, with the scope being an
important part of the id, in that 1:scope1 is not the same row as 1:scope2.
History Service Design
database indexes are quite
important, and a good query can make the difference between minutes or seconds.
... expiration expiration is an
important part of data management for two reasons: privacy: expiring data based on user interaction is
important, nothing must be left behind on a page removal database maintenance: having cleaner and smaller tables helps queries performances expiration is done at certain moments, but in future will most likely be moved to async queries, to be executed on a separate thread.
Accessing the Windows Registry Using XPCOM
to read your windows productid: var wrk = components.classes["@mozilla.org/windows-registry-key;1"] .createinstance(components.interfaces.nsiwindowsregkey); wrk.open(wrk.root_key_local_machine, "software\\microsoft\\windows\\currentversion", wrk.access_read); var id = wrk.readstringvalue("productid"); wrk.close(); this example, while simple, shows several
important things about using the interface.
...this can be very
important when dealing with non-administrator accounts with restricted privileges.
Creating a Python XPCOM component
then you can
import xpcom in any python module (mostly, in your component).
...make a file named "py_simple.py" for the actual code (again, in the 'components' directory): from xpcom
import components, verbose class pysimple: #pythontestcomponent _com_interfaces_ = components.interfaces.nsipysimple _reg_clsid_ = "{c456ceb5-f142-40a8-becc-764911bc8ca5}" _reg_contractid_ = "@mozilla.org/pysimple;1" def __init__(self): self.yourname = "a default name" # or mname ?
XPCOM changes in Gecko 2.0
for example, in your component's javascript code : components.utils.
import("resource://gre/modules/xpcomutils.jsm"); function mycomponent() { } mycomponent.prototype = { // this must match whatever is in chrome.manifest!
...to add a category entry, you must insert the following line to your chrome.manifest: category profile-after-change mycomponent @foobar/mycomponent;1
important: formerly, the contract id of the category entry was prefixed with "service," if the component was implemented as a service.
Component Internals
xpcom initialization to understand why and when your component library gets called, it is
important to understand the xpcom initalization process.
... type library manifests another
important file that xpcom reads in is the type library manifest file.
Starting WebLock
for example, you might have a category named "
important people" in which the name-value pairs would be names and phone numbers.
...there are a few reasons for not using strings to represent file locations, but the most
important one is that not all file systems can be represented by a series of characters separated by a slash.
Using XPCOM Components
for now, what's
important to see is how components like the ones in this section are obtained and used by the mozilla browser.
... this isn't quite all there is to it, of course, but this shows an
important aspect of xpcom.
Detailed XPCOM hashtable guide
hashtables may seem like arrays, but there are
important differences: array hashtable keys: integer: arrays are always keyed on integers, and must be contiguous.
... the
important files to read are xpcom/glue/nsbasehashtable.h and xpcom/glue/nshashkeys.h.
Mozilla internal string guide
when working with existing code, it is
important to examine the current usage of the strings that you are manipulating, to determine the correct conversion mechanism.
...there is no single answer to this question, but the
important points are: surprisingly many strings are very often just ascii.
Receiving startup notifications
the
important thing to note is that now instead of registering with the category manager programmatically as was done in the past, you add lines to your chrome.manifest to let the application handle it for you.
... for example: category profile-after-change mycomponent @foobar/mycomponent;1
important: in the past, the contract id of the category entry started with "service," if the component was implemented as a service.
Interfacing with the XPCOM cycle collector
the collector does not know how to find temporary owning pointers that exist on the stack, so it is
important that it only run from near the top-loop of the program.
...if your class has tearoffs or is being aggregated by other classes it is
important to make the tearoff classes or the outer classes participate in cycle collection too, not doing so could lead to the cycle collector trying to collect the objects too soon.
Components.utils.forceGC
in this case it can be
important to be able to force a garbage collection cycle from javascript.
...this will make sure that xpcom components that build cycles with javascript objects also get collected which might be
important, for example for testcases that depend on the garbage collector.
Components.utils.unload
once this method has been called, references to the module will continue to work but any subsequent
import of the module will reload it and give a new reference.
... if the javascript code module has not yet been
imported then this method will do nothing.
HOWTO
e.g., you use: components.utils.
import("resource://app/modules/gloda/log4moz.js"); however, you get (for that particular line, which is the first
import): uncaught exception: [exception...
... "component returned failure code: 0x80040111 (ns_error_not_available) [nsixpccomponents_utils.
import]" nsresult: "0x80040111 (ns_error_not_available)" location: "js frame :: file.js :: <top_level> :: line 12" data: no] solution 1 var loader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getservice(components.interfaces.mozijssubscriptloader); loader.loadsubscript("chrome://myall/content/file.jsm"); see: http://mxr.mozilla.org/comm-central/...figutils.js#54 solution 2 append the following at the top of your js file which you want to run in xpcshell { // <https://developer.mozilla.org/en/xpconnect/xpcshell/howto> // <https://bugzilla.mozilla.org/show_bug.cgi?id=546628> let cc = components.classes; let ci = components.interfaces; // register resource://app/ uri ...
nsIAnnotationService
if there is an
important annotation that the user or extension wants to keep, you should add a bookmark for the page and use an expire_never annotation.
...if there is an
important annotation that the user or extension wants to keep, you should add a bookmark for the page and use an expire_never annotation.
nsIWebBrowserPersist
this differs just slightly but in an
important way from normal formatted, and that is that lines are space stuffed.
...
important: if you think that you should be passing null here, you are almost certainly wrong.
nsIWebContentHandlerRegistrar
cu.
import('resource://gre/modules/services.jsm'); 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 lo...
...=%s as a content or protocol handler' when calling method: [nsiwebcontenthandlerregistrar::registerprotocolhandler] if the host names do match then a confirmation like this will be seen: this domain check can be bypassed by setting the preference of gecko.handlerservice.allowregisterfromdifferenthost to true as in this code here: var {classes: cc, interfaces: ci, utils: cu} = components; cu.
import("resource://gre/modules/services.jsm"); var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); var allowregisterfromdifferenthost = services.prefs.getboolpref('gecko.handlerservice.allowregisterfromdifferenthost'); if (!allowregisterfromdifferenthost) { services.prefs.setboolpref('gecko.handlerservice...
Storage
opening a connection javascript example of opening my_db_file_name.sqlite in the profile directory: components.utils.
import("resource://gre/modules/services.jsm"); components.utils.
import("resource://gre/modules/fileutils.jsm"); let file = fileutils.getfile("profd", ["my_db_file_name.sqlite"]); let dbconn = services.storage.opendatabase(file); // will also create the file if it does not exist likewise, the c++ would look like this: nscomptr<nsifile> dbfile; rv = ns_getspecialdirectory(ns_app_user_profile_50_dir, ...
... resetting a statement when you execute a statement synchronously, it is
important to make sure you reset your statement.
Using nsIDirectoryService
customizing the locations is
important if, for example, your application already has a profile directory or other resource directories.
...if you are registering it yourself it is very
important to register it immediately after calling ns_initxpcom.
Xptcall Porting Guide
please remember that safety and reliability are more
important than speed optimizations.
...getting these ports done is very
important.
Creating a gloda message query
import gloda gloda's api is exposed in the "gloda" object that is contributed to your namespace.
... you can find the file, which includes doxygen markup of sorts, here: https://hg.mozilla.org/comm-central/file/tip/mailnews/db/gloda/modules/gloda.js components.utils.
import("resource:///modules/gloda/public.js"); create the query let query = gloda.newquery(gloda.noun_message); add constraints to the query each constraint function takes one or more arguments which are "or"ed together.
Mail composition back end
it was
imported from mozilla.org and last updated in 2000.
...an
important item to note is the fact that this interface should also implement the nsimsgcopyservicelistener interface if it wants to be notified of the progress and completion of the copy operation.
Folders and message lists
it's used like this: //
import the fixiterator() function.
... components.utils.
import("resource:///modules/iteratorutils.jsm"); for (let msghdr in fixiterator(myfolder.messages, components.interfaces.nsimsgdbhdr)) { // do something with msghdr...
customDBHeaders Preference
rence outlined in setting up extension development environment, you'll want to add the following preferences: // this allows you to add extra headers while composing messages user_pref("mail.compose.other.header", "x-superfluous,x-other,x-whatever"); // this enables the preservation of custom headers as incoming mail is processed user_pref( "mailnews.customdbheaders", "x-superfluous,x-other");
important: please pay careful attention to the case of the mailnews.customdbheaders preference.
...rvice = components.classes["@mozilla.org/observer-service;1"].getservice(components.interfaces.nsiobserverservice); observerservice.addobserver(createdbobserver, "msgcreatedbview", false); window.document.getelementbyid('foldertree').addeventlistener("select",addcustomcolumnhandler,false); } window.addeventlistener("load",doonceloaded,false); dump(" ~ ~ ~ ~ end superfluous ~ ~ ~ ~ \n");
important be aware that only messages that are added to the .msf database after the customdbheaders pref is set will have the corresponding string property set on the msghdr.
Using the Multiple Accounts API
it was
imported from mozilla.org and last updated in 2003.
...the most
important properties here are the username and the hostname.
Virtualenv
import paths).
... > ls tmp/bin/ activate activate.fish easy_install pip python activate.csh activate_this.py easy_install-2.7 pip-2.7 using this python binary, or these scripts (which point to this python binary), you will correctly install python packages in the lib/python2.x/site-packages directory and they will be appropriately added to your
import path (sys.path) via lib/python2.x/site.py.
WebIDL bindings
for implementations of this method, the
important flags is jsiter_hidden.
... components.utils.
import("resource://gre/modules/xpcomutils.jsm"); function mynumberinner() { this.value = 111; this.invisiblevalue = 12345; } mynumberinner.prototype = { classdescription: "get my number xpcom component", classid: components.id("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"), // dummy uuid contractid: "@mozilla.org/my-number;1", queryinterface: xpcomutils.generateqi([components.interfaces.nsisupp...
Using Objective-C from js-ctypes
#
import <appkit/appkit.h> int main(void) { nsspeechsynthesizer* synth = [[nsspeechsynthesizer alloc] initwithvoice: nil]; [synth startspeakingstring: @"hello, firefox!"]; // wait until start speaking.
... let { ctypes } = components.utils.
import("resource://gre/modules/ctypes.jsm", {}); let id = ctypes.structtype("objc_object").ptr; let sel = ctypes.structtype("objc_selector").ptr; let bool = ctypes.signed_char; let lib = ctypes.open(ctypes.libraryname("objc")); let objc_getclass = lib.declare("objc_getclass", ctypes.default_abi, id, ctypes.char.ptr); let sel_registername = lib.declare("sel_registername...
Memory Management
what won't keep objects alive it's
important to note that getting direct access to the contents of a cdata object using address(), addressofelement(), or contents, will result in a cdata object that does not hold its referent alive.
...this should be obvious, but is
important enough to be worth stating explicitly.
ctypes.open
see: http://stackoverflow.com/questions/19382201/how-to-load-dll-from-sdk-addon-data-folder it is
important to note that custom native files cannot be loaded through chrome:// or resource:// uris.
... if the native file is located at chrome://youraddon/content/mysubfolder/mycfunctionsforunix.so then it is converted to a file uri like this: components.utils.
import("resource://gre/modules/services.jsm"); var cr = components.classes['@mozilla.org/chrome/chrome-registry;1'].getservice(components.interfaces.nsichromeregistry); var chromeuri_mylib = services.io.newuri('chrome://youraddon/content/mysubfolder/mycfunctionsforunix.so', 'utf-8', null); var localfile_mylib = cr.convertchromeurl(chromeuri_mylib); var jarpath_mylib = localfile_mylib.spec; // "jar:file...
js-ctypes reference
it is obtained by by loading the ctypes module: components.utils.
import("resource://gre/modules/ctypes.jsm"); you can use the ctypes object to load libraries, construct types, and perform miscellaneous tasks such as type casting.
... types and data to use js-ctypes effectively, it is
important to understand the different kinds of objects that the module provides.
DOM Inspector internals - Firefox Developer Tools
t/keysetoverlay.xul chrome://inspector/content/viewers/d...setoverlay.xul chrome://inspector/content/statusbaroverlay.xul chrome://global/content/globaloverlay.xul (note that the overlays from the viewer subdirectories—viewers/dom and viewers/stylerules—are loaded as a result of overlay directives in dom inspector's chrome manifest, rather than being explicitly
imported using a xul-overlay processing instruction in the overlaid file.) inspectoroverlay.xul this
imports the scripts the top-level inspector needs, including dependencies.
...for that reason, only those menuitems' ids are referenced here, and the complete definitions are
imported from editingoverlay.xul.
Debugger.Source - Firefox Developer Tools
the url may be passed to the worker web worker constructor, or the web worker
importscripts function.
... "
importscripts", for code by calling
importscripts in a web worker.
Call Tree - Firefox Developer Tools
you can find the specific profile we discuss here - just
import it to the performance tool to follow along.
... in the current version of the call tree, these are the most
important columns.
UI Tour - Firefox Developer Tools
the performance tool's ui consists of 4 main pieces: toolbar recordings pane recording overview details pane, which may contain any one of: waterfall call tree flame chart toolbar the toolbar contains buttons to: start and stop a recording
import a recording you previously saved clear the recordings pane.
... access the settings popup recordings pane the recordings pane lists all the recordings you have loaded, including any you have made in this session and any you have
imported.
CSSStyleDeclaration.getPropertyPriority() - Web APIs
"
important") if one exists.
... example the following javascript code checks whether margin is marked as
important in a css selector rule: var declaration = document.stylesheets[0].cssrules[0].style; var is
important = declaration.getpropertypriority('margin') === '
important'; specifications specification status comment css object model (cssom)the definition of 'cssstyledeclaration.getpropertypriority()' in that specification.
Manipulating video using canvas - Web APIs
the javascript code is
imported from a script named processor.js.
... the for loop that begins on line 6 scans through the frame's pixels, pulling out the red, green, and blue values for each pixel, and compares the values against predetermined numbers that are used to detect the green screen that will be replaced with the still background image
imported from foo.png.
CryptoKey - Web APIs
the cryptokey interface of the web crypto api represents a cryptographic key obtained from one of the subtlecrypto methods generatekey(), derivekey(),
importkey(), or unwrapkey().
...for example: subtlecrypto.generatekey() subtlecrypto.derivekey() subtlecrypto.
importkey() subtlecrypto.exportkey() subtlecrypto.wrapkey() subtlecrypto.unwrapkey() subtlecrypto.encrypt() subtlecrypto.decrypt() subtlecrypto.sign() subtlecrypto.verify() specifications specification status comment web cryptography apithe definition of 'cryptokey' in that specification.
DOMImplementation.createHTMLDocument() - Web APIs
"theframe"); let doc = document.implementation.createhtmldocument("new document"); let p = doc.createelement("p"); p.innerhtml = "this is a new paragraph."; try { doc.body.appendchild(p); } catch(e) { console.log(e); } // copy the new html document into the frame let destdocument = frame.contentdocument; let srcnode = doc.documentelement; let newnode = destdocument.
importnode(srcnode, true); destdocument.replacechild(newnode, destdocument.documentelement); } the code in lines 4–12 handle creating the new html document and inserting some content into it.
...the next two lines handle
importing the contents of our new document into the new document's context.
DedicatedWorkerGlobalScope - Web APIs
workerglobalscope.
importscripts()
imports one or more scripts into the worker's scope.
...for example:
importscripts('foo.js', 'bar.js'); implemented from other places windowbase64.atob() decodes a string of data which has been encoded using base-64 encoding.
Document.cookie - Web APIs
when user privacy is a concern, it's
important that any web app implementation invalidate cookie data after a certain timeout instead of relying on the browser to do it.
...sts (es6)') } example #6: check that a cookie has a specific value //es5 if (document.cookie.split(';').some(function(item) { return item.indexof('reader=1') >= 0 })) { console.log('the cookie "reader" has "1" for value') } //es2016 if (document.cookie.split(';').some((item) => item.includes('reader=1'))) { console.log('the cookie "reader" has "1" for value') } security it is
important to note that the path attribute does not protect against unauthorized reading of the cookie from a different path.
Introduction to the DOM - Web APIs
though we focus exclusively on javascript in this reference documentation, implementations of the dom can be built 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.
...however, you design your test pages, testing the interfaces as you read about them is an
important part of learning how to use the dom effectively.
FetchEvent.respondWith() - Web APIs
this means, for example, if a service worker intercepts a stylesheet or worker script, then the provided response.url will be used to resolve any relative @
import or
importscripts() subresource loads (bug 1222008).
... if a stylesheet is intercepted, then the final url is used as the base url for resolving relative @
import loads.
HTMLImageElement.alt - Web APIs
perhaps the most
important reason to use the alt tag is to support accessibility, as the alt text may be used by screen readers and other assistive technologies to help differently-abled users make full use of your content.
...if the image doesn't require a fallback (such as for an image which is simply decorative or an advisory icon of minimal
importance), you may specify an empty string ("").
Using microtasks in JavaScript with queueMicrotask() - Web APIs
using microtasks before getting farther into this, it's
important to note again that most developers won't use microtasks much, if at all.
...the
important thing to take away from this one is that the microtask isn't processed when the function exits, but when the main program exits.
Recommended Drag Types - Web APIs
it is
important to set the data in the right order, from most-specific to least-specific.
...as some contexts may only include some of these types, it is
important to check which type is made available when receiving dropped images.
Timing element visibility with the Intersection Observer API - Web APIs
the sidebar is represented using an <aside> element, and is styled as follows: aside { grid-column: 1; grid-row: 2; background-color: cornsilk; padding: 5px 10px; } aside ul { padding-left: 0; } aside ul li { list-style: none; } aside ul li a { text-decoration: none; } the most
important thing to note here is that the grid-column is set to 1, to place the sidebar on the left-hand side of the screen.
...the most
important scenario here is when the user switches tabs.
Intersection Observer API - Web APIs
0.9, 1.0], [0, 0.25, 0.5, 0.75, 1.0] ]; for (let i=0; i<=1.0; i+= 0.01) { thresholdsets[0].push(i); } // add each box, creating a new observer for each for (let i=0; i<4; i++) { let template = document.queryselector("#boxtemplate").content.clonenode(true); let boxid = "box" + (i+1); template.queryselector(".samplebox").id = boxid; wrapper.appendchild(document.
importnode(template, true)); // set up the observer for this box observeroptions.threshold = thresholdsets[i]; observers[i] = new intersectionobserver(intersectioncallback, observeroptions); observers[i].observe(document.queryselector("#" + boxid)); } // scroll to the starting position document.scrollingelement.scrolltop = wrapper.firstelementchild.getboundingclientrect().top +...
... <div id="box"> <div class="vertical"> welcome to <strong>the box!</strong> </div> </div> css the css isn't terribly
important for the purposes of this example; it lays out the element and establishes that the background-color and border attributes can participate in css transitions, which we'll use to affect the changes to the element as it becomes more or less obscured.
Node.textContent - Web APIs
note: textcontent and htmlelement.innertext are easily confused, but the two properties are different in
important ways.
...although the names seem similar, there are
important differences: textcontent gets the content of all elements, including <script> and <style> elements.
SharedWorkerGlobalScope - Web APIs
workerglobalscope.
importscripts()
imports one or more scripts into the worker's scope.
...for example:
importscripts('foo.js', 'bar.js'); implemented from other places windowbase64.atob() decodes a string of data which has been encoded using base-64 encoding.
Streams API concepts - Web APIs
important: byte streams are not implemented anywhere as yet, and questions have been raised as to whether the spec details are in a finished enough state for them to be implemented.
... backpressure an
important concept in streams is backpressure — this is the process by which a single stream or a pipe chain regulates the speed of reading/writing.
SubtleCrypto.deriveKey() - Web APIs
otherwise it will be the initial key material for the derivation function: for example, for pbkdf2 it might be a password,
imported as a cryptokey using subtlecrypto.
importkey().
...*/ function getkeymaterial() { let password = window.prompt("enter your password"); let enc = new textencoder(); return window.crypto.subtle.
importkey( "raw", enc.encode(password), "pbkdf2", false, ["derivebits", "derivekey"] ); } async function encrypt(plaintext, salt, iv) { let keymaterial = await getkeymaterial(); let key = await window.crypto.subtle.derivekey( { "name": "pbkdf2", salt: salt, "iterations": 100000, "hash": "sha-256" }, keymaterial, { "name": "aes-gcm", "len...
SubtleCrypto.exportKey() - Web APIs
keys can be exported in several formats: see supported formats in the subtlecrypto.
importkey() page for details.
...// consider using a 4096-bit key for systems that require long-term security moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]), hash: "sha-256", }, true, ["encrypt", "decrypt"] ).then((keypair) => { const exportbutton = document.queryselector(".spki"); exportbutton.addeventlistener("click", () => { exportcryptokey(keypair.publickey); }); }); json web key
import this code exports an ecdsa private signing key as a json web key object.
SubtleCrypto.sign() - Web APIs
the choice of digest algorithm is passed into the generatekey() or
importkey() functions.
... the digest algorithm to use is specified in the hmackeygenparams object that you pass into generatekey(), or the hmac
importparams object that you pass into
importkey().
Matrix math for the web - Web APIs
ult2[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 equivalent to somematrix let somematrixresult = multiplymatrices(identitymatrix, somematrix);
important: these matrix functions are written for clarity of explanation, not for speed or memory management.
... 1.25), // step 6: scale back up translate(0, -200, 0), // step 5: move back up rotatearoundzaxis(-math.pi * 0.5), // step 4: rotate back rotatearoundzaxis(math.pi * 0.5), // step 3: rotate around 90 degrees translate(0, 200, 0), // step 2: move down 100 pixels scale(0.8, 0.8, 0.8), // step 1: scale down ]); why matrices are
important matrices are
important because they comprise a small set of numbers that can describe a wide range of transformations in space.
WebGL model view projection - Web APIs
the result should be identical to the last example: cubedemo.prototype.computesimpleprojectionmatrix = function(scalefactor) { this.transforms.projection = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, scalefactor, 0, 0, 0, scalefactor ]; }; although the result is identical, the
important step here is in the vertex shader.
...if you want to read a full explanation of the math behind it check out some of the following links: opengl projection matrix perspective projection trying to understand the math behind the perspective projection matrix in webgl one
important thing to note about the perspective projection matrix used below is that it flips the z axis.
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
keeping latency to a minimum is especially
important for webrtc, since face-to-face communication needs to be performed with as little latency as possible.
... rtp supports multicast; while this isn't yet
important for webrtc, it's likely to matter in the future, when webrtc is (hopefully) enhanced to support multi-user conversations.
Web Video Text Tracks Format (WebVTT) - Web APIs
we can also place comments in our .vtt file, to help us remember
important information about the parts of our file.
... it is
important to not use "extra" blank lines within a cue, for example between the timings line and the cue payload.
Using bounded reference spaces - Web APIs
<<<--- example --->>> creating a bounded reference space before creating a project that relies on bounded reference spaces, it's
important to keep in mind that not all xr devices are capable of creating them.
... it's
important, however, to keep in mind that while a local-floor space provides a floor-relative space and is always available for immersive sessions, it also has significant differences from bounded-floor, so you need to be prepared to handle these differences.
Rendering and the WebXR frame animation callback - Web APIs
this is
important because as the computer becomes increasingly busy, it may not be able to accurately call your callback every frame and may have to skip frames.
... drawbacks to this approach since it's
important to minimize how much time you spend in this function as much as possible, the more time you spend handling state changes, the less time you have to actually draw things.
Starting up and shutting down a WebXR session - Web APIs
important: you should always test your code on actual ar and/or vr hardware before releasing or shipping a product!
...
important session maintenance events over the course of your webxr session, you may receive any of a number of events which indicate changes to the state of the session, or which let you know about things you need to do to keep the session operating properly.
ARIA: alert role - Accessibility
description one of the five live region roles, the alert role is used to provide the user with
important, and usually time-sensitive, information, and often to tell the user an element has been dynamically updated.
... the most
important thing to know about the alert role is that it is for dynamic content.
ARIA: Region role - Accessibility
screen readers use landmark roles to provide keyboard navigation to
important sections of a page.
... the region role should be reserved for sections of content sufficiently
important that users will likely want to navigate to the section easily and to have it listed in a summary of the page.
Web accessibility for seizures and physical reactions - Accessibility
the point is, seizures most definitely can be and are fatal, and developers and designers are incredibly
important to making the web a safer place for those with sensitivities to photosensitive or musicogenic triggers.
... @media screen and (prefers-reduced-motion: reduce), (update: slow) { * { animation-duration: 0.001ms !
important; animation-iteration-count: 1 !
important; /* hat tip nick/cssremedy (https://css-tricks.com/revisiting-prefers-reduced-motion-the-reduced-motion-media-query/#comment-1700170) */ transition-duration: 0.001ms !
important; } } from w3.org's page on media queries 4: the update media feature is used to query the ability of the output device to modify the appearance of content once it has ...
@keyframes - CSS: Cascading Style Sheets
!
important in a keyframe declarations in a keyframe qualified with !
important are ignored.
... @keyframes
important1 { from { margin-top: 50px; } 50% { margin-top: 150px !
important; } /* ignored */ to { margin-top: 100px; } } @keyframes
important2 { from { margin-top: 50px; margin-bottom: 100px; } to { margin-top: 150px !
important; /* ignored */ margin-bottom: 50px; } } formal syntax @keyframes <keyframes-name> { <keyframe-block-list> }where <keyframes-name> = <custom-ident> | <string><keyframe-block-list> = <keyframe-block>+where <keyframe-block> = <keyframe-selector># { <declaration-list> }where <keyframe-selector> = from | to | <percentage> examples css animation examples see using css animations for examples.
Basic concepts of flexbox - CSS: Cascading Style Sheets
understanding which axis is which is
important when we start to look at aligning and justifying flex items; flexbox features properties that align and justify content along one axis or the other.
...this concept of available space is also
important when we come to look at aligning items.
Consistent list indentation - CSS: Cascading Style Sheets
in order to understand why this is the case, and more
importantly how to avoid the problem altogether, it's necessary to examine the details of list construction.
... visually, the markers are outside the content area of the <ul>, but that's not the
important part here.
The stacking context - CSS: Cascading Style Sheets
importantly, the z-index values of its child stacking contexts only have meaning in this parent.
...the hierarchy of stacking contexts is organized as follows: root div #1 div #2 div #3 div #4 div #5 div #6 it is
important to note that div #4, div #5 and div #6 are children of div #3, so stacking of those elements is completely resolved within div#3.
Media queries - CSS: Cascading Style Sheets
use @
import to conditionally apply an entire style sheet.
... reference at-rules @
import @media guides using media queries introduces media queries, their syntax, and the operators and media features which are used to construct media query expressions.
CSS reference - CSS: Cascading Style Sheets
ggapgrad<gradient>grayscale()gridgrid-areagrid-auto-columnsgrid-auto-flowgrid-auto-rowsgrid-columngrid-column-endgrid-column-startgrid-rowgrid-row-endgrid-row-startgrid-templategrid-template-areasgrid-template-columnsgrid-template-rowshhzhanging-punctuationheightheight (@viewport)@historical-forms:hoverhsl()hsla()hue-rotate()hyphensi<ident><image>image()image-orientationimage-renderingimage-set()@
importin:in-range:indeterminateinheritinitialinline-sizeinsetinset()inset-blockinset-block-endinset-block-startinset-inlineinset-inline-endinset-inline-start<integer>:invalidinvert()isolationjjustify-contentjustify-itemsjustify-selfkkhz@keyframesl:lang:last-child:last-of-typeleader():leftleft@left-bottom<length><length-percentage>letter-spacingline-breakline-heightlinear-gradient():linklist-stylelist-st...
...ting context box model containing block layout mode margin collapsing replaced elements stacking context visual formatting model dom-css / cssom major object types documentorshadowroot.stylesheets stylesheets[i].cssrules cssrules[i].csstext (selector & style) cssrules[i].selectortext htmlelement.style htmlelement.style.csstext (just style) element.classname element.classlist
important methods cssstylesheet.insertrule() cssstylesheet.deleterule() ...
animation - CSS: Cascading Style Sheets
e occurrences of the following values: <single-transition-timing-function> <single-animation-iteration-count> <single-animation-direction> <single-animation-fill-mode> <single-animation-play-state> an optional name for the animation, which may be none, a <custom-ident>, or a <string> zero, one, or two <time> values the order of values within each animation definition is
important: the first value that can be parsed as a <time> is assigned to the animation-duration, and the second one is assigned to animation-delay.
... the order within each animation definition is also
important for distinguishing animation-name values from other keywords.
cross-fade() - CSS: Cascading Style Sheets
syntax
important: the specification and current implementations have different syntaxes.
...this is
important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users.
will-change - CSS: Cascading Style Sheets
important: will-change is intended to be used as a last resort, in order to try to deal with existing performance problems.
...so it is
important to give the browser some time to actually do the optimizations.
Creating a cross-browser video player - Developer guides
this list is inserted after the <video> element, but inside the <figure> element (this is
important for the fullscreen functionality, which is explained later on).
...the custom controls will only appear on this browser in fullscreen mode with some webkit specific css: the default browser controls have to be hidden with video::-webkit-media-controls { display:none !
important; } the custom controls container needs to have a special z-index value: .controls { z-index:2147483647; } dealing with webkit-specific code in this way will affect all webkit browsers, but everything works as expected in more advanced webkit browsers such as chrome and the latest opera.
Challenge solutions - Developer guides
solution the following rule puts borders around only <td> elements that are inside the <tbody> element of the table with id=demo-table: #demo-table tbody td { border:1px solid #7a7; } media separate print style file challenge move the print-specific style rules to a separate css file and
import them into your style4.css stylesheet.
...in style4.css, add the following line at the beginning of the file: @
import url("style4_print.css") print; heading hover color challenge make the headings turn blue when the mouse pointer is over them.
Using HTML sections and outlines - Developer guides
important: there are no implementations of the proposed outline algorithm in web browsers nor assistive technology; it was never part of a final w3c specification.
...it is
important for developers to use these semantic elements in line with their intended purposes.
Optimization and performance - Developer guides
when building modern web apps and sites, it's
important to make your content perform well.
...making web performance a priority by considering web performance throughout the development process is
important in ensuring users get the best user experience possible.
Writing forward-compatible websites - Developer guides
this is especially
important for intranets and other non-public websites; if we can't see your code, we can't see that it broke.
... a good example, for a browser vendor using the -vnd css prefix that has shipped an unprefixed implementation of the make-it-pretty property, with a behavior for the value "sometimes" that differs from the prefixed version: <style> .pretty-element { -vnd-make-it-pretty: sometimes; make-it-pretty: sometimes; } </style> the order of the declarations in the rule above is
important: the unprefixed one needs to come last.
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
if automatic captioning services are used, it is
important to review the generated content to ensure it accurately represents the source audio.
... in addition to spoken dialog, subtitles and transcripts should also identify music and sound effects that communicate
important information.
<input type="tel"> - HTML: Hypertext Markup Language
this can be especially
important if the page design doesn't offer descriptive labels for each <input>.
...
important: html form validation is not a substitute for server-side scripts that ensure the entered data is in the proper format before it is allowed into the database.
<video>: The Video Embed element - HTML: Hypertext Markup Language
if automatic captioning services are used, it is
important to review the generated content to ensure it accurately represents the source video.
... in addition to spoken dialog, subtitles and transcripts should also identify music and sound effects that communicate
important information.
HTML: Hypertext Markup Language
introduction to html this module sets the stage, getting you used to
important concepts and syntax such as looking at applying html to text, how to create hyperlinks, and how to use html to structure a web page.
... html forms forms are a very
important part of the web — these provide much of the functionality you need for interacting with websites, e.g.
Common MIME types - HTTP
two primary mime types are
important for the role of default types: text/plain is the default value for textual files.
...this table lists some
important mime types for the web: extension kind of document mime type .aac aac audio audio/aac .abw abiword document application/x-abiword .arc archive document (multiple files embedded) application/x-freearc .avi avi: audio video interleave video/x-msvideo .azw amazon kindle ebook format application/vnd.amaz...
HTTP Public Key Pinning (HPKP) - HTTP
this means that for users who
imported custom root certificates all pinning violations are ignored.
...this is
important for example when the former key gets compromised.
Control flow and error handling - JavaScript
important: javascript before ecmascript2015 (6th edition) does not have block scope!
... it is also
important to note that the finally block will execute whether or not an exception is thrown.
Using Promises - JavaScript
you might see this expressed with arrow functions instead: dosomething() .then(result => dosomethingelse(result)) .then(newresult => dothirdthing(newresult)) .then(finalresult => { console.log(`got the final result: ${finalresult}`); }) .catch(failurecallback);
important: always return results, otherwise callbacks won't catch the result of a previous promise (with arrow functions () => x is short for () => { return x; }).
...
importantly, if dosomethingcritical() fails, its error is caught by the final (outer) catch only.
TypeError: "x" is not a function - JavaScript
using the latter will throw an error: const sixteen = 2(3 + 5); alert('2 x (3 + 5) is ' + string(sixteen)); //uncaught typeerror: 2 is not a function you can correct the code by adding a * operator: const sixteen = 2 * (3 + 5); alert('2 x (3 + 5) is ' + string(sixteen)); //2 x (3 + 5) is 16
import the exported module correctly ensure you are
importing the module correctly.
... an example helpers library (helpers.js) let helpers = function () { }; helpers.groupby = function (objectarray, property) { return objectarray.reduce(function (acc, obj) { var key = obj[property]; if (!acc[key]) { acc[key] = []; } acc[key].push(obj); return acc; }, {}); } export default helpers; the correct
import usage (app.js):
import helpers from './helpers' ...
Map - JavaScript
however, there are
important differences that make map preferable in certain cases: map object accidental keys a map does not contain any keys by default.
...g([...mymap]) // or use the keys() or values() iterators, and convert them to an array console.log(array.from(mymap.keys())) // ["key1", "key2"] cloning and merging maps just like arrays, maps can be cloned: let original = new map([ [1, 'one'] ]) let clone = new map(original) console.log(clone.get(1)) // one console.log(original === clone) // false (useful for shallow comparison)
important: keep in mind that the data itself is not cloned.
WebAssembly.Instance.prototype.exports - JavaScript
instance.exports examples using exports after fetching some webassembly bytecode using fetch, we compile and instantiate the module using the webassembly.instantiatestreaming() function,
importing a javascript function into the webassembly module in the process.
... var
importobject = {
imports: {
imported_func: function(arg) { console.log(arg); } } }; webassembly.instantiatestreaming(fetch('simple.wasm'),
importobject) .then(obj => obj.instance.exports.exported_func()); note: you can also find this example as instantiate-streaming.html on github (view it live also).
WebAssembly.Instance - JavaScript
examples synchronously instantiating a webassembly module the webassembly.instance() constructor function can be called to synchronously instantiate a given webassembly.module object, for example: const
importobject = {
imports: {
imported_func: function(arg) { console.log(arg); } } }; fetch('simple.wasm').then(response => response.arraybuffer() ).then(bytes => { let mod = new webassembly.module(bytes); let instance = new webassembly.instance(mod,
importobject); instance.exports.exported_func(); }) the preferred way to get an instance is asynchronously, for example using the...
... webassembly.instantiatestreaming() function like this: const
importobject = {
imports: {
imported_func: function(arg) { console.log(arg); } } }; webassembly.instantiatestreaming(fetch('simple.wasm'),
importobject) .then(obj => obj.instance.exports.exported_func()); this also demonstrates how the exports property is used to access exported functions.
WebAssembly.Module() constructor - JavaScript
syntax
important: since compilation for large modules can be expensive, developers should only use the module() constructor when synchronous compilation is absolutely required; the asynchronous webassembly.compilestreaming() method should be used at all other times.
... examples synchronously compiling a webassembly module var
importobject = {
imports: {
imported_func: function(arg) { console.log(arg); } } }; function createwasmmodule(bytes) { return new webassembly.module(bytes); } fetch('simple.wasm').then(response => response.arraybuffer() ).then(bytes => { let mod = createwasmmodule(bytes); webassembly.instantiate(mod,
importobject) .then(result => result.exports.exported_func() ); }) specifications specification webassembly javascript interfacethe definition of 'webassembly.module()' in that specification.
WebAssembly.Module.exports() - JavaScript
var worker = new worker("wasm_worker.js"); webassembly.compilestreaming(fetch('simple.wasm')) .then(mod => worker.postmessage(mod) ); in the worker (see wasm_worker.js) we define an
import object for the module to use, then set up an event handler to receive the module from the main thread.
... var
importobject = {
imports: {
imported_func: function(arg) { console.log(arg); } } }; onmessage = function(e) { console.log('module received from main thread'); var mod = e.data; webassembly.instantiate(mod,
importobject).then(function(instance) { instance.exports.exported_func(); }); var exports = webassembly.module.exports(mod); console.log(exports[0]); }; the exports[0] output looks like this: { name: "exported_func", kind: "function" } specifications specification webassem...
WebAssembly.Table.prototype.set() - JavaScript
var tbl = new webassembly.table({initial:2, element:"anyfunc"}); console.log(tbl.length); console.log(tbl.get(0)); console.log(tbl.get(1)); we then create an
import object that contains a reference to the table: var
importobj = { js: { tbl:tbl } }; finally, we load and instantiate a wasm module (table2.wasm) using the webassembly.instantiatestreaming(), log the table length, and invoke the two referenced functions that are now stored in the table (the table2.wasm module (see text representation) adds two function references to the table, both of wh...
...ich print out a simple value): webassembly.instantiatestreaming(fetch('table2.wasm'),
importobject) .then(function(obj) { console.log(tbl.length); console.log(tbl.get(0)()); console.log(tbl.get(1)()); }); note how you've got to include a second function invocation operator at the end of the accessor to actually invoke the referenced function and log the value stored inside it (e.g.
WebAssembly - JavaScript
webassembly.global() represents a global variable instance, accessible from both javascript and
importable/exportable across one or more webassembly.module instances.
... var
importobject = {
imports: {
imported_func: arg => console.log(arg) } }; webassembly.instantiatestreaming(fetch('simple.wasm'),
importobject) .then(obj => obj.instance.exports.exported_func()); the resultobject's instance member is then accessed, and the contained exported function invoked.
for...in - JavaScript
array iteration and for...in note: for...in should not be used to iterate over an array where the index order is
important.
...therefore, it is better to use a for loop with a numeric index (or array.prototype.foreach() or the for...of loop) when iterating over arrays where the order of access is
important.
JavaScript
introducing javascript objects the object-oriented nature of javascript is
important to understand if you want to go further with your knowledge of the language and write more efficient code, therefore we've provided this module to help you.
... asynchronous javascript discusses asynchronous javascript, why it is
important, and how it can be used to effectively handle potential blocking operations such as fetching resources from a server.
Authoring MathML - MathML
as a consequence, good mathml authoring tools are more
important and we describe some tools below.
... note that ua string sniffing is not the most reliable method and might break from version to version: var ua = navigator.useragent; var isgecko = ua.indexof("gecko") > -1 && ua.indexof("khtml") === -1 && ua.indexof('trident') === -1; var iswebkit = ua.indexof('applewebkit') > -1 && ua.indexof('chrome') === -1; mathematical fonts in order to get a good layout or to allow different style, it's
important to have mathematical fonts available.
Autoplay guide for media and Web Audio APIs - Web media technologies
example: the autoplay attribute an <audio> element using the autoplay attribute might look like this: <audio id="musicplayer" autoplay> <source src="/music/chapter1.mp4"> </audio> example 2: detecting autoplay failure if you rely on autoplay for anything
important, or if autoplay failure will impact your app in any way, you will probably want to be able to tell when it autoplay didn't begin.
...here, any such preferences that may be of special significance or
importance to you as a web developer are listed.
Animation performance and frame rate - Web Performance
while it is not always possible to maintain 60fps, it is
important to maintain a high and steady frame rate for all animations.
...compared with the version that uses margin, we're not spending any time time in layout or (more
importantly in this case) in paint: in this case, using transform significantly improved the site's performance, and the performance tools were able to show how and why it did.
Populating the page: how browsers work - Web Performance
this is why it's
important for web performance optimization to include everything the browser needs to start rendering a page, or at least a template of the page - the css and html needed for the first render -- in the first 14 kilobytes.
...to ensure the script doesn't block the process, add the async attribute, or the defer attribute if javascript parsing and execution order is not
important.
Navigation and resource timings - Web Performance
with the metrics above, and a little bit of math, we can calculate many
important metrics like time to first byte, page load time, dns lookup, and whether the connection is secure.
...checking compression ratios is
important but ensure to also check duration and the time between when the domcontentloaded event ended and when the dom is complete, as running javascript on the main thread for long periods of time can lead to a non-responsive user interface.
Performance Monitoring: RUM vs synthetic monitoring - Web Performance
synthetic monitoring can be an
important component of regression testing and production site monitoring.
...this is particularly
important for large sites or complex apps, where the functionality or content is constantly changing, and where the population accessing the application may differ greatly in life experiences from those creating it.
Add to Home screen - Progressive web apps (PWAs)
you'll see fox pictures, but more
important, you'll see a "home" icon with a plus (+) icon inside it — this is the "add to home screen" icon displayed for any site that has the necessary features in place.
... icons: specifies icons for the browser to use when representing the app in different places (such as on the task switcher, or more
important, the home screen).
Media - Progressive web apps (PWAs)
in css, you can use @
import at the start of a stylesheet to
import another stylesheet from a url, optionally specifying the media type.
... read the @
import reference page to find details of how to
import the new print-specific css file into your style4.css stylesheet.
SVG fonts - SVG: Scalable Vector Graphics
in the example above the first and most
important to be defined is font-family, the value of which can then be referenced in css and svg font-family properties.
...the most
important attribute is unicode.
Transport Layer Security - Web security
https remains an
important use case for tls.
... a tls connection starts with a handshake phase where a client and server agree on a shared secret and
important parameters, like cipher suites, are negotiated.
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
use the {{listsubpages}} macro once the bcd for <xsl:fallback>, <xsl:
import>, <xsl:namespace-alias>, <xsl:number>, <xsl:output>, <xsl:stylesheet>, <xsl:text> and <xsl:value-of> is fully migrated.
... <xsl:apply-
imports><xsl:apply-templates><xsl:attribute-set><xsl:attribute><xsl:call-template><xsl:choose><xsl:comment><xsl:copy-of><xsl:copy><xsl:decimal-format><xsl:element><xsl:fallback><xsl:for-each><xsl:if><xsl:
import><xsl:include><xsl:key><xsl:message><xsl:namespace-alias><xsl:number><xsl:otherwise><xsl:output><xsl:param><xsl:preserve-space><xsl:processing-instruction><xsl:sort><xsl:strip-space><xsl:stylesheet><xsl:template><xsl:text><xsl:transform><xsl:value-of><xsl:variable><xsl:when><xsl:with-param> <xsl:apply-
imports> <xsl:apply-templates> <xsl:attribute> <xsl:attribute-set> <xsl:call-template> <xsl:choose> <xsl:comment> <xsl:copy> <xsl:copy-of> <xsl:decimal-format> <xsl:element> <xsl:fallback> (not supported) <xsl:for-each> <xsl:if> <xsl:
import> (mostly supported) <x...
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
<div>8</div> <div>9</div> <div>10</div> </div> // javascript var xslref; var xslloaded = false; var xsltprocessor = new xsltprocessor(); var mydom; var xmlref = document.implementation.createdocument("", "", null); function sort() { if (!xslloaded){ p = new xmlhttprequest(); p.open("get", "example2.xsl", false); p.send(null); xslref = p.responsexml; xsltprocessor.
importstylesheet(xslref); xslloaded = true; } // create a new xml document in memory xmlref = document.implementation.createdocument("", "", null); // we want to move a part of the dom from an html document to an xml document.
... //
importnode is used to clone the nodes we want to process via xslt - true makes it do a deep clone var mynode = document.getelementbyid("example"); var clonednode = xmlref.
importnode(mynode, true); // after cloning, we append xmlref.appendchild(clonednode); // set the sorting parameter in the xsl file var sortval = xsltprocessor.getparameter(null, "myorder"); if (sortval == "" || sortval == "descending") xsltprocessor.setparameter(null, "myorder", "ascending"); else xsltprocessor.setparameter(null, "myorder", "descending"); // initiate the transformation var fragment = xsltprocessor.transformtofragment(xmlref, document); // clear the contents document.getelementbyid("example").innerhtml = ""; mydom = fragment; // add the new content from the transfo...
Basic Example - XSLT: Extensible Stylesheet Language Transformations
the .xsl file is then
imported (xsltprocessor.
importstylesheet(xslstylesheet)) and the transformation run (xsltprocessor.transformtofragment(xmldoc, document)).
... figure 6 : example var xslstylesheet; var xsltprocessor = new xsltprocessor(); var mydom; var xmldoc; function init(){ // load the xslt file, example1.xsl var myxmlhttprequest = new xmlhttprequest(); myxmlhttprequest.open("get", "example1.xsl", false); myxmlhttprequest.send(null); xslstylesheet = myxmlhttprequest.responsexml; xsltprocessor.
importstylesheet(xslstylesheet); // load the xml file, example1.xml myxmlhttprequest = new xmlhttprequest(); myxmlhttprequest.open("get", "example1.xml", false); myxmlhttprequest.send(null); xmldoc = myxmlhttprequest.responsexml; var fragment = xsltprocessor.transformtofragment(xmldoc, document); document.getelementbyid("example").innerhtml = ""; mydom = fragment; document.getele...
Converting WebAssembly text format to wasm - WebAssembly
a first look at the text format let’s look at a simple example of this — the following program
imports a function called
imported_func from a module called
imports, and exports a function called exported_func: (module (func $i (
import "
imports" "
imported_func") (param i32)) (func (export "exported_func") i32.const 42 call $i ) ) the webassembly function exported_func is exported for use in our environment (e.g.
...when it is called, it calls an
imported javascript function called
imported_func, which is run with the value (42) provided as a parameter.
Content Scripts - Archive of obsolete content
event listeners you can listen for dom events in a content script just as you can in a normal page script, but there are two
important differences: first, if you define an event listener by passing it as a string into setattribute(), then the listener is evaluated in the page's context, so it will not have access to any variables defined in the content script.
Contributor's Guide - Archive of obsolete content
unfortunately, javascript does not yet have native support for modules: it has to rely on the host application to provide it with functionality such as loading subscripts, and exporting/
importing names.
lang/functional - Archive of obsolete content
let { once } = require("sdk/lang/functional"); let setup = once(function (env) { // initializing
important things console.log("successfully initialized " + env); return 1; // assume success and return 1 }); setup('dev'); // returns 1 // prints "successfully initialized dev" // future attempts to call this function just return the cached // value that was returned previously setup('production'); // returns 1 // no print message is displayed since the function isn't executed parameters fn : f...
system/child_process - Archive of obsolete content
const { emit } = require('sdk/event/core'); const { spawn } = require('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 { require } = cu.
import(commonjs_uri + '/toolkit/require.js', {}); var child_process = require('sdk/system/child_process'); // use it in the same way as in the example above ...
cfx to jpm - Archive of obsolete content
requiring modules from test code similarly, suppose you've written some tests for your add-on: my-addon lib my-addon.js test test-my-addon-js with cfx, code inside "test-my-addon.js" can
import "my-addon.js" using a statement like this: var my_addon = require("my-addon"); // this will not work with jpm!
Chrome Authority - Archive of obsolete content
for example, none of the following code will be matched by the manifest scanner, leading to exceptions at runtime, when the require() call is prohibited from
importing the named modules: // all of these will fail!
Using XPCOM without chrome - Archive of obsolete content
// this removes the need to
import ci and the xpcomutils const { class } = require("sdk/core/heritage"); const { unknown } = require('sdk/platform/xpcom'); const { placesutils } = require("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, parenti...
Add-on SDK - Archive of obsolete content
guides contributor's guide 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.
JS XPCOM - Archive of obsolete content
components.utils.
import("resource://gre/modules/services.jsm"); components.utils.
import("resource://gre/modules/xpcomutils.jsm"); const cc = components.classes; const ci = components.interfaces; function abouthandler() {} abouthandler.prototype = { newchannel: function(uri) { var channel = services.io.newchannel("chrome://mystuff/content/mystuff.xul", null, null); channel.originaluri = uri; ...
View Source for XUL Applications - Archive of obsolete content
importing gviewsourceutils xul applications wanting to show the source code for documents should
import the viewsourceutils.js script instead of attempting to open the viewsource.xul window themselves: <script type="application/javascript" src="chrome://global/content/viewsourceutils.js"/> viewsourceutils.js exposes a gviewsourceutils global into the scope of the window that
imports that script.
Windows - Archive of obsolete content
similarly, you can get the current inner window id using the nsidomwindowutils attribute currentinnerwindowid: var util = win.queryinterface(components.interfaces.nsiinterfacerequestor).getinterface(components.interfaces.nsidomwindowutils); var windowid = util.currentinnerwindowid; programatically modifying html when attempting to modify html elements, it is
important to specify the namespace.
Extension Etiquette - Archive of obsolete content
xpcom contract ids, for instance, should always begin with an @, followed by a domain name that the author controls, e.g., "@example.com/foo/bar;1" it is
important that the prefix that you use be unlikely to conflict with other code, and that it be indicative of the name of your add-on.
Install Manifests - Archive of obsolete content
if a value for the application's os is encountered that requires any specific abi, the abi is considered
important for that os and the application will refuse to install the add-on if it does not find a matching os/abi combination.
Me - Archive of obsolete content
the namespace currently lives in the future and must be
imported before it is used: jetpack.future.
import("me"); methods onfirstrun(funcfunction)jetpack.me.onfirstrun() allows jetpacks to be notified after they are successfully installed.
Jetpack Snippets - Archive of obsolete content
using firebug lite in a slidebar jetpack.future.
import("slidebar");jetpack.slidebar.append({ html: <html><head></head><body> <p>some slidbar you want to debug</p> <a href="javascript:console.log('hello!')">test</a> <script><![cdata[ //firebug lite bookmarklet code: var firebug=document.createelement('script'); firebug.setattribute('src','http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'); ...
slideBar - Archive of obsolete content
about status: in development instantiation: jetpack.future.
import('slidebar') last update: v0.6 summary: slidebar is a reinvention of the old sidebar feature of browsers.
slideBar - Archive of obsolete content
jetpack.future.
import("slidebar"); methods append(iconurihtmlhtml/xmlurluriwidthintpersistboolautoreloadboolonclickfunctiononselectfunctiononreadyfunction)this is a list of options to specify modifications to your slidebar instance.
Mozilla Crypto FAQ - Archive of obsolete content
the questions in this faq address mozilla's support for encryption and related security functionality, information
important to mozilla contributors relating to encryption functionality in mozilla, and general questions on u.s.
Plug-n-Hack - Archive of obsolete content
for example, to configure a browser to use an intercepting proxy that can handle https traffic, the user must typically: configure their browser to proxy via the tool configure the tool to proxy via their corporate proxy
import the tool’s ssl certificate into their browser if any of these steps are carried out incorrectly then the browser will typically fail to connect to any website – debugging such problems can be frustrating and time-consuming.
Space Manager High Level Design - Archive of obsolete content
the classes that are considered part of the space manager are: nsspacemanager nsbanddata nsblockbanddata bandrect / bandlist (private structs) frameinfo (private struct) nsbandtrapezoid outside of the space manager itself, the clients of the space manager also play an
important part in the management of he available and used space.
Install script template - Archive of obsolete content
// this block also invokes a function to write registry keys (plid) and checks return from key writing // this block invokes refreshplugins() to ensure that plugin and xpt are available for use immediately if (errblock1 == success) { // installation to the current browser was a success - this is the most
important job of this script!
Working With Directories - Archive of obsolete content
file and stream guide: [ 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 guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
Getting File Information - Archive of obsolete content
file and stream guide: [ 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 guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
Uploading and Downloading Files - Archive of obsolete content
file and stream guide: [ 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 guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
Writing to Files - Archive of obsolete content
file and stream guide: [ 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 guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
IO - Archive of obsolete content
file and stream guide: [ 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 guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
TOC - Archive of obsolete content
file and stream guide: [ 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 guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
List of commands - Archive of obsolete content
:addgroupmarkas browser:back browser:editpage browser:find browser:findagain browser:findprev browser:forward browser:home browser:managebookmark browser:open browser:openfile browser:print browser:printpreview browser:savepage browser:searchinternet browser:sendpage browser:uploadfile cmd_bm_copy cmd_bm_cut cmd_bm_delete cmd_bm_expandfolder cmd_bm_export cmd_bm_find cmd_bm_
import cmd_bm_managefolder cmd_bm_movebookmark cmd_bm_newbookmark cmd_bm_newfolder cmd_bm_newseparator cmd_bm_open cmd_bm_openinnewtab cmd_bm_openinnewwindow cmd_bm_paste cmd_bm_properties cmd_bm_rename cmd_bm_selectall cmd_bm_setnewbookmarkfolder cmd_bm_setnewsearchfolder cmd_bm_setpersonaltoolbarfolder cmd_bm_sortfolder cmd_bm_sortfolderbyname cmd_close cmd_closeothertabs cmd_close...
Namespaces - Archive of obsolete content
it holds and allows disambiguation of items having the same name." if you are familiar with c++ namespaces, java packages, perl packages, or python module
importing, you are already familiar with the namespace concept.
MenuItems - Archive of obsolete content
hence, -moz-image-region is not applied to the menu itself, but one level lower: <menuitem id="add-bookmark" class="menuitem-iconic" label="add bookmark" image="addbookmark.png"/> #add-bookmark { list-style-image: url('addbookmark.png'); } #add-bookmark .menu-iconic-icon { -moz-image-region: rect(0px, 16px, 16px, 0px) !
important; } #add-bookmark:hover .menu-iconic-icon { -moz-image-region: rect(16px, 16px, 32px, 0px) !
important; } this behavior is fundamentally different to other html elements, such as <li> or <div> where list-style-image and -moz-image-region can be applied at the same element level.
Providing Command-Line Options - Archive of obsolete content
est file: component {2991c315-b871-42cd-b33f-bfee4fcbf682} components/commandline.js contract @mozilla.org/commandlinehandler/general-startup;1?type=myapp {2991c315-b871-42cd-b33f-bfee4fcbf682} category command-line-handler m-myapp @mozilla.org/commandlinehandler/general-startup;1?type=myapp the javascript code const cc = components.classes; const ci = components.interfaces; components.utils.
import("resource://gre/modules/xpcomutils.jsm"); components.utils.
import("resource://gre/modules/services.jsm"); // changeme: to the chrome uri of your extension or application const chrome_uri = "chrome://myapp/content/"; /** * utility functions */ /** * opens a chrome window.
tree - Archive of obsolete content
{ background-color: #ffffaa; } treechildren::-moz-tree-row(odd) { background-color: #eeeeee; } treechildren::-moz-tree-row(odd, selected) { background-color: #ffffaa; } treechildren::-moz-tree-cell-text(selected) { color: #000000; } treechildren::-moz-tree-cell-text(odd, selected) { color: #000000; } treechildren::-moz-tree-row(hover) {background-color: #ffffaa !
important;} treechildren:-moz-tree-column { border-right:1px solid rgb(220,220,220) !
important; } the javascript to get the text for the selected row/rows: function getrowcellvalues() { var tree = document.getelementbyid('mytree'); for (var i = 0; i < tree.view.rowcount; i++) { if (tree.view.getcellvalue(i, tree.columns.getcolumnat(0)) == 'true'){ alert(tree.view.getcelltext(i, tree...
Building XULRunner with Python - Archive of obsolete content
for example def onload(): btntest = document.getelementbyid("btntest") btntest.addeventlistener('command', ontest, false) def ontest(): window.alert('button activated') window.addeventlistener('load', onload, false) one possible gotcha is that the default python path used to find modules that are
imported explicitly includes the xulrunner executable directory and the directory that is current when xulrunner launches.
Make your xulrunner app match the system locale - Archive of obsolete content
from xpcom
import components ps_cls = components.classes["@mozilla.org/preferences-service;1"] ps = ps_cls.getservice(components.interfaces.nsiprefservice) branch = ps.getbranch("general.useragent.") branch.setcharpref("locale", lang) i also set the language environment variable to match the system locale so that python's gettext functionality will work (it pulls straight from language instead of using setlocale)...
XULRunner tips - Archive of obsolete content
when using xulrunner 1.9 or greater, you can create your own alias in your chrome manifest add a "skin" line: skin communicator classic/1.0 skin/communicator/ add a skin folder named "communicator" and add a single css file named "communicator.css" with this content: @
import url("chrome://global/skin"); dom inspector to add dom inspector 2.0.* to your xulrunner 1.9.0.* application follow these steps: download the dom inspector (instead of clicking the "add to..." button, right-click and select "save link as...").
Windows and menus in XULRunner - Archive of obsolete content
here’s the css file: /* global skin --------------------------------------------------- */ @
import url(chrome://global/skin/); /* toolbar ------------------------------------------------------- */ #open { list-style-image: url(chrome://basicapp/skin/open.png); -moz-box-orient: vertical; } #save { list-style-image: url(chrome://basicapp/skin/save.png); -moz-box-orient: vertical; } of course, you need to make sure the png files are included in the application.
Mozilla release FAQ - Archive of obsolete content
there are some
important things that you can do if you don't code or care to document: ideas - if you have an idea for what you'd like to see in mozilla, post a feature request to bugzilla artwork - design new icons and other resources for mozilla use talkback - talkback-enabled builds help the community by letting mozilla.org members where in the code crashes occur.
2006-11-10 - Archive of obsolete content
important dates: technical submissions: monday 19th feb 2007 technical paper notification: friday 16th march 2007 communication submissions: monday 26th march 2007 communication paper notification: friday 06th april 2007 all camera ready due: monday 16th april 2007 conference dates: monday 07th and tuesday 08th may 2007 notable keynotes representatives from w3c, ibm, university of manchester, uk and o...
2006-11-10 - Archive of obsolete content
other
important notes are contained in the link above firefox and thunderbird 1.5.0.8 were released firefox and thunderbird 1.5.0.8 were released on november 7, 2006 blocker nomination and code freeze for 1.5.0.9/2.0.0.1 blocker nomination is due on november 10.
2006-11-10 - Archive of obsolete content
benjamin smedberg crossposted a notice about unit testing for the mozilla toolkit, letting developers know about the
importance of testing for the improvement of mozilla 2, and asks for complete coverage.
azimuth - Archive of obsolete content
this is
important in that it provides a natural way to tell several voices apart, as each can be positioned to originate at a different location on the sound stage.
CSS - Archive of obsolete content
this is
important in that it provides a natural way to tell several voices apart, as each can be positioned to originate at a different location on the sound stage.
ActiveXObject - Archive of obsolete content
for example, here are a few examples of values you may find there, depending on which programs are installed: excel.application excel.chart scripting.filesystemobject wscript.shell word.document
important: activex objects may present security issues.
New in JavaScript 1.2 - Archive of obsolete content
new methods array.prototype.concat() array.prototype.slice() string.prototype.charcodeat() string.prototype.concat() string.fromcharcode() string.prototype.match() string.prototype.replace() string.prototype.search() string.prototype.slice() string.prototype.substr() new operators delete equality operators (== and !=) new statements labeled statements switch do...while
import export other new features regular expressions signed scripts changed functionality in javascript 1.2 you can now nest functions within functions.
New in JavaScript 1.3 - Archive of obsolete content
statements label switch do...while export
import built-in objects regexp methods of built-in objects tosource() object.prototype.watch() object.prototype.unwatch() function.arity function.prototype.apply() function.prototype.call() array.prototype.concat() array.prototype.pop() array.prototype.push() array.prototype.shift() array.prototype.slice() array.prototype.splice() string.prototype.concat() string.prototype.concat(...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
since i wanted them to be side by side, it was
important to be sure the total width of the element boxes (including margins) was less than 50%, so the first step was this: div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} by making the content of each card 45% the width of the containing element, and adding 2% margin to both the left and right sides, each card's element box is 49% as wide as the parent.
Fixing Incorrectly Sized List Item Markers - Archive of obsolete content
authors who are not concerned with making sure the rule applies across all namespaces can use a slightly more simplified rule: *:-moz-list-bullet, *:-moz-list-number {font-size: 1em;} recommendations if it is
important to make list item markers match the font size of the content, use one of the suggested rules.
XUL Parser in Python - Archive of obsolete content
i will make these adjustments and change it into a real module when i get a second, so that someone can instantiate the parser from their own scripts and use it more flexibly: >>>
import xultool >>> myxp = xulparser() >>> chrome_dir = 'd:\src\mozilla\xpfe' >>> res = myxp.parsexul(chrome_dir, 'window', 'id') where something like the above would write out all the xul window ids in the build.
Using the DOM File API in chrome code - Extensions
in bootstrap scope, this must be
imported in like so: cu.
importglobalproperties( [ "file" ] ) accessing a file by hard-coded pathname to reference a file by its path, you can simply use a string literal: var file = file.createfromfilename("path/to/some/file"); cross platform note: however using hard-coded paths raises cross platform issues since it uses a platform-dependent path separator (here "/").
Index - Game development
26 audio for web games audio, games, web audio api, audio sprites, spatialization, syncing tracks audio is an
important part of any game; it adds feedback and atmosphere.
Introduction to game development for the Web - Game development
pointer lock api the pointer lock api lets you lock the mouse or other pointing device within your game's interface so that instead of absolute cursor positioning you receive coordinate deltas that give you more precise measurements of what the user is doing, and prevent the user from accidentally sending their input somewhere else, thereby missing
important action.
2D collision detection - Game development
green means collision, blue means no collision.</p> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/crafty/0.5.4/crafty-min.js"></script> #cr-stage { position: static !
important; height: 200px !
important; } crafty.init(200, 200); var dim1 = {x: 5, y: 5} var dim2 = {x: 20, y: 20} crafty.c("circle", { circle: function(radius, color) { this.radius = radius; this.w = this.h = radius * 2; this.color = color || "#000000"; this.bind("move", crafty.drawmanager.drawall) return this; }, draw: function() { var ctx...
Building up a basic demo with Three.js - Game development
to initialize it, we have to set its field of view and aspect ratio: the former is used to set how much is seen, and the latter is
important for the objects on the screen to have the right proportions when rendered, and not look stretched.
Move the ball - Game development
two lines above your draw() function, to define x and y: var x = canvas.width/2; var y = canvas.height-30; next update the draw() function to use the x and y variables in the arc() method, as shown in the following highlighted line: function draw() { ctx.beginpath(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); } now comes the
important part: we want to add a small value to x and y after every frame has been drawn to make it appear that the ball is moving.
Track the score and win - Game development
ckrowcount*brickcolumncount) { alert("you win, congratulations!"); document.location.reload(); clearinterval(interval); // needed for chrome to end game } } } } } } thanks to this, your users can actually win the game when they destroy all the bricks, which is quite
important when it comes to games.
ALPN - MDN Web Docs Glossary: Definitions of Web-related terms
important protocol identifiers: protocol identification sequence http/1.1 0x68 0x74 0x74 0x70 0x2f 0x31 0x2e 0x31 ("http/1.1") http/2 0x68 0x32 ("h2") http/2 over cleartext tcp 0x68 0x32 0x63 ("h2c") specifications specification status notes rfc 7301 ietf rfc initial definition.
HTML Cheatsheet - Learn web development
d to differentiate a part of the content that we will work on differently emphasize some text <em>i'm posh</em> i'm posh italic textt you can mark a phrase in the text in <i>italics</i> you can mark a phrase in the text in italics bold some text <b>bold a word or phrase</b>within the text bold a word or phrase within the text mark text as
important <strong>i'm
important</strong> i'm
important highlight some text <mark>notice me</mark> notice me draw a line through irrelevant text <s>i'm irrelevant</s> i'm irrelevant underline a non-textual annotation this is <u>mispelled</u> this is mispelled text displayed lower than normal text h<sub>2</sub>o h2o small t...
Use HTML to solve common problems - Learn web development
how to create a list of items with html how to stress or emphasize content how to indicate that text is
important how to display computer code with html how to annotate images and graphics how to mark abbreviations and make them understandable how to add quotations and citations to web pages how to define terms with html hyperlinks one of the main reasons for html is making navigation easy with hyperlinks, which can be used in many different ways: how to create a hyperlink how to create a ta...
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 build a layout on top of.
Introduction to web APIs - Learn web development
for example, you might draw shapes such as rectangles or circles,
import an image onto the canvas, and apply a filter to it such as sepia or grayscale using the canvas api, or create a complex 3d scene with lighting and textures using webgl.
Dynamic behavior in Svelte: working with variables and props - Learn web development
update src/app.svelte as follows: <script>
import todos from './components/todos.svelte' let todos = [ { id: 1, name: 'create a svelte starter app', completed: true }, { id: 2, name: 'create your first component', completed: true }, { id: 3, name: 'complete the rest of the tutorial', completed: false } ] </script> <todos todos={todos} /> when the attribute and the variable have the same name, svelte allows you to just s...
Styling Vue components with CSS - Learn web development
{ width: 100%; max-width: 68rem; margin: 0 auto; font: 1.6rem/1.25 "helvetica neue", helvetica, arial, sans-serif; background-color: #f5f5f5; color: #4d4d4d; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; } @media screen and (min-width: 620px) { body { font-size: 1.9rem; line-height: 1.31579; } } /*end resets*/ next, in your src/main.js file,
import the reset.css file like so:
import './assets/reset.css'; this will cause the file to get picked up during the build step and automatically added to our site.
Implementing feature detection - Learn web development
if you look at the dom inspector of your browser's developer tools, you'll see that modernizr has updated your <html> class value like so: <html class="js no-html
imports sizes flash transferables applicationcache blobconstructor blob-constructor cookies cors ...and loads more values!> it now contains a large number of classes that indicate the support status of different technology features.
Links and Resources
lsr open source screen reader for linux, written in python orca open source screen reader for linux, written in python accessibility for desktop environments gnome accessibility - gnome accessibility project kde accessibility project - an equally
important toolkit on linux apple accessibility - moving forward with os x.
Mozilla's Section 508 Compliance
unknown d) where audio information is
important for the use of a product, at least one mode of operation and information retrieval shall be provided in an enhanced auditory fashion, or support for assistive hearing devices shall be provided.
Creating a Login Manager storage module
const cc = components.classes; const ci = components.interfaces; components.utils.
import("resource://gre/modules/xpcomutils.jsm"); function 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]), // thi...
Creating a spell check dictionary add-on
it is
important to choose the right locale code, or the spell checker will not be able to match the language of your dictionary against the language of a web page in order to select the right dictionary to use.
Creating reftest-based unit tests
in order to test invalidation it is
important that invalidation tests let the document completely finish loading and displaying before making the changes for which invalidation and repainting is to be tested.
Creating Sandboxed HTTP Connections
in the nsiinputstream and the type (in this case, "application/x-www-form-urlencoded"): var uploadchannel = gchannel.queryinterface(components.interfaces.nsiuploadchannel); uploadchannel.setuploadstream(inputstream, "application/x-www-form-urlencoded", -1); due to a bug, calling setuploadstream will reset the nsihttpchannel to be a put request, so now the request type is set to post: // order
important - setuploadstream resets to put httpchannel.requestmethod = "post"; ...
Debugging on Windows
here are some wildcards you can use (tested with vc 8): nscomptr.*\:\:.*=nostepinto (nsg|g)etter_*addrefs.*=nostepinto ns_convertutf.* ; might be too broad: (ns|promise)[^\:]*[ss]tring.* ...add common functions to this list should probably make a .reg file for easy
importing obtaining stdout and other file handles running the following command in the command window in visual studio returns the value of stdout, which can be used with various debugging methods (such as nsgenericelement::list) that take a file* param: debug.evaluatestatement {,,msvcr80d}(&__iob_func()[1]) (alternatively you can evaluate {,,msvcr80d}(&__iob_func()[1]) in the quickwatch window) s...
Configuring Build Options
the most
important of these is moz_objdir, which controls where your application gets built (also known as the object directory).
Displaying Places information using views
every xul document containing a built-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.
Cross Process Object Wrappers
this means that examples like this will actually work, even in multiprocess firefox: gbrowser.selectedbrowser.contentdocument.body.innerhtml = "replaced by chrome code"; it's still
important to keep in mind, though, that this is access through a cpow and not direct access to content.
Message manager overview
age manager the parent process message manager lives in the implements nsimessagelistenermanager nsimessagebroadcaster child process message manager implements nsimessagelistenermanager nsimessagesender loading scripts per child process since the process message managers do not support script loading the only way to implement per-child process code is to use a frame script which
imports a custom javascript module (jsm).
Gecko SDK
contents of the sdk the sdk contains the following: 1.9.2 idl files for frozen interfaces (under idl/) header files for frozen interfaces, xpcom functions, and nspr functions (under include/)
import libraries or shared libraries (under lib/) static utility libraries (under lib/) various tools (under bin/) for more information about safely linking xpcom components using the xpcom "glue" library, see xpcom glue.
How to Report a Hung Firefox
win = wm.getmostrecentwindow("navigator:browser"); let browser = win.gbrowser.selectedbrowser; if (browser.isremotebrowser) { browser.messagemanager.loadframescript('data:,let appinfo = components.classes["@mozilla.org/xre/app-info;1"];if (appinfo && appinfo.getservice(components.interfaces.nsixulruntime).processtype != components.interfaces.nsixulruntime.process_type_default) {components.utils.
import("resource://gre/modules/ctypes.jsm");var zero = new ctypes.intptr_t(8);var badptr = ctypes.cast(zero, ctypes.pointertype(ctypes.int32_t));var crash = badptr.contents;}', true); } other techniques on os x if you use a nightly build (>= firefox 16), you can use activity monitor's "sample process" feature to generate a sample.
IME handling guide
one of the other
important jobs of this is, when a focused editor handles a dispatched ecompositionchange event, this modifies the stored composition string and its clause information.
Implementing QueryInterface
it addrefs the resulting interface, not this, thus following the com-correct way (particularly
important in aggregation) it uses nscomtypeinfo<t>::getiid() instead of ktiid thus saving a global declaration and global space it uses c 's static_cast, via ns_static_cast, which detects errors when you can't really get to the desired interface.
Implementing Download Resuming
not only is the ability to specify a start position
important, but it's also
important to have some assurance that the file did not change since the initial download attempt.
AddonManager
to
import the addonmanager object in the add-on sdk, use: const { addonmanager } = require("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?
AddonUpdateChecker
to
import the addonupdatechecker, use: components.utils.
import("resource://gre/modules/addonupdatechecker.jsm"); method overview updateinfo getcompatibilityupdate(in updateinfo updates[], in string version, in boolean ignorecompatibility, in string appversion, in string platformversion) updateinfo getnewestcompatibleupdate(in updateinfo updates[], in string appversion, in string platformversion) void checkforupdates(in string id, in string type, in string updatekey, string url, in updatechecklistener listener) constants constan...
Add-on Repository
to
import the add-on repository code module, use: components.utils.
import("resource://gre/modules/addonrepository.jsm"); method overview string getrecommendedurl() string getsearchurl(in string searchterms) void cancelsearch() void retrieverecommendedaddons(in integer maxresults, in searchcallback callback) void searchaddons(in string searchterms, in integer...
DeferredTask.jsm
to use it, you first need to
import the code module into your javascript scope: components.utils.
import("resource://gre/modules/deferredtask.jsm"); use this, for instance, if you write data to a file and you expect that you may have to rewrite data very soon afterwards.
Dict.jsm
to use it, you first need to
import the code module into your javascript scope: components.utils.
import("resource://gre/modules/dict.jsm"); creating a dictionary you can create a new, empty dictionary by simply calling the dict() constructor: var newdict = new dict(); if you wish, you may also pass in an object literal of key/value pairs with which to initialize the dictionary: var someobj = {}; var newdict = new dict({key1: "foo", key2: someobj}); note that values may be any javascript object type.
DownloadLastDir.jsm
to use this, you first need to
import the code module into your javascript scope: components.utils.
import("resource://gre/modules/downloadlastdir.jsm"); if you are using addon sdk, you can
import the code module as: let { cu } = require("chrome"); let downloadlastdir = cu.
import("resource://gre/modules/downloadlastdir.jsm").downloadlastdir; once you've
imported the module, you can then use the downloadlastdir object it exports.
FileUtils.jsm
to use it, you first need to
import the code module into your javascript scope: components.utils.
import("resource://gre/modules/fileutils.jsm"); the file constructor if you have a path to a file (or directory) you want to obtain an nsifile for, you can do so using the file constructor, like this: var f = new fileutils.file(mypath); method overview nsifile getfile(string key, array patharray, bool followlinks); nsifile getdir(string key, array patharray, bool shouldcreate, bool followlinks); nsifileoutputstream openfileoutputstream(nsifile file, int modeflags); nsifileoutputstream openatomicfileoutputstream(nsifile file, int modeflags); nsifileoutputstr...
FxAccountsOAuthClient.jsm
components.utils.
import("resource://gre/modules/fxaccountsoauthclient.jsm"); creating a new fxaccountsoauthclient new fxaccountsoauthclient(object options); method overview launchwebflow(); teardown(); attributes parameters object returns the set of parameters that initialized the firefox accounts oauth flow.
FxAccountsProfileClient.jsm
components.utils.
import("resource://gre/modules/fxaccountsprofileclient.jsm"); creating a new fxaccountsprofileclient new fxaccountsprofileclient(object options); method overview fetchprofile(); attributes serverurl url profiler server url.
Geometry.jsm
to use these routines, you first need to
import the code module into your javascript scope: components.utils.
import("resource://gre/modules/geometry.jsm"); once you've
imported the module, you can then use the point and rect classes.
ISO8601DateUtils.jsm
to use this, you first need to
import the code module into your javascript scope: components.utils.
import("resource://gre/modules/iso8601dateutils.jsm"); once you've
imported the module, you can then use the iso8601dateutils object it exports.
NetUtil.jsm
to use these utilities, you first need to
import the code module into your javascript scope: components.utils.
import("resource://gre/modules/netutil.jsm"); once you've
imported the module, you can then use its methods.
PerfMeasurement.jsm
before you can use this module, you need to
import it into your scope: components.utils.
import("resource://gre/modules/perfmeasurement.jsm") see measuring performance using the perfmeasurement.jsm code module for details on how to use this api.
Deferred
function deferred() { // update 062115 for typeof if (typeof(promise) != 'undefined' && promise.defer) { //need
import of promise.jsm for example: cu.
import('resource:/gree/modules/promise.jsm'); return promise.defer(); } else if (typeof(promiseutils) != 'undefined' && promiseutils.defer) { //need
import of promiseutils.jsm for example: cu.
import('resource:/gree/modules/promiseutils.jsm'); return promiseutils.defer(); } else { /* a method to resolve the associated promise with the value passed.
Promise
you don't need to
import the promise.jsm module to use a promise object to which you already have a reference.
PromiseUtils.jsm
to use it, you first need to
import the code module into your javascript scope: components.utils.
import("resource://gre/modules/promiseutils.jsm"); method overview deferred defer(); methods defer() creates a new pending promise and provides methods to resolve or reject this promise.
Services.jsm
to use it, you first need to
import the code module into your javascript scope: const {services} = chromeutils.
import("resource://gre/modules/services.jsm"); then you can obtain references to services by simply accessing them from the services object exported by the code module.
SourceMap.jsm
get a reference to the module: let sourcemap = {}; components.utils.
import('resource:///modules/devtools/sourcemap.jsm', sourcemap); sourcemapconsumer a sourcemapconsumer instance represents a parsed source map which we can query for information about the original file positions by giving it a file position in the generated source.
Timer.jsm
to use timer.jsm, first
import it: components.utils.
import("resource://gre/modules/timer.jsm"); then call settimeout and cleartimeout just as you would in a dom window, for example: let timeoutid = settimeout(function() { console.log("hello!"); }, 500); cleartimeout(timeoutid); similarly, you can use setinterval and clearinterval like so: let intervalid = setinterval(function() { console.log("happening every 500ms!"); }, 500); clearinterval(intervalid); ...
Fonts for Mozilla 2.0's MathML engine
finally, include the mathml-fonts/resource/mathml.css style sheet in your web pages, for example by adding the following rule to the default style sheet of your web site: @
import url('/path/to/resource/mathml.css'); browsers have default font-families in their user agent stylesheets.
Mozilla Style System
the grouping of properties into structs follows two rules: any properties in the same style struct must also be in the same css struct all of the properties in a style struct must be inherited or they must all be non-inherited (see inheritance for an explanation of the difference) the first of these rules is no longer
important (in fact, the separation of the specified values into nscss* structs is no longer
important).
mozilla::MonitorAutoEnter
important: when a mozilla::monitorautoenter is live on the stack, your code is guaranteed to own the underlying mozilla::monitor.
mozilla::MutexAutoLock
important: when a mozilla::mutexautolock is the mutex raii wrapper most recently pushed on the stack, your code is guaranteed to own the underlying mozilla::mutex.
mozilla::MutexAutoUnlock
important: when a mozilla::mutexautounlock is the mutex raii wrapper most recently pushed on the stack, your code is guaranteed not to own the underlying mozilla::mutex.
DMD
the "twice-reported stack trace records" and "unreported stack trace records" sections are the most
important, because they indicate ways in which the memory reporters can be improved.
Profiling with Xperf
building firefox to get good data from a firefox build, it is
important to build with the following options in your mozconfig: export cflags="-oy-" export cxxflags="-oy-" this disables frame-pointer optimization which lets xperf do a much better job unwinding the stack.
Productization guide
the second purpose (demonstrate certain features of the product) is equally
important: by providing these default services, we demonstrate particular features of the product, the ones which otherwise wouldn’t be as discoverable.
Emscripten
important: this page provides a very brief introduction to what emscripten is.
L20n Javascript API
a 404 error when fetching a resource file, or recursive
import statements in resource files), context.translationerror, when there is a missing translation in one of supported locales; the context instance will try to retrieve a fallback translation from the next locale in the fallback chain, compiler.error, when l20n is unable to evaluate an entity to a string; there are two types of errors in this category: compiler.valueerror, when...
MailNews
mailnews automated testing automated testing is an increasingly significant and
important part of mailnews development.
NSPR Poll Method
if new_flags contains pr_poll_read, you should try pr_recv or pr_send when the underlying network transport is readable if new_flags contains pr_poll_write, you should try pr_recv or pr_send when the underlying network transport is writable
important do not use out_flags in any way other than testing if (new_flags & out_flags) is 0.
Cached Monitors
important cached monitors are slower to use than their uncached counterparts.
Date and Time
in this form, the time zone information is
important.
Introduction to NSPR
this, and the fact that threads share an address space with other threads in the same process, makes it
important to remember that threads are not processes .
NSPR LOG MODULES
level is a numeric value between 0 and 5, with the values having the following meanings: 0 = pr_log_none: nothing should be logged 1 = pr_log_always:
important; intended to always be logged 2 = pr_log_error: errors 3 = pr_log_warning: warnings 4 = pr_log_debug: debug messages, notices 5: everything!
PRIntervalTime
important note the counters used for interval times are allowed to overflow.
PR_FreeLibraryName
it is
important to use this function to rather than calling directly into malloc in order to isolate the runtime's semantics regarding storage management.
Certificate functions
cert_getsloptime mxr 3.2 and later cert_getsslcacerts mxr 3.2 and later cert_getstatename mxr 3.2 and later cert_getusepkixforvalidation mxr 3.12 and later cert_getvaliddnspatternsfromcert mxr 3.12 and later cert_gentime2formattedascii mxr 3.2 and later cert_hexify mxr 3.2 and later cert_
importcachain mxr 3.2 and later cert_
importcerts mxr 3.2 and later cert_isrootdercert mxr 3.8 and later cert_isusercert mxr 3.6 and later cert_keyfromdercrl mxr 3.4 and later cert_makecanickname mxr 3.4 and later cert_mergeextensions mxr 3.10 and later cert_nametoascii mxr 3.2 and later ...
JSS Provider Notes
translatekey() simply gets the encoded form of the given key and then tries to
import it by calling generatepublic() or generateprivate().
Mozilla-JSS JCA Provider notes
translatekey() simply gets the encoded form of the given key and then tries to
import it by calling generatepublic() or generateprivate().
NSS_3.11.10_release_notes.html
bug 291384: certutil -k behavior doesn't match usage bug 374247: modutil -disable command not disabling modules' slots bug 384459: certification path validation fails when authority key identifier extension contains key identifier bug 385946: can't
import certificate into cert database in fips mode (certutil).
NSS 3.12.5 release_notes
bug 510435: remove unused make variable dso_ldflags bug 510436: add macros for build numbers (4th component of version number) to nssutil.h bug 511227: firefox 3.0.13 fails to compile on freebsd/powerpc bug 511312: nss fails to load softoken, looking for sqlite3.dll bug 511781: add new tls 1.2 cipher suites implemented in windows 7 to ssltap bug 516101: if pk11_
importcert fails, it leaves the certificate undiscoverable by cert_pkixverifycert bug 518443: pk11_
importandreturnprivatekey leaks an arena bug 518446: pk11_derencodepublickey leaks a certsubjectpublickeyinfo bug 518457: seckey_encodedersubjectpublickeyinfo and pk11_derencodepublickey are duplicate bug 522510: add deprecated comments to key.h and pk11func.h bug 522580: nss uses port_memcmp for comp...
NSS 3.14 release notes
the following functions have been added to the libssl library included in nss 3.14: dtls_
importfd (in ssl.h) dtls_gethandshaketimeout (in ssl.h) ssl_getsrtpcipher (in ssl.h) ssl_setrtpciphers (in ssl.h) support for aes-gcm support for aes-gcm has been added to the nss pkcs #11 module (softoken), based upon the draft 7 of pkcs #11 v2.30.
NSS 3.18 release notes
nss 3.18 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_18_rtm/src/ new in nss 3.18 new functionality when
importing certificates and keys from a pkcs#12 source, it's now possible to override the nicknames, prior to
importing them into the nss database, using new api sec_pkcs12decoderrenamecertnicknames.
NSS 3.19.1 release notes
the minimum size of keys that nss will generate,
import, or use has been raised: the minimum modulus size for rsa keys is now 512 bits the minimum modulus size for dsa keys is now 1023 bits the minimum modulus size for diffie-hellman keys is now 1023 bits bugs fixed in nss 3.19.1 this bugzilla query returns all the bugs fixed in nss 3.19.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_f...
NSS 3.30 release notes
the pk12util tool now supports
importing and exporting data encrypted in the aes based schemes defined in pkcs#5 v2.1.
NSS 3.36.8 release notes
bugs fixed in nss 3.36.8 1554336 - optimize away unneeded loop in mpi.c 1515342 - more thorough input checking (cve-2019-11729) 1540541 - don't unnecessarily strip leading 0's from key material during pkcs11
import (cve-2019-11719) compatibility nss 3.36.8 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.38 release notes
when repeatedly
importing the same certificate into an sql database, the existing nickname will be kept.
NSS 3.44.1 release notes
1546229 - add ipsec ike support to softoken many new fips test cases (note: this has increased the source archive by approximately 50 megabytes for this release.) bugs fixed in nss 3.44.1 1554336 - optimize away unneeded loop in mpi.c 1515342 - more thorough input checking (cve-2019-11729) 1540541 - don't unnecessarily strip leading 0's from key material during pkcs11
import (cve-2019-11719) 1515236 - add a sslkeylogfile enable/disable flag at build.sh 1473806 - fix seckey_converttopublickey handling of non-rsa keys 1546477 - updates to testing for fips validation 1552208 - prohibit use of rsassa-pkcs1-v1_5 algorithms in tls 1.3 (cve-2019-11727) 1551041 - unbreak build on gcc < 4.3 big-endian compatibility nss 3.44.1 shared librarie...
NSS 3.45 release notes
certificate authority changes the following ca certificates were removed: bug 1552374 - cn = certinomis - root ca sha-256 fingerprint: 2a99f5bc1174b73cbb1d620884e01c34e51ccb3978da125f0e33268883bf4158 bugs fixed in nss 3.45 bug 1540541 - don't unnecessarily strip leading 0's from key material during pkcs11
import (cve-2019-11719) bug 1515342 - more thorough input checking (cve-2019-11729) bug 1552208 - prohibit use of rsassa-pkcs1-v1_5 algorithms in tls 1.3 (cve-2019-11727) bug 1227090 - fix a potential divide-by-zero in makepfromqandseed from lib/freebl/pqg.c (static analysis) bug 1227096 - fix a potential divide-by-zero in pqg_verifyparams from lib/freebl/pqg.c (static analysis) bug 1509432 -...
NSS 3.47 release notes
for a specified root cert bug 1588557 - bad debug statement in tls13con.c bug 1579060 - mozilla::pkix tag definitions for issueruniqueid and subjectuniqueid shouldn't have the constructed bit set bug 1583068 - nss 3.47 should pick up fix from bug 1575821 (nspr 4.23) bug 1152625 - support aes hw acceleration on armv8 bug 1549225 - disable dsa signature schemes for tls 1.3 bug 1586947 - pk11_
importandreturnprivatekey does not store nickname for ec keys bug 1586456 - unnecessary conditional in pki3hack, pk11load and stanpcertdb bug 1576307 - check mechanism param and param length before casting to mechanism-specific structs bug 1577953 - support longer (up to rfc maximum) hkdf outputs bug 1508776 - remove refcounting from sftk_freesession (cve-2019-11756) bug 1494063 - support tls expor...
NSS 3.48.1 release notes
bugs fixed in nss 3.48.1 bug 1606992 - cache the most recent pbkdf2 password hash, to speed up repeated sdr operations,
important with the increased kdf iteration counts.
NSS 3.49.1 release notes
bugs fixed in nss 3.49.1 bug 1606992 - cache the most recent pbkdf2 password hash, to speed up repeated sdr operations,
important with the increased kdf iteration counts.
NSS 3.49.2 release notes
bugs fixed in nss 3.49.2 bug 1606992 - cache the most recent pbkdf1 password hash, to speed up repeated sdr operations,
important with the increased kdf iteration counts.
NSS 3.50 release notes
bugs fixed in nss 3.50 bug 1599514 - update dtls 1.3 implementation to draft-30 bug 1603438 - fix native tools build 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.
NSS Sample Code sample2
we use pk11_originunwrap * to indicate the key was unwrapped - which is what should be done * normally anyway - using raw keys isn't a good idea */ symkey = pk11_
importsymkey(slot, ciphermech, pk11_originunwrap, cka_encrypt, &keyitem, null); if (symkey == null) { fprintf(stderr, "failure to
import key into nss (err %d)\n", pr_geterror()); goto out; } /* set up the pkcs11 encryption paramters.
NSS Sample Code sample5
* publicvalue arg (4th) can be null for rsa key - i think it is even * ignored */ pk11_
importderprivatekeyinfoandreturnkey(slot, &der, null, null, pr_false, pr_true, ku_all, &pvtkey, null); secitem_freeitem(&der, pr_false); if (pvtkey == null) { fprintf(stderr, "couldn't extract private key (err %d)\n", pr_geterror()); goto cleanup; } /* clear buf1 */ for (i=0;i<modulus_len;i++) {...
PKCS 12 functions
sec_pkcs12createexportcontext mxr 3.2 and later sec_pkcs12createpasswordprivsafe mxr 3.2 and later sec_pkcs12createunencryptedsafe mxr 3.2 and later sec_pkcs12decoderfinish mxr 3.2 and later sec_pkcs12decodergetcerts mxr 3.4 and later sec_pkcs12decoder
importbags mxr 3.2 and later sec_pkcs12decoderiterateinit mxr 3.10 and later sec_pkcs12decoderiteratenext mxr 3.10 and later sec_pkcs12decodersettargettokencas mxr 3.8 and later sec_pkcs12decoderstart mxr 3.2 and later sec_pkcs12decoderupdate mxr 3.2 and...
NSS reference
sec_pkcs12createexportcontext sec_pkcs12createpasswordprivsafe sec_pkcs12createunencryptedsafe sec_pkcs12addcertandkey sec_pkcs12addpasswordintegrity sec_pkcs12enablecipher sec_pkcs12encode sec_pkcs12destroyexportcontext sec_pkcs12decoderstart sec_pkcs12decoder
importbags 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 required for using the certificate verification an...
sslcrt.html
certusage one of these values: certusagesslclient certusagesslserver certusagesslserverwithstepup certusagesslca certusageemailsigner certusageemailrecipient certusageobjectsigner certusageusercert
import certusageverifyca certusageprotectedobjectsigner wincx the pin argument value to pass to pk11 functions.
ssltyp.html
upgraded documentation may be found in the current nss reference selected ssl types and structures chapter 3 selected ssl types and structures this chapter describes some of the most
important types and structures used with the functions described in the rest of this document, and how to manage the memory used for them.
SSL functions
ter ssl_getchannelinfo mxr 3.4 and later ssl_getciphersuiteinfo 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.2 and later ssl_invalidatesession mxr 3.2 and later ssl_localcertificate mxr 3.4 and later ssl_optionget mxr 3.2 and later ssl_optiongetdefault mxr 3.2 and later ssl_optionset mxr 3.2 and later ssl_optionsetdefault mxr 3.2 and later ...
S/MIME functions
nss_cmssigneddata_destroy mxr 3.2 and later nss_cmssigneddata_getcontentinfo mxr 3.2 and later nss_cmssigneddata_getdigestalgs mxr 3.2 and later nss_cmssigneddata_getsignerinfo mxr 3.2 and later nss_cmssigneddata_hasdigests mxr 3.2 and later nss_cmssigneddata_
importcerts mxr 3.2 and later nss_cmssigneddata_setdigests mxr 3.2 and later nss_cmssigneddata_setdigestvalue mxr 3.4 and later nss_cmssigneddata_signerinfocount mxr 3.2 and later nss_cmssigneddata_verifycertsonly mxr 3.2 and later nss_cmssigneddata_verifysignerinfo...
NSS Tools
source, documentation, tasks/plans pk12util 1.0
import and export keys and certificates between the cert/key databases and files in pkcs12 format.
Necko Architecture
because of their
importance, necko provides its own standard implementation of urls (with class id ns_standardurl_cid), which does all of the standard parsing necessary for most urls.
Necko walkthrough
but the interface for clients of necko is
important to consider: send request uri helps creates channel setup channel (headers, request data, response callback...) channel->asyncopen.
Parser API
example: > var expr = reflect.parse("obj.foo + 42").body[0].expression > expr.left.property ({loc:null, 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) built-in objects whether in spidermonkey shell or firefox (after
importing), the global singleton object reflect currently contains just the parse method.
SpiderMonkey 1.8.5
bug 614138 introduces a c++ js::anchor<> template class to help tie lexical scope to the conservative gc for cases where the compiler might optimize away
important stack/register roots (such as when we access the jschars in a jsstring).
SpiderMonkey 1.8.7
bug 614138 introduces a c++ js::anchor<> template class to help tie lexical scope to the conservative gc for cases where the compiler might optimize away
important stack/register roots (such as when we access the jschars in a jsstring).
SpiderMonkey 1.8
however, one of the most
important advances for jsapi application developers is that the documentation is much improved.
Running Automated JavaScript Tests
basic usage is the same: jit_test.py path_to_js_shell developers will usually want to run like this to skip the slow tests and cover the most
important options: jit_test.py --no-slow path_to_js_shell you can select specific tests to run in the same way as the jstests shell harness.
Thread Sanitizer
still, blacklisting should be done very carefully so we won't miss
important bugs.
compare-locales
ab-cd browser chrome/browser browser.dtd +backforwardmenu.tooltip +fullzoomenlargecmd.commandkey3 +fullzoomreducecmd.commandkey2 +fullzoomresetcmd.commandkey2 +organizebookmarks.label -showallbookmarkscmd2.label migration/migration.dtd -
importfromfile.accesskey -
importfromfile.label +
importfromhtmlfile.accesskey +
importfromhtmlfile.label you can assume changed strings when you see entities removed and added with a similar name.
Mozinfo
downloading the software and running python setup.py develop will allow you to do
import mozinfo from python.
Mozilla Projects
it's
important that the update information retrieved has not been tampered with since being written by the add-on author.
Handling Mozilla Security Bugs
version 1.1
important: anyone who believes they have found a mozilla-related security vulnerability can and should report it by sending email to address security@mozilla.org.
Setting up an update server
you can use this command with firefox's browser console to determine the update directory: const {fileutils} = chromeutils.
import("resource://gre/modules/fileutils.jsm"); fileutils.getdir("updrootd", [], false).path once you have determined the update directory, close firefox, browse to the directory and remove the subdirectory called updates.
Signing Mozilla apps for Mac OS X
it will guide you through creating a private key, certificate signing request, and
importing your new developer id into the keychain access application on your mac.
XPConnect wrappers
less informed developers understand that wrappers exist and are somehow
important, but they don't know when they should use what wrappers, or if they should be seeing a wrapper.
RefPtr
so for xpcom interfaces: nscomptr<nsisupports> a; nscomptr<nsifoo> foo; and for concrete classes: refptr<nsfoo> foo; // class that implements nsifoo; refptr<bar> bar; // some random class that i want ref-counted but has nothing to do with xpcom: // just implement addref() and release() and it will work with refptr it is
important that nscomptr is not used to hold a pointer to a concrete class since this can cause compile time errors or runtime errors.
mozIAsyncFavicons
this is
important so that we know what to report when the favicon is used.
mozIJSSubScriptLoader
to get this service, use: var mozijssubscriptloader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getservice(components.interfaces.mozijssubscriptloader); note: see components.utils.
import for another way to
import javascript code.
mozIRegistry
there's another component that turns out to also be real
important when you go to hook up your code with other mozilla components.
nsIAccessibleRetrieval
this node is either from bindings chain if given node is anonymous and owner binding denies accessible in anonymous content or given node (it's not
important whether it is accessible or not).
nsIAccessibleStates
state_required state_alert_low state_
important state_alert_medium currently unused.
nsIBrowserHistory
it is called by history
importing code and is used in the history migration tool.
nsIChannelEventSink
it is
important to understand that oldchannel will continue loading as if it received a response of http 200, which includes notifying observers and possibly display or process content attached to the http response.
nsIDOMGeoGeolocation
starting in gecko 1.9.2, you can access this service using: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getservice(components.interfaces.nsidomgeogeolocation); note: if nsidgeogeolocation throws an exception when
importing, try using this: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getservice(components.interfaces.nsisupports); method overview void clearwatch(in unsigned short watchid); void getcurrentposition(in nsidomgeopositioncallback successcallback, [optional] in nsidomgeopositionerrorcallback errorcallback,...
nsIFaviconService
this is
important so that we know what to report when the favicon is used.
nsIFile
to create an nsifile from a path you can use fileutils.jsm: var fileutils = cu.
import("resource://gre/modules/fileutils.jsm").fileutils var nsifile = new fileutils.file( filename ) note: nsilocalfile was merged with this interface in gecko 14.
nsIHttpServer
an example : https://github.com/laurentj/slimerjs/blob/master/src/modules/webserver.jsm var exported_symbols = ["create"]; components.utils.
import("resource://gre/modules/services.jsm"); function create() { var server = components.classes["@mozilla.org/server/jshttp;1"] .createinstance(components.interfaces.nsihttpserver); return { get objectname () { return "webserver"; }, /** * @param integer|string port port or "host:port" * @param object opt optional options.
nsILivemarkService
being able to manually control this allows activity such as bookmarks
import to occur without kicking off http traffic.
nsILoginManagerIEMigrationHelper
toolkit/components/passwordmgr/public/nsiloginmanageriemigrationhelper.idlscriptable
imports a login from the nsiieprofilemigrator into the login manager.
nsIMemoryMultiReporter
this is
important; multi-reporters can special-case this operation so it's much faster than gathering all the reports, filtering out the unneeded ones, and adding up the rest.
nsIModule
it is very
important to ensure that no outstanding references to the module's code/data exist before returning true.
Building an Account Manager Extension
components.utils.
import("resource://gre/modules/xpcomutils.jsm"); //class constructor function devmoaccountmanagerextension() {}; // class definition devmoaccountmanagerextension.prototype = { name : "devmo-account", chromepackagename : "example@mozilla.org", showpanel: function(server) { //this panel is only shown for imap accounts...
nsINavHistoryObserver
it's
important to note that there is a difference between an empty title and a null title.
nsINavHistoryQuery
this is
important because, if the user has their profile on a networked drive, query latency can be non-negligible method overview nsinavhistoryquery clone(); void getfolders([optional ]out unsigned long count, [retval,array,size_is(count)] out long long folders); void gettransitions([optional] out unsigned long count, [retval,array,size_is(count)] out unsigned long transitions); void setfolders([co...
nsINavHistoryResultTreeViewer
it's
important to be aware of this—if you want to reuse the same viewer, you need to keep your own reference to it, then reinitialize it when the tree changes.
nsIScriptableIO
file and stream guide: [ 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 guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
nsIScriptableInputStream
note: it is also
important to consider how a language bindings may interpret the string data type.
nsIScriptableUnicodeConverter
if the other apis you are reading data from or writing data to don't require you to use this legacy representation, you should use textdecoder and textencoder (available to chrome javascript via components.utils.
importglobalproperties) instead of this api.
nsITraceableChannel
/////// start - do not edit var {classes: cc, interfaces: ci, results: cr, constructor: cc, utils: cu} = components; cu.
import('resource://gre/modules/services.jsm'); var binaryinputstream = cc('@mozilla.org/binaryinputstream;1', 'nsibinaryinputstream', 'setinputstream'); var binaryoutputstream = cc('@mozilla.org/binaryoutputstream;1', 'nsibinaryoutputstream', 'setoutputstream'); var storagestream = cc('@mozilla.org/storagestream;1', 'nsistoragestream', 'init'); function tracinglistener() { this.receivedchunks = []; /...
nsIVersionComparator
see here: nsixulappinfo components.utils.
import("resource://gre/modules/services.jsm"); var curentbrowserversion = services.appinfo.platformversion; //example: '31.*' var comparetothisversion = '25.*'; var compareresult = services.vc.compare(curentbrowserversion, comparetothisversion); if (compareresult == -1) { //currentbrowserversion is less than '25.*' (comparetothisversion) } else if (compareresult == 0) { //currentbrowserversio...
nsIWebProgressListener
cu.reporterror("saw: " + data.name + " -- passing: " + json.stringify(data)); }); /** * below is the contents of example-framescript.js */ const {classes: cc, interfaces: ci, utils: cu} = components; cu.
import("resource://gre/modules/xpcomutils.jsm"); var mylistener = { queryinterface: xpcomutils.generateqi(["nsiwebprogresslistener", "nsisupportsweakreference"]), onstatechange: function(awebprogress, arequest, aflag, astatus) { let win = awebprogress.domwindow; let outerwindowid = win.queryinterface(ci.nsiinterfacerequestor) ...
nsIWindowMediator
important: this will attach the functionality to future opened windows, so if you copy paste this code to scratchpad, then after running this script, you need to open a new window by pressing ctrl + n and then in the new window, selecting tabs will fire the alert.
nsIXMLHttpRequest
le example code for opening a simple http request from a xul application (like a mozilla extension) without using observers: var req = components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(); req.open('post', "http://www.foo.bar:8080/nietzsche.do", true); req.send('your=data&and=more&stuff=here'); example 2 var {cu: utils, cc: classes, ci: instances} = components; cu.
import('resource://gre/modules/services.jsm'); function xhr(url, cb) { let xhr = cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(ci.nsixmlhttprequest); let handler = ev => { evf(m => xhr.removeeventlistener(m, handler, !1)); switch (ev.type) { case 'load': if (xhr.status == 200) { cb(xhr.response); ...
nsIXULTemplateQueryProcessor
the reference point is
important when generating output recursively, as the query will be the same for each iteration, however, the reference point will differ.
nsIZipReader
var zr = cc["@mozilla.org/libjar/zip-reader;1"].createinstance(ci.nsizipreader); cu.
import('resource://gre/modules/osfile.jsm'); cu.
import('resource://gre/modules/fileutils.jsm'); var reusablestreaminstance = cc['@mozilla.org/scriptableinputstream;1'].createinstance(ci.nsiscriptableinputstream); var pathtoxpitoread = os.path.join(os.constants.path.profiledir, 'extensions', 'portabletester@jetpack.xpi'); var nsifilexpi = new fileutils.file(pathtoxpitoread); ...
XPCOM Interface Reference
storyresultnsinavhistoryresultnodensinavhistoryresultobservernsinavhistoryresulttreeviewernsinavhistoryresultviewobservernsinavhistoryresultviewernsinavhistoryservicensinavhistoryvisitresultnodensinetworklinkservicensiobservernsiobserverservicensioutputstreamnsioutputstreamcallbacknsiparentalcontrolsservicensiparserutilsnsipasswordnsipasswordmanagernsipermissionnsipermissionmanagernsipipensiplaces
importexportservicensiplacesviewnsipluginhostnsiprefbranch2nsipreflocalizedstringnsiprefservicensiprincipalnsiprinterenumeratornsiprintingpromptnsiprivatebrowsingservicensiprocessnsiprocess2nsiprocessscriptloadernsiprofilensiprofilelocknsiprofileunlockernsiprogramminglanguagensiprogresseventsinknsipromptnsipromptservicensipropertiesnsipropertynsipropertybagnsipropertybag2nsipropertyelementnsiprotocolhan...
Using IndexedDB in chrome
(see using indexeddb for an overview.) however, the apis can also be accessed from system-privileged javascript using the components.utils.
importglobalproperties() function: components.utils.
importglobalproperties(["indexeddb"]); // from here on, it's like using indexeddb from content var req = indexeddb.open("my-database"); // ...
Reference Manual
nscomptr<nsifoo> foo = ...; foo->addref(); // error: |addref| is private delete foo.get(); // error: |operator delete| is private ns_release(foo); // error: |release| is private of course, the most
important safety feature provided by nscomptr is that it addrefs and releases automatically at the appropriate times.
XPCOM tasks
5.1 3rd party code that doesn't use any services from our tree should be below xpcom; particularly, code xpcom could exploit, e.g., expat berkeley db changes to apis, functionality, and implementations the following items are listed (very) roughly in their order of
importance, i.e., fixing observers is the first thing i want to do.
XPCOM
in addition to the actual content, some
important information is passed with http headers for both http requests and responses.storagestorage is a sqlite database api.
XPIDL
an
important attribute for methods and attributes is scriptability.
XUL Overlays
in xul, attributes control
important features of the skin like image sources, as in the following example, where an overlay destructively overwrites the image source in the base file with a replacement.
Memory - Plugins
calling npn_memflush is particularly
important to systems with small amounts of ram and with virtual memory turned off.
Plug-in Basics - Plugins
though the object element has no hidden attribute, you can create css rules to override the sizing attributes of the object element object { visibility: visible; } object.hiddenobject { visibility: hidden !
important; width: 0px !
important; height: 0px !
important; margin: 0px !
important; padding: 0px !
important; border-style: none !
important; border-width: 0px !
important; max-width: 0px !
important; max-height: 0px !
important; } in this case, the object element that picks up these special style definitions would have a class of hidden.
Plugins
important: plugins are a legacy technology that are a security and performance problem for firefox (and other browser) users.
Accessibility Inspector - Firefox Developer 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.
Tutorial: Set a breakpoint - Firefox Developer Tools
click on the scratchpad panel and enter the following code: components.utils.
import("resource://gre/modules/jsdebugger.jsm"); components.utils.
import("resource://gre/modules/console.jsm"); // this simply defines 'debugger' in this scratchpad; // it doesn't actually start debugging anything.
Deprecated tools - Firefox Developer Tools
starting firefox 72, you can
import a javascript file content in the console input with ctrl + o (cmd + o on macos), as well as saving the console input content to a file using ctrl + s (cmd + s on macos).
DevTools API - Firefox Developer Tools
to use the gdevtools api from an add-on, it can be
imported with following snippet const { gdevtools } = require("resource:///modules/devtools/gdevtools.jsm"); methods registertool(tooldefinition) registers a new tool and adds a tab to each existing toolbox.
Index - Firefox Developer Tools
3 accessibility inspector accessibility, accessibility inspector, devtools, guide, 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.
Basic operations - Firefox Developer Tools
to load a snapshot from an existing .fxsnapshot file, click the
import button, which looks like a rectangle with an arrow rising from it (before firefox 49, this button was labeled with the text "
import..."): you'll be prompted to find a snapshot file on disk.
Dominators - Firefox Developer Tools
retained size is an
important concept in analyzing memory usage, because it answers the question "if this object ceases to exist, what's the total amount of memory freed?".
Frame rate - Firefox Developer Tools
however, consistency is especially
important: if you can't deliver 60fps, it's better to deliver lower frame rates more consistently, and avoid sudden dips in the frame rate which cause the site to freeze.
How to - Firefox Developer Tools
save a profile to save a profile, click the link labeled "save" in the recordings pane: load a profile to load a profile, click "
import..." and choose the file: clear all loaded profiles to clear all loaded profiles, click "clear".
Animating CSS properties - Firefox Developer Tools
compared with the version that uses margin, we're not spending any time time in layout or (more
importantly in this case) in paint: in this case, using transform significantly improved the site's performance, and the performance tools were able to show how and why it did.
Waterfall - Firefox Developer Tools
importantly for responsiveness, the browser doesn't always have to go through every step: css animations update the page without having to run any javascript.
Web Console remoting - Firefox Developer Tools
the getrequestpostdata packet: { "to": "conn0.netevent15", "type": "getrequestpostdata" } { "from": "conn0.netevent15", "postdata": { text: "foobar" }, "postdatadiscarded": false } the getresponsecontent packet: { "to": "conn0.netevent15", "type": "getresponsecontent" } { "from": "conn0.netevent15", "content": { "mimetype": "text/css", "text": "\n@
import \"test.css\";\n\n.foobar { color: green }\n\n" }, "contentdiscarded": false } the request and response content text value is most commonly sent using a longstringactor grip.
AudioListener - Web APIs
it is
important to note that there is only one listener per context and that it isn't an audionode.
Background Tasks API - Web APIs
because event handling and screen updates are two of the most obvious ways users notice performance issues, it's
important for your code to be a good citizen of the web and help to prevent stalls in the execution of the event loop.
BaseAudioContext.createDynamicsCompressor() - Web APIs
it is especially
important in games and musical applications where large numbers of individual sounds are played simultaneously, where you want to control the overall signal level and help avoid clipping (distorting) of the audio output.
Element.requestFullscreen() - Web APIs
it's also
important to listen for fullscreenchange to be aware when, for example, the user manually toggles full-screen mode, or when the user switches applications, causing your application to temporarily exit full-screen mode.
ExtendableEvent - Web APIs
ches.open(current_caches['prefetch']).then(function(cache) { return cache.addall(urlstoprefetch.map(function(urltoprefetch) { return new request(urltoprefetch, {mode: 'no-cors'}); })).then(function() { console.log('all resources have been fetched and cached.'); }); }).catch(function(error) { console.error('pre-fetching failed:', error); }) ); });
important: when fetching resources, it's very
important to use {mode: 'no-cors'} if there is any chance that the resources are served off of a server that doesn't support cors.
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 required 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().
FileReader - Web APIs
important note: filereader is used to read file content from the user's (remote) system in secure ways only.
FileSystemDirectoryReader - Web APIs
because this is a non-standard api, whose specification is not currently on a standards track, it's
important to keep in mind that not all browsers implement it, and those that do may implement only small portions of it.
FileSystemEntry - Web APIs
because this is a non-standard api, whose specification is not currently on a standards track, it's
important to keep in mind that not all browsers implement it, and those that do may implement only small portions of it.
FileHandle API - Web APIs
however, they are
important for the filehandle object as it can generate file objects which inherit their own name and type from those values.
File and Directory Entries API - Web APIs
because this is a non-standard api, whose specification is not currently on a standards track, it's
important to keep in mind that not all browsers implement it, and those that do may implement only small portions of it.
Geolocation API - Web APIs
geolocationcoordinates represents the coordinates of a user's position; a geolocationcoordinates instance contains latitude, longitude, and other
important related information.
HTMLCanvasElement.mozFetchAsStream() - Web APIs
return function(result) { if (!components.issuccesscode(result)) { alert('failed to create icon'); } else { alert('succesfully made'); } }; } var mfascallback = function(iconname) { return function(instream) { var file = fileutils.getfile('desk', [iconname + '.ico']); var outstream = fileutils.openfileoutputstream(file); cu.
import('resource://gre/modules/netutil.jsm'); netutil.asynccopy(instream, outstream, netutilcallback()); } } canvas.mozfetchasstream(mfascallback('myicon'), 'image/vnd.microsoft.icon'); specifications not part of any specification.
HTMLCanvasElement.toBlob() - Web APIs
cu.
import('resource://gre/modules/osfile.jsm'); var writepath = os.path.join(os.constants.path.desktopdir, iconname + '.ico'); var promise = os.file.writeatomic(writepath, new uint8array(r.result), {tmppath:writepath + '.tmp'}); promise.then( function() { console.log('successfully wrote file'); }, f...
ShadowRoot.innerHTML - Web APIs
examples let customelem = document.queryselector('my-shadow-dom-element'); let shadow = customelem.shadowroot; shadow.innerhtml = '<strong>this element should be more
important!</strong>'; specifications this property is not defined by any specifications yet; see this open spec issue to specify it.
Streams API - Web APIs
bytestream-related interfaces
important: these are not implemented anywhere as yet, and questions have been raised as to whether the spec details are in a finished enough state for them to be implemented.
StyleSheet.ownerNode - Web APIs
syntax noderef = stylesheet.ownernode example <html lang="en"> <head> <link rel="stylesheet" href="example.css"> </head> <body> <button onclick="alert(document.stylesheets[0].ownernode)">show example.css’s ownernode</button> </body> </html> // displays "object htmllinkelement" notes for style sheets that are included by other style sheets, such as with @
import, the value of this property is null.
SubtleCrypto.encrypt() - Web APIs
: "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 function wants a cryptokey object const key_encoded = await crypto.subtle.
importkey( "raw", key.buffer, 'aes-ctr' , false, ["encrypt", "decrypt"]); const encrypted_content = await window.crypto.subtle.encrypt( { name: "aes-ctr", counter: iv, length: 128 }, key_encoded, data ); //uint8array console.log(encrypted_content); aes-cbc this code fetches the contents of a text box, encodes it for encryption, and encrypts it using aes in...
TouchEvent - Web APIs
using with addeventlistener() and preventdefault() it's
important to note that in many cases, both touch and mouse events get sent (in order to let non-touch-specific code still interact with the user).
TrackEvent - Web APIs
it's
important not to confuse trackevent with the rtctrackevent interface, which is used for tracks which are part of an rtcpeerconnection.
URL.createObjectURL() - Web APIs
important: if you still have code that relies on createobjecturl() to attach streams to media elements, you need to update your code to simply set srcobject to the mediastream directly.
Adding 2D content to a WebGL context - Web APIs
drawing the scene the most
important thing to understand before we get started is that even though we're only rendering a square plane object in this example, we're still drawing in 3d space.
Using textures in WebGL - Web APIs
note: it's
important to note that the loading of textures follows cross-domain rules; that is, you can only load textures from sites for which your content has cors approval.
WebGL best practices - Web APIs
another
important method for batching is texture atlasing, where multiple images are placed into a single texture, often like a checkerboard.
WebRTC connectivity - Web APIs
it's
important to keep in mind that a single ice session may result in the controlling agent choosing more than one candidate pair.
Using DTMF with WebRTC - Web APIs
html the html for this example is very basic; there are only three elements of
importance: an <audio> element to play the audio received by the rtcpeerconnection being "called." a <button> element to trigger creating and connecting the two rtcpeerconnection objects, then sending the dtmf tones.
Writing a WebSocket server in Java - Web APIs
here's an implementation split into parts:
import java.io.ioexception;
import java.io.inputstream;
import java.io.outputstream;
import java.net.serversocket;
import java.net.socket;
import java.security.messagedigest;
import java.security.nosuchalgorithmexception;
import java.util.base64;
import java.util.scanner;
import java.util.regex.matcher;
import java.util.regex.pattern; public class websocket { public static void main(string[] args) thr...
Inputs and input sources - Web APIs
in order to do anything meaningful involving scanning of profiles beyond basic identification of features, you may need to
import the json profile database from the webxr input profiles registry.
Lighting a WebXR setting - Web APIs
by altering the accuracy of these functions, the browser makes the data less consistent, and,
importantly, makes the data generated by two computers differ, even in the same setting.
WebXR Device API - Web APIs
including other media positional audio in a 3d environment in 3d environments, which may either be 3d scenes rendered to the screen or a mixed reality experience experienced using a headset, it's
important for audio to be performed so that it sounds like it's coming from the direction of its source.
Web Animations API Concepts - Web APIs
this article will introduce you to the
important concepts behind the waapi, providing you with a theoretical understanding of how it works so you can use it effectively.
Example and tutorial: Simple synth keyboard - Web APIs
second, and more
importantly, we are using this to handle mouseover for cases where the user is dragging from note to note, and we only want to start playing the note if the mouse is pressed when it enters the element.
Using the Web Speech API - Web APIs
this accepts as parameters the string we want to add, plus optionally a weight value that specifies the
importance of this grammar in relation of other grammars available in the list (can be from 0 to 1 inclusive.) the added grammar is available in the list as a speechgrammar object instance.
Functions and classes available to Web Workers - Web APIs
e yes, on workerglobalscope yes, on workerglobalscope yes, on window setinterval() yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on window settimeout() yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on window
importscripts() yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope no close() yes, on workerglobalscope yes, on workerglobalscope yes, but is a no-op.
Window.applicationCache - Web APIs
important: application cache is deprecated as of firefox 44, and is no longer available in insecure contexts from firefox 60 onwards (bug 1354175, currently nightly/beta only).
window.cancelAnimationFrame() - Web APIs
var myreq; function step(timestamp) { var progress = timestamp - start; d.style.left = math.min(progress / 10, 200) + 'px'; if (progress < 2000) { // it's
important to update the requestid each time you're calling requestanimationframe myreq = requestanimationframe(step); } } myreq = requestanimationframe(step); // the cancelation uses the last requestid cancelanimationframe(myreq); specifications specification status comment html living standardthe definition of 'cancelanimationframe()' in that specification.
Window: popstate event - Web APIs
note: when writing functions that process popstate event it is
important to take into account that properties like window.location will already reflect the state change (if it affected the current url), but document might still not.
XMLSerializer - Web APIs
note: in the real world, you should usually instead call
importnode() method to
import the new node into the dom, then call one of the following methods to add the node to the dom tree: the document and element methods append() and prepend() the node.replacewith() method (to replace an existing node with the new one) the document.insertadjacentelement() and element.insertadjacentelement() methods.
XRHandedness - Web APIs
examples one
important usage scentario for handedness is to determine which hand a controller is in so you can draw a representation of that hand (or the device that hand is controlling) in virtual space.
XRInputSource.handedness - Web APIs
examples one
important usage scentario for handedness is to determine which hand a controller is in so you can draw a representation of that hand (or the device that hand is controlling) in virtual space.
XRPermissionDescriptor.mode - Web APIs
important: the immersive-ar mode is defined by the webxr augmented reality module, which is not yet stable and should not be used other than for testing and experimentation.
ARIA: dialog role - Accessibility
it is
important for developers to ensure that content outside of the modal dialog is inaccessible to all users while the modal dialog is active.
Web applications and ARIA FAQ - Accessibility
for example, a screen reader uses this api to read the user interface with a text-to-speech engine, a magnifier uses it to highlight
important or active areas of the screen, and an onscreen keyboard might use it to provide the most efficient keyboard layout for a given context or ui control.
Basic form hints - Accessibility
when implementing forms using traditional html form-related elements, it is
important to provide labels for controls, and explicitly associate a label with its control.
Keyboard - Accessibility
note: one
important exception to this rule is if the element has role="document" applied to it, inside an interactive context (such as role="application").
Operable - Accessibility
this is very
important so that keyboard users do not get trapped on specific sections of your apps.
Text labels and names - Accessibility
you can change your details at any time in the user account section.</p> <button>close</button> </div> see also role="dialog" role="alertdialog" aria-label aria-labelledby wai-aria: dialog role dialog authoring practices documents must have a title it is
important on each html document to include a <title> that describes the page's purpose.
Accessibility
mobile accessibility with web access on mobile devices being so popular, and popular platforms such as ios and android having fully-fledged accessibility tools, it is
important to consider the accessibility of your web content on these platforms.
:-webkit-autofill - CSS: Cascading Style Sheets
note: the user agent style sheets of many browsers use !
important in their :-webkit-autofill style declarations, making them non-overrideable by webpages without resorting to javascript hacks.
::part() - CSS: Cascading Style Sheets
element::part(tab):hover { background-color: #0c0c0d19; border-color: #0c0c0d33; } tabbed-custom-element::part(tab):hover:active { background-color: #0c0c0d33; } tabbed-custom-element::part(tab):focus { box-shadow: 0 0 0 1px #0a84ff inset, 0 0 0 1px #0a84ff, 0 0 0 4px rgba(10, 132, 255, 0.3); } tabbed-custom-element::part(active) { color: #0060df; border-color: #0a84ff !
important; } javascript let template = document.queryselector("#tabbed-custom-element"); globalthis.customelements.define(template.id, class extends htmlelement { constructor() { super(); this.attachshadow({ mode: "open" }); this.shadowroot.appendchild(template.content); } }); result specifications specification status comment shadow partsthe definiti...
::placeholder - CSS: Cascading Style Sheets
it is
important to ensure that the contrast ratio between the color of the placeholder text and the background of the input is high enough that people experiencing low vision conditions will be able to read it while also making sure there is enough of a difference between the placeholder text and input text color that users do not mistake the placeholder for inputed data.
::selection - CSS: Cascading Style Sheets
if overridden, it is
important to ensure that the contrast ratio between the text and background colors of the selection is high enough that people experiencing low vision conditions can read it.
font-stretch - CSS: Cascading Style Sheets
on related at-rule@font-faceinitial valuenormalcomputed valueas specified formal syntax <font-stretch-absolute>{1,2}where <font-stretch-absolute> = normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> examples setting a percentage range for font-stretch the following find a local open sans font or
import it, and allow using the font for normal, semi-condensed and semi-expanded states.
font-weight - CSS: Cascading Style Sheets
d valueas specified formal syntax <font-weight-absolute>{1,2}where <font-weight-absolute> = normal | bold | <number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[1,1000]> examples setting normal font weight in a @font-face rule the following finds a local open sans font or
import it, and allows using the font for normal font weights.
Questions about CSS - CSS: Cascading Style Sheets
an
imported style sheet, using the css @
import notation to automatically
import and merge an external style sheet with the current style sheet style attributes specified by the viewer to the browser the default style sheet assumed by the browser in general, the web page creator's style sheet takes precedence, but it's recommended that browsers provide ways for the viewer to override the style attribute...
Grid wrapper - CSS: Cascading Style Sheets
accessibility concerns although grid enables us to position items anwhere (within reason), it is
important when placing items using css grid that your underlying markup follows a logical order (see css grid layout and accessibility for more details).
background-color - CSS: Cascading Style Sheets
accessibility concerns it is
important to ensure that the contrast ratio between the background color and the color of the text placed over it is high enough that people experiencing low vision conditions will be able to read the content of the page.
color-adjust - CSS: Cascading Style Sheets
exact the element's content has been specifically and carefully crafted to use colors, images, and styles in a thoughtful and/or
important way, such that being altered by the browser might actually make things worse rather than better.
color - CSS: Cascading Style Sheets
accessibility concerns it is
important to ensure that the contrast ratio between the color of the text and the background the text is placed over is high enough that people experiencing low vision conditions will be able to read the content of the page.
ime-mode - CSS: Cascading Style Sheets
users may correct the inappropriate behavior of sites that don't follow this recommendation by placing the following css into their user stylesheet: input[type=password] { ime-mode: auto !
important; } the mac version of gecko 1.9 (firefox 3) can't recover the previous state of the ime when a field for which it is disabled loses focus, so mac users may get grumpy when you use the disabled value.
opacity - CSS: Cascading Style Sheets
for example: background: rgba(0, 0, 0, 0.4); accessibility concerns if text opacity is adjusted, it is
important to ensure that the contrast ratio between the color of the text and the background the text is placed over is high enough that people experiencing low vision conditions will be able to read the content of the page.
outline-color - CSS: Cascading Style Sheets
if the color of the outline is adjusted, it is
important to ensure that the contrast ratio between it and the background the outline is placed over is high enough that people experiencing low vision conditions will be able to perceive it.
text-decoration-color - CSS: Cascading Style Sheets
accessibility concerns it is
important to ensure that the contrast ratio between the color of the text, the background the text is placed over, and the text decoration line is high enough that people experiencing low vision conditions will be able to read the content of the page.
text-emphasis - CSS: Cascading Style Sheets
css h2 { text-emphasis: triangle #d55; } html <h2>this is
important!</h2> result specifications specification status comment css text decoration module level 3the definition of 'text-emphasis' in that specification.
url() - CSS: Cascading Style Sheets
} @
import url("https://www.example.com/style.css"); @namespace url(http://www.w3.org/1999/xhtml); relative urls, if used, are relative to the url of the stylesheet (not to the url of the web page).
Ajax - Developer guides
asynchronous javascript and xml, while not a technology in itself, is a term coined in 2005 by jesse james garrett, that describes a "new" approach to using a number of existing technologies together, including html or xhtml, css, javascript, dom, xml, xslt, and most
importantly the xmlhttprequest object.
Using device orientation with 3D transforms - Developer guides
ections that should be applied to those values: the initial alpha value is 180 (device flat on the back, top of the screen pointing 12:00), so the rotatez value should be alpha - 180 the y axis of the screen coordinate system is inverted, such that translatey(100px) moves an element 100px down, so the rotatey value should be -gamma finally, the order of the three different rotations is very
important to accurately convert an orientation to a 3d rotation: rotatez, then rotatex and then rotatey.
Content categories - Developer guides
ly if a specific condition is fulfilled: <a>, if it contains only phrasing content <area>, if it is a descendant of a <map> element <del>, if it contains only phrasing content <ins>, if it contains only phrasing content <link>, if the itemprop attribute is present <map>, if it contains only phrasing content <meta>, if the itemprop attribute is present embedded content embedded content
imports another resource or inserts content from another mark-up language or namespace into the document.
HTML5 Parser - Developer guides
foreignobject and annotation-xml (and various less
important elements) establish a nested html scope, so you can nest svg, mathml and html as you’d expect to be able to nest them.
Developer guides
optimization and performance when building modern web apps and sites, it's
important to make your content work quickly and efficiently.
<input type="checkbox"> - HTML: Hypertext Markup Language
note: radio buttons are similar to checkboxes, but with an
important distinction — radio buttons are grouped into a set in which only one radio button can be selected at a time, whereas checkboxes allow you to turn single values on and off.
<input type="date"> - HTML: Hypertext Markup Language
label { display: flex; align-items: center; } span::after { padding-left: 5px; } input:invalid + span::after { content: '✖'; } input:valid+span::after { content: '✓'; }
important: client-side form validation is no substitute for validating on the server.
<input type="datetime-local"> - HTML: Hypertext Markup Language
div { margin-bottom: 10px; display: flex; align-items: center; } label { display: inline-block; width: 300px; } input:invalid+span:after { content: '✖'; padding-left: 5px; } input:valid+span:after { content: '✓'; padding-left: 5px; }
important: html form validation is not a substitute for scripts that ensure that the entered data is in the proper format.
<input type="month"> - HTML: Hypertext Markup Language
div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; }
important: html form validation is not a substitute for scripts that ensure that the entered data is in the proper format.
<input type="time"> - HTML: Hypertext Markup Language
try playing with the example now: here's a screenshot for those of you who aren't using a browser that supports time inputs:
important: html form validation is not a substitute for scripts that ensure that the entered data is in the proper format.
<input type="week"> - HTML: Hypertext Markup Language
try playing with the example now: here's'a screenshot for those of you who aren't using a supporting browser:
important: html form validation is not a substitute for scripts that ensure that the entered data is in the proper format.
<ins> - HTML: Hypertext Markup Language
because of this, it is
important to not abuse this technique and only apply it in situations where not knowing content has been inserted would adversely affect understanding.
<s> - HTML: Hypertext Markup Language
because of this, it is
important to not abuse this technique and only apply it in situations where not knowing content has been struck out would adversely affect understanding.
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
html in summaries this example adds some semantics to the <summary> element to indicate the label as
important: <details open> <summary><strong>overview</strong></summary> <ol> <li>cash on hand: $500.00</li> <li>current invoice: $75.30</li> <li>due date: 5/6/19</li> </ol> </details> specifications specification status comment html living standardthe definition of '<summary>' in that specification.
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
other elements to consider using in most cases, you should use an element other than <u>, such as: <em> to denote stress emphasis <b> to draw attention to text <mark> to mark key words or phrases <strong> to indicate that text has strong
importance <cite> to mark the titles of books or other publications <i> to denote technical terms, transliterations, thoughts, or names of vessels in western texts to provide textual annotations (as opposed to the non-textual annotations created with <u>), use the <ruby> element.
itemprop - HTML: Hypertext Markup Language
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 equivalent <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> </...
Link types - HTML: Hypertext Markup Language
<link> <a>, <area>, <form>
import html
imports <link> <a>, <area>, <form> index obsolete since html5 indicates that the page is part of a hierarchical structure and that the hyperlink leads to the top level resource of that structure.
HTTP conditional requests - HTTP
building 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.
Configuring servers for Ogg media - HTTP
it's
important to note that it appears that oggz-info makes a read pass of the media in order to calculate its duration, so it's a good idea to store the duration value in order to avoid lengthy delays while the value is calculated for every http request of your ogg media.
Content negotiation - HTTP
compressing http messages is one of the most
important ways to improve the performance of a web site, it shrinks the size of the data transmitted and makes better use of the available bandwidth; browsers always send this header and the server should be configured to abide to it and to use compression.
CSP: style-src - HTTP
examples violation cases given this csp header: content-security-policy: style-src https://example.com/ the following stylesheets are blocked and won't load: <link href="https://not-example.com/styles/main.css" rel="stylesheet" type="text/css" /> <style> #inline-style { background: red; } </style> <style> @
import url("https://not-example.com/styles/print.css") print; </style> as well as styles loaded using the link header: link: <https://not-example.com/styles/stylesheet.css>;rel=stylesheet inline style attributes are also blocked: <div style="display:none">foo</div> as well as styles that are applied in javascript by setting the style attribute directly, or by setting csstext: document.queryselect...
Digest - HTTP
some of the supported algorithms, including unixsum and md5 are subject to collisions and are thus not suitable for applications in which collision-resistance is
important.
Referer - HTTP
important: although this header has many innocent uses it can have undesirable consequences for user security and privacy.
Want-Digest - HTTP
some of the supported algorithms, including unixsum and md5 are subject to collisions and are thus not suitable for applications in which collision-resistance is
important.
HTTP Index - HTTP
13 compression in http guide, http, compression compression is an
important way to increase the performance of a web site.
Link prefetching FAQ - HTTP
it is
important that websites adopt <link> tag based prefetching instead of trying to roll-in silent downloading using various js/dom hacks.
An overview of HTTP - HTTP
although
important to diagnose network problems, the underlying layers are mostly irrelevant to the description of http.
HTTP
http cache caching is very
important for fast web sites.
CSS Houdini
with worklets, you can create modular css, requiring a single line of javascript to
import configureable components: no pre-processors, post-processors or javascript frameworks needed.
Grammar and types - JavaScript
let mylist = ['home', , 'school', , ]; understanding the behavior of extra commas is
important to understanding javascript as a language.
JavaScript Guide - JavaScript
methods getter and setter details of the object model prototype-based oop creating object hierarchies inheritance promises guarantees chaining error propagation composition timing iterators and generators iterators iterables generators meta programming proxy handlers and traps revocable proxy reflect javascript modules exporting
importing default exports renaming features aggregating modules dynamic module loading next » ...
Classes - JavaScript
class rectangle { constructor(height, width) { this.height = height; this.width = width; } } hoisting an
important difference between function declarations and class declarations is that function declarations are hoisted and class declarations are not.
Array.from() - JavaScript
this is especially
important for certain array subclasses, like typed arrays, since the intermediate array would necessarily have values truncated to fit into the appropriate type.
Reflect.construct() - JavaScript
/ false console.log(obj1 instanceof otherclass) // true console.log(obj2 instanceof otherclass) // true //another example to demonstrate below: function func1(a, b, c, d) { console.log(arguments[3]); } function func2(d, e, f, g) { consol.log(arguments[3]); } let obj1 = reflect.construct(func1, ['i', 'love', 'my', 'india']) obj1 however, while the end result is the same, there is one
important difference in the process.
String.prototype.normalize() - JavaScript
// 1 console.log(string2.length); // 2 string1 = string1.normalize('nfkd'); string2 = string2.normalize('nfkd'); console.log(string1); // ff <- visual appearance changed console.log(string2); // ff console.log(string1 === string2); // true console.log(string1.length); // 2 console.log(string2.length); // 2 when applying compatibility normalization it's
important to consider what you intend to do with the strings, since the normalized form may not be appropriate for all applications.
WeakRef - JavaScript
it's also
important to avoid relying on any specific behaviors not guaranteed by the specification.
WebAssembly.Global() constructor - JavaScript
a webassembly.global() constructor creates a new global object representing a global variable instance, accessible from both javascript and
importable/exportable across one or more webassembly.module instances.
WebAssembly.Global - JavaScript
a webassembly.global object represents a global variable instance, accessible from both javascript and
importable/exportable across one or more webassembly.module instances.
WebAssembly.Memory() constructor - JavaScript
the following example (see memory.html on github, and view it live also) fetches and instantiates the loaded memory.wasm byte code using the webassembly.instantiatestreaming() method, while
importing the memory created in the line above.
WebAssembly.Memory.prototype.buffer - JavaScript
examples using buffer the following example (see memory.html on github, and view it live also) fetches and instantiates the loaded memory.wasm byte code using the webassembly.instantiatestreaming() method, while
importing the memory created in the line above.
WebAssembly.Memory - JavaScript
the following example (see memory.html on github, and view it live also) fetches and instantiates the loaded memory.wasm byte code using the webassembly.instantiatestreaming() method, while
importing the memory created in the line above.
WebAssembly.compileStreaming() - JavaScript
var
importobject = {
imports: {
imported_func: arg => console.log(arg) } }; webassembly.compilestreaming(fetch('simple.wasm')) .then(module => webassembly.instantiate(module,
importobject)) .then(instance => instance.exports.exported_func()); the resulting module instance is then instantiated using webassembly.instantiate(), and the exported function invoked.
eval() - JavaScript
more
importantly, a third-party code can see the scope in which eval() was invoked, which can lead to possible attacks in ways to which the similar function is not susceptible.
delete operator - JavaScript
however, it is
important to consider the following scenarios: if the property which you are trying to delete does not exist, delete will not have any effect and will return true.
const - JavaScript
my_fav = 20; // my_fav is 7 console.log('my favorite number is: ' + my_fav); // trying to redeclare a constant throws an error // uncaught syntaxerror: identifier 'my_fav' has already been declared const my_fav = 20; // the name my_fav is reserved for constant above, so this will fail too var my_fav = 20; // this throws an error too let my_fav = 20; block scoping it's
important to note the nature of block scoping.
let - JavaScript
break; } however, it's
important to point out that a block nested inside a case clause will create a new block scoped lexical environment, which will not produce the redeclaration errors shown above.
var - JavaScript
it's
important to point out that the hoisting will affect the variable declaration, but not its value's initialization.
with - JavaScript
where performance is
important, 'with' should only be used to encompass code blocks that access members of the specified object.
Strict mode - JavaScript
second, while es5 unconditionally reserves the words class, enum, export, extends,
import, and super, before firefox 5 mozilla reserved them only in strict mode.
JavaScript reference - JavaScript
or statements javascript statements and declarations control flowblock break continue empty if...else switch throw try...catch declarations var let const functions and classes function function* async function return class iterations do...while for for each...in for...in for...of for await...of while other debugger
import label with expressions and operators javascript expressions and operators.
Web media technologies
positional audio in a 3d environment in 3d environments, which may either be 3d scenes rendered to the screen or a mixed reality experience experienced using a headset, it's
important for audio to be performed so that it sounds like it's coming from the direction of its source.
OpenSearch description format
the xmlns attribute is
important — without it you could get the error message "firefox could not download the search plugin".
Lazy loading - Web Performance
entry point splitting: separates code by entry point(s) in the app dynamic splitting: separates code where dynamic
import() statements are used javascript script type module any script tag with type="module" is treated like a javascript module and is deferred by default.
Understanding latency - Web Performance
in terms of performance optimization, it's
important to optimize to reduce causes of lacency and to test site performance emulating high latency to optimizer for users with lousy connections.
Progressive loading - Progressive web apps (PWAs)
first meaningful paint it's
important to deliver something meaningful to the user as soon as possible — the longer they wait for the page to load, the bigger the chance they will leave before waiting for everything to finish.
The building blocks of responsive design - Progressive web apps (PWAs)
in the snapshot example, we ended up with slightly different code: x-card:nth-child(1) video, x-card:nth-child(2) img { width: 100%; … } this is because in our case, we do in fact want the video and image to stretch to always fill their containers no matter what — a subtle but
important difference from max-width — and therefore always be the same size.
color-rendering - SVG: Scalable Vector Graphics
style="transform: translatex(240px);" /> <text x="290" y="50%" color-rendering="optimizespeed">speed-optimized</text> </svg> usage notes value auto | optimizespeed | optimizequality default value auto animatable yes auto indicates that the user agent shall make appropriate tradeoffs to balance speed and quality, but quality shall be given more
importance than speed.
image-rendering - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following element: <image> usage notes value auto | optimizespeed | optimizequality default value auto animatable yes auto indicates that the user agent shall make appropriate tradeoffs to balance speed and quality, but quality shall be given more
importance than speed.
in - SVG: Scalable Vector Graphics
workaround for backgroundimage instead of using in="backgroundimage", we need to
import one of the images to blend inside the filter itself, using an <feimage> element.
shape-rendering - SVG: Scalable Vector Graphics
cle cx="320" cy="100" r="100" shape-rendering="crispedges"/> </svg> usage notes value auto | optimizespeed | crispedges | geometricprecision default value auto animatable yes auto this value indicates that the user agent shall make appropriate tradeoffs to balance speed, crisp edges and geometric precision, but with geometric precision given more
importance than speed and crisp edges.
text-rendering - SVG: Scalable Vector Graphics
ext-rendering="optimizelegibility">optimized legibility</text> </svg> usage notes value auto | optimizespeed | optimizelegibility | geometricprecision default value auto animatable yes auto this value indicates that the user agent shall make appropriate tradeoffs to balance speed, legibility and geometric precision, but with legibility given more
importance than speed and geometric precision.
visibility - SVG: Scalable Vector Graphics
="nav-toggle-button" > <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewbox="0 0 24 24" class="button-icon"> <path d="m16.59 8.59l12 13.17 7.41 8.59 6 10l6 6 6-6z" /> <path d="m12 8l-6 6 1.41 1.41l12 10.83l4.59 4.58l18 14z" class="invisible" /> <path d="m0 0h24v24h0z" fill="none" /> </svg> <span> click me </span> </button> css svg { display: inline !
important; } span { vertical-align: 50%; } button { line-height: 1em; } .invisible { visibility: hidden; } javascript document.queryselector("button").addeventlistener("click", function (evt) { this.queryselector("svg > path:nth-of-type(1)").classlist.toggle("invisible"); this.queryselector("svg > path:nth-of-type(2)").classlist.toggle("invisible"); }); specifications specifica...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
and ::first-line on <text> implementation status unknown svg and html style sheets in html document with inline svg applying to whole document content implementation status unknown presentation attributes on any svg namespaced element implementation status unknown display behavior of <style> defined via ua style sheet implementation status unknown !
important user agent style rules controlling never-rendered elements implementation status unknown :focus and ::selection styles implementation status unknown geometry change notes x and y attributes removed from <pattern> and <filter> implementation status unknown auto value of width and height computes to 0 but 100% on <svg> not implemente...
SVG image element - SVG: Scalable Vector Graphics
e will be rendered inside an svg object: <?xml version="1.0" standalone="no"?> <!doctype svg public "-//w3c//dtd svg 1.1//en" "http://www.w3.org/graphics/svg/1.1/dtd/svg11.dtd"> <svg width="5cm" height="4cm" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image href="firefox.jpg" x="0" y="0" height="50px" width="50px"/> </svg> there are some
important things to take note of (referenced from the w3 specs): if you do not set the x or y attributes, they will be set to 0.