Search completed in 1.45 seconds.
299 results for "scheme":
Your results are loading. Please wait...
prefers-color-scheme - CSS: Cascading Style Sheets
Syntax light Indicates that user has notified the system that they prefer an interface that has a light theme, or has not expressed an active preference. ...
... Syntax light Indicates that user has notified the system that they prefer an interface that has a light theme, or has not expressed an active preference. ...
...r dark color theme. Syntax light Indicates that user has notified the system that they prefer an interface that has a light theme, or has not expressed an active preference. dark Indicates that user has notified the system that they prefer an interface that has a dark theme. Examples The elements below have an initial color theme. ...
...And 10 more matches
URIScheme - Archive of obsolete content
List of Mozilla supported URI schemes List of URI Schemes http:// by default, port 80 https:// by default, port 443 (SSL) ftp:// by default, port 21 file:// : file:///etc/hosts on Unix/Linux, file:///c:/some/file.txt on Windows. moz-icon://.ext?size=32 : you can replace ext by your some file extension like js, css, xul, xml, etc. and the size number by 1 to 127 mailto:emailaddress@domain.com about: chrome:// ... Preferences See gecko.handlerService.schemes.* Scripting Interface See nsIProtocolHandler to create a new protocol/scheme. about: about: about:config about:crashes about:mozilla about:plugins about:robots ... ...
URIs and URLs - Archive of obsolete content
uence of characters with a restricted syntax. A URI can be further classified as a locator, a name, or both. The term "Uniform Resource Locator" (URL) refers to the subset of URI that identify resources via a representation of their primary access mechanism (e.g., their network "location"), rather than identifying the resource by name or by some other attribute(s) of that resource. ... The URI scheme defines the namespace of the URI, and thus may further restrict the syntax and semantics of identifiers using that scheme. Although many URL schemes are named after protocols, this does not imply that the only way to access the URL's resource is via the named protocol. Gateways, proxies, caches, and name resolution services might be used to access some resources, independent of the protocol of th...
...URL's resource is via the named protocol. Gateways, proxies, caches, and name resolution services might be used to access some resources, independent of the protocol of their origin, and the resolution of some URL may require the use of more than one protocol (e.g., both DNS and HTTP are typically used to access an "http" URL's resource when it can't be found in a local cache). In Necko every URI scheme is represented by a protocol handler. Sometimes a protocol handler represents more than one scheme. The protocol handler provides scheme specific information and methods to create new URIs of the schemes it supports. One of the main Necko goals is to provide a "plug able" protocol support. This means that it should be possible to add new protocols to Necko just by implementing nsIProtocolHandler ...
...it supports. One of the main Necko goals is to provide a "plug able" protocol support. This means that it should be possible to add new protocols to Necko just by implementing nsIProtocolHandler and nsIChannel. It also might be necessary to implement a new urlparser for a new protocol but that might not be necessary because Necko already provides URI implementations that can deal with a number of schemes, by implementing the generic urlparser defined in RFC 2396. nsIURI and nsIURL In a strict sense Necko does only know URLs, URIs by the above definition are much too generic to be properly represented inside a library. There are however two interfaces which loosely relate to the distinction between URI and URL as per the above definition: nsIURI and nsIURL. nsIURI represents access to a very simp...
...And 12 more matches
nsIURI
n the URI. ...
...Follows the IDNA draft specification for converting internationalized domain names (UTF-8) to ASCII for compatibility with existing Internet infrastructure. Read only. Note: IPv6 addresses are not enclosed in square brac...
...Follows the IDNA draft specification for converting internationalized domain names (UTF-8) to ASCII for compatibility with existing Internet infrastructure. Read only. Note: IPv6 addresses are not enclosed in square brackets. ...
...And 11 more matches
nsIIOService
rovides a set of URL parsing utility functions. These are provided as a convenience to the programmer and in some cases to improve performance by eliminating intermediate data structures and interfaces. Inherits from: nsISupports Last changed in Gecko 1.2 This interface duplicates many of the nsIProtocolHandler methods in a protocol handler independent way (For example newURI() inspects the scheme in order to delegate creation of the new URI to the appropriate protocol handler). Note: nsIIOService may only be used from the main thread. Implemented by @mozilla.org/network/io-service;1 as a service: var iOService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); Method overview boolean allowPort(in long a...
...gate creation of the new URI to the appropriate protocol handler). Note: nsIIOService may only be used from the main thread. ...
...e appropriate protocol handler). Note: nsIIOService may only be used from the main thread. ...
...And 10 more matches
nsIExternalProtocolService
sIExternalProtocolService.idlScriptable The external protocol service is used for finding and launching web handlers (a la registerProtocolHandler in the HTML5 draft) or platform-specific applications for handling particular protocols. Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) You can ask the external protocol service if it has an external handler for a given protocol scheme. And you can ask it to load the url using the default handler. Method overview boolean externalProtocolHandlerExists(in string aProtocolScheme); AString getApplicationDescription(in AUTF8String aScheme); nsIHandlerInfo getProtocolHandlerInfo(in ACString aProtocolScheme); nsIHandlerInfo getProtocolHandlerInfoFromOS(in ACString aProtocolScheme, out boolean aFound); boolean isExposedPr...
...ad the url using the default handler. Method overview boolean externalProtocolHandlerExists(in string aProtocolScheme); AString getApplicationDescription(in AUTF8String aScheme); nsIHandlerInfo getProtocolHandlerInfo(in ACString aProtocolScheme); nsIHandlerInfo getProtocolHandlerInfoFromOS(in ACString aProtocolScheme, out boolean aFound); boolean isExposedProtocol(in string aProtocolScheme); void loadURI(in nsIURI aURI, [optional] in nsIInterfaceRequestor aWindowContext); void loadUrl(in nsIURI aURL); void setProtocolHandlerDefaults(in nsIHandlerInfo aHandlerInfo, in boolean aOSHandlerExists); Methods externalProtocolHandlerExists() Check whether a handler for a specific protocol exists. Specifically, this looks to see whether there are any known possible application han...
...colHandlerDefaults(in nsIHandlerInfo aHandlerInfo, in boolean aOSHandlerExists); Methods externalProtocolHandlerExists() Check whether a handler for a specific protocol exists. Specifically, this looks to see whether there are any known possible application handlers in either the nsIHandlerService datastore or registered with the OS. boolean externalProtocolHandlerExists( in string aProtocolScheme ); Parameters aProtocolScheme The scheme from a url: http, ftp, mailto, and so on. Note: aProtocolScheme should not include a trailing colon, which is part of the URI syntax, not part of the scheme itself. That is, pass "mailto" not "mailto:". Return value true if we have a handler and false otherwise. getApplicationDescription() Gets a human-readable description for the application responsibl...
...And 9 more matches
Navigator.registerProtocolHandler() - Web APIs
The Navigator method registerProtocolHandler() lets web sites register their ability to open or handle particular URL schemes (aka protocols). For example, this API lets webmail sites open mailto: URLs, or VoIP sites open tel: URLs. Syntax navigator.registerProtocolHandler(scheme, url, title); Note: Recently updated to navigator.registerProtocolHandler(scheme, url), but no browsers currently support this version. Parameters scheme A string containing the protocol the site wishes to handle. For example, you can register to handle SMS text message links by passing the "sms" scheme. url A string containing the URL of the handler. ...
... currently support this version. Parameters scheme A string containing the protocol the site wishes to handle. For example, you can register to handle SMS text message links by passing the "sms" scheme. url A string containing the URL of the handler. This URL must include %s, as a placeholder that will be replaced with the escaped URL to be handled. Note: The handler URL must us the https scheme. Older browsers also supported http. title A human-readable title string for the handler. This will be displayed to the user, such as prompting "Allow this site to handle [scheme] links?" or listing registered handlers in the browser's settings. Note: The title has been removed from the spec due to spoofing concerns, but all current browsers still require it. It is recommended to always se...
...The title has been removed from the spec due to spoofing concerns, but all current browsers still require it. It is recommended to always set the title, since browsers that support the updated spec most likely will be backwards-compatible and still accept the title (but not use it). Exceptions SecurityError The user agent blocked the registration. ...
...And 7 more matches
Index - Web APIs
Web › API › Index
ious character encodings, including legacy non-UTF-8 encodings. 1232 Encrypted Media Extensions API API, EME, Encrypted Media Extensions, Encrypted Media Extensions API, EncryptedMediaExtensions, NeedsContent, Overview, Reference The Encrypted Media Extensions API provides interfaces for controlling the playback of content which is subject to a digital restrictions management scheme. 1233 ErrorEvent API, Event, Worker API The ErrorEvent interface represents events providing information related to errors in scripts or in files. 1234 Event API, Constructor, DOM, Event, Interface, Reference, UI, listener The Event interface represents an event which takes place in the DOM. 1235 Comparison of Event Targets DOM, Gecko, Guid...
...rectories must be empty before they can be removed. 1381 FileSystemEntry.toURL() API, File System API, File and Directory Entries API, FileSystemEntry, Files, Method, Non-standard, Reference, toURL The FileSystemEntry interface's method toURL() creates and returns a string containing a URL which can be used to identify the file system entry. This is done by exposing a new URL scheme--filesystem:--that can be used as the value of src and href attributes. 1382 FileSystemEntrySync API, EntrySync, File API, File System API, File and Directory Entries API, FileSystemEntrySync, Interface, Non-standard, Offline, Reference, filesystem The FileSystemEntrySync interface of the File and Directory Entries API represents an entry in a file system; it can be either a ...
...RL API The HTMLHyperlinkElementUtils.port property is a USVString containing the port number of the URL. If the URL does not contain an explicit port number, it will be set to ''. 1698 HTMLHyperlinkElementUtils.protocol API, Experimental, HTMLHyperlinkElementUtils, Property, URL API The HTMLHyperlinkElementUtils.protocol property is a USVString representing the protocol scheme of the URL, including the final ':'. 1699 HTMLHyperlinkElementUtils.search API, Experimental, HTMLHyperlinkElementUtils, Property, Reference, URL API The HTMLHyperlinkElementUtils.search property is a search string, also called a query string, that is USVString containing a '?' followed by the parameters of the URL. 1700 HTMLHyperlinkElementUtils.toString() API...
...And 6 more matches
Standard metadata names - HTML: Hypertext Markup Language
Web › HTML › Element › meta › name
are defined, the no-referrer policy is applied. theme-color: indicates a suggested color that user agents should use to customize the display of the page or of the surrounding user interface. The content attribute contains a valid CSS <color>. ...
...is applied. theme-color: indicates a suggested color that user agents should use to customize the display of the page or of the surrounding user interface. The content attribute contains a valid CSS <color>. Standard metadata names defined in other specifications The CSS Color Adjustment specification defines the following metadata name: color-scheme: specifies one or more color schemes with which the document is compatible. The browser will use this information in tandem with the user's browser or device settings to determine what colors to use for everything from background and foregrounds to form controls and scrollbars. The primary use for <meta name="color-scheme"> is to indicate compatibility with--and order of preference for--light and dark color modes. The value o...
...atible. The browser will use this information in tandem with the user's browser or device settings to determine what colors to use for everything from background and foregrounds to form controls and scrollbars. The primary use for <meta name="color-scheme"> is to indicate compatibility with--and order of preference for--light and dark color modes. ...
...And 6 more matches
Debugging on Mac OS X
", then click Add. (These will then be progressively added under the root item <project-name> in the left-hand pane. Note that subdirectories may initially appear to be empty, but they too will progressively be populated as Xcode processes the sourse files. Once done, you should be able to open any file quickly by hitting Cmd-Shift-O and typing in the name of a file.) In the Product menu, select Scheme > New Scheme and name your scheme (for example, "Debug"). After you click OK, Xcode should open the settings window for the new scheme. (If not, then open its settings from the Product > Edit Scheme menu.) Select "Run" on the left-hand side of the settings window, then select the "Info" tab. Set the Executable by clicking on "None" and selecting "Other...". A new dialog titled "Choose an executa...
...file that you want to debug (Firefox.app, NightlyDebug.app etc). The .app file is typically found inside the dist folder in your build directory. If you are debugging Firefox, Thunderbird, or some other application that supports multiple profiles, using a separate profile for debugging purposes is recommended. See "Having a profile for debugging purposes" below. Select the "Arguments" tab in the scheme editor, and click the '+' below the "Arguments passed on launch" field. Add "-P profilename", where profilename is the name of a profile you created previously. Repeat that to also add the argument "-no-remote". Also in the "Arguments" panel, you may want to add an environment variable MOZ_DEBUG_CHILD_PROCESS set to the value 1 to help with debugging e10s. Select "Build" from the left of the sc...
... At this point you can run the application from Xcode, and when you pause or hit breakpoints it should show open the correct source file at the correct line. ...
...And 3 more matches
xml:base support in old browsers - Archive of obsolete content
Before using this code, check if your browser has native support for Node.baseURI. These two functions aim to allow some support for xml:base. Note however, that this code is not based on a thorough examination of the specs related to forming base URIs and could well have a number of errors. However, it is working in some of the cases tested. ...
...seURI. These two functions aim to allow some support for xml:base. Note however, that this code is not based on a thorough examination of the specs related to forming base URIs and could well have a number of errors. However, it is working in some of the cases tested. ...
...owever, that this code is not based on a thorough examination of the specs related to forming base URIs and could well have a number of errors. However, it is working in some of the cases tested. ...
...And 2 more matches
Index - Archive of obsolete content
Safe Browsing: Design Documentation This documentation now lives on the main Mozilla Wiki, see https://wiki.mozilla.org/Phishing_Protection:_Design_Documentation. 633 Safely loading URIs Add-ons, Extensions, Security Not all URI loads are safe. For example, loading some file: URIs can hang the browser or even crash the operating system in some cases. Some other schemes are used internally by Mozilla modules to communicate with each other. Finally, some URIs (e.g. chrome: give the loaded page expanded privileges. If a web page gets access to a window with such expanded privileges, it may be able to abuse it to gain access to those privileges itself. 634 Same origin policy for XBL Same-origin policy, Security, XBL The same origin policy used...
...ing Mozilla Tuning pageload can be beneficial if you know what you're doing. Firefox (and all Mozilla Products/Projects which do page-loading) ship with what are considered the "best" settings for the most cases. This document explains which preferences to tweak to affect your pageload time. You use the URL about:config or the file prefs.js in your profile to change these. 676 URIScheme Necko, NeedsUpdate, URI, URL List of Mozilla supported URI schemes 677 URIs and URLs Guide, Mozilla, Necko, NeedsUpdate Handling network and locally retrievable resources is a central part of Necko. Resources are identified by URI "Uniform Resource Identifier" (Taken from RFC 2396): 678 Uriloader Uriloader Uriloader: Responsible for the dispatch...
...(W3C) Recommendations and drafts from the XML family of specifications are supported, as well as other related technologies. 704 XPInstall XPInstall, XPInstall_API_reference No summary! 705 Creating XPI Installer Modules XPInstall Mozilla has introduced major changes to the way that themes and all the other parts of the UI are packaged. This new packaging scheme is called XPI (pronounced "zippy"), and interacts with XPInstall. A XPI file typically contains the resources to be installed (in this case the barley.jar we want to have installed in the Mozilla/bin/chrome/ directory) and an install script that guides the installation process. 706 Install Wizards (aka: Stub Installers) XPInstall No summary! 707 Mac stub installer ...
...And 2 more matches
Examine and edit CSS - Firefox Developer Tools
n the Inspector's CSS pane. Examine CSS rules The Rules view lists all the rules that apply to the selected element, ordered from most-specific to least-specific: The four buttons on the right top of the rules view allow you to change the display of certain CSS and rules view features. You can: toggle pseudo-classes; toggle classes; add a new rule; change the display based on the color scheme preference (as of Firefox 72, you must set devtools.inspector.color-scheme-simulation.enabled to true in the Configuration Editor to enable this feature); change the display based on print media rules. A warning icon appears next to unsupported CSS properties or rules that have invalid values. This can help you understand why certain styles are not being applied. In the following example, a ...
...mplete cascade for the given property. This makes it easy to see which rule is overriding the declaration: View @media rules for Print You can toggle the display into a mode that emulates @media rules for print. When on, any rules defined for printing the page will be displayed similar to the "Print Preview" mode that many word processing applications provide. ...
... is overriding the declaration: View @media rules for Print You can toggle the display into a mode that emulates @media rules for print. When on, any rules defined for printing the page will be displayed similar to the "Print Preview" mode that many word processing applications provide. ...
...And 2 more matches
<a>: The Anchor element - HTML: Hypertext Markup Language
Web › HTML › Element › a
media type (from the (Content-Type header, the start of a data: URL, or Blob.type for a blob: URL) Defining a value suggests it as the filename. / and \ characters are converted to underscores (_). Filesystems may forbid other characters in filenames, so browsers will adjust the suggested name if necessary. ...
...ary. Notes: download only works for same-origin URLs, or the blob: and data: schemes. If Content-Disposition has a different filename than download, the header takes priority. (If Content-Disposition: inline, Firefox prefers the header while Chrome prefers download.) href The URL that the hyperlink points to. Links are not restricted to HTTP-based URLs -- they can use any URL scheme supported by browsers: Sections of a page with fragment URLs Pieces of media files with media fragments Telephone numbers with tel: URLs Email addresses with mailto: URLs While web browsers may not support other URL schemes, web sites can with registerProtocolHandler() hreflang Hints at the human language of the linked URL. No built-in functionality. Allowed values are the same...
...kbox menuitem menuitemcheckbox menuitemradio option radio switch tab treeitem When href attribute is not present: any DOM interface HTMLAnchorElement Examples Linking to an absolute URL HTML <a href="https://www.mozilla.com"> Mozilla </a> Result Linking to relative URLs HTML <a href="//example.com">Scheme-relative URL</a> <a href="/docs/Web/HTML">Origin-relative URL</a> <a href="./p">Directory-relative URL</a> CSS a { display: block; margin-bottom: 0.5em } Result Linking to an element on the same page <!-- <a> element links to the section below --> <p><a href="#Section_further_down"> Jump to the heading below </a></p> <!-- Heading to link to --> <h2 id="Section_further_down">Section f...
...And 2 more matches
HTTP authentication - HTTP
ernames and passwords. Firefox once used ISO-8859-1, but changed to utf-8 for parity with other browsers and to avoid potential problems as described in bug 1419658. WWW-Authenticate and Proxy-Authenticate headers The WWW-Authenticate and Proxy-Authenticate response headers define the authentication method that should be used to gain access to a resource. They must specify which authentication scheme is used, so that the client that wishes to authorize knows how to provide the credentials. The syntax for these headers is the following: WWW-Authenticate: <type> realm=<realm> Proxy-Authenticate: <type> realm=<realm> Here, <type> is the authentication scheme ("Basic" is the most common scheme and introduced below). The realm is used to describe the protected area or to indicate the scope of ...
...te" or similar, so that the user knows to which space they are trying to get access to. Authorization and Proxy-Authorization headers The Authorization and Proxy-Authorization request headers contain the credentials to authenticate a user agent with a (proxy) server. ...
...-Authorization headers The Authorization and Proxy-Authorization request headers contain the credentials to authenticate a user agent with a (proxy) server. Here, the <type> is needed again followed by the credentials, which can be encoded or encrypted depending on which authentication scheme is used. Authorization: <type> <credentials> Proxy-Authorization: <type> <credentials> Authentication schemes The general HTTP authentication framework is used by several authentication schemes. ...
...And 2 more matches
CSP: connect-src - HTTP
If this directive is absent, the user agent will look for the default-src directive. Syntax One or more sources can be allowed for the connect-src policy: Content-Security-Policy: connect-src <source>; Content-Security-Policy: connect-src <source> <source>; Sources <source> can be one of the following: <host-source> Internet hosts by name or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attemp...
... data: Allows data: URIs to be used as a content source. ...
... data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...And 2 more matches
CSP: form-action - HTTP
igation directive default-src fallback No. Not setting this allows anything. Syntax One or more sources can be set for the form-action policy: Content-Security-Policy: form-action <source>; Content-Security-Policy: form-action <source> <source>; Sources <source> can be one of the following: <host-source> Internet hosts by name or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attemp...
... data: Allows data: URIs to be used as a content source. ...
... data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...And 2 more matches
CSP: img-src - HTTP
ack Yes. If this directive is absent, the user agent will look for the default-src directive. Syntax One or more sources can be allowed for the img-src policy: Content-Security-Policy: img-src <source>; Content-Security-Policy: img-src <source> <source>; Sources <source> can be one of the following: <host-source> Internet hosts by name or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attemp...
... data: Allows data: URIs to be used as a content source. ...
... data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...And 2 more matches
CSP: navigate-to - HTTP
igation directive default-src fallback No. Not setting this allows anything. Syntax One or more sources can be set for the navigate-to policy: Content-Security-Policy: navigate-to <source>; Content-Security-Policy: navigate-to <source> <source>; Sources <source> can be one of the following: <host-source> Internet hosts by name or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attemp...
... data: Allows data: URIs to be used as a content source. ...
... data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...And 2 more matches
CSP: prefetch-src - HTTP
this directive is absent, the user agent will look for the default-src directive. Syntax One or more sources can be allowed for the prefetch-src policy: Content-Security-Policy: prefetch-src <source>; Content-Security-Policy: prefetch-src <source> <source>; Sources <source> can be one of the following: <host-source> Internet hosts by name or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attemp...
... data: Allows data: URIs to be used as a content source. ...
... data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...And 2 more matches
CSP: script-src - HTTP
s. If this directive is absent, the user agent will look for the default-src directive. Syntax One or more sources can be allowed for the script-src policy: Content-Security-Policy: script-src <source>; Content-Security-Policy: script-src <source> <source>; Sources <source> can be one of the following: <host-source> Internet hosts by name or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attemp...
... data: Allows data: URIs to be used as a content source. ...
... data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...And 2 more matches
CSP: style-src - HTTP
Yes. If this directive is absent, the user agent will look for the default-src directive. Syntax One or more sources can be allowed for the style-src policy: Content-Security-Policy: style-src <source>; Content-Security-Policy: style-src <source> <source>; Sources <source> can be one of the following: <host-source> Internet hosts by name or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attemp...
... data: Allows data: URIs to be used as a content source. ...
... data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...And 2 more matches
NPN_GetAuthenticationInfo - Archive of obsolete content
rowser Side Plug-in API Summary The function is called by plugins to get HTTP authentication information from the browser. ...
...The browser passes back the HTTP username. If the function succeeds, the result buffer will be allocated with NPN_MemAlloc; the plugin is responsible for freeing the buffer. Note: the username may have internal NULL bytes and may not be NULL-terminated. ulen ...
...The browser passes back the HTTP username. If the function succeeds, the result buffer will be allocated with NPN_MemAlloc; the plugin is responsible for freeing the buffer. Note: the username may have internal NULL bytes and may not be NULL-terminated. ulen Out parameter. The length of the returned user...
... char **username, uint32_t *ulen, char **password, uint32_t *plen); Parameters This function has the following parameters: instance Pointer to the current plug-in instance protocol Protocol name (URI scheme) host Host name port Port number scheme HTTP authentication scheme name realm HTTP authentication realm username Out parameter. The browser passes back the HTTP username. If the function succeeds, the result buffer will be allocated with NPN_MemAlloc; the plugin is responsible for freeing the buffer. Note: the username may have internal NULL bytes and may not be NULL-terminated. ulen Out parameter. The length of the returned username buffer. password Out...
Necko Architecture
re After a few iterations of our original design, the current Necko architecture looks something like this: URLs Necko's primary responsibility is moving data from one location, to another location. These locations are represented in the form we have all grown to know and love as URIs. A URL implements the URI interface. The URI interface does resource-generic things like getting/setting the scheme, or getting/setting the spec (everything beyond the first colon ':'). URLs provide getting/setting of paths, hosts, ports, filenames, etc. URLs are the most commonly used form of a URI. 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 also provides a simple ...
...ctly one channel. In order to get a channel from a URI an intermediary layer was introduced. Because a URI has no self knowledge about what "protocol" it represents, another component is responsible for deciding which channel implementation will be responsible for "loading" the URI. This layer is the protocol handler layer. A protocol handler's primary responsibility is to create channels for the scheme it has registered to handle. For example, the HTTP protocol handler registers itself as the protocol handler for "http." The HTTP protocol handler creates HTTP channels for HTTP URLs. Once you have a channel you can read or write data from or to your URI. nsIIOService The nsIIOService does the protocol handler lookup for you. However, you can certainly ask the nsIIOService for the protocol han...
...e protocol handler for the URI you have, then ask the protocol handler for a channel on that URI. In fact, most of what the nsIIOService does can be done independently of the nsIIOService, by hand. The nsIIOService acts as a convenience interface, consolidating several steps for the user. To summarize, the nsIIOService creates URL instances. It does this by looking up the protocol handler for the scheme of the URL, then asking the protocol handler to create the URL. The nsIIOService can also create channels. It does this by looking up the protocol handler and asking it to create the channel. The primary responsibility of protocol handlers is to create channel instances that know how to interpret the protocol that the handler registered for. However, a protocol handler implementation also might "...
...tocol handler is a straightforward process in Necko. There are a minimum of two interfaces you need to implement in order to fit into the Necko architecture: nsIProtocolHandler, and nsIChannel. Recall, that the IOService will look up your protocol handler and ask it for a channel. After registering your protocol handler Necko will use it to create channels for any URIs it encounters that have the scheme your protocol handler registered for. Please use existing protocol handler's for reference (the data: protocol handler is the simplest handler Necko provides, HTTP is a fairly complex (uses many classes) implementation utilizing asynchronous I/O, and FTP provides an example of a protocol implementation that creates an extra thread which uses synchronous I/O). Dependencies Necko requires the fo...
Finishing the Component
URI *contentLocation, nsISupports *ctxt, nsIDOMWindow *window, PRBool *_retval) Uniform Resource Locators The method passes in an interface pointer of type nsIURI, which is based on the Uniform Resource Identifier, or URI. This type is defined by the World Wide Web Consortium as: The naming scheme of the mechanism used to access the resource. The name of the machine hosting the resource. The name of the resource itself, given as a path. In this context, URIs are the strings used refer to places or things on the web. This specific form of URI is called a Uniform Resource Locator, or URL. See the intro to the HTML 4 specification for more information about URIs and URLs. Gecko encapsula...
...P protocols. Instead of extracting the string spec out of the nsIURI to do a string comparison, which would require you to do the parsing yourself, you can compare the nsIURI objects with each other, as in the following section. This ensures that the URLs are canonical before they are compared. Checking the White List The WebLock implementation of the ShouldLoad method starts by extracting the scheme of the incoming nsIURI. If the scheme isn't "http", "https", or "ftp", it immediately returns true, which continues the loading process unblocked. These three are the only kinds of URI that Weblock will try to block. When it has one, it walks the linked list and creates a new nsIURI object for each string URL in the list. From each object, ShouldLoad() extracts the host and compares it to the UR...
...objects is OK in a tight loop if the buffer of memory that holds the contents of the URLs is guaranteed to be valid for the lifetime of the object. But regardless of how optimized the implementation is with respect to is memory usage, a heap allocation will be made for every XPCOM object created. The string comparison with the URL type "http", "https", and "ftp" looks like this: nsEmbedCString scheme; contentLocation->GetScheme(scheme); if (strcmp("http", scheme.get()) != 0 && strcmp("https", scheme.get()) != 0 && strcmp("ftp", scheme.get()) != 0) { // this isn't a type of URI that we deal with. *_retval = PR_TRUE; return NS_OK; } Creating nsIURI Objects To create an nsIURI, use nsIIOService. nsIIOService is the part of the networking library ("necko") that's responsible ...
...for more information about relative URLs. Here is the complete implementation of the ShouldLoad() method: NS_IMETHODIMP WebLock::ShouldLoad(PRInt32 contentType, nsIURI *contentLocation, nsISupports *ctxt, nsIDOMWindow *window, PRBool *_retval) { if (!contentLocation) return NS_ERROR_FAILURE; nsEmbedCString scheme; contentLocation->GetScheme(scheme); if (strcmp("http", scheme.get()) != 0 && strcmp("https", scheme.get()) != 0 && strcmp("ftp", scheme.get()) != 0) { // this isn't a type of URI that we deal with *_retval = PR_TRUE; return NS_OK; } nsEmbedCString hostToLoad; contentLocation->GetHost(hostToLoad); // Assume failure. Do not allow this nsIURI to load. ...
CSP: base-uri - HTTP
mail.example.com:443: Matches all attemp...
...e or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attempts to access port 443 on mail.example.com. https://store.example.com: Matches all attempts to access store.example.com using https:. *.example.com: Matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> A scheme such as http: or https:. The colon is required. Unlike other values below, single ...
... data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...er can also inject arbitrary data: URIs. Use this sparingly and definitely not for scripts. mediastream: Allows mediastream: URIs to be used as a content source. blob: Allows blob: URIs to be used as a content source. filesystem: Allows filesystem: URIs to be used as a content source. 'self' Refers to the origin from which the protected document is being served, including the same URL scheme and port number. You must include the single quotes. Some browsers specifically exclude blob and filesystem from source directives. Sites needing to allow these content types can specify them using the Data attribute. 'unsafe-eval' Allows the use of eval() and similar methods for creating code from strings. You must include the single quotes. 'unsafe-hashes' Allows enabling specific inline ev...
CSP: default-src - HTTP
mail.example.com:443: Matches all attemp...
...e or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attempts to access port 443 on mail.example.com. https://store.example.com: Matches all attempts to access store.example.com using https:. *.example.com: Matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> A scheme such as http: or https:. The colon is required. Unlike other values below, single ...
... data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...er can also inject arbitrary data: URIs. Use this sparingly and definitely not for scripts. mediastream: Allows mediastream: URIs to be used as a content source. blob: Allows blob: URIs to be used as a content source. filesystem: Allows filesystem: URIs to be used as a content source. 'self' Refers to the origin from which the protected document is being served, including the same URL scheme and port number. You must include the single quotes. Some browsers specifically exclude blob and filesystem from source directives. Sites needing to allow these content types can specify them using the Data attribute. 'unsafe-eval' Allows the use of eval() and similar methods for creating code from strings. You must include the single quotes. 'unsafe-hashes' Allows enabling specific inline ev...
CSP: frame-ancestors - HTTP
Sources <source> can be one of the following: The frame-ancestors directive's syntax is similar to a source list of other directives (e.g. default-src), but doesn't allow 'unsafe-eval' or 'unsafe-inline' for example. It will also not fall back to a default-src setting. Only the sources listed below are allowed: <host-source> Internet hosts by name or IP address, as well as an optional URL scheme and/or port number, separated by spaces. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Single quotes surrounding the host are not allowed. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.c...
...parated by spaces. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Single quotes surrounding the host are not allowed. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. ...
... are valid for the source. Single quotes surrounding the host are not allowed. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attempts to access port 443 on mail.example.com. https://store.example.com: Matches all attempts to access store.example.com using https:. If no URL scheme is specified for a host-source and the iframe is loaded from an https URL, the URL for the page loading the iframe must also be https, per the W3C spec on matching source expressions. <scheme-source> A scheme such as http: or https:. The colon is required and scheme should not be quoted. You can also specify data schemes (not recommended). data: Allows data: URIs to be used as a content...
...er can also inject arbitrary data: URIs. Use this sparingly and definitely not for scripts. mediastream: Allows mediastream: URIs to be used as a content source. blob: Allows blob: URIs to be used as a content source. filesystem: Allows filesystem: URIs to be used as a content source. 'self' Refers to the origin from which the protected document is being served, including the same URL scheme and port number. You must include the single quotes. Some browsers specifically exclude blob and filesystem from source directives. Sites needing to allow these content types can specify them using the Data attribute. 'none' Refers to the empty set; that is, no URLs match. The single quotes are required. Examples Content-Security-Policy: frame-ancestors 'none'; Content-Security-Policy: fram...
CSP: script-src-attr - HTTP
mail.example.com:443: Matches all attemp...
...e or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attempts to access port 443 on mail.example.com. https://store.example.com: Matches all attempts to access store.example.com using https:. *.example.com: Matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> A scheme such as http: or https:. The colon is required. Unlike other values below, single ...
... data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...er can also inject arbitrary data: URIs. Use this sparingly and definitely not for scripts. mediastream: Allows mediastream: URIs to be used as a content source. blob: Allows blob: URIs to be used as a content source. filesystem: Allows filesystem: URIs to be used as a content source. 'self' Refers to the origin from which the protected document is being served, including the same URL scheme and port number. You must include the single quotes. Some browsers specifically exclude blob and filesystem from source directives. Sites needing to allow these content types can specify them using the Data attribute. 'unsafe-eval' Allows the use of eval() and similar methods for creating code from strings. You must include the single quotes. 'unsafe-hashes' Allows enabling specific inline ev...
CSP: script-src-elem - HTTP
mail.example.com:443: Matches all attemp...
...e or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attempts to access port 443 on mail.example.com. https://store.example.com: Matches all attempts to access store.example.com using https:. *.example.com: Matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> A scheme such as http: or https:. The colon is required. Unlike other values below, single ...
... data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...er can also inject arbitrary data: URIs. Use this sparingly and definitely not for scripts. mediastream: Allows mediastream: URIs to be used as a content source. blob: Allows blob: URIs to be used as a content source. filesystem: Allows filesystem: URIs to be used as a content source. 'self' Refers to the origin from which the protected document is being served, including the same URL scheme and port number. You must include the single quotes. Some browsers specifically exclude blob and filesystem from source directives. Sites needing to allow these content types can specify them using the Data attribute. 'unsafe-eval' Allows the use of eval() and similar methods for creating code from strings. You must include the single quotes. 'unsafe-hashes' Allows enabling specific inline ev...
CSP: style-src-attr - HTTP
mail.example.com:443: Matches all attemp...
...e or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attempts to access port 443 on mail.example.com. https://store.example.com: Matches all attempts to access store.example.com using https:. *.example.com: Matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> A scheme such as http: or https:. The colon is required. Unlike other values below, single ...
... data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...er can also inject arbitrary data: URIs. Use this sparingly and definitely not for scripts. mediastream: Allows mediastream: URIs to be used as a content source. blob: Allows blob: URIs to be used as a content source. filesystem: Allows filesystem: URIs to be used as a content source. 'self' Refers to the origin from which the protected document is being served, including the same URL scheme and port number. You must include the single quotes. Some browsers specifically exclude blob and filesystem from source directives. Sites needing to allow these content types can specify them using the Data attribute. 'unsafe-eval' Allows the use of eval() and similar methods for creating code from strings. You must include the single quotes. 'unsafe-hashes' Allows enabling specific inline ev...
CSP: style-src-elem - HTTP
mail.example.com:443: Matches all attemp...
...e or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attempts to access port 443 on mail.example.com. https://store.example.com: Matches all attempts to access store.example.com using https:. *.example.com: Matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> A scheme such as http: or https:. The colon is required. Unlike other values below, single ...
... data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...er can also inject arbitrary data: URIs. Use this sparingly and definitely not for scripts. mediastream: Allows mediastream: URIs to be used as a content source. blob: Allows blob: URIs to be used as a content source. filesystem: Allows filesystem: URIs to be used as a content source. 'self' Refers to the origin from which the protected document is being served, including the same URL scheme and port number. You must include the single quotes. Some browsers specifically exclude blob and filesystem from source directives. Sites needing to allow these content types can specify them using the Data attribute. 'unsafe-eval' Allows the use of eval() and similar methods for creating code from strings. You must include the single quotes. 'unsafe-hashes' Allows enabling specific inline ev...
HTTP Index - HTTP
Web › HTTP › Index
g new functionality and new semantics by creating new HTTP methods or headers. 5 Choosing between www and non-www URLs Guide, HTTP, URL A recurring question among website owners is whether to choose non-www or www URLs. This page provides some advice on what's best. 6 Data URLs Base64, Guide, HTTP, Intermediate, URL Data URLs, URLs prefixed with the data: scheme, allow content creators to embed small files inline in documents. 7 Evolution of HTTP Guide, HTTP, NeedsUpdate, NeedsUpdate(HTTP/3) HTTP (HyperText Transfer Protocol) is the underlying protocol of the World Wide Web. HTTP has evolved from an early protocol to exchange files in a semi-trusted laboratory environment, to the modern maze of the Internet, now carrying images, vide...
... Guide, HTTP, NeedsUpdate, NeedsUpdate(HTTP/3) HTTP (HyperText Transfer Protocol) is the underlying protocol of the World Wide Web. HTTP has evolved from an early protocol to exchange files in a semi-trusted laboratory environment, to the modern maze of the Internet, now carrying images, videos in high resolution and 3D. 8 Identifying resources on the Web Domain, HTTP, Path, Scheme, Syntax, URI, URL, URL Syntax, Web, fragment, port, query, resources The target of an HTTP request is called a "resource", whose nature isn't defined further; it can be a document, a photo, or anything else. Each resource is identified by a Uniform Resource Identifier (URI) used throughout HTTP for identifying resources. 9 MIME types (IANA media types) Content-Type, Guide, HT...
...document, file, or assortment of bytes. 10 Incomplete list of MIME types Audio, File Types, Files, HTTP, MIME, MIME Types, PHP, Reference, Text, Types, Video Here is a list of MIME types, associated by type of documents, ordered by their common extensions. 11 Resource URLs Guide, HTTP, Intermediate, Resource Resource URLs, URLs prefixed with the resource: scheme, are used by Firefox and Firefox browser extensions to load resources internally, but some of the information is available to sites the browser connects to as well. 12 Browser detection using the user agent Compatibility, HTTP, Web Development Serving different Web pages or services to different browsers is usually a bad idea. The Web is meant to be accessible to everyone, re...
...bleshooting The CORS request was responded to by the server with an HTTP redirect to a URL on a different origin than the original request, which is not permitted during CORS requests. 29 Reason: CORS request not HTTP CORS, CORSRequestNotHttp, Cross-Origin, Error, HTTP, HTTPS, Messages, Reasons, Security, console, troubleshooting CORS requests may only use the HTTPS URL scheme, but the URL specified by the request is of a different type. This often occurs if the URL specifies a local file, using a file:/// URL. 30 Reason: Credential is not supported if the CORS header 'Access-Control-Allow-Origin' is '*' CORS, CORSNotSupportingCredentials, Cross-Origin, Error, HTTP, HTTPS, Messages, Reasons, Security, console, troubleshooting The CORS request was a...
util/match-pattern - Archive of obsolete content
Test strings containing URLs against simple patterns. Usage Specifying Patterns There are three ways you can specify patterns: as an exact match string using a wildcard in a string using a regular expression Exact Matches A URL matches only that URL. The URL must start with a scheme, end with a slash, and contain no wildcards. Example pattern Example matching URLs Example non-matching URLs "http://example.com/" http://example.com/ http://example.com http://example.com/foo https://example.com/ http://foo.example.com/ Wildcards A single asterisk matches any URL with an http, https, or ftp scheme. For other schemes like file, resource, or data, use a scheme followed by an asterisk, as below. Example pattern Example matchi...
...foo ftp://foo.example.com/ ldap://example.com http://example.foo.com/ A URL followed by an asterisk matches that URL and any URL prefixed with the pattern. Example pattern Example matching URLs Example non-matching URLs "https://foo.com/*" https://foo.com/ https://foo.com/bar http://foo.com/ https://foo.com https://bar.foo.com/ A scheme followed by an asterisk matches all URLs with that scheme. To match local files, use file://*, and to match files loaded from your add-on's data directory, use resource://. Example pattern Example matching URLs "file://*" file://C:/file.html file:///home/file.png "resource://*" resource://my-addon-at-me-dot-org/my-addon/data/file.html "data:*" ...
...ion is compiled with the global, ignoreCase, and multiline flags disabled. The MatchPattern constructor will throw an exception if you try to set any of these flags. ...
Mozilla Crypto FAQ - Archive of obsolete content
he Mozilla project then they are welcome to do so. We know of at least two efforts which may produce PGP support for Mozilla. As noted above, the PSM code implements SSL and (in the future) S/MIME support for Mozilla by taking advantage of generic high-level Mozilla public APIs used to add new protocols and message formats. These same APIs can be used to add support to Mozilla for other security schemes, including potentially PGP. If anyone is interested on working such support within the Mozilla project then they are welcome to do so. However note that, as with SSL and S/MIME, mozilla.org will not host code implementing patented algorithms that are not generally usable by all Mozilla developers (including Mozilla developers creating products for commercial sale and distribution). Also note th...
...erested on working such support within the Mozilla project then they are welcome to do so. However note that, as with SSL and S/MIME, mozilla.org will not host code implementing patented algorithms that are not generally usable by all Mozilla developers (including Mozilla developers creating products for commercial sale and distribution). Also note that Mozilla support for PGP and other security schemes may also be made available by commercial security vendors or by independent developers, using the various public APIs already present in Mozilla. Based on statements made in various Internet forums it appears that the developers of GNU Privacy Guard may create a plugin module to support invocation of GnuPG functionality from Mozilla; Network Associates may also create a commercial PGP plugin for...
...related conduct with regard to cryptography (e.g., "technical assistance") were unconstitutional. (Bernstein's suit was originally directed at the ITAR and related regulations, since at the time the suit was filed the current Export Administration Regulations were not yet in effect with respect to encryption software.) Bernstein claimed that the U.S. export regulations were in essence a licensing scheme designed to impede or prohibit certain types of speech (e.g., publishing cryptographic source code in electronic form), and were therefore unconstitutional under the First Amendment to the U.S. constitution. The U.S. government claimed in return that cryptographic software was regulated based solely on its ability to be used to secure communications and data, and that the national security intere...
XML in Mozilla - Archive of obsolete content
Documentation XHTML W3C Recommendation XML Base W3C Recommendation XLink (simple XLinks only) Obsolete since Gecko 2.0 W3C Recommendation FIXptr Obsolete since Gecko 1.9.1 W3C "proposal" XPointer Framework Obsolete since Gecko 1.9.1 W3C Recommendation XPointer element() scheme Obsolete since Gecko 1.9.1 W3C Recommendation XPointer xmlns() scheme Obsolete since Gecko 1.9.1 W3C Recommendation XPointer fixptr() scheme Obsolete since Gecko 1.9.1 This scheme is simply a wrapper for FIXptr XPointer xpath1() scheme Obsolete since Gecko 1.9.1 Internet-Draft document.load(), document.async ...
...into resources in XML documents Mozilla also supports FIXptr, a simplified, non-compatible version of XPointer. In addition to using FIXptr in links, it is possible to use it from scripts. See the proprietary dom/interfaces/core/nsIDOMXMLDocument.idl interface. There is test case for FIXptr links and a scripting example. Since 1.4alpha, Mozilla also supports XPointer Framework, XPointer element() scheme, XPointer xmlns() scheme, XPointer fixptr() scheme and XPointer xpath1() scheme. The XPointer processor is extensible and it is easy to implement support for other schemes - have a look at the API. The xpath1() scheme was implemented using this extensible mechanism. There is also a proprietary API from scripts to the XPointer processor. There is a testcase for XPointers that you can also study. L...
...To fully implement XLink, we need something called a link manager. See some initial design documents. Testing and QA We have a lot of testcases linked to from the browser standards compliance QA page. Most of the co...
Creating XPI Installer Modules - Archive of obsolete content
Introduction This article is rather old and only applies to Mozilla Suite and SeaMonkey (until it gets converted to Toolkit). Addons for various Toolkit applications, such as Firefox or Thunderbird, should be packaged in a different way. Mozilla has introduced major changes to the way that themes and all the other parts of the UI are packaged. This new packaging scheme is called XPI (pronounced "zippy"), and interacts with XPInstall. A XPI file typically contains the resources to be installed (in this case the barley.jar we want to have installed in the Mozilla/bin/chrome/ directory) and an install script that guides the installation process. Under the chrome/ directory, you'll notice that in addition to the package subdirectories, there are now also a handful of JAR files, or Java a...
... However, this new arrangement does not make things much easier for the web or user interface developer. The relatively simple process of finding the appropriate resources (i.e. XUL, JavaScript, or CSS files) in the chrome subdirectories and editing them with a text editor has been replaced by something a lot of developers find more confusing and esoteric. This article describes the new packaging scheme of Mozilla and offers a tutorial for creating a new package that can then be redistributed, installed, and made available to users. The XPI Packaging Scheme A complete description of the new packaging scheme is beyond the scope of this article. The reader is referred to JAR Packaging, which describes the design, goals, and options available for JAR packaging in some depth. What follows is a very ...
...s and have them registered as they develop (a process we do not describe here). One way of another, the chrome registry is shown the contents.rdf files; the contents.rdf files in turn point to new resources, and the resources are then registered with Mozilla and accessible to the user. Creating a New Package The package described in this section is a very simple one, but it uses the new packaging scheme and the chrome registry to make itself a piece of self-contained and redistributable software. Once you have created a package like the one described here, Mozilla users can download and install it in a single step. The Barley Package The barley package is a simple XUL window with a couple of buttons and an image element. One of the buttons, labeled "show aphids", displays an alert dialog by call...
Origin - MDN Web Docs Glossary: Definitions of Web-related terms
Web content's origin is defined by the scheme (protocol), host (domain), and port of the URL used to access it. Two objects have the same origin only when the scheme, host, and port all match. Some operations are restricted to same-origin content, and this restriction can be lifted using CORS. ...
...y the scheme (protocol), host (domain), and port of the URL used to access it. Two objects have the same origin only when the scheme, host, and port all match. Some operations are restricted to same-origin content, and this restriction can be lifted using CORS. ...
... Living Standard Learn more See Same-origin policy ...
Phishing: a short definition
In 2014, the MSCI estimated an annual global impact of phishing, and various forms of identity theft, to be as high as $5 billion USD. The impact has not improved much since. Phishing is an attempt to collect sensitive information, such as usernames, passwords, and financial details by disguising as a trustworthy entity online. A relatively simple, yet effective, phishing scheme is sending an email with a fake invoice of a person's favorite shopping site. This email will usually contain a link pretending to lead to the original service, but in reality, taking the victim to an attacker-controlled website. The login portal might resemble the trusted website's login page very closely, and convince users to enter their credentials, letting others hijack their account. Past and current cou...
...ions can be more efficient if implemented to protect millions of users automatically. As most phishing attacks start with unsolicited email messages, a clear starting point is improving spam filters, thus reducing the number of fraudulent messages reaching users. Web browser vendors too, are interested in protecting their users from phishing. After all, the browser plays an essential role in the scheme: a fake website is loaded in a browser and here is the maker's last chance to preventing fraud. Since version 2.0, Firefox has used Google's SafeBrowsing service, to detect known web forgeries, and display an alert instead of the fraudulent website. Two-Factor Authentication None of the above anti-phishing measures address the basic problem: username/password combinations are often enough to im...
... often generate a QR code to be read by an OTP app. This QR code is nothing more than a random, secret key, that is stored on the user's phone. After verifying username and password, the user is prompted to open the OTP app and enter the corresponding 6-digit code, representing a hashed version of the secret key and a nonce - potentially time-based. OTP is the most widely supported second factor schemes and can be used to secure your most important accounts. Unfortunately, some users still feel it's too tedious unlocking a phone, opening the OTP app, and manually typing a few digits each time a provider requests a new token. This can be phished by an attacker, though with TOTP apps the attacker has limited time to make their unauthorized login. ...
NSS 3.28 release notes
Material implements a key exporter based on the TLS 1.3 early exporter secret. This API is equivalent in function to SSL_ExportKeyingMaterial, but it can only succeed if 0-RTT was attempted (on the client) or accepted (on the server). SSL_SendAdditionalKeyShares configures a TLS 1.3 client so that it generates additional key shares when sending a ClientHello. SSL_SignatureSchemePrefSet allows an application to set which signature schemes should be supported in TLS and to specify the preference order of those schemes. SSL_SignatureSchemePrefGet allows an application to learn the currently supported and enabled signature schemes for a socket. Request to test and prepare for TLS 1.3 This release contains improved support for TLS 1.3, however, the cod...
... for use in TLS (bug 1303648). Note that this detection has a one-off performance cost, which can be avoided by using the SSL_NamedGroupConfig function, to limit supported groups to those that NSS provides. PKCS#11 bypass for TLS is no longer supported and has been removed (bug 1303224). Support for "export" grade SSL/TLS cipher suites has been removed (bug 1252849). NSS now uses the signature schemes definition in TLS 1.3 (bug 1309446). This also affects TLS 1.2. NSS will now only generate signatures with the combinations of hash and signature scheme that are defined in TLS 1.3, even when negotiating TLS 1.2. This means that SHA-256 will only be used with P-256 ECDSA certificates, SHA-384 with P-384 certificates, and SHA-512 with P-521 certificates. SHA-1 is permitted (in TLS 1.2 onl...
...ures with the combinations of hash and signature scheme that are defined in TLS 1.3, even when negotiating TLS 1.2. This means that SHA-256 will only be used with P-256 ECDSA certificates, SHA-384 with P-384 certificates, and SHA-512 with P-521 certificates. SHA-1 is permitted (in TLS 1.2 only) with any certificate for backward compatibility reasons. New functions to configure signature schemes are provided: SSL_SignatureSchemePrefSet, SSL_SignatureSchemePrefGet. The old SSL_SignaturePrefSet and SSL_SignaturePrefSet functions are now deprecated. NSS will now no longer assume that default signature schemes are supported by a peer if there was no commonly supported signature scheme. NSS will now check if RSA-PSS signing is supported by the token that holds the private key prior ...
nsIProtocolHandler
netwerk/base/nsIProtocolHandler.idlScriptable This interface is used to implement protocol handlers. If you wish to create a new protocol handler, you need to implement this interface. Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Method overview boolean allowPort(in long port, in string scheme); nsIChannel newChannel(in nsIURI aURI); nsIURI newURI(in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI); Attributes Attribute Type Description defaultPort long The default port is the port the protocol uses by default. If the protocol doesn't need a port (for example, the "about" protocol), this attribute is -1. Read only. protocolFlags unsig...
... protocolFlags unsigned long Protocol-specific flags. Read only. Note: Starting with Firefox 3, one of URI_LOADABLE_BY_ANYONE, URI_DANGEROUS_TO_LOAD, URI_IS_UI_RESOURCE, or URI_IS_LOCAL_FILE must be set on every protocol handler. Current versions of Firefox assume that the URI has URI_LOADABLE_BY_ANYONE set, but this will not work starting with the Mozilla 2 platform. scheme ACString The scheme for this protocol ("file", "http", and so forth). Read only. Constants Constant Value Description URI_STD 0 A standard full URI with authority component and understanding relative URIs; this includes http and ftp, for example. URI_NORELATIVE 1<<0 The protocol doesn't support relative URIs (for example, about and javasc...
... Lets a protocol override blacklisted ports. This method is called when there's an attempt to connect to a port that is blacklisted. For example, for most protocols, port 25 (Simple Mail Transfer Protocol) is banned. When a URI containing this port number is encountered, this method is called to ask if the protocol handler wants to override the ban. boolean allowPort( in long port, in string scheme ); Parameters port The port for which an override is being requested. scheme The scheme for which an override is being requested. Return value Return true if the override is approved; otherwise, return false. newChannel() Constructs a new channel from the given URI for this protocol handler. nsIChannel newChannel( in nsIURI aURI ); Parameters aURI The URI for which to constr...
nsIWebBrowserPersist
e effect as calling cancel with an argument of NS_BINDING_ABORTED. void cancelSave(); Parameters None. saveChannel() Save a channel to a file. It must not be opened yet. void saveChannel( in nsIChannel aChannel, in nsISupports aFile ); Parameters aChannel The nsIChannel to save to a file. aFile Target local file. This may be a nsILocalFile object or an nsIURI object with a file scheme. saveDocument() Save the specified DOM document to file and optionally all linked files (for example images, CSS, JS & subframes). Do not call this method until the document has finished loading! void saveDocument( in nsIDOMDocument aDocument, in nsISupports aFile, in nsISupports aDataPath, in string aOutputContentType, in unsigned long aEncodingFlags, in unsigned long aWrapColumn...
...in nsISupports aFile, in nsISupports aDataPath, in string aOutputContentType, in unsigned long aEncodingFlags, in unsigned long aWrapColumn ); Parameters aDocument Document to save to file. Some implementations of this interface may also support nsnull to imply the currently loaded document. aFile Target local file. This may be a nsILocalFile object or an nsIURI object with a file scheme or a scheme that supports uploading (for example ftp). aDataPath Path to directory where URIs linked to the document are saved or nsnull if no linked URIs should be saved. This may be a nsILocalFile object or an nsIURI object with a file scheme. aOutputContentType The desired MIME type format to save the document and all sub-documents into or nsnull to use the default behavior. aEncodingFlag...
...ageDescriptor. aReferrer The referrer URI to pass with an HTTP request or nsnull. aReferrerPolicy The referrer policy to use for the request, taken from nsIHttpChannel. aPostData Post data to pass with an HTTP request or nsnull. aExtraHeaders Additional headers to supply with an HTTP request or nsnull. aFile Target file. This may be a nsILocalFile object or an nsIURI object with a file scheme or a scheme that supports uploading (for example ftp). aPrivacyContext A context derived from a relevant window or document (eg. the window containing a link being saved) via a docshell that QIs to nsILoadContext. Used to ensure that privacy-sensitive operations (such as saving a URI related to a private browsing session) do not leak any information (eg. cookies, permanent cache, etc.) Null mus...
Memory - Plugins
In addition, the plug-in usually has the option of using its own memory functions. ...
...In addition, the plug-in usually has the option of using its own memory functions. ...
... The plug-in can call the Plug-in API NPN_MemAlloc function instead of the standard malloc function to allocate dynamic memory. Using NPN_MemAlloc offers several advantages to the plug-in. A call to NPN_MemAlloc is more likely to succeed. The browser may be able to deallocate nonessential memory structures in response to a request. NPN_MemAlloc uses the browser's customized memory-allocation scheme, which is typically faster and causes less fragmentation than the standard OS memory functions. If the plug-in uses NPN_MemAlloc, the browser is able to manage memory more efficiently because it knows how much memory the plug-in is using at any given time. Mac OS The Mac OS browser frequently fills its memory partition with cached data that is purged only as necessary. Since NPN_MemAlloc auto...
HTMLHyperlinkElementUtils.origin - Web APIs
E.g "blob:https://mozilla.org" will have "https://mozilla.org". Note: This feature is available in Web Workers. ...
...E.g "blob:https://mozilla.org" will have "https://mozilla.org". Note: This feature is available in Web Workers. ...
...E.g "blob:https://mozilla.org" will have "https://mozilla.org". Note: This feature is available in Web Workers. ...
Location: origin - Web APIs
Web › API › Location › origin
E.g "blob:https://mozilla.org" will have "https://mozilla.org". Note: This feature is available in Web Workers. ...
...E.g "blob:https://mozilla.org" will have "https://mozilla.org". Note: This feature is available in Web Workers. ...
...E.g "blob:https://mozilla.org" will have "https://mozilla.org". Note: This feature is available in Web Workers. ...
Visual formatting model - CSS: Cascading Style Sheets
continuous media such as a computer screen and paged media such as a book or document printed by browser print functions. Most of the information applies equally to continuous and paged media. In the visual formatting model, each element in the document tree generates zero or more boxes according to the box model. The layout of these boxes is governed by: Box dimensions and type. Positioning scheme (normal flow, float, and absolute positioning). Relationships between elements in the document tree. External information (e.g., viewport size, intrinsic dimensions of images, etc.). Much of the information about the visual formatting model is defined in CSS2, however, various level 3 specifications have added to this information. When reading specifications you will often find references to ...
..."block box" or just a "block". Note however that block boxes, block-level boxes and box containers are all subtly different; see the Block boxes section below for more details. The principal box When an element generates one or more boxes, one of them is the principal box, which contains its descendant boxes and generated content in the box tree, and is also the box involved in any positioning scheme. Some elements may generate additional boxes in addition to the principal box, for example display: list-item generates more than one box (e.g. a principal block box and a child marker box). And some values (such as none or contents) cause the element and/or its descendants to not generate any boxes at all. Anonymous boxes An anonymous box is created when there is not an HTML element to use fo...
... wrap each line of text. You can see the difference between line boxes and their containing block if you float an item and then follow it by a block that has a background color. In the following example, the line boxes following the floated <div> are shortened to wrap around the float. The background of the box runs behind the float, as the floated item has been taken out of flow. Positioning schemes and in-flow and out-of-flow elements In CSS, a box may be laid out according to three positioning schemes -- normal flow, floats, or absolute positioning. Normal flow In CSS, the normal flow includes block-level formatting of block boxes, inline-level formatting of inline boxes, and also includes relative and sticky positioning of block-level and inline-level boxes. Read more about flow layo...
Data URLs - HTTP
They were formerly known as "data URIs" until that name was retired by the WHATWG. Note: Data URLs are treated as unique opaque origins by modern browsers, rather than inheriting the origin of the settings object responsible for the navigation. Syntax Data URLs are composed of four parts: a prefix (data:), a MIME type indicating the type of data, an optional base64 token if non-textual, and the data itself: data:[<mediatype>][;base64],<data> The mediatype is a MIME type string, such as 'image/jpeg' for a JPEG image file. ...
...text/plain;base64,SGVsbG8sIFdvcmxkIQ== base64-encoded version of the above data:text/html,%3Ch1%3EHello%2C%20World!%3C%2Fh1%3E An HTML document with <h1>Hello, World!</h1> data:text/html,<script>alert('hi');</script> An HTML document that executes a JavaScript alert. Note that the closing script tag is required. Encoding data into base64 format Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. By consisting only in ASCII characters, base64 strings are generally url-safe, and that's why they can be used to encode data in Data URLs. Encoding in Javascript The Web APIs have native methods to encode or decode to base64: Base64 encoding and decoding. Encoding on a Unix system Base64 e...
...avigating to them in the browser's top level. To mitigate such issues, top-level navigation to data:// URLs has been blocked in Firefox 59+ (release version, Nightly/Beta from 58), and we hope to see other browsers follow suit soon. See Blocking Top-Level Navigations to data URLs for Firefox 58 for more details. Specifications Specification Title RFC 2397 The "data" URL scheme ...
CSP: child-src - HTTP
Yes. If this directive is absent, the user agent will look for the default-src directive. Syntax One or more sources can be allowed for the child-src policy: Content-Security-Policy: child-src <source>; Content-Security-Policy: child-src <source> <source>; Sources <source> can be one of the following: <host-source> Internet hosts by name or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attemp...
...The colon is required, single quotes shouldn't be used. You can also specify data schemas (not recommended). data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...er can also inject arbitrary data: URIs. Use this sparingly and definitely not for scripts. mediastream: Allows mediastream: URIs to be used as a content source. blob: Allows blob: URIs to be used as a content source. filesystem: Allows filesystem: URIs to be used as a content source. 'self' Refers to the origin from which the protected document is being served, including the same URL scheme and port number. You must include the single quotes. Some browsers specifically exclude blob and filesystem from source directives. Sites needing to allow these content types can specify them using the Data attribute. 'unsafe-eval' Allows the use of eval() and similar methods for creating code from strings. You must include the single quotes. 'unsafe-hashes' Allows to enable specific inline e...
CSP: font-src - HTTP
k Yes. If this directive is absent, the user agent will look for the default-src directive. Syntax One or more sources can be allowed for the font-src policy: Content-Security-Policy: font-src <source>; Content-Security-Policy: font-src <source> <source>; Sources <source> can be one of the following: <host-source> Internet hosts by name or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attemp...
...The colon is required, single quotes shouldn't be used. You can also specify data schemas (not recommended). data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...er can also inject arbitrary data: URIs. Use this sparingly and definitely not for scripts. mediastream: Allows mediastream: URIs to be used as a content source. blob: Allows blob: URIs to be used as a content source. filesystem: Allows filesystem: URIs to be used as a content source. 'self' Refers to the origin from which the protected document is being served, including the same URL scheme and port number. You must include the single quotes. Some browsers specifically exclude blob and filesystem from source directives. Sites needing to allow these content types can specify them using the Data attribute. 'unsafe-eval' Allows the use of eval() and similar methods for creating code from strings. You must include the single quotes. 'unsafe-hashes' Allows to enable specific inline e...
CSP: frame-src - HTTP
gent will look for the child-src directive (which falls back to the default-src directive). Syntax One or more sources can be allowed for the frame-src policy: Content-Security-Policy: frame-src <source>; Content-Security-Policy: frame-src <source> <source>; Sources <source> can be one of the following: <host-source> Internet hosts by name or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attemp...
...The colon is required, single quotes shouldn't be used. You can also specify data schemas (not recommended). data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...er can also inject arbitrary data: URIs. Use this sparingly and definitely not for scripts. mediastream: Allows mediastream: URIs to be used as a content source. blob: Allows blob: URIs to be used as a content source. filesystem: Allows filesystem: URIs to be used as a content source. 'self' Refers to the origin from which the protected document is being served, including the same URL scheme and port number. You must include the single quotes. Some browsers specifically exclude blob and filesystem from source directives. Sites needing to allow these content types can specify them using the Data attribute. 'unsafe-eval' Allows the use of eval() and similar methods for creating code from strings. You must include the single quotes. 'unsafe-hashes' Allows to enable specific inline e...
CSP: manifest-src - HTTP
this directive is absent, the user agent will look for the default-src directive. Syntax One or more sources can be allowed for the manifest-src policy: Content-Security-Policy: manifest-src <source>; Content-Security-Policy: manifest-src <source> <source>; Sources <source> can be one of the following: <host-source> Internet hosts by name or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attemp...
...The colon is required, single quotes shouldn't be used. You can also specify data schemas (not recommended). data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...er can also inject arbitrary data: URIs. Use this sparingly and definitely not for scripts. mediastream: Allows mediastream: URIs to be used as a content source. blob: Allows blob: URIs to be used as a content source. filesystem: Allows filesystem: URIs to be used as a content source. 'self' Refers to the origin from which the protected document is being served, including the same URL scheme and port number. You must include the single quotes. Some browsers specifically exclude blob and filesystem from source directives. Sites needing to allow these content types can specify them using the Data attribute. 'unsafe-eval' Allows the use of eval() and similar methods for creating code from strings. You must include the single quotes. 'unsafe-hashes' Allows to enable specific inline e...
CSP: media-src - HTTP
Yes. If this directive is absent, the user agent will look for the default-src directive. Syntax One or more sources can be allowed for the media-src policy: Content-Security-Policy: media-src <source>; Content-Security-Policy: media-src <source> <source>; Sources <source> can be one of the following: <host-source> Internet hosts by name or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attemp...
...The colon is required, single quotes shouldn't be used. You can also specify data schemas (not recommended). data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...er can also inject arbitrary data: URIs. Use this sparingly and definitely not for scripts. mediastream: Allows mediastream: URIs to be used as a content source. blob: Allows blob: URIs to be used as a content source. filesystem: Allows filesystem: URIs to be used as a content source. 'self' Refers to the origin from which the protected document is being served, including the same URL scheme and port number. You must include the single quotes. Some browsers specifically exclude blob and filesystem from source directives. Sites needing to allow these content types can specify them using the Data attribute. 'unsafe-eval' Allows the use of eval() and similar methods for creating code from strings. You must include the single quotes. 'unsafe-hashes' Allows to enable specific inline e...
CSP: object-src - HTTP
es. If this directive is absent, the user agent will look for the default-src directive. Syntax One or more sources can be allowed for the object-src policy: Content-Security-Policy: object-src <source>; Content-Security-Policy: object-src <source> <source>; Sources <source> can be one of the following: <host-source> Internet hosts by name or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attemp...
...The colon is required, single quotes shouldn't be used. You can also specify data schemas (not recommended). data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...er can also inject arbitrary data: URIs. Use this sparingly and definitely not for scripts. mediastream: Allows mediastream: URIs to be used as a content source. blob: Allows blob: URIs to be used as a content source. filesystem: Allows filesystem: URIs to be used as a content source. 'self' Refers to the origin from which the protected document is being served, including the same URL scheme and port number. You must include the single quotes. Some browsers specifically exclude blob and filesystem from source directives. Sites needing to allow these content types can specify them using the Data attribute. 'unsafe-eval' Allows the use of eval() and similar methods for creating code from strings. You must include the single quotes. 'unsafe-hashes' Allows to enable specific inline e...
CSP: worker-src - HTTP
er skips the child-src directive. Edge 17 skips the script-src directive (bug). Syntax One or more sources can be allowed for the worker-src policy: Content-Security-Policy: worker-src <source>; Content-Security-Policy: worker-src <source> <source>; Sources <source> can be one of the following: <host-source> Internet hosts by name or IP address, as well as an optional URL scheme and/or port number. The site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. Examples: http://*.example.com: Matches all attempts to load from any subdomain of example.com using the http: URL scheme. mail.example.com:443: Matches all attemp...
...The colon is required, single quotes shouldn't be used. You can also specify data schemas (not recommended). data: Allows data: URIs to be used as a content source. This is insecure; an attacker can also inject arbitrary data: URIs. ...
...er can also inject arbitrary data: URIs. Use this sparingly and definitely not for scripts. mediastream: Allows mediastream: URIs to be used as a content source. blob: Allows blob: URIs to be used as a content source. filesystem: Allows filesystem: URIs to be used as a content source. 'self' Refers to the origin from which the protected document is being served, including the same URL scheme and port number. You must include the single quotes. Some browsers specifically exclude blob and filesystem from source directives. Sites needing to allow these content types can specify them using the Data attribute. 'unsafe-eval' Allows the use of eval() and similar methods for creating code from strings. You must include the single quotes. 'unsafe-hashes' Allows to enable specific inline e...
url - Archive of obsolete content
/ "co.uk" console.log(urls.getTLD("https://developer.mozilla.org/")); // "org" Parameters url : string The URL, as a string. Returns string : The top-level domain for the URL. URL Methods toString() Returns a string representation of the URL. Returns string : The URL as a string. toJSON() Returns a string representation of the URL. Returns string : The URL as a string. Properties scheme The name of the protocol in the URL, without the trailing ':'. Compare with protocol. For example: var url = require("sdk/url").URL("https://developer.mozilla.org/Add-ons?example=true&visible=yes#top"); console.log(url.scheme); // https userPass The username:password part of the URL, null if not present. host The host of the URL, null if not present. For example: var url = require("sdk/ur...
...r example: var url = require("sdk/url").URL("https://developer.mozilla.org/Add-ons?example=true&visible=yes#top"); console.log(url.hash); // #top href The whole URL as a string. Mirrors window.location.href. origin The canonical form of the origin for this URL, as a string. Mirrors window.location.origin. protocol The protocol of the URL, including the final ':', as a string. Compare with scheme. Mirrors window.location.protocol. For example: var url = require("sdk/url").URL("https://developer.mozilla.org/Add-ons?example=true&visible=yes#top"); console.log(url.protocol); // https: search If any parameters are present, a '?' followed by the parameters of the URL, as a string. Mirrors window.location.search. For example: var url = require("sdk/url").URL("https://developer.mozilla.org/...
net/xhr - Archive of obsolete content
It also has unfettered access to any local area networks, VPNs, and the internet. Threat Model The XMLHttpRequest object can be used by an add-on to "phone home" and transmit potentially sensitive user data to third parties. ...
...e than it seems at first glance. Possible Attenuations Before being exposed to unprivileged code, this object needs to be attenuated in such a way that, at the very least, it can't access the user's filesystem. This can probably be done most securely by white-listing the protocols that can be used in the URL passed to the open() method, and limiting them to http:, https:, and possibly a special scheme that can be used to access the add-on's packaged, read-only resources. Finally, we need to also consider attenuating http/https requests such that they're "sandboxed" and don't communicate potentially sensitive cookie information. Globals Constructors XMLHttpRequest() Creates an XMLHttpRequest. This is a constructor, so its use should always be preceded by the new operator. For more informat...
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
used to include source files used as visual elements in the GUI, including style sheets and images. Most extensions include only one skin package, but you can include multiple skin packages to allow the GUI to change with different themes. Chrome URL Use a file called a "chrome manifest" to register chrome packages with Firefox and start using them. To register a package, you use a special URI scheme called a "Chrome URL" to represent the path to the file. Chrome URLs are structured as: chrome://%package name%/%package type%/%relative path to source file% For example, the Chrome URL for the Firefox browser window is as follows: chrome://browser/content/browser.xul Here, the package name is "browser", the file "browser.xul", and the type of the package is "content". Source files represente...
...out="urn:mozilla:install-manifest"> <!-- Unique ID for extension. Can be in e-mail address format or GUID format --> <em:id>helloworld@xuldev.org</em:id> <!-- Indicates that this add-on is an extension --> <em:type>2</em:type> <!-- Extension name displayed in Add-on Manager --> <em:name>Hello, World!</em:name> <!-- Extension version number. There is a version numbering scheme you must follow --> <em:version>0.1</em:version> <!-- Brief description displayed in Add-on Manager --> <em:description>My first extension.</em:description> <!-- Name of extension's primary developer. Change to your name --> <em:creator>Gomita</em:creator> <!-- Web page address through which extension is distributed --> <em:homepageURL>http://www.xuldev.org/helloworld/...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
d and maintenance of the site. How is the site styled now that you've ripped out all the HTML-based presentation? Technically, there are 13 total stylesheets used at any one time. ...
...I'm having a tough time thinking of any advantages... What disadvantages did you encounter? Honestly, there were several challenges and glitches we ran into along the way. First of all, since Wired News is a heavily ad-supported site, our advertising units were the cause of several important d...
CSS3 - Archive of obsolete content
tion-duration, transition-property, and transition-timing-function properties. CSS Box Alignment Module Level 3 Working Draft Selectors Level 4 Working Draft CSS Lists Module Level 3 Working Draft Extends the list counter mechanism so that list markers can be styled and Web developers can define new list counter schemes. Motion Path Module Level 1 Working Draft CSS Fonts Module Level 4 Working Draft CSS Easing Functions Level 1 Working Draft CSS Logical Properties and Values Level 1 Editor's Draft Modules in the revising phase Modules that are in the revising phase are much less stable tha...
...orking Draft CSS Device Adaptation Working Draft Adds a new at-rule, @viewport, allowing to specify the size, zoom factor, and orientation of the viewport that is used as the base for the initial containing block. CSS Exclusions Module Level 1 Working Draft Extends the floats mechanism to define exclusion regions in any positioning scheme. Adds the notion of shapes, in which content must flows. Filter Effects Module Level 1 Working Draft CSS Generated Content for Paged Media Module Working Draft Adds the ability to tailor printed version of a document by allowing to control header, footer but also references tables like indexes or tables of content. CSS Page ...
MMgc - Archive of obsolete content
dom, such that they don't grow over time. The occasional random leak from a false positive can be OK. That doesn't mean we shouldn't worry about it at all, but often conservative GC suffices. It is possible that a future version of MMgc might do exact marking. This would be needed for a generational collector. Deferred Reference Counting (DRC) MMgc uses Deferred Reference Counting (DRC). DRC is a scheme for getting more immediate reclamation of objects, while still achieving high performance and getting the other benefits of garbage collection. Classic Reference Counting Previous versions of the Flash Player, up to Flash Player 7, used reference counting to track object lifetimes. class Object { public: Object() { refCount = 0; } void AddRef() { refCount++; } void Release() { if (!--re...
...red Reference Counting In Deferred Reference Counting, a distinction is made between heap and stack references. Stack references to objects tend to be very temporary in nature. Stack frames come and go very quickly. So, performance can be gained by not performing reference counting on the stack references. Heap references are different since they can persist for long periods of time. So, in a DRC scheme, we continue to maintain reference counts in heap-based objects. So, reference counts are only maintained to heap-to-heap references. We basically ignore the stack and registers. They are considered stack memory. Zero Count Table Of course, when an object's reference count goes to zero, what happens? If the object was immediately destroyed, that could leave dangling pointers on the stack, since w...
Source code directories overview - Archive of obsolete content
base. This document contains material for SeaMonkey, Firefox, and Toolkit. It is a living document which is (supposed to be) updated monthly according to changes in the Mozilla source tree. See also similar information in Mozilla Source Code Directory Structure, and also see the more detailed overview of how the parts of Gecko fit together. Introduction: Common Subdirectories A common naming scheme is used throughout the Mozilla source trees. At the top level is the name of the product (e.g. seamonkey). At the second level is the name of the module (e.g. the editor directory in seamonkey). The third level is where the common naming scheme usually takes over. Many third level directories contain the base, the public and the idl directories. Although not required, these common names are typic...
...e, the public and the idl directories. Although not required, these common names are typically used for a common purpose. If files can be grouped into submodules, they are usually put in their own third level directory and given a unique name (e.g. txmgr in the editor directory in seamonkey). Beneath this third level directory, there may be fourth level base, public and idl directories. Thus, the scheme is recursive; it can apply to submodules, sub-submodules and so on. base contains the basic (core) functionality for the module. Base contains all the source code that cannot be categorized into a submodule. build contains any special makefiles for building the particular module. doc contains any documentation associated with this module. idl contains the XPIDL (Cross Platform Interface Def...
XPInstall - Archive of obsolete content
In particular plugin developers should see how to package a plugin as an extension. ...
...ll.js or install.rdf) at the root of the file. Documentation XPInstall API Reference XPInstall API Reference. Learn XPI Installer Scripting by Example This article uses the installer script from browser.xpi install package as the basis for discussing XPI installations in general. Creating XPI Installer Modules This article describes the packaging scheme of the Mozilla and offers a tutorial for creating a new package that can then be redistributed, installed, and made available to users. Install Wizards (aka: Stub Installers) View All... Community View Mozilla forums... Mailing list Newsgroup RSS feed Tools XPInstall trigger page Related Topics Extensions, X...
Opening a Link in the Default Browser - Archive of obsolete content
XULRunner applications may have situation where they wish to open a URI in the default browser. This will often be an HTTP or HTTPS URI, but can use any scheme for which an external handler exists. This can be done using the nsIExternalProtocolService interface: // first construct an nsIURI object using the ioservice var ioservice = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var uriToOpen = ioservice.newURI("http://www.example.com/", null, null); var extps = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"] .getService(Components.interfaces.nsIExternalProtocolService); // now, open it! extps.loadURI(uriToOpen, null); By default, the external protocol ...
...rotocolService); // now, open it! extps.loadURI(uriToOpen, null); By default, the external protocol service will warn the user about opening the link in another application. To suppress this warning for particular protocols that are safe to open in the default application, you must set default prefs (Thunderbird sets the following prefs): // suppress external-load warning for standard browser schemes pref("network.protocol-handler.warn-external.http", false); pref("network.protocol-handler.warn-external.https", false); pref("network.protocol-handler.warn-external.ftp", false); You can also check whether an external handler for a scheme exists. This is how you do it: var extps = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"] .getService(Compo...
Encryption and Decryption - Archive of obsolete content
ves a pair of keys-a public key and a private key-associated with an entity that needs to authenticate its identity electronically or to sign or encrypt data. Each public key is published, and the corresponding private key is kept secret. Data encrypted with your public key can be decrypted only with your private key. Figure 2 shows a simplified view of the way public-key encryption works. The scheme shown in Figure 2 lets you freely distribute a public key, and only you will be able to read data encrypted using this key. In general, to send encrypted data to someone, you encrypt the data with that person's public key, and the person receiving the encrypted data decrypts it with the corresponding private key. Compared with symmetric-key encryption, public-key encryption requires more computa...
...th the corresponding private key. Compared with symmetric-key encryption, public-key encryption requires more computation and is therefore not always appropriate for large amounts of data. However, it's possible to use public-key encryption to send a symmetric key, which can then be used to encrypt additional data. This is the approach used by the SSL protocol. As it happens, the reverse of the scheme shown in Figure 2 also works: data encrypted with your private key can be decrypted only with your public key. This would not be a desirable way to encrypt sensitive data, however, because it means that anyone with your public key, which is by definition published, could decrypt the data. Nevertheless, private-key encryption is useful, because it means you can use your private key to sign data wi...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
the measure of how much information can pass through a data connection in a given amount of time. It is usually measured in multiples of bits-per-second (bps), for example megabits-per-second (Mbps) or gigabits-per-second (Gbps). 27 Base64 Advanced, Base64, JavaScript, Typed Arrays, URI, URL, Unicode Problem, atob(), btoa() Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding. 28 Baseline CSS, Glossary, SVG, alignment, typography The baseline is a term used in European and West Asian typography meaning an imaginary line upon which the characters of a font rest. 29 ...
...ctuation or alphanumeric characters that carries out built-in functionality. For example, in JavaScript the addition operator ("+") adds numbers together and concatenates strings, whereas the "not" operator ("!") negates an expression -- for example making a true statement return false. 305 Origin Glossary, Security, WebMechanics, origin Web content's origin is defined by the scheme (protocol), host (domain), and port of the URL used to access it. Two objects have the same origin only when the scheme, host, and port all match. 306 P2P Glossary, Infrastructure, Networking, P2P P2P (Peer-to-peer) is a computer networking architecture in which all participating nodes (peers) have equal privileges and share the workload. P2P differs from a client-server netw...
CSS and JavaScript accessibility best practices - Learn web development
ta. You can see a good, simple example of table HTML and CSS in our table-css.html example (see it live also). Table CSS generally serves to make the table fit better into your design and look less ugly. It is a good idea to make sure the table headers stand out (normally using bold), and use zebra striping to make different rows easier to parse. Color and color contrast When choosing a color scheme for your website, make sure that the text (foreground) color contrasts well with the background color. Your design might look cool, but it is no good if people with visual impairments like color blindness can't read your content. There is an easy way to check whether your contrast is large enough to not cause problems. There are a number of contrast checking tools online that you can enter your ...
...provide text alternatives or other information for severely visually impaired users to make use of. It is arguable that such a game doesn't really have this group of people as a part of its main target audience, and it would be unreasonable to expect you to make it 100% accessible to blind people, however you could implement keyboard controls so it is usable by non-mouse users, and make the color scheme contrasting enough to be usable by those with color deficiencies. The problem with too much JavaScript The problem often comes when people rely on JavaScript too much. Sometimes you'll see a website where everything has been done with JavaScript -- the HTML has been generated by JavaScript, the CSS has been generated by JavaScript, etc. This has all kinds of accessibility and other issues assoc...
What text editors are available? - Learn web development
gs of your editor and read the manual or documentation to see what its capabilities are. In particular (if possible in your editor), try to: Change syntax highlighting settings and colors Play with indentation width, setting it to an appropriate 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 too...
...r. Get in touch with other users if you're troubleshooting while installing or using the editor. Does my text editor's look-and-feel matter to me? Well, that's a matter of taste, but some people like customizing every bit of the UI (user interface), from colors to button positions. Editors vary widely in flexibility, so check beforehand. It's not hard to find a text editor that can change color scheme, but if you want hefty customizing you may be better off with an IDE. Install and set up Installing a text editor is usually quite straightforward. The method varies based on your platform but it shouldn't be too hard: Windows. The developers will give you an .exe or .msi file. Sometimes the software comes in a compressed archive like .zip, .7z, or .rar, and in that case you'll need to insta...
Handling common accessibility problems - Learn web development
ou want afterward. You should make sure interactive elements like buttons and links have appropriate focus/hover/active states set, to give the user visual clues as to their function. If you remove the defaults for stylistic reasons, make sure you include some replacement styles. There are a few other considerations you should take into account. Color and color contrast When choosing a color scheme for your website, you should make sure that the text (foreground) color contrasts well with the background color. Your design might look cool, but it is no good if people with visual impairments like color blindness can't read your content. Use a tool like WebAIM's Color Contrast Checker to check whether your scheme is contrasting enough. Another tip is to not rely on color alone for signposts/i...
...er details about considerations for accessible JavaScript. More complex JavaScript implementations can create issues with accessibility -- you need to do what you can. For example, it would be unreasonable to expect you to make a complex 3D game written using WebGL 100% accessible to a blind person, but you could implement keyboard controls so it is usable by non-mouse users, and make the color scheme contrasting enough to be usable by those with color deficiencies. Complex functionality One of the main areas problematic for accessibility is complex apps that involve complicated form controls (such as date pickers) and dynamic content that is updated often and incrementally. Non-native complicated form controls are problematic because they tend to involve a lot of nested <div>s, and the bro...
Accessibility/LiveRegionDevGuide
nd removal events. In AT-SPI, this is accomplished by appending ":add" or ":remove" to the event string. In IAccessible2, there are two separate event types, namely EVENT_OBJECT_SHOW and EVENT_OBJECT_HIDE. Text Changed The text changed events are quite similar in AT-SPI and IAccessible2 with both having an insert and delete or removal events. The text changed event type in AT-SPI has a similar scheme as the object:children-changed events. In this case, the root event string is object:text-changed with ":delete" and ":insert" being appended to complete the event type. In IAccessible2, there are two distinct event types - IA2_EVENT_TEXT_REMOVED and IA2_EVENT_TEXT_INSERTED. The text associated with an AT-SPI text changed event is directly in the event object. The event.any_data field holds the e...
...ject changed and a text changed event. Both events should not be acted upon or double announcements would result. Instead, all text changed events should be examined for the presence of an embed character. If one is present, the text changed event should be discarded because an object changed event will follow. Filtering User Actions This paragraph describes object properties and event naming schemes that are used to help an AT determine if an event is an actual live region event or is the result of user action. Filtering for Performance The most significant difference between AT-SPI and IAccessible2 is that AT-SPI is an inter-process communication service while IAccessible2 runs in process. As a result, care must be taken in an AT-SPI based application to minimize performance degradation...
Experimental features in Firefox
Release 77 No Preference name network.ftp.enabled Developer tools Mozilla's developer tools are constantly evolving. We experiment with new ideas, add new features, and test them on the Nightly and Developer Edition channels before letting them go through to beta and release. The features below are the current crop of experimental developer tool features. Color scheme simulation Adds an option to simulate different color schemes allowing to test @prefers-color-scheme media queries. Using this media query lets your style sheet specify whether it prefers a light or dark user interface. This feature lets you test your code without having to change settings in your browser (or operating system, if the browser follows a system-wide color scheme setting). See bug ...
...See bug 1605154 and bug 1605153 for more details. ...
NSS 3.30 release notes
/TLS alert is sent SSL_SetSessionTicketKeyPair - configures an asymmetric key pair, for use in wrapping session ticket keys, used by the server. This function currently only accepts an RSA public/private key pair. New Macros in ciferfam.h PKCS12_AES_CBC_128, PKCS12_AES_CBC_192, PKCS12_AES_CBC_256 - cipher family identifiers corresponding to the PKCS#5 v2.1 AES based encryption schemes used in the PKCS#12 support in NSS in pkcs11n.h CKA_NSS_MOZILLA_CA_POLICY - identifier for a boolean PKCS#11 attribute, that should be set to true, if a CA is present because of it's acceptance according to the Mozilla CA Policy Notable Changes in NSS 3.30 The TLS server code has been enhanced to support session tickets when no RSA certificate (e.g. only an ECDSA certificat...
...the Mozilla CA Policy Notable Changes in NSS 3.30 The TLS server code has been enhanced to support session tickets when no RSA certificate (e.g. only an ECDSA certificate) is configured. RSA-PSS signatures produced by key pairs with a modulus bit length that is not a multiple of 8 are now supported. The pk12util tool now supports importing and exporting data encrypted in the AES based schemes defined in PKCS#5 v2.1. Bugs fixed in NSS 3.30 This Bugzilla query returns all the bugs fixed in NSS 3.30: https://bugzilla.mozilla.org/buglist.cgi?resolution=FIXED&classification=Components&query_format=advanced&product=NSS&target_milestone=3.30 Compatibility NSS 3.30 shared libraries are backward compatible with all older NSS 3.x shared libraries. A program linked with older NSS 3.x shar...
NSS 3.35 release notes
e tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_35_RTM/src/ New in NSS 3.35 New Functionality TLS 1.3 support has been updated to draft -23. This includes a large number of changes since 3.34, which supported only draft -18. See below for details. New Types in sslt.h SSLHandshakeType - The type of a TLS handshake message. For the SSLSignatureScheme enum, the enumerated values ssl_sig_rsa_pss_sha* are deprecated in response to a change in TLS 1.3. Please use the equivalent ssl_sig_rsa_pss_rsae_sha* for rsaEncryption keys, or ssl_sig_rsa_pss_pss_sha* for PSS keys. Note that this release does not include support for the latter. Notable Changes in NSS 3.35 Previously, NSS used the DBM file format by default. Starting with version 3.3...
...e, along with the update from draft -18 to draft -23: Support for KeyUpdate was added. KeyUpdate will be used automatically, if a cipher is used for a sufficient number of records. SSL_KEYLOGFILE support was updated for TLS 1.3. An option to enable TLS 1.3 compatibility mode, SSL_ENABLE_TLS13_COMPAT_MODE, was added. Note: In this release, support for new rsa_pss_pss_shaX signature schemes have been disabled; end-entity certificates with RSA-PSS keys will still be used to produce signatures, but they will use the rsa_pss_rsae_shaX codepoints. Note: The value of ssl_tls13_key_share_xtn value, from the SSLExtensionType, has been renumbered to match changes in TLS 1.3. This is not expected to cause problems; code compiled against previous versions of TLS will now refer to an unsup...
Necko Interfaces Overview
Warning: The content of this article may be out of date. It was last updated in 2001. nsIIOService central necko service manages protocol handlers thin layer over protocol handlers provides interface for creating URI objects from URI strings maps URI scheme to appropriate nsIProtocolHandler impl nsIURI (nsIURL, nsIFileURL, nsIStandardURL) represents an URI, with getters and setters for various URI parts (eg. scheme, host, path, ...) per protocol implementation necko provides URI impl's for common URI formats (see nsStandardURL, nsSimpleURI) nsIChannel : nsIRequest represents a logical connection to the resource identified by a nsIURI per protocol implementation single use (ie. channel is used to download the resource once) download initiated via nsIChannel::Asy...
...uest represents a logical connection to the resource identified by a nsIURI per protocol implementation single use (ie. channel is used to download the resource once) download initiated via nsIChannel::AsyncOpen method can be canceled via nsIRequest::Cancel method at anytime after invocation of AsyncOpen method nsIProtocolHandler a service that manages a protocol, identified by it's URI scheme (eg. http) maps URI string to nsIURI instance via NewURI method creates nsIChannel instance from nsIURI instance via NewChannel method nsIStreamListener : nsIRequestObserver implemented by the consumer of a nsIChannel instance passed to nsIChannel::AsyncOpen method nsIRequestObserver::OnStartRequest - notifies start of async download nsIStreamListener::OnDataAvailable - notifies presence...
GCIntegration - SpiderMonkey Redirect 1
Assume object B is already marked, as in the leftmost frame, while objects A and C have not been marked yet. In the middle frame some code creates a pointer from B to C and destroys the pointer from A to C. In the last frame, A gets marked by the GC. The problem is that C is never marked even though it's reachable. This will likely lead to a crash if C is accessed via B. Write barriers All the schemes for preventing this sort of thing require write barriers. Every time a pointer is updated, a small amount of code runs that may mark one of the objects involved in the update. This only happens if an incremental GC is in progress. SpiderMonkey uses a simple barrier commonly called a "snapshot at the beginning" barrier. The fundamental invariant that this barrier guarantees is that any object rea...
...les of this usage in XPConnect. The js::ObjectPtr class is intended to serve as a drop-in replacement for JSObject *. It has an assignment operator that automatically invokes a write barrier. So far, though, there hasn't been much use for this class--there aren't many places outside of SpiderMonkey where a write barrier is required. Read barriers "Weak pointers" are a major complication to the scheme described above. For the purposes of this article, a weak pointer is one that is not traced during GC. At the end of the GC, if the pointer refers to an object that is not reachable via some other path, then it will be nulled out or dropped in some way. If the object is still reachable, then the pointer will be left alone. To see how weak pointers can cause trouble, consider the following situati...
Invariants
hread that is in a request never does anything that blocks. There are the usual invariants regarding locks: we do not reenter them (it would be nice to check this as there might be an exception or two); we do not wait on a condition variable unless the corresponding lock is held. There are the usual invariants regarding various fields: they are protected by certain locks or more complex locking schemes. In particular, native objects' fields are protected by property locking (below); and several things are protected by the request model, such that there may be either one writer (in GC) or many readers (in requests). No JSNative or other object-related callback ever runs at the same time as a finalizer for that object. Property locks Each thread may have a lock on at most one property at a ti...
...r many readers (in requests). No JSNative or other object-related callback ever runs at the same time as a finalizer for that object. Property locks Each thread may have a lock on at most one property at a time. (Nesting them would risk deadlock. JS_SetWatchPoint violates this rule.) Whether a property is locked, and which one, is static information for almost every line of code. The locking scheme is described under JSObjectOps.dropProperty. (Note that the locking scheme applies to all objects and talks about properties being locked. As implemented for native objects, the locking is not really that fine-grained, but that is a transparent optimization as long as we follow the rules.) A thread holding a property lock never leaves or suspends the current request. With a few exceptions (know...
Index
Mozilla › Tech › XPCOM › Index
593 nsIExternalHelperAppService Interfaces, MIME Implemented by: @mozilla.org/uriloader/external-helper-app-service;1. To access this service, use: 594 nsIExternalProtocolService Interfaces, Interfaces:Scriptable, XPCOM, XPCOM API Reference, XPCOM Interface Reference You can ask the external protocol service if it has an external handler for a given protocol scheme. And you can ask it to load the url using the default handler. 595 nsIExternalURLHandlerService Interfaces, Interfaces:Scriptable Given a URL, looks up the handler info from the operating system. This should be overridden by each operating systems implementation. 596 nsIFTPChannel Channels, Interfaces, Interfaces:Scriptable, XPCOM Interface Reference The ...
...r more lines of text with a property name on the left, then an equals sign ("="), then the value of the property. 691 nsIIOService Channels, I/O, Interfaces, Interfaces:Scriptable, URIs, XPCOM, XPCOM API Reference, XPCOM Interface Reference This interface duplicates many of the nsIProtocolHandler methods in a protocol handler independent way (For example newURI() inspects the scheme in order to delegate creation of the new URI to the appropriate protocol handler). 692 nsIIdleService Interfaces, Interfaces:Scriptable, XPCOM, XPCOM API Reference, XPCOM Interface Reference You can get the idle time directly, but in most cases you will want to register an observer for a predefined interval. The observer will get an 'idle' notification when the user is idle f...
nsIPrincipal
Inherits from: nsISerializable Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) For details on principals, how they work, and how to get the appropriate one, see Security check basics. ...
...ificate. Throws if there is no certificate associated with this principal. Read only. hasCertificate boolean Whether this principal is associated with a certificate. Read only. hashValue unsigned long Returns a hash value for the principal. Read only. Native code only! origin string The origin of this principal's codebase URI. An origin is defined as: scheme + host + port. Read only. prettyName AUTF8String The pretty name for the certificate. This sort of (but not really) identifies the subject of the certificate (the entity that stands behind the certificate). Note that this may be empty; prefer to get the certificate itself and get this information from it, since that may provide more information. Throws if there is no certi...
nsIURIFixup
ixup object implementer should honour this flag and only perform any lengthy keyword (or search) operation if it is set. FIXUP_FLAGS_MAKE_ALTERNATE_URI 2 Tell the fixup to make an alternate URI from the input URI, for example to turn foo into www.foo.com. FIXUP_FLAG_USE_UTF8 4 Use UTF-8 to encode the URI instead of the platform character set. FIXUP_FLAG_FIX_SCHEME_TYPOS 8 Fix common scheme typos. Methods createExposableURI() Converts an internal URI (for example a WYSIWYG URI) into one which we can expose to the user, for example on the URL bar. nsIURI createExposableURI( in nsIURI aURI ); Parameters aURI The URI to be converted. Return value The converted, exposable URI, as an nsIURI. Exceptions thrown NS_ERROR_UNKNOWN_PROTO...
...posableURI() Converts an internal URI (for example a WYSIWYG URI) into one which we can expose to the user, for example on the URL bar. nsIURI createExposableURI( in nsIURI aURI ); Parameters aURI The URI to be converted. Return value The converted, exposable URI, as an nsIURI. Exceptions thrown NS_ERROR_UNKNOWN_PROTOCOL When we can not get a protocol handler service for the URI scheme. NS_ERROR_MALFORMED_URI When the exposable portion of aURI is malformed. createFixupURI() Converts the specified string into a URI, first attempting to correct any errors in the syntax or other vagaries. Returns a well formed URI or nsnull if it cannot. nsIURI createFixupURI( in AUTF8String aURIText, in unsigned long aFixupFlags ); Parameters aURIText Candidate URI. aFixupFlags ...
nsIURLParser
Len, out unsigned long filepathPos, out long filepathLen, out unsigned long paramPos, out long paramLen, out unsigned long queryPos, out long queryLen, out unsigned long refPos, out long refLen); void parseServerInfo(in string serverinfo, in long serverinfoLen, out unsigned long hostnamePos, out long hostnameLen, out long port); void parseURL(in string spec, in long specLen, out unsigned long schemePos, out long schemeLen, out unsigned long authorityPos, out long authorityLen, out unsigned long pathPos, out long pathLen); void parseUserInfo(in string userinfo, in long userinfoLen, out unsigned long usernamePos, out long usernameLen, out unsigned long passwordPos, out long passwordLen); Methods The string to parse in the methods may be given as a null terminated string, in which case the...
... Obsolete since Gecko 9.0 queryPos queryLen refPos refLen parseServerInfo() serverinfo = <hostname>:<port> void parseServerInfo( in string serverinfo, in long serverinfoLen, out unsigned long hostnamePos, out long hostnameLen, out long port ); Parameters serverinfo serverinfoLen hostnamePos hostnameLen port parseURL() Breaks the URL string up into its 3 major components: a scheme, an authority section (hostname, and so on.), and a path. spec = <scheme>://<authority><path> void parseURL( in string spec, in long specLen, out unsigned long schemePos, out long schemeLen, out unsigned long authorityPos, out long authorityLen, out unsigned long pathPos, out long pathLen ); Parameters spec specLen schemePos schemeLen authorityPos authorityLen pathPos pat...
URLs - Plugins
RL) protocols provide a means for locating and accessing resources that are available on the Internet and on intranets. Plug-ins can request and receive the data associated with URLs of any type that the browser can handle, including HTTP, FTP, news, mailto, and gopher. The table below summarizes URLs supported by Gecko. In addition, Gecko may support URLs not listed on this table. URL Scheme Description about Locates browser information or "fun" pages. file (Host-specific filenames) Locates files on a specific host computer rather than an Internet resource. ftp (File Transfer Protocol) Locates files and directories on Internet hosts for file download. gopher (Gopher protocol) Locates specified items on a Gopher server. Obsolete since...
... telnet (Reference to interactive sessions) Locates an interactive service. wais (Wide Area Information Servers) Locates WAIS databases and their documents. wysiwyg Placed before another URL; displays a page that JavaScript has updated using document.write. For more information, see RFC 3986, "Uniform Resource Identifier (URI): Generic Syntax", and the IANA URI scheme registry. Getting URLs Posting URLs Getting URLs To retrieve a URL and display it on a specified target page, use the NPN_GetURL, NPN_GetURLNotify, and NPP_URLNotify functions. This section describes the methods and procedures used for getting the URL and displaying the page. The plug-in uses the NPN_GetURL function to ask the browser to display data retrieved from a URL in a specified ta...
Network request list - Firefox Developer Tools
mn, a turtle icon appears if the server waiting time exceeds a threshhold (default: 500 ms). A tooltip explains the problem. You can configure the threshhold in the Configuration Editor (about:config) by modifying the devtools.netmonitor.audits.slow setting. URL: The URL of the file requested. Protocol: The network protocol used to transfer the data, this column is hidden by default. Scheme: The scheme (https/http/ftp/...) of the path requested. This column is hidden by default. Remote IP: The IP address of the server answering the request. This column is hidden by default. Type: Content-type of the response. Cookies: The number of request cookies associated to the request. This column is hidden by default. This is new in Firefox 55. Set-Cookies: The number of response cookies...
...024. larger-than:2000 -larger-than:4k mime-type Shows resources that match the specified MIME type. mime-type:text/html mime-type:image/png mime-type:application/javascript is is:cached and is:from-cache shows only resources coming from cache. is:running shows only resources, which are currently being transferred. is:cached -is:running scheme Shows resources transferred via the given scheme. scheme:http has-response-header Shows resources that contain the specified HTTP response header. has-response-header:cache-control has-response-header:X-Firefox-Spdy set-cookie-domain Shows the resources that have a Set-Cookie header with a Domain attribute that matches the specified value. set-cookie-domain...
FileSystemEntry - Web APIs
for the FileSystemFileEntry and FileSystemDirectoryEntry interfaces, which provide features specific to file system entries representing files and directories, respectively. The FileSystemEntry interface includes methods that you would expect for manipulating files and directories, but it also includes a convenient method for obtaining the URL of the entry: toURL(). It also introduces a new URL scheme: filesystem:. You can use the filesystem: scheme on Google Chrome to see all the files and folders that are stored in the origin of your app. Just use filesystem: scheme for the root directory of the origin of the app. For example, if your app is in http://www.html5rocks.com, open filesystem:http://www.html5rocks.com/temporary/ in a tab. Chrome shows a read-only list of all the files and folders...
...and size. getParent() Returns a FileSystemDirectoryEntry representing the entry's parent directory. moveTo() Moves the file or directory to a new location on the file system, or renames the file or directory. remove() Removes the specified file or directory. You can only remove directories which are empty. toURL() Creates and returns a URL which identifies the entry. This URL uses the URL scheme "filesystem:". Specifications Specification Status Comment File and Directory Entries API Draft Draft of proposed API This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/brows...
FileSystemEntrySync - Web APIs
ized. Various browsers implement pieces of the File and Directory Entries API (otherwise known as the File System API) but you should try to avoid using it. Basic concepts The FileSystemEntrySync interface includes methods that you would expect for manipulating files and directories, but it also include a really handy method for getting a URL of the entry: toURL(). It also introduces a new URL scheme: filesystem:. You can use the filesystem: scheme on Google Chrome to see all the files and folders that are stored in the origin of your app. Just use filesystem: scheme for the root directory of the origin of the app. For example, if your app is in http://ww.html5rocks.com, open filesystem:http://www.html5rocks.com/temporary/ in a tab. Chrome shows a read-only list of all the files and folders ...
...e source entry, its parent directory, and the target directory. QUOTA_EXCEEDED_ERR The operation would cause the application to exceed its storage quota. You can ask for a larger persistent storage, which your user must explicitly grant. For more information, see the article on basic concepts. toURL() Returns a URL that can be used to identify this entry. It exposes a new URL scheme--filesystem:--that you can use to fill src or href attributes. For example, if you wanted to display an image and have its fileEntry, calling toURL() gives you the image file's file system URL. You get something like: filesystem:http://example.com/temporary/lolcat.png. The file system URL does not expire. Because the method describes a location on disk, the URL is valid for as long as that locat...
HTMLHyperlinkElementUtils - Web APIs
o objects of this type, but several objects such as HTMLAnchorElement and HTMLAreaElement implement it. Properties Note: This interface doesn't inherit any property. HTMLHyperlinkElementUtils.href This a stringifier property that returns a USVString containing the whole URL, and allows the href to be updated. HTMLHyperlinkElementUtils.protocol This is a USVString containing the protocol scheme of the URL, including the final ':'. HTMLHyperlinkElementUtils.host This is a USVString containing the host, that is the hostname, and then, if the port of the URL is not empty (which can happen because it was not specified or because it was specified to be the default port of the URL's scheme), a ':', and the port of the URL. HTMLHyperlinkElementUtils.hostname This is a USVString containing ...
... '#' followed by the fragment identifier of the URL. HTMLHyperlinkElementUtils.username This is a USVString containing the username specified before the domain name. HTMLHyperlinkElementUtils.password This is a USVString containing the password specified before the domain name. HTMLHyperlinkElementUtils.origin Read only This returns a USVString containing the origin of the URL (that is its scheme, its domain and its port). Methods Note: This interface doesn't inherit any method. HTMLHyperlinkElementUtils.toString() This returns a USVString containing the whole URL. It is a synonym for HTMLHyperlinkElementUtils.href, though it can't be used to modify the value. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLHyp...
HTMLMetaElement - Web APIs
erties Inherits properties from its parent, HTMLElement. Name Type Description content DOMString Gets or sets the value of meta-data property. httpEquiv DOMString Gets or sets the name of an HTTP response header to define for a document. name DOMString Gets or sets the name of a meta-data property to define for a document. scheme DOMString Gets or sets the name of a scheme used to interpret the value of a meta-data property. Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLMetaElement' in that specification. Living Standard HTML5The definition of 'HTMLM...
...property. Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLMetaElement' in that specification. Living Standard HTML5The definition of 'HTMLMetaElement' in that specification. Recommendation The following property is now obsolete: scheme. Document Object Model (DOM) Level 2 HTML SpecificationThe definition of 'HTMLMetaElement' in that specification. Obsolete No change from Document Object Model (DOM) Level 1 Specification. Document Object Model (DOM) Level 1 SpecificationThe definition of 'HTMLMetaElement' in that specification. Obsolete Initial definition. ...
URL - Web APIs
Web › API › URL
'#' followed by the fragment identifier of the URL. host A USVString containing the domain (that is the hostname) followed by (if a port was specified) a ':' and the port of the URL. hostname A USVString containing the domain of the URL. href A stringifier that returns a USVString containing the whole URL. origin Read only Returns a USVString containing the origin of the URL, that is its scheme, its domain and its port. password A USVString containing the password specified before the domain name. pathname A USVString containing an initial '/' followed by the path of the URL. port A USVString containing the port number of the URL. protocol A USVString containing the protocol scheme of the URL, including the final ':'. search A USVString indicating the URL's parameter string; i...
...ed before the domain name. Methods toString() Returns a USVString containing the whole URL. It is a synonym for URL.href, though it can't be used to modify the value. toJSON() Returns a USVString containing the whole URL. It returns the same string as the href property. Static methods createObjectURL() Returns a DOMString containing a unique blob URL, that is a URL with blob: as its scheme, followed by an opaque string uniquely identifying the object in the browser. revokeObjectURL() Revokes an object URL previously created using URL.createObjectURL(). Usage notes The constructor takes a url parameter, and an optional base parameter to use as a base if the url parameter is a relative URL: const url = new URL('../cats', 'http://www.example.com/dogs'); console.log(url.hostname)...
URLUtilsReadOnly.origin - Web APIs
This version of origin is implemented by WorkerLocation for use on workers. ...
... This version of origin is implemented by WorkerLocation for use on workers. ...
Web accessibility for seizures and physical reactions - Accessibility
: reduce) { } @media screen and (prefers-reduced-motion) { } To see a great example of how to use the code prefers-reduced-motion, visit the MDN document, prefers-reduced-motion, or see the example below from the section on New in Chrome 74. button { animation: vibrate 0.3s linear infinite both; } @media (prefers-reduced-motion: reduce) { button { animation: none; } } prefers-color-scheme This can be useful if the ambient light API is not available. Support is emerging. @media (prefers-color-scheme: dark) { /* adust styles for dark mode */ } Window.matchMedia() There is a powerful tool available to developers via Window.matchMedia(). A great resource is MDN's document on Window.matchMedia() media update feature The more often the screen is refreshed, the more stable it a...
...thor's chosen colors. From W3C's Draft document, Media Queries Level 5 section on forced-colors: "The forced-colors media feature is used to detect if the user agent has enabled a forced colors mode where it enforces a user-chosen limited color palette on the page". The user will need to be made aware of this ability, and it will need to play nice with the appropriate value for the prefers-color-scheme media query. light-level From W3C's Draft document, Media Queries Level 5 section on light-level: "The light-level media feature is used to query about the ambient light-level in which the device is used, to allow the author to adjust style of the document in response." This will be a godsend to those who have motor-skills problems, or for some with cognitive difficulties, who cannot find the r...
@media - CSS: Cascading Style Sheets
Web › CSS › @media
ce handle content that overflows the viewport along the block axis? Added in Media Queries Level 4. overflow-inline Can content that overflows the viewport along the inline axis be scrolled? Added in Media Queries Level 4. pointer Is the primary input mechanism a pointing device, and if so, how accurate is it? Added in Media Queries Level 4. prefers-color-scheme Detect if the user prefers a light or dark color scheme Added in Media Queries Level 5. prefers-contrast Detects if the user has requested the system increase or decrease the amount of contrast between adjacent colors Added in Media Queries Level 5. prefers-reduced-motion The user prefers less motion on the page Added in Media Queries Level 5. prefers-...
...amples, please see Using media queries. Specifications Specification Comment Feedback Media Queries Level 5The definition of '@media descriptors' in that specification. Reinstates light-level, inverted-colors and Custom Media Queries, which were removed from Level 4. Adds prefers-reduced-motion, prefers-reduced-transparency, prefers-contrast, and prefers-color-scheme media features. CSS Working Group drafts GitHub issues CSS Conditional Rules Module Level 3The definition of '@media' in that specification. Defines the basic syntax of the @media rule. CSS Working Group drafts GitHub issues Media Queries Level 4The definition of '@media' in that specification. Adds scripting, pointer, hover, update, overflow-block, and overflow...
Identifying resources on the Web - HTTP
SomewhereInTheDocument URNs A Uniform Resource Name (URN) is a URI that identifies a resource by name in a particular namespace. urn:isbn:9780141036144 urn:ietf:rfc:7230 The two URNs correspond to the book Nineteen Eighty-Four by George Orwell, the IETF specification 7230, Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing. Syntax of Uniform Resource Identifiers (URIs) Scheme or protocol http:// is the protocol. It indicates which protocol the browser must use. Usually it is the HTTP protocol or its secured version, HTTPS. The Web requires one of these two, but browsers also know how to handle other protocols such as mailto: (to open a mail client) or ftp: to handle file transfer, so don't be surprised if you see such protocols. Common schemes are: Sch...
...ent, for example, the browser will scroll to the point where the anchor is defined; on a video or audio document, the browser will try to go to the time the anchor represents. It is worth noting that the part after the #, also known as fragment identifier, is never sent to the server with the request. Usage notes When using URLs in HTML content, you should generally only use a few of these URL schemes. When referring to subresources -- that is, files that are being loaded as part of a larger document -- you should only use the HTTP and HTTPS schemes. Increasingly, browsers are removing support for using FTP to load subresources, for security reasons. FTP is still acceptable at the top level (such as typed directly into the browser's URL bar, or the target of a link), although some browsers m...
Authorization - HTTP
a user agent with a server, usually, but not necessarily, after the server has responded with a 401 Unauthorized status and the WWW-Authenticate header. Header type Request header Forbidden header name no Syntax Authorization: <type> <credentials> Directives <type> Authentication type. A common type is "Basic". Other types: IANA registry of Authentication schemes Authentification for AWS servers (AWS4-HMAC-SHA256) <credentials> If the "Basic" authentication scheme is used, the credentials are constructed like this: The username and the password are combined with a colon (aladdin:opensesame). The resulting string is base64 encoded (YWxhZGRpbjpvcGVuc2VzYW1l). Note: Base64 encoding does not mean encryption or hashing! This method is equa...
...cation. ...
Proxy-Authenticate - HTTP
t to the proxy server, allowing it to transmit the request further. The Proxy-Authenticate header is sent along with a 407 Proxy Authentication Required. Header type Response header Forbidden header name no Syntax Proxy-Authenticate: <type> realm=<realm> Directives <type> Authentication type. A common type is "Basic". IANA maintains a list of authentication schemes. realm=<realm> A description of the protected area, the realm. If no realm is specified, clients often display a formatted host name instead. Examples Proxy-Authenticate: Basic Proxy-Authenticate: Basic realm="Access to the internal site" Specifications Specification Title RFC 7235, section 4.3: Proxy-Authenticate HTTP/1.1: Authentication RFC 7617 The...
...ion of the protected area, the realm. If no realm is specified, clients often display a formatted host name instead. Examples Proxy-Authenticate: Basic Proxy-Authenticate: Basic realm="Access to the internal site" Specifications Specification Title RFC 7235, section 4.3: Proxy-Authenticate HTTP/1.1: Authentication RFC 7617 The 'Basic' HTTP Authentication Scheme ...
Proxy-Authorization - HTTP
ser agent to a proxy server, usually after the server has responded with a 407 Proxy Authentication Required status and the Proxy-Authenticate header. Header type Request header Forbidden header name no Syntax Proxy-Authorization: <type> <credentials> Directives <type> Authentication type. A common type is "Basic". See also the IANA registry of Authentication schemes. <credentials> The credentials are constructed like this: The username and the password are combined with a colon (aladdin:opensesame). The resulting string is base64 encoded (YWxhZGRpbjpvcGVuc2VzYW1l). Note: Base64 encoding does not mean encryption or hashing! This method is equally secure as sending the credentials in clear text (base64 is a reversible encoding). Prefer to use HT...
...lly secure as sending the credentials in clear text (base64 is a reversible encoding). Prefer to use HTTPS in conjunction with Basic Authentication. Examples Proxy-Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l Specifications Specification Title RFC 7235, section 4.4: Proxy-Authorization HTTP/1.1: Authentication RFC 7617 The 'Basic' HTTP Authentication Scheme ...
WWW-Authenticate - HTTP
ion method that should be used to gain access to a resource. The WWW-Authenticate header is sent along with a 401 Unauthorized response. Header type Response header Forbidden header name no Syntax WWW-Authenticate: <type> realm=<realm>[, charset="UTF-8"] Directives <type> Authentication type. A common type is "Basic". IANA maintains a list of Authentication schemes. realm=<realm> A description of the protected area. If no realm is specified, clients often display a formatted hostname instead. charset=<charset> Tells the client the server's prefered encoding scheme when submitting a username and password. The only allowed value is the case insensitive string "UTF-8". This does not relate to the encoding of the realm string. Examples Typically, a serv...
...nticate: Basic realm="Access to the staging site", charset="UTF-8" See also HTTP authentication for examples on how to configure Apache or nginx servers to password protect your site with HTTP basic authentication. Specifications Specification Title RFC 7235, section 4.1: WWW-Authenticate HTTP/1.1: Authentication RFC 7617 The 'Basic' HTTP Authentication Scheme ...
Cross-domain Content Scripts - Archive of obsolete content
Wildcards are not allowed. This feature is currently only available for content scripts, not for page scripts included in HTML files shipped with your add-on. Cross-domain iframes Th...
widget - Archive of obsolete content
nstances attached to other browser windows will be unaffected. By contrast, any changes you make to an instance of the normal Widget class will be applied across all browser windows. This class has all the same methods, attributes and events as the Widget class except for the getView method and the attach event. In this example WidgetView is used to display different content for http and https schemes: // A widget that update its content specifically to each window. var tabs = require("sdk/tabs"); var windows = require("sdk/windows").browserWindows; var widget = require("sdk/widget").Widget({ id: "window-specific-test", label: "Widget with content specific to each window", content: " ", width: 50 }); // Observe tab switch or document changes in each existing tab: function updateWidge...
window/utils - Archive of obsolete content
vel (application) windows. It takes the uri of the window document as its first argument and an optional hash of options as its second argument. var { open } = require('sdk/window/utils'); var window = open('data:text/html,Hello Window'); This function wraps nsIWindowWatcher.openWindow. Parameters uri : string URI of the document to be loaded into the window. Only chrome, resource, and data schemes are accepted. options : object Options for the function, with the following properties: Name Type parent nsIDOMWindow Parent for the new window. Optional, defaults to null. name string Name that is assigned to the window. Optional, defaults to null. features object Map of features to set for the window, defined like this: ...
Localization - Archive of obsolete content
atoes But Russian has different forms for numbers ending in 1 (except 11), numbers ending in 2-4 (except 12-14) and other numbers: ???? ??????? // one tomato ??? ???????? // two tomatoes ???? ????????? // five tomatoes The SDK uses the Unicode CLDR data to describe the different plural forms used by different languages. Unicode CLDR plural forms The Unicode CLDR project defines a scheme for describing a particular language's plural rules. In this scheme a language maps each distinct range of numbers on to one of up to six forms, identified by the following categories: zero, one, two, few, many, and other. English has two forms, which can be described by mapping "1" to "one" and "everything else" to "other": one -> n is 1; other -> everything else Russian uses four forms, t...
Canvas code snippets - Archive of obsolete content
RemoteCanvas.CANVAS_HEIGHT / windowHeight); ctx.drawWindow(remoteWindow, 0, 0, windowWidth, windowHeight, 'rgb(255, 255, 255)'); ctx.restore(); }; Usage: var remoteCanvas = new RemoteCanvas(); remoteCanvas.load(); Convert image files to base64 strings The following code gets a remote image and converts its content to Data URI scheme. var canvas = document.createElement('canvas'); var ctxt = canvas.getContext('2d'); function loadImageFile(url, callback) { var image = new Image(); image.src = url; return new Promise((accept, reject) => { image.onload = accept; image.onerror = reject; }).then(accept => { canvas.width = this.width; canvas.height = this.height; ctxt.clearRect(0, 0, this.width, this.he...
File I/O - Archive of obsolete content
hasmore = istream.readLine(line); lines.push(line.value); } while(hasmore); istream.close(); // do something with read data alert(lines); Reading a Binary File For instance, to get the data in a PNG file: var ios = Components.classes["@mozilla.org/network/io-service;1"]. getService(Components.interfaces.nsIIOService); var url = ios.newURI(aFileURL, null, null); if (!url || !url.schemeIs("file")) throw "Expected a file URL."; var pngFile = url.QueryInterface(Components.interfaces.nsIFileURL).file; var istream = Components.classes["@mozilla.org/network/file-input-stream;1"]. createInstance(Components.interfaces.nsIFileInputStream); istream.init(pngFile, -1, -1, false); var bstream = Components.classes["@mozilla.org/binaryinputstream;1"]. createInst...
How to convert an overlay extension to restartless - Archive of obsolete content
Components.utils.import()" just fine; in fact you've been able to since Firefox 4. However, because it was implemented first for only file:// and resource:// but not chrome://, everyone who learned of this new feature learned that you had to load JSM from resource:// URIs and just stuck with that forever. It does still work if you don't have restartlessness to worry about, though the protocol (or scheme, or whatever term you prefer) really should be avoided at this point. The resource:// protocol actually bleeds into content which allows webpages to detect installed add-ons using the protocol, which is not particularly fantastic (just the static file contents, not any loaded script/data). Step 2a: Load your JSM from chrome:// Now with that preface out of the way, this part is easy: drop suppor...
Appendix: What you should know about open-source software licenses - Archive of obsolete content
d, such as the following: GNU Free Documentation License (GFDL) Creative Commons The GFDL is a license for documents and was created by the FSF, the same people behind the GPL and LGPL. Wikipedia uses this license. The Debian project, however, considers its terms too harsh, and that it does not allow for the free distribution of documents. Creative Commons is a flexible copyright licensing scheme that applies not just to documents but other creative works, including music, pictures, video, etc. It has the following characteristics: Gives creators flexibility when selecting and applying terms; Terms of use stated in easy-to-understand language; Licensing conditions conform with current copyright laws; Also has an RDF schema for attaching metadata. It is particularly convenient in t...
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
For example, to display a 16x16 icon for a file with a .pdf dot-extension (a PDF file), you would write moz-icon://.PDF?size=16. You can reference icons using content type as a key rather than dot-extension; for example, you could display a plain-text icon using moz-icon://goat?size=16&contentType=t...
Appendix F: Monitoring DOM changes - Archive of obsolete content
res; }; } Now, whenever doAwesomeDOMStuff() is called, the original function will be called, followed by your own doAwesomerDOMStuff() function, which can then further modify the DOM as needed. Variations on this method include modifying the arguments passed to the wrapped function, modifying its return value, and making changes both before and after the original method is called. This scheme is highly flexible and can be made to work under most circumstances. CSS animation events This technique, which works on Firefox 5+, has some particular advantages. Because it is based on CSS, it can be keyed to match new elements of any arbitrary CSS selector. And because it is CSS-based, and is triggered when CSS is being applied anyway, it does not slow DOM mutations. The technique was adapt...
Creating reusable content with CSS and XBL - Archive of obsolete content
You apply this technique in a simple demonstration. Information: XBL bindings The structure provided by markup languages and CSS is not ideal for complex applications where parts need to be self-contained and reusable. ...
Getting the page URL in NPAPI plugin - Archive of obsolete content
Or whenever you make network requests yourself, you almost always need to enforce same-origin policy. There's unfortunately no trivial way to do that, but you can still do it, by asking the browser for the page URL during plugin initialization. Then you can just refuse to do anything, if you don't like the URL, or you can compare it with the other URL you want to contact. So, how do we get at that page URL, i.e. the URL of the HTML which embeds the plugin, i.e. ...
Index of archived content - Archive of obsolete content
a The life of an HTML HTTP request The new nsString class implementation (1999) TraceVis Transforming XML with XSLT:Mozilla XSLT Transforming XML with XSLT:The Netscape XSLT Treehydra Treehydra Build Instructions Treehydra Manual Tuning Pageload URIScheme URIs and URLs Uriloader Using addresses of stack variables with NSPR threads on win16 Using cross commit Using gdb on wimpy computers Venkman Using Breakpoints in Venkman Venkman Internals Venkman Introduction Video presentations When T...
Install.js - Archive of obsolete content
In particular plugin developers should see how to package a plugin as an extension. ...
Layout System Overview - Archive of obsolete content
for example) the length of the lines within it changes, and thus more or less text appears on each line. The block is responsible for managing the lines. Note that lines may contain only inline elements, whereas block may contain both inline elements and other blocks.Other Layout Models: XUL In addition to managing CSS-defined formatting, the layout system provides a way to integrate other layout schemes into the presentation. Currently layout supports the formatting of XUL elements, which utilize a constraint-based layout language. The Box is introduced into the layout system's frame model via an adapter (BoxToBlockAdapter) that translates the normal layout model into the box formatting model. Conceptually, this could be used to introduce other layout systems, but it might be worth noting that ...
Safely loading URIs - Archive of obsolete content
Finally, some URIs (e.g. chrome: give the loaded page expanded privileges. If a web page gets access to a window with such expanded privileges, it may be able to abuse it to gain access to those privileges itself. To solve this problem, Gecko provides methods that allow the caller to check whether it's safe to load a particular URI. ...
The life of an HTML HTTP request - Archive of obsolete content
om some LoadURL or LoadURI variant in the webshell). The webshell then tells its DocumentLoader to load (command "view") the specified url. [note: Passes nsWebShell.mObserver as nsIStreamObserver and the webshell as nsIContentViewerContainer to the DocLoader.] (2) The Document Loader calls NS_OpenURI with the url to begin transfering the requested file. Necko (the network library) checks the url scheme (the first part of the url, http: in this case) and locates the correct nsIProtocolHandler (in this case nsHTTPHandler) and asks it for a nsIChannel (nsHTTPChannel). The channel represents the connection to the server, and is the source of the html data stream. (3) When data is starting to come from the webserver the nsIChannel calls the OnStartRequest in the DocumenLoader. Now the channel knows...
Using XPInstall to Install Plugins - Archive of obsolete content
In particular plugin developers should see how to package a plugin as an extension. ...
Methods - Archive of obsolete content
In particular plugin developers should see how to package a plugin as an extension. Methods dirCreate Creates a new directory. dirGetParent Returns an object representing the parent directory. dirRemove Removes a directory. ...
File Object - Archive of obsolete content
In particular plugin developers should see how to package a plugin as an extension. File Use the File object to manipulate local files and directories during the installation process. ...
InstallVersion Object - Archive of obsolete content
In particular plugin developers should see how to package a plugin as an extension. InstallVersion You use InstallVersion objects to contain version information for software. ...
Methods - Archive of obsolete content
In particular plugin developers should see how to package a plugin as an extension. Methods addDirectory Unpacks an entire subdirectory. addFile Unpacks a single file. ...
Properties - Archive of obsolete content
In particular plugin developers should see how to package a plugin as an extension. Properties archive Full local path of the archive after it is downloaded to the platform specific temp folder. (e.g. ...
Install Object - Archive of obsolete content
In particular plugin developers should see how to package a plugin as an extension. Install Use the Install object to manage the downloading and installation of software with the XPI Installation Manager. ...
Methods - Archive of obsolete content
Parts of this page show the use of the XPInstall API. The majority of this API is now deprecated and as of Gecko 1.9 no longer available. Extension, Theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. In particular plugin developers should see how to package a plugin as an extension. Methods getString Retrieves a value from a .ini file. writeString Changes a value in a .ini file. ...
WinProfile Object - Archive of obsolete content
In particular plugin developers should see how to package a plugin as an extension. WinProfile (Windows only) Windows developers use this object to manipulate the content of a Windows .ini file. Overview This object does not have a public constructor. ...
Methods - Archive of obsolete content
In particular plugin developers should see how to package a plugin as an extension. Methods createKey Adds a key. deleteKey Removes a key. deleteValue Removes the value of an arbitrary key. ...
WinReg Object - Archive of obsolete content
In particular plugin developers should see how to package a plugin as an extension. WinReg (Windows only) Windows developers use this object to manipulate the content of the Windows registry. Overview This object does not have a public constructor. ...
XPInstall API reference - Archive of obsolete content
In particular plugin developers should see how to package a plugin as an extension. ...
Learn XPI Installer Scripting by Example - Archive of obsolete content
In particular plugin developers should see how to package a plugin as an extension. This article uses the installer script from browser.xpi install package as the basis for discussing XPI installations in general. ...
Introduction to XUL - Archive of obsolete content
.org/keymaster/gatekeeper/there.is.only.xul"> <window id="main"> ... </window> <window id="help"> ... </window> </package> And a window (or other service) could be instantiated by first parsing the whole package and then picking out a window from its contents Package *package = LoadPackage("http://xxx/package.xul"); InstantiateWindow(package, GetNodeWithID("main"); This happy scheme doesn't work today, because the code expects the result of parsing an XML document to be a window. So currently, a single XUL file must contain a single window. <?xml version="1.0"?> <?xml-stylesheet href="xul.css" type="text/css"?> <!DOCTYPE window> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> ... </window> We would like to head more toward the "package" im...
Creating an Installer - Archive of obsolete content
In particular plugin developers should see how to package a plugin as an extension. << PreviousNext >> This section will describe packaging a XUL application into an installer. ...
XUL Structure - Archive of obsolete content
browser.js -- other browser XUL and JS files goes here -- bookmarks -- bookmarks files go here -- preferences -- preferences files go here -- . . . This is easily recognizable as a content package, as the top-level directory is called content. For skins, this directory will usually be called skin and for locales, it will usually be called locale. This naming scheme isn't necessary, but this is a common convention to make the parts of a package clearer. Some packages may include a content section, a skin, and a locale. In this case, you will find a subdirectory for each type. For example, Chatzilla is distributed in this way. The content/browser directory contains a number of files with .xul and .js extensions. The XUL files are the ones with the .xul exten...
Writing Skinnable XUL and CSS - Archive of obsolete content
t the global skin (or any other skin for that matter). They are already derived skins and therefore should not inherit from global. They should instead rely on the context in which they will appear for color, font, and border information. For example, the sidebar should not import the global skin, since it could appear in Messenger and in Navigator (which could have two completely different color schemes). If it imported the global skin, then when it was overlayed into Navigator, it would potentially clash (if the user's current chosen Navigator skin were NOT inheriting from global). Derived skin files should not contain any font, color, or border information. This information should only be found in base skin files. The skin file should instead inherit from a base skin file to obtain the appro...
XUL Questions and Answers - Archive of obsolete content
non-RDF datasources for XUL template is planned (bug 321170): XML datasources (bug 321171) Storage (sqlite) datasources (bug 321172) When loading an XSLT stylesheet into an XML I get the error: "Error loading stylesheet: An XSLT stylesheet load was blocked for security reasons." That error is from a security check that has been put up to safeguard against cross-site-scripting attacks. A scheme is in development to allow servers to open up their site for cross-site access, but that's not yet done. hidechrome="true" doesn't work on a Mac? Unfortunately, no simple solution to this was posted. A workaround is to open the content in a new window using "window.open" and send titlebar="no" as one of the flags in the 3rd argument. Is it possible to have checkbox support for multi column...
XUL accessibility guidelines - Archive of obsolete content
ason to change them. If you must change them, use CSS to size elements relative to the default sizes (for example, use % or em rather than specific point or pixel sizes). Color Color is an important tool. Different colors can give different meanings to objects and text. However, color alone is inadequate for conveying meaning or information to the user. Some users may override the default color scheme of your application. Color should only be used to enhance the meaning of an object or text after that meaning is also communicated another way. Flexible sizing One of the great things about XUL is that visual layout is easy to control. On the web, visual design is often contained to a specific size. With XUL you can allow elements to flex with the resizing of the application window. Use the fle...
The Implementation of the Application Object Model - Archive of obsolete content
to be reflected right in the XUL). Referencing local data: The LOCALDATA attribute A tag that references local RDF data does so by using the localData attribute, which gives the URI of the local data that should be merged in with the XUL content tree. Examples of tags that can reference local data are menu, menuitem, menubar, toolbox, toolbar, treebody, and treeitem. TODO: Outline the naming scheme for local data. Give an example once I actually know what the naming scheme will be. Talk to John McMullen about 5.0 preferences and figure out where LOCALDATA will need to be used (likely on every form element control) Talk to Steve Elmer. It's likely that this might be the desirable solution for buttons that observe preferences (like the HOME button) Denoting persistence of local annotation...
Deploying XULRunner - Archive of obsolete content
Finally : You can...
Archived Mozilla and build documentation - Archive of obsolete content
y diagnose many tracing-related performance issues. Treehydra Try the gcc python plugin instead: https://fedorahosted.org/gcc-python-plugin/. URIs and URLs Handling network and locally retrievable resources is a central part of Necko. Resources are identified by URI "Uniform Resource Identifier" (Taken from RFC 2396): URIScheme List of Mozilla supported URI schemes Using addresses of stack variables with NSPR threads on win16 This is a cautionary note that may be old information for some of you. However, since it affects the portability of code, it was deemed prudent to include a short memo describing the issue. When working with Mozilla, you tend to accumulate patches which nee...
2006-10-20 - Archive of obsolete content
x and other assorted browsers. Also a debate about which browser is "beating" which to a lesser extent further in the discussion. How to create firefox extension (chrome) to add images next to URLs ? Question regarding how to make a firefox extension that would insert an image next to all links in the loaded web pages similar to the McAfee SiteAdvisor extension. Adding support for new URI scheme Question regarding creating a new URI scheme for Firefox on Windows. Helpful information was found here on mozillaZine. Meetings None this week. Authors Sara Minchella (sara) Dave Manley (seneManley) Back to Summary List ...
NPN_MemAlloc - Archive of obsolete content
amount of memory in the browser's memory space. If you allocate saved instance data with NPP_Destroy, be sure to use NPN_MemAlloc to allocate memory. This ensures that the browser can free the saved data at a later time with the equivalent of NPN_MemFree. Since the browser and plug-ins share the same memory space, NPN_MemAlloc allows plug-ins to take advantage of any customized memory allocation scheme the application may have, and allows the application to manage its memory more flexibly and efficiently. Mac OS NPN_MemAlloc is particularly important on Mac OS, since the Mac OS version of the browser frequently fills its memory partition with cached data that is only purged as necessary. Since NPN_MemAlloc automatically frees cached information if necessary to fulfill the request, calls to NP...
The First Install Problem - Archive of obsolete content
ko known as 0.9.4.2. Note that this means that at a minimum, the plugin vendor is ensuring compatibility with 0.9.4.2 browsers. "ProductName" -- This is the String Value name of the actual product. Example: [HKEY_LOCAL_MACHINE\Software\MozillaPlugins\@mycompany.com/MyApplication,version=5.01] ProductName=MyApplication Player 5 "Version" -- This is the versioning scheme of the above Product. Example: [HKEY_LOCAL_MACHINE\Software\MozillaPlugins\@mycompany.com/MyApplication,version=5.01] Version=5.01 MimeTypes -- This is a subkey and contains individual mimetypes as further subkeys. HKEY_LOCAL_MACHINE\Software\MozillaPlugins\@mycompany.com/MyApplication,version=5.01/MimeTypes/someMimeTypeSubkey/ The MimeTypes...
Introduction to Public-Key Cryptography - Archive of obsolete content
provides maximum nonrepudiation, but may involve more participation by the user in the issuing process. Flexible key management capabilities are essential for most organizations. Key recovery, or the ability to retrieve backups of encryption keys under carefully defined conditions, can be a crucial part of certificate management (depending on how an organization uses certificates). Key recovery schemes usually involve an m of n mechanism: for example, m of n managers within an organization might have to agree, and each contribute a special code or key of their own, before a particular person's encryption key can be recovered. This kind of mechanism ensures that several authorized personnel must agree before an encryption key can be recovered. Renewing and Revoking Certificates Like a driver'...
Building a Theme - Archive of obsolete content
URI (since the location of Firefox on the system can change from platform to platform and system to system), Mozilla developers came up with a solution for creating URIs to content that the installed add-on knows about. The browser window is: chrome://browser/content/browser.xul. Try typing this URL into the location bar in Firefox! Chrome URIs consist of several components: Firstly, the URI scheme (chrome) which tells Firefox's networking library that this is a Chrome URI. It indicates that the content of the URI should be handled as a (chrome). Compare (chrome) to (http) which tells Firefox to treat the URI as a web page. Secondly, a package name (in the example above, browser) which identifies the bundle of user interface components. Thirdly, the type of data being requested. There are...
-ms-scrollbar-base-color - Archive of obsolete content
div { width: 150px; height: 150px; border-style: solid; border-width: thin; overflow-y: scroll; font-family: sans-serif; float: left; margin-right: 10px; } .aquaScroll { scrollbar-base-color: aqua; scrollbar-arrow-color: blue; border-color: blue; } .bisqueScroll { scrollbar-base-color: bisque; scrollbar-arrow-color: red; border-color: red; } <body> <div class="a...
-ms-scrollbar-highlight-color - Archive of obsolete content
div { width: 150px; height: 150px; border-style: solid; border-width: thin; overflow-y: scroll; font-family: sans-serif; float: left; margin-right: 10px; } .blueScroll { -ms-scrollbar-highlight-color: aqua; -ms-scrollbar-face-color: blue; -ms-scrollbar-arrow-color: blue; border-color: blue; } .redScroll { -ms-scrollbar-highlight-color: bisque; -ms-scrollbar-face-c...
-ms-scrollbar-track-color - Archive of obsolete content
div { width: 150px; height: 150px; border-style: solid; border-width: thin; overflow-y: scroll; font-family: sans-serif; float: left; margin-right: 10px; } .blueScroll { -ms-scrollbar-highlight-color: aqua; -ms-scrollbar-face-color: blue; -ms-scrollbar-arrow-color: blue; border-color: blue; } .redScroll { -ms-scrollbar-highlight-color: bisque; -ms-scrollbar-face-c...
Reference - Archive of obsolete content
SGML comment hiding needs to be mentioned here and its consequences. Brendan just mentioned one obscure one here: https://bugzilla.mozilla.org/show_bu...?id=310993#c20 --Maian 22:46, 5 October 2005 (PDT) Section title capitalization There's an inconsistency in the capitalization of section titles. Some capitalize everything as if it's a book title. Others just capitalize the first word. Which scheme should we take, or does it even matter? --Maian 07:11, 8 September 2005 (PDT) If you want to make them consistent, I think we should go with the "First word only" capitalization, rather than the book-title style. Thanks :) -- dria deprecated pre box Is there any wiki markup available for deprecated examples? --Maian 20:24, 25 Aug 2005 (PDT) Help:Custom_Templates#Template:deprecated_header ...
Building Mozilla XForms - Archive of obsolete content
ve successfully built your first Mozilla XForms extension! The built XPI file will only install on a nightly snapshot from the same day or your self-built Firefox version. If you are sure that older or newer Firefox versions are compatible with your extension, you can unzip the XPI file (it's a regular ZIP file), edit the install.rdf and change the minVersion and maxVersion entries. ...
RDF in Fifty Words or Less - Archive of obsolete content
s no reason that you shouldn't be able to treat these as "bookmarks" as well, grouping them together into folders as you please, or maybe even creating "smart" folders that, when you open them, dynamically generate their contents by running common search that you define. And a "bookmark" could really have arbitrary properties associated with it: you might want to invent your own "classification" scheme for a bookmarka la Macintosh's "hot", "warm", "cool" color coding. Or you might want to relate a bookmark to another bookmark, or keep it in multiple "folders" at once. The RDF graph provides a perfect data model upon which to build a "universal" bookmarking service as described above: the graph can contain pointers to arbitrary resources and can group them in just about any way that you can ima...
Archive of obsolete content
technical limitations. They are actually replaced by ''-(EXAMPLE REMOVED)-'' The goal of this handbook is to help you update websites to work with standards-based browsers and properly detect Gecko. Getting the page URL in NPAPI plugin Sometimes, you want to restrict an NPAPI plugin to be loadable only from a certain URL or domain or scheme. Or whenever you make network requests yourself, you almost always need to enforce same-origin policy. Index of archived content Inner-browsing extending the browser navigation paradigm This article is the version from 2003 with slight modifications (no images and no links to samples). It's here for reference. Install.js See also this arti...
Base64 - MDN Web Docs Glossary: Definitions of Web-related terms
This is to ensure that the data remain intact without modification during transport. Base64 is commonly used in a number of applications including email via MIME, and storing complex data in XML. One common application of base64 encoding on the web is to encode binary data so it can be included in a data: URL. ...
Block (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
Learn more General knowledge Visual formatting model ...
HTTP - MDN Web Docs Glossary: Definitions of Web-related terms
The HyperText Transfer Protocol (HTTP) is the underlying network protocol that enables transfer of hypermedia documents on the Web, typically between a browser and a server so that humans can read them. The current version of the HTTP specification is called HTTP/2. As part of a URI, the "http" within "http://example.com/" is called a "scheme". Resources using the "http" schema are typically transported over unencrypted connections using the HTTP protocol. The "https" scheme (as in "https://developer.mozilla.org") indicates that a resource is transported using the HTTP protocol, but over a secure TLS channel. HTTP is textual (all communication is done in plain text) and stateless (no communication is aware of previous communications). This property makes it ideal for humans to read doc...
Site - MDN Web Docs Glossary: Definitions of Web-related terms
uffix (e.g. com, org or co.uk). The concept of a site is used in SameSite cookies, as well as a web application's Cross-Origin Resource Policy. ...
Assessment: Accessibility troubleshooting - Learn web development
t the bottom of this page. Project brief For this project, you are presented with a fictional nature site displaying a "factual" article about bears. As it stands, it has a number of accessibility issues -- your task is to explore the existing site and fix them to the best of your abilities, answering the questions given below. Color The text is difficult to read because of the current color scheme. Can you do a test of the current color contrast (text/background), report the results of the test, and then fix it by changing the assigned colors? Semantic HTML The content is still not very accessible -- report on what happens when you try to navigate it using a screenreader. Can you update the article text to make it easier for screenreader users to navigate? The navigation menu part of...
Creating fancy letterheaded paper - Learn web development
e top and bottom, but completely transparent for a large part of the center. Add another background declaration that just adds the top image to the top of the letter, as a fallback for browsers that don't support the previous declaration. Add a white background color to the letter. Add a 1mm top and bottom solid border to the letter, in a color that is inkeeping with the rest of the color scheme. The logo To the <h1>, add the logo as a background image. Add a filter to the logo to give it a subtle drop shadow. Now comment out the filter and implement the drop shadow in a different (slightly more cross-browser compatible) way, which still follows the shape of the round image. Hints and tips Remember that you can create a fallback for older browsers by putting the fallback vers...
CSS values and units - Learn web development
(which represents 15) -- so 0123456789abcdef. Each pair of values represents one of the channels -- red, green and blue -- and allows us to specify any of the 256 available values for each (16 x 16 = 256.) These values are a bit more complex and less easy to understand, but they are a lot more versatile than keywords -- you can use hex values to represent any color you want to use in your color scheme. Again, try changing the values to see how the colors vary. RGB and RGBA values The third scheme we'll talk about here is RGB. An RGB value is a function -- rgb() -- which is given three parameters that represent the red, green, and blue channel values of the colors, in much the same way as hex values. The difference with RGB is that each channel is represented not by two hex digits, but by...
Styling links - Learn web development
so doesn't cut across the descenders of the word being underlined (e.g. the tails on g and y). The border-bottom value has been set as 1px solid, with no color specified. Doing this makes the border adopt the same color as the element's text, which is useful in cases like this where the text is a different color in each case. 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! Active learning: Style your own links In this active learning session, we'd like you to take our empty set of rules and add your own declarations to make the links look really cool. Use your imagination, go wild. We are sure you can come up with something cooler and just as functional as our example above. If y...
Creating hyperlinks - Learn web development
ould look similar to the following page: Note: If you get stuck, or aren't sure if you have got it right, you can check the navigation-menu-marked-up directory to see the correct answer. E-mail links It's possible to create links or buttons that, when clicked, open a new outgoing email message rather than linking to a resource or page. This is done using the <a> element and the mailto: URL scheme. In its most basic and commonly used form, a mailto: link simply indicates the email address of the intended recipient. For example: <a href="mailto:nowhere@mozilla.org">Send email to nowhere</a> This results in a link that looks like this: Send email to nowhere. In fact, the email address is optional. If you omit it and your href is simply "mailto:"), a new outgoing email window will be ope...
Client-side storage - Learn web development
ing HTML to the client to be displayed by the user's browser. Client-side storage works on similar principles, but has different uses. It consists of JavaScript APIs that allow you to store data on the client (i.e. on the user's machine) and then retrieve it when needed. This has many distinct uses, such as: Personalizing site preferences (e.g. showing a user's choice of custom widgets, color scheme, or font size). Persisting previous site activity (e.g. storing the contents of a shopping cart from a previous session, remembering if a user was previously logged in). Saving data and assets locally so a site will be quicker (and potentially less expensive) to download, or be usable without a network connection. Saving web application generated documents locally for use offline Often clien...
Aprender y obtener ayuda - Learn web development
unks For a start, when you are trying to implement something specific and it seems really hard to get your head around, you should try to break it down into multiple smaller problems, or chunks. For example, if you are looking at a task of "Build a simple two-column website", you could break it down as follows: Create the HTML structure Work out basic site typography Work out a basic color scheme Implement a high-level layout -- header, horizontal navigation menu, main content area with main and side columns, and footer. Implement a horizontal navigation menu etc. Then you could break it down further, for example, "Implement horizontal navigation menu" could be written out as: Make a list of menu items sit horizontally in a line. Remove unneeded defaults, like list spacing and bu...
Multiprocess on Windows
s parameter to know how many interface pointers exist in the array. mFlag may currently be set to one of two values: ArrayData::Flag::eNone or ArrayData::Flag::eAllocatedByServer. Setting eAllocatedByServer signals to the interceptor that the array is allocated within the method's implementation by calling CoTaskMemAlloc(). Using the interceptor in a11y code Unlike the built in COM marshaling schemes, we must explicitly wrap any COM objects that we want to expose, through the MTA with interceptors. The function call to wrap a COM object is mozilla::mscom::MainThreadHandoff::WrapInterface(). This receives the COM interface which you want to wrap as its first parameter, and outputs the wrapped object (with the same interface) as its second parameter. A word about smart pointers As long as yo...
Eclipse CDT
ing to this already lengthy page.) For further documentation see the official Eclipse user guide and Eclipse CDT user guide. Keyboard shortcuts Regarding key bindings (keyboard shortcuts), the bindings given below are the defaults. You can change the key bindings by opening the workspace preferences (Eclipse > Preferences, or Window > Preferences) and selecting "General > Keys". You can set the scheme to "Emacs" or "Microsoft Visual Studio" if that's your thing, or change individual key bindings. When changing individual key bindings, note that bindings are context sensitive and that any changes you make may be ignored if they conflict with existing bindings, or if they are overridden by a binding for a more specific context. For example, changing the Find Next command to cmd-G/ctrl-G is not s...
Error codes returned by Mozilla APIs
return this error if the channel has already been opened (and has not yet been closed). NS_ERROR_OFFLINE (0x804B0010) NS_ERROR_NO_CONTENT (0x804B0011) Returned from nsIChannel.asyncOpen() to indicate that OnDataAvailable will not be called because there is no content available. This is used by helper app style protocols (for example, mailto). NS_ERROR_UNKNOWN_PROTOCOL (0x804B0012) The URI scheme corresponds to an unknown protocol handler. NS_ERROR_PORT_ACCESS_NOT_ALLOWED (0x804B0013) NS_ERROR_NET_RESET (0x804B0014) NS_ERROR_FTP_LOGIN (0x804B0015) NS_ERROR_FTP_CWD (0x804B0016) NS_ERROR_FTP_PASV (0x804B0017) NS_ERROR_FTP_PWD (0x804B0018) NS_ERROR_NOT_RESUMABLE (0x804B0019) NS_ERROR_INVALID_CONTENT_ENCODING (0x804B001B) The content encoding of the source docume...
Internationalized Domain Names (IDN) Support in Mozilla Browsers
tringprep Profile for Internationalized Domain Names (IDN)) and RFC 3454 (Preparation of Internationalized Strings ("stringprep")). ASCII-compatible encoding (ACE) The next step is to convert the 8-bit characters in Unicode to 7-bit ones using only restricted ASCII characters. During the discussion phase of the IDN protocols development, there were some competing ASCII-compatible encoding (ACE) schemes proposed but an agreement was reached eventually to standardize on a type of ACE called "Punycode". This is defined in RFC 3492 (Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)). The Punycode proposal uses only restricted ASCII characters and numbers (a-z0-9) and a hyphen (-). It was shown to be language independent, superior in compression, ...
WebChannel.jsm
The WebChannel.jsm JavaScript code module provides an abstraction that uses the Message Manager and Custom Events APIs to create a two-way communication channel between chrome and content code for specific origins (using a specific origin passed to the constructor or a lookup with nsIPermissionManager while also ensuring the scheme is HTTPS). Components.utils.import("resource://gre/modules/WebChannel.jsm"); Constructor WebChannel(String webChannelId, nsIURI originOrPermission); 2nd argument is a valid origin that should be part of requests for this channel. WebChannel(String webChannelId, string originOrPermission); 2nd argument is a permission for which the permission manager will be checked to determine if the request is allowed. Note that in addition to the permission manager check,...
L10n testing with xcode
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. Next, you need to configure the iOS app simulator to run the app in your locale. Choose Product > Scheme > Edit Scheme from the toolbar menu. In the Edit Scheme screen, select Run from the left pane and then navigate to the Options tab. Select your language from the Application Language menu and click Close. Tah dah! You're ready to test your localization of Firefox on iOS. Launching & testing your Firefox on iOS localization The iOS Simulator is fairly easy to use once you launch you...
Localization and Plurals
alRuleFromProperties), making sure to save the 2 returned functions. (You can use destructured assignment in JavaScript 1.7 to keep things clean.) The returned functions act just like PluralForm.get() and PluralForm.numForms(), except for the specified plural rule instead of the default plural rule. Credits Plural Form code first implemented for bug 394516 - Figure out a remaining-time rounding scheme for minutes -> hours/days Plural rules and families derived from GNU gettext documentation. ...
Localizing with Koala
ala asks if you want to create this file. From the sidebar, add the cmd_addFoundEngine string to the newly-created search.properties file in your locale file structure. Translate the cmd_addFoundEngine string. Notice that the .properties files have a different syntax than the DTD files. They're just a simple key=value mapping. Save the file to save your work. Re-running the comparison A common scheme of working with the compare-locales tools (included in Koala) is to incrementally translate and commit the files and then re-run comparison to see what is left to be translated. To make sure you're always translating the most recent en-US reference, you should update the source repository before you start working. Open Koala's start page. In "Last used compares" click "Update repo" to update th...
Localization prerequisites
...
4.3.1 Release Notes
1 for more information about this security vulnerability. All SSL/TLS renegotiation is disabled by default in NSS 3.12.5 and therefore will be disabled by default with JSS 4.3.1. This will cause programs that attempt to perform renegotiation to experience failures where they formerly experienced successes, and is necessary for them to not be vulnerable, until such time as a new safe renegotiation scheme is standardized by the IETF. If an application depends on renegotiation feature, it can be enabled by setting the environment variable NSS_SSL_ENABLE_RENEGOTIATION to 1. By setting this environmental variable, the fix provided by these patches will have no effect and the application may become vulnerable to the issue. This default setting can also be changed within the application by using the fo...
JSS Provider Notes
is no clear timeframe for fixing them. Meanwhile, the org.mozilla.jss.crypto.CryptoStore class can be used for some of this functionality. ...
Mozilla-JSS JCA Provider notes
was created. ...
NSS 3.12.5 release_notes
on Vulnerability See CVE-2009-3555 and US-CERT VU#120541 for more information about this security vulnerability. All SSL/TLS renegotiation is disabled by default in NSS 3.12.5. This will cause programs that attempt to perform renegotiation to experience failures where they formerly experienced successes, and is necessary for them to not be vulnerable, until such time as a new safe renegotiation scheme is standardized by the IETF. If an application depends on renegotiation feature, it can be enabled by setting the environment variable NSS_SSL_ENABLE_RENEGOTIATION to 1. By setting this environmental variable, the fix provided by these patches will have no effect and the application may become vulnerable to the issue. This default setting can also be changed within the application by using the ...
NSS 3.24 release notes
ertificate is configured (which incorrectly identifies a key agreement type rather than a certificate). Separate functions for configuring Online Certificate Status Protocol (OCSP) responses or Signed Certificate Timestamps are not needed, since these can be added to the optional SSLExtraServerCertData struct provided to SSL_ConfigServerCert. Also, partial support for RSA Probabilistic Signature Scheme (RSA-PSS) certificates has been added. Although these certificates can be configured, they will not be used by NSS in this version. For functions that use temporary arenas, allocating a PORTCheapArena on the stack is more performant than allocating a PLArenaPool on the heap. Rather than declaring a PLArenaPool pointer and calling PORT_NewArena/PORT_FreeArena to allocate or free an instance on th...
NSS 3.28.2 release notes
ses/NSS_3_28_2_RTM/src/ Incorrect version number Note the version numbers embedded in the NSS 3.28.2 are wrong (it reports itself as version 3.28.1). New in NSS 3.28.2 No new functionality is introduced in this release. This is a patch release includes bug fixes and addresses some compatibility issues with TLS. Bugs fixed in NSS 3.28.2 Bug 1334114 - NSS 3.28 regression in signature scheme flexibility, causes connectivity issue between iOS 8 clients and NSS servers with ECDSA certificates Bug 1330612 - X25519 is the default curve for ECDHE in NSS Bug 1323150 - Crash [@ ReadDBEntry ] Compatibility NSS 3.28.2 shared libraries are backward compatible with all older NSS 3.x shared libraries. A program linked with older NSS 3.x shared libraries will work with NSS 3.28.2 shared libr...
NSS 3.29 release notes
ease. Distribution information The hg tag is NSS_3_29_RTM. NSS 3.29 requires Netscape Portable Runtime (NSPR) 4.13.1 or newer. NSS 3.29 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_29_RTM/src/ Notable Changes in NSS 3.29 Fixed a NSS 3.28 regression in the signature scheme flexibility that causes connectivity issues between iOS 8 clients and NSS servers with ECDSA certificates (bug1334114). TLS 1.3 is now enabled by default in (bug1311296). Bugs fixed in NSS 3.29 This Bugzilla query returns all the bugs fixed in NSS 3.29: https://bugzilla.mozilla.org/buglist.cgi?resolution=FIXED&classification=Components&query_format=advanced&product=NSS&target_milestone=3.29 ...
NSS 3.39 release notes
ation The HG tag is NSS_3_39_RTM. NSS 3.39 requires NSPR 4.20 or newer. NSS 3.39 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_39_RTM/src/ New in NSS 3.39 New Functionality The tstclnt and selfserv utilities added support for configuring the enabled TLS signature schemes using the -J parameter. NSS will use RSA-PSS keys to authenticate in TLS. Support for these keys is disabled by default but can be enabled using SSL_SignatureSchemePrefSet(). certutil added the ability to delete an orphan private key from an NSS key database. Added the nss-policy-check utility, which can be used to check an NSS policy configuration for problems. A PKCS#1...
NSS 3.43 release notes
This Bugzilla query returns all the bugs fixed in NSS 3.43: https...
NSS 3.47 release notes
certificates issued after a certain date 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...
NSS 3.55 release notes
to draft-38. Bug 1649190 - Run cipher, sdr, and ocsp tests under standard test cycle in CI. Bug 1649226 - Add Wycheproof ECDSA tests. Bug 1637222 - Consistently enforce IV requirements for DES and 3DES. Bug 1067214 - Enforce minimum PKCS#1 v1.5 padding length in RSA_CheckSignRecover. Bug 1643528 - Fix compilation error with -Werror=strict-prototypes. Bug 1646324 - Advertise PKCS#1 schemes for certificates in the signature_algorithms extension. Bug 1652331 - Update NSS 3.55 NSPR version to 4.27. This Bugzilla query returns all the bugs fixed in NSS 3.55: https://bugzilla.mozilla.org/buglist.cgi?resolution=FIXED&classification=Components&query_format=advanced&product=NSS&target_milestone=3.55 Compatibility NSS 3.55 shared libraries are backward compatible with all older NSS 3...
NSS 3.56 release notes
654142 - Add CPU feature detection for Intel SHA extension. Bug 1648822 - Add stricter validation of DH keys in FIPS mode. Bug 1656986 - Properly detect arm64 during GYP build architecture detection. Bug 1652729 - Add build flag to disable RC2 and relocate to lib/freebl/deprecated. Bug 1656429 - Correct RTT estimate used in 0-RTT anti-replay. Bug 1588941 - Send empty certificate message when scheme selection fails. Bug 1652032 - Fix failure to build in Windows arm64 makefile cross-compilation. Bug 1625791 - Fix deadlock issue in nssSlot_IsTokenPresent. Bug 1653975 - Fix 3.53 regression by setting "all" as the default makefile target. Bug 1659792 - Fix broken libpkix tests with unexpired PayPal cert. Bug 1659814 - Fix interop.sh failures with newer tls-interop commit and dependencies. ...
NSS Sample Code Sample1
ill add message protection (encryption and MACing) examples to this program in the future. Sample Code #include <iostream.h> #include "pk11pub.h" #include "keyhi.h" #include "nss.h" // Key management for keys share among multiple hosts // // This example shows how to use NSS functions to create and // distribute keys that need to be shared among multiple servers // or hosts. // // The management scheme assumes that one host is PRIMARY. It // generates the secret keys that will be used by all participating // hosts. The other hosts (SECONDARY) request keys from the // primary host. As an alternative, new keys may be sent to the // current set of SECONDARY hosts when they are generated by the // PRIMARY. In this case, the PRIMARY maintains a list of the // secondary hosts. // // The sequence o...
sslfnc.html
If successful, SECSuccess. If unsuccessful, SECFailure. Use PR_GetError to obtain the error code. Description This function completes the inheritance of file descriptors from a parent to a child process. After the child process is created, it must call this function to complete its initialization. The value of the envString argument depends on which of the two possible inheritance schemes you have used. (See Initializing Multi-Processing with a Shared SSL Server Cache.) If the SSL_INHERITANCE variable has been inherited as part of the child's environment, the child must pass a NULL pointer as the envString argument. This causes the function to look in the environment for the variable. If the parent has transmitted the value of the SSL_INHERITANCE variable to the child by so...
Network Security Services
3.2 Test Suite Archived version. Describes how to run the standard NSS tests. NSS Performance Reports Archived version. Links to performance reports for NSS 3.2 and later releases. Encryption Technologies Available in NSS 3.11 Archived version. Lists the cryptographic algorithms used by NSS 3.11. NSS 3.1 Loadable Root Certificates Archived version. Describes the scheme for loading root CA certificates. cert7.db Archived version. General format of the cert7.db database. PKCS #11 information Documentation on PKCS #11 modules Implementing PKCS #11 for NSS The strings NSS uses to load PKCS #11 modules PKCS #11 FAQ Using the JAR Installation Manager to Install a PKCS #11 Cryptographic Module PKCS #11 Conformanc...
Creating JavaScript jstest reftests
var arr = []; arr[10000] = 'item'; gc(); assertEq(arr[10000], 'item', 'gc must not wipe out sparse array elements'); } else { print('Test skipped: no gc function'); } reportCompare(0, 0, 'ok'); Handling abnormal test terminations Some tests can terminate abnormally even though the test has technically passed. Earlier we discussed the deprecated approach of using the -n naming scheme to identify tests whose PASSED, FAILED status is flipped by the post test processing code in jsDriver.pl and post-process-logs.pl. A different approach is to use the expectExitCode(exitcode) function which outputs a string: --- NOTE: IN THIS TESTCASE, WE EXPECT EXIT CODE <exitcode> --- that tells the post-processing scripts jsDriver.pl or post-process-logs.pl that the test passes if the shell o...
JSObjectOps.dropProperty
which the property is defined. The granularity of the locking is up to the JSObjectOps implementation; deadlock does not happen because each thread accesses only one property at a time. A single, built-in JSObjectOps implementation is used for most SpiderMonkey objects that are exposed to scripts. Custom JSObjectOps implementations can either retain the SpiderMonkey property storage and locking scheme (by copying all or most of the built-in JSObjectOps) or replace it entirely. Threads. In a JS_THREADSAFE build, any consistency observed by multiple threads operating on the same data is provided solely by the property locking scheme described above. In SpiderMonkey 1.8 and earlier, the main built-in JSObjectOps implementation serialized all accesses to a given object's properties. (That is, for...
JSAPI reference
fe easier when using SpiderMonkey and the JSAPI. A note on versioning: Up until the release of Firefox 4, SpiderMonkey, and thus the JSAPI, was versioned in an ad-hoc way, with releases happening at times that roughly, but not really, corresponded to Firefox releases. In the fall of 2012, the SpiderMonkey team decided to align releases with those of Firefox. The reference applies this versioning scheme retroactively starting with Firefox 5. Firefox 4 is the last release that has a corresponding SpiderMonkey release with the old scheme, where the JSAPI has the version 1.8.5. Runtimes and contexts JS_Init Added in SpiderMonkey 31 JS_ShutDown struct JSRuntime JS_NewRuntimeObsolete since JSAPI 52 JS_DestroyRuntime JS_GetRuntimePrivate JS_SetRuntimePrivate JS_SetNativeStackQuota Added ...
SpiderMonkey 1.8.5
r -L%,$(JSAPI_LDFLAGS))\ $(filter -%_namespace,$(JSAPI_LDFLAGS))\ $(filter -Wl%,$(JSAPI_LDFLAGS)) JSAPI_LDFLAGS := $(filter-out $(MOZJS_INSTALL_NAME_OPT),$(JSAPI_LDFLAGS)) endif JSAPI_LDFLAGS := $(filter-out %libffi.a,$(JSAPI_LDFLAGS)) LDFLAGS += $(JSAPI_LDFLAGS) Future Direction The SpiderMonkey 1.8.5 source release includes an experimental library versioning scheme. This versioning scheme will not be rolled back into the upstream Mozilla source tree(s), and may not be used in future source releases. Comments in bug 628723 with regard to its usefulness are appreciated. Bugs with the source release tar ball should be copied to wes@page.ca. SpiderMonkey embedders should also be aware that Mozilla has no plans to keep the JSAPI, nor the JSDBGAPI stable for em...
SpiderMonkey 1.8.7
r -L%,$(JSAPI_LDFLAGS))\ $(filter -%_namespace,$(JSAPI_LDFLAGS))\ $(filter -Wl%,$(JSAPI_LDFLAGS)) JSAPI_LDFLAGS := $(filter-out $(MOZJS_INSTALL_NAME_OPT),$(JSAPI_LDFLAGS)) endif JSAPI_LDFLAGS := $(filter-out %libffi.a,$(JSAPI_LDFLAGS)) LDFLAGS += $(JSAPI_LDFLAGS) Future Direction The SpiderMonkey 1.8.5 source release includes an experimental library versioning scheme. This versioning scheme will not be rolled back into the upstream Mozilla source tree(s), and may not be used in future source releases. Comments in bug 628723 with regard to its usefulness are appreciated. Bugs with the source release tar ball should be copied to wes@page.ca. SpiderMonkey embedders should also be aware that Mozilla has no plans to keep the JSAPI, nor the JSDBGAPI stable for em...
SpiderMonkey 1.8.8
o many methods The JS_GetClass method now takes only a JSObject*, where previously it also required a JSContext* in threadsafe builds. (The JS_GET_CLASS macro abstracting away this difference has accordingly been removed.) JavaScript shell changes Detail added/removed methods here... Known Issues Detail any known issues here... Future Direction INCLUDE-FOLLOWUP-ON-EXPERIMENTAL-LIBRARY-VERSIONING-SCHEME-HERE SpiderMonkey embedders should also be aware that Mozilla has no plans to keep the JSAPI, nor the JSDBGAPI stable for embedders. We have chosen to concentrate on performance and correctness as primary concerns instead. The team is considering the removal of TinyIDs JS_THREADSAFE is going away, with future versions supporting only thread-safe builds A new debugging API is on the way to re...
SpiderMonkey 17
d.) Garbage Collection functions now take runtime argument Most garbage collection functions now take a runtime argument instead of a context. The one exception to this is JS_MaybeGC which still takes a context as argument. JavaScript shell changes Detail added/removed methods here... Known Issues Detail any known issues here... Future Direction INCLUDE-FOLLOWUP-ON-EXPERIMENTAL-LIBRARY-VERSIONING-SCHEME-HERE SpiderMonkey embedders should also be aware that Mozilla has no plans to keep the JSAPI, nor the JSDBGAPI stable for embedders. We have chosen to concentrate on performance and correctness as primary concerns instead. The team is considering the removal of TinyIDs JS_THREADSAFE is going away, with future versions supporting only thread-safe builds A new debugging API is on the way to re...
Handling Mozilla Security Bugs
ity fixes. We understand and acknowledge the concerns of those who believe that too-hasty disclosure of exploit details can provide a short-term advantage to potential attackers, who can exploit a problem before most end users become aware of its existence. We believe that both sets of concerns are valid, and that both are worth addressing as best we can. We have attempted to create a compromise scheme for how the Mozilla project will handle reports of security vulnerabilities. We believe that it is a compromise that can be justified to those on both sides of the question regarding disclosure. General Policies mozilla.org has adopted the following general policies for handling bug reports related to security vulnerabilities: Security bug reports can be treated as special and handled differ...
Embedded Dialog API
cko to display XUL dialogs. Advanced Windowing API Embedding applications concerned with ensuring that dialogs posed by Gecko are consistent in appearance and behaviour with dialogs posed directly by the application itself face a choice. It is probably easier to write CSS rules (a skin) to give Gecko's XUL dialogs the same appearance as the application's own. Skins are very rich and capable; this scheme can probably be made to work for nearly all applications. Many embeddors however choose to implement their own dialogs, and this is of course the only way to gain complete control and consistency. An embedding application may implement its own version of all dialogs in Gecko. (Note that at time of writing this may not be strictly true; work continues on this topic.) All overrideable dialogs are i...
History Service Design
enus, allowing for good performances even in presence of a really large history. Storing pages and visits Pages (intended as URIs) are stored into a table shared by both History and Bookmarks, every url is unique in this table and is associated with a place id, commonly used as the foreign key on other tables. This table has common attributes for a page like typed, hidden and frecency. Certain scheme are excluded from history, so they will never be added, for example: about, view-source, chrome. If a page can be added we first check if it exists already, then it is added or updated accordingly to the previous check, and common attributes are set based on concurrent visit properties. Typed means the page as a typed visit, hidden means the page should not be shown in autocomplete, while frecenc...
Packaging WebLock
he necessary installation scripts for doing a web-based installation. As WebLock Installation Script demonstrates, XPInstall uses special keywords to refer to common installation directories such as components in a generalized, cross-platform way. If you are installing WebLock in an Gecko-based application for which XPInstall is not available, then you will have to devise a separate installation scheme. We leave this as an exercise for the reader. Note: install-object-methods The methods are available on the main Install object, which is implied in the script below in the same way that the window object is implied in JavaScript manipulation of the DOM of a web page. In other words, the fragment initInstall() from the script is equivalent to Install.initInstall(). << PreviousNext >> ...
mozIColorAnalyzer
onger to process, especially those with a larger number of unique colors. If imageURI points to an image that has more than 128^2 pixels, this method will fail for performance reasons before analyzing it. void findRepresentativeColor( in nsIURI imageURI, in mozIRepresentativeColorCallback callback ); Parameters imageURI A URI pointing to the image - ideally a data: URI, but any scheme that will load when setting the src attribute of a DOM img element should work. callback Function to call when the representative color is found or an error occurs. Remarks Below are some images with the result of findRepresentativeColor: Image Representative color 0xB28D3A 0x502E1E ...
nsIAuthInformation
sernameAndPassword() or nsIAuthPrompt2.promptPasswordAsync() provides an object implementing this interface; the prompt implementation can then read the values here to prefill the dialog. After the user entered the authentication information, it should set the attributes of this object to indicate to the caller what was entered by the user. Attributes Attribute Type Description authenticationScheme AUTF8String The authentication scheme used for this request, if applicable. If the protocol for this authentication does not support schemes, this will be the empty string. Otherwise, this will be a string such as "basic" or "digest". This string will always be in lowercase. Read only. domain AString The initial value should be used to prefill the dialog or be shown in some other way to the use...
nsIFileURL
Inherits from: nsISupports Last changed in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3) Attributes Attribute Type Description file nsIFile Get/Set nsIFile corresponding to this URL. The getter returns a reference to an immutable object. Callers must clone before attempting to modify the returned nsIFile object. ...
nsIGlobalHistory2
7 This interface replaces and deprecates nsIGlobalHistory Method overview void addURI(in nsIURI aURI, in boolean aRedirect, in boolean aToplevel, in nsIURI aReferrer); boolean isVisited(in nsIURI aURI); void setPageTitle(in nsIURI aURI, in AString aTitle); Methods addURI() Add a URI to global history. Note: Docshell will not filter out URI schemes like chrome:, data:, about: and view-source:. Embedders should consider filtering out these schemes and others, for example mailbox:, for the main nsIURI and the referrer. void addURI( in nsIURI aURI, in boolean aRedirect, in boolean aToplevel, in nsIURI aReferrer ); Parameters aURI The nsIURI of the page being added. aRedirect Whether the URI was redirecte...
nsIMsgAccountManagerExtension
used to add a new panel to Thunderbird's Account Manager. An Account Manager Extension is a XPCOM compontent implementing this Interface. The interface is basically a manifest and defines the properties of the new Panel. A Panel consists of a XUL file with a Page Element as root element and the Property File containing the localized name. Note: The Account Manager relies on a very strong naming scheme to load and unload a panel. An Account Manager Extension with a "name" attribute of "devmo" and the "chromePackageName" attribute set to "extension@example.org" means, that the Account Manager expects to find a XUL file in "chrome://extension@example.org/content/am-devmo.xul" and a property file in "chrome://extension@example.org/locale/am-devmo.properties" containing a property named "prefPanel-...
nsIProfileLock
directory nsILocalFile The main profile directory. Read only. localDirectory nsILocalFile A directory corresponding to the main profile directory, which exists for the purpose of storing data on the local filesystem, including cache files or other data files that may not represent critical user data. (for example, this directory may not be included as part of a backup scheme.) In some cases, this directory may just be the main profile directory. Read only. Methods unlock() Unlocks the profile. void unlock(); Parameters None. Exceptions thrown NS_ERROR_UNEXPECTED The profile isn't locked. See also Profile management nsIToolkitProfileService nsIToolkitProfile nsIProfileUnlocker ...
nsISupportsWeakReference
Inherits from: nsISupports Last changed in Gecko 1.7 Method overview nsIWeakReference GetWeakReference(); Methods GetWeakReference() Produces an appropriate instance of nsIWeakReference. nsIWeakReference GetWeakReference(); Parameters None. Return value The resulting nsIWeakReference instance. ...
nsIWebContentHandlerRegistrar
String uri, in DOMString title, in nsIDOMWindow contentWindow ); Parameters protocol The protocol the site wishes to handle, specified as a string. uri The URI to the handler as a string. You must include "%s" to indicate where to insert the escaped URI of the document to be handled. Otherwise NS_ERROR_DOM_SYNTAX_ERR will be thrown. This string must also be of either the http or https schemes. title The title of the handler presented to the user as a string. contentWindow The DOM content window from which the method has been called. Note: Script must execute from same domain as uri or else it will throw permission error. Can bypass this by opening about:config and setting preference of gecko.handlerService.allowRegisterFromDifferentHost to true. Examples Register a webmail ...
Frequently Asked Questions
ails] You should note, though, that there is a small performance penalty for this. The nsCOMPtr will still exercize logic in its destructor to attempt to Release the value it has at that time. The optimal solution is to arrange the lifetime of your nsCOMPtr to correspond to exactly how long you want to hold the reference. E.g., using blocks as in this sample // The most efficient scheme is to scope your |nsCOMPtr| to live exactly as long // as you need to hold the reference nsresult SomeLongFunction( nsIBar* aBar ) { nsresult rv; // ... { // I only need the |nsIFoo| interface for a short time // so I control its lifetime by declaring it inside // a block statement. nsCOMPtr<nsIFoo> foo( do_QueryInterface(aBar, &rv) ); if ( foo ) ...
Getting Started Guide
59414). This is an acceptable way to declare `in/out' parameters, but prefer passing nsCOMPtrs by reference, as below. // Passing an |nsCOMPtr| by pointer requires extra work... void f( nsCOMPtr<nsIFoo>* ); // ... nsCOMPtr<nsIFoo> myFoo = ...; f( address_of(myFoo) ); void f( nsCOMPtr<T>& ) do pass an nsCOMPtr by reference for `in/out' parameters This is the prefered scheme for providing `in/out' parameters. If you were to use a raw pointer instead, your function couldn't know what ownership relationship the caller had to the input value, and hence, couldn't know whether to Release it or not before assigning in the new value. By declaring the parameter as an nsCOMPtr&, the relationship is explicit. Summary An nsCOMPtr is an owning reference. Whatever it points to ...
Reference Manual
/ Safe iterating with |nsCOMPtr|... nsCOMPtr<nsIDOMNode> p = ...; while ( p ) { // ... // Introduce a temporary so we // don't stomp on |p| nsCOMPtr<nsIDOMNode> temp = p; temp->GetNext(getter_AddRefs(p)); } Although the nsCOMPtr parallel is easy to understand, it suffers from doing one extra AddRef and one extra Release compared to the raw pointer scheme. A slight transformation makes the code uglier, but (possibly negligibly) more efficient. // Safe, efficient, iterating with |nsCOMPtr|... nsCOMPtr<nsIDOMNode> p = ...; while ( p ) { // ... nsIDOMNode* next; p->GetNext(&next); p = dont_AddRef(next); } // Look! It's our friend, the `raw pointer, call getter, assign // |dont_AddRef|' pattern. ...
Weak reference
y the same interface as an nsCOMPtr. In fact, nsWeakPtr is defined like this typedef nsCOMPtr<nsIWeakReference> nsWeakPtr; Well this sucks! By now you've probably noticed that this particular weak reference implementation doesn't give you exactly the interface you were hoping for. Why can't I just directly call my interfaces methods on the weak reference? You really want this weak reference scheme to give you a pointer that implements the interface you actually care about, e.g., // Note: _not_ the implementation we have... nsWeakPtr<nsIFoo> weakFooPtr = fooPtr; // ... if ( weakFooPtr ) status = weakFooPtr->SomeFooMethod(...); This is a reasonable thing to want. It's expensive to implement automatically, however. Neither inheritance, nor templates, nor macros can help automatically for...
XPCOM ownership guidelines
s can be individually released. You don't need to own it if it's lifetime is guaranteed to be longer than yours. As for instance, when it owns you. Parents own their children (and not the reverse). Though parents may not need to own their children. For instance, a tree may own all the nodes that are in it. All the nodes in the tree point to each other with non-owning pointers. In the simplest scheme, however, parents point to their children with owning-pointers, children point back to their parents with non-owning-pointers. Containers own the things they contain (and not the reverse). Use nsCOMPtrs to implement owning-pointers. It's explicit, efficient, and fairly bullet-proof. It's easier to write `getter's and `setter's; and you don't need to put anything in your destructor. Original ...
XPCOM tasks
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. P1 Various threading issues, e.g., Too many locks. See bug 13009. Not enough locks. See bug 5795, bug 12755, and bug 12755. P1 We would like to move to a scheme where no one writes QueryInterface, and we save code-space with a table driven implementation. A first step is moving all QI implementations to the table-like macros already in place (and some slight modifications to those macros). See bug 23737 Work is progressing on this. See in particular, the new NS_INTERFACE_MAP_... macros in "nsISupportsUtils.h". P1 We need to use NS_GET_IID instead of N...
Xptcall Porting Guide
entation for Win32 and Linux x86, NetBSD x86, and FreeBSD. Both of these examples use inline assembly language. That is just how I decided to do it. You can do it as you choose. The Win32 version is somewhat tighter because the __declspec(naked) feature allows for very small stubs. However, the __stdcall requires the callee to clean up the stack, so it is imperative that the interface information scheme allow the code to determine the correct stack pointer fixup for return without fail, else the process will crash. I opted to use inline assembler for the gcc Linux x86 port. I ended up with larger stubs than I would have preferred rather than battle the compiler over what would happen to the stack before my asm code began running. I believe that the non-assembly parts of these files can be copied...
Xptcall Porting Status
d NetBSD x86 Christoph Toshok <toshok@hungry.com>, John Bandhauer <jband@netscape.com> unix (same as Linux 86 code) <font color="white">Done</font> BSD/OS x86 Bert Driehuis <bert_driehuis@nl.compuware.com> unix (same as Linux 86 code) Bert contributed patches that *should* do the right thing for all the unixish-x86 versions of this code for GCC 2.7 or 2.8 vs. EGCS 1.1. He notes that the vtbl scheme is different. He is hoping that others will help test the changes using these two compilers on the various platforms where this same code is used. Bert's details <font color="white">Done</font> Mac PPC Roger Lawrence <rogerl@netscape.com>, Patrick Beard <beard@netscape.com> mac (passing tests and checked in) <font color="white">Done</font> Solaris Sparc Roger Lawrence <rogerl@netscape.com>...
Buddy icons in mail
on disk at: <profile home>/NIM/<value of pref aim.session.screenname>/picture/<screenname for card>.gif If aim.session.screenname is not set, the icon will not appear. If there is no card matching the email, the icon will not appear. If there is a card, but no screenname, the icon will not appear. And finally, if there is no icon, the icon will not appear. The reason this file name scheme was chosen was is this is how Netscape 7.0 IM stores buddy icons on disk. So if you use NIM, and you use buddy icons, this will just work for free. Notes: You do not have to be online to use this feature. We do not show any buddy icon if you are in "collapsed" header mode. ...
Index
on disk at: <profile home>/NIM/<value of pref aim.session.screenname>/picture/<screenname for card>.gif If aim.session.screenname is not set, the icon will not appear. If there is no card matching the email, the icon will not appear. If there is a card, but no screenname, the icon will not appear. And finally, if there is no icon, the icon will not appear. The reason this file name scheme was chosen was is this is how Netscape 7.0 IM stores buddy icons on disk. So if you use NIM, and you use buddy icons, this will just work for free. Notes: 16 Cached compose window FAQ Seth Spitzer (sspitzer@mozilla.org) What is the "cached" compose window? Instead of destroying the mail compose window on send (or close) just to create a new one the next time, Mozilla ...
ABI
http://en.wikipedia.org/wiki/X86_calling_conventions ABI ABI stands for "Application Binary Interface". ...
Plugins
e roadmap for Adobe Flash and other plugin support in Firefox. Roadmap Highlights Since Firefox 52, plugins other than Flash are not loaded by Firefox. Starting in Firefox 55, users will be asked to choose which sites may use Flash content. This feature will be rolled out gradually to Firefox users. Also From Firefox 55 onwards, Flash and other plugins can no longer be loaded from any URL scheme except for http:// and https:// (bug 1335475). See also Flash can now be loaded only from HTTP/HTTPS for more useful information. Starting with Firefox 56 in September 2017, Firefox for Android will remove all support for plugins (bug 1381916). Tutorials and references The articles below are developer information about the developing for click-to-play, and plugin blocking. Flash Activat...
Eyedropper - Firefox Developer Tools
The Eyedropper is new in Firefox 31. The Eyedropper tool enables you to select colors in the current page. It works like a magnifying glass over the page, enabling you to select with pixel precision. ...
Index - Firefox Developer Tools
s implemented in the dark theme and light theme for developer tools. 31 Eyedropper Firefox, Tools, Web Development:Tools The Eyedropper tool enables you to select colors in the current page. It works like a magnifying glass over the page, enabling you to select with pixel precision. Underneath the magnifying glass it shows the color value for the current pixel using whichever scheme you've selected in Settings > Inspector > Default color unit: 34 Index Tools Found 158 pages: 35 JSON viewer Firefox includes a JSON viewer. If you open a JSON file in the browser, or view a remote URL with the Content-Type set to application/json, it is parsed and given syntax highlighting. Arrays and objects are shown collapsed, and you can expand them...
Network request details - Firefox Developer Tools
equest. The Resend button opens a menu with two items: Resend: Simply resends the request. Edit and Resend: Enables an editing mode, where you can modify the method, URL, request headers, or request body of the request. Click Send to send the modified request, or Cancel to cancel editing. Request Information The following information is shown only when the section is expanded: Scheme: The scheme used in the URL Host: The server involved in the request Filename: The full path to the file requested Address: The IP address of the host The following information is shown in both the collapsed and the expanded states: Status: The HTTP response code for the request. Version: The HTTP version used Transferred: The amount of data transferred with the request The Referrer Po...
UI Tour - Firefox Developer Tools
ding, click its entry in the pane. To save the recording as a JSON file click "Save". Recording overview This displays an overview of the entire recording, with the x-axis representing time. It contains two elements: an overview of the Waterfall and a frame rate graph. Waterfall overview This presents a compressed view of the Waterfall: Recorded operations are color-coded using the same scheme as in the main Waterfall view. Frame rate graph The frame rate gives you an overview of the browser's responsiveness during the recording: See the separate article on frame rate. Correlating events Because these elements are synchronized, you can correlate events in one element with events in another. For example, in the screenshot below a long-running paint operation (shown as a green ba...
Cache.add() - Web APIs
Web › API › Cache › add
previously stored in the cache that matches the request. Syntax cache.add(request).then(function() { // request has been added to the cache }); Parameters request The request you want to add to the cache. This can be a Request object or a URL. Return value A Promise that resolves with undefined. Exceptions Exception Happens when TypeError The URL scheme is not http or https. The Response status is not in the 200 range (i.e., not a successful response.) This occurs if the request does not return successfully, but also if the request is a cross-origin no-cors request (in which case the reported status is always 0.) Examples This code block waits for an InstallEvent to fire, then calls waitUntil() to handle the install process for ...
Cache.addAll() - Web APIs
Web › API › Cache › addAll
Syntax cache.addAll(requests[]).then(function() { // requests have been added to the cache }); Parameters requests An array of string URLs that you want to be fetched and added to the cache. You can specify the Request object instead of the URL. Return value A Promise that resolves with undefined. Exceptions Exception Happens when TypeError The URL scheme is not http or https. The Response status is not in the 200 range (i.e., not a successful response.) This occurs if the request does not return successfully, but also if the request is a cross-origin no-cors request (in which case the reported status is always 0.) Examples This code block waits for an InstallEvent to fire, then runs waitUntil() to handle the install process for t...
Cache.put() - Web APIs
Web › API › Cache › put
ereas Cache.put can. Syntax cache.put(request, response).then(function() { // request/response pair has been added to the cache }); Parameters request The Request object or URL that you want to add to the cache. response The Response you want to match up to the request. Return value A Promise that resolves with undefined. Note: The promise will reject with a TypeError if the URL scheme is not http or https. Examples This example is from the MDN sw-test example (see sw-test running live). Here we wait for a FetchEvent to fire. We construct a custom response like so: Check whether a match for the request is found in the CacheStorage using CacheStorage.match(). If so, serve that. If not, open the v1 cache using open(), put the default network request in the cache using Cach...
Document.documentURIObject - Web APIs
e. For web content this property doesn't have any special meaning and can be used just like any other custom property. Privileged code must be careful not to try getting or setting this property on a non-wrapped content object (e.g., on a wrappedJSObject of an XPCNativeWrapper). See bug 324464's comments for details. Syntax var uri = document.documentURIObject; Example // Check that the URI scheme of the current tab in Firefox is 'http', // assuming this code runs in context of browser.xul let uriObj = content.document.documentURIObject; let uriPort = uriObj.port; if (uriObj.schemeIs('http')) { ... } Specifications Not part of any specification. ...
Encrypted Media Extensions API - Web APIs
Interfaces MediaKeyMessageEvent Contains the content and related data when the content decryption module (CDM) generates a message for the session. MediaKeys Represents a set of keys that an associated HTMLMediaElement can use for decryption of media data during playback. MediaKeySession Represents a context for message exchange with a content decryption module (CDM). MediaKeyStatusMap Is a read-only map of media key statuses by key IDs. ...
File.type - Web APIs
Web › API › File › type
ould give "text/plain" and not "image/png". Moreover, file.type is generally reliable only for common file types like images, HTML documents, audio and video. Uncommon file extensions would return an empty string. Client configuration (for instance, the Windows Registry) may result in unexpected values even for common types. Developers are advised not to rely on this property as a sole validation scheme. Specifications Specification Status Comment File APIThe definition of 'type' in that specification. Working Draft Initial definition. ...
FileSystemEntry.toURL() - Web APIs
Syntax FileSystemEntry.toURL([mimeType]); Parameters mimeType Optional An optional string specifying the MIME type to use when interpreting the file. This can be used to help deal with files whose types aren't recognized automatically by the user agent. If this parameter is omitted, the user agent uses its standard algorithms to identify the file. ...
File and Directory Entries API support in Firefox - Web APIs
...
HTMLAnchorElement.referrerPolicy - Web APIs
.referrerPolicy property reflect the HTML referrerpolicy attribute of the <a> element defining which referrer is sent when fetching the resource. Syntax refStr = anchorElt.referrerPolicy; anchorElt.referrerPolicy = refStr; Values "no-referrer" meaning that the Referer: HTTP header will not be sent. "origin" meaning that the referrer will be the origin of the page, that is roughly the scheme, the host and the port. "unsafe-url" meaning that the referrer will include the origin and the path (but not the fragment, password, or username). This case is unsafe as it can leak path information that has been concealed to third-party by using TLS. Examples var elt = document.createElement("a"); var linkText = document.createTextNode("My link"); elt.appendChild(linkText); elt.href = "...
HTMLAnchorElement - Web APIs
ting the language of the linked resource. HTMLAnchorElement.media Is a DOMString that reflects the media HTML attribute, indicating the intended media for the linked resource. HTMLHyperlinkElementUtils.password Is a USVString containing the password specified before the domain name. HTMLHyperlinkElementUtils.origin Read only Returns a USVString containing the origin of the URL, that is its scheme, its domain and its port. HTMLHyperlinkElementUtils.pathname Is a USVString representing the path name component, if any, of the referenced URL. HTMLHyperlinkElementUtils.port Is a USVString representing the port component, if any, of the referenced URL. HTMLHyperlinkElementUtils.protocol Is a USVString representing the protocol component, including trailing colon (':'), of the referenced U...
HTMLAreaElement.referrerPolicy - Web APIs
t.referrerPolicy property reflect the HTML referrerpolicy attribute of the <area> element defining which referrer is sent when fetching the resource. Syntax refStr = areaElt.referrerPolicy; areaElt.referrerPolicy = refStr; Values "no-referrer" meaning that the Referer: HTTP header will not be sent. "origin" meaning that the referrer will be the origin of the page, that is roughly the scheme, the host and the port. "unsafe-url" meaning that the referrer will include the origin and the path (but not the fragment, password, or username). This case is unsafe as it can leak path information that has been concealed to third-party by using TLS. Examples <img usemap="#mapAround" width="100" height="100" src="/img/logo@2x.png" /> <map id="myMap" name="mapAround" />> var elt = docum...
HTMLAreaElement - Web APIs
e media HTML attribute, indicating target media of the linked resource. HTMLAreaElement.noHref Is a Boolean flag indicating if the area is inactive (true) or active (false). HTMLHyperlinkElementUtils.password Is a USVString containing the password specified before the domain name. HTMLHyperlinkElementUtils.origin Read only Returns a USVString containing the origin of the URL, that is its scheme, its domain and its port. HTMLHyperlinkElementUtils.pathname Is a USVString containing the path name component, if any, of the referenced URL. HTMLHyperlinkElementUtils.port Is a USVString containing the port component, if any, of the referenced URL. HTMLHyperlinkElementUtils.protocol Is a USVString containing the protocol component (including trailing colon ':'), of the referenced URL. HT...
HTMLHyperlinkElementUtils.host - Web APIs
Living Standard Initial definition ...
HTMLHyperlinkElementUtils.protocol - Web APIs
The HTMLHyperlinkElementUtils.protocol property is a USVString representing the protocol scheme of the URL, including the final ':'. Syntax string = object.protocol; object.protocol = string; Examples // Let's an <a id="myAnchor" href="https://developer.mozilla.org/HTMLHyperlinkElementUtils.protocol"> element be in the document var anchor = document.getElementById("myAnchor"); var result = anchor.protocol; // Returns:'https:' Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLHyperlinkElementUtils.protocol' in that specification. Living Standard Initial definition. ...
HTMLImageElement.referrerPolicy - Web APIs
te of the <img> element defining which referrer is sent when fetching the resource. Syntax refStr = imgElt.referrerPolicy; imgElt.referrerPolicy = refStr; Values A DOMString representing the referrer policy. Possible values are: "no-referrer" meaning that the Referer: HTTP header will not be sent. "origin" meaning that the referrer will be the origin of the page, that is roughly the scheme, the host and the port. "unsafe-url" meaning that the referrer will include the origin and the path (but not the fragment, password, or username). This case is unsafe as it can leak path information that has been concealed to third-party by using TLS. Examples var img = new Image(); img.src = 'img/logo.png'; img.referrerPolicy = 'origin'; var div = document.getElementById('divAround'); ...
compareVersion - Web APIs
In particular plugin developers should see how to package a plugin as an extension. compareVersion Compares the version of a file or package with the version of an existing file or package. ...
getVersion - Web APIs
In particular plugin developers should see how to package a plugin as an extension. getVersion Returns an object representing the version number from the Client Version Registry for the specified component. ...
Location: host - Web APIs
Web › API › Location › host
y, a ':', and the port of the URL. Syntax string = object.host; object.host = string; Examples var anchor = document.createElement("a"); anchor.href = "https://developer.mozilla.org/Location.host" anchor.host == "developer.mozilla.org" anchor.href = "https://developer.mozilla.org:443/Location.host" anchor.host == "developer.mozilla.org" // The port number is not included because 443 is the scheme's default port anchor.href = "https://developer.mozilla.org:4097/Location.host" anchor.host == "developer.mozilla.org:4097" Specifications Specification Status Comment HTML Living StandardThe definition of 'host' in that specification. Living Standard Initial definition ...
Location: protocol - Web APIs
Web › API › Location › protocol
The protocol property of the Location interface is a USVString representing the protocol scheme of the URL, including the final ':'. Syntax string = object.protocol; object.protocol = string; Examples // Let's an <a id="myAnchor" href="https://developer.mozilla.org/Location.protocol"> element be in the document var anchor = document.getElementById("myAnchor"); var result = anchor.protocol; // Returns:'https:' Specifications Specification Status Comment HTML Living StandardThe definition of 'protocol' in that specification. Living Standard Initial definition. ...
Location - Web APIs
Web › API › Location
, in reverse order, the origins of all ancestor browsing contexts of the document associated with the given Location object. Location.href Is a stringifier that returns a USVString containing the entire URL. If changed, the associated document navigates to the new page. It can be set from a different origin than the associated document. Location.protocol Is a USVString containing the protocol scheme of the URL, including the final ':'. Location.host Is a USVString containing the host, that is the hostname, a ':', and the port of the URL. Location.hostname Is a USVString containing the domain of the URL. Location.port Is a USVString containing the port number of the URL. Location.pathname Is a USVString containing an initial '/' followed by the path of the URL. Location.search Is a ...
MediaDevices.getUserMedia() - Web APIs
privacy concerns, getUserMedia()'s specification lays out a wide array of privacy and security requirements that browsers are obligated to meet. getUserMedia() is a powerful feature which can only be used in secure contexts; in insecure contexts, navigator.mediaDevices is undefined, preventing access to getUserMedia(). A secure context is, in short, a page loaded using HTTPS or the file:/// URL scheme, or a page loaded from localhost. In addition, user permission is always required to access the user's audio and video inputs. Only a window's top-level document context for a valid origin can even request permission to use getUserMedia(), unless the top-level context expressly grants permission for a given <iframe> to do so using Feature Policy. Otherwise, the user will never even be asked for ...
PushManager.subscribe() - Web APIs
Only: A boolean indicating that the returned push subscription will only be used for messages whose effect is made visible to the user. applicationServerKey: A Base64-encoded DOMString or ArrayBuffer containing an ECDSA P-256 public key that the push server will use to authenticate your application server. If specified, all messages from your application server must use the VAPID authentication scheme, and include a JWT signed with the corresponding private key. This key IS NOT the same ECDH key that you use to encrypt the data. For more information, see "Using VAPID with WebPush". Note: This parameter is required in some browsers like Chrome and Edge. Returns A Promise that resolves to a PushSubscription object. Example this.onpush = function(event) { console.log(event.data);...
Push API - Web APIs
Web › API › Push API
ique capability URL: knowledge of the endpoint is all that is necessary to send a message to your application. The endpoint URL therefore needs to be kept secret, or other applications might be able to send push messages to your application. Activating a service worker to deliver a push message can result in increased resource usage, particularly of the battery. Different browsers have different schemes for handling this, there is currently no standard mechanism. Firefox allows a limited number (quota) of push messages to be sent to an application, although Push messages that generate notifications are exempt from this limit. The limit is refreshed each time the site is visited. In comparison, Chrome applies no limit, but requires that every push message causes a notification to be displayed. ...
RTCIceServers.urls - Web APIs
Web › API › RTCIceServer › urls
n = new RTCPeerConnection({ iceServers: [ { urls: "turn:turnserver.example.org", username: "webrtc", credential: "turnpassword" } ] }); A single ICE server with multiple URLs The next example creates a new RTCPeerConnection which will use a single TURN server which has multiple URLs. This is useful if the server is, for example, available both on "turn" and "turns" schemes, or if there's a fallback address available for the server. Keep in mind that ICE will try all the URLs you list here, so the more you include, the longer connections will take to establish. myPeerConnection = new RTCPeerConnection({ iceServers: [ { urls: ["turns:turnserver.example.org", "turn:turnserver.example.org"], username: "webrtc", credential: "turnpassword" ...
URL.host - Web APIs
Web › API › URL › host
This feature is available in Web Workers. Syntax const host = url.host url.host = newHost Value A USVString. Examples let url = new URL('/docs/Web/API/URL/host'); console.log(url.host); // "developer.mozilla.org" url = new URL('https://developer.mozilla.org:443/docs/Web/API/URL/host'); console.log(url.host); // "developer.mozilla.org" // The port number is not included because 443 is the scheme's default port url = new URL('https://developer.mozilla.org:4097/docs/Web/API/URL/host'); console.log(url.host); // "developer.mozilla.org:4097" Specifications Specification Status Comment URLThe definition of 'URL.host' in that specification. Living Standard Initial definition ...
URL.origin - Web APIs
Web › API › URL › origin
For file: URLs, the value is browser dependant. ...
URL.protocol - Web APIs
Web › API › URL › protocol
Note: This feature is available in Web Workers. Syntax const protocol = url.protocol url.protocol = newProtocol Value A USVString. ...
URLUtilsReadOnly.protocol - Web APIs
Syntax string = object.protocol; Examples // In a Web worker, on the page https://developer.mozilla.org/URLUtilsReadOnly.href var result = window.self.protocol; // Returns:'https:' Specifications Specification Status Comment URLThe definition of 'URLUtilsReadOnly.protocol' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. ...
URLUtilsReadOnly - Web APIs
by other interfaces, such as WorkerLocation. URLUtilsReadOnly has been removed from the specification, and the properties it defined are now directly part of the affected interfaces. Properties This interface doesn't inherit any properties. URLUtilsReadOnly.href Read only Is a DOMString containing the whole URL. URLUtilsReadOnly.protocol Read only Is a DOMString containing the protocol scheme of the URL, including the final ':'. URLUtilsReadOnly.host Read only Is a DOMString containing the host, that is the hostname, a ':', and the port of the URL. URLUtilsReadOnly.hostname Read only Is a DOMString containing the domain of the URL. URLUtilsReadOnly.origin Read only Returns a DOMString containing the canonical form of the origin of the specific location. URLUtilsReadOnly.port...
USBDevice.deviceVersionMajor - Web APIs
Syntax var serialNumber = USBDevice.deviceVersionMajor Value A number. ...
USBDevice.deviceVersionMinor - Web APIs
Syntax var serialNumber = USBDevice.deviceVersionMinor Value A number. ...
USBDevice.deviceVersionSubminor - Web APIs
Syntax var serialNumber = USBDevice.deviceVersionSubminor Value A number. ...
USBDevice - Web APIs
Web › API › USBDevice
USBDevice.deviceClass and USBDevice.deviceSubclass. USBDevice.deviceSubclass Read only One of three properties that identify USB devices for the purpose of loading a USB driver that will work with that device. The other two properties are USBDevice.deviceClass and USBDevice.deviceProtocol. USBDevice.deviceVersionMajor Read only The major version number of the device in a semantic versioning scheme. USBDevice.deviceVersionMinor Read only The minor version number of the device in a semantic versioning scheme. USBDevice.deviceVersionSubminor Read only The patch version number of the device in a semantic versioning scheme. USBDevice.manufacturerName Read only The of the organization that manufactured the USB device. USBDevice.opened Read only Indicates whether a session has been st...
WebRTC API - Web APIs
equirements RTCWeb Data Channels RTCWeb Data Channel Protocol Web Real-Time Communication (WebRTC): Media Transport and Use of RTP WebRTC Security Architecture Transports for RTCWEB Related supporting protocols Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocol Session Traversal Utilities for NAT (STUN) URI Scheme for the Session Traversal Utilities for NAT (STUN) Protocol Traversal Using Relays around NAT (TURN) Uniform Resource Identifiers An Offer/Answer Model with Session Description Protocol (SDP) Session Traversal Utilities for NAT (STUN) Extension for Third Party Authorization WebRTC statistics WebRTC Statistics API Specifications Specification Status Comment W...
Writing WebSocket client applications - Web APIs
communicate using the WebSocket protocol, you need to create a WebSocket object; this will automatically attempt to open the connection to the server. The WebSocket constructor accepts one required and one optional parameter: webSocket = new WebSocket(url, protocols); url The URL to which to connect; this should be the URL to which the WebSocket server will respond. This should use the URL scheme wss://, although some software may allow you to use the insecure ws:// for local connections. protocols Optional Either a single protocol string or an array of protocol strings. These strings are used to indicate sub-protocols, so that a single server can implement multiple WebSocket sub-protocols (for example, you might want one server to be able to handle different types of interactions depen...
Using Web Workers - Web APIs
ng eval(). However, if the script constructs a worker, code running in the worker's context will be allowed to use eval(). To specify a content security policy for the worker, set a Content-Security-Policy response header for the request which delivered the worker script itself. The exception to this is if the worker script's origin is a globally unique identifier (for example, if its URL has a scheme of data or blob). In this case, the worker does inherit the CSP of the document or worker that created it. Transferring data to and from workers: further details Data passed between the main page and workers is copied, not shared. Objects are serialized as they're handed to the worker, and subsequently, de-serialized on the other end. The page and worker do not share the same instance, so the...
Window.localStorage - Web APIs
and the values are always in the UTF-16 DOMString format, which uses two bytes per character. As with objects, integer keys are automatically converted to strings. Syntax myStorage = window.localStorage; Value A Storage object which can be used to access the current origin's local storage space. Exceptions SecurityError The request violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example). For example, the user may have their browser configured to deny permission to persist data for the specified origin. Example The following snippet accesses the current domain's local Storage object and adds a data item to it using Storage.setItem(). localStorage.setItem('myCat', 'Tom'); The syntax fo...
Window.open() - Web APIs
Web › API › Window › open
ick on links, tab-browsing features in extensions, etc. "javascript:" links will interfere with the process of indexing webpages by search engines. "javascript:" links interfere with assistive technologies (e.g. voice browsers) and several web-aware applications (e.g. PDAs and mobile browsers). "javascript:" links also interfere with "mouse gestures" features implemented in browsers. Protocol scheme "javascript:" will be reported as an error by link validators and link checkers. Further reading: Top Ten Web-Design Mistakes of 2002, 6. JavaScript in Links, Jakob Nielsen, December 2002 Links & JavaScript Living Together in Harmony, Jeff Howden, February 2002 comp.lang.javascript newsgroup discussion FAQ on "javascript:" links Never use <a href="#" onclick="window.open(...);"> Such ps...
Window.openDialog() - Web APIs
Web › API › Window › openDialog
s extra parameters into the dialog, you can simply supply them after the windowFeatures parameter: openDialog("http://example.tld/zzz.xul", "dlg", "", "pizza", 6.98); The extra parameters will then get packed into a property named arguments of type Array, and this property gets added to the newly opened dialog window. To access these extra parameters from within dialog code, use the following scheme: var food = window.arguments[0]; var price = window.arguments[1]; Note that you can access this property from within anywhere in the dialog code. (Another example). Returning values from the dialog Since window.close() erases all properties associated with the dialog window (i.e. the variables specified in the JavaScript code which gets loaded from the dialog), it is not possible to pass re...
window.postMessage() - Web APIs
ng the structured clone algorithm. This means you can pass a broad variety of data objects safely to the destination window without having to serialize them yourself. [1] targetOrigin Specifies what the origin of targetWindow must be for the event to be dispatched, either as the literal string "*" (indicating no preference) or as a URI. If at the time the event is scheduled to be dispatched the scheme, hostname, or port of targetWindow's document does not match that provided in targetOrigin, the event will not be dispatched; only if all three match will the event be dispatched. This mechanism provides control over where messages are sent; for example, if postMessage() was used to transmit a password, it would be absolutely critical that this argument be a URI whose origin is the same as the in...
Window.sessionStorage - Web APIs
he values are always in the UTF-16 DOMString format, which uses two bytes per character. As with objects, integer keys are automatically converted to strings. Syntax myStorage = window.sessionStorage; Value A Storage object which can be used to access the current origin's session storage space. Exceptions SecurityError The request violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example). For example, the user may have their browser configured to deny permission to persist data for the specified origin. Example The following snippet accesses the current origin's session Storage object and adds data to it with Storage.setItem(). sessionStorage.setItem('myCat', 'Tom'); The following exa...
WindowOrWorkerGlobalScope.fetch() - Web APIs
e resources it's retrieving. Note: The fetch() method's parameters are identical to those of the Request() constructor. Syntax const fetchResponsePromise = fetch(resource [, init]) Parameters resource This defines the resource that you wish to fetch. This can either be: A USVString containing the direct URL of the resource you want to fetch. Some browsers accept the blob: and data: schemes. A Request object. init Optional An object containing any custom settings that you want to apply to the request. The possible options are: method The request method, e.g., GET, POST. Note that the Origin header is not set on Fetch requests with a method of HEAD or GET. (This behavior was corrected in Firefox 65 -- see bug 1508661). headers Any headers you want to add to yo...
WindowOrWorkerGlobalScope.origin - Web APIs
Scope interface returns the origin of the global scope, serialized as a string. Syntax var myOrigin = self.origin; // or just origin Value A USVString. Examples Executed from inside a worker script, the following snippet will log the worker's global scope's origin to the console each time it receives a message onmessage = function() { console.log(self.origin); }; If the origin is not a scheme/host/port tuple (say you are trying to run it locally, i.e. via file:// URL), origin will return the string "null". Specifications Specification Status Comment HTML Living StandardThe definition of 'WindowOrWorkerGlobalScope.origin' in that specification. Living Standard Initial definition. ...
WorkerLocation - Web APIs
ecuted in the context of a Web worker. Properties The WorkerLocation interface doesn't inherit any property, but implements properties defined in the URLUtilsReadOnly interface. URLUtilsReadOnly.href Read only Is a stringifier that returns a DOMString containing the whole URL of the script executed in the Worker. URLUtilsReadOnly.protocol Read only Is a DOMString containing the protocol scheme of the URL of the script executed in the Worker, including the final ':'. URLUtilsReadOnly.host Read only Is a DOMString containing the host, that is the hostname, a ':', and the port of the URL of the script executed in the Worker. URLUtilsReadOnly.hostname Read only Is a DOMString containing the domain of the URL of the script executed in the Worker. URLUtilsReadOnly.origin Read only R...
Color contrast - Accessibility
Make the color contrast as good as it can be within your design constraints -- ideally go for the AAA rating (see 1.4.6 below), but at least meet the AA rating (see 1.4.3 below). If you are including non-text content such as video or animation, you should follow 1.4.11 (again, see below). To check your contrast a...
Understandable - Accessibility
appropriate, etc. GlobalEventHandlers.oninput is useful here. 3.2.3 Consistent Navigation (AA) Navigation menu/control style and positioning should be consistent between different pages or views of a web page, and the existing items should appear in the same order, even if for example new iteam are added. If the user has initiated a change, e.g. choosing a different color scheme or position for the navigation, their choice should be respected across all pages. Again, sensible design -- make the navigation controls the same across all pages or views. See Page layouts for information on modern markup for layouts. See also Styling links as buttons for a useful accessible navigation menu example. 3.2.4 Consistent Identification (AA) Controls or c...
src - CSS: Cascading Style Sheets
Web › CSS › @font-face › src
s to an element within a document containing SVG font definitions. If the element reference is omitted, a reference to the first defined font is implied. Similarly, font container formats that can contain more than one font load only one of the fonts for a given @font-face rule. Fragment identifiers are used to indicate which font to load. If a container format lacks a defined fragment identifier scheme, a simple 1-based indexing scheme (e.g., "font-collection#1" for the first font, "font-collection#2" for the second font, etc.) is used. Formal definition Related at-rule@font-faceInitial valuen/a (required)Computed valueas specified Formal syntax [ <url> [ format( <string># ) ]? | local( <family-name> ) ]#where <family-name> = <string> | <custom-ident>+ Examples Specifying font resources u...
forced-colors - CSS: Cascading Style Sheets
ndicates whether or not the browser is currently in forced-colors mode. Values none Forced colors mode is not active; the page's colors are not being forced into a limited palette. active Indicates that forced colors mode is active. The browser provides the color palette to authors through the CSS system color keywords and, if appropriate, it triggers the appropriate value of prefers-color-scheme so that authors can adapt the page. Usage notes Properties affected by forced-color mode In forced colors mode, the values of the following properties are treated as if they have no author-level values specified. That is, user-specified values (if any) or browser-specified values are used instead. color fill stroke text-decoration-color text-emphasis-color border-color outline-color ...
Using media queries - CSS: Cascading Style Sheets
ce handle content that overflows the viewport along the block axis? Added in Media Queries Level 4. overflow-inline Can content that overflows the viewport along the inline axis be scrolled? Added in Media Queries Level 4. pointer Is the primary input mechanism a pointing device, and if so, how accurate is it? Added in Media Queries Level 4. prefers-color-scheme Detect if the user prefers a light or dark color scheme Added in Media Queries Level 5. prefers-contrast Detects if the user has requested the system increase or decrease the amount of contrast between adjacent colors Added in Media Queries Level 5. prefers-reduced-motion The user prefers less motion on the page Added in Media Queries Level 5. prefers-...
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
p along side the base color. To find that, we click the "add complementary" toggle underneath the menu that lets you select the palette type (currently "Monochromatic"). Paletton computes an appropriate accent color; clicking on the accent color down in the bottom-right corner tells us that this color is #508D7C. If you're unhappy with the color that's proposed to you, you can change the color scheme, to see if you find something you like better. For example, if we don't like the proposed greenish-blue color, we can click the Triad color scheme icon, which presents us with the following: That greyish blue in the top-right looks pretty good. Clicking on it, we find that it's #556E8D. That would be used as the accent color, to be used sparingly to make things stand out, such as in headlines ...
<area> - HTML: Hypertext Markup Language
Web › HTML › Element › area
er to use when fetching the resource: "no-referrer" meaning that the Referer: header will not be sent. "no-referrer-when-downgrade" meaning that no Referer: header will be sent when navigating to an origin without TLS (HTTPS). This is a user agent's default behavior, if no policy is otherwise specified. "origin" meaning that the referrer will be the origin of the page, that is roughly the scheme, the host and the port. "origin-when-cross-origin" meaning that navigations to other origins will be limited to the scheme, the host and the port, while navigations on the same origin will include the referrer's path. "unsafe-url" meaning that the referrer will include the origin and the path (but not the fragment, password, or username). This case is unsafe because it can leak origins and p...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
Web › HTML › Element › iframe
elements; or the windowName parameter in the window.open() method. referrerpolicy Indicates which referrer to send when fetching the frame's resource: no-referrer: The Referer header will not be sent. no-referrer-when-downgrade (default): The Referer header will not be sent to origins without TLS (HTTPS). origin: The sent referrer will be limited to the origin of the referring page: its scheme, host, and port. origin-when-cross-origin: The referrer sent to other origins will be limited to the scheme, the host, and the port. Navigations on the same origin will still include the path. same-origin: A referrer will be sent for same origin, but cross-origin requests will contain no referrer information. strict-origin: Only send the origin of the document as the referrer when the proto...
<img>: The Image Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › img
images are requested and when. referrerpolicy A string indicating which referrer to use when fetching the resource: no-referrer: The Referer header will not be sent. no-referrer-when-downgrade: No Referer header is sent when navigating to an origin without HTTPS. This is the default if no policy is otherwise specified. origin: The Referer header will include the page's origin (scheme, host, and port). origin-when-cross-origin: Navigating to other origins will limit the included referral data to the scheme, host, and port, while navigating from the same origin will include the full path and query string. unsafe-url: The Referer header will always include the origin, path and query string, but not the fragment, password, or username. This is unsafe because it can leak infor...
<input type="url"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › url
omatically validated as conforming to URL syntax. More specifically, there are two possible value formats that will pass validation: An empty string ("") indicating that the user did not enter a value or that the value was removed. A single properly-formed absolute URL. This doesn't necessarily mean the URL address exists, but it is at least formatted correctly. In simple terms, this means urlscheme://restofurl. See Validation for details on how URLs are validated to ensure that they're formatted properly. Additional attributes In addition to the attributes that operate on all <input> elements regardless of their type, url inputs support the following attributes: Attribute Description list The id of the <datalist> element that contains the optional pre-define...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
Web › HTML › Element › link
which referrer to use when fetching the resource: no-referrer means that the Referer header will not be sent. no-referrer-when-downgrade means that no Referer header will be sent when navigating to an origin without TLS (HTTPS). This is a user agent's default behavior, if no policy is otherwise specified. origin means that the referrer will be the origin of the page, which is roughly the scheme, the host, and the port. origin-when-cross-origin means that navigating to other origins will be limited to the scheme, the host, and the port, while navigating on the same origin will include the referrer's path. unsafe-url means that the referrer will include the origin and the path (but not the fragment, password, or username). This case is unsafe because it can leak origins and paths from...
<script>: The Script element - HTML: Hypertext Markup Language
Web › HTML › Element › script
resource's policy is otherwise trivial. referrerpolicy Indicates which referrer to send when fetching the script, or resources fetched by the script: no-referrer: The Referer header will not be sent. no-referrer-when-downgrade (default): The Referer header will not be sent to origins without TLS (HTTPS). origin: The sent referrer will be limited to the origin of the referring page: its scheme, host, and port. origin-when-cross-origin: The referrer sent to other origins will be limited to the scheme, the host, and the port. Navigations on the same origin will still include the path. same-origin: A referrer will be sent for same origin, but cross-origin requests will contain no referrer information. strict-origin: Only send the origin of the document as the referrer when the proto...
<textarea> - HTML: Hypertext Markup Language
Web › HTML › Element › textarea
ents exceeding cols are not wrapped and the <textarea> becomes horizontally scrollable. If this attribute is not specified, soft is its default value. Styling with CSS <textarea> is a replaced element -- it has intrinsic dimensions, like a raster image. By default, its display value is block. Compared to other form elements it is relatively easy to style, with its box model, fonts, color scheme, etc. being easily manipulable using regular CSS. Styling HTML forms provides some useful tips on styling <textarea>s. Baseline inconsistency The HTML specification doesn't define where the baseline of a <textarea> is, so different browsers set it to different positions. For Gecko, the <textarea> baseline is set on the baseline of the first line of the textarea's first line, on another browser...
x-ms-format-detection - HTML: Hypertext Markup Language
Links created through format detection do not appear in the DOM. ...
Using the application cache - HTML: Hypertext Markup Language
iles can be set by adding AddType text/cache-manifest .appcache to a .htaccess file within either the root directory, or the same directory as the application. Entries in a cache manifest file The cache manifest file is a simple text file that lists the resources the browser should cache for offline access. Resources are identified by URI. Entries listed in the cache manifest must have the same scheme, host, and port as the manifest. Example 1: a simple cache manifest file The following is a simple cache manifest file, example.appcache, for an imaginary web site at www.example.com. CACHE MANIFEST # v1 - 2011-08-13 # This is a comment. http://www.example.com/index.html http://www.example.com/header.png http://www.example.com/blah/blah A cache manifest file can include three sections (CACHE...
Resource URLs - HTTP
Non-standard This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. Resource URLs, URLs prefixed with the resource: scheme, are used by Firefox and Firefox browser extensions to load resources internally, but some of the information is available to sites the browser connects to as well. Syntax Resource URLs are composed of two parts: a prefix (resource:), and a URL pointing to the resource you want to load: resource://<url> An example: resource://gre/res/svg.css When arrows are found in the resource URL's ('->'), it means that the first file loaded the next one: ...
Basics of HTTP - HTTP
RIs A brief introduction to the concept of resources, identifiers, and locations on the web. Identifying resources on the Web Describes how web resources are referenced and how to locate them. Data URIs A specific kind of URI that directly embeds the resource it represents. Data URIs are very convenient, but have some caveats. Resource URLs Resource URLs, those prefixed with the resource scheme are used by Firefox and Firefox browser extensions to load resources internally, but is also available to some sites the browser connects to as well. Separating identity and location of a resource: The Alt-Svc HTTP header Most of the time the identity and location of a web resource are shared, this can be changed with the Alt-Svc header. MIME types Since HTTP/1.0, different types of content c...
Reason: CORS request not HTTP - HTTP
This often occurs if the URL specifies a local file, using a file:/// URL. To fix this problem, simply make sure you use HTTPS URLs when issuing requests involving CORS, such as XMLHttpRequest, Fetch APIs, Web Fonts (@font-face), and WebGL textures, and XSL stylesheets. Local File Security in Firefox 68 When a user opened a page using a file:/// URI in Firefox 67 and earlier, the origin of the page was defined as the directory from which the page was opened. ...
Content Security Policy (CSP) - HTTP
Web › HTTP › CSP
ceive the reports; it can store or process them in whatever manner you determine is appropriate. Violation report syntax The report JSON object contains the following data: blocked-uri The URI of the resource that was blocked from loading by the Content Security Policy. If the blocked URI is from a different origin than the document-uri, then the blocked URI is truncated to contain just the scheme, host, and port. disposition Either "enforce" or "report" depending on whether the Content-Security-Policy-Report-Only header or the Content-Security-Policy header is used. document-uri The URI of the document in which the violation occurred. effective-directive The directive whose enforcement caused the violation. original-policy The original policy as specified by the Content-Securit...
Cross-Origin Resource Policy (CORP) - HTTP
Cross-Origin-Resource-Policy HTTP response header, which accepts one of three values: same-site Only requests from the same Site can read the resource. Warning: This is less secure than an origin. The algorithm for checking if two origins are same site is defined in the HTML standard and involves checking the registrable domain. same-origin Only requests from the same origin (i.e. scheme + host + port) can read the resource. cross-origin Requests from any origin (both same-site and cross-site) can read the resource. Cross-Origin-Resource-Policy: same-site | same-origin | cross-origin During a cross-origin resource policy check, if the header is set, the browser will deny no-cors requests issued from a different origin/site. ...
Access-Control-Allow-Origin - HTTP
Specifies an origin. Only a single origin can be specified. If the server supports clients from multiple origins, it must return the origin for the specific client making the request. null Specifies the origin "null". Note: null should not be used: "It may seem safe to return Access-Control-Allow-Origin: "null", but the serialization of the Origin of any resource that uses a non-hierarchical scheme (such as data: or file:) and sandboxed documents is defined to be "null". Many User Agents will grant such documents access to a response with an Access-Control-Allow-Origin: "null" header, and any origin can create a hostile document with a "null" Origin. The "null" value for the ACAO header should therefore be avoided." Examples A response that tells the browser to allow code from any orig...
Content-Encoding - HTTP
ing the zlib structure (defined in RFC 1950) with the deflate compression algorithm (defined in RFC 1951). identity Indicates the identity function (i.e., no compression or modification). This token, except if explicitly specified, is always deemed acceptable. br A format using the Brotli algorithm. Examples Compressing with gzip On the client side, you can advertise a list of compression schemes that will be sent along in an HTTP request. The Accept-Encoding header is used for negotiating content encoding. Accept-Encoding: gzip, deflate The server responds with the scheme used, indicated by the Content-Encoding response header. Content-Encoding: gzip Note that the server is not obligated to use any compression method. Compression highly depends on server settings and used server mod...
Content-Security-Policy-Report-Only - HTTP
ective. Content-Security-Policy: default-src https:; report-uri /csp-violation-report-endpoint/ Violation report syntax The report JSON object contains the following data: blocked-uri The URI of the resource that was blocked from loading by the Content Security Policy. If the blocked URI is from a different origin than the document-uri, then the blocked URI is truncated to contain just the scheme, host, and port. disposition Either "enforce" or "report" depending on whether the Content-Security-Policy header or the Content-Security-Policy-Report-Only header is used. document-uri The URI of the document in which the violation occurred. effective-directive The directive whose enforcement caused the violation. original-policy The original policy as specified by the Content-Security-P...
Content-Security-Policy - HTTP
s Workers are in general not governed by the content security policy of the document (or parent worker) that created them. To specify a content security policy for the worker, set a Content-Security-Policy response header for the request which requested the worker script itself. The exception to this is if the worker script's origin is a globally unique identifier (for example, if its URL has a scheme of data or blob). In this case, the worker does inherit the content security policy of the document or worker that created it. Multiple content security policies The CSP mechanism allows multiple policies being specified for a resource, including via the Content-Security-Policy header, the Content-Security-Policy-Report-Only header and a <meta> element. You can use the Content-Security-Policy ...
Origin - HTTP
Web › HTTP › Headers › Origin
uests, as well as with POST requests. It is similar to the Referer header, but, unlike this header, it doesn't disclose the whole path. Note: The Origin header is not set on Fetch requests with a method of HEAD or GET (this behavior was corrected in Firefox 65 -- see bug 1508661). Header type Request header Forbidden header name yes Syntax Origin: null Origin: <scheme> "://" <hostname> [ ":" <port> ] Directives <scheme> The protocol that is used. Usually it is the HTTP protocol or its secured version, HTTPS. <hostname> The domain name of the server (for virtual hosting) or the IP. <port> Optional TCP port number on which the server is listening. If no port is given, the default port for the service requested (e.g., "80" for an HTTP URL) is implied. ...
Set-Cookie - HTTP
path-value> Optional A path that must exist in the requested URL, or the browser won't send the Cookie header. The forward slash (/) character is interpreted as a directory separator, and subdirectories will be matched as well: for Path=/docs, /docs, /docs/Web/, and /docs/Web/HTTP will all match. Secure Optional A secure cookie is only sent to the server when a request is made with the https: scheme. (However, confidential information should never be stored in HTTP Cookies, as the entire mechanism is inherently insecure and doesn't encrypt any information.) Note: Insecure sites (http:) can't set cookies with the Secure attribute (since Chrome 52 and Firefox 52). HttpOnly Optional Forbids JavaScript from accessing the cookie, for example, through the Document.cookie property. Note that a...
X-Forwarded-Proto - HTTP
ized version of this header is the HTTP Forwarded header. Header type Request header Forbidden header name no Syntax X-Forwarded-Proto: <protocol> Directives <protocol> The forwarded protocol (http or https). Examples X-Forwarded-Proto: https Other non-standard forms: # Microsoft Front-End-Https: on X-Forwarded-Protocol: https X-Forwarded-Ssl: on X-Url-Scheme: https Specifications Not part of any current specification. The standardized version of this header is Forwarded. ...
Protocol upgrade mechanism - HTTP
or any library that does WebSockets, most or all of this is done for you. For example, opening a WebSocket connection is as simple as: webSocket = new WebSocket("ws://destination.server.ext", "optionalProtocol"); The WebSocket() constructor does all the work of creating an initial HTTP/1.1 connection then handling the handshaking and upgrade process for you. You can also use the "wss://" URL scheme to open a secure WebSocket connection. If you need to create a WebSocket connection from scratch, you'll have to handle the handshaking process yourself. After creating the initial HTTP/1.1 session, you need to request the upgrade by adding to a standard request the Upgrade and Connection headers, as follows: Connection: Upgrade Upgrade: websocket WebSocket-specific headers The following hea...
Redirections in HTTP - HTTP
an be used to set up a different redirect: Redirect permanent / https://www.example.com # ...acts the same as: Redirect 301 / https://www.example.com The mod_rewrite module can also create redirects. It is more flexible, but a bit more complex. Nginx In Nginx, you create a specific server block for the content you want to redirect: server { listen 80; server_name example.com; return 301 $scheme://www.example.com$request_uri; } To apply a redirect to a directory or only certain pages, use the rewrite directive: rewrite ^/images/(.*)$ https://images.example.com/$1 redirect; rewrite ^/images/(.*)$ https://images.example.com/$1 permanent; IIS In IIS, you use the <httpRedirect> element to configure redirections. Redirection loops Redirection loops happen when additional redirections f...
HTTP resources and specifications - HTTP
raft RFC 2145 Use and Interpretation of HTTP Version Numbers Informational RFC 6585 Additional HTTP Status Codes Proposed Standard RFC 7538 The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect) Proposed Standard RFC 7725 An HTTP Status Code to Report Legal Obstacles On the standard track RFC 2397 The "data" URL scheme Proposed Standard RFC 3986 Uniform Resource Identifier (URI): Generic Syntax Internet Standard RFC 5988 Web Linking Defines the Link header Proposed Standard Experimental spec Hypertext Transfer Protocol (HTTP) Keep-Alive Header Informational (Expired) Draft spec HTTP Client Hints IETF Draft RFC 7578 Returning Values f...
HTTP response status codes - HTTP
Web › HTTP › Status
ailed This response code means the expectation indicated by the Expect request header field can't be met by the server. 418 I'm a teapot The server refuses the attempt to brew coffee with a teapot. 421 Misdirected Request The request was directed at a server that is not able to produce a response. This can be sent by a server that is not configured to produce responses for the combination of scheme and authority that are included in the request URI. 422 Unprocessable Entity (WebDAV) The request was well-formed but was unable to be followed due to semantic errors. 423 Locked (WebDAV) The resource that is being accessed is locked. 424 Failed Dependency (WebDAV) The request failed due to failure of a previous request. 425 Too Early Indicates that the server is unwilling to risk process...
Equality comparisons and sameness - JavaScript
If your use case does not require this, it is suggested to avoid Object.is and use === instead. Even if your requirements involve having comparisons between two NaN values evaluate to true, generally it is easier to special-case the NaN checks (using the ...
Promise - JavaScript
he handler will be called, so there is no race condition between an asynchronous operation completing and its handlers being attached. As the Promise.prototype.then() and Promise.prototype.catch() methods return promises, they can be chained. Not to be confused with: Several other languages have mechanisms for lazy evaluation and deferring a computation, which they also call "promises", e.g. Scheme. Promises in JavaScript represent processes that are already happening, which can be chained with callback functions. If you are looking to lazily evaluate an expression, consider the arrow function with no arguments: f = () => expression to create the lazily-evaluated expression, and f() to evaluate. Note: A promise is said to be settled if it is either fulfilled or rejected, but not pending.
encodeURI() - JavaScript
se clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax encodeURI(URI) Parameters URI A complete URI. Return value A new string representing the provided string encoded as a URI. Description The encodeURI() function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI "scheme" can possibly contain. Note how certain characters are used to signify special meaning: http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor Hence encodeURI() does not encode characters that are necessary to formulate a complete URI. Also, encodeURI() does not encode a few additional characters, known as "unreserved marks", which do not have a reserved...
Web audio codec guide - Web media technologies
essary because the rate at which the music is downloaded needs to be no greater than the amount of bandwidth available on the network, and ideally there should be room left for network speed fluctuations and use of the network by other applications. Unless there's a specific need for lossless compression, or the network bandwidth is guaranteed to be high enough to support it, a lossy compression scheme is a good choice. Which one you choose depends on browser compatibility and the availability of any special features you may need the codec to support. Usually the latency is not particularly important when streaming music. Possible exceptions include looped music, where you need music to be able to play back uninterrupted over and over, or when you need to be able to play songs back to back wit...
OpenSearch description format
rch engine. It must be 1024 or fewer characters of plain text, with no HTML or other markup. InputEncoding The character encoding to use when submitting input to the search engine. Image URI of an icon for the search engine. When possible, include a 16x16 image of type image/x-icon (such as /favicon.ico) and a 64x64 image of type image/jpeg or image/png. The URI may also use the data: URI scheme. (You can generate a data: URI from an icon file at The data: URI kitchen.) <Image height="16" width="16" type="image/x-icon">https://example.com/favicon.ico</Image> <!-- or --> <Image height="16" width="16">data:image/x-icon;base64,AAABAAEAEBAAA ... DAAA=</Image> Firefox caches the icon as a base64 data: URI (search plug-ins are stored in the profile's searchplugins/ folder). http: and ht...
Fills and Strokes - SVG: Scalable Vector Graphics
CSS file. Most SVG you'll find around the web use inline CSS, but there are advantages and disadvantages associated with each type. Fill and Stroke Attributes Painting Basic coloring can be done by setting two attributes on the node: fill and stroke. Using fill sets the color inside the object and stroke sets the color of the line drawn around the object. You can use the same css color naming schemes that you use in HTML, whether that's color names (that is red), rgb values (that is rgb(255,0,0)), hex values, rgba values, etc. <rect x="10" y="10" width="100" height="100" stroke="blue" fill="purple" fill-opacity="0.5" stroke-opacity="0.8"/> In addition, you can specify the opacity of either the fill or stroke separately in SVG. These are controlled by the fill-opacity and stroke-op...
Same-origin policy - Web security
policy is a critical security mechanism that restricts how a document or script loaded from one origin can interact with a resource from another origin. It helps isolate potentially malicious documents, reducing possible attack vectors. Definition of an origin Two URLs have the same origin if the protocol, port (if specified), and host are the same for both. You may see this referenced as the "scheme/host/port tuple", or just "tuple". (A "tuple" is a set of items that together comprise a whole -- a generic form for double/triple/quadruple/quintuple/etc.) The following table gives examples of origin comparisons with the URL http://store.company.com/dir/page.html: URL Outcome Reason http://store.company.com/dir2/other.html Same origin Only the path differs ...
An Overview - XSLT: Extensible Stylesheet Language Transformations
lare that any node that matches this specific pattern should be manipulated in this specific way and end up in this specific position in the result tree. The particulars of how this is to be accomplished are left up to the processor. Because the order of execution of the stylesheet cannot be guaranteed, XSLT does not support any functionality that produces side-effects. In this it is like Lisp or Scheme. Locations on the tree are specified using XPath, another W3C Recommendation. Transformations depend on the processor's being able to pinpoint individual nodes on the tree. To facilitate this, the W3C decided to use a separate language, XPath, which also has uses outside the XSLT context. As its name implies, XPath defines a "path" the processor must take through the tree to arrive at the desir...
Understanding WebAssembly text format - WebAssembly
se JavaScript has full access to function references, the Table object can be mutated from JavaScript using the grow(), get() and set() methods. And WebAssembly code is itself able to manipulate tables using instructions added as part of Reference types, such as table.get and table.set. Because tables are mutable, they can be used to implement sophisticated load-time and run-time dynamic linking schemes. When a program is dynamically linked, multiple instances share the same memory and table. This is symmetric to a native application where multiple compiled .dlls share a single process's address space. To see this in action, we'll create a single import object containing a Memory object and a Table object, and pass this same import object to multiple instantiate() calls. Our .wat examples loo...