Search completed in 1.26 seconds.
HTML attribute: accept - HTML: Hypertext Markup Language
the
accept attribute takes as its value a comma-separated list of one or more file types, or unique file type specifiers, describing which file types to allow. the
accept property is an attribute of the file <input> type. it was supported on the <form> element, but was removed in favor of file in html5. because a given file type may be identified in more than one manner, it's useful to provide a thorough set of type specifiers when you need files of specific type, or use the wild card to denote a type of any format is
acceptable. ...
...rted on the <form> element, but was removed in favor of file in html5. because a given file type may be identified in more than one manner, it's useful to provide a thorough set of type specifiers when you need files of specific type, or use the wild card to denote a type of any format is
acceptable. ...
...file type may be identified in more than one manner, it's useful to provide a thorough set of type specifiers when you need files of specific type, or use the wild card to denote a type of any format is
acceptable. ...
...And 9 more matches
NodeFilter.acceptNode() - Web APIs
the nodefilter.
acceptnode() method returns an unsigned short that will be used to tell if a given node must be
accepted or not by the nodeiterator or treewalker iteration algorithm. this method is expected to be written by the user of a nodefilter. possible return values are: constant description nodefilter.filter_
accept value returned by the nodefilter.
acceptnode() method when a node should be
accepted. nodefilter.filter_reject value to be returned by the nodefilter.
acceptnode() method when a node should be rejected. the children of rejected nodes are not visited by the nodeiterator or treewalker object; this value is treated as "skip this node and all its children". ...
...eptnode() method when a node should be
accepted. nodefilter.filter_reject value to be returned by the nodefilter.
acceptnode() method when a node should be rejected. the children of rejected nodes are not visited by the nodeiterator or treewalker object; this value is treated as "skip this node and all its children". nodefilter.filter_skip value to be returned by nodefilter.
acceptnode() for nodes to be skipped by the nodeiterator or treewalker object. the children of skipped nodes are still considered. this is treated as "skip this node but not its children". ...
...or or treewalker object; this value is treated as "skip this node and all its children". nodefilter.filter_skip value to be returned by nodefilter.
acceptnode() for nodes to be skipped by the nodeiterator or treewalker object. the children of skipped nodes are still considered. this is treated as "skip this node but not its children". the function should return nodefilter.filter_
accept, which causes the treewalker to return the node, nodefilter.filter_reject, which causes the treewalker to ignore the entire subtree, or nodefilter.filter_skip. the browser doesn't provide any object implementing this method. ...
...And 7 more matches
Accept-Encoding - HTTP
two common cases lead to this: the data to be sent is already compressed and a second compression won't lead to smaller data to be transmitted. this may be the case with some image formats; the server is overloaded and cannot afford the computational overhead induced by the compression requirement. ...
...g, usually a compression algorithm, the client is able to understand. using content negotiation, the server selects one of the proposals, uses it and informs the client of its choice with the content-encoding response header. even if both the client and the server supports the same compression algorithms, the server may choose not to compress the body of a response, if the identity value is also
acceptable. two common cases lead to this: the data to be sent is already compressed and a second compression won't lead to smaller data to be transmitted. this may be the case with some image formats; the server is overloaded and cannot afford the computational overhead induced by the compression requirement. typically, microsoft recommends not to compress if a server uses more than 80% of its comp...
...d and cannot afford the computational overhead induced by the compression requirement. typically, microsoft recommends not to compress if a server uses more than 80% of its computational power. as long as the identity value, meaning no encoding, is not explicitly forbidden, by an identity;q=0 or a *;q=0 without another explicitly set value for identity, the server must never send back a 406 not
acceptable error. notes: an iana registry maintains a complete list of official content encodings. two others content encoding, bzip and bzip2, are sometimes used, though not standard. they implement the algorithm used by these two unix programs. note that the first one was discontinued due to patent licensing problems. header type request header forbidden header name ...
...And 6 more matches
Accept-Patch - HTTP
notes: an iana registry maintains a complete list of official content encodings. two others content encoding, bzip and bzip2, are sometimes used, though not standard. they implement the algorithm used by these two unix programs. note that the first one was discontinued due to patent licensing problems. ...
... notes: an iana registry maintains a complete list of official content encodings. two others content encoding, bzip and bzip2, are sometimes used, though not standard. they implement the algorithm used by these two unix programs. note that the first one was discontinued due to patent licensing problems. ...
... an iana registry maintains a complete list of official content encodings. two others content encoding, bzip and bzip2, are sometimes used, though not standard. they implement the algorithm used by these two unix programs. note that the first one was discontinued due to patent licensing problems. ...
...And 6 more matches
Accept-Charset - HTTP
in early versions of http/1.1, a default character encoding was defined: iso-8859-1. ...
...the encodings, uses it, and informs the client of its choice within the content-type response header, usually in a charset= parameter. browsers usually don't send this header, as the default value for each resource is usually correct and transmitting it would allow fingerprinting. if the server cannot serve any character encoding from this request header, it can theoretically send back a 406 not
acceptable error code. but for a better user experience, this is rarely done and the
accept-charset header is ignored. in early versions of http/1.1, a default character encoding was defined: iso-8859-1. this is no longer recommended, and now each content-type may have its own default. utf-8 is now well-supported and the overwhelmingly preferred character encoding. to guarantee better privacy through...
...s rarely done and the
accept-charset header is ignored. in early versions of http/1.1, a default character encoding was defined: iso-8859-1. this is no longer recommended, and now each content-type may have its own default. utf-8 is now well-supported and the overwhelmingly preferred character encoding. to guarantee better privacy through less configuration-based entropy, all browsers omit the
accept-charset header: internet explorer 8+, safari 5+, opera 11+, firefox 10+ and chrome 27+ no longer send it. ...
...And 5 more matches
Accept-Language - HTTP
(by languages, we mean natural languages, such as english, and not programming languages.) using content negotiation, the server then selects one of the proposals, uses 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. ...
...r 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 any matching language, it can theoretically send back a 406 (not
acceptable) error code. but, for a better user experience, this is rarely done and m...
...ntrol 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 any matching language, it can theoretically send back a 406 (not
acceptable) error code. but, for a better user experience, this is rarely done and more common way is to ignore the
accept-language header in this case. ...
...And 5 more matches
PR_Accept
if unsuccessful, null. ...
... if unsuccessful, null. ...
... if unsuccessful, null. ...
...And 4 more matches
PR_AcceptRead
this parameter is valid only if the function return does not indicate failure. peeraddr a pointer a pointer to a prnetaddr object. ...
...this parameter is valid only if the function return does not indicate failure. peeraddr a pointer a pointer to a prnetaddr object. ...
...this parameter is valid only if the function return does not indicate failure. peeraddr a pointer a pointer to a prnetaddr object. on return, peeraddr points to the address of the remote socket. ...
...And 4 more matches
List of default Accept values - HTTP
this article documents the default values for the http
accept header for specific inputs and browser versions. default values these are the values sent when the context doesn't give better information. note that all browsers add the */* mime type to cover all cases. this is typically used for requests initiated via the address bar of a browser, or via an html <a> element. ...
...t value comment firefox text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 (since firefox 66) text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 (in firefox 65) text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 (before) in firefox 65 and earlier, this value can be modified using the network.http.
accept.default parameter. (source) safari, chrome text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 (source) safari 5 text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 this is an improvement over earlier
accept headers as it no longer ranks image/png above text/html internet explorer 8 image/jpe...
...ari 5 text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 this is an improvement over earlier
accept headers as it no longer ranks image/png above text/html internet explorer 8 image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/x-shockwave-flash, application/msword, */* see ie and the
accept header (ieinternals' msdn blog). edge text/html, application/xhtml+xml, image/jxr, */* opera text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 values for an image when requesting an image, like through an html <img> element, user-agent often sets a specific list of media types t...
...And 4 more matches
Accept - HTTP
the
accept request http header advertises which content types, expressed as mime types, the client is able to understand. using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-type response header. browsers set adequate values for this header depending on the context where the request is done: when fetching a css stylesheet a different value is set for the request than when fetching an image, video or a script. header type request header forbidden header name no cors-safelisted request header yes, with the additional restriction that values can't contain a cors-unsafe request header byte: 0x00-0x1f (except 0x09 (ht)), "():<>?@[\]{}, and 0x7f (del). ...
...a css stylesheet a different value is set for the request than when fetching an image, video or a script. header type request header forbidden header name no cors-safelisted request header yes, with the additional restriction that values can't contain a cors-unsafe request header byte: 0x00-0x1f (except 0x09 (ht)), "():<>?@[\]{}, and 0x7f (del). syntax
accept: <mime_type>/<mime_subtype>
accept: <mime_type>/*
accept: */* // multiple types, weighted with the quality value syntax:
accept: text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8 directives <mime_type>/<mime_subtype> a single, precise mime type, like text/html. <mime_type>/* a mime type, but without any subtype. image/* will match image/png, image/svg, image/...
... */*;q=0.8 directives <mime_type>/<mime_subtype> a single, precise mime type, like text/html. <mime_type>/* a mime type, but without any subtype. image/* will match image/png, image/svg, image/gif and any other image types. ...
...And 4 more matches
406 Not Acceptable - HTTP
instead of responding using this error code, which would be cryptic for the end user and difficult to fix, servers ignore the relevant header and serve an actual page to the user. it is assumed that even if the user won't be completely happy, they will prefer this to an error code. ...
...instead of responding using this error code, which would be cryptic for the end user and difficult to fix, servers ignore the relevant header and serve an actual page to the user. it is assumed that even if the user won't be completely happy, they will prefer this to an error code. ...
...instead of responding using this error code, which would be cryptic for the end user and difficult to fix, servers ignore the relevant header and serve an actual page to the user. it is assumed that even if the user won't be completely happy, they will prefer this to an error code. ...
...And 4 more matches
Accept-CH-Lifetime - HTTP
the
accept-ch-lifetime header is set by the server to specify the persistence of
accept-ch header value that specifies for which client hints headers client should include in subsequent requests. header type response header forbidden header name ? ...
... the
accept-ch-lifetime header is set by the server to specify the persistence of
accept-ch header value that specifies for which client hints headers client should include in subsequent requests. header type response header forbidden header name ? ...
... the
accept-ch-lifetime header is set by the server to specify the persistence of
accept-ch header value that specifies for which client hints headers client should include in subsequent requests. header type response header forbidden header name ? ...
...And 3 more matches
Accept-Ranges - HTTP
though bytes is the only range unit formally defined by rfc 7233, additional range units may be registered in the http range unit registry. ...
...though bytes is the only range unit formally defined by rfc 7233, additional range units may be registered in the http range unit registry. ...
...p header is a marker used by the server to advertise its support of partial requests. the value of this field indicates the unit that can be used to define a range. in presence of an
accept-ranges header, the browser may try to resume an interrupted download, rather than to start it from the start again. header type response header forbidden header name no syntax
accept-ranges: <range-unit>
accept-ranges: none directives <range-unit> defines the range unit the server supports. though bytes is the only range unit formally defined by rfc 7233, additional range units may be registered in the http range unit registry. none no range unit is supported, this makes the header equivalent of its own absence and is therefore rarely used, though some browsers, like ...
...And 2 more matches
Running Tamarin acceptance tests - Archive of obsolete content
running the tamarin test suite requires the following steps: set the avm environment variable to the path of the avmplus executable (avmshell). note: the name of the avmshell executable varies among the build systems; use the name of the avm shell produced from the build process you used, above. set the builtinabc environment variable to the path of the generated/builtin.abc. you may build the .abc files build by downloading the latest asc.jar. the latest asc.jar can be downloaded from from ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar. ...
...atest asc.jar. the latest asc.jar can be downloaded from from ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar. also the source to asc.jar may be downloaded and rebuilt from http://opensource.adobe.com/wiki/dis...exsdk/flex+sdk. set the asc environment variable, as described above. set the shellabc environment variable to the path of the generated/shell_toplevel.abc. ...
...010-09-28 10:39:26.751797 start date: 2010-09-28 10:38:07.221457 end date : 2010-09-28 10:39:26.751797 test time : 0:01:19.530340 passes : 59291 failures : 0 expected failures : 75 tests skipped : 76 the -f flag tells runtests.py to force recompilation of all the scripts. for help on runtests.py options, see below or use python runtests.py -h. notes on using
acceptance runtests.py threading in order to speed up the execution time of the
acceptance testsuite, the runtests script automatically detects the number of cores on the machine and sets an equivalent number of threads. this can be overrided with the threads flag: python ./runtests.py --threads=3 threading on cygwin / windows due to an issue with cygwin python, threading does not work, and threads wil...
...$avm -dversion shell 1.4 debug build 6299:455bca954565 features avmsystem_32bit;avmsystem_unaligned_int_access;avmsystem_little_endian;avmsystem_arm;avmsystem_unix; avmfeature_jit;avmfeature_abc_interp;avmfeature_selftest;avmfeature_eval;avmfeature_protect_jitmem; avmfeature_shared_gcheap;avmfeature_cache_gqcn;avmfeature_safepoints;avmfeature_swf12;avmfeature_swf13;avmtweak_exact_tracing; running
acceptance tests --androidthreads sets the number of threads to the number of phones found via usb. running with 2 or more phones uses threads to run tests in parallel and reduces running times dramatically. you must, in any case, at least use --androidthreads or --threads=1 (or will fail due to multiple tests running). $ cd tamarin-redux/test/
acceptance $ ./runtests.py --androidthreads note on using...
Tamarin Acceptance Testing - Archive of obsolete content
in order to ensure that changes to the tamarin code base are high quality before submitting, all developers are required to complete the following steps. ...
...ubmitting, all developers are required to complete the following steps. successfully build release and debug versions of the shell with the debugger enabled [info] successfully run the following test suites:
acceptance test suite [info] self tests [info] submit a sandbox build request to test against platforms that you may not have locally [info] available tamarin
acceptance test suites actionscript
acceptance tests: actionscript
acceptance tests running tamarin
acceptance tests abc assembler tests cmdline tests performance tests actionscript performance tests running tamarin performance tests built-in self tests see instructions in doc/selftest.html in the tamarin repository. avmdi...
... to build and setup the tools see building_tamarin_windows_mobile_utilities. ...
nsICookieAcceptDialog
remember_decision 1 value for remembering a decision. hostname 2 value for holding the hostname object. cookiesfromhost 3 value for holding the cookie from the host. changingcookie 4 value for changing cookie. ...
... remember_decision 1 value for remembering a decision. hostname 2 value for holding the hostname object. cookiesfromhost 3 value for holding the cookie from the host. changingcookie 4 value for changing cookie. ...
... remember_decision 1 value for remembering a decision. hostname 2 value for holding the hostname object. cookiesfromhost 3 value for holding the cookie from the host. changingcookie 4 value for changing cookie. ...
Sec-WebSocket-Accept - HTTP
the sec-websocket-
accept header is used in the websocket opening handshake. it would appear in the response headers. that is, this is header is sent from server to client to inform that server is willing to initiate a websocket connection. header type response header forbidden header name no syntax sec-websocket-
accept: <hashed key> directives <hashed key> the server takes the value of the sec-websocket-key sent in the handshake request, appends 258eafa5-e914-47da-95ca-c5ab0dc85b11, takes sha-1 of the new value, and is then base64 encoded. ...
...e a websocket connection. header type response header forbidden header name no syntax sec-websocket-
accept: <hashed key> directives <hashed key> the server takes the value of the sec-websocket-key sent in the handshake request, appends 258eafa5-e914-47da-95ca-c5ab0dc85b11, takes sha-1 of the new value, and is then base64 encoded. ...
...t: <hashed key> directives <hashed key> the server takes the value of the sec-websocket-key sent in the handshake request, appends 258eafa5-e914-47da-95ca-c5ab0dc85b11, takes sha-1 of the new value, and is then base64 encoded. examples sec-websocket-
accept: s3pplmbitxaq9kygzzhzrbk+xoo= specification specification title rfc 6455, section 11.3.3: sec-websocket-
accept the websocket protocol ...
202 Accepted - HTTP
the hypertext transfer protocol (http) 202
accepted response status code indicates that the request has been
accepted for processing, but the processing has not been completed; in fact, processing may not have started yet. the request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. 202 is non-committal, meaning that there is no way for the http to later send an asynchronous response indicating the outcome of processing the request. it is intended for cases where another process or server handles the request, or for batch processing. ...
...ted yet. the request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. ...
... processing actually takes place. ...
Actionscript Acceptance Tests - Archive of obsolete content
testing versioned bug fixes when testing versioned bug fixes (using avmplus.system.swfversion) there are a couple of requirements: you must use system.swfversion when looking up the swfversion. the test file can not be wrapped in a package or define classes as the file will be wrapped in a function when used in the ats. if you must use classes, define them in a sub-dir with the same name as the test. ...
onbeforeaccept - Archive of obsolete content
« xul reference home onbefore
accept type: script code the code in this attribute is called when the ok button is pressed or the
acceptdialog method is called. returning false doesn't currently prevent the dialog from closing, but does prevent saving (bug 474527). ...
PR_QueueJob_Accept
iod a pointer to a prjobiodesc structure. fn the function to be executed when the job is executed. arg a pointer to an argument passed to fn. joinable if pr_true, the job is joinable. ...
HTMLFormElement.acceptCharset - Web APIs
the htmlformelement.
acceptcharset property represents a list of the supported character encodings for the given <form> element. this list can be comma-separated or space-separated. syntax var string = form.
acceptcharset; form.
acceptcharset = string; example inputs = document.forms['myform'].
acceptcharset; specifications specification status comment html living standardthe definition of 'htmlformelement:
acceptcharset' in that specification. living standard ...
Accept-CH - HTTP
the
accept-ch header is set by the server to specify which client hints headers a client should include in subsequent requests. header type response header forbidden header name ? note: client hints are accessible only on secure origins (via tls).
accept-ch and
accept-ch-lifetime headers should be persisted for all secure requests to ensure client hints are sent reliably. syntax
accept-ch: <list of client hints> examples
accept-ch: dpr, viewport-width
accept-ch: width
accept-ch-lifetime: 86400 vary: dpr, viewport-width, width note: remember to vary the response based on the
accepted client hints. ...
Index - Web APIs
wer down the audio hardware when it will not be using an audio context for a while. 136 audiocontextlatencycategory api, audio, audio context, audiocontextlatencycategory, enum, interface, media, reference, type, web audio, web audio api, latency the audiocontextlatencycategory type is an enumerated set of strings which are used to select one of a number of default values for
acceptable maximum latency of an audio context. 137 audiocontextoptions api, audio, audiocontext, audiocontextoptions, configuration, context, dictionary, interface, options, reference, settings, web audio api, samplerate the audiocontextoptions dictionary is used to specify configuration options when constructing a new audiocontext object to represent a graph of web audio nodes. ...
...ly, reference, primitivevalue the primitivetype read-only property of the cssprimitivevalue interface represents the type of a css value. 446 cssprimitivevalue.setfloatvalue() api, cssprimitivevalue, method, needsexample, setfloatvalue the setfloatvalue() method of the cssprimitivevalue interface is used to set a float value. ...
... 448 csspseudoelement api, csspseudoelement, element, experimental, interface, reference the csspseudoelement interface represents a pseudo-element that may be the target of an event or animated using the web animations api. ...
...And 23 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
conditions: one of the allowed methods: get head post apart from the headers automatically set by the user agent (for example, connection, user-agent, or the other headers defined in the fetch spec as a “forbidden header name”), the only headers which are allowed to be manually set are those which the fetch spec defines as a “cors-safelisted request-header”, which are:
accept accept-language content-language content-type (but note the additional requirements below) dpr downlink save-data viewport-width width the only allowed values for the content-type header are: application/x-www-form-urlencoded multipart/form-data text/plain no event listeners are registered on any xmlhttprequestupload object used in the request; these are accessed...
...hese are the same kinds of cross-site requests that web content can already issue, and no response data is released to the requester unless the server sends an appropriate header. therefore, sites that prevent cross-site request forgery have nothing new to fear from http access control. ...
... the same kinds of cross-site requests that web content can already issue, and no response data is released to the requester unless the server sends an appropriate header. therefore, sites that prevent cross-site request forgery have nothing new to fear from http access control. ...
...And 16 more matches
Content negotiation - HTTP
ed by content negotiation and there are several ways of negotiating between the client and the server. the determination of the best suited representation is made through one of two mechanisms: specific http headers by the client (server-driven negotiation or proactive negotiation), which is the standard way of negotiating a specific kind of resource. the 300 (multiple choices) or 406 (not
acceptable) http response codes by the server (agent-driven negotiation or reactive negotiation), that are used as fallback 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 proacti...
...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-charset,
accept-encoding,
accept-language). though strictly speaking user-agent is not in this list, it is sometimes also used to send a specific representation of the requested resource, though this is not considered as a good practice. the server uses the vary header to indicate which headers it actually used for content negotiation (or more precisely the associated response headers), s...
...nlike reactive content negotiation where the client makes the choice, the server choice is always somewhat arbitrary. the information by the client is quite verbose (http/2 header compression mitigates this problem) and a privacy risk (http fingerprinting) as several representations of a given resource are sent, shared caches are less efficient and server implementations are more complex. ...
...And 13 more matches
HTTP Index - HTTP
on content negotiation, content negotiation reference, http, reference in http, content negotiation is the mechanism that is used for serving different representations of a resource at the same uri, so that the user agent can specify which is best suited for the user (for example, which language of a document, which image format, or which content encoding). 18 list of default
accept values
accept, content negotiation, http, reference this article documents the default values for the http
accept header for specific inputs and browser versions. 19 cross-origin resource policy (corp) http, reference, security cross-origin resource policy is an opt-in mechanism that allows web applications to protect against certain cross-origin requests, such as t...
...r. the browser may store it and send it back with the next request to the same server. 46 http headers http, http header, headers, networking, overview, reference http headers let the client and the server pass additional information with an http request or response. an http header consists of its case-insensitive name followed by a colon (:), then by its value. 47
accept http, http header, reference, request header the
accept request http header advertises which content types, expressed as mime types, the client is able to understand. using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-type response header. browsers set adequate values for this header depending on the con...
...understand. using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-type response header. browsers set adequate values for this header depending on the context where the request is done: when fetching a css stylesheet a different value is set for the request than when fetching an image, video or a script. ...
...And 13 more matches
Index - Archive of obsolete content
d generate or parse uuids. 131 window/utils functions for working with browser windows. 132 release notes add-on sdk no summary! 133 tools add-on sdk, cfx, jpm no summary! 134 cfx add-on sdk, cfx enables you to test, run, and package add-ons. cfx is is no longer supported as of firefox 44 and no longer
accepted for add-on submission, jpm should now be used instead. 135 cfx to jpm cfx, jpm, sdk, add-on a guide to working with jpm if you're already familiar with cfx. 136 console add-on sdk enables your add-on to log error, warning or informational messages. 137 jpm add-on sdk, jpm jpm is a command-line tool that enables you to test, run, and...
... summary! 294 performance best practices in extensions add-ons, best practices, extensions, guide, needscontent, needsexample, performance no summary! 295 search extension tutorial (draft) extensions, search, tutorial many add-ons, for monetization or other reasons, change several search-related settings at install time. while this is generally considered
acceptable behavior, considerable care must be taken to avoid violating the mozilla add-on guidelines or creating an adverse user experience. 296 security best practices in extensions add-ons, best practices, extensions, guide, security this document is intended as a guide for developers to promote best practices in securing your extension. your goal is to keep your users safe. some...
...ween fixed and auto layout of tables has been introduced. the auto-layout mechanism is implemented in basictablelayoutstrategy.cpp the fixed-layout in fixedtablelayoutstrategy.cpp. all these files are in the layout/html/table/src subdirectory. ...
...And 12 more matches
<input type="file"> - HTML: Hypertext Markup Language
s 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. value a domstring representing the path to the selected file. events change and input supported common attributes required additional attributes
accept, capture, files, multiple idl attributes files and value dom interface htmlinputelement properties properties that apply only to elements of type file methods select() value a file input's value attribute contains a domstring that represents the path to the selected file(s). if the user selected multiple files, the value re...
... the input's files property. if no file is yet selected, the string is "" (empty). the string is prefixed with c:\fakepath\, to prevent malicious software from guessing the user's file structure. ...
...this string is a comma-separated list of unique file type specifiers. ...
...And 12 more matches
sslfnc.html
ssl_require_certificate is a server option that requires a client to authenticate itself (only if ssl_request_certificate is also on). if client does not provide certificate, the connection terminates. default state is a third state similar to on, that provides backward compatibility with older netscape server products. ssl_handshake_as_client controls the behavior of pr_
accept,. if this option is off, the pr_
accept configures the ssl socket to handshake as a server. if it is on, then pr_
accept configures the ssl socket to handshake as a client, even though it
accepted the connection as a tcp server. ssl_handshake_as_server controls the behavior of pr_connect. if this option is off, then pr_connect configures the ssl socket to handshake as a client. if it i...
...ation, when an application imports a socket into ssl after the tcp connection on that socket has already been established, it must call ssl_resethandshake to determine whether the socket is for a client or server. at first glance this may seem unnecessary, since ssl_enable can set ssl_handshake_as_client or ssl_handshake_as_server. however, these settings control the behavior of pr_connect and pr_
accept only; if you don't call one of those functions after importing a non-ssl socket with ssl_import (as in the case of an already established tcp connection), ssl still needs to know whether the application is functioning as a client or server. for a complete discussion of the use of ssl_handshake_as_client and ssl_handshake_as_server with ssl_enabledefault and ssl_enable, see ssl_optionset. the ss...
...ssl3 client hello message is sent to a server that only understands ssl2 and not ssl3, then the server will interpret the ssl3 client hello as a very large message, and the connection will usually seem to "hang" while the ssl2 server expects more data that will never arrive. for this reason, the ssl3 spec allows ssl3 client hellos to be sent in ssl2 format, and it recommends that ssl3 servers all
accept ssl3 client hellos in ssl2 format. when an ssl2-only server receives an ssl3 client hello in ssl2 format, it can (and probably will) negotiate the protocol version correctly, not causing a "hang". some applications may wish to force ssl3 client hellos to be sent in ssl3 format, not in ssl2-compatible format. they might wish to do this if they knew, somehow, that the server does not understand ...
...And 11 more matches
Mozilla CSS extensions - CSS: Cascading Style Sheets
window-shadow formerly proprietary properties that are now standard note: to maximize the compatibility of your css, you should use the unprefixed standard properties instead of the prefixed ones listed below. once a given property is standardized and implemented without the prefix, the prefixed version is typically dropped after a while. ...
...now standard note: to maximize the compatibility of your css, you should use the unprefixed standard properties instead of the prefixed ones listed below. once a given property is standardized and implemented without the prefix, the prefixed version is typically dropped after a while. ...
..., you should use the unprefixed standard properties instead of the prefixed ones listed below. once a given property is standardized and implemented without the prefix, the prefixed version is typically dropped after a while. ...
...And 9 more matches
dialog - Archive of obsolete content
roperties | methods | related ] this element should be used in place of the window element for dialog boxes. the buttons attribute may be used to set which buttons should appear in the dialog box. these buttons will be placed in the correct locations for the user's platform. more information is available in the xul tutorial and dialogs and prompts (code snippets). ...
...ns should appear in the dialog box. these buttons will be placed in the correct locations for the user's platform. more information is available in the xul tutorial and dialogs and prompts (code snippets). ...
... the dialog box. these buttons will be placed in the correct locations for the user's platform. more information is available in the xul tutorial and dialogs and prompts (code snippets). ...
...And 8 more matches
Drag and Drop JavaScript Wrapper - Archive of obsolete content
ts, the event object and the drag session. ondrop(event, dropdata, session) this function should be defined when you want something to happen when an object is dropped. the first argument is the event object and the second is the data being dragged. the third argument is the drag session. getsupportedflavours() this function should return a list of flavors that the object being dragged over can
accept. this function takes no arguments. this function is necessary so that the wrapper can determine the best flavour to pass to the other functions. for an observer that is observing an element that can start a drag, you should define at least the ondragstart function. for elements that can have objects dropped on them, you should define ondragover, ondrop and getsupportedflavours (and, if desired, ...
...s observing an element that can start a drag, you should define at least the ondragstart function. for elements that can have objects dropped on them, you should define ondragover, ondrop and getsupportedflavours (and, if desired, ondragexit). the type of data being dragged is stored as a set of flavors. often, a dragged object will be available in a number of flavors. that way, a drop target can
accept the flavor it finds most suitable. for example, a file may come in two flavors, the file itself and the text name of the file. if the file is dragged and dropped onto a directory, the file flavor will be used. if the file is dropped onto a textbox, the text name flavor will be used. the text is therefore used to insert the name of the file when files can't be dropped directly. a flavor object has...
.... conveniently, this element is available from the event object's target property. the event object is passed as the first argument to ondragstart. we create a transferdata object which can be used to hold all the data to be dragged. we add two pieces of data to the transfer data. the first is a string of html text and the second is a string of plain text. if the user drops onto an area which can
accept html (such as mozilla's editor window), the html flavour will be used and the text will appear bold. otherwise, the plain text version will be used instead. usually you will want to provide a text version of the data so that more applications can
accept the data. the order that you define the flavours should be from the best match to the weakest match. in this case above, the html flavour (text/h...
...And 7 more matches
Creating Dialogs - Archive of obsolete content
ser presses each button. this mechanism is necessary because different platforms have a specific order in which the buttons appear. example dialog source view <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" buttons="
accept,cancel" ondialog
accept="return dook();" ondialogcancel="return docancel();"> <script> function dook(){ alert("you pressed ok!"); return true; } function docancel(){ alert("you pressed cancel!"); return true; } </script> <description value="select a button"/> </dialog> you may place any elements that you wish in a dialog. the dialog element has some additional attribu...
...ion docancel(){ alert("you pressed cancel!"); return true; } </script> <description value="select a button"/> </dialog> you may place any elements that you wish in a dialog. the dialog element has some additional attributes that windows do not have. the buttons attribute is used to specify which buttons should appear in the dialog. the following values may be used, seperated by commas:
accept - an ok button cancel - a cancel button help - a help button disclosure - a disclosure button, which is used for showing more information you can set code to execute when the buttons are pressed using the ondialog
accept, ondialogcancel, ondialoghelp and ondialogdisclosure attributes. if you try the example above, you will find that the dook() function is called when the ok button is pressed ...
...ressed and the docancel() function is called when the cancel button is pressed. the two functions dook() and docancel() both return true, which indicates that the dialog should be closed. if the dialog shouldn't be closed, false should be returned instead. this would be used, for example, if an invalid value was entered in a field in the dialog. amongst other useful attributes are buttonlabel
accept - label to appear on the
accept button egsave buttonaccesskey
accept - access key to use for the
accept button egs defaultbutton - button is activated when the enter key is pressed note: the label attributes are required by remote sites and are probably missing in the above examples due to bug 224996. example dialog with more features <?xml version="1.0"?> <?xml-stylesheet href="chrome://g...
...And 7 more matches
prefwindow - Archive of obsolete content
openwindow() with a null parentwindow. this does not work with prefwindows, breaking the general behavior of the window and in particular the list of prefpanes. prefer the classical window.opendialog() with the following window features: "chrome,titlebar,toolbar,centerscreen,dialog=yes". ...
...h a null parentwindow. this does not work with prefwindows, breaking the general behavior of the window and in particular the list of prefpanes. prefer the classical window.opendialog() with the following window features: "chrome,titlebar,toolbar,centerscreen,dialog=yes". ...
... the following window features: "chrome,titlebar,toolbar,centerscreen,dialog=yes". ...
...And 6 more matches
NodeFilter - Web APIs
a nodefilter interface represents an object used to filter the nodes in a nodeiterator or treewalker. a nodefilter knows nothing about the document or traversing nodes; it only knows how to evaluate a single node against the provided filter. note: the browser doesn't provide any object implementing this interface. it is the user who is expected to write one, tailoring the
acceptnode() method to its needs, and using it with some treewalker or nodeiterator objects. properties this interface neither implements nor inherits any properties. methods this interface doesn't inherit any methods. nodefilter.
acceptnode() returns an unsigned short that will be used to tell if a given node must be
accepted or not by the nodeiterator or treewalker iteration algorithm. this method is expected t...
...for treewalker, child nodes are also rejected. ...
...erit any methods. nodefilter.
acceptnode() returns an unsigned short that will be used to tell if a given node must be
accepted or not by the nodeiterator or treewalker iteration algorithm. this method is expected to be written by the user of a nodefilter. possible return values are: constant description filter_
accept value returned by the nodefilter.
acceptnode() method when a node should be
accepted. filter_reject value to be returned by the nodefilter.
acceptnode() method when a node should be rejected. for treewalker, child nodes are also rejected. for nodeiterator, this flag is synonymous with filter_skip. ...
...And 6 more matches
attr() - CSS: Cascading Style Sheets
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 attribute value is parsed as a css <integer>. if it is not valid, that is not an integer or out of the range
accepted by the css property, the default value is used. leading and trailing spaces are stripped. 0, or, if 0 is not a valid value for the property, the property's minimum value. number <number> the attribute value is parsed as a css <number>. if it is not valid, that is not a number or out of the range
accepted by the css property, the default value is used. leading...
... if the given unit is a relative length, attr() computes it to an absolute length. leading and trailing spaces are stripped. 0, or, if 0 is not a valid value for the property, the property's minimum value. ...
... spaces are stripped. 0, or, if 0 is not a valid value for the property, the property's minimum value. em, ex, px, rem, vw, vh, vmin, vmax, mm, cm, in, pt, or pc <length> the attribute value is parsed as a css <number>, that is without the unit (e.g. 12.5), and interpreted as a <length> with the specified unit. if it is not valid, that is not a number or out of the range
accepted by the css property, the default value is used. if the given unit is a relative length, attr() computes it to an absolute length. leading and trailing spaces are stripped. 0, or, if 0 is not a valid value for the property, the property's minimum value. angle <angle> the attribute value is parsed as a css <angle> dimension, that is including the unit (e.g. 30.
...And 6 more matches
Index - HTTP
tags and summary 1 http headers http, http header, networking, overview, reference http headers allow the client and the server to pass additional information with the request or the response. an http header consists of its case-insensitive name followed by a colon ':', then by its value (without line breaks). leading white space before the value is ignored. 2
accept http, http header, reference, request header the
accept request http header advertises which content types, expressed as mime types, the client is able to understand. using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-type response header. browsers set adequate values for this header depending on the con...
... understand. using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-type response header. browsers set adequate values for this header depending on the context where the request is done: when fetching a css stylesheet a different value is set for the request than when fetching an image, video or a script. 3
accept-charset content negotiation, http, http header, reference, request header the
accept-charset request http header advertises which character set the client is able to understand. using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice within the content-type response header. browsers usually don't set this header as the defaul...
...header advertises which character set the client is able to understand. using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice within the content-type response header. browsers usually don't set this header as the default value for each content type is usually correct and transmitting it would allow easier fingerprinting. 4
accept-encoding content negotiation, http, http header, reference, request header the
accept-encoding request http header advertises which content encoding, usually a compression algorithm, the client is able to understand. using content negotiation, the server selects one of the proposals, uses it and informs the client of its choice with the content-encoding response header. 5 acc...
...And 6 more matches
Canvas code snippets - Archive of obsolete content
trokerect(2, 10, 15, 20) .context; // use property name as a function (but without arguments) to get the value var strokestyle = canvas2dcontext(canvas) .strokestyle('rgb(50, 110, 210)') .strokestyle(); code usable only from privileged code these snippets are only useful from privileged code, such as extensions or privileged apps. ...
...owing function
accepts a canvas object and a destination file path string. the canvas is converted to a png file and saved to the specified location. the function returns a promise which resolves when the file has been completely saved. ...
... canvas object and a destination file path string. the canvas is converted to a png file and saved to the specified location. the function returns a promise which resolves when the file has been completely saved. ...
...And 5 more matches
Embedding API for Accessibility
ithcaret", true); accessibility prefs reference the following is a description of what accessibility prefs give us (or will give us), for accessibility: functionality implementation works as of images setintpref("network.image.imagebehavior", behavior); /* behavior: 0=
accept, 1=
accept images from originating server only, 2=no images */ moz 0.8 cookies setintpref("network.cookie.cookiebehavior", behavior); /* behavior: 0=
accept, 1=
accept cookies from originating server only, 2=no cookies */ setboolpref("network.cookie.warnaboutcookies", boolwarn); ...
...le); setcharpref("alert.audio.audio_waiting", pathtosoundfile); setcharpref("alert.audio.timed_event_waiting", pathtosoundfile); /* these alerts will also be mirrored visually, either on the status bar or elsewhere */ no background images setboolpref("browser.
accept.background_images",
acceptbackgroundimages); no blinking text setboolpref("browser.blink_allowed",
acceptblinktext); no animations setcharpref("image.animation_mode", animationmode); animationmode: "normal", "none", "once" ...
...text setboolpref("browser.blink_allowed",
acceptblinktext); no animations setcharpref("image.animation_mode", animationmode); animationmode: "normal", "none", "once" moz 0.8 applets setboolpref("browser.
accept.applets",
acceptapplets); no scripts setboolpref("browser.
accept.scripts",
acceptscripts); no popup windows // turn window.open off for particular sites: user_pref("capability.policy.popupsites.sites", "http://www.annoyingsite1.com ht...
...And 5 more matches
Writing a WebSocket server in C# - Web APIs
to write less. it allows usage of a namespace's classes without typing the full namespace every time. tcplistener constructor: tcplistener(system.net.ipaddress localaddr, int port) localaddr specifies the ip of the listener, and port specifies the port. to create an ipaddress object from a string, use the parse static method of ipaddress. methods: start() system.net.sockets.tcpclient
accepttcpclient() waits for a tcp connection,
accepts it and returns it as a tcpclient object. here's a barebones server implementation: using system.net.sockets; using system.net; using system; class server { public static void main() { tcplistener server = new tcplistener(ipaddress.parse("127.0.0.1"), 80); server.start(); console.writeline("server has started on 1...
...both sides of the channel have reading and writing capability. properties: int available this property indicates how many bytes of data have been sent. the value is zero until networkstream.dataava...
... have been sent. the value is zero until networkstream.dataavailable is true. networkstream methods: write(byte[] buffer, int offset, int size) writes bytes from buffer, offset and size determine length of message. read(byte[] buffer, int offset, int size) reads bytes to buffer. offset and size determine the length of the message. let us extend our example. ...
...And 5 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
the <input> element is one of the most powerful and complex in all of html due to the sheer number of combinations of input types and attributes. 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. ...
...owsers. <input type="datetime-local" name="datetime-local"/> html5 email a field for editing an email address. looks like a text input, but has validation parameters and relevant keyboard in supporting browsers and devices with dynamic keyboards. <input type="email" name="email"/> html5 file a control that lets the user select a file. use the
accept attribute to define the types of files that the control can select. <input type="file"
accept="image/*, text/*" name="file"/> hidden a control that is not displayed but whose value is submitted to the server. there is an example in the next column, but it's hidden! image a graphical submit button. displays an image defined by the src attribute. the ...
...name="password"/> radio a radio button, allowing a single value to be selected out of multiple choices with the same name value. <input type="radio" name="radio"/> range a control for entering a number whose exact value is not important. displays as a range widget defaulting to the middle value. used in conjunction min and max to define the range of
acceptable values. <input type="range" name="range" min="0" max="25"/> html5 reset a button that resets the contents of the form to default values. not recommended. <input type="reset" name="reset"/> search a single-line text field for entering search strings. line-breaks are automatically removed from the input value. may include a delete icon in ...
...And 5 more matches
jpm - Archive of obsolete content
jpm prepends "@" to name and use the result as the id field in the add-on's install manifest. version description entry point (which maps to "main" in package.json) author engines (supported applications) license most of these fields have a default, which is shown in brackets after the question. if you just press enter, your add-on gets the default value. once you've supplied a value or
accepted the default for these properties, you'll be shown the complete contents of "package.json" and asked to
accept it. then jpm creates a skeleton add-on, as a starting point for your add-on development, with the following file structure: my-addon index.js package.json test test-index.js jpm run this command runs a new instance of firefox with the add-on in...
...binary may be specified as a full path or as a path relative to the current directory. jpm run -b /path/to/firefox/nightly see selecting a browser version. ...
...rts with "test-". make note of the hyphen after "test" in the filename. jpm test include a file called "test-mycode.js", but will exclude files called "test_mycode.js" or "testmycode.js") call every function exported from that file whose name starts with "test". jpm test see the tutorial on unit testing and the reference documentation for the assert module for more details on this. jpm test
accepts the following options: -b --binary binary use the version of firefox specified in binary. binary may be specified as a full path or as a path relative to the current directory. jpm test -b /path/to/firefox/nightly see selecting a browser version. --binary-args cmdargs pass extra arguments to firefox. for example, to pass the -jsconsole argume...
...And 4 more matches
Dialogs and Prompts - Archive of obsolete content
indow>) as root element in the xul file. this will: handle a few keyboard events (enter/esc and more), which is good for keyboard accessibility. add ok and cancel buttons in an order that is consistent with os default (but the button set and layout is highly customizable, see below). ...
... layout is highly customizable, see below). simple dialog code the following xul code defines a simple dialog with two buttons, ok and cancel (buttons="
accept,cancel" attribute on dialog). <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="..." title="..." buttons="
accept,cancel" ondialog
accept="return on
accept();" ondialogcancel="return oncancel();"> <script src="chrome://..."/> <!-- content --> </dialog> you need to implement on
accept and oncancel functions in your script. if they return anything but false, the dialog will be closed. buttons in <dialog> predefined there are six button types you can use in the buttons attribute of dialog. they are: ac...
...g (by default). for each of these buttons you can set their label, accesskey and oncommand handler by adding buttonlabel<buttonname>, buttonaccesskey<buttonname> and ondialog<buttonname> attributes to the dialog element. for example, to add an apply button to your dialog, use the following code: <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="..." buttons="
accept,cancel,extra1" ondialog
accept="on
accept();" ondialogextra1="onapply();" buttonlabelextra1="apply" buttonaccesskeyextra1="a"> <!-- content --> </dialog> you can even get the element object for any of predefined buttons with gdialog.getbutton(dlgtype);, where gdialog is the <dialog> element and dlgtype is one of the six button types listed above. explicit if you are not satisfied with ...
...And 4 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
and other dialogs. buttons used in dialog windows a dialog element will display some number of buttons at its bottom. as shown in table 1, there are four types of buttons that can be displayed, and you can set the names of the buttons you want to display as a comma-delimited list in the value of the buttons attribute. fixme: make the table cleaner button name description
accept the ok button. cancel the cancel button. help the help button. disclosure either a disclosure triangle or a button. this is used to allow the user to toggle the display of additional information. table 1: types of buttons that can be displayed in the dialog element additionally, there are two special button names, extra1 and extra2. the labels for t...
...ere are two special button names, extra1 and extra2. the labels for these buttons are set using the buttonlabelextra1 and buttonlabelextra2 attributes on the root element, which take arbitrary strings as their values. the action taken when pressing one of these buttons is defined by an event handler with the name ondialog<button name>. ...
... name>. if these event handlers are not defined, pressing either the
accept button or cancel button will simply close that dialog. listing 8 shows a simple dialog example, and figure 5 shows its output. ...
...And 4 more matches
Introduction to cross browser testing - Learn web development
for testing, identifying, and fixing problems?" prerequisites: familiarity with the core html, css, and javascript languages. objective: to gain an understanding of the high-level concepts involved in cross browser testing. what is cross browser testing? cross browser testing is the practice of making sure that the web sites and web apps you create work across an
acceptable number of web browsers. as a web developer, it is your responsibility to make sure that not only do your projects work, but they work for all your users, no matter what browser, device, or additional assistive tools they are using. you need to think about: different browsers other than the one or two that you use regularly on your devices, including slightly older browsers that some people...
...ur users — there's a whole lot of testing to be done! note: make the web work for everyone provides more useful perspective on the different browsers people use, their market share, and related cross browser compatibility issues. we should explain a few bits of terminology here. to start with, when we talk about sites "working cross browser", we are really saying that they should provide an
acceptable user experience across different browsers. it is potentially ok for a site to not deliver the exact same experience on all browsers, as long as the core functionality is accessible in some way. on modern browsers you might get something animated, 3d and shiny, whereas on older browsers you might just get a flat graphic representing the same information. as long as the site owner is happy with...
... you might just get a flat graphic representing the same information. as long as the site owner is happy with this, then you have done your job. on the other hand, it is not ok for a site to work fine for sighted users, but be completely inaccessible for visually impaired users because their screen reader application can't read any of the information stored on it. second, when we say "across an
acceptable number of web browsers", we don't mean 100% of the browsers in the world — this is just about impossible. you can make some informed calls as to what browsers and devices your users will be using (as we'll discuss in the second article in the series — see gotta test 'em all?), but you can't guarantee everything. as a web developer, you need to agree on a range of browsers and devices that...
...And 4 more matches
MediaTrackConstraints - Web APIs
straints dictionary is passed into applyconstraints() to allow a script to establish a set of exact (required) values or ranges and/or preferred values or ranges of values for the track, and the most recently-requested set of custom constraints can be retrieved by calling getconstraints(). for each constraint, you can typically specify an exact value you need, an ideal value you want, a range of
acceptable values, and/or a value which you'd like to be as close to as possible. the specifics vary somewhat depending on the type of the constrainable property. to learn more about how constraints work, see capabilities, constraints, and settings. properties some combination—but not necessarily all—of the following properties will exist on the object. this may be because a given browser doesn't...
...n't support the property, or because it doesn't apply. for example, because rtp doesn't provide some of these values during negotiation of a webrtc connection, a track associated with a rtcpeerconnection will not include certain values, such as facingmode or groupid. ...
... negotiation of a webrtc connection, a track associated with a rtcpeerconnection will not include certain values, such as facingmode or groupid. properties of all media tracks deviceid a constraindomstring object specifying a device id or an array of device ids which are
acceptable and/or required. groupid a constraindomstring object specifying a group id or an array of group ids which are
acceptable and/or required. properties of audio tracks autogaincontrol a constrainboolean object which specifies whether automatic gain control is preferred and/or required. channelcount a constrainlong specifying the channel count or range of channel counts which are
acceptable and/or required. echocancellation a constrainboolean object specifying whether or not echo cancellation is preferred...
...And 4 more matches
CSS values and units - CSS: Cascading Style Sheets
below is an overview of most of these data types. refer to the page for each value type for more detailed information. ...
...r the mdn property page, allowable keywords will be listed in the following form. the following values are the pre-defined keyword values allowed for float. left | right | none | inline-start | inline-end such values are used without quotes: .box { float: left; } css-wide values in addition to the pre-defined keywords that are part of the specification for a property, all css properties
accept the css-wide property values initial, inherit, and unset, which explicitly specify defaulting behaviors. the initial keyword represents the value specified 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 ...
...erit 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. urls a <url> type uses functional notation, which
accepts a <string> that is a url. this may be an absolute url or a relative url. for example, if you wanted to include a background image, you might use either of the following. .box { background-image: url("images/my-background.png"); } .box { background-image: url("https://www.exammple.com/images/my-background.png"); } the parameter for url() can be either quoted or unquoted. if unquoted, it i...
...And 4 more matches
Client hints - MDN Web Docs Glossary: Definitions of Web-related terms
quest header fields for proactive content negotiation allowing clients to indicate a list of device and agent specific preferences. client hints enable automated delivery of optimized assets like the automatic negotiation of image dpr resolution. use of client hints isn't automatic: rather, servers must announce that they support client hints. ...
...r fields for proactive content negotiation allowing clients to indicate a list of device and agent specific preferences. client hints enable automated delivery of optimized assets like the automatic negotiation of image dpr resolution. use of client hints isn't automatic: rather, servers must announce that they support client hints. ...
...ent specific preferences. client hints enable automated delivery of optimized assets like the automatic negotiation of image dpr resolution. use of client hints isn't automatic: rather, servers must announce that they support client hints. servers announce support for client hints using the
accept-ch (
accept client hints) header or an equivalent html meta element with the http-equiv attribute. ...
...And 3 more matches
Client-Server Overview - Learn web development
s in the body): get https://developer.mozilla.org/search?q=client+server+overview&topic=apps&topic=html&topic=css&topic=js&topic=api&topic=webdev http/1.1 host: developer.mozilla.org connection: keep-alive pragma: no-cache cache-control: no-cache upgrade-insecure-requests: 1 user-agent: mozilla/5.0 (windows nt 10.0; wow64) applewebkit/537.36 (khtml, like gecko) chrome/52.0.2743.116 safari/537.36
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 referer: https://developer.mozilla.org/
accept-encoding: gzip, deflate, sdch, br
accept-charset: iso-8859-1,utf-8;q=0.7,*;q=0.7
accept-language: en-us,en;q=0.8,es;q=0.6 cookie: sessionid=6ynxs23n521lu21b1t136rhbv7ezngie; csrftoken=zipujsazv6pcgcbjscj1zu6pqzbfmuat; dwf_section_edit=false; dwf_sg_task_completion=false; _gat...
...ne contains information about the client-side cookies — you can see in this case the cookie includes an id for managing sessions (cookie: sessionid=6ynxs23n521lu21b1t136rhbv7ezngie; ...). the remaining lines contain information about the browser used and the sort of responses it can handle. for example, you can see here that: my browser (user-agent) is mozilla firefox (mozilla/5.0). it can
accept gzip compressed information (
accept-encoding: gzip). it can
accept the specified set of characters (
accept-charset: iso-8859-1,utf-8;q=0.7,*;q=0.7) and languages (
accept-language: de,en;q=0.7,en-us;q=0.3). the referer line indicates the address of the web page that contained the link to this resource (i.e. the origin of the request, https://developer.mozilla.org/). http requests can also have...
...s text/html formatted (content-type). we can also see that it uses the utf-8 character set (content-type: text/html; charset=utf-8). the head also tells us how big it is (content-length: 41823). at the end of the message we see the body content — which contains the actual html returned by the request. ...
...And 3 more matches
Cookies Preferences in Mozilla
these preferences apply to most mozilla products (including firefox and seamonkey), however they are application-specific, so not all of them may apply to you. the default values given are for firefox 3. ...
... these preferences apply to most mozilla products (including firefox and seamonkey), however they are application-specific, so not all of them may apply to you. the default values given are for firefox 3. ...
... network.cookie.cookiebehavior default value: 0 0 =
accept all cookies by default 1 = only
accept from the originating site (block third party cookies) 2 = block all cookies by default 3 = use p3p settings (note: this is only applicable to older mozilla suite and seamonkey versions.) 4 = storage access policy: block cookies from trackers network.cookie.lifetimepolicy default value: 0 0 =
accept cookies normally 1 = prompt for each cookie (prompting was removed in firefox 44) 2 =
accept for current session only 3 =
accept for n days network.cookie.lifetime.days default value: 90 only used if network.cookie.lifetimepolicy is set to 3 sets the number of days that the lifetime of cookies should be limited to. ...
...And 3 more matches
Localization content best practices
izers. dtd files <!-- localization note (entity name): {{privacy}} will be replaced at run-time by an active link. the string 'privacy-link' will be used as text for this link. --> properties files # localization note(privacy-text): {{privacy}} will be replaced at run-time by an # active link. the string 'privacy-link' will be used as text for this link. privacy-text = by proceeding you
accept the {{privacy}}. privacy-link = privacy terms file-wide comments should use the same format, they should be at the top of the file (after the license header) and just drop the (entity name/key) reference. land good quality strings don't land temporary strings. if you already know that your strings are temporary, they shouldn't be exposed to the localization process. this would waste everybo...
... the order of variables if fixed, which is actually not. # localization note(generalsiteidentity): %1$s is the owner of the current website, # %2$s is the name of the certification authority signing the certificate. generalsiteidentity=this website is owned by %1$s\nthis has been verified by %2$s avoid concatenations, use placeholders instead consider this string: tos-text = by proceeding you
accept the tos-link = terms of services most developers would consider this a good solution and display the concatenation of tos-text+tos-link, with an active link on the second part. unfortunately, this won't work at all: you need at least a third string to place after the link, without that some languages won't be able to create a natural sounding sentence. a much more flexible solution would be:...
...tunately, this won't work at all: you need at least a third string to place after the link, without that some languages won't be able to create a natural sounding sentence. a much more flexible solution would be: # localization note(tos-text): {{link}} will be replaced at run-time # by an active link. string with id 'tos-link' will be used as text # for this link. ...
...And 3 more matches
PRIOMethods
the table of i/o methods used in a file descriptor. ...
...ble of i/o methods used in a file descriptor. ...
... close close file and destroy descriptor. read read up to the specified number of bytes into buffer. write write specifi...
...And 3 more matches
Index
ll reference automated testing, developing mozilla, javascript, javascript:tools, tools, xpcom:language bindings, xpconnect the command-line syntax for xpcshell is: 70 xpcshell test manifest expressions qa, testing xpcshell unit tests are run by specifying them in a manifest file. you can add conditions to tests in order to control when tests get run. the conditions
accept a simple boolean expression syntax, described here. 71 monitoring http activity http gecko includes the nsihttpactivityobserver interface, which you can implement in your code to monitor http transactions in real time, receiving a callback as the transactions take place. 72 observer notifications xpcom, xpcom:add-ons the following are topics that you can ...
...iptable, xpcom, xpcom api reference, xpcom interface reference an optional interface for accessing the http or javascript cookie object. 449 nsicookie2 cookies, interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference the nsicookie2 interface provides information about a cookie, and extends the nsicookie interface. ...
... 456 nsicookieservice cookies, interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference see nsicookiemanager and nsicookiemanager2 for methods to manipulate the cookie database directly. this separation of interface is mainly historical. 457 nsicookiestorage cookies, interfaces, xpcom, xpcom api reference, xpcom interf...
...And 3 more matches
HTML documentation index - HTML: Hypertext Markup Language
automatically converted to followable links. 36 html attribute reference attribute, attributes, beginner, configuring, element attributes, elements, html, reference, settings, web elements in html have attributes; these are additional values that configure the elements or adjust their behavior in various ways to meet the criteria the users want. 37 html attribute:
accept accept, attribute, file, input, reference the
accept attribute takes as its value a comma-separated list of one or more file types, or unique file type specifiers, describing which file types to allow. 38 html attribute: capture api, attribute, attributes, capture, constraint validation, html the capture attribute specifies that, optionally, a new file should be ca...
...e a comma-separated list of one or more file types, or unique file type specifiers, describing which file types to allow. 38 html attribute: capture api, attribute, attributes, capture, constraint validation, html the capture attribute specifies that, optionally, a new file should be captured, and which device should be used to capture that new media of a type defined by the
accept attribute. values include user and environment. 39 html attribute: crossorigin advanced, attribute, cors, html, needscontent, reference, security the crossorigin attribute, valid on the <audio>, <img>, <link>, <script>, and <video> elements, provides support for cors, defining how the element handles crossorigin requests, thereby enabling the configuration of the cors reques...
...ovides support for cors, defining how the element handles crossorigin requests, thereby enabling the configuration of the cors requests for the element's fetched data. depending on the element, the attribute can be a cors settings attribute. 40 html attribute: max attribute, attributes, constraint validation, html, reference the max attribute defines the maximum value that is
acceptable and valid for the input containing the attribute. if the value of the element is greater than this, the element fails constraint validation. this value must be greater than or equal to the value of the min attribute. if the max attribute is present by is not specified or is invalid, no max value is applied. if the max attribute is valid and a non-empty value is greater than the maximum allowe...
...And 3 more matches
DPR - HTTP
he dpr header is a client hints headers which represents the client device pixel ratio (dpr), which is the the number of physical device pixels corresponding to every css pixel. header type request header forbidden header name ? note: client hints are accessible only on secure origins (via tls). ...
...is a client hints headers which represents the client device pixel ratio (dpr), which is the the number of physical device pixels corresponding to every css pixel. header type request header forbidden header name ? note: client hints are accessible only on secure origins (via tls). ...
... pixel. header type request header forbidden header name ? note: client hints are accessible only on secure origins (via tls). server has to opt in to receive dpr header from the client by sending
accept-ch and
accept-ch-lifetime response headers. ...
...And 3 more matches
HTTP headers - HTTP
ation-specific header that may have various effects anywhere along the request-response chain. used for backwards compatibility with http/1.0 caches where the cache-control header is not yet present. warning general warning information about possible problems. client hints http client hints are a work in progress. actual documentation can be found on the website of the http working group.
accept-ch servers can advertise support for client hints using the
accept-ch header field or an equivalent html <meta> element with http-equiv attribute ([html5]).
accept-ch-lifetime servers can ask the client to remember the set of client hints that the server supports for a specified period of time, to enable delivery of client hints on subsequent requests to the server’s origin ([rfc6454]). ...
...isting documents. vary determines how to match request headers to decide whether a cached response can be used rather than requesting a fresh one from the origin server. connection management connection controls whether the network connection stays open after the current transaction finishes. keep-alive controls how long a persistent connection should stay open. content negotiation
accept informs the server about the types of data that can be sent back.
accept-charset which character encodings the client understands.
accept-encoding the encoding algorithm, usually a compression algorithm, that can be used on the resource sent back.
accept-language informs the server about the human language the server is expected to send back. this is a hint and is not necessarily under the...
...otocol peers to identify the application type, operating system, software vendor or software version of the requesting software user agent. see also the firefox user agent string reference. response context allow lists the set of http request methods supported by a resource. server contains information about the software used by the origin server to handle the request. range requests
accept-ranges indicates if the server supports range requests, and if so in which unit the range can be expressed. range indicates the part of a document that the server should return. if-range creates a conditional range request that is only fulfilled if the given etag or date matches the remote resource. used to prevent downloading two ranges from incompatible version of the resource. content-ra...
...And 3 more matches
Promises - Archive of obsolete content
re some example promise-based wrappers for common callback-based asynchronous apis. ...
... return addon; return { __proto__: addon, getdatadirectory: function getdatadirectory() { return new promise((
accept, reject) => { return addon.getdatadirectory((directory, error) => { if (error) reject(error); else
accept(directory); }); }); }, }; }, getinstallforurl: function getinstallforurl(url, mimetype, hash, name, iconurl, version, loadgroup) { return new promise(
accept => this.addonmanager.getinstallforurl(url,
accept, mimetype, hash, ...
...(url, mimetype, hash, name, iconurl, version, loadgroup) { return new promise(
accept => this.addonmanager.getinstallforurl(url,
accept, mimetype, hash, iconurl, version, loadgroup)); }, getinstallforfile: function getinstallforfile(url, mimetype) { return new promise(
accept => this.addonmanager.getinstallforfile(url,
accept, mimetype)); }, getallinstalls: function getallinstalls() { return new promise(
accept => this.addonmanager.getallinstalls(
accept)); }, _replacemethod: function replacemethod(method, callback) { object.defineproperty(this, method, { enumerable: true, configurable: true, value: k...
...And 2 more matches
Index - Archive of obsolete content
e, xul reference no summary! 30 browser.type xul attributes, xul reference type: one of the values below.the type of browser, which can be used to set access of the document loaded inside the browser. ...
...attributes, xul reference no summary! 37 buttonaccesskeyextra2 xul attributes, xul reference no summary! 38 buttonaccesskeyhelp xul attributes, xul reference no summary! 39 buttonalign xul attributes, xul reference no summary! 40 buttondir xul attributes, xul reference no summary! 41 buttondisabled
accept xul attributes, xul reference no summary! 42 buttonlabel
accept xul attributes, xul reference no summary! 43 buttonlabelcancel xul attributes, xul reference no summary! 44 buttonlabeldisclosure xul attributes, xul reference no summary! 45 buttonlabelextra1 xul attributes, xul reference no summary! ...
...a change event is fired in different ways for different xul input elements as liste...
...And 2 more matches
Dialogs in XULRunner - Archive of obsolete content
as the container for the dialog. dialog xul files can have dtd, css, and javascript, just like windows. ...
...dialog xul files can have dtd, css, and javascript, just like windows. ...
...cript, just like windows. ...
...And 2 more matches
Tamarin Tracing Build Documentation - Archive of obsolete content
tamarin source versions the following instructions are for obtaining and building the tamarin tracing source code. ...
... tamarin source versions the following instructions are for obtaining and building the tamarin tracing source code. ...
...for obtaining and building the tamarin tracing source code. ...
...And 2 more matches
CSS values and units - Learn web development
but the second 40% box is now 40% of 400px — a lot narrower than the first one! try changing the width of the wrapper or the percentage value to see how this works. the next example has font sizes set in percentages. each <li> has a font-size of 80%, therefore the nested list items become progressively smaller as they inherit their sizing from their parent. note that, while many values
accept a length or a percentage, there are some that only
accept length. you can see which values are
accepted on the mdn property reference pages. if the allowed value includes <length-percentage> then you can use a length or a percentage. if the allowed value only includes <length>, it is not possible to use a percentage. numbers some values
accept numbers, without any unit added to them. an example...
... in the below example, try changing the value of opacity to various decimal values between 0 and 1 and see how the box and its contents become more or less opaque. ...
...owed value includes <length-percentage> then you can use a length or a percentage. if the allowed value only includes <length>, it is not possible to use a percentage. numbers some values
accept numbers, without any unit added to them. an example of a property which
accepts a unitless number is the opacity property, which controls the opacity of an element (how transparent it is). this property
accepts a number between 0 (fully transparent) and 1 (fully opaque). in the below example, try changing the value of opacity to various decimal values between 0 and 1 and see how the box and its contents become more or less opaque. note: when you use a number in css as a value it should not be surrounded in quotes. color there are many ways to specify color in css, some of which are more recent...
...And 2 more matches
Basic native form controls - Learn web development
s button"> buttons always behave the same whether you use a <button> element or an <input> element. as you can see from the examples, however, <button> elements let you use html in their content, which is inserted between the opening and closing <button> tags. <input> elements on the other hand are empty elements; their displayed content is inserted inside the value attribute, and therefore only
accepts plain text as content. the following examples show default, focused, and disabled button input types — in firefox 71 and safari 13 on macos and chrome 79 and edge 18 on windows 10. image button the image button control is rendered exactly like an <img> element, except that when the user clicks on it, it behaves like a submit button. an image button is created using an <input> element wit...
...er 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). the file picker widget can be used to choose one or more files to send. to create a file picker widget, you use the <input> element with its type attribute set to file. ...
...t 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). the file picker widget can be used to choose one or more files to send. to create a file picker widget, you use the <input> element with its type attribute set to file. the types of files that are
accepted can be constrained using the
accept attribute. ...
...And 2 more matches
Using Fetch - Web APIs
mixin, which is implemented by both the request and response objects.) note: the body mixin also has similar methods to extract other types of body content; see the body section for more. fetch requests are controlled by the 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-c...
... fetch('https://example.com', { credentials:...
... fetch('https://example.com', { credentials: 'includ...
...And 2 more matches
Using files from web applications - Web APIs
file input elements using the click() method you can hide the admittedly ugly file <input> element and present your own interface for opening the file picker and displaying which file or files the user has selected. you can do this by styling the input element with display:none and calling the click() method on the <input> element. ...
...n file input element to allow opening the file picker without using javascript (the click() method), a <label> element can be used. note that in this case the input element must not be hidden using display: none (nor visibility: hidden), otherwise the label would not be keyboard-accessible. use the visually-hidden technique instead. ...
...f the hidden input field on its label, be it an outline as shown above, or background-color or box-shadow. (as of time of writing, firefox doesn’t show this visual cue for <input type="file"> elements.) selecting files using drag and drop you can also let the user drag and drop files into your web application. the first step is to establish a drop zone. ...
...And 2 more matches
Capabilities, constraints, and settings - Web APIs
eated as non-required. the user agent will try to provide what you request but will not guarantee that what you get will match. however, if you use simple values for properties when calling mediastreamtrack.applyconstraints(), the request will always succeed, because these values will be considered a request, not a requirement. specifying a range of values sometimes, any value within a range is
acceptable for a property's value. you can specify ranges with either or both minimum and maximum values, and you can even specify an ideal value within the range, if you choose. if you provide an ideal value, the browser will try to get as close as possible to matching that value, given the other constraints specified. let supports = navigator.mediadevices.getsupportedconstraints(); if (!supports["wi...
...that the constrainable properties for which matches must be found are supported (width, height, framerate, and facingmode), we set up constraints which request a width no smaller than 640 and no larger than 1920 (but preferably 1920), a height no smaller than 400 (but ideally 1080), an aspect ratio of 16:9 (1.777777778), and a frame rate no greater than 30 frames per second. in addition, the only
acceptable input device is a camera facing the user (a "selfie cam"). if the width, height, framerate, or facingmode constraints can't be met, the promise returned by applyconstraints() will be rejected. constraints which are specified using any or all of max, min, or exact are always treated as mandatory. if any constraint which uses one or more of those can't be met when calling applyconstraints(), ...
...es for this feature, and there is some interest in removing it from the specification, so it will not be discussed here. if you wish to learn more, see section 11 of the media capture and streams specification, past example 2. checking capabilities you can call mediastreamtrack.getcapabilities() to get a list of all of the supported capabilities and the values or ranges of values which each one
accepts on the current platform and user agent. this function returns a mediatrackcapabilities object which lists each constrainable property supported by the browser and a value or range of values which are supported for each one of those properties. note: getcapabilities() hasn't been implemented yet by all major browsers. for the time being, you'll have to try to get what you need, and if you can't...
...And 2 more matches
<input type="number"> - HTML: Hypertext Markup Language
ue attribute, like so: <input id="number" type="number" value="42"> additional attributes in addition to the attributes commonly supported by all <input> types, inputs of type number support these attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options max the maximum value to
accept for this input min the minimum value to
accept for this input placeholder an example value to display inside the field when it's empty readonly a boolean attribute indicating whether the value is read-only step a stepping interval to use when using up and down arrows to adjust the value, as well as for validation list the values of the list ...
... <datalist> element located in the same document. the <datalist> provides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. max the maximum value to
accept for this input. if the value entered into the element exceeds this, the element fails constraint validation. if the value of the max attribute isn't a number, then the element has no maximum value. this value must be greater than or equal to the value of the min attribute. min the minimum value to
accept for this input. if the value of the element is less than this, the element fails constrain...
...er input can be implemented like this: <label for="ticketnum">number of tickets you would like to buy:</label> <input id="ticketnum" type="number" name="ticketnum" value="0"> a number input is considered valid when empty and when a single number is entered, but is otherwise invalid. if the required attribute is used, the input is no longer considered valid when empty. note: any number is an
acceptable value, as long as it is a valid floating point number (that is, not nan or infinity). placeholders sometimes it's helpful to offer an in-context hint as to what form the input data should take. this can be especially important if the page design doesn't offer descriptive labels for each <input>. this is where placeholders come in. a placeholder is a value most commonly used to provide a hi...
...And 2 more matches
cfx - Archive of obsolete content
cfx usage is: cfx [options] command [command-specific options] "options" are global options applicable to the tool itself or to all commands (for example --help). cfx supports the following global options: -h, --help - show a help message and exit -v, --verbose - enable lots of output "command-specific options" are documented alongside the commands. ...
...he current directory. internal options --keydir=keydir supply a different location for signing keys. keydir may be specified as a full path or as a path relative to the current directory. internal commands cfx testcfx this will run a number of tests on the cfx tool, including tests against the documentation. use cfx testcfx -v for the specific list of tests. ...
...may be specified as a full path or as a path relative to the current directory. internal commands cfx testcfx this will run a number of tests on the cfx tool, including tests against the documentation. use cfx testcfx -v for the specific list of tests. this
accepts the same options as cfx test. cfx testaddons this will run a number of test add-ons that are packaged with the sdk. this
accepts the same options as cfx test. cfx testpkgs this will test all of the available commonjs packages. note that the number of tests run and their success depends on what application they are run with, and which binary is used. this
accepts the same options as cfx test. cfx testex this will test all available example code. note that the number of tests run and their success depends on what appli...
...est all of the available commonjs packages. note that the number of tests run and their success depends on what application they are run with, and which binary is used. this
accepts the same options as cfx test. cfx testex this will test all available example code. note that the number of tests run and their success depends on what application they are run with, and which binary is used. this
accepts the same options as cfx test. cfx testall this will test everything: the cfx tool, all available commonjs packages, and all examples. this
accepts the same options as cfx test. using --profiledir by default, cfx run and cfx test use a new profile each time they are executed. this means that any profile-specific data entered from one run of cfx will not, by default, be available in the next ...
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
the frozen string api is similar but not identical to the nonfrozen string api. the frozen string api does not have (or need) nsxpidlstring: - nsxpidlstring value; + nsstring value; ptr->gettermethod(getter_copies(value)); - const prunichar *strvalue = value; + // nsstring doesn't cast directly to prunichar*, use .get()+ const prunichar *strvalue = value.get(); the frozen string api doesn't
accept a length for .truncate(). use .setlength() instead: nsstring mystring = somestring; - mystring.truncate(4); + mystring.setlength(4); the frozen string api doesn't support the iterator or const_iterator classes, but you can use pointers the same way: nsstring mystring = somestring; - nsstring::const_iterator begin, end;- mystring.beginreading(begin); mystring.endreading(end); + const prunicha...
...ccess to appendutf16toutf8 kind of functions. all these functions are now available via the new string api - appendutf16toutf8(srcstring, deststring); + deststring.append(ns_convertutf16toutf8(srcstring)); the signatures of the find methods differ between the two apis. if you are only finding a single character, prefer the findchar method. the (lossy)copy(ascii|utf8|16)to(ascii|utf8|16) do not
accept character pointer parameters. you must explicitly wrap them in an appropriate dependent string. you cannot make a dependent string from an abstract string. nor can you use nspromiseflat(c)string. you probably meant to use promiseflat(c)string instead. note that you don't need to promise a flat string if you already have an ns(c)(auto)string type, since they are already flat. you cannot mix string...
... the internal and external apis. these enhancements make it easier to write code that will transparently compile using either api. the list of enhancements fall in to three categories. changes to internal apis to make them compatible with the external api. #define caseinsensitivecompare pr_true this allows you to use caseinsensitivecompare as the parameter to various string methods that normally
accept pr_true under the internal api. #define tointeger(prv, radix) tointeger(reinterpret_cast<print32*>(prv), radix) this allows you to pass a pointer to an nsresult to the tointeger method, when it normally
accepts a print32. note that you must pass the radix (normally 10). changes to external apis to make them compatible with the internal api. #define nscaseinsensitivecstringcomparator() caseinsen...
...#define knotfound -1 this convenience constant is not defined under the external api. #define appendascii(str) appendliteral(str) the internal api distinguishes between literals (which must be character constants) and ascii strings. ...
User Notifications and Alerts - Archive of obsolete content
notification shows up again when you come back to the tab that displayed it. this means that these notifications make the most sense when they are related to the page currently being displayed, such as a page trying to install an add-on, or a site you just entered a password on. ...
...the page currently being displayed, such as a page trying to install an add-on, or a site you just entered a password on. notification boxes are very easy to create, and are very customizable: let nb = gbrowser.getnotificationbox(); let
acceptbutton = new object(); let declinebutton = new object(); let message = this._bundle.getstring("xulschoolhello.friendmessage.label"); let that = this;
acceptbutton.label = this._bundle.getstring("xulschoolhello.
acceptbutton.label");
acceptbutton.accesskey = this._bundle.getstring("xulschoolhello.
acceptbutton.accesskey");
acceptbutton.popup = null;
acceptbutton.callback = function() { that.
acceptrequest(); }; // similarly for decline button. nb.appendnotification( message, "xulschoolhello-friend-notification", "chrome://xulschoolhello/skin/frie...
...the notificationbox elements can be obtained from the gbrowser object. in this case we don't pass any arguments to getnotificationbox so that we get the notification box that corresponds to the tab currently on display. ...
...rmation the user needs to know and can't get in any other way. custom alerts creating custom solutions for alerting the user is not complicated, given the advantages of xul overlays and css positioning. however, these solutions are prone to be buggy and have accessibility issues. you should use the 2 alternatives mentioned above whenever possible. if none of those fit your needs then this is an
acceptable solution. an easy way to display alerts is to include a hidden box in your overlay, which you can fill with any content you need before removing the hidden attribute so that it is displayed to the user. the best locations for this kind of box are above and below the tab browser. below is preferrable because it only cuts the bottom part of the current page, as opposed to pushing down all tabs...
Tamarin build documentation - Archive of obsolete content
$ cd tamarin-central $ echo 'print("hello, world")' > hello.as $ java -jar ./utils/asc.jar -import ./core/builtin.abc hello.as hello.abc, 86 bytes written use the avmplus standalone executable (avmshell) built previously to run the application: $ avmshell hello.abc hello, world use the -help options of asc.jar and avmshell for more details. running tamarin tests see running tamarin
acceptance tests and running tamarin performance tests building tamarin windows mobile utilities the tamarin windows mobile utilities allows the existing
acceptance and performance testsuites to be run on a windows mobile device connected to a windows desktop machine by activesync or windows mobile device center (for windows vista and windows 7). setup and run activesync or windows mobile device ...
... tamarin buildbot tryserver the tryserver/sandbox is setup to allow users to push any code changes that they would like to have tested in the automated build/test proces...
... tamarin buildbot tryserver the tryserver/sandbox is setup to allow users to push any code changes that they would like to have tested in the automated build/test process prior to actually pushing the changes. the sandbox is setup so tha...
...t a build via the form at http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm user email: your email address. an email with the build status will be sent to this address when a builder completes whether it is passes or fails. mercurial repository: give the location of the repository that will be used for the build. note: only repositories hosted on http://hg.mozilla.org/ are
accepted. revision: specify the revision number that will be built. currently this only
accepts the change number and not the hash. branch: which branch of tamarin the repository is based on, tamarin-central or tamarin-tracing. description: self explanatory check the status of the build @ http://tamarin-builds.mozilla.org/tamarin-redux/ , you can also see your build request in the queue a...
Tamarin Build System Documentation - Archive of obsolete content
test suite (including performance). the smoke test list is constantly updated to contain the most recent failures, most frequent failures, and the newest testcases. the idea is to catch test failures in a few minutes rather than running the complete test run (1h 45m). the smoke test including downloading the shell takes about 3-4 minutes. the test phase runs all functional testcases including
acceptance tests, cmdline tests, and selftests. the
acceptance tests are the majority and are run on all shells (release, release-debugger, debug, debug-debugger). the test phase takes approximately 1 hour 45 minutes. the performance and deep phases do not run synchronously. the phases run when slaves are available and the other phases do not wait for completion to start the next build. how are bui...
...new scripts directory: cp -r mac-intel-10_5/scripts . ; cd scripts edit environment.sh, change the basedir and buildsdir settings (around line 51) basedir=~/hg/tamarin-redux (path to my test repository) (next line) buildsdir=~/hg/builds (a directory to store downloaded builds) always set current working directory to the scripts directory when running a script run a script (e.g.) ../all/run-
acceptance-release.sh <optional hg revision number like 1902> how do i navigate the build status page? the page is divided into the phase table at the top and the waterfall table below the phase table shows all phases at the top of the page, each slave is shown as a box with a red,green, or yellow color: red means failed, green passed, and yellow has warnings. the phase state is idle or active clic...
... expectedfail or skip expectedfail means the test is run and the assertion is the test ...
... expectedfail or skip expectedfail means the test is run and the assertion is the test fails, if the test passes and is marked expectedfail t...
Introduction to SSL - Archive of obsolete content
the ssl protocol ciphers used with ssl the ssl handshake the new internet engineering task force (ietf) standard protocol called transport layer security (tls) is based on ssl. the details of the protocol are available in request for comments (rfc): 2246,the tls protocol version 1.0. some red hat products already support tls. most other red hat products plan to support the protocol in future versions. ...
...ssl protocol supports the use of a variety of different cryptographic algorithms, or ciphers, for use in operations such as authenticating the server and client to each other, transmitting certificates, and establishing session keys. clients and servers may support different cipher suites, or sets of ciphers, depending on factors such as the version of ssl they support, company policies regarding
acceptable encryption strength, and government restrictions on export of ssl-enabled software. among its other functions, the ssl handshake protocol determines how the server and client negotiate which cipher suites they will use to authenticate each other, to transmit certificates, and to establish session keys. key-exchange algorithms like kea and rsa key exchange govern the way in which the server a...
...tside of that range, the authentication process won't go any further. if the current date and time are within the certificate's validity period, the client goes on to step. is the issuing ca a trusted ca? each ssl-enabled client maintains a list of trusted ca certificates, represented by the shaded area on the right side of figure 3. this list determines which server certificates the client will
accept. if the distinguished name (dn) of the issuing ca matches the dn of a ca on the client's list of trusted cas, the answer to this question is yes, and the client goes on to step 3. if the issuing ca is not on the list, the server will not be authenticated unless the client can verify a certificate chain ending in a ca that is on the list. does the issuing ca's public key validate the issuer's dig...
...re outside of that range, the authentication process won't go any further. if the current date and time are within the certificate's validity period, the server goes on to step 3. is the issuing ca a trusted ca? each ssl-enabled server maintains a list of trusted ca certificates, represented by the shaded area on the right side of figure 3. this list determines which certificates the server will
accept. if the dn of the issuing ca matches the dn of a ca on the server's list of trusted cas, the answer to this question is yes, and the server goes on to step 4. if the issuing ca is not on the list, the client will not be authenticated unless the server can verify a certificate chain ending in a ca that is on the list. administrators can control which certificates are trusted or not trusted within ...
Writing JavaScript for XHTML - Archive of obsolete content
ngs which can then be converted into e4x. finally: content negotiation now, how do we decide, when to serve xhtml as xml? we can do this on server side by evaluating the http request header. every browser sends with its request a list of mime types it understands, as part of the http content negotiation mechanism. ...
...rowser sends with its request a list of mime types it understands, as part of the http content negotiation mechanism. so if the browser tells our server, that it can handle xhtml as xml, that is, the
accept: field in the http head contains application/xhtml+xml somewhere, we are safe to send the content as xml. in php, for example, you would write something like this: if( strpos( $_server['http_
accept'], "application/xhtml+xml" ) ) { header( "content-type: application/xhtml+xml" ); echo '<?xml version="1.0" ?>'."\n"; } else { header( "content-type: text/html" ); } this distinction also sends the xml declaration, which is strongly recommended, when the document is an xml file. if the content is sent as html, an xml declaration would break ie's doctype switch, so we don't want it there. ...
...) { header( "content-type: application/xhtml+xml" ); echo '<?xml version="1.0" ?>'."\n"; } else { header( "content-type: text/html" ); } this distinction also sends the xml declaration, which is strongly recommended, when the document is an xml file. if the content is sent as html, an xml declaration would break ie's doctype switch, so we don't want it there. ...
... '<?xml version="1.0" ?>'."\n"; } else { header( "content-type: text/html" ); } this distinction also sends the xml declaration, which is strongly recommended, when the document is an xml file. if the content is sent as html, an xml declaration would break ie's doctype switch, so we don't want it there. ...
Request header - MDN Web Docs Glossary: Definitions of Web-related terms
not all headers appearing in a request are request headers. for example, the content-length appearing in a post request is actually an entity header referring to the size of the body of the request message. however, these entity headers are often called request headers in such a context. ...
...uch a context. in addition, cors defines a subset of request headers as simple headers, request headers that are always considered authorized and are not explicitly listed in responses to preflight requests. ...
... simple headers, request headers that are always considered authorized and are not explicitly listed in responses to preflight requests. ...
... that are always considered authorized and are not explicitly listed in responses to preflight requests. ...
Application Translation with Mercurial
save the file and close it. enabling mercurial queues (revertable patches) some time will pass between the moment in which you start the localization, finish it, test it, improve it, upload it for review and get review (maybe not approved on first try). other localizers will likely have done changes to the translation, either adding new texts, removing obsolete ones or improving...
...s still able to find the lines in the files which it has to replace or where it has to add them. mercurial queues allow to revert changes and also pull changes and reapply your local changes. go back to the localization directory: cd /c/mozilla/de-mozilla-aurora initiate mercurial queues: hg qinit get to know the translation style for having good chances that the translation suggestions get
accepted, they should match the translation style of the texts in the application already translated. in general, the labels in the applications should have the same style like the operating system, e.g. use the same order of subject, verb and objects; decline verbs or not like the operating system does. the following resources can help figuring out the translation style and translate according to them...
...ee above): hg qexport > ../firefox-29-aboutprivatebrowsing-v1.patch this creates a patch file called firefox-29-aboutprivatebrowsing-v1.patch containing the changes in the parent directory of de-mozilla-aurora (in this example: c:\mozilla\). proof-reading and altering the patch now proof-read the patch. this detects often more than 90 percent of the possible reasons for the reviewer to not
accept the patch. if you find that changes have to be done, edit the real aboutprivatebrowsing.dtd file from the localization repository, save it and follow the steps from exporting the changes as patch (see above). validating the translation in the product this guide hasn't yet a section about the validation of the translation. please follow the instructions from the qa phase section of the localizat...
...e. this information can be found on the page of the localization team. submit the bug report. now you have to wait for the review of that person. this can happen on the same day, on the next weekend or later, but should happen in the timeframe given for the localization of aurora. if the person requests changes, follow the instructions under proof-reading and altering the patch. if the reviewer
accepts the changes, the patch will get uploaded and your translation will officially be added to firefox. ...
Creating localizable web applications
d use variables in the english strings. write semantic code (e.g. don't use text and <img/> for decorations; instead, use css). document your code so that localizers know what they're translating (e.g. in gettext use comments and contexts). app logic detect the locale correctly be smart about detecting the user's locale correctly. you can use one or more of the following techniques: http
accept-language headers, the ua string, ip geolocation. see examples 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 remem...
...0\" class=\"get-personas\" id=\"download\"><span>get personas for firefox - free</span>");?><span class="arrow"></span></a> snippet 2. good: <a href="https://addons.mozilla.org/firefox/downloads/latest/10900" class="get-personas" id="download"> <span><?= _("get personas for firefox - free");?></span><span class="arrow"></span> </a> snippet 3. ...
...load\"><span>get personas for firefox - free</span>");?><span class="arrow"></span></a> snippet 2. good: <a href="https://addons.mozilla.org/firefox/downloads/latest/10900" class="get-personas" id="download"> <span><?= _("get personas for firefox - free");?></span><span class="arrow"></span> </a> snippet 3. ...
...irefox - free");?></span><span class="arrow"></span> </a> snippet 3. bad: <p><?= _("<strong class=\"legal\">design
acceptance:</strong> if a design is
accepted, we will send the following message:");?></p> <p><?= _("<strong class=\"legal\">design rejection:</strong> if a design is rejected, we will send the following message:");?></p> snippet 4. good: <p><strong class="legal"><?= _("design
acceptance:");?></strong> <?= _("if a design is
accepted, we will send the following message:");?></p> <p><strong class="legal"><?= _("design rejection:");?></strong> <?= _("if a design is rejected, we will send the following message:");?></p> snippet 5. bad: <p id="breadcrumbs"> <?printf(_("<a href=\"%s\">personas home</a> : <a href=\"%s\">sign in</a> : forgot your password?"), $loca...
NSS 3.33 release notes
is nss_3_33_rtm. nss 3.33 requires netscape portable runtime (nspr) 4.17, or newer. nss 3.33 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_33_rtm/src/ notable changes in nss 3.33 tls compression is no longer supported. api calls that attempt to enable compression are
accepted without failure. however, tls compression will remain disabled. this version of nss uses a formally verified implementation of curve25519 on 64-bit systems. the compile time flag disable_ecc has been removed. when nss is compiled without nss_force_fips=1 startup checks are no longer performed. fixes cve-2017-7805, a potential use-after-free in tls 1.2 server, when verifying client authentic...
...al use-after-free in tls 1.2 server, when verifying client authentication. various minor improvements and correctness fixes. new in nss 3.33 new functionality when listing an nss database, using certutil -l, and the database hasn't yet been initialized with any non-empty or empty password, the text "database needs user init" will be included in the listing. ...
...authentication. various minor improvements and correctness fixes. new in nss 3.33 new functionality when listing an nss database, using certutil -l, and the database hasn't yet been initialized with any non-empty or empty password, the text "database needs user init" will be included in the listing. when using certutil to set an in
acceptable password in fips mode, a correct explanation of
acceptable passwords will be printed. new functions in cert.h cert_findcertbyissuerandsncx - a variation of existing function cert_findcertbyissuerandsn that
accepts an additional password context parameter. cert_findcertbynicknameoremailaddrcx - a variation of existing function cert_findcertbynicknameoremailaddr that
accepts an additional password context parameter. cert_findcertbynic...
... in secport.h nss_securememcmpzero - check if a memory region is all zero in constant time. port_zallocaligned - allocate aligned memory. port_zallocalignedoffset - allocate aligned memory for structs. in ssl.h ssl_getexperimentalapi - access experimental apis in libssl. ...
nsIJSON
); deprecated since gecko 2.0 jsval legacydecodetojsval(in astring str, in jscontext cx); native code only! deprecated since gecko 2.0 methods decode() obsolete since gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) decodes a json string, returning the javascript object it represents. note: this method is more flexible than it should be, and
accepts some not-correctly-structured json. for that reason, it has been removed in gecko 7.0. jsobject decode( in astring str ); parameters str the json string to decode. return value the original javascript object, reconstructed from the json string. decodetojsval() note: this method may only be used from native code, and provides a way to decode a json string to a jsval for use in yo...
...sioutputstream to which to write the json string. charset the string encoding to use. only the five unicode encodings "utf-8", "utf-16le", "utf-16be", "utf-32le" and "utf-32be" are supported. writebom specify true if you wish to write a byte-order mark (bom) into the stream, otherwise specify false. value the javascript object to encode. legacydecode() decodes a json string. this method
accepts slightly more than the exact json syntax; details of extra
accepted syntax are deliberately not described. this method is intended for use only by code processing legacy data. when the original instance requiring this function is removed, this method will be removed. thus, this deprecated method should not be used. jsval legacydecode( in astring str ); parameters str the json stri...
...hen the original instance requiring this function is removed, this method will be removed. thus, this deprecated method should not be used. jsval legacydecode( in astring str ); parameters str the json string to decode. return value the original javascript object, reconstructed from the json string. legacydecodefromstream() decodes a json string, read from a stream. this method
accepts slightly more than the exact json syntax; details of extra
accepted syntax are deliberately not described. this method is intended for use only by code processing legacy data. when the original instance requiring this function is removed, this method will be removed. thus, this deprecated method should not be used. jsval legacydecodefromstream( in nsiinputstream stream, in long conten...
... not be used. jsval legacydecodefromstream( in nsiinputstream stream, in long contentlength ); parameters stream the nsiinputstream from which to read the json string to decode. contentlength the length of the string to decode. return value the original javascript object, reconstructed from the json string. legacydecodetojsval() decodes a json string to a jsval. this method
accepts slightly more than the exact json syntax; details of extra
accepted syntax are deliberately not described. this method is intended for use only by code processing legacy data. when the original instance requiring this function is removed, this method will be removed. thus, this deprecated method should not be used. note: this method may only be used from native code, and provides a way to de...
nsIServerSocket
netwerk/base/public/nsiserversocket.idlscriptable please add a summary to this article. last changed in gecko 1.6 inherits from: nsisupports implemented by: @mozilla.org/network/server-socket;1. ...
... void close(); void asynclisten(in nsiserversocketlistener alistener); prnetaddr getaddress();native code only! attributes attribute type description port long returns the port of this server socket. read only. methods asynclisten() this method puts the server socket in the listening state. it will asynchronously listen for and
accept client connections. the listener will be notified once for each client connection that is
accepted. the listener's onsocket
accepted() method will be called on the same thread that called asynclisten() (the calling thread must have an nsieventtarget). the listener will be passed a reference to an already connected socket transport (nsisockettransport). see nsiserversocketlistener for more details...
... be called on the same thread that called asynclisten() (the calling thread must have an nsieventtarget). the listener will be passed a reference to an already connected socket transport (nsisockettransport). see nsiserversocketlistener for more details. void asynclisten( in nsiserversocketlistener alistener ); parameters alistener the listener to be notified when client connections are
accepted. close() this method closes a server socket. this does not affect already connected client sockets (i.e., the nsisockettransport instances created from this server socket). this will cause the onstoplistening event to asynchronously fire with a status of ns_binding_aborted. void close(); parameters none. native code only!getaddress returns the address to which this server socket is boun...
...h the socket is bound. init() initializes a server socket. void init( in long aport, in boolean aloopbackonly, in long abacklog ); parameters aport the port of the server socket. pass -1 to indicate no preference, and a port will be selected automatically. aloopbackonly if true, the server socket will only respond to connections on the local loopback interface. otherwise, it will
accept connections from any interface. to specify a particular network interface, use initwithaddress(). abacklog the maximum length to which the queue of pending connections may grow. this parameter may be silently limited by the operating system. pass -1 to use the default value. the default value is 5. native code only!initwithaddress this method initializes a server socket and binds it to a par...
Add to iPhoto
ctypes.jschar.ptr, // pointer to the unicode string ctypes.int32_t); // length of the string cfstringcreatewithcharacters() is used to create a new cfstring object using a unicode string as the source string, which is copied into the new cfstring object. 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. cfurl the cfurl type is used to describe a url. it differs from a string in that...
...and mutable versions of the same data types. for example, the cfarray type describes an array, but cfarray objects can't be changed once they've been created. however, obviously there are cases in which you'll want to be able to manipulate the contents of an array by adding and removing items, sorting them, and so forth. that's where the cfmutablearray type comes into play. ...
...s an array, but cfarray objects can't be changed once they've been created. however, obviously there are cases in which you'll want to be able to manipulate the contents of an array by adding and removing items, sorting them, and so forth. that's where the cfmutablearray type comes into play. all cfarray functions
accept cfmutablearray objects, so you can use cfmutablearray with any routine that
accepts a cfarray as input, but cfmutablearray supports additional functions that let you change the contents of the array. there's nothing particularly interesting about how we declare this api, but it will be noteworthy when we look at how we use cfmutablearray objects with methods that
accept a cfarray as input, so i introduce this concept here. carbon the carbon api is the core operating system a...
... an optionbits value providing a bit field of special options. a pointer to an apple event parameter; we aren't using this, so i'm just using a voidptr_t here. a pointer to an lsapplicationparameters structure that describes what application to launch a pointer to the first element of...
Working with data
conversion isn't possible, typeerror is thrown. the resulting data is then copied into a new cdata object. if the original value is already a cdata object, the original object is simply duplicated directly into the new one. if type is an array type of unspecified length, the following steps are taken: if the value is a size value, a new array of that length is created, with its cells ready to
accept values of the same type as those in the specified array. this is the same as new arraytype(type.elementtype, value). if the type represents a javascript string (that is, an array of jschar characters followed by a null terminator), a copy of that string is created and returned. if the type is an array of 8-bit characters and value is a utf-16 string, the new cdata object is the result of conver...
...y want to compare two addresses, you can use type casting: if (ctypes.cast(p, ctypes.uintptr_t).value.tostring() == "5") { // the pointer p's address is 5 } this casts the pointer to a ctypes.uintptr_t, for which the value property returns a ctypes.uint64. calling tostring() on that returns the pointer as a base 10 integer. ...
...types.void_t, ctypes.char.ptr.array() /*same as ctypes.char.ptr.ptr*/); somecfunction(myarray); line 1 declares a new array type, capable of containing 5 arrays of pointers to c characters. this might be an array of strings, for example. the next line instantiates an object of that type, creating a new array. each pointer in the array is initialized to null. line 4 declares the c function that
accepts the array as an input, and the last line calls that function. using arrays of non-pointers if a function expects an argument that is a pointer to a list of elements, this is how it is accomplished: var myarraytype = ctypes.char.array(5); var myarray = myarraytype(); var somecfunction = library.declare("somecfunction", ctypes.default_abi, ctypes.void_t, ctypes.char.array() /*same as ctypes.ch...
...64-bit number into the int64 or uint64 constructor, like this: var num1 = ctypes.int64("400000000000"); var num2 = ctypes.uint64("-0x1234567890abcdef"); as you can see, you can use this technique with both decimal and hexadecimal source strings. creating a 64-bit value using join() the join() method offered by the int64 and uint64 objects provides another way to construct 64-bit integers. it
accepts as its input parameters the high and low 32-bit values and returns a new 64-bit integer. for example: var num = ctypes.int64.join(-0x12345678, 0x90abcdef); performing arithmetic with 64-bit values the int64 and uint64 objects don't provide any methods for performing arithmetic, which means you'll have to do it yourself by pulling out the high and low 32-bit portions and doing math on them, t...
File.getAsBinary() - Web APIs
hod readasbinarystring() or readasarraybuffer() instead. syntax var binary = instanceoffile.getasbinary(); returns a string. ...
... ...
... ...
...
accept = { binary : ["image/png", "image/jpeg"], text : ["text/plain", "text/css", "application/xml", "text/html"] }; var file; for (var i = 0; i < files.length; i++) { file = files[i]; // if file type could be detected if (file !== null) { if (
accept.binary.indexof(file.type) > -1) { // file is a binary, which we
accept var data = file.getasbinary(); } else if (
accept.text.indexof(file.type) > -1) { // file is of type text, which we
accept var data = file.getastext(); // modify data with string methods } } } specification not part of any specification. ...
File.getAsText() - Web APIs
s string is empty, utf-8 is assumed. returns a string containing the file's data interpreted as text in the specified encoding. ...
... ...
... ...
... ...
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
the streams for an rtcpeerconnection are implemented using rtp and the interfaces above, you can take advantage of the access this gives you to the internals of streams to make adjustments. among the simplest things you can do is to implement a "hold" feature, wherein a participant in a call can click a button and turn off their microphone, begin sending music to the other peer instead, and stop
accepting incoming audio. note: this example makes use of modern javascript features including async functions and the await expression. this enormously simplifies and makes far more readable the code dealing with the promises returned by webrtc methods. in the examples below, we'll refer to the peer which is turning "hold" mode on and off as the local peer and the user being placed on hold as the r...
...ously simplifies and makes far more readable the code dealing with the promises returned by webrtc methods. in the examples below, we'll refer to the peer which is turning "hold" mode on and off as the local peer and the user being placed on hold as the remote peer. activating hold mode local peer when the local user decides to enable hold mode, the enablehold() method below is called. it
accepts as input a mediastream containing the audio to play while the call is on hold. async function enablehold(audiostream) { try { await audiotransceiver.sender.replacetrack(audiostream.getaudiotracks()[0]); audiotransceiver.receiver.track.enabled = false; audiotransceiver.direction = "sendonly"; } catch(err) { /* handle the error */ } } the three lines of code within the try ...
...peer. the audiostream, containing the audio to play instead of the local peer's microphone audio, can come from anywhere. one possibility is to have a hidden <audio> element and use htmlaudioelement.capturestream() to get its audio stream. remote peer on the remote peer, when we receive an sdp offer with the directionality set to "sendonly", we handle it using the holdrequested() method, which
accepts as input an sdp offer string. async function holdrequested(offer) { try { await peerconnection.setremotedescription(offer); await audiotransceiver.sender.replacetrack(null); audiotransceiver.direction = "recvonly"; await sendanswer(); } catch(err) { /* handle the error */ } } the steps taken here are: set the remote description to the specified offer by calling rt...
...rr) { /* handle the error */ } } the steps taken here are: set the remote description to the specified offer by calling rtcpeerconnection.setremotedescription(). replace the audio transceiver's rtcrtpsender's track with null, meaning no track. this stops sending audio on the transceiver. set the audio transceiver's direction property to "recvonly", instructing the transceiver to only
accept audio and not to send any. the sdp answer is generated and sent using a method called sendanswer(), which generates the answer using createanswer() then sends the resulting sdp to the other peer over the signaling service. deactivating hold mode local peer when the local user clicks the interface widget to disable hold mode, the disablehold() method is called to begin the process of restorin...
Basic Shapes - CSS: Cascading Style Sheets
css shapes can be defined using the <basic-shape> type, and in this guide i’ll explain how each of the different values
accepted by this type work. they range from simple circles to complex polygons. before looking at the shapes, it is worth understanding two pieces of information that go together to make these shapes possible: the <basic-shape> type the reference box the <basic-shape> type the <basic-shape> type is used as the value for all of our basic shapes. this type uses functional notation: the type of shape is followed by brackets, inside of which are additional values used to describe the shape. the arguments which are
accepted vary depending on the shape that you are creating. we will cover these in the examples below. the reference box understanding the reference box use...
...floated element. change the offset values to see how the shape changes. you can also add the box value that you wish to use as a reference box. in the example below change the reference box from margin-box to border-box, padding-box or content-box to see how the reference box used as the starting point before offsets are calculated changes. circle() the circle() value for shape-outside can
accept two possible arguments. the first is the shape-radius. both circle() and ellipse() values for shape-outside are specified as
accepting this argument of <shape-radius>. this argument can be a length or percentage but can also be one of the keywords closest-side or farthest-side. the keyword closest-side uses the length from the center of the shape to the closest side of the reference box. for ci...
...the length from the center of the shape to the farthest side of the reference box. for circles, this is the farthest side in any dimension. for ellipses, this is the farthest side in the radius dimension. the second argument is a position. if omitted this will be set to center. however you can use any valid position here to indicate the position of the centre of the circle. our circle therefore
accepts one radius value, which may be a length, a percentage or the closest-side or farthest side keyword then optionally the keyword at followed by a position value. in the below example i have created a circle on an item with a width of 100 pixels, plus a margin of 20 pixels. this gives a total width for the reference box of 140 pixels. i have given a value of 50% for the shape-radius value which me...
... a half ellipse shape to wrap our text around. you can change these values to see how the ellipse changes. the keyword values of closest-side and farthest-side are useful to create a quick ellipse based on the size of the floated element reference box. polygon() the final basic shape is the most complex and enables the creation of many side shapes by way of creating a polygon(). this shape
accepts three or more pairs of values (a polygon must at least draw a triangle). these values are co-ordinates drawn with reference to the reference box. in the example below i have created a shape for text to follow using the polygon(), you can change any of the values to see how the shape is changed. you may well find the firefox shape inspector very useful here to create your polygon shape. the s...
HTML attribute: capture - HTML: Hypertext Markup Language
value description user the user-facing camera and/or microphone should be used. ...
... value description user the user-facing camera and/or microphone should be used. ...
...vice(s) such as camera or microphone be used instead of requesting a file input. examples when set on a file input type, operating systems with microphones and cameras will display a user interface allowing the selection from an existing file or the creating of a new one. ...
...ng systems with microphones and cameras will display a user interface allowing the selection from an existing file or the creating of a new one. <p> <label for="soundfile">what does your voice sound like?:</label> <input type="file" id="soundfile" capture="user"
accept="audio/*"> </p> <p> <label for="videofile">upload a video:</label> <input type="file" id="videofile" capture="environment"
accept="video/*"> </p> <p> <label for="imagefile">upload a photo of yourself:</label> <input type="file" id="imagefile" capture="user"
accept="image/*"> </p> note these work better on mobile devices; if your device is a desktop computer, you'll likely get a typical file picker. specifications specification status html media capturethe definition of 'capture attribute' ...
HTML attribute reference - HTML: Hypertext Markup Language
accesskey global attribute keyboard shortcut to activate or add focus to the element. ...
... accesskey global attribute keyboard shortcut to activate or add focus to the element. ...
... accesskey global attribute keyboard shortcut to activate or add focus to the element. ...
...d>, <fieldset>, <input>, <keygen>, <optgroup>, <option>, <select>, <textarea> indicates whether the user can interact with the element. download <a>, <area> indicates that the hyperlink is to be used for downloading a resource. draggable global attribute defines whether the element can be dragged. dropzone global attribute indicates that the element
accepts the dropping of content onto it. enctype <form> defines the content type of the form data when the method is post. enterkeyhint <textarea>, contenteditable the enterkeyhint specifies what action label (or icon) to present for the enter key on virtual keyboards. the attribute can be used with form controls (such as the value of textarea elements), or in elements in...
Preloading content with rel="preload" - HTML: Hypertext Markup Language
est, like json, imported scripts, or web workers. larger images and video files. preload has other advantages too. using as to specify the type of content to be preloaded allows the browser to: prioritize resource loading more accurately. store in the cache for future requests, reusing the resource if appropriate. apply the correct content security policy to the resource. set the correct
accept request headers for it. what types of content can be preloaded? many different content types can be preloaded. the possible as attribute values are: audio: audio file, as typically used in <audio>. document: an html document intended to be embedded by a <frame> or <iframe>. embed: a resource to be embedded inside an <embed> element. fetch: resource to be accessed by a fetch or xhr reques...
...eb worker or shared worker. video: video file, as typically used in <video>. note: there's more detail about these values and the web features they expect to be consumed by in the preload spec — see link element extensions. also note that the full list of values the as attribute can take is governed by the fetch spec — see request destinations. including a mime type <link> elements can
accept a type attribute, which contains the mime type of the resource the element points to. this is especially useful when preloading resources — the browser will use the type attribute value to work out if it supports that resource, and will only download it if so, ignoring it if not. you can see an example of this in our video example (see the full source code, and also the live version): <head> ...
...gin> <link rel="preload" href="fonts/zantroke-webfont.woff2" as="font" type="font/woff2" crossorigin> <link href="style.css" rel="stylesheet"> </head> <body> … </body> not only are we providing the mime type hints in the type attributes, but we are also providing the crossorigin attribute to handle the cors issue. ...
...nts/zantroke-webfont.woff2" as="font" type="font/woff2" crossorigin> <link href="style.css" rel="stylesheet"> </head> <body> … </body> not only are we providing the mime type hints in the type attributes, but we are also providing the crossorigin attribute to handle the cors issue. including media one nice feature of <link> elements is their ability to
accept media attributes. ...
Evolution of HTTP - HTTP
uate content to exchange. thanks to the host header, the ability to host different domains at the same ip address now allows server colocation. ...
...t different domains at the same ip address now allows server colocation. ...
...ip address now allows server colocation. ...
...ng: gzip, deflate, br referer: https://developer.mozilla.org/docs/glossary/simple_header 200 ok connection: keep-alive content-encoding: gzip content-type: text/html; charset=utf-8 date: wed, 20 jul 2016 10:55:30 gmt etag: "547fa7e369ef56031dd3bff2ace9fc0832eb251a" keep-alive: timeout=5, max=1000 last-modified: tue, 19 jul 2016 00:59:33 gmt server: apache transfer-encoding: chunked vary: cookie,
accept-encoding (content) get /static/img/header-background.png http/1.1 host: developer.cdn.mozilla.net user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0
accept: */*
accept-language: en-us,en;q=0.5
accept-encoding: gzip, deflate, br referer: https://developer.mozilla.org/docs/glossary/simple_header 200 ok age: 9578461 cache-control: public, max-age=315360...
Content-Location - HTTP
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. ...
...e 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. ...
... formats let's say a site's api can return data in json, xml, or csv formats. if the url for a particular document is at https://example.com/documents/foo, the site could return different urls for content-location depending on the request's
accept header: request header response header
accept: application/json, text/json content-location: /documents/foo.json
accept: application/xml, text/xml content-location: /documents/foo.xml
accept: text/plain, text/* content-location: /documents/foo.txt these urls are examples — the site could serve the different filetypes with any url patterns it wishes, such as a query string parameter: /documents/foo?format=json, /documents/foo?format=xml, and so on. then the client could remember that the js...
...d serve the different filetypes with any url patterns it wishes, such as a query string parameter: /documents/foo?format=json, /documents/foo?format=xml, and so on. then the client could remember that the json version is available at that particular url, skipping content negotation the next time it requests that document. the server could also consider other content negotiation headers, such as
accept-language. pointing to a new document (http 201 created) say you're creating a new blog post through a site's api: put /new/post host: example.com content-type: text/markdown # my first blog post! i made this through `example.com`'s api. i hope it worked. the site returns a generic success message confirming the post was published. the server specifies where the new post is with content-loc...
A typical HTTP session - HTTP
tp headers form a block which ends with an empty line. the final block is an optional data block, which may contain further data mainly used by the post method. example requests fetching the root page of developer.mozilla.org, i.e. http://developer.mozilla.org/, and telling the server that the user-agent would prefer the page in french, if possible: get / http/1.1 host: developer.mozilla.org
accept-language: fr observe that final empty line, this separates the data 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: develope...
...1 200 ok content-type: text/html; charset=utf-8 content-length: 55743 connection: keep-alive cache-control: s-maxage=300, public, max-age=0 content-language: en-us date: thu, 06 dec 2018 17:37:18 gmt etag: "2e77ad1dc6ab0b53a2996dfd4653c1c3" server: meinheld/0.6.1 strict-transport-security: max-age=63072000 x-content-type-options: nosniff x-frame-options: deny x-xss-protection: 1; mode=block vary:
accept-encoding,cookie age: 7 <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>a simple webpage</title> </head> <body> <h1>simple html5 webpage</h1> <p>hello, world!</p> </body> </html> notification that the requested resource has permanently moved: http/1.1 301 moved permanently server: apache/2.4.37 (red hat) content-type: text/html; charset=utf-8 date: thu, 06 dec 20...
...(contains a site-customized page helping the user to find the missing resource) notification that the requested resource doesn't exist: http/1.1 404 not found content-type: text/html; charset=utf-8 co...
...(contains a site-customized page helping the user to find the missing resource) response status codes http response status codes indicate if a specific http request has been successfully completed. responses are grouped into five classes: informational responses, successful responses, redirects, client errors, and servers error...
The arguments object - JavaScript
orter than above but allocates an empty array var args = [].slice.call(arguments); as you can do with any array-like object, you can use es2015's array.from() method or spread syntax to convert arguments to a real array: let args = array.from(arguments); // or let args = [...arguments]; the arguments object is useful for functions called with more arguments than they are formally declared to
accept. ...
...s2015's array.from() method or spread syntax to convert arguments to a real array: let args = array.from(arguments); // or let args = [...arguments]; the arguments object is useful for functions called with more arguments than they are formally declared to
accept. this technique is useful for functions that can be passed a variable number of arguments, such as math.min(). this example function
accepts any number of string arguments and returns the longest one: function longeststring() { var longest = ''; for (var i=0; i < arguments.length; i++) { if (arguments[i].length > longest.length) { longest = arguments[i]; } } return longest; } you can use arguments.length to count how many arguments the function was called with. if you instead want to count how many parameters...
...ments and returns the longest one: function longeststring() { var longest = ''; for (var i=0; i < arguments.length; i++) { if (arguments[i].length > longest.length) { longest = arguments[i]; } } return longest; } you can use arguments.length to count how many arguments the function was called with. if you instead want to count how many parameters a function is declared to
accept, inspect that function's length property. using typeof with arguments the typeof operator returns 'object' when used with arguments console.log(typeof arguments); // 'object' the type of individual arguments can be determined by indexing arguments: console.log(typeof arguments[0]); // returns the type of the first argument properties arguments.callee reference to the currently executin...
...uments object behaves the same whether or not a function is passed rest, default, or destructured parameters. that is, assigning new values to variables in the body of the function will not affect the arguments object. nor will assigning new variables to the arguments object affect the value of variables. note: you cannot write a "use strict"; directive in the body of a function definition that
accepts rest, default, or destructured parameters. doing so will throw a syntax error. non-strict functions that are passed only simple parameters (that is, not rest, default, or restructured parameters) will sync the value of variables new values in the body of the function with the arguments object, and vice versa: function func(a) { arguments[0] = 99; // updating arguments[0] also updates a co...
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
phase 2 adding an event handler first, we add an event handler to the menu item that will open the window (listing 4). fixme: listing 4: event handler clock handler create the window that displays the clock (listing 5) and its controller (listing 6). we’ve already covered the dialog element in chapter 3. in this case, we only want to display an ok button, so we set the buttons attribute to
accept. ...
... so we set the buttons attribute to
accept. within the window are a label element and textbox element, wrapped in a hbox element so that they are arranged horizontally. ...
...eferences the dtd file, and replace “clock” and “current time” with entity references. listing 8: revisions to clock.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/"?> <!doctype dialog system "chrome://helloworld/locale/clock.dtd"> <dialog id="clockdialog" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="&helloworld.clock;" buttons="
accept" onload="initclock();"> <script type="application/javascript" src="chrome://helloworld/content/clock.js" /> <hbox align="center"> <label value="&helloworld.currenttime;:" /> <textbox id="currenttime" /> </hbox> </dialog> create the dtd that defines the entity references now create the dtd file that gets referred to by clock.xul (listing 9). the clock.dtd file inside the fr-fr...
Adding windows and dialogs - Archive of obsolete content
resizable unless they display dynamically generated content from a datasource, such as lists or trees that may need resizing to have a better view of the content. to open a new dialog, use the function window.opendialog, an extension of the open function. it allows you to send a set of optional parameters that can be used to communicate with the dialog. ...
...llows you to send a set of optional parameters that can be used to communicate with the dialog. let somevalue = 2; let returnvalue = {
accepted : false , result : "" }; window.opendialog( "chrome://xulschoolhello/content/somedialog.xul", "xulschoolhello-some-dialog", "chrome,centerscreen", somevalue, returnvalue); // you can send as many extra parameters as you need. // if (returnvalue.
accepted) { do stuff } the optional parameters are available in the dialog code through the window.arguments property: let somevalue = window.arguments[0]; let returnvalue = window.arguments[1]; // returnvalue.
accepted = true; // returnvalue.result = "something"; the parameter named returnvalue is an object that the dialog will modify to reflect what the user did in it. this is the simplest w...
...argins and paddings that are not the same for all systems, so you should avoid making dialogs from scratch or overriding the default dialog css styles. the dialog element handles all of this transparently. all you need to do is define which buttons you'll need and the actions associated with them. <dialog id="xulschoolhello-hello-dialog" title="&xulschoolhello.hellodialog.title;" buttons="
accept,cancel" ondialog
accept="return xulschoolchrome.hellodialog.
accept();" ondialogcancel="return xulschoolchrome.hellodialog.cancel();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> carefully read the specification of the dialog element. you'll see that you can choose from a wide variety of buttons, associate any action you need to them, override their labels, and ev...
Drag and Drop Example - Archive of obsolete content
we don't need to do anything special for the ondragover function, so no code is added in its body. the ondrop handler first uses the createelement function to create a new element of the type stored in the drag session. next, appendchild is called to add the new element to the stack, which is the target of the event. finally, we set some at...
... var elem = document.createelement(dropdata.data); event.target.appendchild(elem); elem.setattribute("left", "" + event.pagex); elem.setattribute("top", "" + event.pagey); elem.setattribute("label", dropdata.data); } } } the getsupportedflavours function needs only to return a list of flavours that the stack can
accept to be dropped on it. in this case, it only
accepts text. we don't need to do anything special for the ondragover function, so no code is added in its body. the ondrop handler first uses the createelement function to create a new element of the type stored in the drag session. next, appendchild is called to add the new element to the stack, which is the target of the event. finally, we set some attributes on the new element. the position of eleme...
...ndow. the label attribute is set to the data from the drag also so that the button has a default label. this example is fairly simple. one possible change is to use a custom flavour for the data instead of text. the problem with using text is that if the text from an external drag just happens to be set to button, a button will be created on the board. a custom type means that the board will only
accept drags from the palette. the final code is shown below: <window title="widget dragger" id="test-window" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul"> <script src="chrome://global/content/nsdraganddrop.js"/> <script src="chrome://global/content/nstransferable.js"/> <script src="dragboard.js"/> <stack id="board" style="w...
buttons - Archive of obsolete content
this button will also be the default button. ...
...this button will also be the default button. ...
...ts label with the buttonlabelextra1 attribute and its command with the ondialogextra1 attribute. extra2: a second optional additional button. you can set its label with the buttonlabelextra2 attribute and its command with the ondialogextra2 attribute. note: if you don't want to display any buttons in the dialog box, set the value of this attribute to "," (a single comma). warning: if the
accept and cancel buttons are actually shown is system dependent and is mainly controlled by the value of the boolean preference browser.preferences.instantapply. if it is set to true any changes to settings are supposed to be applied immediately. the
accept button is therefore unnecessary and is hidden. the cancel button might be shown as an additional possibility to close the dialog in this situation ...
Building accessible custom components in XUL - Archive of obsolete content
rigger editing mode. when the user presses enter, we replace the currently focused xul label element with a xul textbox element, copy the initial value over to the textbox element, and call its focus and select methods to set focus to the textbox and select the entire value. we register two event handlers on the textbox: onkeypress and onblur. if the user presses enter while editing the cell, we "
accept" the value by recreating the original label and copying the new value back. if the user presses esc, we "cancel" the edit by simply recreating the original label and restoring its previous value. finally, if the user hits tab while editing, we treat this as
acceptance and recreate the label with the new value, then let firefox manage changing focus to the spreadsheet's next sibling. (we don't nee...
...the user presses esc, we "cancel" the edit by simply recreating the original label and restoring its previous value. finally, if the user hits tab while editing, we treat this as
acceptance and recreate the label with the new value, then let firefox manage changing focus to the spreadsheet's next sibling. ...
...tbox, false); label.focus(); }, 0); break; } } </code> with this new code, we can now navigate to a specific cell within the spreadsheet and press enter to edit the value. the start_edit function replaces the label with a textbox, which allows the user to change the cell value. <caption>editing a cell</caption> once we're satisfied with our changes, we can press enter again to
accept the value. the done_edit function recreates the original label element and sets the new value. note that the role is once again "cell", since we explicitly set it when we recreated the label element. <caption>after editing a cell</caption> further reading accessible html spreadsheet demo on mozilla.org future enhancements now that we know how to create an accessible spreadsheet, it sho...
RDF Modifications - Archive of obsolete content
or not. thus, the member statement can be skipped. the next statement is a triple involving the 'http://purl.org/dc/elements/1.1/title' predicate. we aren't adding a arc involving this triple so we can ignore this statement as well. the second triple, however, could cause a change, since the predicate attribute matches the predicate being added. the subject and object are variables so the builder
accepts this as a possible change, and moves on to the next step. if the predicate was different, the builder would come to the end of the statements and could just stop there. for instance, if the predicate of the triple being added was 'http://purl.org/dc/elements/1.1/date', the builder could ignore it since the template doesn't even care about the date field. similarly, if the triple didn't use a var...
...ntainer, there would be no match and the builder could stop processing the new triple. for instance, we might have added a description for a new photo, but haven't added the photo to the container resource. once we do add it to the container with another rdf assertion, the process described above is applied again and this time it may match. there are still two more things to do before a result is
accepted as a new match. first, once the builder reaches the content statement, it checks what the container or reference variable is, in this case ?start, as specified by the uri attribute. the calculated value for the potential new match is 'http://www.xulplanet.com/rdf/myphotos'. the builder looks to see if this resource is being used as the stating point in the template. as it happens, this resource...
...se for any starting points used in recursive generation. if the calculated ?start variable was something different, naturally we don't need to change the template output, as that resource isn't being used in a template. finally, the builder processes any statements below the one we started at, in order to fill in any remaining variables. in this case, there are no other statements, so the builder
accepts this result as a new match. since all the variables have been filled in, the action body can be processed and a new block of content generated and inserted into the output. we'll find out how the builder determines where to insert the new content is an upcoming section. however, this does show that the template builder can update the output upon changes without rebuilding the entire template. wh...
nsIContentPolicy - Archive of obsolete content
cess() if the load/process is rejected based on some other criteria. mozilla callers will handle this like reject_request; third-party implementors may, for example, use this to direct their own callers to consult the extra parameter for additional details. note: this rejection only applies to the current request on this server, not to future requests of the same type.
accept 1 returned from shouldload() or shouldprocess() if the load or process 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 ...
...the actual mime type of the requested content. aextra an optional argument, pass-through for non-gecko callers to pass extra data to callees. arequestprincipal optional. defines the principal that caused the load. this is optional only for non-gecko code: all gecko code should set this argument. for navigation events, this is the principal of the page that caused this load. return value
accept or reject_* shouldprocess() should the resource be processed? shouldprocess() will be called once all the information passed to it has been determined about the resource, typically after part of the resource has been loaded. "processing" means handling by the application. for instance, shouldprocess could be used to allow a response from a server to be handled or ignored depending on the mime t...
...e; can be null if inapplicable. amimetype the mime type of the requested resource (for example, image/png), as reported by the networking library, if available (may be empty if inappropriate for the type, e.g., type_refresh). aextra an optional argument, pass-through for non-gecko callers to pass extra data to callees. arequestprincipal optional. the requesting principal. return value
accept or reject_* example you can implement this interface easily by including the nsicontentpolicy.h header file and implementing public nsicontentpolicy into your class, like this: // put this into your header file #include "_path_to_sdk/include/content/nsicontentpolicy.h" class myclass: public nsisupports, public nsicontentpolicy { ... ns_decl_nsicontentpolicy ... } // and this into your...
Using IO Timeout And Interrupt On NT - Archive of obsolete content
g overlapped io request that works on both nt 3.51 and 4.0 is to close the file descriptor, hence the rule of thumb stated at the beginning of this memo. limitations this seemingly harsh way to force the completion of outstanding overlapped io request has the following limitations: it is difficult for threads to shared a file descriptor. for example, suppose thread a and thread b call <tt>pr_
accept()</tt> on the same socket, and they time out at the same time. following the rule of thumb, both threads would close the socket. the first <tt>pr_close()</tt> would succeed, but the second <tt>pr_close()</tt> would be freeing freed memory. a solution that may work is to use a lock to ensure only one thread can be using that socket at all times. once there is a timeout or interrupt error, the fil...
...ceed, but the second <tt>pr_close()</tt> would be freeing freed memory. a solution that may work is to use a lock to ensure only one thread can be using that socket at all times. once there is a timeout or interrupt error, the file descriptor is no longer usable. suppose the file descriptor is intended to be used for the life time of the process, for example, the logging file, this is really not
acceptable. a possible solution is to add a <tt>pr_disableinterrupt()</tt> function to turn off interrupts when accessing such file descriptors. a related known bug is that timeout and interrupt don't work for <tt>pr_connect()</tt> on nt. this bug is due to a different limitation in our nt implementation. conclusions as long as we need to support nt 3.51, we need to program under the guideline that a...
...errupt on files that need to stay open throughout the process. when we stop supporting nt 3.51, we can look into using nt 4's <tt>cancelio()</tt> function to cancel outstanding overlapped io requests when we get io timeout or interrupt errors. if <tt>cancelio()</tt> really works as advertised, that should fundamentally solve this problem. if these limitations with io timeout and interrupt are not
acceptable to the needs of your programs, you can consider using the win95 version of nspr. the win95 version runs without trouble on nt, but you would lose the better performance provided by nt fibers and asynchronous io. original document information author: larryh@netscape.com last updated date: december 1, 2004 ...
Your first form - Learn web development
a 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: the data entry portion contains three text fields, each with a corresponding <label>: the input field for the name is a single-line text field. the input field for the e-mail is an input of type email: a single-line text field that
accepts only e-mail addresses. the input field for the message is a <textarea>; a multiline text field. in terms of html code we need something like the following to implement these form widgets: <form action="/my-handling-form-page" method="post"> <ul> <li> <label for="name">name:</label> <input type="text" id="name" name="user_name"> </li> <li> <label for="mail">e-mail:</label> ...
...st important attribute is the type attribute. this attribute is extremely important because it defines the way the <input> element appears and behaves. you'll find more about this in the basic native form controls article later on. in our simple example, we use the value <input/text> for the first input — the default value for this attribute. it represents a basic single-line text field that
accepts any kind of text input. for the second input, we use the value <input/email>, which defines a single-line text field that only
accepts a well-formed e-mail address. this turns a basic text field into a kind of "intelligent" field that will perform some validation checks on the data typed by the user. it also causes a more appropriate keyboard layout for entering email addresses (e.g. with an @ ...
...ext </textarea> the <button> element the markup for our form is almost complete; we just need to add a button to allow the user to send, or "submit", their data once they have filled out the form. this is done by using the <button> element; add the following just above the closing </ul> tag: <li class="button"> <button type="submit">send your message</button> </li> the <button> element also
accepts a type attribute — this
accepts one of three values: submit, reset, or button. a click on a submit button (the default value) sends the form's data to the web page defined by the action attribute of the <form> element. a click on a reset button resets all the form widgets to their default value immediately. from a ux point of view, this is considered bad practice, so you should avoid using...
Handling common accessibility problems - Learn web development
navigation and color contrast checkers), let's have a look at other tools you can make use of when doing accessibility testing. auditing tools there are a number of auditing tools available 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 accessib...
... now; you can then go on to play with some of our examples in the screenreader testing section. nvda nvda is windows-only, and you'll need to install it. download it from nvaccess.org. you can choose whether to make a donation or download it for free; you'll also need to give them your e-mail address before you can download it. once downloaded, install it — you double click the installer,
accept the license and follow the prompts. to start nvda, double click on the program file/shortcut, or use the keyboard shortcut ctrl + alt + n. you'll see the nvda welcome dialog when you start it. here you can choose from a couple of options, then press the ok button to get going. nvda will now be active on your computer. to use nvda, you will make a lot of use of the "nvda modifier" — this is ...
... semantically correct as possible. validating it is a good start, as is using an auditing tool. check that your content makes sense when the css is turned off. make sure your functionality is keyboard accessible. test using tab, return/enter, etc. make sure your non-text content has text alternatives. an auditing tool is good for catching such problems. make sure your site's color contrast is
acceptable, using a suitable checking tool. make sure hidden content is visible by screenreaders. make sure that functionality is usable without javascript wherever possible. use aria to improve accessibility where appropriate. run your site through an auditing tool. test it with a screenreader. include an accessibility policy/statement somewhere findable on your site to say what you did. findin...
Strategies for carrying out testing - Learn web development
uld try to make sure your site works on the most important target browsers and devices, and then code defensively to give your site the widest support reach it can be expected to have. by coding defensively, we mean trying to build in intelligent fallbacks so that if a feature or style doesn't work in a browser, the site will be able to downgrade to something less exciting that still provides an
acceptable user experience — the core information is still accessible, for example, even if it doesn't look quite as nice. the aim is to build up a chart of browsers/devices you can refer to as you test. you can make this as simple or as complex as you like — for example a common approach is to have multiple grades of support level, something like: a grade: common/modern browsers — known to be...
...t. 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 analytics on your site. you could place the snippets below your closing </body> tag, or somewhere else appropriate that keeps it from g...
...et, chrome and firefox for android (last two versions) on phone tablet. accessibility passing common tests. b grade: ie 8 and 9 for windows, opera mini. c grade: opera, other niche modern browsers. what are you going to test? when you've got a new addition to your codebase that needs testing, before you start testing you should write out a list of testing requirements that need to pass to be
accepted. these requirements can be visual or functional — both combine to make a usable web site feature. consider the following example (see the source code, and also the example running live): test criteria for this feature could be written like so: a and b grade: button should be activatable by the user's primary control mechanism, whatever it is — this should include mouse, keyboard, an...
Setting up your own test automation environment - Learn web development
essibility/native-keyboard-accessibility.html'); interacting with the document now we've got a document to test, we need to interact with it in some way, which usually involves first selecting a specific element to test something about. you can select ui elements in many ways in webdriver, including by id, class, element name, etc. the actual selection is done by the findelement() method, which
accepts as a parameter a selection method. for example, to select an element by id: const element = driver.findelement(by.id('myelementid')); one of the most useful ways to find an element by css — the by.css method allows you to select an element using a css selector enter the following at the bottom of your quick_test.js code now: const button = driver.findelement(by.css('button:nth-of-type(1)'...
... button.click(); try running your test again; the button will be clicked, and the alert() popup should appear. at least we know the button is working! you can interact with the popup too. add the following to the bottom of the code, and try testing it again: let alert = driver.switchto().alert(); alert.gettext().then(function(text) { console.log('alert text is \'' + text + '\''); }); alert.
accept(); next, let's try entering some text into one of the form elements. add the following code and try running your test again: const input = driver.findelement(by.id('name')); input.sendkeys('filling in my form'); you can submit key presses that can't be represented by normal characters using properties of the webdriver.key object. for example, above we used this construct to tab out of the form...
...efore you try to interact with any of its elements, otherwise the test will likely fail. in our google_test.js test for example, we included this block: driver.sleep(2000).then(function() { driver.gettitle().then(function(title) { if(title === 'webdriver - google search') { console.log('test passed'); } else { console.log('test failed'); } }); }); the sleep() method
accepts a value that specifies the time to wait in milliseconds — the method returns a promise that resolves at the end of that time, at which point the code inside the then() executes. in this case we get the title of the current page with the gettitle() method, then return a pass or fail message depending on what its value is. we could add a sleep() method to our quick_test.js test too — try wrap...
IPDL Tutorial
pes include the c++ integer types (bool, char, int, double) and xpcom string types (nsstring, nscstring). ipdl imports these automatically because they are common, and because the base ipc library knows how to serialize and deserialize these types. see ipc/ipdl/ipdl/builtin.py for the most up-to-date list of automatically imported types. actors may be passed as parameters. the c++ signature will
accept a pprotocolparent* on one side and convert it to a pprotocolchild* on the other. maybe types if you want to pass a potentially undefined argument, you can add ? postfix after the type name. then you can pass a mozilla::maybe object instead of a concrete value. protocol pmaybe { child: async maybe(nscstring? maybe); }; custom primitive types when you need to send data of a type other than ...
...s for "normal" error conditions such as inability to load a network request! normal errors should be signaled with a message or return value. note: the following paragraphs are not yet implemented. ipdl tracks all active protocols between two endpoints. ...
...ung: any synchronous or rpc messages currently active will return false no further messages will be
accepted (c++ methods will return false) each ipdl actor will receive an onerror message deallocpsubprotocol will be called on each manager protocol to deallocate any active subprotocols. when a manager protocol is destroyed, any subprotocols will be notified: no further messages will be
accepted deallocpsubprotocol will be called on the manager protocol to deallocate any active subprotocols when the toplevel protocol is destroyed, this is equivalent to shutting down the entire ipdl machinery for that connection, because no more messages can be sent and all subprotocols are destroyed. ...
Following the Android Toasts Tutorial from a JNI Perspective
he key being static_methods and methods and the value being an array. var toast = jni.loadclass(my_jenv, sig.toast.substr(1, sig.toast.length - 2), { static_methods: [ { name: 'maketext', sig: '()' } ], methods: [ { name: 'show', sig: '()' } ] }); the sig of methods is always in the format of "method format" from our types table above. the reason is that methods
accept arguments and return something. we need to declare now the arguments and return type for each of the methods. the documentation says maketext takes three arguments, the types are context, int, and int and returns a toast. for example, let's declare this with strings: { name: 'maketext', sig: '(landroid/content/context;ii)landroid/widget/toast;' } we see there are no separating characters betwe...
...sig: '()' + // no arguments sig.void // return } ] determine static-ness of fields declare them just like methods, fields have two types, static and not. we look up the documentation for our field, which is length_short, and we see it is static. so we will not need a group in the third argument of loadclass for fields, we will only need static_fields. fields do not
accept arguments, so the "method format" is not used, we simply tell the sig the type of the field, which we find out from the android documentation website. this is what our fields array will look like: static_fields: [ { name: 'length_short', sig: sig.int } ] wrap it all up here is the code for our completed toast class: var toast = jni.loadclass(my_jenv, sig.toast.substr(1, sig.toast.length ...
...ckoappshell class. to figure out the sig for firefox classes, we have to search on dxr. we find an xml file showing the sig for geckoappshell is org.mozilla.gecko.geckoappshell. we will add this to our sig object in slash notation: geckoappshell: 'lorg/mozilla/gecko/geckoappshell;' we then instantiate the geckoappshell class in jni and declare the getcontext method; dxr showed that this method
accepted no arguments and returns a context, and we already had the sig for context in our sig object. var geckoappshell = jni.loadclass(my_jenv, sig.geckoappshell.substr(1, sig.geckoappshell.length - 2), { static_methods: [ { name: 'getcontext', sig: '()' + sig.context } ] }); porting the java code now that all the declarations are complete, we can now side-by-side port the java code...
Nonblocking IO In NSPR
me strange problems with using a nonblocking socket associated with an i/o completion port. so the first constraint is: the blocking/nonblocking io mode of a new socket is committed the first time a potentially-blocking io function is invoked on the socket. once the io mode of a socket is committed, it cannot be changed. the potentially-blocking io functions include <tt>pr_connect()</tt>, <tt>pr_
accept()</tt>, <tt>pr_
acceptread()</tt>, <tt>pr_read()</tt>, <tt>pr_write()</tt>, <tt>pr_writev()</tt>, <tt>pr_recv()</tt>, <tt>pr_send()</tt>, <tt>pr_recvfrom()</tt>, <tt>pr_sendto()</tt>, and <tt>pr_transmitfile(),</tt> and do not include <tt>pr_bind()</tt> and <tt>pr_listen()</tt>. in blocking mode, any of these potentially-blocking functions requires the use of the nt i/o completion port. so at that...
...n()</tt>. in blocking mode, any of these potentially-blocking functions requires the use of the nt i/o completion port. so at that point we must determine whether to associate the socket with the i/o completion or not, and that decision cannot be changed later. there is a second constraint, due to the use of nt asynchronous i/o and the recycling of used sockets: the new socket returned by <tt>pr_
accept()</tt> or <tt>pr_
acceptread()</tt> inherits the blocking/nonblocking io mode of the listening socket and this cannot be changed. the socket returned by <tt>pr_
accept()</tt> or <tt>pr_
acceptread()</tt> on a blocking, listening socket may be a recycled socket previously used in a <tt>pr_transmitfile()</tt> call. since <tt>pr_transmitfile()</tt> only operates in blocking mode, this recycled socket c...
...eused in blocking mode, hence the above constraint. because these constraints only apply to nt, it is advised that you test your cross-platform code that uses nonblocking io on nt early in the development cycle. these constraints are enforced in the debug nspr library by assertions. differences from blocking io in nonblocking mode, the timeout argument for the io functions is ignored. <tt>pr_
acceptread()</tt> and <tt>pr_transmitfile()</tt> only work on blocking sockets. they do not make sense in nonblocking mode. <tt>pr_write()</tt>, <tt>pr_send()</tt>, <tt>pr_writev()</tt> in blocking mode block until the entire buffer is sent. in nonblocking mode, they cannot block, so they may return with just sending part of the buffer. pr_poll() or pr_select()? <tt>pr_select()</tt> is deprecated, n...
I/O Functions
getspecialfd pr_createpipe directory i/o functions pr_opendir pr_readdir pr_closedir pr_mkdir pr_rmdir socket manipulation functions the network programming interface presented here is a socket api modeled after the popular berkeley sockets. differences include the following: the blocking socket functions in nspr take a timeout parameter. ...
...ckets. differences include the following: the blocking socket functions in nspr take a timeout parameter. two new functions, pr_transmitfile and pr_
acceptread, can exploit the new system calls of some operating systems for higher performance. ...
...eter. two new functions, pr_transmitfile and pr_
acceptread, can exploit the new system calls of some operating systems for higher performance. list of functions: pr_openudpsocket pr_newudpsocket pr_opentcpsocket pr_newtcpsocket pr_importtcpsocket pr_connect pr_connectcontinue pr_
accept pr_bind pr_listen pr_shutdown pr_recv pr_send pr_recvfrom pr_sendto pr_transmitfile pr_
acceptread pr_getsockname pr_getpeername pr_getsocketoption pr_setsocketoption converting between host and network addresses pr_ntohs pr_ntohl pr_htons pr_htonl pr_familyinet memory-mapped i/o functions the memory-mapped i/o functions allow sections of a file to be mapped to memory regions, allowing read-write accesses to the file to be accomplished by normal memory accesses. memory-map...
PR_NewTCPSocket
essful completion, a pointer to the prfiledesc object created for the newly opened ipv4 tcp socket. if the creation of a new tcp socket failed, null. description tcp (transmission control protocol) is a connection-oriented, reliable byte-stream protocol of the tcp/ip protocol suite. pr_newtcpsocket creates a new ipv4 tcp socket. a tcp connection is established by a passive socket (the server)
accepting a connection setup request from an active socket (the client). typically, the server binds its socket to a well-known port with pr_bind, calls pr_listen to start listening for connection setup requests, and calls pr_
accept to
accept a connection. the client makes a connection request using pr_connect. after a connection is established, the client and server may send and receive data between e...
... a tcp connection can be shut down by pr_shutdown, and the sockets should be closed by pr_close. see also pr_newtcpsocket is deprecated because it is hardcoded to create an ipv4 tcp socket. ...
... a tcp connection can be shut down by pr_shutdown, and the sockets should be closed by pr_close. see also pr_newtcpsocket is deprecated because it is hardcoded to create an ipv4 tcp socket. ...
Index
information when you run the command with the -g option. however, all of the requested fields are optional for test certificates. if you do not enter a common name, the tool provides a default name. in the following example, the user input is in boldface: signtool -g mytestcert using certificate directory: /u/someuser/.netscape enter certificate information. all fields are optional.
acceptable characters are numbers, letters, spaces, and apostrophes. certificate common name: test object signing certificate organization: netscape communications corp. organization unit: server products division state or province: california country (must be exactly 2 characters): us username: someuser email address: someuser@netscape.com enter password or pin for "communicator certificate db...
... with -h, two separate parts are printed for each record: the plain hex/ascii output, and the parsed ssl output. -x turn on hex/ascii printing of undecoded data inside parsed ssl records. used only with the -s option. this option uses the same output format as the -h option. -l prefix turn on looping; that is, continue to
accept connections rather than stopping after the first connection is complete. -p port change the default rendezvous port (1924) to another port. the following are well-known port numbers: * http 80 * https 443 * smtp 25 * ftp 21 * imap 143 * imaps 993 (imap over ssl) * nntp 119 ...
...indow. to output a basic, printable interpretation of the data, use the -h option, or, if you are looking at an ssl connection, the -s option. you will notice that the page you retrieved looks incomplete in the browser. this is because, by default, the tool closes down after the first connection is complete, so the browser is not able to load images. to make the tool continue to
accept connections, switch on looping mode with the -l option. the following examples show the output from commonly used combinations of options. example 1 $ ssltap.exe -sx -p 444 interzone.mcom.com:443 > sx.txt output connected to interzone.mcom.com:443 -->; [ alloclen = 66 bytes [ssl2] clienthellov2 { version = {0x03, 0x00} cipher-specs-length = 39 (0...
PKCS #11 Module Specs
ructure is defined as typedef struct ck_c_initialize_args { ck_createmutex createmutex; ck_destroymutex destroymutex; ck_lockmutex lockmutex; ck_unlockmutex unlockmutex; ck_flags flags; ck_void_ptr libraryparameters; ck_void_ptr preserved; } ck_c_initialize_args; applications/libraries must set libraryparameters to null if no parameter value is specified. pkcs #11 libraries which
accept parameters must check if the 'new' preserved field is null if and only if libraryparameters field is not null. nss specific parameters in module specs here are the nss application specific parameters in use. this data is currently stored in secmod.db or pkcs11.txt. this isn't part of the generic spec (that is other applications need not parse it, nor pkcs #11 modules need supply them or use the...
...n't open secmod.db and try to supply the strings. the mod db function is not through standard pkcs #11 interfaces. readonly databases should be opened read only. nocertdb don't try to open a certificate database. nokeydb don't try to open a key database. forceopen don't fail to initialize the token if the databases could not be opened. passwordrequired zero length passwords are not
acceptable (valid only if there is a keydb). optimizespace allocate smaller hash tables and lock tables. when this flag is not specified, softoken will allocate large tables to prevent lock contention. tokens configure 'tokens' by hand. the tokens parameter specifies a space separated list of slotids, each of which specify their own set of parameters affecting that token. typically 'tokens' would ...
...r this token. flags comma separated list of flag values, parsed case-insensitive. valid flags are: readonly databases should be opened read only. nocertdb don't try to open a certificate database. nokeydb don't try to open a key database. forceopen don't fail to initialize the token if the databases could not be opened. passwordrequired zero length passwords are not
acceptable (valid only if there is a keydb). optimizespace allocate smaller hash tables and lock tables. when this flag is not specified, softoken will allocate large tables to prevent lock contention. examples: ...
Python binding for NSS
als nss and nspr are c language api's which python-nss "wraps" and exposes to python programs. the design of python-nss follows these basic guiding principles: be a thin layer with almost a one-to-one mapping of nss/nspr calls to python methods and functions. programmers already familiar with nss/nspr will be quite comfortable with python-nss. be "pythonic". the term pythonic means to follow
accepted python paradigms and idoms in the python language and libraries. thus when deciding if the nss/nspr api should be rigidly followed or a more pythonic api provided the pythonic implementation wins because python programmers do not want to write c programs in python, rather they want their python code to feel like python code with the richness of full python. identifer names follow the preferred...
...it is expected very few programs will have used t...
...ts.py release 0.9.0 release date 2010-05-28 scm tag pynss_release_0_9_0 source download change log general modifications: correct definciencies in auth_certificate_callback found in several of the example files and documentation. if you've copied that code you should merge those changes in. unicode objects now
accepted as well as str objects for interfaces expecting a string. sockets were enhanced thusly: threads will now yield during blocking io. socket.makefile() reimplemented file object methods that had been missing (readlines(), sendall(), and iteration) were implemented makefile now just returns the same socket object but increments an "open"...
Using the Places keywords API
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 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. placesutils.keywords.insert({ keyword: "my_keyword", url: "http://www.example.com/...
...eyword url: the url represeted by the keyword postdata: optional post data string. not defined if there's no post data. if no keyword exists, will resolve to null. placesutils.keywords.fetch("my_keyword").then(entry => { /* entry is either null, or a keyword entry */ }, e => { /* failure */}); fetching entries by url the fetch() method also
accepts a keyword entry, where it's possible to specify keyword, url, or both. if both are specified it will try to fetch an exact match. specifying only an url, will fetch all the keywords associated to such an url. note that fetch() always resolves to a single entry, to fetch all of the entries it's necessary to provide a callback function. placesutils.keywords.fetch({ url: "http://www.example.com/" ...
...es it's necessary to provide a callback function. placesutils.keywords.fetch({ url: "http://www.example.com/" }, entry => { /* invoked for each found keyword entry */ }) .then(oneentry => { /* oneentry is either null, or one of the keyword entries */ }, e => { /* failure */}); removing a keyword the remove() method
accepts a keyword string. placesutils.keywords.remove("my_keyword").then(() => { /* success */ }, e => { /* failure */ }); ...
Components.utils.exportFunction
context. the exported function does not have to be added to the less privileged code's global window object: it can be exported to any object in the target scope. exportfunction() is made available as a global in sandboxes which have the wantexporthelpers option set in the sandbox() constructor. this includes add-on sdk content scripts. to understand what happens if the functions you export
accept arguments, see exporting functions that take arguments below. syntax components.utils.exportfunction(func, targetscope[, options]); parameters func : function the function to export. targetscope : object the object to attach the function to. this does not have to be the global window object: it could be any other object in the target window, or an object created by the caller. options :...
...caller. options : object optional parameter that supplies additional options. the following options are currently defined: defineas: determines the name of the function in targetscope. if this is omitted, you need to assign the return value of exportfunction() to an object in the target scope. allowcallbacks: deprecated/redundant from firefox 34. this option allows the exported function to
accept callbacks as arguments. boolean, defaulting to false. this option is new in firefox 33. from firefox 34 onwards this option has no effect: the exported function is always able to
accept callbacks as arguments. allowcrossoriginarguments: do not check that arguments to the exported function are subsumed by the caller: this allows the caller to pass objects with a different origin into the exported...
... 34, any arguments that the function takes are structured-cloned across the security boundary unless they are native objects such as dom nodes. because structured cloning does not clone functions, this meant that the function may not return a function, and by default, may not take any functions as arguments. however, in firefox 33, you could use the allowcallbacks option to enable the function to
accept callbacks. from firefox 34 onwards, any arguments passed into the function are not cloned. instead, they are passed through to the privileged scope as xrays. modifying the argument while cloning creates a copy of an object, an xray for an object refers to the original, so any changes to the argument that are made in the exported function will affect the original object that was passed in: // ...
Streams - Plugins
api methods npp_newstream, npp_write, and npp_destroystream to create a stream, push data into it, and delete it. receiving a stream sending a stream receiving a stream when the browser sends a data stream to the plug-in, it has several tasks to perform: 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 telling the plug-in when a stream is created to tell the plug-in instance when a new stream is created, the browser calls the npp_newstream method. this method also determines which mode it should use to send data to the plug-in. the browser can create a stream for several different ty...
... was sent to the instance. npres_user_break: the user canceled the stream directly by clicking the stop button or indirectly by some action, such as by deleting the instance or initiating higher-priority network operations. npres_network_err: the stream failed because of problems with the network, disk i/o error, lack of memory, or some other problem. finding out how much data the plug-in can
accept after a call to npp_newstream and before writing data to the plug-in, the browser calls npp_writeready to determine the maximum number of bytes that the plug-in can consume. this function allows the browser to send only as much data to the instance as it can handle at one time, and it helps both the browser and the plug-in to use their resources efficiently. after a call to npp_newstream, in wh...
...nd the plug-in to use their resources efficiently. after a call to npp_newstream, in which the plug-in requested a normal-mode stream, the browser delivers the data in the stream progressively in a series of calls to npp_writeready and npp_write. the browser calls npp_writeready before each call to npp_write. the value returned by npp_writeready indicates how many bytes the plug-in instance can
accept for this stream. if the plug-in allocates memory for the entire stream at once, it can return a large number. this number tells the browser that it can pass as much data to the instance as possible in a single call to npp_write. the browser can write a smaller amount of data if desired or necessary (for example, if only 8k of data is available in a network buffer). for instance, suppose the plug...
Network request details - Firefox Developer Tools
firefox.) you can copy some or all of the response header in json format by using the context menu: if you select copy, a single key word, value pair is copied. ...
...cial:centralautologin/p3p for more info.\"" }, { "name": "server", "value": "mw1316.eqiad.wmnet" }, { "name": "server-timing", "value": "cache;desc=\"pass\"" }, { "name": "strict-transport-security", "value": "max-age=106384710; includesubdomains; preload" }, { "name": "vary", "value": "
accept-encoding,treat-as-untrusted,x-forwarded-proto,cookie,authorization,x-seven" }, { "name": "via", "value": "1.1 varnish (varnish/5.1), 1.1 varnish (varnish/5.1)" }, { "name": "x-analytics", "value": "ns=-1;special=badtitle;wmf-last-access=11-jun-2019;wmf-last-access-global=11-jun-2019;https=1" }, { "name": "x-cache", ...
...rame-options", "value": "sameorigin" }, { "name": "x-powered-by", "value": "hhvm/3.18.6-dev" }, { "name": "x-search-id", "value": "esvan0r5bnnwscyk2wq09i1im" }, { "name": "x-varnish", "value": "766019457, 417549316" } ] }, "request headers (665 b)": { "headers": [ { "name": "
accept", "value": "*/*" }, { "name": "
accept-encoding", "value": "gzip, deflate, br" }, { "name": "
accept-language", "value": "en-us,en;q=0.5" }, { "name": "connection", "value": "keep-alive" }, { "name": "cookie", "value": "wmf-last-access=11-jun-2019; wmf-last-access-global=11-jun-20...
Applying styles and colors - Web APIs
the value must be between 0.0 (fully transparent) to 1.0 (fully opaque). this value is 1.0 (fully opaque) by default. the globalalpha property can be useful if you want to draw a lot of shapes on the canvas with similar transparency, but otherwise it's generally more useful to set the transparency on individual shapes when setting their colors. because the strokestyle and fillstyle properties
accept css rgba color values, we can use the following notation to assign a transparent color to them. // assigning transparent colors to stroke and fill style ctx.strokestyle = 'rgba(255, 0, 0, 0.5)'; ctx.fillstyle = 'rgba(255, 0, 0, 0.5)'; the rgba() function is similar to the rgb() function but it has one extra parameter. the last parameter sets the transparency value of this particular color. th...
...="number" size="3" id="miterlimit"/> <input type="submit" value="redraw"/> </form> </td> </tr> </table> document.getelementbyid('miterlimit').value = document.getelementbyid('canvas').getcontext('2d').miterlimit; draw(); screenshotlive sample using line dashes the setlinedash method and the linedashoffset property specify the dash pattern for lines. the setlinedash method
accepts a list of numbers that specifies distances to alternately draw a line and a gap and the linedashoffset property sets an offset where to start the pattern. in this example we are creating a marching ants effect. it is an animation technique often found in selection tools of computer graphics programs. it helps the user to distinguish the selection border from the image background by animating th...
... stops to a gradient as you need. below is a very simple linear gradient from white to black. var lineargradient = ctx.createlineargradient(0, 0, 150, 150); lineargradient.addcolorstop(0, 'white'); lineargradient.addcolorstop(1, 'black'); a createlineargradient example in this example, we'll create two different gradients. as you can see here, both the strokestyle and fillstyle properties can
accept a canvasgradient object as valid input. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); // create gradients var lingrad = ctx.createlineargradient(0, 0, 0, 150); lingrad.addcolorstop(0, '#00abeb'); lingrad.addcolorstop(0.5, '#fff'); lingrad.addcolorstop(0.5, '#26c000'); lingrad.addcolorstop(1, '#fff'); var lingrad2 = ctx.createlineargradient(0, 5...
Document.createNodeIterator() - Web APIs
ill appear in the first position of the traversal. since entities are not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_processing_instruction 64 shows processinginstruction nodes. nodefilter.show_text 4 shows text nodes. filter optional an object implementing the nodefilter interface. its
acceptnode() method will be called for each node in the subtree based at root which is
accepted as included by the whattoshow flag to determine whether or not to include it in the list of iterable nodes (a simple callback function may also be used instead). the method should return one of nodefilter.filter_
accept, nodefilter.filter_reject, or nodefilter.filter_skip. see the example. note: prior to gec...
...this parameter indicated whether or not the children of entity reference nodes were visible to the iterator. since such nodes were never created in browsers, this paramater had no effect. ...
...renceexpansion) that is not part of the dom4 specification, and has therefore been removed. this parameter indicated whether or not the children of entity reference nodes were visible to the iterator. since such nodes were never created in browsers, this paramater had no effect. example const nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, {
acceptnode(node) { return node.nodename.tolowercase() === 'p' ? nodefilter.filter_
accept : nodefilter.filter_reject; } } ); const pars = []; let currentnode; while (currentnode = nodeiterator.nextnode()) { pars.push(currentnode); } specifications specification status comment domthe definition of 'document.createnodeiterator' in that specification. l...
Document.createTreeWalker() - Web APIs
node will appear in the first position of the traversal. since entities are not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_processing_instruction 64 shows processinginstruction nodes. nodefilter.show_text 4 shows text nodes. filter optional a nodefilter, that is an object with a method
acceptnode, which is called by the treewalker to determine whether or not to
accept a node that has passed the whattoshow check. entityreferenceexpansion optional a boolean flag indicating if when discarding an entityreference its whole sub-tree must be discarded at the same time. return value a new treewalker object. example the following example goes through all nodes in the body, reduces the...
... whether or not to
accept a node that has passed the whattoshow check. entityreferenceexpansion optional a boolean flag indicating if when discarding an entityreference its whole sub-tree must be discarded at the same time. return value a new treewalker object. example the following example goes through all nodes in the body, reduces the set of nodes to elements, simply passes through as
acceptable each node (it could reduce the set in the
acceptnode() method instead), and then makes use of tree walker iterator that is created to advance through the nodes (now all elements) and push them into an array. ...
...h all nodes in the body, reduces the set of nodes to elements, simply passes through as
acceptable each node (it could reduce the set in the
acceptnode() method instead), and then makes use of tree walker iterator that is created to advance through the nodes (now all elements) and push them into an array. var treewalker = document.createtreewalker( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); var nodelist = []; var currentnode = treewalker.currentnode; while(currentnode) { nodelist.push(currentnode); currentnode = treewalker.nextnode(); } specifications specification status comment domthe definition of 'document.createtreewalker' in that specification. living standard removed ...
HTMLInputElement - Web APIs
rc attribute, which specifies a uri for the location of an image to display on the graphical submit button, if the value of type is image; otherwise it is ignored. width string: returns / sets the document's width attribute, which defines the width of the image displayed for the button, if the value of type is image. properties that apply only to elements of type file
accept string: returns / sets the element's
accept attribute, containing comma-separated list of file types
accepted by the server when type is file. allowdirs boolean: part of the non-standard directory upload api; indicates whether or not to allow directories and files both to be selected in the file list. implemented only in firefox and is hidden behind a preference. files ...
...: returns / sets the element's
accept attribute, containing comma-separated list of file types
accepted by the server when type is file. allowdirs boolean: part of the non-standard directory upload api; indicates whether or not to allow directories and files both to be selected in the file list. implemented only in firefox and is hidden behind a preference. files returns/
accepts a filelist object, which contains a list of file objects representing the files selected for upload. webkitdirectory boolean: returns the webkitdirectory attribute; if true, the file system picker interface only
accepts directories instead of files. webkitentries array of filesystementry objects: describes the currently selected files or directories. properti...
... htmlinputelement.labels read only nodelist array: returns a list of <label> elements that are labels for this element. step string: returns / sets the element's step attribute, which works with min and max to limit the increments at which a numeric or date-time value can be set. it can be the string any or a positive floating point number. if this is not set to any, the control
accepts only values at multiples of the step value greater than the minimum. valueasdate date object: returns / sets the value of the element, interpreted as a date, or null if conversion is not possible. valueasnumber double: returns the value of the element, interpreted as one of the following, in order: a time value a number nan if conversion is impossible ...
Drag Operations - Web APIs
) 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 dragged to check whether a drop is allowed. for instance, a drop target that
accepts links would check for the type text/uri-list. during a drop event, a listener would retrieve the data being dragged and insert it at the drop location. the drag data's types property returns a list of mime-type like domstrings, such as text/plain or image/jpeg. you can also create your own types. the most commonly used types are listed in the article recommended drag types. a drag may include ...
...n. however, you will commonly wish to call the preventdefault() method only in certain situations (for example, only if a link is being dragged). to do this, call a function which checks a condition and only cancels the event when the condition is met. if the condition is not met, don't cancel the event, and a drop will not occur there if the user releases the mouse button. it is most common to
accept or reject a drop based on the type of drag data in the data transfer — for instance, allowing images, or links, or both. to do this, you can check the types property of the event's datatransfer (property). the types property returns an array of the string types that were added when the drag began, in the order from most significant to least significant. function dodragover(event) { const isl...
...t was previously checked during a dragover event.) in the example here, once the data has been retrieved, we insert the string as the textual content of the target. this has the effect of inserting the dragged text where it was dropped, assuming that the drop target is an area of text such as a p or div element. in a web page, you should call the preventdefault() method of the event if you have
accepted the drop, so that the browser's default handling is not triggered by the dropped data as well. for example, when a link is dragged to a web page, firefox will open the link. by cancelling the event, this behavior will be prevented. you can retrieve other types of data as well. if the data is a link, it should have the type text/uri-list. you could then insert a link into the content. function...
Headers.get() - Web APIs
the latest spec has removed getall(), and updated get() to return all values. specifications specification status comme...
...the latest spec has removed getall(), and updated get() to return all values. specifications specification status comment fetchthe definition of 'get()' in th...
...the latest spec has removed getall(), and updated get() to return all values. specifications specification status comment fetchthe definition of 'get()' in that specification. living standard ...
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
the other hand, the message has a candidate, it's an ice candidate received from the remote peer as part of trickle ice. the candidate is destined to be delivered to the local ice layer by passing it into addicecandidate(). on receiving a description if we received a description, we prepare to respond to the incoming offer or answer. first, we check to make sure we're in a state in which we can
accept an offer. if the connection's signaling state isn't stable or if our end of the connection has started the process of making its own offer, then we need to look out for offer collision. if we're the impolite peer, and we're receiving a colliding offer, we return without setting the description, and instead set ignoreoffer to true to ensure we also ignore all candidates the other side may be send...
... ignore all candidates the other side may be sending us on the signaling channel belonging to this offer. doing so avoids error noise since we never informed our side about this offer. if we're the polite peer, and we're receiving a colliding offer, we don't need to do anything special, because our existing offer will automatically be rolled back in the next step. having ensured that we want to
accept the offer, we set the remote description to the incoming offer by calling setremotedescription(). this lets webrtc know what the proposed configuration of the other peer is. if we're the polite peer, we will drop our offer and
accept the new one. if the newly-set remote description is an offer, we ask webrtc to select an appropriate local configuration by calling the rtcpeerconnection method set...
...nswer to an offer. previously, triggering rollback involved manually checking for rollback conditions and triggering the rollback manually, by setting the local description to one with the type rollback, like this: await pc.setlocaldescription({ type: "rollback" }); doing so returns the local peer to the stable signalingstate from whichever state it had previously been in. since a peer can only
accept offers when in the stable state, the peer has thus rescinded its offer and is ready to receive the offer from the remote (impolite) peer. as we'll see in a moment, there are problems with this approach, however. perfect negotiation with the old api using the previous api to implement incoming negotiation messages during perfect negotiation would look something like this: signaler.onmessage = a...
Signaling and video calling - Web APIs
ests a communication protocol (tcp or udp), ip address, port number, connection type (for example, whether the specified ip is the peer itself or a relay server), along with other information needed to link the two computers together. this includes nat or other networking complexity. note: the important thing to note is this: the only thing your code is responsible for during ice negotiation is
accepting outgoing candidates from the ice layer and sending them across the signaling connection to the other peer when your onicecandidate handler is executed, and receiving ice candidate messages from the signaling server (when the "new-ice-candidate" message is received) and delivering them to your ice layer by calling rtcpeerconnection.addicecandidate(). that's it. the contents of the sdp are irre...
...the connection is not fully established yet, you can begin sending data when you feel it's appropriate to do so. media received before the ice negotiation is completed may be used to help ice decide upon the best connectivity approach to take, thus aiding in the negotiation process. note that for native apps, such as a phone application, you should not begin sending until the connection has been
accepted at both ends, at a minimum, to avoid inadvertently sending video and/or audio data when the user isn't prepared for it. as soon as media is attached to the rtcpeerconnection, a negotiationneeded event is triggered at the connection, so that ice negotiation can be started. if an error occurs while trying to get the local media stream, our catch clause calls handlegetusermediaerror(), which dis...
...ted from the other end). function handleiceconnectionstatechangeevent(event) { switch(mypeerconnection.iceconnectionstate) { case "closed": case "failed": closevideocall(); break; } } here, we apply our closevideocall() function when the ice connection state changes to "closed" or "failed". this handles shutting down our end of the connection so that we're ready start or
accept a call once again. note: we don't watch the disconnected signaling state here as it can indicate temporary issues and may go back to a connected state after some time. watching it would close the video call on any temporary network issue. ice signaling state similarly, we watch for signalingstatechange events. if the signaling state changes to closed, we likewise close the call out. functio...
Writing a WebSocket server in Java - Web APIs
java.net.socket getoutputstream() returns an output stream for this socket. outputstream methods: write(byte[] b, int off, int len) writes len bytes from the specified byte array starting at offset off to this output stream. inputstream method...
...\\r\\n").next(); matcher get = pattern.compile("^get").matcher(data); creating the response is easier than understanding why you must do it in this way. ...
...pute sha-1 and base64 code of it write it back as value of sec-websocket-
accept response header as part of a http response. if (get.find()) { matcher match = pattern.compile("sec-websocket-key: (.*)").matcher(data); match.find(); byte[] response = ("http/1.1 101 switching protocols\r\n" + "connection: upgrade\r\n" + "upgrade: websocket\r\n" + "sec-websocket-
accept: " + base64.getencoder().encodetostring(messagedigest.getinstance("sha-1").digest((match.group(1) + "258eafa5-e914-47da-95ca-c5ab0dc85b11").getbytes("utf-8"))) + "\r\n\r\n").getbytes("utf-8"); out.write(response, 0, response.length); decoding messages after a successful handshake, client can send messages to the server, but now these are encoded. if we send "abcdef", we get t...
<color> - CSS: Cascading Style Sheets
darkgray / darkgrey darkslategray / darkslategrey dimgray / dimgrey lightgray / lightgrey lightslategray / lightslategrey gray / grey slategray / slategrey though many keywords have been adapted from x11, their rgb values may differ from the corresponding color on x11 systems since manufacturers sometimes tailor x11 colors to their specific hardware. note: the list of
accepted keywords has undergone many changes during the evolution of css: css level 1 only included 16 basic colors, called the vga colors as they were taken from the set of displayable colors on vga graphics cards. css level 2 added the orange keyword. although various colors not in the specification (mostly adapted from the x11 colors list) were supported by early browsers, it wasn't until svg 1.
...s the rgb color model defines a given color according to its red, green, and blue components. an optional alpha component represents the color's transparency. syntax rgb colors can be expressed through both hexadecimal (prefixed with #) and functional (rgb(), rgba()) notations. note: as of css colors level 4, rgba() is an alias for rgb(). in browsers that implement the level 4 standard, they
accept the same parameters and behave the same way. hexadecimal notation: #rrggbb[aa] r (red), g (green), b (blue), and a (alpha) are hexadecimal characters (0–9, a–f). a is optional. for example, #ff0000 is equivalent to #ff0000ff. hexadecimal notation: #rgb[a] r (red), g (green), b (blue), and a (alpha) are hexadecimal characters (0–9, a–f). a is optional. the three-digit notation (#rgb...
... it allows hue, saturation, and lightness to each be adjusted independently. hsl can also make it easier to create a set of matching colors (such as when you want multiple shades of a single hue). syntax hsl colors are expressed through the functional hsl() and hsla() notations. note: as of css colors level 4, hsla() is an alias for hsl(). in browsers that implement the level 4 standard, they
accept the same parameters and behave the same way. functional notation: hsl[a](h, s, l[, a]) h (hue) is an <angle> of the color circle given in degs, rads, grads, or turns in css color module level 4. when written as a unitless <number>, it is interpreted as degrees, as specified in css color module level 3. by definition, red=0deg=360deg, with the other colors spread around the circle, so green=1...
filter - CSS: Cascading Style Sheets
values, then all filter functions are interpolated according to their specific rules. otherwise, discrete interpolation is used. functions the filter property is specified as none or one or more of the functions listed below. if the parameter for any function is invalid, the function returns none. except where noted, the functions that take a value expressed with a percent sign (as in 34%) also
accept the value expressed as decimal (as in 0.34). when a single filter property has two or more functions it's results will be different from when two or more filter properties are separately applied with the same functions. svg filter url() takes an uri pointing to an svg filter, which may be embedded in an external xml file. filter: url(resources.svg#c1) filter functions blur() the blur() f...
... url(resources.svg#c1) filter functions blur() the blur() fucntion applies a gaussian blur to the input image. the value of radius defines the value of the standard deviation to the gaussian function, or how many pixels on the screen blend into each other, so a larger value will create more blur. the lacuna value for interpolation is 0. the parameter is specified as a css length, but does not
accept percentage values. filter: blur(5px) <table class="standard-table"> <thead> <tr> <th style="text-align: left;" scope="col">original image</th> <th style="text-align: left;" scope="col">live example</th> <th style="text-align: left;" scope="col">svg equivalent</th> <th style="text-align: left;" scope="col">static example</th> </tr> </thead> <tbody> <...
...ng: 5px; border: 1px solid rgb(204, 204, 204); text-align: left; vertical-align: top; width:25%; height:auto; } #img3 { height:100%; } drop-shadow() the drop-shadow() function applies a drop shadow effect to the input image. a drop shadow is effectively a blurred, offset version of the input image's alpha mask drawn in a particular color, composited below the image. the function
accepts a parameter of type <shadow> (defined in css3 backgrounds), with the exception that the inset keyword is not allowed. this function is similar to the more established box-shadow property; the difference is that with filters, some browsers provide hardware acceleration for better performance. the parameters of the <shadow> parameter are as follows: <offset-x> <offset-y> (required) these are t...
font-weight - CSS: Cascading Style Sheets
culation; see the meaning of relative weights section below. <number> a <number> value between 1 and 1000, inclusive. higher numbers represent weights that are bolder than (or as bold as) lower numbers. certain commonly used values correspond to common weight names, as described in the common weight name mapping section below. ...
...rsions of the font-weight specification, the property
accepts only keyword values and the numeric values 100, 200, 300, 400, 500, 600, 700, 800, and 900; non-variable fonts can only really make use of these set values, although fine-grained values (e.g. 451) will be translated to one of these values for non-variable fonts using the fallback weights system. css fonts level 4 extends the syntax to
accept any number between 1 and 1000 and introduces variable fonts, which can make use of this much finer-grained range of font weights. fallback weights if the exact weight given is unavailable, then the following rule is used to determine the weight actually rendered: if the target weight given is between 400 and 500 inclusive: look for available weights between the target and 500, in asce...
...to two steps heavier than normal but less than a standard bold. */ div { font-weight: 600; } /* set span text to be one step lighter than its parent. */ span { font-weight: lighter; } result specifications specification status comment css fonts module level 4the definition of 'font-weight' in that specification. working draft defines font-weight to
accept any numbers between 1 and 1000. css fonts module level 3the definition of 'font-weight' in that specification. candidate recommendation no change. css level 2 (revision 1)the definition of 'font-weight' in that specification. recommendation no change. css level 1the definition of 'font-weight' in that specification. recommendation initial definition. ...
<input type="email"> - HTML: Hypertext Markup Language
tted properly. ...
...utomatic validation that the entered text is at least in the correct form to potentially be a legitimate e-mail address. this can help avoid cases in which the user mistypes their address, or provides an invalid address. it's important, however, to note that this is not enough to ensure that the specified text is an e-mail address which actually exists, corresponds to the user of the site, or is
acceptable in any other way. it simply ensures that the value of the field is properly formatted to be an e-mail address. note: it's also crucial to remember that a user can tinker with your html behind the scenes, so your site must not use this validation for any security purposes. you must verify the e-mail address on the server side of any transaction in which the provided text may have any securit...
...l"> notice that it's considered valid when empty and when a single validly-formatted e-mail address is entered, but is otherwise not considered valid. by adding the required attribute, only validly-formed e-mail addresses are allowed; the input is no longer considered valid when empty. allowing multiple e-mail addresses by adding the multiple boolean attribute, the input can be configured to
accept multiple e-mail addresses. <input id="emailaddress" type="email" multiple> the input is now considered valid when a single e-mail address is entered, or when any number of e-mail addresses separated by commas and, optionally, some number of whitespace characters are present. note: when multiple is used, the value is allowed to be empty. some examples of valid strings when multiple is spec...
<input type="month"> - HTML: Hypertext Markup Language
ument.queryselector('input[type="month"]'); monthcontrol.value = '1978-06'; additional attributes in addition to the attributes common to <input> elements, month inputs offer the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options max the latest year and month to
accept as a valid input min the earliest year and month to
accept as a valid input readonly a boolean which, if present, indicates that the input's value can't be edited step a stepping interval to use when incrementing and decrementing the value of the input field list the values of the list attribute is the id of a <datalist> element located in the same docu...
...vides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. max the latest year and month, in the string format discussed in the value section above, to
accept. ...
...if the value of the element is less than this, the element fails constraint validation. if a value is specified for min that isn't a valid year and month string, the input has no minimum value. this value must be a year-month pairing which is earlier than or equal to the one specified by the max attribute. ...
<input type="tel"> - HTML: Hypertext Markup Language
ng (""). ...
...this particular pattern is obviously only useful for certain locales — in a real application you'd probably have to vary the pattern used depending on the locale of the user. examples in this example, we present a simple interface with a <select> element that lets the user choose which country they're in, and a set of <inp...
...pan:after { position: absolute; content: '✖'; padding-left: 5px; color: #8b0000; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; color: #009000; } notice how the entered value is reported as invalid unless the pattern xxx-xxx-xxxx is matched; for instance, 41-323-421 won't be
accepted. neither will 800-mdn-rocks. however, 865-555-6502 will be
accepted. this particular pattern is obviously only useful for certain locales — in a real application you'd probably have to vary the pattern used depending on the locale of the user. examples in this example, we present a simple interface with a <select> element that lets the user choose which country they're in, and a set of <input type="tel"> elements to let them enter each part of their phone n...
<input type="time"> - HTML: Hypertext Markup Language
hh%3amm, or name=hh%3amm%3ass if seconds are included (see using the step attribute). ...
...onal attributes in addition to the attributes common to all <input> elements, time inputs offer the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options max the latest time to
accept, in the syntax described under time value format min the earliest time to
accept as a valid input readonly a boolean attribute which, if present, indicates that the contents of the time input should not be user-editable step the stepping interval to use both for user interfaces purposes and during constraint validation unlike many data types, time values have a periodic domain, meaning that the values reach the highest possible value, then wrap ...
...t located in the same document. the <datalist> provides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. max a string indicating the latest time to
accept, specified in the same time value format as described above. if the specified string isn't a valid time, no maximum value is set. min a string specifying the earliest time to
accept, given in the time value format described previously. if the value specified isn't a valid time string, no minimum value is set. readonly a boolean attribute which, if present, means this field cannot be edited by...
Standard metadata names - HTML: Hypertext Markup Language
t is unaware of color schemes and should simply be rendered using the default color palette. [light | dark]+ one or more color schemes supported by the document. specifying the same color scheme more than once has the same effect as specifying it only once. indicating multiple color schemes indicates that the first scheme is preferred by the document, but that the second specified scheme is
acceptable if the user prefers it. only light indicates that the document only supports light mode, with a light background and dark foreground colors. by specification, only dark is not valid, because forcing a document to render in dark mode when it isn't truly compatible with it can result in unreadable content; all major browsers default to light mode if not otherwise configured. for exa...
...n unreadable content; all major browsers default to light mode if not otherwise configured. for example, to indicate that a document prefers dark mode but does render functionally in light mode as well: <meta name="color-scheme" content="dark light"> this works at the document level in the same way that the css color-scheme property lets individual elements specify their preferred and
accepted color schemes. your styles can adapt to the current color scheme using the prefers-color-scheme css media feature. the css device adaptation specification defines the following metadata name: viewport: gives hints about the size of the initial size of the viewport. used by mobile devices only. values for the content of <meta name="viewport"> value possible su...
...eriencing low vision conditions from being able to read and understand page content. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 see also the @viewport css at-rule. other metadata names the whatwg wiki metaextensions page contains a large set of non-standard metadata names that have not been formally
accepted yet; however, some of the names included there are already used quite commonly in practice — including the following: creator: the name of the creator of the document, such as an organization or institution. if there are more than one, several <meta> elements should be used. googlebot, a synonym of robots, is only followed by googlebot (the indexing crawler for google). publisher: the na...
Compression in HTTP - HTTP
ble way for the user. video formats on the web are lossy; the jpeg image format is also lossy. some formats can be used for both loss-less or lossy compression, like webp, and usually lossy algorithm can be configured to compress more or less, which then of course leads to less or more quality. for better performance of a web site, it is ideal to compress as much as possible, while keeping an
acceptable level of quality. for images, an image generated by a tool could be not optimized enough for the web; it is recommended to use tools that will compress as much as possible with the required quality. there are numerous tools that are specialized for this. lossy compression algorithms are usually more efficient than loss-less ones. as compression works better on a specific kind of files, it ...
...ithm to use. these algorithm are optimized for text. in the 1990s, compression technology was advancing at a rapid pace and numerous successive algorithms have been added to the set of possible choices. nowadays, only two are relevant: gzip, the most common one, and br the new challenger. to select the algorithm to use, browsers and servers use proactive content negotiation. ...
... as compression brings significant performance improvements, it is recommended to activate it for all files, but already compressed ones like images, audio files and videos. ...
Device-Memory - HTTP
the device-memory header is a device memory api header that works like client hints header which represents the approximate amount of ram client device has. header type request header forbidden header name ? note: client hints are accessible only on secure origins (via tls). server has to opt in to receive device-memory header from the client by sending
accept-ch and
accept-ch-lifetime response headers. syntax the amount of device ram can be used as a fingerprinting variable, so values for the header are intentionally coarse to reduce the potential for its misuse. the header takes on the following values: 0.25, 0.5, 1, 2, 4, 8. device-memory: <number> examples server first needs to opt in to receive device-memory header by sending the response h...
... editor's draft initial definition. ...
... syntax the amount of device ram can be used as a fingerprinting variable, so values for the header are intentionally coarse to reduce the potential for its misuse. the header takes on the following values: 0.25, 0.5, 1, 2, 4, 8. device-memory: <number> examples server first needs to opt in to receive device-memory header by sending the response headers
accept-ch containing device-memory and
accept-ch-lifetime.
accept-ch: device-memory
accept-ch-lifetime: 86400 then on subsequent requests the client might send device-memory header back: device-memory: 1 specifications specification status comment device memory 1the definition of 'device-memory' in that specification. editor's draft initial definition. ...
TE - HTTP
the te request header specifies the transfer encodings the user agent is willing to
accept. (you could informally call it
accept-transfer-encoding, which would be more intuitive). in http/2 - the te header field is only
accepted if the trailers value is set. see also the transfer-encoding response header for more details on transfer encodings. note that chunked is always
acceptable for http/1.1 recipients and you don't have to specify "chunked" using the te header. however, it is useful for setting if the client is
accepting trailer fields in a chunked transfer coding using the "trailers" value. header type request header forbidden header name yes syntax te: compress te: deflate te: gzip te: trailers // multiple directives, weighted with the quality value syn...
... is
accepting trailer fields in a chunked transfer coding using the "trailers" value. header type request header forbidden header name yes syntax te: compress te: deflate te: gzip te: trailers // multiple directives, weighted with the quality value syntax: te: trailers, deflate;q=0.5 directives compress a format using the lempel-ziv-welch (lzw) algorithm is
accepted as a transfer coding name. deflate using the zlib structure is
accepted as a transfer coding name. gzip a format using the lempel-ziv coding (lz77), with a 32-bit crc is
accepted as a transfer coding name. trailers indicates that the client is willing to
accept trailer fields in a chunked transfer coding. ...
... lempel-ziv-welch (lzw) algorithm is
accepted as a transfer coding name. deflate using the zlib structure is
accepted as a transfer coding name. gzip a format using the lempel-ziv coding (lz77), with a 32-bit crc is
accepted as a transfer coding name. trailers indicates that the client is willing to
accept trailer fields in a chunked transfer coding. q when multiple transfer codings are
acceptable, the q parameter of the quality value syntax can rank codings by preference. specifications specification title rfc 7230, section 4.3: te hypertext transfer protocol (http/1.1): message syntax and routing ...
OPTIONS - HTTP
in this example, we will request permission for these parameters: the access-control-request-method header sent in the preflight request tells the server that when the actual request is sent, it will have a post request method. the access-control-request-headers header tells the server that when the actual request is sent, it will have the x-pingother and content-type...
... for these parameters: the access-control-request-method header sent in the preflight request tells the server that when the actual request is sent, it will have a post request method. the access-control-request-headers header tells the server that when the actual request is sent, it will have the x-pingother and content-type headers. options /resources/post-here/ http/1.1 host: bar.example
accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
accept-language: en-us,en;q=0.5
accept-encoding: gzip,deflate 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 th...
...her and content-type headers. access-control-max-age the above permissions may be cached for 86,400 seconds (1 day). ...
Protocol upgrade mechanism - HTTP
d by clients that choose to use it; it cannot be added using the xmlhttprequest.setrequestheader() method. sec-websocket-key: key key the key for this request to upgrade. the client adds this if it wishes to do so, and the server will include in the response a key of its own, which the client will validate before delivering the upgrade response to you. the server's response's sec-websocket-
accept header will have a value computed based upon the specified key. sec-websocket-protocol the sec-websocket-protocol header specifies one or more websocket protocols that you wish to use, in order of preference. the first one that is supported by the server will be selected and returned by the server in a sec-websocket-protocol header included in the response. you can use this more than once in th...
...ed list of the supported protocol versions. if the server does support the requested protocol version, no sec-websocket-version header is included in the response. sec-websocket-version: supportedversions supportedversions a comma-delineated list of the websocket protocol versions supported by the server. response-only headers the response from the server may include these. ...
...comma-delineated list of the websocket protocol versions supported by the server. response-only headers the response from the server may include these. sec-websocket-
accept included in the response message from the server during the opening handshake process when the server is willing to initiate a websocket connection. it will appear no more than once in the response headers. sec-websocket-
accept: hash hash if a sec-websocket-key header was provided, the value of this header is computed by taking the value of the key, concatenating the string "258eafa5-e914-47da-95ca-c5ab0dc85b11" to it, taking the sha-1 hash of that concatenated string, resulting in a 20-byte value. that value is then base64 encoded to obtain the value of this property. references websocket api http specificat...
HTTP range requests - HTTP
http range requests allow 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 curl, for example. curl -i http://i.imgur.com/z4d4kwk.jpg http/1.1 200 ok ... ...
...l 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 curl, for example. curl -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 requests. some sites also explicitly send "none" as a value, indicating no support. ...
...it indicates the part(s) of a document that the server should return. ...
<mstyle> - MathML
attributes dir overall directionality of formulas. possible values are either ltr (left to right) or rtl (right to left). decimalpoint this attribute is specifying the character for the alignment point within <mstack> and <mtable> columns, if the decimalpoint value is used to specify the alignment. displaystyle a boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. ...
...the main effect is that larger versions of operators are displayed, when displaystyle is set to true. see also largeop and movablelimits on <mo>. infixlinebreakstyle specifies the default linebreakstyle to use for infix operators. the values before, after and duplicate are allowed. scriptlevel controls mostly the font-size. the higher the scriptlevel, the smaller the font size. this attribute
accepts a non-negative integer, as well as a "+" or a "-" sign, which increments or decrements the current value. in addition, the scriptlevel attribute can never reduce the font size below scriptminsize in order to avoid unreadable small font sizes and depends on the multiplier specified in scriptsizemultiplier. scriptminsize specifies a minimum font size allowed due to changes in scriptlevel. the de...
...low scriptminsize in order to avoid unreadable small font sizes and depends on the multiplier specified in scriptsizemultiplier. scriptminsize specifies a minimum font size allowed due to changes in scriptlevel. the default value is 8pt. scriptsizemultiplier specifies the multiplier to be used to adjust font size due to changes in scriptlevel. the default value is 0.71. the <mstyle> element
accepts all attributes of all presentation elements with the following exceptions: height, depth or width do not apply to <mglyph>, <mpadded> or <mtable>. rowalign, columnalign, or groupalign do not apply to <mtr>, <mlabeledtr>, <mtd> or <maligngroup>. lspace or voffset do not apply to <mpadded>. fontfamily does not apply to <mglyph>. align does not apply to <mtable> or <mstack>. index cannot be...
MathML documentation index - MathML
, mathml, needsbeginnerupdate we will now prove the pythagorean theorem: 6 mathml attribute reference mathml, mathml reference this is an alphabetical list of mathml attributes. more details for each attribute are available on particular element pages. 7 values guide, mathml, mathml reference several mathml presentation elements have attributes that
accept length values used for size or spacing. mathml
accepts different units and constants for specifying lengths. 8 mathml documentation index index, mathml found 40 pages: 9 mathml element reference mathml, mathml reference this is an alphabetical list of mathml presentation elements. 10 <maction> mathml, mathml reference, mathml:element, mathm...
...athml reference, mathml:element, mathml:general layout schemata the mathml <mphantom> element is rendered invisibly, but dimensions (such as height, width, and baseline position) are still kept. 25 <mroot> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mroot> element is used to display roots with an explicit index. two arguments are
accepted, which leads to the syntax: <mroot> base index </mroot>. 26 <mrow> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mrow> element is used to group sub-expressions, which usually contain one or more operators with their respective operands (such as <mi> and <mn>). this element renders as a horizontal row containing its arguments. 27...
... 28 <mspace> mathml, mathml reference, mathml:element, mathml:token elements the mathml <mspace> element is used to display a blank space, whose size is set by its attributes. 29 <msqrt> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <msqrt> element is used to display square roots (no index is displayed). the square root
accepts only one argument, which leads to the following syntax: <msqrt> base </msqrt>. 30 <mstyle> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mstyle> element is used change the style of its children. it
accepts all attributes of all mathml presentation elements with some exceptions and additional attributes listed below. 31 <msub>...
base64 - Archive of obsolete content
oding using base64 algorithms. var base64 = require("sdk/base64"); var encodeddata = base64.encode("hello, world"); var decodeddata = base64.decode(encodeddata); globals functions encode(data, charset) creates a base-64 encoded ascii string from a string of binary data. parameters data : string the data to encode charset : string the charset of the string to encode (optional). the only
accepted value is "utf-8". in order to encode and decode unicode strings, the charset parameter needs to be set: var base64 = require("sdk/base64"); var encodeddata = base64.encode(unicodestring, "utf-8"); returns string : the encoded string decode(data, charset) decodes a string of data which has been encoded using base-64 encoding. parameters data : string the encoded data charset : string ...
...in order to encode and decode unicode strings, the charset parameter needs to be set: var base64 = require("sdk/base64"); var decodeddata = base64.decode(encodeddata, "utf-8"); returns string : the decoded string ...
stylesheet/utils - Archive of obsolete content
helper functions for working with stylesheets. globals functions loadsheet(window, uri, type) synchronously loads a style sheet from uri and adds it to the list of additional style sheets of the document. the sheets added takes effect immediately, and only on the document of the window given. parameters window : nsidomwindow uri : string, nsiuri} type : string the type of the sheet. ...
...if not provided, the default value is "author". istypevalid(type) verifies that the type given is a valid stylesheet's type. the values considered valid are: "agent", "user" and "author". parameters type : string the type of the sheet. returns boolean : true if the type given is valid, otherwise false. ...
test/utils - Archive of obsolete content
t, done) { search().on('end', function (results) { assert.equal(results, 0, 'should be no bookmarks'); done(); }); }; before(exports, function (name, assert, done) { removeallbookmarksasync(function () { done(); }); }); require('sdk/test').run(exports); globals functions before(exports, beforefn) runs beforefn before each test in the file. may be asynchronous if beforefn
accepts a third argument, which is a callback. parameters exports : object a test file's exports object beforefn : function the function to be called before each test. it has two arguments, or three if it is asynchronous: the first argument is the test's name as a string. the second argument is the assert object for the test. the third, optional, argument is a callback. if the callback is defi...
... asynchronous: the first argument is the test's name as a string. the second argument is the assert object for the test. the third, optional, argument is a callback. if the callback is defined, then the beforefn is considered asynchronous, and the callback must be invoked before the test runs. after(exports, afterfn) runs afterfn after each test in the file. may be asynchronous if afterfn
accepts a third argument, which is a callback. parameters exports : object a test file's exports object afterfn : function the function to be called after each test. it has two arguments, or three if it is asynchronous: the first argument is the test's name as a string. the second argument is the assert object for the test. the third, optional, argument is a callback. if the callback is define...
jpm-mobile - Archive of obsolete content
n also chat with other sdk users in #jetpack on mozilla's irc network. command reference there are currently two jpm commands: jpm-mobile run launch an instance of firefox with your add-on installed. jpm-mobile test runs your add-on's unit tests. jpm-mobile run this command runs a new instance of firefox with the add-on installed: jpm-mobile run jpm-mobile run
accepts the following options: --adb /path/to/adb provides the path to adb. -b --binary binary use the package name of firefox specified in binary. jpm-mobile run -b fennec you can get the package name by following command. $ adb shell pm list packages | grep org.mozilla package:org.mozilla.firefox $ jpm-mobile run -b firefox # the package name is firefox ...
... package name by following command. $ adb shell pm list packages | grep org.mozilla package:org.mozilla.firefox $ jpm-mobile run -b firefox # the package name is firefox -v --verbose verbose operation. jpm-mobile test jpm-mobile test see the tutorial on unit testing and the reference documentation for the assert module for more details on this. jpm-mobile test
accepts the following options: --adb /path/to/adb provides the path to adb. -b --binary binary use the package name of firefox specified in binary. jpm-mobile test -b fennec you can get the package name by following command. $ adb shell pm list packages | grep org.mozilla package:org.mozilla.firefox $ jpm-mobile run -b firefox # the package name is firefox ...
Creating Event Targets - Archive of obsolete content
part of a module to access the browser's places api. it will emit events when the user adds and visits bookmarks, enabling users of the module to listen for these events using the sdk's standard event api. using the places api first, let's write some code using places api that logs the uris of bookmarks the user adds. create a new directory called "bookmarks", navigate to it, and run jpm init,
accepting all the defaults. then open "index.js" and add the following code: var {cc, ci} = require("chrome"); var { xpcomutils } = require("resource://gre/modules/xpcomutils.jsm"); var bookmarkservice = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); var bookmarkobserver = { onitemadded: function(aitemid, afolder, aindex) { co...
...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, contenturl: "https://en.wikipedia.org/w/index.php" }); if ...
Signing an XPI - Archive of obsolete content
> signtool -g mytestcert -d . -p"password" using certificate directory: . warning: performing this operation while the browser is running could cause corruption of your security databases. if the browser is currently running, you should exit the browser before continuing this operation. enter "y" to continue, or anything else to abort: y enter certificate information. all fields are optional.
acceptable characters are numbers, letters, spaces, and apostrophes. certificate common name: xpi test organization: tjworld organization unit: software state or province: nottingham country (must be exactly 2 characters): gb username: tj email address: certificates@lan.tjworld.net generated public/private key pair certificate request generated certificate has been signed certificate "mytestcert" added ...
...eceived an automated email requesting documentary evidence of my id in the form of a photo-id or similar. i have hi-resolution scanned images of my passport and drivers license for these situations so i placed them on my web-server temporarily in a hidden location and emailed unizeto certum with the details and location of the files. within a few hours i received a confirmation email from a human
accepting the id images and giving me a hyperlink to the certifcate download area. install the certificate into mozilla firefox (which goes with the private key created earlier), and copy/paste the displayed certificate text into a new file called c:\projects\codesigning\certum code signing.cer. installing real certificate there are two steps required to install the new certificate in the code signin...
Search Extension Tutorial (Draft) - Archive of obsolete content
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. ...
...t 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 add-on uninstall, is to make such changes in the default preference branch, as explained below. while the technical details below are important to understand, a library which encapsulates the appropriate logic is provided along with the example add-on at the end, and should be used where possible. changing default prefer...
jspage - Archive of obsolete content
{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.options.issuccess||this.issuccess;this.headers=new hash(this.options...
...retrieve("load:options")){this.set("load",a);}this.store("load",new request.html(this.retrieve("load:options"))); }return this.retrieve("load");}};element.implement({load:function(){this.get("load").send(array.link(arguments,{data:object.type,url:string.type}));return this; }});request.json=new class({extends:request,options:{secure:true},initialize:function(a){this.parent(a);this.headers.extend({
accept:"application/json","x-request":"json"}); },success:function(a){this.response.json=json.decode(a,this.options.secure);this.onsuccess(this.response.json,a);}}); ...
Mozilla Crypto FAQ - Archive of obsolete content
y services source code to be used in as many contexts as possible; for example, the psm and nss code can be used in mozilla under mpl terms, and can also be used in gnu and other projects under gpl terms. if you create and distribute modifications to the original psm and nss code, we ask that you in turn make such modifications available under both the mpl and gpl. ...
...new contributions of crypto code should also be reviewed and approved by the appropriate mozilla module owners, just as with any other mozilla contributions. ...
New Skin Notes - Archive of obsolete content
or is to bright. it's less readable than the old one. i'd suggest to use the color from cavedish. -- gandalf that was my first thought, too. -- axelhecht ok, i'll tone the main link colour down a bit. --dria page title needs "development skin" removed. -- dria the skin looks nice, but the links on the right are too small. if this is going to be the default skin used by editors, they are un
acceptably small. --nickolay 01:59, 25 aug 2005 (pdt) i'm planning on doing up a special skin for editors in the future (with the edit tools and such closer to the top, etc). in the meantime, i'll bump the font size of those links up. --dria but if the editors use a different skin, they won't have an easy way to make sure the pages look good to end-users. --nickolay 04:43, 25 aug 2005 (pdt) the skin ...
... anymore, but the width remains wasted anyway. in the case of a story book, small text columns do seem reasonable, but i don't think this is nice for technical documentation which requires usage of tables, etc... wikipedia's side bar is smaller, btw, probably for the same reasons. since i manage a number of sites for which i must respect quality standards at 800 pixels width for compatibility (we
accept break 640 compatibility nowadays except for sites intended for pdas/ppcs), i find myself needing to use ctrl+- with the devmo wikki currently, not to change my global settings of course, which are fine and factory-default, working well with the other sites i visit regularily or manage... thanks again --mmondor future fixes in l10n versions there all heading links are wrong - main link and doc...
Tamarin-central rev 703:2cee46be9ce0 - Archive of obsolete content
tamarin-central rev 703:2cee46be9ce0 was declared stable on 12/02/08. the announcement sent to tamarin-devel can be read here. testing summary
acceptance tests have passed on the following supported platforms: * windows, 32 & 64 bit * mac ox x ppc & intel, 32 bit * linux, 32 bit * windows mobile arm version asc-4200 of the actionscript compiler was used for all tests. performance testsuite time metric the following is a comparison of the current tamarin-central (tc-703) versus the prior build (tc-700) as well as current against the vm in flash player 10. the key takeaway is that the interpreter is much improved. osdefault-jitinterpretedaggressive jit mac (os/x 10.4 inte...
...re)n/an/an/a vm code size the following is a comparison of the current tamarin-central compiled size (tc-703) versus the prior build (tc-700) as well as the current build against the vm in flash player 10. buildsize flash10576k tc-700740k tc-703655k known issues known failures in the
acceptance testsuite include: number failures in testsuite when running on linux windows mobile system.privatebytes and -memstats privatebytes always returns 0 amd64 longjmp hack needs reengineering on non-windows platforms different runtime errors when -dforcemir set in
acceptance test run arm: math failures running with thumb or arm jit and interp. ...
When To Use ifdefs - Archive of obsolete content
itional that differentiates between different build configurations. when are ifdefs used? there are three major kinds of ifdefs in use in the mozilla tree: platform/widget ifdefs, feature ifdefs, and application-specific ifdefs: platform/widget ifdefs the mozilla code will frequently need to differentiate between code for different platforms or widget sets. these ifdefs are generally always
acceptable. the only time when they might be a problem is in cross-platform extension code and locales: since this code is downloaded on multiple platforms, platform-specific ifdefs are generally out of the question. for an example of platform-specfic ifdefs, see nscrt.h. feature ifdefs the mozilla code has many features that can be enabled or disabled by configure flags. for instance, it is possible...
...re flags, care must be taken to obey the build dependencies. for instance, xpcom, the spidermonkey javascript engine, and the networking engine do not know anything about xul and should not have any ifdefs based on --disable-xul. one special "feature ifdef" that deserves special attention is "moz_xul_app". this variable marks any application that is using the "toolkit". moz_xul_app ifdefs are not
acceptable in tier 9, but are
acceptable (even necessary) in later tiers. for an example of feature ifdefs, see layout/makefile.in. application-specific ifdefs finally, each application/project needs to build different pieces of code. application ifdefs should only be made in application-specific code. this is the trickiest kind of ifdef, because it is frequently hard to determine what code is "share...
Attribute (XUL) - Archive of obsolete content
« xul reference home acceltext accessible accesskey activetitlebarcolor afterselected align allowevents allownegativeassertions alternatingbackground alwaysopenpopup attribute autocheck autocompleteenabled autocompletepopup autocompletesearch autocompletesearchparam autofill autofillaftermatch autoscroll beforeselected buttonaccesskey
accept buttonaccesskeycancel buttonaccesskeydisclosure buttonaccesskeyextra1 buttonaccesskeyextra2 buttonaccesskeyhelp buttonalign buttondir buttondisabled
accept buttonlabel
accept buttonlabelcancel buttonlabeldisclosure buttonlabelextra1 buttonlabelextra2 buttonlabelhelp buttonorient buttonpack buttons checked checkstate clicktoscroll class closebutton closemenu coalesceduplicatearcs collapse collapsed colo...
...y key keycode keytext label lastpage lastselected last-tab left linkedpanel max maxheight maxlength maxpos maxrows maxwidth member menu menuactive min minheight minresultsforpopup minwidth mode modifiers mousethrough movetoclick multiline multiple name negate newlines next noautofocus noautohide noinitialfocus nomatch norestorefocus object observes onbefore
accept onbookmarkgroup onchange onclick onclosetab oncommand oncommandupdate ondialog
accept ondialogcancel ondialogclosure ondialogextra1 ondialogextra2 ondialoghelp onerror onerrorcommand onextra1 onextra2 oninput onload onnewtab onpageadvanced onpagehide onpagerewound onpageshow onpaneload onpopuphidden onpopuphiding onpopupshowing onpopupshown onsearchcomplete onselect ...
XUL Events - Archive of obsolete content
the keyup event is sent to an element that has the focus when a key is released. attribute: onkeyup load this event is sent to the window after it has been fully loaded. you should place this event handler on the window element. this event may also be used on the image element, or an element that
accepts an image attribute, and will be fired when the image has finished loading. for images, this event does not bubble up the element tree, so it will not conflict with the window's load event. attribute: onload mousedown this event is sent when the mouse is pressed on an element but not released. ...
... drag the drag event is sent to the source node (the node that was dragged) several times a second while the drag is occurring. attribute: ondrag dragdrop this event is sent when the user releases the mouse button to drop an object being dragged. the element, if it
accepts the drop, should respond in some manner such inserting the dragged object into itself. attribute: ondragdrop dragend the dragend event is sent to the source node (the node that was dragged) when the drag is finished. attribute: ondragend ...
button - Archive of obsolete content
items, is normally preferred to use of the attribute, as it may need to update additional state. dlgtype type: one of the values below the dialog type of the button, used only when the button is in a dialog box. you can use this feature to replace the standard dialog box buttons with custom buttons, yet the dialog event methods will still function. for example, if the dlgtype is set to
accept, the button will replace the dialog box's
accept button, which is usually labeled ok. using this attribute on a button that is not in a dialog box has no effect. the following values can be used as the dialog type:
accept the ok button, which will
accept the changes when pressed. cancel the cancel button which will cancel the operation. help a help button for displaying help about...
.... only one button from each group can be checked at a time. if the user selects one the buttons, the others in the group are unchecked. icon mozilla 1.8 type: string this attribute should be used to set the usage for common buttons. some platforms display these buttons with a small icon indicating their usage. this should be used in place of the image attribute. possible values include:
accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. if you are using a button that matches one of these common usages, use the icon attribute to indicate this. see the appearance of the different icons on some available platforms. image type: uri the uri of the image to appear o...
tab - Archive of obsolete content
been selected during the current session, or has changed since the last time it was selected. this attribute is not present if the tab is not unread. validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the images are stored remotely or you plan on swapping the image frequently. 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 accesskey type: character gets and sets the value of the accesskey attribute. accessibletype type: integer a value indicating t...
... also, "unhiding" a tab leads to unpredictable ordering of the tabs. see bug 307088 and bug 261826. use collapsed instead of hidden. related elements tabbox, tabs, tabpanels, tabpanel. interfaces nsiaccessibleprovider, nsidomxulselectcontrolitemelement ...
toolbarbutton - Archive of obsolete content
uitems, is normally preferred to use of the attribute, as it may need to update additional state. dlgtype type: one of the values below the dialog type of the button, used only when the button is in a dialog box. you can use this feature to replace the standard dialog box buttons with custom buttons, yet the dialog event methods will still function. for example, if the dlgtype is set to
accept, the button will replace the dialog box's
accept button, which is usually labeled ok. using this attribute on a button that is not in a dialog box has no effect. the following values can be used as the dialog type:
accept the ok button, which will
accept the changes when pressed. cancel the cancel button which will cancel the operation. help a help button for displaying help about...
...es: type value <toolbarbutton > menu menu-button checkbox radio validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the images are stored remotely or you plan on swapping the image frequently. 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 accesskey type: character gets and sets the value of the accesskey attribute. accessibletype type: integer a value indicating the t...
Syndicating content with RSS - Archive of obsolete content
quired, support of this is recommended, especially for web sites and applications with high performance needs. the http protocol, one of the core technologies behind the web, provides a way of prioritizing the content type that an http client prefers to receive. this technique takes advantage by having the client prefer rss (over html or other formats). ...
... the http protocol, one of the core technologies behind the web, provides a way of prioritizing the content type that an http client prefers to receive. this technique takes advantage by having the client prefer rss (over html or other formats). here's a simple example of it being done:
accept: application/rss+xml, text/html with real production software, though, it would look more like this:
accept: application/rss+xml, application/xhtml+xml, text/html here's a more complete example: get / http/1.1 host: example.com
accept: application/rss+xml, application/xhtml+xml, text/html when an http server (or server-side script) gets this, it should redirect the http client to the feed. it should do this with an http 302 found. something like: http/1.1 302 found location: http://example.com/fe...
Introduction to Public-Key Cryptography - Archive of obsolete content
a dialog box requesting the user's name and password for that server. the user must supply a name and password separately for each new server the user wishes to use during a work session. the client sends the name and password across the network, either in the clear or over an encrypted ssl connection. the server looks up the name and password in its local password database and, if they match,
accepts them as evidence authenticating the user's identity. the server determines whether the identified user is permitted to access the requested resource, and if so allows the client to access it. with this arrangement, the user must supply a new password for each server, and the administrator must keep track of the name and password for each user, typically on separate servers. proper implementa...
...he client's identity before the encrypted ssl session can be established. for an overview of client authentication over ssl and how it differs from password-based authentication, see "authentication confirms an identity". for more detailed information about ssl, see "introduction to ssl." signed and encrypted email some email programs support digitally signed and encrypted email using a widely
accepted protocol known as secure multipurpose internet mail extension (s/mime). using s/mime to sign or encrypt email messages requires the sender of the message to have an s/mime certificate. an email message that includes a digital signature provides some assurance that it was in fact sent by the person whose name appears in the message header, thus providing authentication of the sender. if the dig...
Security - Archive of obsolete content
ications. this document introduces the basic concepts of public-key cryptography. for an overview of ssl, see "introduction to ssl." for an overview of encryption and decryption, see "encryption and decryption." information on digital signatures is available from "digital signatures." introduction to sslthis document introduces the secure sockets layer (ssl) protocol. ...
...ayer (ssl) protocol. ssl has been universally
accepted on the world wide web for authenticated and encrypted communication between clients and servers.nspr release engineering guidethis paper is for engineers performing formal release for the netscape portable runtime (nspr) across all platforms.ssl and tlsthe secure sockets layer (ssl) and transport layer security (tls) protocols are universally
accepted standards for authenticated and encrypted communication between clients and servers. both client and server authentication occur over ssl/tls. ...
New in JavaScript 1.8.5 - Archive of obsolete content
function.prototype.bind() creates a new function that, when called, itself calls this function in the context provided (with a given sequence of arguments). bug 429507 new ecmascript5 features get and set operators now allows the identifier to be numeric or a string. bug 520696 function.apply() can
accept any array-like object as the arguments list, instead of only true arrays. strict mode support array.tostring() now works even on non-arrays by either returning the result of calling its join() method if one is available or by calling its tostring() method. other standardization work various non-standard syntaxes for defining getters and se...
...1 format date strings. global objects made read only: the nan, infinity, and undefined global objects have been made read only, per the ecmascript 5 specification. obj.__parent__ and obj.__count__ become obsolete. some information about why: spidermonkey change du jour: the special __parent__ property has been removed bug 551529 & bug 552560. trailing commas no longer
accepted in json.parse(). ...
Object.observe() - Archive of obsolete content
the object.observe() method was used for asynchronously observing the changes to an object. it provided a stream of changes in the order in which they occur. however, this api has been deprecated and removed from browsers. you can use the more general proxy object instead. syntax object.observe(obj, callback[,
acceptlist]) parameters obj the object to be observed. callback the function called each time changes are made, with the following argument: changes an array of objects each representing a change. the properties of these change objects are: name: the name of the property which was changed. object: the changed object after the change was made. type: a string indicating the type of change taking place. one of "add", "update", or "delete". oldvalue: on...
...es an array of objects each representing a change. the properties of these change objects are: name: the name of the property which was changed. object: the changed object after the change was made. type: a string indicating the type of change taking place. one of "add", "update", or "delete". oldvalue: only for "update" and "delete" types. the value before the change.
acceptlist the list of types of changes to be observed on the given object for the given callback. if omitted, the array ["add", "update", "delete", "reconfigure", "setprototype", "preventextensions"] will be used. return value the object to be observed. description callback is called each time a change is made to obj, with an array of all changes in the order in which they occurred. examples lo...
Anatomy of a video game - Game development
looks at the anatomy and workflow of the average video game from a technical point of view, in terms of how the main loop should run. it helps beginners to the modern game development arena understand what is required when building a game and how web standards like javascript lend themselves as tools. experienced game programmers who are new to web development could also benefit, too. present,
accept, interpret, calculate, repeat the goal of every video game is to present the user(s) with a situation,
accept their input, interpret those signals into actions, and calculate a new situation resulting from those acts. games are constantly looping through these stages, over and over, until some end condition occurs (such as winning, losing, or exiting to go to bed). not surprisingly, this pattern...
...over, until some end condition occurs (such as winning, losing, or exiting to go to bed). not surprisingly, this pattern corresponds to how a game engine is programmed. the specifics depend on the game. some games drive this cycle by user input. imagine that you are developing a "find the differences between these two similar pictures"-type game. these games present two images to the user; they
accept their click (or touch); they interpret the input as a success, failure, pause, menu interaction, etc.; finally, they calculate an updated scene resulting from that input. the game loop is advanced by the user's input and sleeps until they provide it. this is more of a turn-based approach that doesn't demand a constant update every frame, only when the player reacts. other games demand control ov...
Audio for Web games - Game development
disabled before playback has been initiated. buffering is the process of the browser downloading the media in advance, which we often need to do to ensure smooth playback. the htmlmediaelement interface comes with lots of properties to help determine whether a track is in a state to be playable. note: in many ways the concept of buffering is an outdated one. as long as byte-range requests are
accepted (which is the default behavior), we should be able to jump to a specific point in the audio without having to download the preceding content. however, preloading is still useful — without it, there would always need to be some client-server communication required before playing can commence. concurrent audio playback a requirement of many games is the need to play more than one piece of au...
...d more flexible with the more advanced web audio api. let's look at this next. element and associated htmlmediaelement api, but it becomes much easier and more flexible with the more advanced web audio api. let's look at this next. web audio api for games the web audio api is supported across all modern desktop and mobile browsers, with the exception of opera mini. with that in mind, it's an
acceptable approach for many situations to use the web audio api (see the can i use web audio api page for more on browser compatibility). the web audio api is an advanced audio javascript api that is ideal for game audio. developers can generate audio and manipulate audio samples as well as positioning sound in 3d game space. a feasible cross-browser strategy would be to provide basic audio using the ...
CORS-safelisted request header - MDN Web Docs Glossary: Definitions of Web-related terms
a cors-safelisted request header is one of the following http headers:
accept,
accept-language, content-language, content-type. when containing only these headers (and values that meet the additional requirements laid out below), a requests doesn't need to send a preflight request in the context of cors. ...
...ow), a requests doesn't need to send a preflight request in the context of cors. you can safelist more headers using the access-control-allow-headers header and also list the above headers there to circumvent the following additional restrictions: additional restrictions cors-safelisted headers must also fulfill the following requirements in order to be a cors-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/...
Forbidden header name - MDN Web Docs Glossary: Definitions of Web-related terms
name (in contrast with a forbidden response header name). modifying such headers is forbidden because the user agent retains full control over them. names starting with `sec-` are reserved for creating new headers safe from apis using fetch that grant developers control over headers, such as xmlhttprequest. ...
...st with a forbidden response header name). modifying such headers is forbidden because the user agent retains full control over them. names starting with `sec-` are reserved for creating new headers safe from apis using fetch that grant developers control over headers, such as xmlhttprequest. ...
Quality values - MDN Web Docs Glossary: Definitions of Web-related terms
ned for the first two values, the order in the list is irrelevant. nevertheless, with the same quality, more specific values have priority over less specific ones: text/html;q=0.8,text/*;q=0.8,*/*;q=0.8 value priority text/html 0.8 (but totally specified) text/* 0.8 (partially specified) */* 0.8 (not specified) some syntax, like the one of
accept, allow additional specifiers like text/html;level=1. these increase the specificity of the value. their use is extremely rare. browser-specific information firefox starting with firefox 18, the quality factor values are clamped to 2 decimal places. they used to be clamped to only 1 decimal place in earlier versions (bug 672448). more information http headers using q-values in their syntax:...
... allow additional specifiers like text/html;level=1. these increase the specificity of the value. their use is extremely rare. browser-specific information firefox starting with firefox 18, the quality factor values are clamped to 2 decimal places. they used to be clamped to only 1 decimal place in earlier versions (bug 672448). more information http headers using q-values in their syntax:
accept,
accept-charset,
accept-language,
accept-encoding, te. ...
Signature (functions) - MDN Web Docs Glossary: Definitions of Web-related terms
utomatically while the program is being processed. a signature in javascript can still give you some information about the method: myobject.prototype.myfunction(value) the method is installed on an object called myobject. the method is installed on the prototype of myobject (thus it is an instance method) as opposed to being a static method. the name of the method is myfunction. the method
accepts one parameter, which is called value and is not further defined. signatures in java in java, signatures are used to identify methods and classes at the level of the virtual machine code. you have to declare types of variables in your code in order to be able to run the java code. java is strictly typed and will check any parameters at compilation time if they are correct. public static void ...
...t compilation time if they are correct. public static void main(string[] args) the public keyword is an access modifier and indicates that this method can be called by any object. the static keyword indicates that this method is a class method as opposed to being an instance method. the void keyword indicates that this method has no return value. the name of the method is main. the method
accepts one parameter of type string array. it is named args. learn more general knowledge java internal type signatures on wikipedia ...
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
var xinclude = xincludes[i]; var href = xinclude.getattribute('href'); var parse = xinclude.getattribute('parse'); var xpointer = xinclude.getattribute('xpointer'); var encoding = xinclude.getattribute('encoding'); // e.g., utf-8 // "text/xml or application/xml or matches text/*+xml or application/*+xml" before encoding (then utf-8) var
accept = xinclude.getattribute('
accept'); // header "
accept: "+x var
acceptlanguage = xinclude.getattribute('
accept-language'); // "
accept-language: "+x var xifallback = xinclude.getelementsbytagnamens('http://www.w3.org/2001/xinclude', 'fallback')[0]; // only one such child is allowed if (href === '' || href === null) { // points to same document if empty (null is eq...
... sites if (href !== null) { var response, responsetype; var request = new xmlhttprequest(); request.open('get', href, false); request.setrequestheader('if-modified-since', 'thu, 1 jan 1970 00:00:00 gmt'); request.setrequestheader('cache-control', 'no-cache'); if (
accept) { request.setrequestheader('
accept',
accept); } if (
acceptlanguage) { request.setrequestheader('
accept-language',
acceptlanguage); } switch (parse) { case 'text': // priority should be on media type: ...
CSS and JavaScript accessibility best practices - Learn web development
ffect, because it doesn't stop screen readers from getting to it. on the other hand, you shouldn't use visibility:hidden or display:none, because they do hide content from screen readers. unless of course, there is a good reason why you want this content to be hidden from screen readers. note: invisible content just for screen reader users has a lot more useful detail surrounding this topic. ...
...eaders from getting to it. on the other hand, you shouldn't use visibility:hidden or display:none, because they do hide content from screen readers. unless of course, there is a good reason why you want this content to be hidden from screen readers. note: invisible content just for screen reader users has a lot more useful detail surrounding this topic.
accept that users can override styles
accept that users can override your styles it is possible for users to override your styles with their own custom styles, for example: see sarah maddox's how to use a custom style sheet (css) with firefox for a useful guide covering how to do this manually in firefox, and how to use a custom style sheet (css) with internet explorer by adrian gordon for the equivalent ie instructions. it is probably...
Fundamental text and font styling - Learn web development
tell. but it was a rare occasion such as this that he did.</p> you can find the finished example on github (see also the source code.) color the color property sets the color of the foreground content of the selected elements (which is usually the text, but can also include a couple of other things, such as an underline or overline placed on text using the text-decoration property). color can
accept any css color unit, for example: p { color: red; } this will cause the paragraphs to become red, rather than the standard browser default black, like so: <h1>tommy the cat</h1> <p>well i remember it as though it were a meal ago...</p> <p>said tommy the cat as he reeled back to clear whatever foreign matter may have nestled its way into his mighty throat. many a fat alley rat had met its ...
... text-decoration: sets/unsets text decorations on fonts (you'll mainly use this to unset the default underline on links when styling them.) available values are: none: unsets any text decorations already present. underline: underlines the text. overline: gives the text an overline. line-through: puts a strikethrough over the text. you should note that text-decoration can
accept multiple values at once, if you want to add multiple decorations simultaneously, for example text-decoration: underline overline. also note that text-decoration is a shorthand property for text-decoration-line, text-decoration-style, and text-decoration-color. you can use combinations of these property values to create interesting effects, for example text-decoration: line-through red wavy. let...
Getting started with HTML - Learn web development
function(){ // we only want to save the state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; boolean attributes sometimes you will see attributes written without values. this is entirely
acceptable. these are called boolean attributes. boolean attributes can only have one value, which is generally the same as the attribute name. for example, consider the disabled attribute, which you can assign to form input elements. (you use this to disable the form input elements so the user can't make entries. the disabled elements typically have a grayed-out appearance.) for example: <input type="...
...an attributes can only have one value, which is generally the same as the attribute name. for example, consider the disabled attribute, which you can assign to form input elements. (you use this to disable the form input elements so the user can't make entries. ...
Working with Svelte stores - Learn web development
d: false } ] </script> <alert /> <todos bind:todos={$todos} /> try it out; everything should work. next we'll see how to define our own custom stores. how to implement a store contract: the theory you can create your own stores without relying on svelte/store by implementing the store contract. ...
...a store with a set() method is called a writable store. ...
Handling common JavaScript problems - Learn web development
arrow functions). for a quick example, see arrow-function.html (see the source code also). arrow functions are supported across all modern browsers, except for ie and safari. declaring strict mode at the top of your javascript code causes it to be parsed with a stricter set of rules, meaning that more warnings and errors will be thrown, and some things will be disallowed that would otherwise be
acceptable. it is arguably a good idea to use strict mode, as it makes for better, more efficient code, however it has limited/patchy support across browsers (see strict mode in browsers). typed arrays allow javascript code to access and manipulate raw binary data, which is necessary as browser apis for example start to manipulate streams of raw video and audio data. these are available in ie10 and abo...
...d. for example, you could use feature detection to determine whether a feature is supported; if it isn't, you could then run code to load a polyfill or a library to handle the lack of support. feature detection the idea behind feature detection is that you can run a test to determine whether a javascript feature is supported in the current browser, and then conditionally run code to provide an
acceptable experience both in browsers that do and don't support the feature. as a quick example, the geolocation api (which exposes available location data for the device the web browser is running on) has a main entry point for its use — a geolocation property available on the global navigator object. therefore, you can detect whether the browser supports geolocation or not by using something like ...
Package management basics - Learn web development
environment later on, or even publish the package to the npm registry (although this is somewhat beyond the scope of this article). type the following command, making sure you are inside the parcel-experiment directory: npm init you will now be asked some questions; npm will then create a default package.json file based on the answers: name: a name to identify the app. just press return to
accept the default parcel-experiment. version: the starting version number for the app: again, just press return to
accept the default 1.0.0. description: a quick description of the app's purpose. type in something really simple, like "a simple npm package to learn about using npm", then press return. entry point: this will be the top-level javascript file of the app. the default index.js is fine for...
... about using npm", then press return. entry point: this will be the top-level javascript file of the app. the default index.js is fine for now — press return. test command, git repository, and keywords: press return to leave each of these blank for now. author: the author of the project. type your own name, and press return. license: the license to publish the package under: press return to
accept the default for now. press return one more time to
accept these settings. go into your parcel-experiment directory and you should now find you've got a package.json file. open it up and it should look something like this: { "name": "parcel-experiment", "version": "1.0.0", "description": "a simple npm package to learn about using npm", "main": "index.js", "scripts": { "test": "ec...
Command line options
ofile" note: profile_dir must not exist and you must not already have a profile called profile_name. -migration start with import wizard. -new-instance open new instance, not a new window in running instance, which allows multiple copies of application to be open at a time. firefox -new-instance -p "another profile" note: not available for windows, see bug 855899. -no-remote do not
accept or send remote commands. implies -new-instance. firefox -no-remote -p "another profile" note: since firefox 9, this does really mean what its name implies on all platforms, i.e. instances created with this parameter do not
accept or send remote commands, see bug 650078. that means that such instances won't be re-used. also when using this argument a new instance is created in any case. -ove...
...d launch application with the profile named profile_name. useful for dealing with multiple profiles. firefox -p "joel user" note: profile_name is case sensitive. if you don't specify a profile name then the profile manager is opened instead. you must use an upper case p on linux with versions older than 7.x, as there lower case invokes purify mode (memory and leak detection). other platforms
accept both upper and lower case. -profile "profile_path" start with the profile with the given path. firefox, thunderbird and seamonkey2.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 -brow...
Mozilla Content Localized in Your Language
rved? other regional calendar observed? time format how is time expressed in your language? including 0-24 hr expression, hour, minute and second. percentages how are percentages expressed in your language? digit groups how are digit groups expressed in your language? example: 1.23 (decimal separator) or 1,000 (thousand separator) using comma or period. ...
...cluding 0-24 hr expression, hour, minute and second. percentages how are percentages expressed in your language? digit groups how are digit groups expressed in your language? example: 1.23 (decimal separator) or 1,000 (thousand separator) using comma or period. acronyms do you translate widely
accepted acronyms such as cd, dvd, mb? if translated, is there an equavilent acronym and widely
accepted in the language? gender are there exceptions to standard gender conventions within your language? if so, what are they? tone/register what is the appropriate tone for your translations? does it vary by product and target audience? if so, how? what are formality to avoid? list products and their tones if different. capitalization what is the appropriate form of expressing capitalization i...
Localizing with Mozilla Translator
the directory structure will look like this: (ab-cd jar root) locale |-- branding | |-- brand.dtd | `-- brand.properties |-- browser | |-- aboutdialog.dtd . . |-- browser-region | `-- region.properties `-- ab-cd |-- alerts | `-- notificationnames.properties |-- autoconfig | `-- autoconfig.properties |-- cookie | |-- cookie
acceptdialog.dtd | `-- cookie
acceptdialog.properties |-- global | |-- about.dtd | |-- apppicker.dtd . . but in the cvs and mozilla-central repositories the locale part looks like this: toolkit |-- locales | |-- en-us | | |-- chrome | | | |-- alerts | | | | `-- notificationnames.properties | | | |-- autoconfig | | ...
...bout.dtd | |-- apppicker.dtd . . but in the cvs and mozilla-central repositories the locale part looks like this: toolkit |-- locales | |-- en-us | | |-- chrome | | | |-- alerts | | | | `-- notificationnames.properties | | | |-- autoconfig | | | | `-- autoconfig.properties | | | |-- cookie | | | | |-- cookie
acceptdialog.dtd | | | | `-- cookie
acceptdialog.properties | | | |-- global | | | | |-- about.dtd | | | | |-- apppicker.dtd . . browser |-- locales | |-- en-us | | |-- readme.txt | | |-- chrome | | | |-- branding | | | | |-- brand.dtd | | | | `-- brand.properties | | | |-- browser | | | | |-- abou...
Mozilla Quirks Mode Behavior
xtarea. give form a margin-bottom:1em (bug 41806). in quirks mode css class and id names are case insensitive. in standards mode they are case sensitive. (this also applies to getelementsbyclassname.) stylesheets linked in the document with an advisory mime type of text/css will still be treated as css even if the server gives a content-type header other than text/css. the css parser
accepts colors not beginning with #, except in shorthands. the 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 s...
... one pixel. obsolete since gecko 1.9 (firefox 3) the basic table layout strategy ignores padding (on what) in quirks mode. obsolete since gecko 1.9 (firefox 3) the basic table layout strategy handles widths differently in some way. obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in quirks mode absmiddle (handled incorrectly?) and middle (perhaps incorrectly as well?) are
accepted as values of align on table cells, and absmiddle, abscenter, and middle are supported on tables (treated the same as center). removed in bug 559834 and bug 573322, though middle and absmiddle in table cells work in all modes now. in quirks mode, percentage values are supported on the cellspacing attribute, but treated as pixels (bug 106336). obsolete since gecko 13.0 (firefox 13.0 / thunde...
DMD
which blocks refer to a particular block. dmd.py --clamp-contents needs to be run on the log first. see this other page for an overview of how to use heap scan mode to fix a leak involving refcounted objects. options runtime when you run mach run --dmd you can specify additional options to control how dmd runs. run mach help run for documentation on these. the most interesting one is --mode.
acceptable values are dark-matter (the default), live, cumulative, and scan. another interesting one is --stacks.
acceptable values are partial (the default) and full. in the former case most blocks will not have an allocation stack trace recorded. however, because larger blocks are more likely to have one recorded, most allocated bytes should have an allocation stack trace even though most allocated b...
...range 2..10 are often good. the maximum is 24. -a / --ignore-alloc-frames. many allocation stack traces start with multiple frames that mention allocation wrapper functions, e.g. js_calloc() calls replace_calloc(). this option filters these out. it often helps improve the quality of the output when using a small --max-frames value. -s / --sort-by. this controls how records are sorted.
acceptable values are usable (the default), req, slop and num-blocks. --clamp-contents. for a heap scan log, this performs a conservative pointer analysis on the contents of each block, changing any value that is a pointer into the middle of a live block into a pointer to the start of that block. all other values are changes to null. in addition, all trailing nulls are removed from the block contents...
NSPR Contributor Guide
abstract: nspr
accepts contributions in the form of bugfixes, new features, libraries, platform ports, documentation, test cases and other items from many sources. we (the nspr module owners) sometimes disappoint our contributors when we must reject their contributions. we reject contributions for a variety of reasons. some of these reasons are not obvious to an outside observer. nspr wishes to document some guidelines for those who would contribute to nspr. these guidelines should help the contributor in crafting his contribution, increasing its likelihood for
acceptance. general guidelines downward compatibility because many different applications, besides the mozilla client, use the nspr api, the api must remain downward compatible across even major releases. this means that the ...
... may be a substantial effort in making a candidate feature for nspr, talk to us. we may tell you that you have a good idea; we may say that it really is not a good candidate for inclusion in nspr; we may give you suggestions on what would make it more generalized, hence a good candidate for inclusion in nspr. use bugzilla to track your work. be verbose. nspr wants you to document your work. if we
accept it, we are going to have to answer questions about it and/or maintain it. these are some guidelines for new apis that you may add to nspr. header file descriptions. provide header file descriptions that fully document your public typedefs, enums, macros and functions. see: prshm.h as an example of how your header file(s) should be documented. source file descriptions. provide descriptive document...
Optimizing Applications For NSPR
windows. this means that nspr threads use a shadow stack to preserve context across a thread switch. at thread switch time, the stack of the current running thread is copied to other storage associated with that thread and the about-to-be-dispatched thread's stack data is copied back onto the windows stack just before the thread is given control. this has disastrous implications on the generally
accepted programming practice of taking the address of a stack variable and giving that address to another thread. consider that the windows stack is swapped in and out with each thread switch. the thread that created a stack variable sees his own stack variables correctly across thread switches. however, another thread does not see the data as intended because the stack has been swapped out to the sha...
...ual processors and nt's fiber abstraction as the locally scheduled threads. the fibers are nice because much of the nt api understands them. but they are not really preemptable, and that can lead to problems, depending on the needs of your application. the mode (blocking or nonblocking) of a socket cannot be changed at will once the socket has been used. also, the new socket created by an <tt>pr_
accept()</tt> call on a listening socket inherits the mode of the listening socket, and cannot be changed. a file descriptor is not usable after an io operation on it fails with either <tt>pr_io_timeout_error</tt> or <tt>pr_io_interrupt_error</tt>. the only thing you can do is to close the file descriptor. see the faq article for more info. there is no current workaround. you must write your program wi...
PR_OpenTCPSocket
n, a pointer to the prfiledesc object created for the newly opened tcp socket. if the creation of a new tcp socket failed, null. description tcp (transmission control protocol) is a connection-oriented, reliable byte-stream protocol of the tcp/ip protocol suite. pr_opentcpsocket creates a new tcp socket of the address family af. a tcp connection is established by a passive socket (the server)
accepting a connection setup request from an active socket (the client). typically, the server binds its socket to a well-known port with pr_bind, calls pr_listen to start listening for connection setup requests, and calls pr_
accept to
accept a connection. the client makes a connection request using pr_connect. after a connection is established, the client and server may send and receive data between e...
...calls pr_listen to start listening for connection setup requests, and calls pr_
accept to
accept a connection. the client makes a connection request using pr_connect. after a connection is established, the client and server may send and receive data between each other. to receive data, one can call pr_read or pr_recv. to send data, one can call pr_write, pr_writev, pr_send, or pr_transmitfile. pr_
acceptread is suitable for use by the server to
accept a new client connection and read the client's first request in one function call. a tcp connection can be shut down by pr_shutdown, and the sockets should be closed by pr_close. ...
NSS Certificate Download Specification
in all cases the certificates are x509 version 1, 2, or 3. binary formats nss's certificate loader will recognize several binary formats. they are: der encoded certificate: this is a single binary der encoded certificate. pkcs#7 certificate chain: this is a single pkcs#7 signeddata object. ...
...chain is being imported then the first certificate in the chain must be the user certificate, and any subsequent certificates will be added as untrusted ca certificates to the local database. application/x-x509-ca-cert the certificate being downloaded represents a certificate authority. when it is downloaded the user will be shown a sequence of dialogs that will guide them through the process of
accepting the certificate authority and deciding if they wish to trust sites certified by the ca. if a certificate chain is being imported then the first certificate in the chain must be the ca certificate, and any subsequent certificates will be added as untrusted ca certificates to the local database. application/x-x509-email-cert the certificate being downloaded is a user certificate belonging to an...
NSS 3.30 release notes
in ssl.h ssl_alertreceivedcallback - register a callback function, that will be called whenever an ssl/tls alert is received ssl_alertsentcallback - register a callback function, that will be called whenever an ssl/tls alert is sent ssl_setsessionticketkeypair - configures an asymmetric key pair, for use in wrapping session ticket keys, used by the server. this function currently only
accepts an rsa public/private key pair. new macros in ciferfam.h pkcs12_aes_cbc_128, pkcs12_aes_cbc_192, pkcs12_aes_cbc_256 - cipher family identifiers corresponding to the pkcs#5 v2.1 aes based encryption schemes used in the pkcs#12 support in nss in pkcs11n.h cka_nss_mozilla_ca_policy - identifier for a boolean pkcs#11 attribute, that should be set to true, if a ca is pres...
...ate key pair. new macros in ciferfam.h pkcs12_aes_cbc_128, pkcs12_aes_cbc_192, pkcs12_aes_cbc_256 - cipher family identifiers corresponding to the pkcs#5 v2.1 aes based encryption schemes used in the pkcs#12 support in nss in pkcs11n.h cka_nss_mozilla_ca_policy - identifier for a boolean pkcs#11 attribute, that should be set to true, if a ca is present because of it's
acceptance according to the mozilla ca policy notable changes in nss 3.30 the tls server code has been enhanced to support session tickets when no rsa certificate (e.g. only an ecdsa certificate) is configured. rsa-pss signatures produced by key pairs with a modulus bit length that is not a multiple of 8 are now supported. the pk12util tool now supports importing and exporting data encrypted...
NSS tools : ssltab
where x is the sequence number of the certificate. if the -s option is used with -h, two separate parts are printed for each record: the plain hex/ascii output, and the parsed ssl output. -x turn on hex/ascii printing of undecoded data inside parsed ssl records. used only with the -s option. this option uses the same output format as the -h option. -l prefix turn on looping; that is, continue to
accept connections rather than stopping after the first connection is complete. -p port change the default rendezvous port (1924) to another port. the following are well-known port numbers: * http 80 * https 443 * smtp 25 * ftp 21 * imap 143 * imaps 993 (imap over ssl) * nntp 119 * nntps 563 (nntp over ssl) usage and examples you can use the ssl debugging tool to intercept any connection information. al...
...he command shell window. to output a basic, printable interpretation of the data, use the -h option, or, if you are looking at an ssl connection, the -s option. you will notice that the page you retrieved looks incomplete in the browser. this is because, by default, the tool closes down after the first connection is complete, so the browser is not able to load images. to make the tool continue to
accept connections, switch on looping mode with the -l option. the following examples show the output from commonly used combinations of options. example 1 $ ssltap.exe -sx -p 444 interzone.mcom.com:443 > sx.txt output connected to interzone.mcom.com:443 -->; [ alloclen = 66 bytes [ssl2] clienthellov2 { version = {0x03, 0x00} cipher-specs-length = 39 (0x27) sid-length = 0 (0x00) challenge-length = 16 (0...
NSS tools : ssltap
where x is the sequence number of the certificate. if the -s option is used with -h, two separate parts are printed for each record: the plain hex/ascii output, and the parsed ssl output. -x turn on hex/ascii printing of undecoded data inside parsed ssl records. used only with the -s option. this option uses the same output format as the -h option. -l prefix turn on looping; that is, continue to
accept connections rather than stopping after the first connection is complete. -p port change the default rendezvous port (1924) to another port. the following are well-known port numbers: * http 80 * https 443 * smtp 25 * ftp 21 * imap 143 * imaps 993 (imap over ssl) * nntp 119 * nntps 563 (nntp over ssl) usage and examples you can use the ssl debugging tool to intercept any connection information. al...
...he command shell window. to output a basic, printable interpretation of the data, use the -h option, or, if you are looking at an ssl connection, the -s option. you will notice that the page you retrieved looks incomplete in the browser. this is because, by default, the tool closes down after the first connection is complete, so the browser is not able to load images. to make the tool continue to
accept connections, switch on looping mode with the -l option. the following examples show the output from commonly used combinations of options. example 1 $ ssltap.exe -sx -p 444 interzone.mcom.com:443 > sx.txt output connected to interzone.mcom.com:443 -->; [ alloclen = 66 bytes [ssl2] clienthellov2 { version = {0x03, 0x00} cipher-specs-length = 39 (0x27) sid-length = 0 (0x00) challenge-length = 16 (0...
sslintro.html
call. it is also possible to force the handshake explicitly with ssl_forcehandshake or repeat it explicitly with ssl_rehandshake. once the ssl sockets have been configured, authentication and encryption happen automatically whenever you use the communication functions from the nspr library. a server application typically uses these functions to establish a connection: pr_bind pr_listen pr_
accept pr_getsockname a client application typically uses these functions to establish a connection: pr_gethostbyname pr_enumeratehostent pr_connect pr_getconnectstatus when an application imports a socket into ssl after the tcp connection on that socket has already been established, it must call ssl_resethandshake to determine whether ssl should behave like an ssl client or an ssl server. n...
...et into ssl after the tcp connection on that socket has already been established, it must call ssl_resethandshake to determine whether ssl should behave like an ssl client or an ssl server. note that this step would not be necessary if the socket weren't already connected. for an ssl socket that is configured before it is connected, ssl figures this out when the application calls pr_connect or pr_
accept. if the socket is already connected before ssl gets involved, you must provide this extra hint. functions that can be used by both clients and servers during communication include the following: pr_send or pr_write pr_read or pr_recv pr_geterror pr_getpeername pr_sleep pr_malloc pr_free pr_poll pr_now pr_intervaltomilliseconds pr_millisecondstointerval pr_shutdown pr_cl...
NSS Tools ssltap
0x, where x is the sequence number of the certificate. if the -s option is used with -h, two separate parts are printed for each record: the plain hex/ascii output, and the parsed ssl output. -x turn on hex/ascii printing of undecoded data inside parsed ssl records. used only with the -s option. this option uses the same output format as the -h option. -l turn on looping; that is, continue to
accept connections rather than stopping after the first connection is complete. -p port change the default rendezvous port (1924) to another port. the following are well-known port numbers: http 80 https 443 smtp 25 ftp 21 imap 143 imaps 993 (imap over ssl) nntp 119 nntps 563 (nntp over ssl) examples you can use the ssl debugging tool to intercept any connection informati...
...e command shell window. to output a basic, printable interpretation of the data, use the -h option, or, if you are looking at an ssl connection, the -s option. you will notice that the page you retrieved looks incomplete in the browser. this is because, by default, the tool closes down after the first connection is complete, so the browser is not able to load images. to make the tool continue to
accept connections, switch on looping mode with the -l option. the following examples show the output from commonly used combinations of options. example 1 the s and x options in this example turn on ssl parsing and show undecoded values in hex/ascii format. the output is routed to a text file. command ssltap.exe -sx -p 444 interzone.mcom.com:443 > sx.txt output output connected to ...
NSS tools : ssltap
with -h, two separate parts are printed for each record: the plain hex/ascii output, and the parsed ssl output. -x turn on hex/ascii printing of undecoded data inside parsed ssl records. used only with the -s option. this option uses the same output format as the -h option. -l prefix turn on looping; that is, continue to
accept connections rather than stopping after the first connection is complete. -p port change the default rendezvous port (1924) to another port. the following are well-known port numbers: * http 80 * https 443 * smtp 25 * ftp 21 * imap 143 * imaps 993 (imap over ssl) * nntp 119 ...
...indow. to output a basic, printable interpretation of the data, use the -h option, or, if you are looking at an ssl connection, the -s option. you will notice that the page you retrieved looks incomplete in the browser. this is because, by default, the tool closes down after the first connection is complete, so the browser is not able to load images. to make the tool continue to
accept connections, switch on looping mode with the -l option. the following examples show the output from commonly used combinations of options. example 1 $ ssltap.exe -sx -p 444 interzone.mcom.com:443 > sx.txt output connected to interzone.mcom.com:443 -->; [ alloclen = 66 bytes [ssl2] clienthellov2 { version = {0x03, 0x00} cipher-specs-length = 39 (0...
JS_PropertyStub
not designed to be called directly by a jsapi application. rather, they are convenient stand-ins anywhere the jsapi requires callbacks of certain types. examples at jsclass illustrate how stub functions can be used. js_propertystub is of type jspropertyop, the type of getter callback. it can be used in jsclass.addproperty, and jsclass.getproperty. it behaves exactly like a property callback that
accepts the default property behavior: it does nothing and returns true. js_strictpropertystub is of type jsstrictpropertyop, the type of setter callback. it can be used in jsclass.setproperty. it behaves exactly like a property callback that
accepts the default property behavior: it does nothing and returns true. js_deletepropertystub is of type jsdeletepropertyop, the type of setter callback. it can...
... js_enumeratestub is a stub for jsclass.enumerate. it does nothing and returns true. js_resolvestub is a stub for jsclass.resolve. it does nothing and returns true. ...
SpiderMonkey 1.8.5
rind option to suppress superflous error messages triggered by the garbage collector. this also means that objects will be finalized in a non-deterministic order in spidermonkey 1.8.5. this is not a bug, and, any embedding which depends upon deterministic finalization is fatally flawed. typed rooting api the rooting api has been changed from an error-prone void ** interface to an interface which
accepts pointers to specific types. js_addroot has been replaced by js_addobjectroot, js_addvalueroot and js_addstringroot; similar changes were made for js_addnamedroot and js_removeroot. since jsdoubles are now stored in the jsval, instead of on the heap, we no longer need to define roots for them. compartments spidermonkey 1.8.5 introduces the concept of compartments. a compartment is a global obje...
...e the compiler might optimize away important stack/register roots (such as when we access the jschars in a jsstring). a c analogue, js_anchorptr, was introduced with bug 630209. bug 630209 also removed the need for js_newscriptobject, by modifying the script compilation interfaces to handle the creation and management of the object wrapper directly; similarly, the script execution interfaces now
accept a jsobject pointer than a pointer to jsscript. affected interfaces are: js_compilescript js_compilescriptforprincipals js_compilescriptforprincipalsversion js_compileucscript js_compileucscriptforprincipals js_compileucscriptforprincipalsversion js_compilefile js_compilefilehandle js_compilefilehandleforprincipals js_compilefilehandleforprincipalsversion js_compilefunction js_compile...
SpiderMonkey 1.8.7
rind option to suppress superflous error messages triggered by the garbage collector. this also means that objects will be finalized in a non-deterministic order in spidermonkey 1.8.5. this is not a bug, and, any embedding which depends upon deterministic finalization is fatally flawed. typed rooting api the rooting api has been changed from an error-prone void ** interface to an interface which
accepts pointers to specific types. js_addroot has been replaced by js_addobjectroot, js_addvalueroot and js_addstringroot; similar changes were made for js_addnamedroot and js_removeroot. since jsdoubles are now stored in the jsval, instead of on the heap, we no longer need to define roots for them. compartments spidermonkey 1.8.5 introduces the concept of compartments. a compartment is a global obje...
... the compiler might optimize away important stack/register roots (such as when we access the jschars in a jsstring). a c analogue, js_anchorptr, was introduced with bug 630209. bug 630209 also removed the need for js_newscriptobject, by modifying the script compilation interfaces to handle the creation and management of the object wrapper directly; similarly, the script execution interfaces now
accept a jsobject pointer than a pointer to jsscript. affected interfaces are: js_compilescript js_compilescriptforprincipals js_compilescriptforprincipalsversion js_compileucscript js_compileucscriptforprincipals js_compileucscriptforprincipalsversion js_compilefile js_compilefilehandle js_compilefilehandleforprincipals js_compilefilehandleforprincipalsversion js_compilefunction js_compile...
nsICommandLine
cified argument. this is the full text of that argument, so if the argument is a flag, the returned value is "-flag [<flagvalue>]". exceptions thrown ns_error_invalid_arg the specified index is out of bounds. handleflag() finds the specified flag, removing it from the array of flags. reports whether or not the specified flag was found. this is useful for boolean flags; that is, flags that don't
accept a parameter. you can determine if the flag was provided and remove it from the list of flags waiting to be processed in one operation. boolean handleflag( in astring aflag, in boolean acasesensitive ); parameters aflag the flag name to find and remove. acasesensitive whether to do case-sensitive comparisons. return value true if the flag was found, otherwise false. handleflagwithparam() fi...
...arameters aflag the flag name to find and remove. acasesensitive whether to do case-sensitive comparisons. return value true if the flag was found, otherwise false. handleflagwithparam() finds a flag in the list of flags waiting to be processed and returns its value, after removing both the flag and its value from the list of flags waiting to be handled. this is useful for processing flags that
accept a value. this is, essentially, a helper method that combines findflag() and removearguments() into one operation. astring handleflagwithparam( in astring aflag, in boolean acasesensitive ); parameters aflag the flag name to find and remove. acasesensitive whether to do case-sensitive flag search. return value the value of the specified flag, an empty string if the flag's value is the empty...
nsIContentPrefService2
rt any special significance to global preferences; they're simply name-value pairs that aren't associated 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. ...
...this parameter relates to private browsing and determines the kind of storage that a method uses, either the usual permanent storage or temporary storage set() aside for private browsing sessions. pass null to unconditionally use permanent storage. ...
nsICookieManager2
he cookie is set. presence of a leading dot indicates a domain cookie; otherwise, the cookie is treated as a non-domain cookie. see rfc2109 for details. the host string will be normalized to ascii or ace; any trailing dot will be stripped. to be a domain cookie, the host must have at least two subdomain parts (e.g. '.foo.com', not '.com'), otherwise an exception will be thrown. an empty string is
acceptable (e.g. file:// uri's). apath the path within the domain for which the cookie is valid. aname the cookie name. avalue the cookie data. aissecure true if the cookie should only be sent over a secure connection. aishttponly true if the cookie should only be sent to, and can only be modified by, an http connection. aissession true if the cookie should exist for the current session only...
...ly of the host portion of the uri and should not contain a leading dot, port number, or other information. return value the number of matching cookies found. findmatchingcookie() obsolete since gecko 1.9 (firefox 3) find whether a matching cookie already exists, and how many cookies a given host has already set. this is useful when e.g. prompting the user whether to
accept a given cookie. boolean findmatchingcookie( in nsicookie2 acookie, out unsigned long acountfromhost ); parameters acookie the cookie to look for. acountfromhost the number of cookies found whose hosts are the same as, or subdomains of, the host field of acookie. return value true if a cookie was found which matches the host, path, and name fields of acookie. getcookiesfromhost() ...
nsICookiePromptService
the nsicookiepromptservice interface is to open a dialog to ask to permission to
accept the cookie. extensions/cookie/nsicookiepromptservice.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview long cookiedialog(in nsidomwindow parent, in nsicookie cookie, in acstring hostname, in long cookiesfromhost, in boolean changingcookie, out boolean rememberdecision); constants constant value description deny_cookie 0 holds the value for a denying the cookie.
accept_cookie 1 holds the value for
accepting the cookie.
accept_session_cookie 2 holds the value for
accepting the session cookie. methods cookiedialog() opens a dialog that asks for permission to
accept a cookie. long cookiedialog( ...
...e dialog. cookie the cookie about which permission is being requested. hostname the host that wants to set the cookie, not the domain; this is part of the cookie. cookiesfromhost the number of cookies there are already for this host. changingcookie are we changing this cookie? rememberdecision should we set the matching permission for this host? return value returns 0 for denying a cookie, 1 for
accepting a cookie, and 2 for
accepting cookie for the current session only. see also nsicookie nsicookie2 nsicookiemanager nsicookiemanager2 ...
nsILocaleService
.9 (firefox 3) implemented by: @mozilla.org/intl/nslocaleservice;1. to use this service, use: var localeservice = components.classes["@mozilla.org/intl/nslocaleservice;1"] .getservice(components.interfaces.nsilocaleservice); method overview nsilocale getapplicationlocale(); astring getlocalecomponentforuseragent(); nsilocale getlocalefrom
acceptlanguage(in string
acceptlanguage); nsilocale getsystemlocale(); nsilocale newlocale(in astring alocale); nsilocale newlocaleobject(in nsilocaledefinition localedefinition); obsolete since gecko 1.9 methods getapplicationlocale() gets the user preference for locale from the operating system. note: this has nothing to do with the locale used for localization of the ...
...etlocalecomponentforuseragent() gets the user preference for locale from the operating system. note: this has nothing to do with any http user-agent. this method returns the same as getsystemlocale.getcategory("nsilocale_messages"). astring getlocalecomponentforuseragent(); parameters none. return value the user's os setting for preferred locale in the format described in nsilocale. getlocalefrom
acceptlanguage() gets the most preferred locale from a list of locale preferences. nsilocale getlocalefrom
acceptlanguage( in string
acceptlanguage ); parameters
acceptlanguage locale preference in the same format as the
accept-language http header. return value the most preferred locale according to the
acceptlanguage parameter. getsystemlocale() gets the user preference for locale from the...
nsIServerSocketListener
netwerk/base/public/nsiserversocket.idlscriptable this interface is notified whenever a server socket
accepts a new connection. the transport is in the connected state, and read/write streams can be opened using the normal nsitransport api. the address of the client can be found by calling the nsisockettransport.getaddress() method or by inspecting nsisockettransport.gethost(), which returns a string representation of the client's ip address, which may be either an ipv4 or an ipv6 address. ...
... can be opened using the normal nsitransport api. the address of the client can be found by calling the nsisockettransport.getaddress() method or by inspecting nsisockettransport.gethost(), which returns a string representation of the client's ip address, which may be either an ipv4 or an ipv6 address. inherits from: nsisupports last changed in gecko 1.7 method overview void onsocket
accepted(in nsiserversocket aserv, in nsisockettransport atransport); void onstoplistening(in nsiserversocket aserv, in nsresult astatus); methods onsocket
accepted() this method is called when a client connection is
accepted. void onsocket
accepted( in nsiserversocket aserv, in nsisockettransport atransport ); parameters aserv the server socket. atransport the connect...
nsIThreadEventFilter
the nsithreadeventfilter interface may be implemented to determine whether or not an event may be
accepted by a nested event queue; see nsithreadinternal.pusheventqueue() for more information. you should implement this interface and its
acceptevent() method, then pass the object implementing it as the filter. xpcom/threads/nsithreadinternal.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview boolean
acceptevent(in nsirunnable event);violates the xpcom interface guidelines methods violates the xpcom interface guidelines
acceptevent() this method is called to determine whether or not an event may be
accepted by a nested event queue. (see nsithreadinternal.pusheventqueue()) ...
...erview boolean
acceptevent(in nsirunnable event);violates the xpcom interface guidelines methods violates the xpcom interface guidelines
acceptevent() this method is called to determine whether or not an event may be
accepted by a nested event queue. (see nsithreadinternal.pusheventqueue()) warning: this method must not make any calls on the thread object. boolean
acceptevent( in nsirunnable event ); parameters event the event being dispatched. return value implement this method to return true if the event is
accepted, or false to reject it. see also the thread manager nsithreadmanager nsithread nsithreadpool nsithreadobserver nsithreadinternal ...
nsIThreadInternal
popeventqueue() reverts a call to pusheventqueue(). when an event queue is popped, any events remaining in the queue are appended to the elder queue. void popeventqueue(); parameters none. pusheventqueue() causes any events currently enqueued on the thread to be suppressed until popeventqueue() is called. ...
... popped, any events remaining in the queue are appended to the elder queue. void popeventqueue(); parameters none. pusheventqueue() causes any events currently enqueued on the thread to be suppressed until popeventqueue() is called. in addition, any new events dispatched to the thread are only processed if they are
accepted by the specified filter. if the filter is null, all new events are
accepted. calls to pusheventqueue() may be nested, and must each be paired with a corresponding call to popeventqueue() to restore the original state of the thread. void pusheventqueue( in nsithreadeventfilter filter ); parameters filter the nsithreadeventfilter to apply to dispatched events, or null to
accept all dispatched events. see also the thread manager nsithreadmanager nsithread...
nsIXULTemplateBuilder
ry processor handles these more specifically. results implement the nsixultemplateresult interface and may be identified by an id which must be unique within a given set of query results. each query may be accompanied by one or more <rule> elements. these rules are evaluated by the template builder for each result produced by the query. a rule consists of conditions that cause a rule to be either
accepted or rejected. the condition syntax allows for common conditional handling; additional filtering may be applied by adding a custom filter to a rule with the builder's addrulefilter() method. if a result passes a rule's conditions, this is considered a match, and the content within the rule's <action> body is inserted as a sibling of the <template>, assuming the template builder creates real dom c...
...ns true if the node has content generated for it; otherwise returns false. addrulefilter() adds a rule filter for a given rule, which may be used for specialized rule filtering. any existing filter on the rule is removed. the default conditions specified inside the <rule> tag are applied before the rule filter is applied, meaning that the filter may be used to further filter out results but not re
accept results that have already been rejected. void addrulefilter( in nsidomnode arule, in nsixultemplaterulefilter afilter ); parameters arule the rule to apply the filter to. afilter the filter to add. native code only!init called to initialize a xul content builder on a particular root element. this element presumably has a datasources attribute, which the builder will parse to set up the tem...
Storage
arametername the same way for numeric and non-numeric columns. do not put the :boundparametername within apostrophes, because that the binding mechanism does that for you. you can still use this helper object by manually creating the statement wrapper, mozistoragestatementwrapper, which is provided in gecko 1.9.1 and later. using named parameters in c++ is a lot more difficult, so it's generally
accepted to use numerical placeholders instead. the example below uses mozistoragestatement.bindint32parameter(). the full list of binding functions can be found with the mozistoragestatement documentation. c++ example: nscomptr<mozistoragestatement> statement; rv = mdbconn->createstatement(ns_literal_cstring("select * from table_name where id = ?1"), getter_addrefs(state...
...ecution, for performance reasons. asynchronously gecko 1.9.1 introduced support for asynchronous execution of a statement by calling mozistoragestatement.executeasync() on the statement. multiple statements can be executed in a transaction by calling mozistorageconnection.executeasync() on the connection and passing in an array of statements. both of these methods have similar signatures that
accept an object as input that receives notifications the execution of the statement(s). a c++ example is omitted here because it would be verbose, but real-world code can be found in the mozilla source tree (mxr id search for mozistoragestatementcallback). after you create and bind a statement, your javascript should look something like this to execute a statement asynchronously: statement.executeasy...
Declaring types
mitive types. for example, on windows, you may wish to be able to use the windows-standard dword type name for unsigned 32-bit integers. to declare this type, you can simply do: const dword = ctypes.uint32_t; after doing this, dword is a ctype that can then be used to represent 32-bit unsigned integers. structures structures are declared using the ctypes.structtype() constructor. this method
accepts as input the name of the structure and an array of field descriptors, each describing one field in the structure. you can, optionally, leave out the field descriptor array; this creates an opaque structure whose contents are not defined. note: at present, there isn't a way to specify that an array's c equivalent was declared as a packed structure; that is, using #pragma pack. field descriptors...
...tm_year": ctypes.int }, { "tm_wday": ctypes.int }, { "tm_yday": ctypes.int }, { "tm_isdst": ctypes.int } ]); to find other types see here: predefined types - primitive types. you can then declare and use a function that uses this structure, like this: // declare the libc asctime() function, which returns a char * and
accepts a pointer to a tm structure. const asctime = lib.declare("asctime", ctypes.default_abi, ctypes.char.ptr, struct_tm.ptr); var thetime = new struct_tm; thetime.tm_hour = 3; thetime.tm_min = 15; ... var timestr = asctime(thetime.address()); // pass a pointer to the tm struct var jsstring = timestr.readstring(); // convert the c string to javascript the last line converts the c stri...
Network request list - Firefox Developer Tools
a message will be added to the item in the list indicating that it has been blocked by the devtools. stop blocking a url from the request list hover over the item. select unblock url. now when you refresh the page, the item will once enabled. note: (starting in firefox 80) you can also block and unblock urls from the web console, using the :block and :unblock helper commands. these
accept any string, and affect any url containing the string. filtering requests you can filter requests by content type, by whether they are xmlhttprequests or websocket requests, or by request properties. filter type how to apply content type use the buttons in the toolbar (html, css, js). xhr requests use the xhr button in the toolbar. websocket con...
...le. copy as curl the command may include the following options: -x [method] if the method is not get or post --data for url encoded request parameters --data-binary for multipart request parameters --http/version if the http version is not 1.1 -i if the method is head -h one for each request header. if the "
accept-encoding" header is present, the curl command includes --compressed instead of -h "
accept-encoding: gzip, deflate". this means that the response will be automatically decompressed. --globoff suppresses curl's globbing (wildcard matching) feature if the copied url includes square bracket characters ([ or ]). (starting in firefox 76) managing har data the har format enables ...
The JavaScript input interpreter - Firefox Developer Tools
line editing pane, or press ctrl+b (windows/linux) or cmd+b (macos). accessing variables you can access variables defined in the page, both built-in variables like window and variables added by javascript libraries like jquery: autocomplete the editor has autocomplete: enter the first few letters and a popup appears with possible completions: press enter, tab, or the right arrow key to
accept the suggestion, use the up/down arrows to move to a different suggestion, or just keep typing if you don't like any of the suggestions. console autocomplete suggestions are case-insensitive. the console suggests completions from the scope of the currently executing stack frame. this means that if you've hit a breakpoint in a function you get autocomplete for objects local to the function. you ...
...tor for that object. pprint() obsolete since gecko 74 formats the specified value in a readable way; this is useful for dumping the contents of objects and arrays. help()deprecated since gecko 62 :help displays help text. actually, in a delightful example of recursion, it will bring you to this page. cd() switch 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 that will be passed to document.queryselector to locate the iframe element the iframe element itself the content window inside the iframe see working with iframes. copy() new in firefox 38. copy the argument to the clipboard. if the argument is a string, it's cop...
Background Tasks API - Web APIs
ks api or simply the requestidlecallback() api) provides the ability to queue tasks to be executed automatically by the user agent when it determines that there is free time to do so. concepts and usage the main thread of a web browser is centered around its event loop. this code draws any pending updates to the document currently being displayed, runs any javascript code the page needs to run,
accepts events from input devices, and dispatches those events to the elements that should receive them. in addition, the event loop handles interactions with the operating system, updates to the browser's own user interface, and so forth. it's an extremely busy chunk of code, and your main javascript code may run right inside this thread along with all of this. certainly most if not all code that is ca...
...sks first, we need a function that enqueues tasks for future execution. that function, enqueuetask(), looks like this: function enqueuetask(taskhandler, taskdata) { tasklist.push({ handler: taskhandler, data: taskdata }); totaltaskcount++; if (!taskhandle) { taskhandle = requestidlecallback(runtaskqueue, { timeout: 1000 }); } schedulestatusrefresh(); } enqueuetask()
accepts as input two parameters: taskhandler is a function which will be called to handle the task. taskdata is an object which is passed into the task handler as an input parameter, to allow the task to receive custom data. to enqueue the task, we push an object onto the tasklist array; the object contains the taskhandler and taskdata values under the names handler and data, respectively, then in...
BeforeInstallPromptEvent - Web APIs
of domstring items containing the platforms on which the event was dispatched. this is provided for user agents that want to present a choice of versions to the user such as, for example, "web" or "play" which would allow the user to chose between a web version or an android version. beforeinstallpromptevent.userchoice read only returns a promise that resolves to a domstring containing either "
accepted" or "dismissed". methods beforeinstallpromptevent.prompt() allows a developer to show the install prompt at a time of their own choosing. this method returns a promise. example window.addeventlistener("beforeinstallprompt", function(e) { // log the platforms provided as options in an install prompt console.log(e.platforms); // e.g., ["web", "android", "windows"] e.userchoice.th...
...developer to show the install prompt at a time of their own choosing. this method returns a promise. example window.addeventlistener("beforeinstallprompt", function(e) { // log the platforms provided as options in an install prompt console.log(e.platforms); // e.g., ["web", "android", "windows"] e.userchoice.then(function(choiceresult) { console.log(choiceresult.outcome); // either "
accepted" or "dismissed" }, handleerror); }); ...
CSSStyleSheet.insertRule() - Web APIs
add a stylesheet rule to the document (it may be better practice * to dynamically change classes, so style information can be kept in * genuine stylesheets and avoid adding extra elements to the dom). * note that an array is needed for declarations and rules since ecmascript does * not guarantee a predictable object iteration order, and since css is * order-dependent. ...
...s, so style information can be kept in * genuine stylesheets and avoid adding extra elements to the dom). * note that an array is needed for declarations and rules since ecmascript does * not guarantee a predictable object iteration order, and since css is * order-dependent. ...
CanvasRenderingContext2D.filter - Web APIs
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. ...
... 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. ...
DOMMatrixReadOnly.scale() - Web APIs
be 3d. return value returns a dommatrix containing a new matrix being the result of the matrix x and y dimensions being scaled by the given factor, centered on the origin given. the original matrix is not modified. if a scale is applied about the z-axis, the resulting matrix will be a 4x4 3d matrix. note: at time of writing, firefox still supports an older version of the specification that
accepts either one or three values. dommatrix.scale(scale[, originx][, originy]) we'll show an example of how you can deal with the cross-browser support implications of this in the examples section, below. examples this svg contains three squares, one red, one blue, and one green, each positioned at the document origin: <svg width="250" height="250" viewbox="0 0 25 25"> <rect width="25" height=...
...t id="transformedorigin" width="25" height="25" fill="green" /> </svg> this javascript first creates an identity matrix, then uses the scale() method to create a new matrix with a single parameter. we test if the browser supports a six parameter scale() method by creating a new matrix using three parameters and observing it's is2d property — if this is false then the third parameter has been
accepted by the browser as a scalez parameter, making this a 3d matrix. we then create a new matrix scaled about a given origin, using either three or six parameters depending on the browser support. these new matrices are then applied to the blue and green squares as a transform, changing their dimensions and position. the red square is left in place. const matrix = new dommatrixreadonly(); const sc...
EffectTiming.easing - Web APIs
the effecttiming dictionary's easing property in the web animations api specifies the timing function used to scale the time to produce easing effects, where easing is the rate of the animation's change over time. element.animate(), keyframeeffectreadonly(), and keyframeeffect() all
accept an object of timing properties including easing. ...
...ds directly to animationeffecttimingreadonly.easing in timing objects returned by animationeffectreadonly, keyframeeffectreadonly, and keyframeeffect. syntax var timingproperties = { easing: single-transition-timing-function } timingproperties.easing = single-transition-timing-function value a string defining the timing function to use for easing transitions during the animation process.
accepts several pre-defined domstring values, a steps() timing function like steps(5, end), or a custom cubic-bezier value like cubic-bezier(0.42, 0, 0.58, 1). defaults to linear. available values include: linear a constant rate of change, neither accelerating nor deccelerating. cubic-bezier(<number>, <number>, <number>, <number>) specifies a cubic bézier timing function. the four numbers spec...
Element.scrollHeight - Web APIs
et elit interdum quis placerat metus posuere. duis malesuada justo a diam vestibulum vel aliquam nisi ornare. integer laoreet nisi a odio ornare non congue turpis eleifend. cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. cras vulputate libero sed arcu iaculis nec lobortis orci fermentum. ...
...n-bottom: 12px; border-radius: 5px; width: 600px; padding: 5px; border: 2px #7fdf55 solid; } #rules { width: 600px; height: 130px; padding: 5px; border: #2a9f00 solid 2px; border-radius: 5px; } javascript function checkreading () { if (checkreading.read) { return; } checkreading.read = this.scrollheight - this.scrolltop === this.clientheight; document.registration.
accept.disabled = document.getelementbyid("nextstep").disabled = !checkreading.read; checkreading.noticebox.innerhtml = checkreading.read ? "thank you." : "please, scroll and read the following text."; } onload = function () { var otoberead = document.getelementbyid("rules"); checkreading.noticebox = document.createelement("span"); document.registration.
accept.checked = false; checkreading.no...
HTMLFormElement - Web APIs
s action html attribute, containing the uri of a program that processes the information submitted by the form. htmlformelement.encoding or htmlformelement.enctype a domstring reflecting the value of the form's enctype html attribute, indicating the type of content that is used to transmit the form to the server. only specified values can be set. the two properties are synonyms. htmlformelement.
acceptcharset a domstring reflecting the value of the form's
accept-charset html attribute, representing the character encoding that the server
accepts. htmlformelement.autocomplete a domstring reflecting the value of the form's autocomplete html attribute, indicating whether the controls in this form can have their values automatically populated by the browser. htmlformelement.novalidate a boolean...
...nclick="setforminfo(this.form);">set</button> <button type="reset">reset</button> </p> <textarea id="form-info" rows="15" cols="20"></textarea> </form> <script> function getforminfo(){ // get a reference to the form via its name var f = document.forms["forma"]; // the form properties we're interested in var properties = [ 'elements', 'length', 'name', 'charset', 'action', '
acceptcharset', 'action', 'enctype', 'method', 'target' ]; // iterate over the properties, turning them into a string that we can display to the user 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[...
HTMLSelectElement.add() - Web APIs
= document.createelement("option"); opt1.value = "1"; opt1.text = "option: value 1"; opt2.value = "2"; opt2.text = "option: value 2"; sel.add(opt1, null); sel.add(opt2, null); /* produces the following, conceptually: <select> <option value="1">option: value 1</option> <option value="2">option: value 2</option> </select> */ the before parameter is optional. so the following is
accepted. ... sel.add(opt1); sel.add(opt2); ... append to an existing collection var sel = document.getelementbyid("existinglist"); var opt = document.createelement("option"); opt.value = "3"; opt.text = "option: value 3"; sel.add(opt, null); /* takes the existing following select object: <select id="existinglist"> <option value="1">option: value 1</option> <option value="2">option: ...
... <select id="existinglist"> <option value="1">option: value 1</option> <option value="2">option: value 2</option> </select> and changes it to: <select id="existinglist"> <option value="1">option: value 1</option> <option value="2">option: value 2</option> <option value="3">option: value 3</option> </select> */ the before parameter is optional. so the following is
accepted. ... sel.add(opt); ... inserting to an existing collection var sel = document.getelementbyid("existinglist"); var opt = document.createelement("option"); opt.value = "3"; opt.text = "option: value 3"; sel.add(opt, sel.options[1]); /* takes the existing following select object: <select id="existinglist"> <option value="1">option: value 1</option> <option value="2">option: val...
Headers.append() - Web APIs
for security reasons, some headers can only be controlled by the user agent. ...
...d. example creating an empty headers object is simple: var myheaders = new headers(); // currently empty you could add a header to this using append(): myheaders.append('content-type', 'image/jpeg'); myheaders.get('content-type'); // returns 'image/jpeg' if the specified header already exists, append() will change its value to the specified value. if the specified header already exists and
accepts multiple values, append() will append the new value to the end of the value set: myheaders.append('
accept-encoding', 'deflate'); myheaders.append('
accept-encoding', 'gzip'); myheaders.get('
accept-encoding'); // returns 'deflate, gzip' to overwrite the old value with a new one, use headers.set. specifications specification status comment fetchthe definition of 'append(...
Headers.entries() - Web APIs
erator allowing to go through all key/value pairs contained in this object. the both the key and value of each pairs are bytestring objects. note: this method is available in web workers. ...
... workers. syntax headers.entries(); return value returns an iterator. ...
Headers.set() - Web APIs
for security reasons, some headers can only be controller by the user agent. ...
...s = new headers(); // currently empty you could add a header to this using headers.append, then set a new value for this header using set(): myheaders.append('content-type', 'image/jpeg'); myheaders.set('content-type', 'text/html'); if the specified header does not already exist, set() will create it and set its value to the specified value. if the specified header does already exist and does
accept multiple values, set() will overwrite the existing value with the new one: myheaders.set('
accept-encoding', 'deflate'); myheaders.set('
accept-encoding', 'gzip'); myheaders.get('
accept-encoding'); // returns 'gzip' you'd need headers.append to append the new value onto the values, not overwrite it. specifications specification status comment fetchthe definition of 'set(...
Headers.values() - Web APIs
he headers.values() method returns an iterator allowing to go through all values contained in this object. the values are bytestring objects. ...
...bjects. note: this method is available in web workers. syntax headers.values(); return value returns an iterator. ...
Ajax navigation example - Web APIs
reateelement("div"), oloadingimg = new image(), opageinfo = { title: null, url: location.href }, ohttpstatus = /* http://www.iana.org/assignments/http-status-codes/http-status-codes.xml */ { 100: "continue", 101: "switching protocols", 102: "processing", 200: "ok", 201: "created", 202: "
accepted", 203: "non-authoritative information", 204: "no content", 205: "reset content", 206: "partial content", 207: "multi-status", 208: "already reported", 226: "im used", 300: "multiple choices", 301: "moved permanently", 302: "found", 303: "see other", 304...
...ther", 304: "not modified", 305: "use proxy", 306: "reserved", 307: "temporary redirect", 308: "permanent redirect", 400: "bad request", 401: "unauthorized", 402: "payment required", 403: "forbidden", 404: "not found", 405: "method not allowed", 406: "not
acceptable", 407: "proxy authentication required", 408: "request timeout", 409: "conflict", 410: "gone", 411: "length required", 412: "precondition failed", 413: "request entity too large", 414: "request-uri too long", 415: "unsupported media type", 416: "requested range not satisfiabl...
Using IndexedDB - Web APIs
ameter, the name of the database; then you must call idbversionchangerequest.setversion to establish the versionchange transaction.) to read the records of an existing object store, the transaction can either be in readonly or readwrite mode. to make changes to an existing object store, the transaction must be in readwrite mode. you open such transactions with idbdatabase.transaction. the method
accepts two parameters: the storenames (the scope, defined as an array of object stores that you want to access) and the mode (readonly or readwrite) for the transaction. the method returns a transaction object containing the idbindex.objectstore method, which you can use to access your object store. by default, where no mode is specified, transactions open in readonly mode. note: as of firefox 40, in...
... new attempt to open the database, but using an outdated version. security indexeddb uses the same-origin principle, which means that it ties the store to the origin of the site that creates it (typically, this is the site domain or subdomain), so it cannot be accessed by any other origin. third party window content (e.g. ...
Key Values - Web APIs
11) and firefox 36 and earlier generate the value "crsel" instead of "crsel" when the crsel key is pressed. [4] internet explorer (tested on release 9 and 11) and firefox 36 and earlier generate the value "exsel" instead of "exsel" when the exsel key is pressed. ui keys keyboardevent.key value description virtual keycode windows mac linux android "
accept" the
accept, commit, or ok key or button.
accepts the currently selected option or input method sequence conversion. vk_
accept (0x1e) keycode_dpad_center (23) "again" the again key. redoes or repeats a previous action. gdk_key_redo (0xff66) "attn" [4] the attn (attention) key. vk_oem_attn (0xf0) gdk_key_3270_attn (0xfd0e) ...
...ycles among input modes of imes. vk_modechange (0x1f) gdk_key_mode_switch (0xff7e) gdk_key_script_switch (0xff7e) qt::key_mode_switch (0x0100117e) keycode_switch_charset (95) "nextcandidate" the next candidate function key. selects the next possible match for the ongoing input. "nonconvert" [2] the nonconvert ("don't convert") key. this
accepts the current input method sequence without running conversion when using an ime. vk_nonconvert (0x1d) gdk_key_muhenkan (0xff22) qt::key_muhenkan (0x01001122) keycode_muhenkan (213) "previouscandidate" the previous candidate key. selects the previous possible match for the ongoing input. gdk_key_previouscandidate (0xff3e) qt::key_previouscandidate ...
MediaTrackConstraints.facingMode - Web APIs
his is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. ...
...traints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { facingmode: constraint }; constraintsobject.facingmode = constraint; value an object based on constraindomstring specifying one or more
acceptable, ideal, and/or exact (mandatory) facing modes are
acceptable for a video track. an exact value in this case indicates that the specified facing mode is specifically required; for example: var constraints = { facingmode: { exact: "user" } }; this indicates that only a user-facing camera is
acceptable; if there is no user-facing camera, or the user declines permission to use that camera, the media request will fail. the following strings are permit...
MediaTrackConstraints.latency - Web APIs
onstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { latency: constraint }; constraintsobject.latency = constraint; value a constraindouble describing the
acceptable or required value(s) for an audio track's latency, with values specified in seconds. in audio processing, latency is the time between the start of processing (when sound occurs in the real world, or is generated by a hardware device) and the data being made available to the next step in the audio input or output process. in most cases, low latency is desirable for performance and user experie...
...n seconds. in audio processing, latency is the time between the start of processing (when sound occurs in the real world, or is generated by a hardware device) and the data being made available to the next step in the audio input or output process. in most cases, low latency is desirable for performance and user experience purposes, but when power consumption is a concern, or delays are otherwise
acceptable, higher latency might be
acceptable. if this property's value is a number, the user agent will attempt to obtain media whose latency tends to be as close as possible to this number given the capabilities of the hardware and the other constraints specified. otherwise, the value of this constraindouble will guide the user agent in its efforts to provide an exact match to the required latency (...
Node - Web APIs
t of the node's css boxes relative to another node. node.getrootnode() returns the context object's root which optionally includes the shadow root if it is available. node.haschildnodes() returns a boolean indicating whether or not the element has any child nodes. node.insertbefore() inserts a node before the reference node as a child of a specified parent node. node.isdefaultnamespace()
accepts a namespace uri as an argument and returns a boolean with a value of true if the namespace is the default namespace on the given node or false if not. node.isequalnode() returns a boolean which indicates whether or not two nodes are of the same type and all their defining data points match. node.issamenode() returns a boolean value indicating whether or not the two nodes are the same (that i...
... their defining data points match. node.issamenode() returns a boolean value indicating whether or not the two nodes are the same (that is, they reference the same object). node.lookupprefix() returns a domstring containing the prefix for a given namespace uri, if present, and null if not. when multiple prefixes are possible, the result is implementation-dependent. node.lookupnamespaceuri()
accepts a prefix and returns the namespace uri associated with it on the given node if found (and null if not). supplying null for the prefix will return the default namespace. node.normalize() clean up all the text nodes under this element (merge adjacent, remove empty). node.removechild() removes a child node from the current element, which must be a child of the current node. node.replacechild()...
NodeIterator.filter - Web APIs
the nodeiterator.filter read-only method returns a nodefilter object, that is an object implement an
acceptnode(node) method, used to screen nodes. when creating the nodeiterator, the filter object is passed in as the third parameter, and the object method
acceptnode(node) is called on every single node to determine whether or not to
accept it. this function should return the constant nodefilter.filter_
accept for cases when the node should be
accepted and nodefilter.filter_reject for cases when the node should be rejected. ...
...every single node to determine whether or not to
accept it. this function should return the constant nodefilter.filter_
accept for cases when the node should be
accepted and nodefilter.filter_reject for cases when the node should be rejected. syntax nodefilter = nodeiterator.filter; example const nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); nodefilter = nodeiterator.filter; specifications specification status comment domthe definition of 'nodeiterator.filter' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification. document object model (dom) level 2...
NodeIterator.previousNode() - Web APIs
irst node in the set. in old browsers, as specified in old versions of the specifications, the method may throws the invalid_state_err domexception if this method is called after the nodeiterator.detach()method. recent browsers never throw. ...
...n old versions of the specifications, the method may throws the invalid_state_err domexception if this method is called after the nodeiterator.detach()method. recent browsers never throw. syntax node = nodeiterator.previousnode(); example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false // this optional argument is not used any more ); currentnode = nodeiterator.nextnode(); // returns the next node previousnode = nodeiterator.previousnode(); // same result, since we backtracked to the previous node specifications specification status comment domthe definition of 'nodeiterator.previousnode' in that specification. living standard as...
NodeIterator.whatToShow - Web APIs
art of the document tree, they do not appear when traversing over the document tree. nodefilter.show_processing_instruction 64 shows processinginstruction nodes. nodefilter.show_text 4 shows text nodes. ...
...ersing over the document tree. nodefilter.show_processing_instruction 64 shows processinginstruction nodes. nodefilter.show_text 4 shows text nodes. example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element + nodefilter.show_comment + nodefilter.show_text, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); if( (nodeiterator.whattoshow == nodefilter.show_all) || (nodeiterator.whattoshow % (nodefilter.show_comment*2)) >= nodefilter.show_comment) { // nodeiterator will show comments } specifications specification status comment domthe definition of 'nodeiterator.whattoshow' in that specification. living standard no change from document object...
Notification - Web APIs
ructor notification() creates a new instance of the notification object. properties static properties these properties are available only on the notification object itself. notification.permission read only a string representing the current permission to display notifications. possible values are: denied — the user refuses to have notifications displayed. granted — the user
accepts having notifications displayed. default — 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 param...
...} we no longer show a live sample on this page, as chrome and firefox no longer allow notification permissions to be reque...
PaymentRequest.show() - Web APIs
you can provide if your architecture requires that the payment request's details need to be updated between instantiating the payment interface and the user beginning to interact with it. the promise should resolve with a paymentdetailsupdate object containing the updated information. return value a promise that eventually resolves with a paymentresponse. the promise is resolved when the user
accepts the payment request (such as by clicking a "pay" button in the browser's payment sheet). exceptions aborterror the returned promise rejects with an aborterror if the user agent is already showing a payment panel. only one payment panel may be visible at a time across all documents loaded by the user agent. the promise is also rejected with aborterror if the user cancels the payment requ...
...re, a custom function called checkallvalues() looks at each value in the response and ensures that they're valid, returning true if every field is valid or false if any are not. if and only if every field is valid, the complete() method is called on the response with the string "success", which indicates that everything is valid and that the payment can complete accordingly. if any fields have un
acceptable values, or if an exception is thrown by the previous code, complete() is called with the string "fail", which indicates that the payment process is complete and failed. instead of immediately failing, you could choose to call retry() on the response object to ask the user agent to try to process the payment again; this should usually only be done after the user has made any needed correction...
RTCIceCandidateStats - Web APIs
ctionary provides statistics related to an rtcicecandidate. properties rtcicecandidatestats is based upon the rtcstats dictionary, so it includes those properties in addition to the ones below. address optional a string containing the address of the candidate. this value may be an ipv4 address, an ipv6 address, or a fully-qualified domain name. this property was previously named ip and only
accepted ip addresses. candidatetype optional a string matching one of the values in the rtcicecandidatetype enumerated type, indicating what kind of candidate the object provides statistics for. deleted optional a boolean value indicating whether or not the candidate has been released or deleted; the default value is false. for local candidates, it's value is true if the candidate has been deleted ...
...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 object's networktype and determine whether or not the type of network is
acceptable for use. this function is then called for rtcstats objects whose type is local-candidate, indicating that the object is in fact an rtcicecandidatestats with information about a local ice candidate. const isusablenetworktype = stats => { switch(stats.networktype) { case "ethernet": case "vpn": return true; case "bluetooth": case "cellular": case "wimax": case...
RTCPeerConnection.canTrickleIceCandidates - Web APIs
ice trickling is the process of continuing to send candidates after the initial offer or answer has already been sent to the other peer. this property is only set after having called rtcpeerconnection.setremotedescription(). ideally, your signaling protocol provides a way to detect trickling support, so that you don't need to rely on this property. a webrtc browser will always support trickle ice. ...
...ickling isn't supported, or you aren't able to tell, you can check for a falsy value for this property and then wait until the value of icegatheringstate changes to "completed" before creating and sending the initial offer. that way, the offer contains all of the candidates. syntax var cantrickle = rtcpeerconnection.cantrickleicecandidates; value a boolean that is true if the remote peer can
accept trickled ice candidates and false if it cannot. if no remote peer has been established, this value is null. note: this property's value is determined once the local peer has called rtcpeerconnection.setremotedescription(); the provided description is used by the ice agent to determine whether or not the remote peer supports trickled ice candidates. example var pc = new rtcpeerconnection(); /...
RTCPeerConnection.createOffer() - Web APIs
sceivers to exclude reception (i.e. set to either "sendonly" or "inactive"). in modern implementations, the presence of this member with a value true, will ensure there is at least one transceiver set to receive audio that has not been stopped, and if there isn't one, one will be created. note: you shouldn't use this legacy property. instead, use rtcrtptransceiver to control whether or not to
accept incoming audio. offertoreceivevideo optional (legacy) a legacy boolean option which used to control whether or not to offer to the remote peer the opportunity to try to send video. if this value is false, the remote peer will not be offered to send video data, even if the local side will be sending video data. if this value is true, the remote peer will be offered to send video data, even if ...
...sceivers to exclude reception (i.e. set to either "sendonly" or "inactive"). in modern implementations, the presence of this member with a value true, will ensure there is at least one transceiver set to receive video that has not been stopped, and if there isn't one, one will be created. note: you shouldn't use this legacy property. instead, use rtcrtptransceiver to control whether or not to
accept incoming video. voiceactivitydetection optional some codecs and hardware are able to detect when audio begins and ends by watching for "silence" (or relatively low sound levels) to occur. this reduces network bandwidth used for audio by only sending audio data when there's actually something to broadcast. however, in some cases, this is unwanted. for example, in the case of music or other non...
RTCSessionDescription() - Web APIs
the rtcsessiondescription() constructor creates a new rtcsessiondescription with its properties initialized as described in the specified object. this constructor has been deprecated because rtcpeerconnection.setlocaldescription() and other methods which take sdp as input now directly
accept an object conforming to the rtcsessiondescriptioninit dictionary, so you don't have to instantiate an rtcsessiondescription yourself. syntax sessiondescription = new rtcsessiondescription(rtcsessiondescriptioninit); values rtcsessiondescriptioninit optional an object providing the default values for the session description; the object conforms to the rtcsessiondescriptioninit dictionary. that dictionary has the following properties: type required. a string which is a member of the rtcsdp...
...able state. sdp a string containing a sdp message describing the session. this value is an empty string ("") by default and may not be null. example this example uses the constructor to convert an sdp offer into an rtcsessiondescription object. this is no longer necessary, however; rtcpeerconnection.setlocaldescription() and other methods which take sdp as input now directly
accept an object conforming to the rtcsessiondescriptioninit dictionary, so you don't have to instantiate an rtcsessiondescription yourself. navigator.getusermedia({video: true}, function(stream) { pc.onaddstream({stream: stream}); // adding a local stream won't trigger the onaddstream callback pc.addstream(stream); pc.createoffer(function(offer) { pc.setlocaldescription(new rtcsessiondes...
Streams API concepts - Web APIs
yet, or available in many browsers. at some point the spec writers hope to add something like a transformstream class to make creating transform streams easier. backpressure an important concept in streams is backpressure — this is the process by which a single stream or a pipe chain regulates the speed of reading/writing. when a stream later in the chain is still busy and isn't yet ready to
accept more chunks, it sends a signal backwards through the chain to tell earlier transform streams (or the original source) to slow down delivery as appropriate so that you don't end up with a bottleneck anywhere. to use backpressure in a readablestream, we can ask the controller for the chunk size desired by the consumer by querying the readablestreamdefaultcontroller.desiredsize property on the con...
... signal backpressure based on the internal queue state. in general, the strategy compares the size of the chunks in the queue to a value called the high water mark, which is the largest total chunk size that the queue can realistically manage. the calculation performed is high water mark - total size of chunks in queue = desired size the desired size is the size of chunks the stream can still
accept to keep the stream flowing but below the high water mark in size. after the calculation is performed, chunk generation will be slowed down/sped up as appropriate to keep the stream flowing as fast as possible while keeping the desired size above zero. if the value falls to zero (or below in the case of writable streams), it means that chunks are being generated faster than the stream can cope wit...
WebGL best practices - Web APIs
(the interpolation of varyings is very cheap, and is done automatically for you through the fixed functionality rasterization phase of the graphics pipeline) for example, a simple animation of a textured surface can be achieved through a time-dependent transformation of texture coordinates. (the simplest case being adding a uniform vector to the texture coordinates attribute vector) if visually
acceptable, one can transform the texture coordinates in the vertex shader rather than in the fragment shader, to get better performance. one common trade-off is to some lighting calculations per-vertex instead of per-fragment (pixel). in some cases, especially with simple models or dense vertices, this looks good enough. the inversion of this is if a model has more vertices than pixels in the rendere...
...ba8 and ignore the alpha yourself for better performance. consider compressed texture formats while jpg and png are generally smaller over-the-wire, gpu compressed texture formats are smaller on in gpu memory, and are faster to sample from. (this reduces texture memory bandwidth, which is precious on mobile) however, compressed texture formats have worse quality than jpg, and are generally only
acceptable for colors (not e.g. normals or coordinates). unfortunately, there's no single universally supported format. every system has at least one of the following though: webgl_compressed_texture_s3tc (desktop) webgl_compressed_texture_etc1 (android) webgl_compressed_texture_pvrtc (ios) webgl 2 has universal support by combining: webgl_compressed_texture_s3tc (desktop) webgl_compressed_t...
WebRTC connectivity - Web APIs
ions taking one step deeper into the process, we find that localdescription and remotedescription, the properties which return these two descriptions, aren't as simple as they look. because during renegotiation, an offer might be rejected because it proposes an incompatible format, it's necessary that each endpoint have the ability to propose a new format but not actually switch to it until it's
accepted by the other peer. for that reason, webrtc uses pending and current descriptions. the current description (which is returned by the rtcpeerconnection.currentlocaldescription and rtcpeerconnection.currentremotedescription properties) represents the description currently in actual use by the connection. this is the most recent connection that both sides have fully agreed to use. the pending des...
...cription if there's a pending description (that is, the pending description isn't null); otherwise, the current description (currentlocaldescription/currentremotedescription) is returned. when changing the description by calling setlocaldescription() or setremotedescription(), the specified description is set as the pending description, and the webrtc layer begins to evaluate whether or not it's
acceptable. once the proposed description has been agreed upon, the value of currentlocaldescription or currentremotedescription is changed to the pending description, and the pending description is set to null again, indicating that there isn't a pending description. the pendinglocaldescription contains not just the offer or answer under consideration, but any local ice candidates which have already ...
A simple RTCDataChannel sample - Web APIs
candidate to tell the other side about. note: in a real-world scenario in which the two peers aren't running in the same context, the process is a bit more involved; each side provides, one at a time, a suggested way to connect (for example, udp, udp with a relay, tcp, etc.) by calling rtcpeerconnection.addicecandidate(), and they go back and forth until agreement is reached. but here, we just
accept the first offer on each side, since there's no actual networking involved. localconnection.onicecandidate = e => !e.candidate || remoteconnection.addicecandidate(e.candidate) .catch(handleaddcandidateerror); remoteconnection.onicecandidate = e => !e.candidate || localconnection.addicecandidate(e.candidate) .catch(handleaddcandidateerror); we configure e...
...connection.setlocaldescription(answer)) .then(() => localconnection.setremotedescription(remoteconnection.localdescription)) .catch(handlecreatedescriptionerror); let's go through this line by line and decipher what it means. first, we call rtcpeerconnection.createoffer() method to create an sdp (session description protocol) blob describing the connection we want to make. this method
accepts, optionally, an object with constraints to be met for the connection to meet your needs, such as whether the connection should support audio, video, or both. in our simple example, we don't have any constraints. if the offer is created successfully, we pass the blob along to the local connection's rtcpeerconnection.setlocaldescription() method. this configures the local end of the connection. ...
Writing WebSocket servers - Web APIs
r receives the handshake request, it should send back a special response that indicates that the protocol will be changing from http to websocket. that header looks something like the following (remember each header line ends with \r\n and put an extra \r\n after the last one to indicate the end of the header): http/1.1 101 switching protocols upgrade: websocket connection: upgrade sec-websocket-
accept: s3pplmbitxaq9kygzzhzrbk+xoo= additionally, the server can decide on extension/subprotocol requests here; see miscellaneous for details. the sec-websocket-
accept header is important in that the server must derive it from the sec-websocket-key that the client sent to it. to get it, concatenate the client's sec-websocket-key and the string "258eafa5-e914-47da-95ca-c5ab0dc85b11" together (it's a ...
...ate the client's sec-websocket-key and the string "258eafa5-e914-47da-95ca-c5ab0dc85b11" together (it's a "magic string"), take the sha-1 hash of the result, and return the base64 encoding of that hash. note: this seemingly overcomplicated process exists so that it's obvious to the client whether the server supports websockets. this is important because security issues might arise if the server
accepts a websockets connection but interprets the data as a http request. so if the key was "dghlihnhbxbszsbub25jzq==", the sec-websocket-
accept header's value is "s3pplmbitxaq9kygzzhzrbk+xoo=". once the server sends these headers, the handshake is complete and you can start swapping data! note: the server can send other headers like set-cookie, or ask for authentication or redirects via other stat...
Using the Web Speech API - Web APIs
st line — #jsgf v1.0; — states the format and version used. this always needs to be included first. the second line indicates a type of term that we want to recognise. public declares that it is a public rule, the string in angle brackets defines the recognised name for this term (color), and the list of items that follow the equals sign are the alternative values that will be recognised and
accepted as appropriate values for the term. note how each is separated by a pipe character. you can have as many terms defined as you want on separate lines following the above structure, and include fairly complex grammar definitions. for this basic demo, we are just keeping things simple. plugging the grammar into our speech recognition the next thing to do is define a speech recogntion instance...
...e to control the recognition for our application. this is done using the speechrecognition() constructor. we also create a new speech grammar list to contain our grammar, using the speechgrammarlist() constructor. var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); we add our grammar to the list using the speechgrammarlist.addfromstring() method. this
accepts as parameters the string we want to add, plus optionally a weight value that specifies the importance of this grammar in relation of other grammars available in the list (can be from 0 to 1 inclusive.) the added grammar is available in the list as a speechgrammar object instance. speechrecognitionlist.addfromstring(grammar, 1); we then add the speechgrammarlist to the speech recognition instan...
Using Web Workers - Web APIs
rkers must be hosted within the same origin as the parent page. also, the uris for subworkers are resolved relative to the parent worker's location rather than that of the owning page. this makes it easier for workers to keep track of where their dependencies are. importing scripts and libraries worker threads have access to a global function, importscripts(), which lets them import scripts. ...
...he worker. example.html: (the main page): var myworker = new worker('my_task.js'); myworker.onmessage = function(oevent) { console.log('worker said : ' + oevent.data); }; myworker.postmessage('ali'); my_task.js (the worker): postmessage("i\'m working before postmessage(\'ali\')."); onmessage = function(oevent) { postmessage('hi ' + oevent.data); }; the structured cloning algorithm can
accept 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. first, we create a queryableworker class that takes the...
Worker.prototype.postMessage() - Web APIs
the data may be any value or javascript object handled by the structured clone algorithm, which includes cyclical references. the worker can send back information to the thread that spawned it using the dedicatedworkerglobalscope.postmessage method. syntax worker.postmessage(message, [transfer]); parameters message the object to deliver to the worker; this will be in the data field in the event delivered to the dedicatedworkerglobalscope.onmessage handler. ...
...itly. transfer optional an optional array of transferable objects to transfer ownership of. if the ownership of an object is transferred, it becomes unusable (neutered) in the context it was sent from and becomes available only to the worker it was sent to. transferable objects are instances of classes like arraybuffer, messageport or imagebitmap objects that can be transferred. null is not an
acceptable value for transfer. returns void. example the following code snippet shows the creation of a worker object using the worker() constructor. when either of two form inputs (first and second) have their values changed, change events invoke postmessage() to send the value of both inputs to the current worker. var myworker = new worker('worker.js'); first.onchange = function() { myworker.
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
of the xr device match. in any case, multiplying the recommended resolution as identified by the xrsession by this value will result in the actual native resolution of the xr hardware. the recommended webgl frame buffer resolution is the best possible estimate of the resolution necessary to contain all of fthe xrviews needed by the device while at the same time providing typical applications an
acceptable balance of image quality and performance. for example, consider a device which uses a 2560x1440 pixel frame buffer (which is used to render two views, for the left and right eyes, side by side each at a resolution of 1280x1440 pixels). consider a frame buffer which at full size looks like this: if, on this device, it's determined that due to gpu limitations the browser needs to reduce ima...
...or example, consider a device which uses a 2560x1440 pixel frame buffer (which is used to render two views, for the left and right eyes, side by side each at a resolution of 1280x1440 pixels). consider a frame buffer which at full size looks like this: if, on this device, it's determined that due to gpu limitations the browser needs to reduce image quality in order to improve performance to an
acceptable level, it might choose to halve the resolution. in this case, the value returned by xrwebgllayer.getnativeframebufferscalefactor() will be 2.0. this method of dividing the frame buffer between views is shown in the following diagram. now the width and height of the frame buffer are 50% what they were before, resulting in a total frame buffer size of 1280 by 720 pixels, with each eye's half...
ARIA annotations - Accessibility
the semantics for this have long been available in html, via the <ins> and <del> elements: <p>freida’s pet is a <del>black cat called luna</del><ins>purple tyrannosaurus rex called tiny</ins>.</p> with the new additions, you now have new roles available to provide the same semantics, should you be unable to use <ins> and <del> elements for some reason: <p>freida’...
...</p> <div role="comment" id="thread-1" data-author="chris"> <h3>chris said</h3> <p class="comment-text">i really think this moment could use more cowbell.</p> <p><time datetime="2019-03-30t19:29">march 30 2019, 19:29</time></p> </div> note: if for some reason you can’t use the <mark> element in your application, you could also use <span role="mark"></span>. ...
-moz-user-input - CSS: Cascading Style Sheets
/* keyword values */ -moz-user-input: none; -moz-user-input: enabled; -moz-user-input: disabled; /* global values */ -moz-user-input: inherit; -moz-user-input: initial; -moz-user-input: unset; for elements that normally take user input, such as a <textarea>, the initial value of -moz-user-input is enabled. note: -moz-user-input was one of the proposals leading to the proposed css 3 user-input property, which has not yet reached candidate recommendation (call for implementations). a similar property, user-focus, was proposed in early drafts of a predecessor of the css3 ui specification, but was rejected by the working group. ...
...eading to the proposed css 3 user-input property, which has not yet reached candidate recommendation (call for implementations). a similar property, user-focus, was proposed in early drafts of a predecessor of the css3 ui specification, but was rejected by the working group. syntax values none the element does not respond to user input, and it does not become :active. enabled the element
accepts user input. for textboxes, this is the default behavior. please note that this value is no longer supported in firefox 60 onwards (bug 1405087). disabled the element does not
accept user input. however, this is not the same as setting disabled to true, in that the element is drawn normally. please note that this value is no longer supported in firefox 60 onwards (bug 1405087). formal definit...
:disabled - CSS: Cascading Style Sheets
/* selects any disabled <input> */ input:disabled { background: #ccc; } syntax :disabled examples this example shows a basic shipping form. it uses the javascript change event to let the user enable/disable the billing fields. ...
... /* selects any disabled <input> */ input:disabled { background: #ccc; } syntax :disabled examples this example shows a basic shipping form. it uses the javascript change event to let the user enable/disable the billing fields. ...
font-weight - CSS: Cascading Style Sheets
t weight. same as 400. bold bold font weight. same as 700. <number> a <number> value between 1 and 1000, inclusive. higher numbers represent weights that are bolder than (or as bold as) lower numbers. certain commonly used values correspond to common weight names, as described in the common weight name mapping section below. ...
...ing section below. in earlier versions of the font-weight specification, the property
accepts only keyword values and the numeric values 100, 200, 300, 400, 500, 600, 700, 800, and 900; non-variable fonts can only really make use of these set values, although fine-grained values (e.g. 451) will be translated to one of these values for non-variable fonts. css fonts level 4 extends the syntax to
accept any number between 1 and 1000, inclusive, and introduces variable fonts, which can make use of this much finer-grained range of font weights. common weight name mapping the numerical values 100 to 900 roughly correspond to the following common weight names: value common weight name 100 thin (hairline) 200 extra light (ultra light) 300 light ...
@font-face - CSS: Cascading Style Sheets
t("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%; font-style a font-style 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-style: oblique 20deg 50deg; font-weight a font-weight value. since firefox 61 (and in other modern browsers) this al...
...wo values to specify a range that is supported by a font-face, for example font-stretch: 50% 200%; font-style a font-style 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-style: oblique 20deg 50deg; font-weight a font-weight 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-weight: 100 400; 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...
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
the live example below, the value of align-items is stretch. try the other values and see how all of the items align against each other in the flex container. aligning one item with align-self the align-items property sets the align-self property on all of the flex items as a group. this means you can explicitly declare the align-self property to target a single item. the align-self property
accepts all of the same values as align-items plus a value of auto, which will reset the value to that which is defined on the flex container. in this next live example, the flex container has align-items: flex-start, which means the items are all aligned to the start of the cross axis. i have targeted the first item using a first-child selector and set that item to align-self: stretch; another item ha...
... control what happens with available space, should there be more space than is needed to display the items. in our initial example with display: flex on the container, the items display as a row and all line up at the start of the container. this is due to the initial value of justify-content being flex-start. any available space is placed at the end of the items. the justify-content property
accepts the same values as align-content. justify-content: flex-start justify-content: flex-end justify-content: center justify-content: space-between justify-content: space-around justify-content: space-evenly (not defined in the flexbox specification) in the example below, the value of justify-content is space-between. the available space after displaying the items is distributed between the...
border - CSS: Cascading Style Sheets
ues will be set to their initial value. importantly, border cannot be used to specify a custom value for border-image, but instead sets it to its initial value, i.e., none. the border shorthand is especially useful when you want all four borders to be the same. to make them different from each other, however, you can use the longhand border-width, border-style, and border-color properties, which
accept different values for each side. alternatively, you can target one border at a time with the physical (e.g., border-top ) and logical (e.g., border-block-start) border properties. borders vs. outlines borders and outlines are very similar. however, outlines differ from borders in the following ways: outlines never take up space, as they are drawn outside of an element's content. according to...
... of 'border' in that specification. candidate recommendation removes specific support for transparent, as it is now a valid <color>; this has no practical impact. though it cannot be set to a custom value using the shorthand, border now resets border-image to its initial value (none). css level 2 (revision 1)the definition of 'border' in that specification. recommendation
accepts the inherit keyword. also
accepts transparent as a valid color. css level 1the definition of 'border' in that specification. recommendation 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 r...
overflow-wrap - CSS: Cascading Style Sheets
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). ...
...e 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 otherwise
acceptable break points in the line, but soft wrap opportunities introduced by the word break are not considered when calculating min-content intrinsic sizes. formal definition initial valuenormalapplies tonon-replaced inline elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | break-word | anywhere examples comparing overflow-wrap, word-break, and hyphens ...
HTML attribute: multiple - HTML: Hypertext Markup Language
valid for the email and file input types and the <select>, the manner by which the user opts for multiple values depends on the form control. depending on the type, the form control may have a different appearance if the multiple attribute is set. for the file input type, the native messaging the browser provides differs. in firefox, the file input reads "no files selected" when the attribute is present and "no file selected" when not, when no files are selected. most browsers displaying a scrolling list box for a <select> control with the multiple attribute set versus a single line dropdown when the attribute is ommitted. ...
...ions from the associated <datalist> for subsequent email addresses when multiple is present. others do not. file input when multiple is set on the file input type, the user can select one or more files: <form method="post" enctype="multipart/form-data"> <p> <label for="uploads"> choose the images you want to upload: </label> <input type="file" id="uploads" name="uploads"
accept=".jpg, .jpeg, .png, .svg, .gif" multiple> </p> <p> <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="...
<form> - HTML: Hypertext Markup Language
he :valid and :invalid css pseudo-classes to style a <form> element based on whether or not the elements inside the form are valid. content categories flow content, palpable content permitted content flow content, but not containing <form> elements tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content implicit aria role form if the form has an accessible name, otherwise no corresponding role permitted aria roles search, none or presentation dom interface htmlformelement attributes this element includes the global attributes.
accept comma-separated content types the server
accepts. this attribute was removed in html5 and should no...
...icit aria role form if the form has an accessible name, otherwise no corresponding role permitted aria roles search, none or presentation dom interface htmlformelement attributes this element includes the global attributes.
accept comma-separated content types the server
accepts. this attribute was removed in html5 and should not be used. instead, use the
accept attribute on <input type=file> elements.
accept-charset space-separated character encodings the server
accepts. the browser uses them in the order in which they are listed. the default value means the same encoding as the page. (in previous versions of html, character encodings could also be delimited by commas.) autocapitalize a nonstandard attribute used by ios safari that controls how...
<img>: The Image Embed element - HTML: Hypertext Markup Language
file name isn't representative of the image's contents. an alt decision tree • images • wai web accessibility tutorials alt-texts: the ultimate guide — axess lab how to design great alt text: an introduction | deque mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 the title attribute the title attribute is not an
acceptable substitute for the alt attribute. additionally, avoid duplicating the alt attribute's value in a title attribute declared on the same image. doing so may cause some screen readers to announce the description twice, creating a confusing experience. the title attribute should also not be used as supplemental captioning information to accompany an image's alt description. if an image needs a ca...
...p technical summary content categories flow content, phrasing content, embedded content, palpable content. if the element has a usemap attribute, it also is a part of the interactive content category. permitted content none, it is an empty element. tag omission must have a start tag and must not have an end tag. permitted parents any element that
accepts embedded content. implicit aria role with non-empty alt attribute or no alt attribute: img with empty alt attribute: no corresponding role permitted aria roles with non-empty alt attribute: button checkbox link menuitem menuitemcheckbox menuitemradio option progressbar scrollbar separator...
<input type="date"> - HTML: Hypertext Markup Language
ts 1496275200000, a unix timestamp this code finds the first <input> element whose type is date, and sets its value to 2017-06-01 (june 1st, 2017). it then reads that value back in string and number formats. additional attributes along with the attributes common to all <input> elements, date inputs have the following attributes: attribute description max the latest
acceptable date min the earliest
acceptable date step the stepping interval, when clicking up and down spinner buttons and validating the date max the latest date to
accept. if the value entered into the element occurs afterward, the element fails constraint validation. if the value of the max attribute isn't a possible date string in the format yyyy-mm-dd, then the eleme...
...if the value entered into the element occurs beforehand, the element fails constraint validation. if the value of the min attribute isn't a possible date string in the format yyyy-mm-dd, then the element has no minimum date value. if both the max and min attributes are set, this value must be a date string earlier than or equal to the one in the max attribute. ...
<input type="datetime-local"> - HTML: Hypertext Markup Language
e used to convert numeric date information into a properly-formatted string, or you can do it manually. for example, the date.toisostring() method can be used for this purpose. additional attributes in addition to the attributes common to all <input> elements, datetime-local inputs offer the following attributes: attribute description max the latest date and time to
accept min the earliest date and time to
accept step the stepping interval to use for this input, such as when clicking arrows on spinner controls or performing validation max the latest date and time to
accept. if the value entered into the element is later than this timestamp, the element fails constraint validation. if the value of the max attribute isn't a valid strin...
...if the value of the min attribute isn't a valid string which follows the format yyyy-mm-ddthh:mm, then the element has no minimum value. this value must specify a date string earlier than or equal to the one specified by the max attribute. ...
<input type="image"> - HTML: Hypertext Markup Language
ithub.com/mdn/interactive-examples and send us a pull request. value none — the value attribute should not be specified. events none. supported common attributes alt, src, width, height, formaction, formenctype, formmethod, formnovalidate, formtarget idl attributes none. methods none. value <input type="image"> elements do not
accept value attributes. the path to the image to be displayed is specified in the src attribute. additional attributes in addition to the attributes shared by all <input> elements, image button inputs support the following attributes: attribute description alt alternate string to display when the image can't be shown formaction the url to which to submit the d...
...at, in pixels. the button is the same size as the image; if you need the button's hit area to be bigger than the image, you will need to use css (e.g. padding). also, if you specify only one dimension, the other is automatically adjusted so that the image maintains its original aspect ratio. overriding default form behaviors <input type="image"> elements — like regular submit buttons — can
accept a number of attributes that override the default form behavior: formaction html5 the uri of a program that processes the information submitted by the input element; overrides the action attribute of the element's form owner. formenctype html5 specifies the type of content that is used to submit the form to the server. possible values are: application/x-www-form-urlencoded: the defaul...
<input type="password"> - HTML: Hypertext Markup Language
tead of a full keyboard, to make entering the password easier. if the pin is for one-time use, set the autocomplete attribute to either off or one-time-code to suggest that it's not saved. <label for="pin">pin: </label> <input id="pin" type="password" inputmode="numeric"> setting length requirements as usual, you can use the minlength and maxlength attributes to establish minimum and maximum
acceptable lengths for the password. this example expands on the previous one by specifying that the user's pin must be at least four and no more than eight digits. the size attribute is used to ensure that the password entry control is eight characters wide. <label for="pin">pin:</label> <input id="pin" type="password" inputmode="numeric" minlength="4" maxlength="8" size="8"> selecting text ...
...id="hexid" type="password" pattern="[0-9a-fa-f]{4,8}" title="enter an id consisting of 4-8 hexadecimal digits" autocomplete="new-password"> disabled this boolean attribute indicates that the password field is not available for interaction. additionally, disabled field values aren't submitted with the form. examples requesting a social security number this example only
accepts input which matches the format for a valid united states social security number. these numbers, used for tax and identification purposes in the us, are in the form "123-45-6789". assorted rules for what values are permitted in each group exist as well. html <label for="ssn">ssn:</label> <input type="password" id="ssn" inputmode="numeric" minlength="9" maxlength="12" pattern="(?!000)([0-6]\...
<input type="range"> - HTML: Hypertext Markup Language
er. firefox only. orient similar to the -moz-orient non-standard css property impacting the <progress> and <meter> elements, the orient attribute defines the orientation of the range slider. values include horizontal, meaing the range is rendered horizontally, and vertical, where the range is rendered vertically. note: the following input attributes do not apply to the input range:
accept, alt, checked, dirname, formaction, formenctype, formmethod, formnovalidate, formtarget, height, maxlength, minlength, multiple, pattern, placeholder, readonly, required, size, src, and width. any of these attributes, if included, will be ignored. examples while the number type lets users enter a number with optional constraints forcing their value to be between a minimum and a maximum value, ...
...ange" min="-10" max="10"> setting the value's granularity by default, the granularity, is 1, meaning that the value is always an integer. you can change the step attribute to control the granularity. for example, if you need a value between 5 and 10, accurate to two decimal places, you should set the value of step to 0.01: <input type="range" min="5" max="10" step="0.01"> if you want to
accept any value regardless of how many decimal places it extends to, you can specify a value of any for the step attribute: <input type="range" min="0" max="3.14" step="any"> this example lets the user select any value between 0 and π without any restriction on the fractional part of the value selected. adding hash marks and labels the html specification gives browsers some flexibility on how ...
<input type="text"> - HTML: Hypertext Markup Language
ty string (""). ...
... note: html form validation is not a substitute for server-scripts that ensure the entered data is in the proper format. it's far too easy for someone to make adjustments to the html that allow them to bypass the validation, or to remove it entirely. it's also possible for someone to...
<input type="url"> - HTML: Hypertext Markup Language
matted properly. ...
... url, you get automatic validation that the entered text is at least in the correct form to potentially be a legitimate url. this can help avoid cases in which the user mis-types their web site's address, or provides an invalid one. it's important, however, to note that this is not enough to ensure that the specified text is a url which actually exists, corresponds to the user of the site, or is
acceptable in any other way. it simply ensures that the value of the field is properly formatted to be a url. note: it's also crucial to remember that a user can tinker with your html behind the scenes, so your site must not use this validation for any security purposes. you must verify the url on the server-side of any transaction in which the provided text may have any security implications of any k...
<input type="week"> - HTML: Hypertext Markup Language
so get and set the value in javascript using the input element's value property, for example: var weekcontrol = document.queryselector('input[type="week"]'); weekcontrol.value = '2017-w45'; additional attributes in addition to the attributes common to <input> elements, week inputs offer the following attributes: attribute description max the latest year and week to
accept as valid input min the earliest year and week to
accept as valid input readonly a boolean which, if present, indicates that the user cannot edit the field's contents step the stepping interval (the distance between allowed values) to use for both user interface and constraint validation max the latest (time-wise) year and week number, in the string form...
... year and week to
accept as valid input readonly a boolean which, if present, indicates that the user cannot edit the field's contents step the stepping interval (the distance between allowed values) to use for both user interface and constraint validation max the latest (time-wise) year and week number, in the string format discussed in the value section above, to
accept. if the value entered into the element exceeds this, the element fails constraint validation. if the value of the max attribute isn't a valid week string, then the element has no maximum value. this value must be greater than or equal to the year and week specified by the min attribute. min the earliest year and week to
accept. if the value of the element is less than this, the element fails c...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
next for rel to preload the next page in a document series. attributes this element includes the global attributes. as this attribute is only used when rel="preload" or rel="prefetch" has been set on the <link> element. it specifies the type of content being loaded by the <link>, which is necessary for request matching, application of correct content security policy, and setting of correct
accept request header. furthermore, rel="preload" uses this as a signal for request prioritization. the table below lists the valid values for this attribute and the elements or resources they apply to. value applies to audio <audio> elements document <iframe> and <frame> elements embed <embed> elements fetch ...
...amples in preloading content with rel="preload". technical summary content categories metadata content. if itemprop is present: flow content and phrasing content. permitted content none, it is an empty element. tag omission as it is a void element, the start tag must be present and the end tag must not be present permitted parents any element that
accepts metadata elements. if itemprop is present: any element that
accepts phrasing content. implicit aria role link with href attribute permitted aria roles no role permitted dom interface htmllinkelement specifications specification status comment html living standardthe definition of '<link>' in that specification. living sta...
<select>: The HTML Select element - HTML: Hypertext Markup Language
ded, the value defaults to the text contained inside the element. you can include a selected attribute on an <option> element to make it selected by default when the page first loads. the <select> element has some unique attributes you can use to control it, such as multiple to specify whether multiple options can be selected, and size to specify how many options should be shown at once. it also
accepts most of the general form input attributes such as required, disabled, autofocus, etc. you can further nest <option> elements inside <optgroup> elements to create separate groups of options inside the dropdown. for further examples, see the native form widgets: drop-down content. attributes this element includes the global attributes. autocomplete a domstring providing a hint for a user a...
...t be selected at all. technical summary content categories flow content, phrasing content, interactive content, listed, labelable, resettable, and submittable form-associated element permitted content zero or more <option> or <optgroup> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role combobox with no multiple attribute and no size attribute greater than 1, otherwise listbox permitted aria roles menu with no multiple attribute and no size attribute greater than 1, otherwise no role permitted dom interface htmlselectelement specifications specification status comments h...
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
f you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, must have both a start tag and an end tag. permitted parents any element that
accepts phrasing content, or any element that
accepts flow content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes the <strong> element is for content that is of "strong importance," including things of great seriousness or urgency (such as w...
...ter importance compared to nearby content. typically this element is rendered by default using a bold font weight. however, it should not be used simply to apply bold styling; use the css font-weight property for that purpose. use the <b> element to draw attention to certain text without indicating a higher level of importance. use the <em> element to mark text that has stress emphasis. another
accepted use for <strong> is to denote the labels of paragraphs which represent notes or warnings within the text of a page. <b> vs. <strong> it is often confusing to new developers why there are so many ways to express the same thing on a rendered website. <b> and <strong> are perhaps one of the most common sources of confusion, causing developers to ask "should i use <b> or <strong>? don't they both...
<sup>: The Superscript element - HTML: Hypertext Markup Language
'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes the <sup> element should only be used for typographical reasons—that is, to change the position of the text to comply with typographical conventions or standards, rath...
...include (but aren't necessarily limited to): displaying exponents, such as "x3." it may be worth considering the use of mathml for these, especially in more complex cases. see exponents under examples below. displaying superior lettering, which is used in some languages when rendering certain abbreviations. for example, in french, the word "mademoiselle" can be abbreviated "mlle"); this is an
acceptable use case. see superior lettering for examples. representing ordinal numbers, such as "4th" instead of "fourth." see ordinal numbers for examples. examples exponents exponents, or powers of a number, are among the most common uses of superscripted text. for example: <p>one of the most common equations in all of physics is <var>e</var>=<var>m</var><var>c</var><sup>2</sup>.<p> the resulti...
<textarea> - HTML: Hypertext Markup Language
e name of the associated data point submitted to the server when the form is submitted. rows and cols attributes to allow you to specify an exact size for the <textarea> to take. setting these is a good idea for consistency, as browser defaults can differ. default content entered between the opening and closing tags. <textarea> does not support the value attribute. the <textarea> element also
accepts several attributes common to form <input>s, such as autocomplete, autofocus, disabled, placeholder, readonly, and required. attributes this element includes the global attributes. autocapitalize this is a non-standard attribute supported by webkit on ios (therefore nearly all browsers running on ios, including safari, firefox, and chrome), which controls whether and how the text value sh...
..." cols="30" readonly>i am a readonly textarea</textarea> technical summary content categories flow content, phrasing content, interactive content, listed, labelable, resettable, and submittable form-associated element. permitted content text tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role textbox permitted aria roles no role permitted dom interface htmltextareaelement specifications specification status comment html living standardthe definition of '<textarea>' in that specification. living standard html5the definition of '<textarea>' in that specification.
MIME types (IANA media types) - HTTP
l>name: <input name="mytextfield" value="test"></label> <label><input type="checkbox" name="mycheckbox"> check</label> <label>upload file: <input type="file" name="myfile" value="test.txt"></label> <button>send the file</button> </form> will send this message: post / http/1.1 host: localhost:8000 user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0
accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
accept-language: en-us,en;q=0.5
accept-encoding: gzip, deflate connection: keep-alive upgrade-insecure-requests: 1 content-type: multipart/form-data; boundary=---------------------------8721656041911415653955004498 content-length: 465 -----------------------------8721656041911415653955004498 content-disposition: form-data; name="my...
... to the browser. when the 206 partial content status code is sent, this mime type indicates that the document is composed of several parts, one for each of the requested ranges. like other multipart types, the content-type uses a boundary to separate the pieces. each piece has a content-type header with its actual type and a content-range of the range it represents. ...
Configuring servers for Ogg media - HTTP
requests correctly in order to support seeking and playing back regions of the media that aren't yet downloaded, gecko uses http 1.1 byte-range requests to retrieve the media from the seek target position. in addition, gecko uses byte-range requests to seek to the end of the media (assuming you serve the content-length header) in order to determine the duration of the media. your server should
accept the
accept-ranges: bytes http header if it can
accept byte-range requests. it must return 206: partial content to all byte range requests; otherwise, browsers can't be sure you actually support byte range requests. your server must also return 206: partial content for the request range: bytes=0- as well. include regular key frames when the browser seeks through ogg media to a specified time, i...
...ferior alternative, gecko can estimate the video length based on the content-length. see next point. don't use http compression for media files one common way to reduce the load on a web server is to use gzip or deflate compression when serving to a supporting web browser. although it's unlikely, it's possible the browser may advertise that it supports http compression (gzip/deflate) using the
accept-encoding: gzip,deflate header when requesting media files. your server should be configured to not do so. the data in media files is already compressed, so you won't get any real benefit from compression, and the use of compression makes it impossible for the browser to properly seek the video or determine its duration. another probelm with allowing http compression for media streaming: apache s...
Using HTTP cookies - HTTP
with the domain attribute, which gives access to that cookie on all other subdomains. this mechanism can be abused in a session fixation attack. see session fixation for primary mitigation methods. as a defence-in-depth measure, however, it is possible to use cookie prefixes to assert specific facts about the cookie. ...
...this is weaker than the __host- prefix. cookies with these prefixes that are not compliant with their restrictions are rejected by the browser. ...
Cache-Control - HTTP
e to be stored in a cache, which no-store prevents. expiration max-age=<seconds> the maximum amount of time a resource is considered fresh. unlike expires, this directive is relative to the time of the request. s-maxage=<seconds> overrides max-age or the expires header, but only for shared caches (e.g., proxies). ignored by private caches. max-stale[=<seconds>] indicates the client will
accept a stale response. an optional value in seconds indicates the upper limit of staleness the client will
accept. min-fresh=<seconds> indicates the client wants a response that will still be fresh for at least the specified number of seconds. stale-while-revalidate=<seconds> indicates the client will
accept a stale response, while asynchronously checking in the background for a fresh one. the s...
...indicates the upper limit of staleness the client will
accept. min-fresh=<seconds> indicates the client wants a response that will still be fresh for at least the specified number of seconds. stale-while-revalidate=<seconds> indicates the client will
accept a stale response, while asynchronously checking in the background for a fresh one. the seconds value indicates how long the client will
accept a stale response. see "keeping things fresh with stale-while-revalidate" for more information. stale-if-error=<seconds> indicates the client will
accept a stale response if the check for a fresh one fails. the seconds value indicates how long the client will
accept the stale response after the initial expiration. revalidation and reloading must-revalidate indicates that once a resource ...
Save-Data - HTTP
examples the vary header ensures that the content is cached properly (for instance ensuring that the user is not served a lower-quality image from the cache when save-data header is no longer present [e.g. after having switched from cellular to wi-fi]). ...
...from cellular to wi-fi]). ...
Set-Cookie - HTTP
s prefixed with __secure- or __host- can be used only if they are set with the secure attribute from a secure (https) origin. in addition, cookies with the __host- prefix must have a path of / (meaning any path at the host) and must not have a domain attribute. ...
...cure- or __host- can be used only if they are set with the secure attribute from a secure (https) origin. in addition, cookies with the __host- prefix must have a path of / (meaning any path at the host) and must not have a domain attribute. for clients that don't implement cookie prefixes, you cannot count on these additional assurances, and prefixed cookies will always be
accepted. ...
Strict-Transport-Security - HTTP
irectives max-age=<expire-time> the time, in seconds, that the browser should remember that a site is only to be accessed using https. includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. preload optional see preloading strict transport security for details. not part of the specification. description if a website
accepts a connection through http and redirects to https, visitors may initially communicate with the non-encrypted version of the site before being redirected, if, for example, the visitor types http://www.foo.com/ or even just foo.com. this creates an opportunity for a man-in-the-middle attack. the redirect could be exploited to direct visitors to a malicious site instead of the secure version of the ...
...ox hsts preload list : nsstspreloadlist.inc examples all present and future subdomains will be https for a max-age of 1 year. this blocks access to pages or sub domains that can only be served over http. strict-transport-security: max-age=31536000; includesubdomains in the following example, max-age is set to 2 years, raised from what was a former limit max-age of 1 year. note that 1 year is
acceptable for a domain to be included in browsers' hsts preload lists. 2 years is, however, the recommended goal as a website's final hsts configuration as explained on https://hstspreload.org. it also suffixed with preload which is necessary for inclusion in most major web browsers' hsts preload lists, e.g. chromium, edge, & firefox. strict-transport-security: max-age=63072000; includesubdomains; pre...
HTTP Messages - HTTP
of an http header: a case-insensitive string followed by a colon (':') and a value whose structure depends upon the header. the whole header, including the value, consist of one single line, which can be quite long. there are numerous request headers available. they can be divided in several groups: general headers, like via, apply to the message as a whole. request headers, like user-agent,
accept-type, modify the request by specifying it further (like
accept-language), by giving context (like referer), or by conditionally restricting it (like if-none). entity headers, like content-length which apply to the body of the request. obviously, there is no such header transmitted if there is no body in the request. body the final part of the request is its body. not all requests have one: ...
...same structure as any other header: a case-insensitive string followed by a colon (':') and a value whose structure depends upon the type of the header. the whole header, including its value, presents as a single line. there are numerous response headers available. these can be divided into several groups: general headers, like via, apply to the whole message. response headers, like vary and
accept-ranges, give additional information about the server which doesn't fit in the status line. entity headers, like content-length, apply to the body of the response. typically, no such headers are transmitted when there is no body in the response. body the last part of a response is the body. not all responses have one: responses with a status code that sufficiently answers the request without...
HTTP response status codes - HTTP
e entity headers are in the message body. put or post: the resource describing the result of the action is transmitted in the message body. trace: the message body contains the request message as received by the server 201 created the request has succeeded and a new resource has been created as a result. this is typically the response sent after post requests, or some put requests. 202
accepted the request has been received but not yet acted upon. it is noncommittal, since there is no way in http to later send an asynchronous response indicating the outcome of the request. it is intended for cases where another process or server handles the request, or for batch processing. 203 non-authoritative information this response code means the returned meta-information is not exactly the s...
...e 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 has been disabled and cannot be used. for example, an api may forbid delete-ing a resource. the two mandatory methods, get and head, must never be disabled and should not return this error code. 406 not
acceptable this response is sent when the web server, after performing server-driven content negotiation, doesn't find any content that conforms to the criteria given by the user agent. 407 proxy authentication required this is similar to 401 but authentication is needed to be done by a proxy. 408 request timeout this response is sent on an idle connection by some servers, even without any previous...
Function.prototype.apply() - JavaScript
o the function. starting with ecmascript 5 these arguments can be a generic array-like object instead of an array. see below for browser compatibility information. return value the result of calling the function with the specified this value and arguments. description note: while the syntax of this function is almost identical to that of call(), the fundamental difference is that call()
accepts an argument list, while apply()
accepts a single array of arguments. note: when the first argument is undefined or null a similar outcome can be achieved using the array spread syntax. you can assign a different this object when calling an existing function. this refers to the current object (the calling object). with apply, you can write a method once, and then inherit it in another object...
...e ecmascript 5th edition, you can also use any kind of object which is array-like. in practice, this means it's going to have a length property, and integer ("index") properties in the range (0..length - 1). for example, you could use a nodelist, or a custom object like { 'length': 2, '0': 'eat', '1': 'bananas' }. note: many older browsers—including chrome <17 and internet explorer <9—don't
accept array-like objects, and will throw an exception. examples using apply to append an array to another you can use push to append an element to an array. and, because push
accepts a variable number of arguments, you can also push multiple elements at once. but, if you pass an array to push, it will actually add that array as a single element, instead of adding the elements individually. so you ...
Web audio codec guide - Web media technologies
stored in what is perhaps the most widely distributed audio file format in the world, which is in large part responsible for the digital audio revolution of the late 1990s and early 2000s. mpeg-1 mp3 audio supports higher bit rates as well as higher sampling rates than mp3 audio in mpeg-2 files. mpeg-1 format mp3 is generally best for music or other complex audio, while mpeg-2 mode mp3 audio is
acceptable for speech and other simpler sounds. the patents behind mp3 have expired, removing many or most licensing concerns around using mp3 files in your projects. that makes them a good choice for many projects. supported bit rates mpeg-1 mode: 32 kbps, 40 kbps, 48 kbps, 56 kbps, 64 kbps, 80 kbps, 96 kbps, 112 kbps, 128 kbps, 160 kbps, 192 kbps, 224 kbps, 256 kbps, 320 kbps mp...
... can throw away everything else. the voice-specific codecs are all inherently very lossy, however, and any sound with significant information in the frequency bands outside the vocal range captured will be entirely lost. this makes these codecs completely unsuitable for anything but spoken words. even audio that contains only voices, but singing rather than simply speaking, will likely not be of
acceptable quality in one of these formats. voice recording and playback usually needs to be low-latency in order to synchronize with video tracks, or in order to avoid cross-talk or other problems. fortunately, the characteristics that lead to speech codecs being so efficient storage space-wise also make them tend to be very low latency. if you're working with webrtc, g.722, for example, has 4 ms late...
Digital audio concepts - Web media technologies
ed size of the audio while maximizing the percieved fidelity of the sound. an algorithm employing psychoacoustics may use any of the techniques mentioned here, and will almost certainly apply others as well. all of this means there is a fundamental question that has to be asked and answered before choosing a codec: given the content of the sound, the usage context, and the target audience, is it
acceptable to lose some degree of audio fidelity, and if so, how much; or is it necessary that, upon decoding the data, the result be identical to the source audio? lossy vs lossless compression if loss of detail and potentially fidelity is un
acceptable or undesirable, a lossless codec is preferred. on the other hand, if some degree of reduction of audio fidelity is okay, a lossy codec can be used. ge...
...e on average at a given level, while allowing some fluctuation, cbr uses an actually fixed bit rate for the duration of the audio. cbr is primarily used in codecs designed for voice-only purposes, where the frequency range and variation tends to be minimal, allowing cbr encoding to work without unworkable fluctuations in audio quality. variable bit rate variable bit rate (vbr) encoding works by
accepting as an input into the encoder a constant quality setting. this indicates a quality level to maintain for the duration of the audio, allowing the bit rate to fluctuate as needed to achieve that quality level. in portions of the sound where compression is easily achieved with minimum impact to quality, the bit rate may be very low, while in areas where compression is more complex, the bit rate wi...
Web video codec guide - Web media technologies
coding the video. the simplest guideline is this: anything that makes the encoded video look more like the original, uncompressed, video will generally make the resulting data larger as well. thus, it's always a tradeoff of size versus quality. in some situations, a greater sacrifice of quality in order to bring down the data size is worth that lost quality; other times, the loss of quality is un
acceptable and it's necessary to
accept a codec configuration that results in a correspondingly larger file. effect of source video format on encoded output the degree to which the format of the source video will affect the output varies depending on the codec and how it works. if the codec converts the media into an internal pixel format, or otherwise represents the image using a means other than si...
...e. while the immediate loss of size or smoothness of playback may be a negative factor, careful decision-making can result in a good end result. if a 1080p video is reduced to 720p prior to encoding, the resulting video can be much smaller while having much higher visual quality; even after scaling back up during playback, the result may be better than encoding the original video at full size and
accepting the quality hit needed to meet your size requirements. reduced frame rate similarly, you can remove frames from the video entirely and decrease the frame rate to compensate. this has two benefits: it makes the overall video smaller, and that smaller size allows motion compensation to accomplish even more for you. for exmaple, instead of computing motion differences for two frames that are tw...
Codecs used by WebRTC - Web media technologies
tion of 320 pixels wide by 240 pixels tall. it's encouraged that video be encoded at a frame rate and size no lower than that, since that's essentially the lower bound of what webrtc generally is expected to handle. sdp supports a codec-independent way to specify preferred video resolutions (rfc 6236. this is done by sending an a=imageattr sdp attribute to indicate the maximum resolution that is
acceptable. the sender is not required to support this mechanism, however, so you have to be prepared to receive media at a different resolution than you requested. beyond this simple maximum resolution request, specific codecs may offer further ways to ask for specific media configurations. supported video codecs webrtc establishes a baseline set of codecs which all compliant browsers are required to...
...you should at least allow for fallback to one of the mandatory codecs if support is unavailable for the codec you prefer. audio in general, if it's available and the audio you wish to send has a sample rate greater than 8 khz, you should strongly consider using opus as your primary codec. for voice-only connections in a constrained environment, using g.711 at an 8 khz sample rate can provide an
acceptable experience for conversation, but typically you'll use g.711 as a fallback option, since there are other options which are more efficient and sound better, such as opus in its narrowband mode. video there are a number of factors that come into play when deciding upon a video codec (or set of codecs) to support. licensing terms before choosing a video codec, make sure you're aware of any li...
2015 MDN Fellowship Program - Archive of obsolete content
this page is a historical archive, originally hosted at /fellowship, and was localized. more information: mdn/developerfellowship wiki page. announcing the mdn fellows! blog post, may 14 2015. mdn fellows successfully oriented blog post, july 6 2015. mdn fellows: what they did & what’s next blog post, september 23, 2015. 2015 mdn fellowship program launching in q1 2015, the mozilla developer fellowship intends to accelerate the involvement of highly-skilled and experienced web developers with the open web. ...
Loading Content Scripts - Archive of obsolete content
n 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; ... 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 contentscri...
Content Scripts - Archive of obsolete content
the point the domcontentloaded event fires. at this point, content scripts are able to interact with the dom content, but externally-referenced stylesheets and images may not have finished loading. "end": load the scripts after all content (dom, js, css, images) for the page has been loaded, at the time the window.onload event fires. the default value is "end". note that tab.attach() doesn't
accept contentscriptwhen, because it's generally called after the page has loaded. passing configuration options the contentscriptoptions is a json object that is exposed to content scripts as a read-only value under the self.options property: // main.js var tabs = require("sdk/tabs"); tabs.on('ready', function(tab) { tab.attach({ contentscript: 'window.alert(self.options.message);', ...
page-mod - Archive of obsolete content
pts: are not attached to any tabs that are already open when the page-mod is created. are attached to all documents whose url matches the rule: so if your rule matches a specific hostname and path, and the topmost document that satisfies the rule includes ten iframes using a relative url, then your page-mod is applied eleven times. you can modify this behavior using the attachto option. it
accepts the following values: "existing": the page-mod will be automatically applied on already opened tabs. "top": the page-mod will be applied to top-level tab documents "frame": the page-mod will be applied to all iframes inside tab documents if the option is set at all, you must set at least one of "top" and "frame". for example, the following page-mod will be attached to already opened tabs...
url - Archive of obsolete content
parameters source : string a string to be converted into a url. if source is not a valid uri, this constructor will throw an exception. ...
core/promise - Archive of obsolete content
e promise utility functions provided by other promise libraries. for example grouping promises to observe single resolution of all of them is as simple as this: var group = promised(array); var abc = group(aasync, basync, casync).then(function(items) { return items[0] + items[1] + items[2]; }); all the all function is provided to consume an array of promises and return a promise that will be
accepted upon the
acceptance of all the promises in the initial array. this can be used to perform an action that requires values from several promises, like getting user information and server status, for example: const { all } = require('sdk/core/promise'); all([getuser, getserverstatus]).then(function (result) { return result[0] + result[1] }); if one of the promises in the array is rejected, the...
dev/panel - Archive of obsolete content
e. connecting volcan.js provides a global connect() function that takes a messageport connected to the debugger server, and returns a promise which is fulfilled with an object representing the root actor: volcan.connect(debuggee).then(gotroot); function gotroot(root) { // can use root actor here } actors actors in the remote debugging protocol are volcan.js objects. the messages actors can
accept are methods of those objects. the message type becomes the method name. for example, the root actor object has a method listtabs and the stylesheet actor object has a method getstylesheets. any additional parameters sent in the message become arguments to the method. if a message is expected to get a reply, then the method returns a promise which is fulfilled with the reply. if the message reply...
places/bookmarks - Archive of obsolete content
(saves, inputs) { // like the previous example, the "end" event returns an // array of all of our updated saves. only explicitly saved // items are returned in this array -- the `group` won't be // present here. console.log(saves[0].title); // "ran" console.log(saves[2].group.title); // "guitars" }); searching for bookmarks bookmarks can be queried with the search() function, which
accepts a query object or an array of query objects, as well as a query options object. query properties are and'd together within a single query object, but are or'd together across multiple query objects. let { search, unsorted } = require("sdk/places/bookmarks"); // simple query with one object search( { query: "firefox" }, { sort: "title" } ).on("end", function (results) { // results matchin...
stylesheet/style - Archive of obsolete content
a string, or an array of strings, that represents local uri to stylesheet. source string,array a string, or an array of strings, that contains css rules. those rules are applied after the rules in the stylesheet specified with uri options, if provided. optional options: name type type string the type of the sheet. it
accepts the following values: "agent", "user" and "author". if not provided, the default value is "author". style properties source an array of strings that contains the css rule(s) specified in the constructor's option; null if no source option was given to the constructor. this property is read-only. uri an array of strings that contains the stylesheet local uri(s) specified in the con...
window/utils - Archive of obsolete content
tion) windows. it takes the uri of the window document as its first argument and an optional hash of options as its second argument. var { open } = require('sdk/window/utils'); var window = open('data:text/html,hello window'); this function wraps nsiwindowwatcher.openwindow. parameters uri : string uri of the document to be loaded into the window. only chrome, resource, and data schemes are
accepted. options : object options for the function, with the following properties: name type parent nsidomwindow parent for the new window. optional, defaults to null. name string name that is assigned to the window. optional, defaults to null. features object map of features to set for the window, defined like this: { width: 10,...
console - Archive of obsolete content
owser console. if you're developing your add-on using the extension auto-installer, then the add-on is installed in firefox, meaning that messages will appear in the browser console. but see the discussion of logging levels: by default, messages logged using log(), info(), trace(), or warn() won't be logged in these situations. console methods all console methods except exception() and trace()
accept one or more javascript objects as arguments and log them to the console. depending on the console's underlying implementation and user interface, you may be able to examine the properties of non-primitive objects that are logged. console.debug(...) deprecated, you should use console.log() instead. console.error(object[, object, ...]) logs the arguments to the console, preceded by "error:" and...
Tools - Archive of obsolete content
cfx to jpm a guide to working with jpm if you're already familiar with cfx. console enables your add-on to log error, warning or informational messages. jpm jpm is a command-line tool that enables you to test, run, and package add-ons. jpm-mobile the node-based replacement for cfx --force-mobile. enables you to run and test add-ons for firefox mobile (aka fennec). ...
Adding a Button to the Toolbar - Archive of obsolete content
to follow this tutorial you'll need to have learned the basics of jpm. to add a button to the toolbar, use the action button or toggle button modules. create a new directory, navigate to it, and execute jpm init,
accepting all the defaults. create a directory called "data", mkdir data and save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png then open the file called "index.js" in the root of your addon directory and add the following code to it: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, on...
Getting Started (jpm) - Archive of obsolete content
a command prompt. install firefox developer version for testing your add-on. initializing an empty add-on in the command prompt, create a new directory. navigate to it, type jpm init, and hit enter: mkdir my-addon cd my-addon jpm init you'll then be asked to supply some information about your add-on: this will be used to create your add-on's package.json file. for now, just press enter to
accept the default for each property. for more information on jpm init, see the jpm command reference. once you've supplied a value or
accepted the default for these properties, you'll be shown the complete contents of "package.json" and asked to
accept it. implementing the add-on now you can write the add-on's code. unless you've changed the value of "entry point" ("main" in package.json), this goes...
Logging - Archive of obsolete content
ject with most of the same methods as the dom console, including methods to log error, warning, or informational messages. you don't have to require() anything to get access to the console. it is automatically made available to you. the console.log() method prints an informational message: console.log("hello world"); try it out: create a new directory, and navigate to it execute jpm init,
accepting all the defaults open "index.js" and add the line above execute jpm run firefox will start, and the following line will appear in the command window you used to execute jpm run: info: hello world! console in content scripts you can use the console in content scripts as well as in your main add-on code. the following add-on logs the html content of every tab the user loads, by calling c...
Modifying Web Pages Based on URL - Archive of obsolete content
d 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 browser window that opens. below is what you should see. specifying the match pattern match pattern uses match-pattern syntax. you can pass a single match-pattern string, or an array. keeping the content script in a separate file in the example above, we've supplied content script as a st...
Using third-party modules (jpm) - Archive of obsolete content
menuitem --save now you'll see a new directory in your add-on root called "node_modules" that contains a directory "menuitem". in your add-on code, you can require() modules by passing a path to the module starting from, but not including "node_modules": var menuitems = require("menuitem"); details create a new directory called, for example, "my-menuitem", navigate to it, type "jpm init" and
accept all the defaults: mkdir my-menuitem cd my-menuitem jpm init install the menuitem package from npm: npm install menuitem --save this will install the package in the current directory, under a directory called "node_modules". the --save argument instructs npm to add this package to the dependencies key in the add-on's package.json file. you'll now see a new directory in "my-menuitem" called "...
Bootstrapped extensions - Archive of obsolete content
} else { console.log('not a permanent uninstall, likely an upgrade or downgrade'); } } void uninstall( data, reason ); parameters data a bootstrap data structure. reason one of the reason constants, indicating why the extension is being uninstalled. this will be one of addon_uninstall, addon_upgrade, or addon_downgrade. reason constants the bootstrap functions
accept a reason parameter, which explains to the extension why it's being called. the reason constants are: constant value description app_startup 1 the application is starting up. app_shutdown 2 the application is shutting down. addon_enable 3 the add-on is being enabled. addon_disable 4 the add-on is being disabled. (also sent...
Downloading Files - Archive of obsolete content
xample, with empty dummy methods if you are not interested about the progress. instead of using qi like above, you can also implement nsiinterfacerequestor and return nsiauthprompt from there, like nsiwebbrowserpersist.progresslistener documentation suggests. downloading images sample function for fetching an image file from a url. // this function is for fetching an image file from a url. //
accepts a url and returns the file. // returns empty if the file is not found (with an 404 error for instance). // tried with .jpg, .ico, .gif (even .html). function getimagefromurl(url) { var ioserv = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var channel = ioserv.newchannel(url, 0, null); var stream = channel.open(); ...
View Source for XUL Applications - Archive of obsolete content
l) 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 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: aurl 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. alin...
Common Pitfalls - Archive of obsolete content
etter_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 for uri loads before loading a uri, one of two security checks needs to be performed: if the uri is a string that will be loaded v...
Default Preferences - Archive of obsolete content
tual file, despite having .js extension, is not a javascript file. you may not set variables inside of it, nor may do any kind of program flow control (ifs, loops etc.) nor even calculated values (i.e. 3600 * 24 * 5). doing so will cause mozilla to stop processing your preferences file without any notification, warning, error, or exception. think of it more as an .ini file. comments are perfectly
acceptable. inside your file you set preferences using the pref() function: pref("name", "value") example: pref('extensions.defaultprefs.example.int', 1); pref('extensions.defaultprefs.example.float', 0.1); pref('extensions.defaultprefs.example.string', 'fadf'); pref('extensions.defaultprefs.example.bool', true); notice that unlike when you're reading preferences, writing default preferences uses the...
Extension Packaging - Archive of obsolete content
nsion xpis in some cases, a single xpi file may wish to install multiple extensions/themes. a special kind of extension xpi, called the multiple item package, explains how to create this kind of package. (firefox 1.5/xulrunner 1.8 required.) from the release of firefox 53, multiple item extension packages are no longer supported and will not load. as a consequence, these packages are no longer
accepted by amo. official references for toolkit api structure of an installable bundle: describes the common structure of installable bundles, including extensions, themes, and xulrunner applications extension packaging: specific information about how to package extensions theme packaging: specific information about how to package themes multiple-item extension packaging: specific informati...
How to convert an overlay extension to restartless - Archive of obsolete content
function() { return loadpropertiesfile("chrome://myaddon/locale/mystrings.properties"); }); function loadpropertiesfile(path) { /* hack: the string bundle cache is cleared on addon shutdown, however it doesn't appear to do so reliably. errors can erratically happen on next load of the same file in certain instances. (at minimum, when strings are added/removed) the apparently
accepted solution to reliably load new versions is to always create bundles with a unique url so as to bypass the cache. this is accomplished by passing a random number in a parameter after a '?'. (this random id is otherwise ignored) the loaded string bundle is still cached on startup and should still be cleared out of the cache on addon shutdown. this just bypasses the built-in ca...
Install Manifests - Archive of obsolete content
nen tabs an.</em:description> </description> </em:localized> the following properties which are described elsewhere in this page can be included in the localized property: name description creator homepageurl developer translator contributor more documentation can be found at localizing extension descriptions. optionstype the type of user-interface used for displaying the options.
accepted values are: 1 opens optionsurl in a dialog box 2 options are displayed inside the add-on manager 3 opens optionsurl in a new tab (if the application supports that), or a dialog box optionstype defaults to 1 if there is an optionsurl included in install.rdf or 2 if there is no optionsurl and the file options.xul exists in the root of the add-on. <em:o...
Installing Extensions and Themes From Web Pages - Archive of obsolete content
nction must return false so that when the link is clicked, only the script is run, and the link href is not navigated to. if you omit this step, the user may see two installation dialogs—since you've effectively invoked two install requests, one from the installtrigger, one from trying to load the xpi file directly. available parameters for the install object the installtrigger.install method
accepts a javascript object as a parameter, with several properties on that object used to affect the install. url the url property specifies the url of the xpi to install. this property is required. iconurl the iconurl property specifies an icon to be displayed in the installation dialog. this property is optional. if you do not specify an icon, the default icon will be used, usually a green puzzle...
Multiple item extension packaging - Archive of obsolete content
a multiple item package provides the ability to package multiple installable bundles which can then be downloaded and installed by a user, or provided pre-packaged with an application or by an external program. every multiple item package must provide an install.rdf file (not old-style install.js!) and has the same requirements as an extension except as noted below. ...
Appendix: What you should know about open-source software licenses - Archive of obsolete content
g maintained by the oss project team. but the team may not permit just anyone to contribute additional code whenever they want—if they did, then viruses and back-doors could wind up being distributed in the official version. so oss gives you the freedom to duplicate, distribute, and modify source code, but if you want to contribute those modifications back to the core project, the project’s
acceptance is an entirely different matter. developers who contribute to the free office suite openoffice.org are requested to enter into a joint copyright assignment with sun microsystems, the initial developer. despite the fact that different modules have different copyright holders, and overall license management is complicated, by taking this contract as a kind of proxy letter, sun is able to make ...
Appendix D: Loading Scripts - Archive of obsolete content
rieving 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 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...
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
attribute('href'))"); } escaping functions when the code fragment in question is not an event handler attribute and there is no feasible way to pass the data through other means, they must be escaped with functions such as uneval, string.quote, json.stringify, or number. generating scripts in this matter is deprecated and should be avoided wherever possible, but is relatively safe and sometimes
acceptable. function createscript(href, otherstuff) { var script = function (href, otherstuff) { dostuffwith(href); dootherstuff(); for (var somestuff in otherstuff) dosomemorestuffwith(somestuff); } return script.tosource() + "(" + [string.quote(href), uneval(otherstuff)] + ")"; } safely using remote html in the above cases, we're working with text co...
Intercepting Page Loads - Archive of obsolete content
efficient, and a good way to do this is to filter out unneeded cases right from the start. shouldload is called for every load operation firefox tries to do, including images, scripts and xul documents. a good filter would look like this: shouldload : function(acontenttype, acontentlocation, arequestorigin, acontext, amimetypeguess, aextra) { let result = components.interfaces.nsicontentpolicy.
accept; // we should check for type_subdocument as well if we want frames. if ((components.interfaces.nsicontentpolicy.type_document == acontenttype) && some_regular_expression.test(acontentlocation.spec)) { // do stuff here, possibly changing result. } return result; } the content policy is applied very early in the process, even before the request is made, allowing a very clean c...
The Box Model - Archive of obsolete content
the case for xul, except there are two flexibility directions to consider. an hbox is as big as its contents horizontally, but it will occupy all the available space vertically. you can make an hbox flexible horizontally with the css property -moz-box-flex or the flex attribute. the same applies to a vbox, but in the other direction. unlike most style attributes, the flex attribute is considered
acceptable to use in xul code. this is because this attribute is used much too often, and it would require a great deal of css code to avoid using it. at any rate, it can always be overriden using css, so your extension won't lose skinability because of it. flexibility is defined as a numeric value. the default value for most elements is 0, which means that the element will not stretch in the direction...
The Essentials of an Extension - Archive of obsolete content
laced for a simpler database system. we'll discuss both of these storage systems further ahead in the tutorial. now let's look at the important parts of the file. <em:id>helloworld@xulschool.com</em:id> this is the unique identifier for the extension. firefox needs this to distinguish your extension from other extensions, so it is required that you have an id that is unique. there are two
accepted standards for add-on ids. one is the email-like format in the hello world example, which should be something like <project-name>@<yourdomain>. the other standard practice is to use a generated uuid string, which is extremely unlikely to be duplicated. unix-based systems have a command line tool called uuidgen that generates uuids. there are also downloadable tools for all platforms that generat...
Security best practices in extensions - Archive of obsolete content
tent 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 legitimate environment for remote scripts is to run in a sandbox. for more information, refer to the evalinsandbox() section. evalinsandbox the evalinsandbox document explains very well how it works, so there will be no repetition here. the usefulness of it an...
Tabbed browser - Archive of obsolete content
*this* browser window in case another one is currently focused tabbrowser.ownerdocument.defaultview.focus(); } } the function can be called like so: openandreuseonetabperattribute("myextension-myattribute", "http://developer.mozilla.org/"). closing a tab this example closes the currently selected tab. gbrowser.removecurrenttab(); there is also a more generic removetab method, which
accepts a xul tab element as its single parameter. changing active tab this moves one tab forward (to the right). gbrowser.tabcontainer.advanceselectedtab(1, true); this moves one tab to the left. gbrowser.tabcontainer.advanceselectedtab(-1, true); detecting page load see also code snippets:on page load function examplepageload(event) { if (event.originaltarget instanceof components.interfac...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
or without cost. our engineer, aaron jones, actually ended up rebuilding the majority of our vignette templates from scratch. i ran into a steep learning curve, not with the web standards themselves, but with the quirky rendering behaviors and inconsistencies in various browsers. our writers and editors must get used to some new rules when generating the day's stories. our management also has to
accept the fact that some older or smaller browsers may be getting an un-styled version of our content. we know that some users may prefer getting an un-styled version, because they'll finally be able to read our content in the browser they use. but some users may write in, frustrated and complaining about the horrible design decisions we've made. those feedback loops will have to be managed appropriate...
Index of archived content - Archive of obsolete content
string rosetta stone structure of an installable bundle supporting per-window private browsing supporting private browsing mode table cellmap table cellmap - border collapse table layout regression tests table layout strategy tamarin abcasm tamarin
acceptance testing abc assembler tests actionscript
acceptance tests tamarin
acceptance test template actionscript performance tests cmdline tests running tamarin
acceptance tests running tamarin performance tests ...
No Proxy For configuration - Archive of obsolete content
black-lists port. only applies to one port (no support for ranges and/or multiple ports). port-only filters ":80" or "*:80" are not supported. all non-fqdn hosts, such as intranet hosts the string "<local>" (without quotes) "<local>" bypasses the proxy for all hostnames which have no periods in them. for example: "https://mycompanyintranet/" formats that are not
accepted example domain filters with interior wildcards www.*.com ip address string prefixes 127. or 10.0.* ip addresses with wildcards in quads 10.*.*.* preferences name network.proxy.no_proxies_on default value localhost, 127.0.0.1 by default "localhost" and "127.0.0.1" are excluded, since most people assume these should con...
Creating a Microsummary - Archive of obsolete content
conclusion you should now have a microsummary generator that displays the current firefox download count when you install it, bookmark the spread firefox home page, and select the microsummary from the summary drop-down menu in the add bookmark dialog. for more information about microsummaries, see the microsummaries home page. ...
Drag and Drop - Archive of obsolete content
ich can be called from within the drag event handlers to get and modify the state of the drag. the function returns an object that implements nsidragsession. the interface nsidragsession is used to get and set properties of the drag that is currently occuring. the following properties and methods are available: candrop set this property to true if the element the mouse is currently over can
accept the object currently being dragged to be dropped on it. set the value to false if it doesn't make sense to drop the object on it. this should be changed in the ondragover and ondragenter event handlers. dragaction set to the current action to be performed, which should be one or more of the constants described earlier. this can be used to provide extra feedback to the user. numdropitems the...
Editor Embedding Guide - Archive of obsolete content
for color values, use the cstring representation of rrggbb, e.g., red="#ff0000" and black="#000000". cmd_fontface sets the font face for the current selection. getcommandstate "state_attribute" (cstring) docommand "state_attribute" (cstring or string) "helvetica, arial, sans-serif" "times new roman, times, serif" "courier new, courier, monospace" any string is
acceptable. the above strings should be considered examples of base functionality and in no way imply that this command won't handle other fonts. cmd_align sets the alignment for the lines contained in the current selection. getcommandstate "state_attribute" (cstring) docommand "state_attribute" (cstring) "left", "right", "center", "justify" cmd_inserthtml cmd_insertlinknoui cmd_insertimag...
generateCRMFRequest() - Archive of obsolete content
string is an optional algorithm dependent parameter value. for diffie-hellman it is used to specify p and g parameters. for dsa, it will be used to specify pqg. if the key generation requires parameters and the value passed in is null, then the client will generate the parameters on its own. currently, this value is ignored. "keygenalgn" which algorithm the generated key will support.
acceptable values are (the mentioned values for keyusage pertain to the keyusage value of the certificate extension that will ultimately be in the issued certificate): "rsa-ex" - generate an rsa key for key exchange only (this will have eyencipherment set for keyusage.) "rsa-dual-use" - generate a single rsa key for both signing and encryption. (this will have digitalsignature, keyenciphe...
Enabling Experimental Jetpack Features - Archive of obsolete content
ountpathstring that enumerates where, starting from the jetpack base, the feature will be mounted. to get a list of mount paths that are available, see the method below. string here is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been formally
accepted into the core without additionally changing the script (barring any other changes made during integration). list() arrayreturns an array of the set of potential stringmountpath as used in jetpack.future.import(). this is an example of how to get this array. a quick way of displaying the list is to write it to the console.log. var list = jetpack.future.list();console.log(list); open the firebug ...
Enabling - Archive of obsolete content
untpathstring that enumerates where, starting from the jetpack base, the feature will be mounted. to get a list of mount paths that are available, see the method below. string here is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been formally
accepted into the core without additionally changing the script (barring any other changes made during integration). list()returns an array of the set of potential stringmountpath as used in jetpack.future.import(). this is an example of how to get this array. a quick way of displaying the list is to write it to the console.log. var list = jetpack.future.list(); console.log(list); open the firebug cons...
Me - Archive of obsolete content
the first sdk release for what we're up to next! the jetpack.me namespace provides mechanisms for introspecting the dynamic state of your jetpack. the namespace currently lives in the future and must be imported before it is used: jetpack.future.import("me"); methods onfirstrun(funcfunction)jetpack.me.onfirstrun() allows jetpacks to be notified after they are successfully installed. onfirstrun()
accepts a callback which is called after installation. note that this mechanism is independent of the first-run page; in particular, the callback is not a load event listener or jquery ready callback. onfirstrun() may be called anywhere in your jetpack, but if it is called as the result of some asynchronous operation such as a timeout or xmlhttprequest, it is ignored. if you call it multiple times, all ...
Enabling Experimental Jetpack Features - Archive of obsolete content
untpathstring that enumerates where, starting from the jetpack base, the feature will be mounted. to get a list of mount paths that are available, see the method below. string here is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been formally
accepted into the core without additionally changing the script (barring any other changes made during integration). list() arrayreturns an array of the set of potential stringmountpath as used in jetpack.future.import(). this is an example of how to get this array. a quick way of displaying the list is to write it to the console.log. var list = jetpack.future.list(); console.log(list); open the firebu...
New Security Model for Web Services - Archive of obsolete content
scripts really needs to be under the control of the stake holder, which is the resource and server owner -- not the user -- to determine whether a resource should be insulated from web applications loaded from outside of the firewall. using a soap header for verification soap messages have a distinct processing model allowing a header to be added that the recipient is required to understand and
accept, which identifies the untrusted source of a script making a request. soap services which have not been cleared for access by untrusted scripts will reject the requests. this is offered in the mozilla implementation of soap today. unfortunately, this does not prevent soap messages from being sent to non-soap addresses, which is a big enough problem that the verification cannot stand alone to guar...
Supporting private browsing mode - Archive of obsolete content
default. for example, the fire.fm extension has a preference 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...
Actionscript Performance Tests - Archive of obsolete content
the runtests.py test harness works by parsing the abc stdout for lines like: 'metric time 566'. the testconfig.txt file defines groups of tests to run (e.g. sunspider, scimark, language). by default the time for each test is output. use the --memory flag to capture the maximum private bytes memory (high water mark) for a test. by default each test is run a single time. to run each test multiple times use the --iterations flag. ...
Running Tamarin performance tests - Archive of obsolete content
just type the following commands after making sure you've set the environment variables correctly. $ cd /test/performance $ ./runtests.py note on using an emulator: the emulator does seem to support hardware floating point but gives a buserror when running avmshell -darm_vfp. it's unreliable, losing its adb connection frequently. an emulator is ok ...
Tamarin - Archive of obsolete content
itecture, and file format supported by the avm2. see also the possible errata. tamarin build documentation how to get, build, and use tamarin. tamarin build system documentation documentation on how the tamarin build system works and how to modify. tamarin commit hook instructions for installing and using the mercurial hook for tamarin. tamarin
acceptance testing instructions on how to validate changes to the tamarin source code. tamarin pages at wiki.mozilla.org more documentation. mmgc overview an overview of the tamarin garbage collector. nanojit lir in nanojit, lir is the source language for compilation to machine code. tamarin strings documentation t...
Treehydra Manual - Archive of obsolete content
s used to filter states at conditional statements. for example, if the current abstract value of a variable x is nonzero, and the analysis goes inside an if statement with the condition x == 1, then in the new abstract value of x will be nonzero meet 1. esp uses a user-defined meet function supplied to the analysis constructor that should return the intersection of two abstract values. it is also
acceptable for meet to return a value that contains the intersection--this may cause the analysis to have more false positives but will not introduce false negatives. join. join is a relation on abstract values used to merge states at control flow merge points. for example, if esp reaches a point where two control flow paths merge, and on one side the abstract value of x is 1, and on the other side, the...
Using cross commit - Archive of obsolete content
ge. otherwise cross-commit will end up waiting forever for you to type a cvs checkin message in an editor that it never shows you! (although it works without specifying -m on the command line if you are using x-enabled emacs on linux.) also note that if you don't specify any branches to commit on, cross-commit will commit to the trunk and the mozilla_1_8_branch by default. details cross-commit
accepts the following options: all cvs options (those to the left of the specific cvs command) and cvs commit options (those to the right of a commit command), although the -r and -f cvs options need to be specified as --cvs-r and --cvs-f to avoid conflict with the similarly named (but different in meaning) cvs commit options. you can list the files/directories you want it to commit on the command li...
confirm - Archive of obsolete content
bject syntax int confirm( string atext ); int confirm( string atext, string adialogtitle, number abuttonflags, string abutton0title, string abutton1title, string abutton2title, string acheckmsg, object acheckstate ); parameters the second, extended confirm() method is supported starting with gecko 1.8. it
accepts any number of parameters up to 8. previous gecko versions only support the first, one-parameter method and will throw an error on occuring the extended form. see the notes at the end of this document for a safe way to implement a fallback. atext the string to be displayed in the confirmation dialog. this string is typically in the form of a prompt for the user (e.g., "are you sure...
dlgtype - Archive of obsolete content
« xul reference home dlgtype type: one of the values below the dialog type of the button, used only when the button is in a dialog box. you can use this feature to replace the standard dialog box buttons with custom buttons, yet the dialog event methods will still function. for example, if the dlgtype is set to
accept, the button will replace the dialog box's
accept button, which is usually labeled ok. using this attribute on a button that is not in a dialog box has no effect. the following values can be used as the dialog type:
accept the ok button, which will
accept the changes when pressed. cancel the cancel button which will cancel the operation. help a help button for displaying help about the dialog. disclosure a button to show more information. this might...
icon - Archive of obsolete content
« xul reference home icon mozilla 1.8 type: string this attribute should be used to set the usage for common buttons. some platforms display these buttons with a small icon indicating their usage. this should be used in place of the image attribute. possible values include:
accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. if you are using a button that matches one of these common usages, use the icon attribute to indicate this. see the appearance of the different icons on some available platforms. ...
validate - Archive of obsolete content
« xul reference home validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the images are stored remotely or you plan on swapping the image frequently. 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. ...
Introduction to XUL - Archive of obsolete content
<html:script type="application/javascript"> // dialog initialization code function initwindow() { var checkbox = document.getelementbyid("remember"); if (checkbox) checkbox.checked = true; } </html:script> javascript can be referenced as in html documents: as onclick handlers and the like. see individual widget documentation referenced at the index for a list of attributes
accepting javascript values. javascript is most safely kept in a separate file and included in the xul file <html:script language="javascript" src="our.js"/> or relegated to the contents of a cdata section, to prevent the xml parser from choking on javascript which may look like xml content (a < character, for instance.) <html:script type="application/javascript"> <![cdata[ function lesser(a,...
stopEditing - Archive of obsolete content
« xul reference home stopediting( should
accept ) return type: no return value stops editing the cell currently being edited. if the should
accept parameter is true, the cell's label is changed to the edited value (the tree view's nsitreeview.setcelltext() method is called to change the cell contents). otherwise the cell label is reverted to the value it had prior to editing. ...
Methods - Archive of obsolete content
« xul reference home
acceptdialog additemtoselection addpane addprogresslistener addsession addtab addtabsprogresslistener advance advanceselectedtab appendcustomtoolbar appendgroup appenditem appendnotification blur cancel canceldialog centerwindowonscreen checkadjacentelement clearresults clearselection click close collapsetoolbar contains decrease decreasepage docommand ensureelementisvisible ensureindexisvisible ensureselectedelementisvisible expandtoolbar extra1 extra2 focus getbrowseratindex getbrowserfordocument getbrowserfortab getbrowserindexfordocument getbutton getdefaultsession geteditor getelementsbyattribute getelementsbyattributens getformattedstring gethtmleditor getindexoffirstv...
Building Hierarchical Trees - Archive of obsolete content
ext time the row is opened. if you want to put rows inside the photo rows, you will either need to make each photo resource a container (for this rdf datasource, this will usually be an rdf seq), or use the containment attribute to specify additional properties that indicate containership. if a particular photo had a value for one of the properties listed in the containment attribute, it would be
accepted as a container, and the user could open the row. when the user opens the row, the template will be re-examined for results using the photo as the starting point instead of the top level ref value. here is an example for the streets datasource: <tree flex="1" datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood" flags="dont-build-content" xmlns:...
Result Generation - Archive of obsolete content
ntains a number of different pieces of necessary information, for the purposes of this discussion, we will only be interested in the list of possible results. the builder begins with a single possible result, called the seed. the builder processes each of a query's statements in sequence. to do this for a particular statement, the builder iterates over the possible results found so far and either
accepts each result or rejects each result. for the first statement, only the seed will be available as a possible result. at each step, new possible results may be added, or more information pertaining to an existing result may be added to the network. naturally, a rejected result will be removed. once all results have been examined, the builder moves on to the next statement in the query. once all sta...
Simple Query Syntax - Archive of obsolete content
tes pointing out of other resources. for that, you need to use the full syntax. the triples to check are specified using attributes on the rule element (thus, a rule element should be used). the namespace of the attribute and the attribute name combine to form the predicate you wish to filter by and the value of the attribute will be the value to filter by. any results that match the criteria are
accepted and any that do not match are rejected. you can use multiple attributes to filter by several criteria. in this case, all of the criteria must match for the result to be
accepted. for example, to filter for photos with a specific country: <hbox id="photoslist" datasources="template-guide-photos4.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:r="http://www.xulplanet.com/rdf/"...
Template Builder Interface - Archive of obsolete content
ext, 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 » ...
The Joy of XUL - Archive of obsolete content
s cross platform install facility, provides a standard way of packaging xul application components with an install script that mozilla can download and execute. xpinstall enables users to effortlessly install new xul applications over the internet or from corporate intranet servers. to install a new application the user need only click a hypertext link on a web page or in an email message and
accept the new package through a mozilla install dialog. todo: describe cool toolkit and xul runner features case study: a mozilla calendar application this mini case study describes how oeone corporation (now part of hipplay; this calendar application is no longer listed on their site) integrated its calendar application with the core mozilla product. the calendar application is comprised ...
Adding Style Sheets - Archive of obsolete content
e the look that is desired. for this, we will need to add a style sheet of our own. so far, we have been applying styles using the style attribute on elements. although this works, it is not really the best thing to do. it is much better to create a separate style sheet. the reason is so that different looks, or skins, can be applied easily. there may be certain cases where the style attribute is
acceptable. an example would be when a script changes the style, or where a difference in layout might change the meaning of the element. however you should avoid this as much as possible. for installed files, you'll have to create or modify a manifest file and install the skin. our find files dialog example let's modify the find files dialog so that its style comes from a separate style file. first,...
Input Controls - Archive of obsolete content
l has elements that are similar to the html form controls. looking for a guide to using input controls and forms on the web? see forms in html. text entry fields html has an input element which can be used for text entry controls. xul has a similar element, textbox, used for text entry fields. without any attributes, the textbox element creates a box in which the user can enter text. textboxes
accept many of the same attributes as html input controls. the following are some of them: id a unique identifier so that you can identify the textbox. class the style class of the textbox. value if you want the textbox to have default text, supply it with the value attribute. disabled set to true to have text entry disabled. textbox.type you can set this attribute to the special value ...
Simple Menu Bars - Archive of obsolete content
element. this is used to separate groups of menuitems. menubar element the menubar is a box containing menus. note that it has been placed inside a flexible toolbox. the menubar has no special attributes but it is a type of box. this means that you could create a vertical menubar by setting the orient attribute to vertical. menu element the menu element works much like the button element. it
accepts some of the same attributes plus some additional ones: id the unique identifier of the menu title button. label the text to appear on the menu, such as file or edit. disabled this boolean attribute determines whether the menu is disabled. although you can, there's rarely a need to disable an entire menu. this attribute can be set to either true or false. of course, the latter is th...
Skinning XUL Files by Hand - Archive of obsolete content
what is a skin? the skin of a xul file is its look or overall style. in xul, skins are created with cascading style sheets and images. to skin a xul file means to change the overall look of that file by changing its style information. in the very near future, it will be possible to skin xul files dynamically and completely -- by pressing a button, selecting a skin from a menu, or by
accepting a skin from over the web. when this day comes, skins defined in a global skin file will be applied to a whole application -- like the mozilla browser -- so that all the various windows and parts will look consistent. in the meantime, however, skinning a file requires some manual interaction. this article can help you get started understanding skins and creating skins for xul. it presumes you have at least...
XUL Changes for Firefox 1.5 - Archive of obsolete content
either to one of the buttons of the <dialog> binding (using their names); or to none - in which case no button is set to be the default. button: icon property the icon property on a button may be used to set stock icons on a button, used on some platforms. for instance <button icon="help"> will create a button with a help icon. this is used typically on gnome systems where possible values are:
accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. <menulist> items in a <menulist> support the description attribute to allow for extra descriptive text to appear beside an item's label. the menulist modification methods appenditem and insertitemat take an extra description argument wh...
XUL Questions and Answers - Archive of obsolete content
m specification, the properties will eventually be fixed to return the value with the correct type. using the "icon" attribute on a button from xulplanet.com reference: this attribute should be used to set the usage for common buttons. some platforms display these buttons with a small icon indicating their usage. this should be used in place of the image attribute. possible values include:
accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. if you are using a button that matches one of these common usages, use the icon attribute to indicate this. how to use dynamic objects in toolbar there may be a few ways to implement this: by building your menupopup from an rdf da...
The Implementation of the Application Object Model - Archive of obsolete content
at kind of relationship should exist between the two nodes. the resultant file, although still relatively easy to manipulate, is bloated needlessly with extra syntax that is not strictly necessary. rdf is not a markup language. rdf can be serialized as an xml file, but it isn't a parallel to html. it's something different. it makes more sense to describe a content tree structure according to the
accepted standards (that is accessible and manipulable via standard dom apis) using a real markup language, either an extension of html or an xml language like xul. forget xul! let's just extend html! still i say forget xul! let's just extend html and use it to represent the ui! that would also be an unwise decision for a variety of reasons. html is designed to handle documents and not to handle ap...
image - Archive of obsolete content
image loads. this event will not bubble up the element tree. src type: uri the uri of the content to appear in the element. validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the images are stored remotely or you plan on swapping the image frequently. 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 s...
menuitem - Archive of obsolete content
e radio group. only one menuitem in the same radio group can be checked at once. more information on adding checkmarks to menus in the xul tutorial validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the images are stored remotely or you plan on swapping the image frequently. 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. value type: string the string attribute allows you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your ow...
stringbundle - Archive of obsolete content
operty file is a list of property 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, coalescedu...
tree - Archive of obsolete content
cechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata startediting( row, column ) return type: no return value activates user editing of the given cell, which is specified by row index number and the nsitreecolumn in which it is located. the tree view's nsitreeview.getcelltext() method is called to obtain the cell contents. stopediting( should
accept ) return type: no return value stops editing the cell currently being edited. if the should
accept parameter is true, the cell's label is changed to the edited value (the tree view's nsitreeview.setcelltext() method is called to change the cell contents). otherwise the cell label is reverted to the value it had prior to editing. related elements treecols, treecol, treechildren, treeitem, ...
Gecko Compatibility Handbook - Archive of obsolete content
of the css 2 recommendation. the mode is picked based on the doctype declaration (or the lack thereof) at the beginning of an html document. invalid comments gecko also has three parsing modes: quirks, almost standards, and standards. quirks mode allows the use of invalid comments containing two dashes -- while standards and almost standards modes do not. <!---- this is an invalid html comment
accepted in quirks comment parsing ----> <!-- this is a valid html comment
accepted in stricts comment parsing --> for the exact rules on which doctypes invoke quirks vs. standards mode see mozilla's doctype sniffing article. plugins coding you'll find for that some plugins behave differently in gecko than in netscape navigator 4. visit the plugins page to learn about scripting gecko browsers, proper...
2006-07-17 - Archive of obsolete content
criteria are included in the linked post. firefox 1.5.0.5 planned release - 2006/07/26 discussions firefox survey feedback requested rachel werner (mozilla corp marketing intern) requested feedback on a proposed user survey. the survey questions and feedback are included in the thread. deadline for feedback has passed. dropping bugs from blocking1.8.1+ david baron suggested a list of bugs that could be dropped from the blocking list. ...
2006-09-29 - Archive of obsolete content
summary: mozilla.dev.tech.layout september 22-29, 2006 announcements no announcements for this week. discussions discussion on how the firefox 1.5.0.7 dom generates xhtml inline elements using wordpress. it was determined that the generated elements from wordpress do not follow the wc3 guidelines in appendix c of xhtml 1.0. although the w3 validation
accepted the generated xhtml as valid, a bug identified within the html working group ignored the invalid elements. details can be located at layout confusion refactoring the nshtmlreflowstate(computeblockboxdata, initconstraints) and nsimageframe::getdesiredsize which uses ns_inrinsicsize, into the following method: /** * compute the size that a frame will occupy. called while * constructing the nshtmlreflowstate to be used to r...
NPAPI plugin developer guide - Archive of obsolete content
a plug-in is windowless invalidating the drawing area forcing a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless plug-ins streams 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...
NPEvent - Archive of obsolete content
in all windows. null events: sent to all instances in all windows. in addition to these standard types, the browser provides three additional event types that can be passed in the what field of the eventrecord: getfocusevent: sent when the instance could become the focus of subsequent key events, when the user clicks the instance or presses the tab key to focus the instance. if your instance
accepts key events, return true, and key events will be sent to the instance until it receives a losefocusevent. if your plug-in ignores key events, return false, and the key events will be processed by the browser itself. losefocusevent: sent when the instance has lost the text focus, as a result of the user clicking elsewhere on the page or pressing the tab key to move the focus. no key events are s...
NPP_Write - Archive of obsolete content
int32 len, void* buf); parameters the function has the following parameters: instance pointer to the current plug-in instance. stream pointer to the current stream. offset offset in bytes of buf from the beginning of the data in the stream. can be used to check stream progress or by range requests from npn_requestread. len length in bytes of buf; number of bytes
accepted. buf buffer of data, delivered by the stream, that contains len bytes of data offset bytes from the start of the stream. the buffer is allocated by the browser and is deleted after returning from the function, so the plug-in should make a copy of the data it needs to keep. returns the plug-in should return the number of bytes written (consumed by the instance). if the return value is smaller...
NPP_WriteReady - Archive of obsolete content
g-in side plug-in api summary determines maximum number of bytes that the plug-in can consume. syntax #include <npapi.h> int32 npp_writeready(npp instance, npstream* stream); parameters the function has the following parameters: instance pointer to the current plug-in instance. stream pointer to the current stream. returns returns the maximum number of bytes that an instance is prepared to
accept from the stream. description the browser calls npp_writeready before each call to npp_write to determine whether a plug-in can receive data and how many bytes it can receive. this function allows the browser to send only as much data to the instance as it can handle at one time, making resource use more efficient for both the browser and plug-in. the npp_write function may pass a larger buffer, ...
0.90 - Archive of obsolete content
ization stood for rich site summary and not really simple syndication. (see rss - what is in a name for more info on rss's naming history.) note: rss 0.90 has been deprecated. producers of rssshould not be creating rss 0.90 feeds, andshould instead use a newer non-deprecated rss format. (see the rss versions list for a list of non-deprecated rss formats.) consumers of rssshould still be able to
accept rss 0.90 feeds though. examples rss 0.90 looked something like this: <?xml version="1.0"?> <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 organizati...
Security Controls - Archive of obsolete content
hat are primarily implemented and executed by the system through the system's hardware, software, or firmware. all three types of controls are necessary for robust security. for example, a security policy is a management control, but its security requirements are implemented by people (operational controls) and systems (technical controls). think of phishing attacks. an organization may have an
acceptable use policy that specifies the conduct of users, including not visiting malicious websites. security controls to help thwart phishing, besides the management control of the
acceptable use policy itself, include operational controls, such as training users not to fall for phishing scams, and technical controls that monitor emails and web site usage for signs of phishing activity. a common prob...
SSL and TLS - Archive of obsolete content
both client and server authentication occur over ssl/tls. ssl/tls uses a combination of public key and symmetric-key encryption. symmetric-key encryption is much faster than public-key encryption, but public-key encryption provides better authentication techniques. an ssl/tls session always begins with an exchange of messages called the ssl handshake, initial communication between the server and client. ...
Browser Detection and Cross Browser Support - Archive of obsolete content
. the basic differences between navigator 4 and gecko can be easily summarized by: gecko is standards conformant. gecko supports many more standards than navigator 4 and implements them correctly unlike navigator 4. gecko does not support layers. navigator 4 introduced the layer api which it used to manipulate content and which formed the basis of dhtml in navigator 4. layers however were not
accepted by the w3c either in html or in the dom. since gecko's mission was to be the most standards conformant browser possible, layers were not supported. this lack of backwards compatibility has been the cause of many problems for web authors, but can easily be overcome through proper authoring and browser detection strategies. as the use of navigator 4 decreases and more authors use the standards in...
-moz-border-bottom-colors - Archive of obsolete content
tside in. this eliminates the need for nested boxes. if the border is wider than the number of specified colors, the remaining part of the border is the innermost color specified. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. syntax values
accepts a white-space separated list of color values. <color> specifies the color of a line of pixels of the bottom border. transparent is valid. see <color> values for possible units. none default, no colors are drawn or border-color is used, if specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprec...
-moz-border-left-colors - Archive of obsolete content
tside in. this eliminates the need for nested boxes. if the border is wider than the number of specified colors, the remaining part of the border is the innermost color specified. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. syntax values
accepts a white-space separated list of color values. <color> specifies the color of a line of pixels of the left border. transparent is valid. see <color> values for possible units. none default, no colors are drawn or border-color is used, if specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecat...
-moz-border-right-colors - Archive of obsolete content
tside in. this eliminates the need for nested boxes. if the border is wider than the number of specified colors, the remaining part of the border is the innermost color specified. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. syntax values
accepts a white-space separated list of color values. <color> specifies the color of a line of pixels of the right border. transparent is valid. see <color> values for possible units. none default, no colors are drawn or border-color is used, if specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <depreca...
-moz-border-top-colors - Archive of obsolete content
tside in. this eliminates the need for nested boxes. if the border is wider than the number of specified colors, the remaining part of the border is the innermost color specified. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. syntax values
accepts a white-space separated list of color values. <color> specifies the color of a line of pixels of the top border. transparent is valid. see <color> values for possible units. none default, no colors are drawn or border-color is used, if specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecate...
-ms-flow-from - Archive of obsolete content
initial valuenoneapplies tonon-replaced elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none default. no container has been specified. ...
-moz-windows-compositor - Archive of obsolete content
note: since firefox 58, this media feature is no longer available to web content — it is only available internally (e.g. to xul / chrome code). see bug 1396066 for more details. syntax <integer> if the user is using windows with the dwm compositor, this is 1. otherwise it's 0. media: media/visual
accepts min/max prefixes: no ...
:-moz-system-metric() - Archive of obsolete content
this page was auto-generated because a user created a sub-page to this page. note: since firefox 58, this pseudo-class is no longer available to web content — it is only available internally (e.g. to xul / chrome code). see bug 1396066 for more details. ...
CSS - Archive of obsolete content
oomingthe -ms-content-zooming css property is a microsoft extension that specifies whether zooming is enabled.-ms-filterthe -ms-filter css property is a microsoft extension that sets or retrieves the filter or collection of filters applied to an object.-ms-flow-fromthe -ms-flow-from css property is a microsoft extension that gets or sets a value identifying a region container in the document that
accepts the content flow from the data source.-ms-flow-intothe -ms-flow-into css property is a microsoft extension that gets or sets a value identifying an iframe container in the document that serves as the region's data source.-ms-high-contrast-adjustthe -ms-high-contrast-adjust css property is a microsoft extension that gets or sets a value indicating whether to override any css properties that would...
Array.observe() - Archive of obsolete content
however, this api has been deprecated and removed from browsers. you can use the more general proxy object instead. syntax array.observe(arr, callback) parameters arr the array to be observed. ...
Date.getVarDate() - Archive of obsolete content
warning: this method is supported in internet explorer only. the getvardate method returns a vt_date value from a date object. syntax dateobj.getvardate() parameters the required dateobj reference is a date object. return value returns a vt_date value. remarks the getvardate() method is used when javascript code interacts with com objects, activex objects, or other objects that
accept and return date values in vt_date format. these include objects in visual basic and visual basic scripting edition (vbscript). the actual format of the returned value depends on regional settings. requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, and internet...
@cc_on - Archive of obsolete content
ms because the capabilities of the compilers can be determined by using other methods. when you write a script for a web page, always put conditional compilation code in comments. this enables hosts that do not support conditional compilation to ignore it. it is strongly recommended that you use the @cc_on statement in a comment, so that browsers that do not support conditional compilation will
accept your script as valid syntax: an @if or @set statement outside of a comment also activates conditional compilation. example the following example illustrates the use of the @cc_on statement. /*@cc_on @*/ /*@ document.write("javascript version: " + @_jscript_version + "."); document.write("<br />"); @if (@_win32) document.write("running on the 32-bit version of windows."); ...
Archived JavaScript Reference - Archive of obsolete content
to quickly assemble a new array based on an existing one. however, it has been removed from the standard and the firefox implementation. do not use it!array.observe()the array.observe() method was used for asynchronously observing changes to arrays, similar to object.observe() for objects. it provided a stream of changes in order of occurrence. it's equivalent to object.observe() invoked with the
accept type list ["add", "update", "delete", "splice"]. however, this api has been deprecated and removed from browsers. you can use the more general proxy object instead.array.unobserve()the array.unobserve() method was used to remove observers set by array.observe(), but has been deprecated and removed from browsers. you can use the more general proxy object instead.arraybuffer.transfer()the static ar...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
rks like a charm alert( notexposed() ); //produces an object not found error since it server-side only </script> understanding the concept of operating context in jaxer is central to moving forward with the example application which is what we'll examine next. jaxer – example application the example application consists of a simple form used to
accept comments from public users and was built to cover some of the most useful jaxer features. the example application is running under jaxer build 0.9.7.2472 and also incorporates the extjs version 2.1 javascript framework for user interface controls. for more information how to obtain and install these products, refer to the resources section. single page applications th...
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
gers and engineers develop a fundamental understanding of the importance of requiring adherence to these processes. when projects are proposed, they are evaluated to ensure compatibility with the overall business strategy. product marketing must then analyze the marketability of the application/product, and then conduct in-depth technical evaluations and market research studies. if the project is
accepted, the compiled information, analysis and research is merged into a request for proposal (rfp). this process is not unique: most organizations have basic project management processes for product or service. even within organizations, their processes are fine-tuned to work within the existing culture. when this happens, a development standard is created and is expected to be followed. it is easy...
Fixing Incorrectly Sized List Item Markers - Archive of obsolete content
-moz-list-number {font-size: 1em;} this rule tells gecko-based browsers to use the computed value of font-size for the marker's parent, which is the list item itself. thus the font sizes of the marker and the content will be the same. since this rule is not valid css, it will prevent the validation of any stylesheet that contains it. one solution is to move the rule into its own stylesheet, and
accept that the stylesheet in question will never validate. this might also be a place to put any explorer-specific css-like rules (such as scrollbar styling rules), which also will not validate. authors who are not concerned with making sure the rule applies across all namespaces can use a slightly more simplified rule: *:-moz-list-bullet, *:-moz-list-number {font-size: 1em;} recommendations if i...
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
enclose the rest of the document. this generally means that the rest of the document will take hover styles. consider the effects of the following rule: a:hover {color: red;} in a document with an unclosed named anchor, any text that follows the anchor's open tag will be colored red (unless another css rule intervenes). this brings up the second common problem, which is that named anchors can
accept hover styles. although authors may intend the selector a:hover to apply only to hyperlinks, it will also apply to named anchors, since the selector merely states that any a element which is in a hover state will be styled. in order to avoid this problem, authors should use the combined pseudo-class syntax described by css2: a:link:hover {color: red;} a:visited:hover {color: maroon;} note that, ...
RDF in Mozilla FAQ - Archive of obsolete content
fault on windows, and on linux when the configure --enable-tests is specified. rdfcat url takes as a parameter a url from which to read an rdf/xml file, and will "cat" the file back to the console. you can use it to verify that the rdf/xml that you've written is being properly parsed by mozilla. rdfpoll url [interval ] takes as a parameter a url from which to read an rdf/xml file. it also
accepts an optional poll interval, where it will re-load the url. it outputs the assertions that are generated from each load. note that a polling reload generates a set of differences between the current and previous contents of the rdf/xml file. this is useful for debugging generated rdf/xml that may change over time. both these programs are slow to load and run (but they will run, eventually). they...
The Business Benefits of Web Standards - Archive of obsolete content
sciplines; need not become involved in the actual process of publishing that content at all. and the person applying the markup need not necessarily, know (or care) how it is going to be styled. that has been the real impact of the zen garden, in helping to demonstrate the stunning results which are possible without altering the markup, and indeed keeping the amount of presentational markup to an
acceptable minimum. the content - markup - style; model also lends itself very neatly to linear methods of production. no web development activity need or indeed - should take place until the content has been produced. conversely once the content is to hand the development/publishing process should be lighteningly fast. which is as it should be. if we have produced content we want to publish it now. no...
Common causes of memory leaks in extensions - Extensions
please see the corresponding documentation of these services on how to properly unregister/remove your observers and components during unload. forgetting to unload javascript modules in restartless add-ons another common cause of leaks is forgetting to unload javascript code modules in bootstrapped add-ons. when ...
Game distribution - Game development
comes to the mobile market, there's the apple app store for ios, google play for android and all the rest of the competition. native stores are already filled with established devs selling great games, so you have to be talented and lucky to get noticed. the ios app store is quite hard to get into as there are strict requirements games have to meet, and you'll have to wait a week or two to get
accepted. plus, it's the most prominent mobile store, with hundreds of thousands of apps, so it's extremely hard to stand out from the crowd. google play's requirements are less strict, so the store is polluted with low quality games. it's still quite hard to be noticed there as the number of apps submitted daily is huge. it's harder to earn money here too — most of the paid games from ios are publis...
Game promotion - Game development
orial when you're showing how to do something you've implemented already. that way everyone benefits — people learn new skills, your game gets promoted, and if you're lucky you can even get paid for writing a tutorial if it's good enough. there are portals like tuts+ game development which will be more than happy if you write for them - they pay for the content, but not all topic ideas will be
accepted. when writing a tutorial remember to focus on delivering something valuable to the reader. they want to learn something - offer your expertise and use your game as a case study. focus on one aspect and try to explain it throughout and in detail. also remember to follow up discussion in comments if people have any questions. if portals you contact are not interested in your content because you ...
Building up a basic demo with PlayCanvas editor - Game development
later! to change its color we'll use the diffuse option in the entity inspector. click diffuse, then select the colored box next to the color label — it will open a color wheel. from here you can click your desired color or enter it in the bottom text field as a hex value. we've chosen a blue color with a hex value of 0095dd — enter this code in the text field and press return for it to be
accepted. note: yes, you read that right — you need to enter the hex value without the hash/pound symbol. now we can apply the colored material to the shape by clicking and dragging its icon from the bottom part of the screen (the little dot on the left hand side of the material's name — it can be a bit fiddly to select; just persevere) onto the box on the scene. so, at this point we've cre...
Implementing game control mechanisms - Game development
ng truly multiplatform; all of the following articles focus on the apis provided for interfacing with different control mechanisms: mobile touch controls — the first article will kick off with touch, as the mobile first approach is very popular. desktop mouse and keyboard controls — when playing on a desktop/laptop computer, providing keyboard and mouse controls is essential to provide an
acceptable level of accessibility for the game. desktop gamepad controls — the gamepad api rather usefully allows gamepads to be used for controlling web apps on desktop/laptop, for that console feel. unconventional controls — the final article showcases some unconventional control mechanisms, from the experimental to the slightly crazy, which you might not believe could be used to play the game. ...
Implementing controls using the Gamepad API - Game development
nscache array and takes fresh ones from the gamepadapi.controller object. then it loops through buttons and axes to get their actual states and values. detecting button presses the buttonpressed() method is also placed in the main game loop to listen for button presses. it takes two parameters — the button we want to listen to and the (optional) way to tell the game that holding the button is
accepted. without it you'd have to release the button and press it again to have the desired effect. buttonpressed: function(button, hold) { var newpress = false; // loop through pressed buttons for(var i=0,s=gamepadapi.buttonsstatus.length; i<s; i++) { // if we found the button we're looking for... if(gamepadapi.buttonsstatus[i] == button) { // set the boolean variable to true ...
Cookie - MDN Web Docs Glossary: Definitions of Web-related terms
a cookie is a small piece of information left on a visitor's computer by a website, via a web browser. cookies are used to personalize a user’s web experience with a website. it may contain the user’s preferences or inputs when accessing that website. a user can customize their web browser to
accept, reject, or delete cookies. cookies can be set and modified at the server level using the set-cookie http header, or with javascript using document.cookie. learn more general knowledge http cookie on wikipedia ...
Graceful degradation - MDN Web Docs Glossary: Definitions of Web-related terms
graceful degradation is a design philosophy that centers around trying to build a modern web site/application that will work in the newest browsers, but falls back to an experience that while not as good still delivers essential content and functionality in older browsers. polyfills can be used to build in missing features with javascript, but
acceptable alternatives to features like styling and layout should be provided where possible, for example by using the css cascade, or html fallback behaviour. some good examples can be found in handling common html and css problems. it is a useful technique that allows web developers to focus on developing the best possible websites, given that those websites are accessed by multiple unknown user-agents. progressive enhancement is related but d...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
tive csp, http, policy, reporting, security, violation csp reporting directives are used in a content-security-policy header and control the reporting process of csp violations. 372 request header glossary, webmechanics a request header is an http header that can be used in an http request, and that doesn't relate to the content of the message. request headers, like
accept,
accept-*, or if-* allow to perform conditional requests; others like cookie, user-agent, or referer precise the context so that the server can tailor the answer. 373 resource timing glossary, timings, web performance diagnosing performance issues requires performance data at the granularity of the resource. the resource timing api is a javascript api that is able to capture ...
Progressive Enhancement - MDN Web Docs Glossary: Definitions of Web-related terms
and functionality to as many users as possible, while delivering the best possible experience only to users of the most modern browsers that can run all the required code. feature detection is generally used to determine whether browsers can handle more modern functionality, while polyfills are often used to add missing features with javascript. special notice should be taken of accessibility.
acceptable alternatives should be provided where possible. progressive enhancement is a useful technique that allows web developers to focus on developing the best possible websites while making those websites work on multiple unknown user agents. graceful degradation is related but is not the same thing and is often seen as going in the opposite direction to progressive enhancement. in reality both ap...
Response header - MDN Web Docs Glossary: Definitions of Web-related terms
onnection: keep-alive content-encoding: gzip content-type: text/html; charset=utf-8 date: mon, 18 jul 2016 16:06:00 gmt etag: "c561c68d0ba92bbeb8b0f612a9199f722e3a621a" keep-alive: timeout=5, max=997 last-modified: mon, 18 jul 2016 02:36:04 gmt server: apache set-cookie: mykey=myvalue; expires=mon, 17-jul-2017 16:06:00 gmt; max-age=31449600; path=/; secure transfer-encoding: chunked vary: cookie,
accept-encoding x-backend-server: developer2.webapp.scl3.mozilla.com x-cache-info: not cacheable; meta data too large x-kuma-revision: 1085259 x-frame-options: deny ...
TOFU - MDN Web Docs Glossary: Definitions of Web-related terms
relationship with an unknown server. to do that, clients will look for identifiers (for example public keys) stored locally. if an identifier is found, the client can establish the connection. if no identifier is found, the client can prompt the user to determine if the client should trust the identifier. tofu is used in the ssh protocol, in http public key pinning (hpkp) where the browsers will
accept the first public key returned by the server, and in strict-transport-security (hsts) where a browser will obey the redirection rule. learn more http public key pinning (hpkp) public-key-pins wikipedia: tofu ...
XSLT - MDN Web Docs Glossary: Definitions of Web-related terms
extensible stylesheet language transformations (xslt) is a declarative language used to convert xml documents into other xml documents, html, pdf, plain text, and so on. xslt has its own processor that
accepts xml input, or any format convertible to an xquery and xpath data model. the xslt processor produces a new document based on the xml document and an xslt stylesheet, making no changes to the original files in the process. learn more technical reference xslt on wikipedia xslt documentation on mdn ...
Character set - MDN Web Docs Glossary: Definitions of Web-related terms
is an encoding system to let computers know how to recognize character, including letters, numbers, punctuation marks, and whitespace. in earlier times, countries developed their own character sets due to their different languages used, such as kanji jis codes (e.g. shift-jis, euc-jp, etc.) for japanese, big5 for traditional chinese, and koi8-r for russian. however, unicode gradually became most
acceptable character set for its universal language support. if a character set is used incorrectly (for example, unicode for an acticle encoded in big5), you may see nothing but broken characters, which are called mojibake. ...
Test your skills: CSS and JavaScript accessibility - Learn web development
hed example: download the starting point for this task to work in your own editor or in an online editor. css accessibility 2 in this next task you are presented with a simple bit of content — just headings and paragraphs. there are accessibility issues with the colors and sizing of the text; we'd like you to: 1. explain what the problems are, and what the guidelines are that state the
acceptable values for color and sizing. 2. select new values for the color and font-size that fix the problem. 3. update the css with these new values to fix the problem. 4. test the code to make sure the problem is now fixed. explain what tools or methods you used to select the new values and test the code. try updating the live code below to recreate the finished example: download the starting...
Accessible multimedia - Learn web development
h quality. if you don't want to pay for it, you are likely to get it done at a lower quality, and/or slowly. it is not ok to publish an audio resource but promise to publish the transcript later on — such promises often aren't kept, which will erode trust between you and your users. if the audio you are presenting is something like a face to face meeting or live spoken performance, it would be
acceptable to take notes during the performance, publish them in full along with the audio, then seek help in cleaning up the notes afterwards. transcript examples if you use an automated service, then you'll probably have to use the user interface that the tool provides. for example, take a look at our wait, aria roles have categories? video and choose the three dot menu (. . .) > show transcript. yo...
Backgrounds and borders - Learn web development
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 background-color extends underneath the content and padding box of the element. in the example below, we have used various color values to add a background color to the box, a heading, and a <span> element. play around with these, using any available <color> value. background images the background-image property enables the display of an image in the background of an e...
Cascade and inheritance - Learn web development
ers do not inherit. if a border were to be inherited by the children of our list, every single list and list item would gain a border — probably not an effect we would ever want! which properties are inherited by default and which aren't is largely down to common sense. controlling inheritance css provides four special universal property values for controlling inheritance. every css property
accepts these values. inherit sets the property value applied to a selected element to be the same as that of its parent element. effectively, this "turns on inheritance". initial sets the property value applied to a selected element to the initial value of that property. unset resets the property to its natural value, which means that if the property is naturally inherited it acts like inherit,...
Flexbox - Learn web development
sions of android/ios, etc. however you should be aware that there are still older browsers in use that don't support flexbox (or do, but support a really old, out-of-date version of it.) while you are just learning and experimenting, this doesn't matter too much; however if you are considering using flexbox in a real website you need to do testing and make sure that your user experience is still
acceptable in as many browsers as possible. flexbox is a bit trickier than some css features. for example, if a browser is missing a css drop shadow, then the site will likely still be usable. not supporting flexbox features however will probably break a layout completely, making it unusable. we discuss strategies for overcoming cross browser support issues in our cross browser testing module. test y...
Floats - Learn web development
if } .box { float: left; margin: 15px; width: 150px; height: 150px; border-radius: 5px; background-color: rgb(207,232,220); padding: 1em; } .special { background-color: rgb(79,185,227); padding: 10px; color: #fff; } .cleared { clear: left; } you should see that the following paragraph clears the floated element and no longer comes up alongside it. the clear property
accepts the following values: left: clear items floated to the left. right: clear items floated to the right. both: clear any floated items, left or right. clearing boxes wrapped around a float you now know how to clear something following a floated element, but let's see what happens if you have a tall float and a short paragraph, with a box wrapped around both elements. change your document so...
Multiple-column layout - Learn web development
olumn. you have two opportunities to change the way that columns display: changing the size of the gap between columns using the column-gap. adding a rule between columns with column-rule. using your example above, change the size of the gap by adding a column-gap property: .container { column-width: 200px; column-gap: 20px; } you can play around with different values — the property
accepts any length unit. now add a rule between the columns, with column-rule. in a similar way to the border property that you encountered in previous lessons, column-rule is a shorthand for column-rule-color, column-rule-style, and column-rule-width, and
accepts the same values as border. .container { column-count: 3; column-gap: 20px; column-rule: 4px dotted rgb(79, 185, 227); } try adding ru...
Positioning - Learn web development
higher values will go above lower values, and it is up to you what values you use. using 2 and 3 would give the same effect as 300 and 40000. note: you can see the example at this point live at 5_z-index.html (see source code). fixed positioning let's now look at f...
What is a web server? - Learn web development
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 correct (hardware) web server, the (software) http server
accepts the request, finds the requested document, and sends it back to the browser, also through http. (if the server doesn't find the requested document, it returns a 404 response instead.) to publish a website, you need either a static or a dynamic web server. a static web server, or stack, consists of a computer (hardware) with an http server (software). we call it "static" because the server se...
Advanced form styling - Learn web development
page — the output line that is part of the control will inherit the parent font if you tell the input to do so, and you can style the custom list of file names and sizes in any way you want; we created it after all. the only problem with file pickers is that the button provided that you press to open the file picker is completely unstyleable — it can't be sized or colored, and it won't even
accept a different font. one way around this is to take advantage of the fact that if you have a label associated with a form control, clicking the label will activate the control. so you could hide the actual from input using something like this: input[type="file"] { height: 0; padding: 0; opacity: 0; } and then style the label to act like a button, which when pressed will open the file picker...
Client-side form validation - Learn web development
regular expressions are case-sensitive, but we've made it support capitalized as well as lower-case versions using an extra "aa" pattern nested inside square brackets. at this point, try changing the value inside the pattern attribute to equal some of the examples you saw earlier, and look at how that affects th...
How to build custom form controls - Learn web development
html so that we can better describe roles, states and properties as though the element we've just devised was the native element it tries to pass for. using these attributes can be done by editing the html markup. we also update the aria attributes via javascript as the user updates their selected value. the role attribute the key attribute used by aria is the role attribute. the role attribute
accepts a value that defines what an element is used for. each role defines its own requirements and behaviors. in our example, we will use the listbox role. it's a "composite role", which means elements with that role expect to have children, each with a specific role (in this case, at least one child with the option role). it's also worth noting that aria defines roles that are applied by default to ...
Other form controls - Learn web development
following screenshots show default, focused, and disabled <textarea> elements in firefox 71 and safari 13 on macos, and edge 18, yandex 14, firefox 71 and chrome 79 on windows 10. note: you can find a slightly more interesting example of text area usage in the example we put together in the first article of the series (see the source code also). controlling multi-line rendering <textarea>
accepts three attributes to control its rendering across several lines: cols specifies the visible width (columns) of the text control, measured in average character widths. this is effectively the starting width, as it can be changed by resizing the <textarea>, and overriden using css. the default value if none is specified is 20. rows specifies the number of visible text rows for the control. th...
Sending form data - Learn web development
won't. this can be very important for two reasons: if you need to send a password (or any other sensitive piece of data), never use the get method or you risk displaying it in the url bar, which would be very insecure. if you need to send a large amount of data, the post method is preferred because some browsers limit the sizes of urls. in addition, many servers limit the length of urls they
accept. on the server side: retrieving the data whichever http method you choose, the server receives a string that will be parsed in order to get the data as a list of key/value pairs. the way you access this list depends on the development platform you use and on any specific frameworks you may be using with it. example: raw php php offers some global objects to access the data. assuming you've u...
Test your skills: Basic controls - Learn web development
d a couple more hotdog choices of your own. 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. basic controls 3 the final task in this set requires you to create a file picker. create a basic file picker. allow the user to pick multiple files at once. allow the file picker to
accept jpg and png images only. 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. assessment or further help you can practice these examples in the interactive editors above. if you would like your work assessed, or are stuck and want to ask for help: put your work into an online sh...
Test your skills: Form validation - Learn web development
all of the user names in our application consist of a single letter, followed by a dot, followed by three or more letters or numbers. all letters should be lowercase. all of the email addresses for our users consist of one or more letters (lower or upper case) or numbers, followed by "@bigcorp.eu". remove the length validation from the phone number field if it is present, and set it so that it
accepts 10 digits — either 10 digits in a row, or a pattern of three digits, three digits, then four digits, separated by either spaces, dashes, or dots. note: regular expressions are really challenging if you are new to them, but don't despair — have a go and see where you get to; there is no shame in asking for some help. you can find everything you need to answer these questions at our regular...
Add a hitmap on top of an image - Learn web development
oughly consider their performance and accessibility ramifications. text links (perhaps styled with css) are preferable to image maps for several reasons: text links are lightweight, maintainable, often more seo-friendly, and support accessibility needs (e.g., screen readers, text-only browsers, translation services). how to insert an image map, properly step 1: the image not just any image is
acceptable. the image must make it clear what happens when people follow image links. alt text is mandatory, of course, but many people never see it. the image must clearly indicate where hotspots begin and end. hotspots must be large enough to tap comfortably, at any viewport size. how large is large enough? 72 × 72 css pixels is a good minimum, with additional generous gaps between touch targets...
Define terms with HTML - Learn web development
that you can operate on all abbreviations uniformly. just as with any new keyword, you should define your abbreviations the first time they occur. <p> <dfn><abbr>html</abbr> (hypertext markup language)</dfn> is a description language used to structure documents on the web. </p> the html spec does indeed set aside the title attribute for expanding the abbreviation. however, this is not an
acceptable alternative for providing an inline expansion. the contents of title are completely hidden from your users, unless they're using a mouse and they happen to hover over the abbreviation. the spec duly acknowledges this as well. improve accessibility <dfn> marks the keyword defined, and indicates that the current paragraph defines the keyword. in other words, there's an implicit relationship ...
HTML table basics - Learn web development
hippopotamus horse mare stallion crocodile chicken hen rooster we need a way to get "animals", "hippopotamus", and "crocodile" to span across two columns, and "horse" and "chicken" to span downwards over two rows. fortunately, table headers and cells have the colspan and rowspan attributes, which allow us to do just those things. both
accept a unitless number value, which equals the number of rows or columns you want spanned. for example, colspan="2" makes a cell span two columns. let's use colspan and rowspan to improve this table. first, make a local copy of our animals-table.html and minimal-table.css files in a new directory on your local machine. the html contains the same animals example as you saw above. next, use colspan...
Graceful asynchronous programming with Promises - Learn web development
ble options), it can block until not only all of those decisions are made, but also the camera and microphone have been engaged. also, the user may not respond immediately to these permission requests. this can potentially take a long time. since the call to getusermedia() is made from the browser's main thread, the entire browser is blocked until getusermedia() returns! obviously, that's not an
acceptable option; without promises, everything in the browser becomes unusable until the user decides what to do about the camera and microphone. so instead of waiting for the user, getting the chosen devices enabled, and directly returning the mediastream for the stream created from the selected sources, getusermedia() returns a promise which is resolved with the mediastream once it's available. the ...
Making decisions in your code — conditionals - Learn web development
choices! in this example, you are going to take the ternary operator example we saw earlier and convert the ternary operator into a switch statement to allow us to apply more choices to the simple website. look at the <select> — this time you'll see that it has not two theme options, but five. you need to add a switch statement just underneath the // add switch statement comment: it should
accept the choice variable as its input expression. for each case, the choice should equal one of the possible values that can be selected, that is, white, black, purple, yellow, or psychedelic. note that the values are case sensitive, and should equal the <option> element value values rather than the visual labels. for each case, the update() function should be run, and be passed two color values, th...
Introduction to web APIs - Learn web development
oner or later are: the twitter api, which allows you to do things like displaying your latest tweets on your website. map apis like mapquest and the google maps api allows you to do all sorts of things with maps on your web pages. the facebook suite of apis enables you to use various parts of the facebook ecosystem to benefit your app, for example by providing app login using facebook login,
accepting in-app payments, rolling out targetted ad campaigns, etc. the telegram apis allows you to embed content from telegram channels on your website, in addition to providing support for bots. the youtube api, which allows you to embed youtube videos on your site, search youtube, build playlists, and more. the pinterest api provides tools to manage pinterest boards and pins to include them in you...
Third-party APIs - Learn web development
mapquest for a couple of reasons: it is much easier to get started with. for google apis in general, you need to create a google account and log into the google cloud platform console to create api keys, etc., and the process is fairly complex. for the google maps api in particular, you need to provide a credit card for billing purposes (although basic usage is free), which we didn't think was
acceptable for a basic tutorial. we wanted to show that there are other alternatives 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 l...
JavaScript object basics - Learn web development
what is "this"? you may have noticed something slightly strange in our methods. look at this one for example: greeting: function() { alert('hi! i\'m ' + this.name.first + '.'); } you are probably wondering what "this" is. the this keyword refers to the current object the code is being written inside — so in this case this is ...
Inheritance in JavaScript - Learn web development
constructor we have to use the super() operator, like so: class teacher extends person { constructor(subject, grade) { super(); // now 'this' is initialized by calling the parent constructor. this.subject = subject; this.grade = grade; } } there is no point having a sub-class if it doesn't inherit properties from the parent class. it is good then, that the super() operator also
accepts arguments for the parent constructor. looking back to our person constructor, we can see it has the following block of code in its constructor method: constructor(first, last, age, gender, interests) { this.name = { first, last }; this.age = age; this.gender = gender; this.interests = interests; } since the super() operator is actually the parent class constructor, ...
Working with JSON - Learn web development
ren't so lucky — sometimes we receive a raw json string, and we need to convert it to an object ourselves. and when we want to send a javascript object across the network, we need to convert it to json (a string) before sending. luckily, these two problems are so common in web development that a built-in json object is available in browsers, which contains the following two methods: parse():
accepts a json string as a parameter, and returns the corresponding javascript object. stringify():
accepts an object as a parameter, and returns 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 j...
Website security - Learn web development
iscussed earlier, this gives the attacker all the information they need to enter the site as the target user, potentially making purchases as the user or sharing their contact information. a persistent xss vulnerability occurs when the malicious script is stored on the website and then later redisplayed unmodified for other users to execute unwittingly. for example, a discussion board that
accepts comments that contain unmodified html could store a malicious script from an attacker. when the comments are displayed, the script is executed and can send to the attacker the information required to access the user's account. this sort of attack is extremely popular and powerful, because the attacker might not even have any direct engagement with the victims. while the data from post or get...
Framework main features - Learn web development
in order to render. suppose you're building a website for an online magazine, and you need to be sure that each contributing writer gets credit for their work. you might create an authorcredit component to go with each article. this component needs to display a portrait of the author and a short byline about them. in order to know what image to render, and what byline to print, authorcredit needs
accept some props. a react representation of this authorcredit component might look something like this: function authorcredit(props) { return ( <figure> <img src={props.src} alt={props.alt} /> <figcaption>{props.byline}</figcaption> </figure> ); } {props.src}, {props.alt}, and {props.byline} represent where our props will be inserted into the component. to render this compone...
Getting started with React - Learn web development
just like any other function parameter, you can put props in a console.log() to print it to your browser's console. go ahead and do that before the return statement, like so: function app(props) { console.log(props); return ( // return statement ); } save your file and check your browser's javascript console. you should see somethin...
TypeScript support in Svelte - Learn web development
e stack is empty!') return this.elements.pop() } } we define a generic type t and then use it like we would normally use a specific type. now elements is an array of type t, and push() and pop() both receive and return a variable of type t. this is how we would use our generic stack: const numberstack = new stack<number>() numberstack.push(1) now typescript knows that our stack can only
accept numbers, and will issue an error if we try to push anything else: typescript can also infer generic types by its usage. generics also support default values and constraints. generics is a powerful feature that allows our code to abstract away from the specific types being used, making it more reusable and generic without giving up on type-safety. to learn more about it check out the typescrip...
Deployment and next steps - Learn web development
opensas/mdn-svelte-tutorial (created .vercel) inspect: https://vercel.com/opensas/mdn-svelte-tutorial/[...] [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 s...
Dynamic behavior in Svelte: working with variables and props - Learn web development
perty or prop, which means it becomes accessible to consumers of the component. you can also specify a default initial value for a prop. this will be used if the component's consumer doesn't specify the prop on the component — or if its initial value is undefined — when instantiating the component. so with export let todos = [], we are telling svelte that our todos.svelte component will
accept a todos attribute, which when omitted will be initialized to an empty array. have a look at the app, and you'll see the "nothing to do here!" message. this is because we are currently not passing any value into it from app.svelte, so it's using the default value. now let's move our todos to app.svelte and pass them to the todos.svelte component as a prop. update src/app.svelte as foll...
Focus management with Vue refs - Learn web development
is where the virtual dom comes into play. because vue is trying to optimize and batch changes, it won't immediately update the dom when we set isediting to false. so when we call focusonedit(), the "edit" button has not been rendered yet. instead, we need to wait until after vue undergoes the next dom update cycle. to do that, vue components have a special method called $nexttick(). this method
accepts a callback function, which then executes after the dom updates. since the focusoneditbutton() method needs to be invoked after the dom has updated, we can wrap the existing function body inside a $nexttick() call. focusoneditbutton() { this.$nexttick(() => { const editbuttonref = this.$refs.editbutton; editbuttonref.focus(); }); } now when you activate the "edit" button and then c...
Implementing feature detection - Learn web development
principles of cross-browser testing. objective: to understand what the concept of feature detection is, and be able to implement suitable solutions in css and javascript. the concept of feature detection the idea behind feature detection is that you can run a test to determine whether a feature is supported in the current browser, and then conditionally run code to provide an
acceptable experience both in browsers that do support the feature, and browsers that don't. if you don't do this, browsers that don't support the features you are using in your code won't display your sites properly and will just fail, creating a bad user experience. let's recap and look at the example we touched on in our handling common javascript problems — the geolocation api (which exposes avai...
Introducing a complete toolchain - Learn web development
however, in the project's source files we are using react jsx syntax (for your real projects you might use react or vue or any other framework, or no framework at all!). putting jsx syntax in the middle of our javascript is going to cause eslint to complain pretty quickly with the current configuration, so we'll need to add a little more configuration to the eslint settings to get it to
accept jsx features. the final config file should look like this — add in the bolded parts and save it: { "env": { "es6": true, "browser": true }, "extends": ["eslint:recommended", "plugin:react/recommended"], "parseroptions": { "ecmaversion": 6, "sourcetype": "module", "ecmafeatures": { "jsx": true } }, "plugins": ["react"], "rules": { "semi": "er...
Chrome Worker Modules
only need to do this once for each worker, it doesn't hurt if you do it more than once. this defines a global value require(), that you may now use as follows: // import the module // (here, we import the core of os.file) let core = require("resource://gre/modules/osfile/osfile_shared_allthreads.jsm"); // we may now use module core. core.declareffi(...) note that, for the moment, require() only
accepts absolute uris. if the your module uri ends with “.js”, you can omit the extension. creating modules creating a module is just as simple. a module is a file, whose filename generally ends with either “.js” or “.jsm”, and designed to be opened through require(). any value you define in that file is private by default. to make the value public, you just have to add it to either global v...
Accessibility API cross-reference
on the change notifications defined by the aria-relevant attribute. n/a n/a aria-atomic indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be presented if they are made. n/a n/a aria-autocomplete the control cannot
accept input at this time. indicates an element is being modified and that assistive technologies may want to wait until the modifications are complete before exposing them to the user. busy busy busy aria-busy indicates the current "checked" state of checkboxes, radio buttons, and other widgets. checked checked checked aria-checked checked (boolea...
Accessibility Features in Firefox
ecause they needed an accessible web browser which supported their software: contributes accessible web applications (dhtml and ajax) ibm realized it needed a way to enable accessibility for ever more powerful web applications, beyond what you see on typical web pages today. rather than go and write their own new web browser, ibm decided to trust in the openness of the mozilla community, which
accepted ibm's significant contributions. for example, ibm has delivered over 50,000 lines of code to enable accessibility in firefox on windows and especially for this new powerful world of "web applications". a web application may be an easier-to-use online tax assistant, a web calendar or a live sports statistics page, which is familiar in that it acts much like a desktop application. whether the cur...
CSUN Firefox Materials
cause they needed an accessible web browser which supported their software: ibm contributes accessible web applications (dhtml and ajax) ibm realized it needed a way to enable accessibility for ever more powerful web applications, beyond what you see on typical web pages today. rather than go and write their own new web browser, ibm decided to trust in the openness of the mozilla community, which
accepted ibm's significant contributions. for example, ibm has delivered over 50,000 lines of code to enable accessibility in firefox on windows and especially for this new powerful world of "web applications". a web application may be an easier-to-use online tax assistant, a web calendar or a live sports statistics page, which is familiar in that it acts much like a desktop application. whether the cur...
Mozilla Plugin Accessibility
pply the same solution as in problem 4 above. the plugin will be responsible for bubbling up shift+tab and tab when the user has reached the end of the tab cycle within the plugin. the bug tracking this work is bug 93149. ? no target 3. many plugins lack accessibility api support most plugins that work with mozilla do not yet support accessibility apis. a notable
acception is the adobe pdf plugin on windows, which supports msaa. in other cases, vendors need to find or be convinced of the business justification so that resources are applied to the problem. plugin vendors. unknown 4. seamonkey has no message bar for plugin installation the message bar will be ported to seamonkey as part of the toolkit merging work that will occur ...
Multiprocess on Windows
ap the first element in the array, because it cannot distinguish between scalars and arrays. note: if your new interface does not contain either of these annotations, then you do not need to worry about this step. for those interfaces that do contain length_is or size_is annotations, we need to use another api declared in mozilla/mscom/registration.h: registerarraydata(). registerarraydata()
accepts an array of arraydata structs. you should statically define this array in your code, as const. for example: static const mozilla::mscom::arraydata kmyarraydata[] { { // first arraydata definition }, { // second arraydata definition } }; mozilla::mscom::registerarraydata(kmyarraydata); each arraydata struct corresponds to one function; with length_is and/or size_is annotations. if your int...
Themes
and feel of the user interface and personalize it to your tastes. learn how to create and share themes! browser themes browser theme concepts get an introduction to creating themes for the latest versions of firefox using the amo theme generator use the theme generator to create and submit a new theme to amo lightweight themes lightweight themes have been deprecated and are no longer
accepted by amo. only browser themes will be
accepted going forward. tools & resources browser theme manifest.json keys browser extensions theme api discourse forum theme related blog posts archived resources ...
Browser chrome tests
g too long, you can extend the timeout. be aware that this is not a solution; you should investigate why your test is taking so long, since it's most likely due to a bad test design or a performance problem. if you can rewrite the test to make is shorter, split it into smaller tests, or find why it's taking so long, you should really do that instead! function test() { // requestlongertimeout
accepts an integer factor, that is a multiplier for the the default 30 seconds timeout. // so a factor of 2 means: "wait for at last 60s (2*30s)". requestlongertimeout(2); waitforexplicitfinish(); settimeout(completetest, 40000); } function completetest() { ok(true, "timeout did not run"); finish(); } exceptions in tests any exceptions thrown under test() will be caught and rep...
Creating JavaScript callbacks in components
the xpconnect machinery to treat the javascript function as if it was an implementation of the callback interface. note, that since the javascript function is a single method, this magic only works for callback interfaces with a single method, like nsidomeventlistener. the javascript function is passed the same arguments as defined by the callback method. ...
Debugging JavaScript
er itself. go to about:config and set the following two prefs: devtools.chrome.enabled: true devtools.debugger.remote-enabled: true after you restart the browser, you can access the browser debugger through tools > web developer > browser toolbox. (note that before firefox 28, this was labeled "browser debugger" and only the debugger was available, not the whole toolbox.) note that you must
accept the incoming connection : (you may disable the pop-up above with the devtools.debugger.prompt-connection set to false in about:config. this can be a security risk, especially if you also set the devtools.debugger.force-local preference to false.) then, the browser toolbox displays the available tools for debugging. (note that before firefox 28, only the script debugger was available.) the use...
HTTP logging
editors may have problems with this, but if you're using an even reasonably modern mac os x application to view the log, you won't have any problems. start logging using command line arguments since firefox 61 it's possible to start logging in a bit simpler way than setting environment variables: using command line arguments. here is an example for the windows platform, on other platforms we
accept the same form of the arguments: if firefox is already running, exit out of it. open a command prompt. on windows xp, you can find the "run..." command in the start menu's "all programs" submenu. on all newer versions of windows, you can hold down the windows key and press "r". copy and paste the following line into the "run" command window and then press enter: for 32-bit windows: "c:\pr...
How Mozilla's build system works
lass instances as well as common hook points, such as processing has finished. see recursivemake.py for an implementation of a buildbackend. although we call the base class buildbackend, the class doesn't need to be focused with building at all. if you wanted to create a consumer that performed a line count of all c++ files or generated a clang compilation database, for example, this would be an
acceptable use of a buildbackend. technically, we don't need to feed the treemetadataemitter output into a buildbackend: it's possible to create your own consumer. however, a buildbackend provides a common framework from which to author consumers. along the same vein, you don't need to use treemetadataemitter to consume mozbuildsandbox instances. nor do you need to use buildreader to traverse the moz.b...
Eclipse CDT
"juno" to the current developer branch). click "ok", then "ok" again. type "nightly" into the "work with" field and select the repository that you just added. (if it doesn't appear, close the window, reopen it from the help menu, and try again.) a "cdt main features" option should now have been added in the area below. tick this (all of its sub-options should then be ticked), click "next" twice,
accept the license agreement, and then click "finish". eclipse should now update itself and ask you to restart. troubleshooting: if you get an error when trying to update, try clicking "available software sites" in the "install" window, make sure "juno" is still unticked, that "nightly" is ticked, highlight "nightly", click "reload", "ok", and then try again. troubleshooting here is a list of problem...
Eclipse CDT Manual Setup
cdt uses to identify compiler commands when parsing the build output. by default, it recognizes commands of the form "gcc", "g++", "c++", and "clang". this is fine for a desktop build, where the commands are in fact "gcc" and "g++". for fennec builds, however, most of the commands are something like "arm-linux-androideabi-g++", which will not be recognized by the default regex. the modified regex
accepts any command that ends with "gcc" or "g++". this may also affect other non-desktop builds besides fennec. especially important if the main object directory for your source tree is located somewhere outside your tree's top source directory: if this applies to you, then select the entries tab, select "gnu c++", select "cdt user settings entries", and click "add". change "project path" to "filesys...
Reviewer Checklist
good web citizenship make sure new web-exposed apis actually make sense and are either standards track or preffed off by default. in c++, wrapper-cache as needed. ...
Performance
since the code calls to the parent process to check whether a specific request can be allowed it would slow down all page loads, as web pages gener...
Storage access policy: Block cookies from trackers
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 preference. for the preference value enter comma separated origins that you’d like to have classified as trackers. e.g. "example.net,example.org". warning: ...
ChromeWorker
ailable 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). setsubstitution('my-cool-addon', fileuri); var worker = new worker('resource://my-cool-addon/worker.js'); more references: ...
Creating a New Protocol
d classes pnewprotocolparent and pnewprotocolchild. it must implement abstract methods for receiving the appropriate messages on each side. the method signatures can be read from the generated pnewprotocolparent.h and pnewprotocolchild.h headers. writing the tests protocols which are managed by pbrowser must be tested using the mochitest-chrome test framework with a <browser remote="true">. it is
acceptable to use synchronous calls on jpw wrappers for testing purposes. it may be possible to test protocols unrelated to a particular window using the xpcshell testing framework, which has additional primitives in electrolysis for launching and running js commands in a content process. ...
IPDL Type Serialization
ou have a serializer for a type, you can serialize a collection of it (ex: an nstarray<examplestruct>) by simply declaring "using nstarray<examplestruct>;' in your ipdl file, then using it in a ipc method. serializers and deserializers are security-sensitive and must always receive two reviews from module owners who understand ipc serialization well. if in doubt, please ask for help! it is never
acceptable to serialize/deserialize raw pointer values; if you are tempted, you probably should create a subprotocol for that data, so that ipdl can check the values and lifetime. ...
Internationalized Domain Names (IDN) Support in Mozilla Browsers
coding) almost all idn registration data are expected to change to punycode by the end of 2003. some country will complete the conversion quickly, e.g. japan as mentioned above, but others such as the ones under the .com and .net top domains may take longer. most of the existing sites currently use the ascii-compatible encoding 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 pr...
OS.File for the main thread
after image loads it then draws it to canvas, makes it a blob, and uses filereader to turn it into arraybuffer(view), then uses os.file.writeatomic to save to disk. var img = new image(); img.onload = function() { var canvas = document.createelementns('http://www.w3.org/1999/xhtml', 'canvas'); canvas.width = img.naturalwidth; canvas.height = img.naturalheight; var ctx...
Task.jsm
e declared succinctly: let greeter = { message: "hello, name!", greet: task.async(function* (name) { return yield sendgreeting(this.message.replace(/name/, name)); }) }; while maintaining identical semantics: greeter.greet("mitchell").then((reply) => { ... }); // behaves the same spawn() creates and starts a new task. promise spawn( atask ); parameters atask this parameter
accepts different data types: if you specify a generator function, it is called with no arguments to retrieve the associated iterator. the generator function is a task, that is can yield promise objects to wait upon. the promise returned by the task either fulfills with the returned value if generator returns or rejects with the thrown error if the generator throws. if you specify the iterator ret...
WebRequest.jsm
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 matchpattern. ...
QA phase
//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 allowed.
accepted payload. quota: 979.7 kb in use, 150.0 mb available (0.64% used) your changeset has been successfully pushed to your repository! as you begin to move through your translations, you should commit the changes locally and push your work to this experimental repository. for instance, if you have finished translating all the .dtd and .properties files in your x-testing/browser/chrome/browser/ dir...
Localization technical reviews
ocess, see bug 421893. no utf-7 in the intl.properties file firefox no longer has a utf-7 parser. there should not be any utf-7 encodings in the file toolkit/chrome/global/intl.properties. for more info about utf-7 in firefox, see bug 441876. more intl.properties checkpoints, cont we also check the plural rule for the locale, that the general.useragent.locale is set to the locale code, that
accept-lang shows the locale code(s) (like ab, ab-cd,...) and is followed by en and en-us, and finally that intl.menuitems.insertseparatorbeforeaccesskeys = true, where "true" should be left untranslated. inspect firefox-l10n.js we ensure that there are no odd preferences, or #filter substitutions for general.useragent.locale. most locales should have the following: #filter substitution pref("gener...
Creating localizable web content
often times explaining how to achieve something in a desktop or web application. as such, they should be perceived as an essential part of the content and should be localized. image 1. bad. if the screenshot shows the application that the website directly relates to (firefox on mozilla.com/firefox, personas on getpersonas.com), try to use screenshots from the localized version. image 2.
acceptable. if however the screenshot shows a third-party application or website, it's
acceptable to use the english version if it's not available in the target language. ...
Mozilla MathML Status
at all. if only the main features of an element are implemented then its section is marked as supported but details of unsupported attributes are specified below. the top-level math element see § 2.2. attribute notes display implemented. maxwidth, overflow not implemented. see bug 534962. altimg, altimg-width, altimg-height, altimg-valign, alttext
accepted, but do not have any effect on the rendering. mathml is always enabled since bug 660762. cdgroup
accepted, but does not have any effect on the rendering. attributes shared by all mathml elements see § 2.1.6 and § 3.1.10. attribute notes id, class, style implemented. xref
accepted, but does not have any effect on the rendering. hre...
Mozilla Web Developer FAQ
time and effort into reverse-engineering and cloning legacy browsers, it makes more sense to focus on implementing standards. standards (when implemented by others as well) promote interoperability better than cloning legacy software bug by bug. also, html was designed to adapt to different presentation media, so different presentations of the same document are to be expected. according to the
accept header, gecko
accepts both application/xhtml+xml and text/html. should i serve application/xhtml+xml to gecko? application/xhtml+xml was added to the
accept header in order to enable the serving of mathml to both mozilla and ie with apache without scripting back when the mathplayer plug-in for ie did not handle application/xhtml+xml. if your document mixes mathml or svg with xhtml, you should u...
BloatView
those configurations are located in testing/mozharness/configs/. the most ...
Refcount tracing and balancing
by a release() in main(). hints clearly, this is an iterative and analytical process. here are some tricks that make it easier. check for leaks from smart pointers. if the leak comes from a smart pointer that is logged in the xpcom_mem_comptr_log, then find-comptr-leakers.pl will find the exact stack for you, and you don't have to look at trees. ignore balanced trees. the make-tree.pl script
accepts an option --ignore-balanced, which tells it not to bother printing out the children of a node whose balance factor is zero. this can help remove some of the clutter from an otherwise noisy tree. ignore matched releases from smart pointers. if you've checked (see above) that the leak wasn't from a smart pointer, you can ignore the references that came from smart pointers (where we can use the po...
NSPR build instructions
o generate a debug build that uses the debug c run-time library, specify the --enable-debug-rtl configure option. makefile targets all (default) clean realclean distclean install release running the test programs the tests were built above, in the pr/tests directory. on mac os x, they can be executed with the following: /bin/sh: $ cd pr/tests $ dyld_library_path=../../dist/lib ./
accept pass $ $ # to run all the nspr tests... $ $ dyld_library_path=../../dist/lib ../../../nspr/pr/tests/runtests.sh ../.. ...
Network Addresses
b_buf_size network address functions initializing a network address pr_initializenetaddr facilitates the use of prnetaddr, the basic network address structure, in a polymorphic manner. by using these functions with other network address functions, clients can support either version 4 or version 6 of the internet protocol transparently. all nspr functions that require prnetaddr as an argument
accept either an ipv4 or ipv6 version of the address. pr_initializenetaddr converting between a string and a network address pr_stringtonetaddr pr_netaddrtostring converting address formats pr_convertipv4addrtoipv6 getting host names and addresses pr_gethostbyname pr_gethostbyaddr pr_enumeratehostent pr_getaddrinfobyname pr_enumerateaddrinfo pr_getcanonnamefromaddrinfo pr_freead...
PR_Listen
success. if unsuccessful, pr_failure. further information can be obtained by calling pr_geterror. description pr_listen turns the specified socket into a rendezvous socket. it creates a queue for pending connections and starts to listen for connection requests on the socket. the maximum size of the queue for pending connections is specified by the backlog parameter. pending connections may be
accepted by calling pr_
accept. ...
Thread Pools
ling work (jobs) onto one or more threads. nspr's thread pool is modeled on the thread pools described by david r. ...
Threads
for an overview of the nspr threading model and sample code that illustrates its use, see introduction to nspr. for api reference information related to thread synchronization, see locks and condition variables. threading types and constants prthread prthreadtype prthreadscope prthreadstate prthreadpriority prthreadprivatedtor threading functions most of the functions described here
accept a pointer to the thread as an argument. nspr does not check for the validity of the thread. it is the caller's responsibility to ensure that the thread is valid. the effects of these functions on invalid threads are undefined. creating, joining, and identifying threads controlling thread priorities interrupting and yielding setting global thread concurrency getting a thread's scope creat...
Running NSPR tests
for example, cvs -q co -r nspr_4_6_6_rtm mozilla/nsprpub mkdir linux.debug cd linux.debug ../mozilla/nsprpub/configure gmake cd pr/tests gmake ../../../mozilla/nsprpub/pr/tests/runtests.sh the output of the test suite looks like this: nspr test results - tests begin mon mar 12 11:44:41 pdt 2007 nspr_test_logfile /dev/null test result
accept passed
acceptread passed
acceptreademu passed affinity passed alarm passed anonfm passed atomic passed attach passed bigfile passed cleanup passed cltsrv passed concur passed...
Certificate functions
nce (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
HTTP delegation
contained in the nss c header files. look for function sec_registerdefaulthttpclient and all functions having names that start with sec_http. to find an example implementation, you may look at bug 111384, which tracks the implementation in mozilla client applications. specifying an ocsp proxy the remainder of this document is a short howto. one might expect the api defines a simple function that
accepts the uri and data to be sent, and returns the result data. but there is no such simple interface. the api should allow nss to use the http client either asynchronously or synchronously. in addition, during an application session with ocsp enabled, a large number of ocsp requests might have to be sent. therefore the api should allow for keep-alive (persistent) http connections. http uris consist o...
HTTP delegation
contained in the nss c header files. look for function sec_registerdefaulthttpclient and all functions having names that start with sec_http. to find an example implementation, you may look at bug 111384, which tracks the implementation in mozilla client applications. specifying an ocsp proxy the remainder of this document is a short howto. one might expect the api defines a simple function that
accepts the uri and data to be sent, and returns the result data. but there is no such simple interface. the api should allow nss to use the http client either asynchronously or synchronously. in addition, during an application session with ocsp enabled, a large number of ocsp requests might have to be sent. therefore the api should allow for keep-alive (persistent) http connections. http uris consist o...
JSS Provider Notes
keygenerator supported algorithms notes aes des desede (des3 ) rc4 the securerandom argument passed to init() is ignored, because nss does not support specifying an external source of randomness. none of the key generation algorithms
accepts an algorithmparameterspec. keypairgenerator supported algorithms notes dsa rsa the securerandom argument passed to initialize() is ignored, because nss does not support specifying an external source of randomness. ...
Mozilla-JSS JCA Provider notes
lling generatepublic() or generateprivate(). only x509encodedkeyspec is supported for public keys, and only pkcs8encodedkeyspec is supported for private keys. keygenerator supported algorithms notes aes des desede (des3) rc4 the securerandom argument passed to init() is ignored, because nss does not support specifying an external source of randomness. none of the key generation algorithms
accepts an algorithmparameterspec. keypairgenerator supported algorithms notes dsa rsa the securerandom argument passed to initialize() is ignored, because nss does not support specifying an external source of randomness. mac supported algorithms notes hmacsha1 (hmac-sha1) any secret key type (aes, des, etc.) can be used as the mac key, but it must be a jss key. that is, it must be an insta...
NSS 3.12.4 release notes
cert.h). cert_decodecrlissuingdistributionpoint cert_findcrlissuingdistpointexten the old documentation of the expression matching syntax rules was incorrect, and the new corrected documentation is as follows for public nssutil functions (see portreq.h): port_regexpvalid port_regexpsearch port_regexpcasesearch these functions will match a string with a shell expression. the expressions
accepted are based loosely on the expressions
accepted by zsh. expected return values: non_sxp if exp is a standard string invalid_sxp if exp is a shell expression, but invalid valid_sxp if exp is a valid shell expression expression matching rules: * matches anything ? matches one character \ will escape a special character $ matches the end of the string bracketed expressions: [abc] matches one occ...
NSS_3.12_release_notes.html
tem dertemp in crmf_encode_popoprivkey bug 395080: double backslash in sysdir filenames causes problems on os/2 bug 341371: certutil lacks a way to request a certificate with an existing key bug 382292: add support for camellia to cmd/symkeyutil bug 385642: add additional cert usage(s) for certutil's -v -u option bug 175741: strict aliasing bugs in mozilla/dbm bug 210584: cert_asciitoname doesn't
accept all valid values bug 298540: vfychain usage option should be improved and documented bug 323570: make dbck debug mode work with softoken bug 371470: vfychain needs option to verify for specific date bug 387621: certutil's random noise generator isn't very efficient bug 390185: signtool error message wrongly uses the term database bug 391651: need config.mk file for windows vista bug 396322: fix s...
NSS 3.15.2 release notes
128_gcm_sha256 new functions pk11_cipherfinal has been introduced, which is a simple alias for pk11_digestfinal. new types no new types have been introduced. new pkcs #11 mechanisms no new pkcs#11 mechanisms have been introduced notable changes in nss 3.15.2 bug 880543 - support for aes-gcm ciphersuites that use the sha-256 prf bug 663313 - md2, md4, and md5 signatures are no longer
accepted for ocsp or crls, consistent with their handling for general certificate signatures. bug 884178 - add pk11_cipherfinal macro bugs fixed in nss 3.15.2 bug 734007 - sizeof() used incorrectly bug 900971 - nssutil_readsecmoddb() leaks memory bug 681839 - allow ssl_handshakenegotiatedextension to be called before the handshake is finished. bug 848384 - deprecate the ssl cipher policy cod...
NSS 3.16.2.1 release notes
1_rtm/src/ security advisories the following security-relevant bugs have been resolved in nss 3.16.2.1. users are encouraged to upgrade immediately. bug 1064636 - (cve-2014-1568) rsa signature forgery in nss. see also mfsa 2014-73 for details. new in nss 3.16.2.1 new functionality no new functionality is introduced in this release. this is a patch release to fix a bug that caused nss to
accept forged rsa signatures. a new symbol, _sgn_verifypkcs1digestinfo is exported in this release. as with all exported nss symbols that have a leading underscore '_', this is an internal symbol for nss use only. applications that use or depend on these symbols can and will break in future nss releases. bugs fixed in nss 3.16.2.1 bug 1064636 - (cve-2014-1568) rsa signature forgery in nss acknowl...
NSS 3.16.5 release notes
_16_5_rtm/src/ security advisories the following security-relevant bugs have been resolved in nss 3.16.5. users are encouraged to upgrade immediately. bug 1064636 - (cve-2014-1568) rsa signature forgery in nss. see also mfsa 2014-73 for details. new in nss 3.16.5 new functionality no new functionality is introduced in this release. this is a patch release to fix a bug that caused nss to
accept forged rsa signatures. a new symbol, _sgn_verifypkcs1digestinfo is exported in this release. as with all exported nss symbols that have a leading underscore '_', this is an internal symbol for nss use only. applications that use or depend on these symbols can and will break in future nss releases. bugs fixed in nss 3.16.5 bug 1064636 - (cve-2014-1568) rsa signature forgery in nss acknowled...
NSS 3.17.1 release notes
la.org/pub/mozilla.org/security/nss/releases/nss_3_17_1_rtm/src/ security advisories the following security-relevant bugs have been resolved in nss 3.17.1. users are encouraged to upgrade immediately. bug 1064636 - (cve-2014-1568) rsa signature forgery in nss. see also mfsa 2014-73 for details. new in nss 3.17.1 this patch release adds new functionality and fixes a bug that caused nss to
accept forged rsa signatures. a new symbol, _sgn_verifypkcs1digestinfo is exported in this release. as with all exported nss symbols that have a leading underscore '_', this is an internal symbol for nss use only. applications that use or depend on these symbols can and will break in future nss releases. new functionality tls_fallback_scsv is a signaling cipher suite value that indicates a handshak...
NSS 3.19.1 release notes
ibution information the hg tag is nss_3_19_1_rtm. nss 3.19.1 requires nspr 4.10.8 or newer. nss 3.19.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_19_1_rtm/src/ security fixes in nss 3.19.1 bug 1138554 / cve-2015-4000 - the minimum strength of keys that libssl will
accept for finite field algorithms (rsa, diffie-hellman, and dsa) have been increased to 1023 bits. new in nss 3.19.1 new functionality no new functionality is introduced in this release. this patch release includes a fix for the recently published logjam attack. notable changes in nss 3.19.1 nss reports the bit length of keys more accurately. thus, the seckey_publickeystrength and seckey_publi...
NSS 3.19.2.1 release notes
rc/ security advisories the following security-relevant bugs have been resolved in nss 3.19.2.1. users are encouraged to upgrade immediately. bug 1192028 (cve-2015-7181) and bug 1202868 (cve-2015-7182): several issues existed within the asn.1 decoder used by nss for handling streaming ber data. while the majority of nss uses a separate, unaffected der decoder, several public routines also
accept ber data, and thus are affected. an attacker that successfully exploited these issues can overflow the heap and may be able to obtain remote code execution. the following security-relevant bugs have been resolved in nspr 4.10.10, which affect nss. because nss includes portions of the affected nspr code at build time, it is necessary to use nspr 4.10.10 when building nss. bug 1205157 (nspr, ...
NSS 3.19.4 release notes
/src/ security advisories the following security-relevant bugs have been resolved in nss 3.19.4. users are encouraged to upgrade immediately. bug 1192028 (cve-2015-7181) and bug 1202868 (cve-2015-7182): several issues existed within the asn.1 decoder used by nss for handling streaming ber data. while the majority of nss uses a separate, unaffected der decoder, several public routines also
accept ber data, and thus are affected. an attacker that successfully exploited these issues can overflow the heap and may be able to obtain remote code execution. the following security-relevant bugs have been resolved in nspr 4.10.10, which affect nss. because nss includes portions of the affected nspr code at build time, it is necessary to use nspr 4.10.10 when building nss. bug 1205157 (nspr, ...
NSS 3.20.1 release notes
/src/ security advisories the following security-relevant bugs have been resolved in nss 3.20.1. users are encouraged to upgrade immediately. bug 1192028 (cve-2015-7181) and bug 1202868 (cve-2015-7182): several issues existed within the asn.1 decoder used by nss for handling streaming ber data. while the majority of nss uses a separate, unaffected der decoder, several public routines also
accept ber data, and thus are affected. an attacker that successfully exploited these issues can overflow the heap and may be able to obtain remote code execution. the following security-relevant bugs have been resolved in nspr 4.10.10, which affect nss. because nss includes portions of the affected nspr code at build time, it is necessary to use nspr 4.10.10 when building nss. bug 1205157 (nspr, ...
NSS 3.28 release notes
ort for the x25519 key exchange algorithm (bug 957105), which is supported and enabled by default in all versions of tls. new functions in ssl.h ssl_exportearlykeyingmaterial implements a key exporter based on the tls 1.3 early exporter secret. this api is equivalent in function to ssl_exportkeyingmaterial, but it can only succeed if 0-rtt was attempted (on the client) or
accepted (on the server). ssl_sendadditionalkeyshares configures a tls 1.3 client so that it generates additional key shares when sending a clienthello. ssl_signatureschemeprefset allows an application to set which signature schemes should be supported in tls and to specify the preference order of those schemes. ssl_signatureschemeprefget allows an application to lear...
NSS 3.34 release notes
b:e5:88:f5:fb:23:16:5c:2e:61:4b:f8:85:56:2d:0d:ce:50:b2:9b:02 libfreebl no longer requires sse2 instructions. new in nss 3.34 new functionality when listing an nss database. using certutil -l, and the database hasn't yet been initialized with any non-empty or empty password, the text "database needs user init" will be included in the listing. when using certutil, to set an in
acceptable password in fips mode, a correct explanation of
acceptable passwords will be printed. sslkeylogfile is now supported with tls 1.3, see bug 1287711 for details. sslchannelinfo has two new fields (bug 1396525) sslnamedgroup originalkeagroup holds the key exchange group of the original handshake, when the session was resumed. prbool resumed is pr_true when the session is resumed, and ...
NSS 3.35 release notes
rimental apis were added in support of tls 1.3 features: tls servers are able to send session tickets to clients on demand, using the experimental ssl_sendsessionticket function. this ticket can include arbitrary application-chosen content. an anti-replay mechanism was added for 0-rtt, through the experimental ssl_setupantireplay function. this mechanism must be enabled for 0-rtt to be
accepted when nss is being used as a server. keyupdate can be triggered by the experimental ssl_keyupdate() function. tls servers can screen new tls 1.3 connections, as they are made using the experimental ssl_helloretryrequestcallback function. this function allows for callbacks to be installed, which are called when a server receives a new tls clienthello. the application is then able to exami...
NSS 3.37 release notes
on information the hg tag is nss_3_37_rtm. nss 3.37 requires nspr 4.19 or newer. nss 3.37 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_37_rtm/src/ notable changes in nss 3.37 the tls 1.3 implementation was updated to draft 28. an issue where nss erroneously
accepted hrr requests was resolved. this issue was found by oss fuzz. added hacl* poly1305 32-bit the code to support the npn protocol, which had already been disabled in a previous release, has been fully removed. nss allows servers now to register alpn handling callbacks to select a protocol. nss supports opening sql databases in read-only mode. nss now requires the sqlite apis...
NSS 3.39 release notes
the key type associated with the given certificate. utilpars.h nssutil_addnssflagtomodulespec - a helper function for modifying the pkcs#11 module configuration. it can be used to add a single flag to the flags= section inside the spec's nss= section. notable changes in nss 3.39 the tls 1.3 implementation uses the final version number from rfc 8446. previous versions of nss
accepted an rsa pkcs#1 v1.5 signature where the digestinfo structure was missing the null parameter. starting with version 3.39, nss requires the encoding to contain the null parameter. the tstclnt and selfserv test utilities no longer
accept the -z parameter, as support for tls compression was removed in a previous nss version. the ca certificates list was updated to version 2.26. the following ca...
NSS 3.45 release notes
unctions: ssl_settimefunc, ssl_createantireplaycontext, ssl_setantireplaycontext, and ssl_releaseantireplaycontext. the experimental function ssl_initantireplay is removed. bug 1546477 - various changes in response to the ongoing fips review note: the source package size has increased substantially due to the new fips test vectors. this will likely prompt follow-on work, but please
accept our apologies in the meantime. certificate authority changes the following ca certificates were removed: bug 1552374 - cn = certinomis - root ca sha-256 fingerprint: 2a99f5bc1174b73cbb1d620884e01c34e51ccb3978da125f0e33268883bf4158 bugs fixed in nss 3.45 bug 1540541 - don't unnecessarily strip leading 0's from key material during pkcs11 import (cve-20...
NSS Config Options
nss config options format the specified ciphers will be allowed by policy, but an application may allow more by policy explicitly: config="allow=curve1:curve2:hash1:hash2:rsa-1024..." only the specified hashes and curves will be allowed: config="disallow=all allow=sha1:sha256:secp256r1:secp384r1" only the specified hashes and curves will be allowed, and rsa keys of 2048 or more will be
accepted, and dh key exchange with 1024-bit primes or more: config="disallow=all allow=sha1:sha256:secp256r1:secp384r1:min-rsa=2048:min-dh=1024" a policy that enables the aes ciphersuites and the secp256/384 curves: config="allow=aes128-cbc:aes128-gcm::hmac-sha1:sha1:sha256:sha384:rsa:ecdhe-rsa:secp256r1:secp384r1" turn off md5 config="disallow=md5" turn off md5 and sha1 only for ssl config="disa...
NSS PKCS11 Functions
password length for this token. flags a comma separated list of flag values, parsed case-insensitive. valid flags are: readonly - databases should be opened read only. nocertdb - don't try to open a certificate database. nokeydb - don't try to open a key database. forceopen - don't fail to initialize the token if thedatabases could not be opened. passwordrequired - zero length passwords are not
acceptable(valid only if there is a keydb). optimizespace - allocate smaller hash tables and lock tables.when this flag is not specified, softoken will allocatelarge tables to prevent lock contention. for more info on module strings see pkcs11_module_specs. this function will return a reference to a slot. the caller is responsible for freeing the slot reference when it is through. freeing the slot refe...
NSS functions
nce (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
sslerr.html
lert codes are listed in other blocks.) ssl_error_handshake_unexpected_alert -12229 "ssl peer was not expecting a handshake message it received." ssl_error_decompression_failure_alert -12228 "ssl peer was unable to successfully decompress an ssl record it received." ssl_error_handshake_failure_alert -12227 "ssl peer was unable to negotiate an
acceptable set of security parameters." ssl_error_illegal_parameter_alert -12226 "ssl peer rejected a handshake message for un
acceptable content." ssl_error_unsupported_cert_alert -12225 "ssl peer does not support certificates of the type it received." ssl_error_certificate_unknown_alert -12224 "ssl peer had some unspecified issue with the certificate it rece...
NSS_3.12.3_release_notes.html
bug 464406: fix signtool regressions bug 465270: uninitialised value in devutil.c::create_object() bug 465273: dead assignment in devutil.c::nssslotarray_clone() bug 465926: during import of pkcs #12 files bug 466180: ssl_configmpserversidcache with default parameters fails on {net bug 466194: cert_decodetruststring should take a const char * input trusts ...
NSS tools : signtool
information when you run the command with the -g option. however, all of the requested fields are optional for test certificates. if you do not enter a common name, the tool provides a default name. in the following example, the user input is in boldface: signtool -g mytestcert using certificate directory: /u/someuser/.netscape enter certificate information. all fields are optional.
acceptable characters are numbers, letters, spaces, and apostrophes. certificate common name: test object signing certificate organization: netscape communications corp. organization unit: server products division state or province: california country (must be exactly 2 characters): us username: someuser email address: someuser@netscape.com enter password or pin for "communicator certificate db...
Scripting Java
t the org.mozilla.javascript package you could use importpackage() as follows: $ java org.mozilla.javascript.tools.shell.main js> importpackage(packages.org.mozilla.javascript); js> context.currentcontext; org.mozilla.javascript.context@bb6ab6 occasionally, you will see examples that use the fully qualified name of the package instead of importing using the importpackage() method. this is also
acceptable, it just takes more typing. using a fully qualified name, the above example would look as follows: $ java org.mozilla.javascript.tools.shell.main js> jspackage = packages.org.mozilla.javascript; [javapackage org.mozilla.javascript] js> jspackage.context.currentcontext; org.mozilla.javascript.context@bb6ab6 alternatively, if you want to import just one class from a package you can do so usi...
Shumway
shumway extension (or run a browser version with shumway included and enabled) and browse to your flash content with adobe flash player set "ask to activate" or "never activate" in firefox's add-ons menu (this will be listed as "shockwave flash" under the plugins tab). this will be the experience met by your users who are running that version of shumway. hopefully, this displays your content with
acceptable quality. the next step is to use the inspector included as one of shumway's examples. it can be run locally through a web server or you can use the version hosted on mozilla's github. several methods exist to allow inspector access to your swf file. once your flash content is loaded, you can see how shumway manages it in detail. several buttons are available at the bottom of the screen to en...
Hacking Tips
nts (a small value too). if you want to know at which lir the code is failing at, the js::ion::codegenerator::generatebody function can be intrumented to dump the lir id before each instruction. for (; iter != current->end(); iter++) { ionspew(ionspew_codegen, "instruction %s", iter->opname()); […] masm.store16(imm32(iter->id()), address(stackpointer, -8)); // added if (!iter->
accept(this)) return false; […] } this modification will add an instruction which abuse the stack pointer to store an immediate value (the lir id) to a location which would never be generated by any sane compiler. thus when dumping the assembly under gdb, this kind of instructions would be easily noticeable. viewing the mirgraph of ion/odin compilations (from gdb) with gdb instrumentat...
Exact Stack Rooting
t live by storing its pointer on the stack so that the conservative scanner will find it. this distinction should not be noticable to the end user. performance tweaking in aggregate, exact and conservate stack rooting should have similar performance. the performance tradeoffs that these techniques make, however, are quite different. if the extra overhead of exact rooting does end up adding an un
acceptable cost to a specific code path that is not mitigated by a faster gc, there are some tricks you can use to get better performance at the cost of more complex code. move js::rootedt declarations above loops. modern c++ compilers are not smart enough to do licm on js::rootedt, so forward declaring a single js::rootedt above the loop and re-using it on every iteration can save some cycles. raw ...
SpiderMonkey Internals
atoms play three roles: as literals referred to by unaligned 16-bit immediate bytecode operands, as unique string descriptors for efficient property name hashing, and as members of the root gc set for exact gc. standard library the methods for arrays, booleans, dates, functions, numbers, and strings are implemented using the js api. most are jsfastnatives. most string methods are customized to
accept a primitive string as the this argument. (otherwise, spidermonkey converts primitive values to objects before invoking their methods, per ecma 262-3 §11.2.1.) error handling spidermonkey has two interdependent error-handling systems: javascript exceptions (which are not implemented with, or even compatible with, any kind of native c/c++ exception handling) and error reporting. in general, both...
JSAPI Cookbook
is certain that y is an object (that is, not a boolean, number, string, null, or undefined), this is fairly straightforward. use jsval_to_object to cast y to type jsobject *. /* jsapi */ js::rootedvalue x(cx); assert(y.isobject()); js::rootedobject yobj(cx, &y.toobject()); if (!js_getproperty(cx, yobj, "myprop", &x)) return false; that code will crash if y is not an object. that's often un
acceptable. an alternative would be to simulate the behavior of the javascript . notation exactly. it's a nice thought—javascript wouldn't crash, at least—but implementing its exact behavior turns out to be quite complicated, and most of the work is not particularly helpful. usually it is best to check for !y.isobject() and throw an error with a nice message. /* jsapi */ js::rootedvalue x(cx); if...
JS::CompileOptions
piler. the usual compileoptions class must be stack-allocated, and holds non-owning references to the filename, element, and so on. it's derived from readonlycompileoptions, so the compiler can use it. owningcompileoptions roots / copies / reference counts of all its values, and unroots / frees / releases them when it is destructed. it too is derived from readonlycompileoptions, so the compiler
accepts it. readonlycompileoptions readonlycompileoptions is the common base class for the compileoptions hierarchy. use this in code that only needs to access compilation options created elsewhere, like the compiler. don't instantiate this class (the constructor is protected anyway); instead, create instances only of the derived classes: compileoptions and owningcompileoptions. owningcompileoption...
JSConvertOp
is deprecated. vp js::mutablehandlevalue out parameter. on success, *vp receives the converted value. description jsconvertop callback specifies conversion behavior for objects having this class, implementing the ecmascript [[defaultvalue]] behavior for them. on success it must return a primitive value in *vp. implementations of this hook have historically been required to
accept any type. however, the engine itself only requires support for jstype_string, jstype_number, and jstype_void, if js_convertvalue is not used. if you do not use the js_convertvalue method, you may omit support for other types. (support for the other types may eventually be removed.) the callback returns true to indicate success or false to indicate failure. jsclass hooks jsclass offers the foll...
JS_MaybeGC
ctices. in both cases, frequent calls js_maybegc are safe and will not cause the application to spend a lot of time doing redundant garbage collection work. implementation note: spidermonkey 1.8 and earlier determine whether garbage collection is appropriate by analyzing statistics about the gc heap and memory usage since the last garbage collection cycle. the analysis is simplistic but produces
acceptable performance for many applications. in some applications, js_maybegc collects more often than it should for ideal performance. such applications can benefit from implementing their own custom-tuned maybe-gc function that conditionally calls js_gc on the basis of some application-specific analysis, and using that instead of js_maybegc. to perform a full garbage collection unconditionally, use ...
JS_NewExternalString
js_newexternalstring and js_newexternalstringwithclosure create a new jsstring whose characters are stored in external memory, i.e., memory allocated by the application, not the javascript engine. since the program allocated the memory, it will need to free it; this happens in an external string finalizer indicated by the type parameter. js_newexternalstringwithclosure works similarly, except it
accepts an additional parameter, closure, which is saved in the string's internal data structure. it can be retrieved later by calling js_getexternalstringclosure. this is application-defined data you can associate with the string. to determine if a string was created as an external string, you can call js_isexternalstring. see also mxr id search for js_newexternalstring js_getexternalstringclosur...
JS_PreventExtensions
nize the concept of extensibility: whether new properties may be added to the object. in some situations, it may be convenient to prohibit new properties. in javascript this may be accomplished using the object.preventextensions method. the similar jsapi method is js_preventextensions. the failure-mode information below is new as of spidermonkey 36. before then, js_preventextensions did not
accept a succeeded argument; in those cases where *succeeded would be set to false, js_preventextensions would throw a typeerror and return false. unlike object.preventextensions, js_preventextensions doesn't necessarily throw a typeerror if the object couldn't be made non-extensible. there are instead two modes of failure: through internal error, and because the object denied the attempt. the first...
JS_StringHasLatin1Chars
str jsstring * string to examine. description js_stringhaslatin1chars returns true iff the string's characters are stored as latin1. string characters are stored as either latin1char (8-bit) or char16_t (16-bit). clients can use js_stringhaslatin1chars and can then call either the latin1* or twobyte* functions. some functions like js_copystringchars and js_getstringcharat
accept both latin1 and twobyte strings. see also mxr id search for js_stringhaslatin1chars bug 1032726 ...
Parser API
etexpression <: expression { type: "letexpression"; head: [ variabledeclarator ]; body: expression; } a let expression. note: the let expression form is spidermonkey-specific. patterns interface pattern <: node { } javascript 1.7 introduced destructuring assignment and binding forms. all binding forms (such as function parameters, variable declarations, and catch block headers)
accept array and object destructuring patterns in addition to plain identifiers. the left-hand sides of assignment expressions can be arbitrary expressions, but in the case where the expression is an object or array literal, it is interpreted by spidermonkey as a destructuring pattern. since the left-hand side of an assignment can in general be any expression, in an assignment context, a pattern can be...
SpiderMonkey 1.8
reads. this includes iterators and generators (bug 349263) and arrays (bug 417501). in short, applications that share objects among threads in such a way that two threads could access an array, iterator, or generator object at the same time should not use spidermonkey 1.8. there is a minor known bug in the new javascript 1.8 functionality. when javascript 1.8 support is enabled, the parser
accepts some incorrect programs by inserting a semicolon where it should instead throw a syntaxerror (bug 384758). this bug will be fixed in 1.8.1. migrating to spidermonkey 1.8 spidermonkey 1.8 is not binary-compatible with previous releases. it is source-compatible with spidermonkey 1.7 though, which means you can probably just recompile and relink your application. a handful of changes are not bac...
SpiderMonkey releases
this page lists spidermonkey release notes. note: standalone spidermonkey is not an official product. our continuous integration system does produce a tarball that is built into a binary that runs our smoke tests, but we do not maintain it nor actively test its suitability for general embedding. we have periodically created "releases", but they are best-effort and incomplete. we do happily
accept patches, and make some effort to keep the tip of the gecko tree minimally working as an embeddable source package. we are very limited in our ability to support older versions, including those labeled as "releases" on this page. the easiest way to fetch the version corresponding to the current firefox release is to visit the treeherder page for the release repository and click on the first sm(pkg...
Shell global objects
stacklimit highfrequencytimelimit highfrequencylowlimit highfrequencyhighlimit highfrequencyheapgrowthmax highfrequencyheapgrowthmin lowfrequencyheapgrowth dynamicheapgrowth dynamicmarkslice allocationthreshold minemptychunkcount maxemptychunkcount compactingenabled refreshframeslicesenabled relazifyfunctions(...) perform a gc and allow relazification of functions.
accepts the same arguments as gc(). getbuildconfiguration() return an object describing some of the configuration options spidermonkey was built with. haschild(parent, child) return true if child is a child of parent, as determined by a call to tracechildren setsavedstacksrngstate(seed) set this compartment's savedstacks' rng state. getsavedframecount() return the number of savedframe instances ...
Web Replay
ption handler and the dirty memory exception handler. shared array buffers can be used by web content to introduce data races to the browser on the contents of those buffers, going against a fundamental assumption of the record/replay infrastructure. recording and replaying executions using these buffers will require new techniques like treating all accesses on the buffers as atomic (probably un
acceptable overhead) or performing all accesses on the buffer on a single core and keeping track of context switches. dom workers are not supported yet. for simplicity, debugger integration is currently only able to handle js code that runs on the main thread. webgl is not supported yet, as it uses a pretty different rendering path from normal web content. media elements are not supported yet, as ma...
Pinning violation reports
if a site makes use of key pinning, and your browser sees a certificate chain for that site which does not match the pin, firefox will reject the connection and display an error page. ...
Handling Mozilla Security Bugs
hem and nominate them for membership. nomination is done by the "voucher" sending e-mail to the security bug group private mailing list. the applicant's nomination for membership will then be considered for a period of a few days, during which members of the security bug group can speak out in favor of or against the applicant. at the end of this period, the security module owner will decide to
accept the applicant or not, based on feedback and objections from the security bug group in general, and from the module owner's peers in particular. if anyone else in the security bug group has a problem with the module owner's decision, they can appeal to mozilla.org staff, who will make the final decision. the criteria for membership in the mozilla security bug group are as follows: the applica...
Setting up an update server
ir>/dist/host/bin/mar.exe" moz_product_version=<version> mar_channel_id=<channel> ./tools/update-packaging/make_full_update.sh <mar output path> "<obj dir>/dist/firefox" for a local build, <channel> can be default, and <version> can be the value from browser/config/version.txt (or something arbitrarily large like 2000.0a1). note: it can be a bit tricky to get the make_full_update.sh script to
accept paths with spaces. serving the update preparing the update files first, create the directory that updates will be served from and put the 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. <?xml version="1.0" encoding="utf-8"?> <updates> <update typ...
Gecko object attributes
uncheck". applied to: state_checkable state datatype warning: obsolete, do not use! a qname that refers to an xsd (schema) defined type. for example, a datatype may be xsd:integer. when this is not specified, the default is string, unless the value interface is exposed, which indicates the type is numeric. for more information please read about schema datatypes. applied to: any widget that
accepts input exposed via aria: aria-datatype exposed in xforms: from boud instance node datatype draggable true when the accessible object can be grabbed. dropeffect indicates what functions can be performed when the dragged object is released on the drop target. refer to aria-dropeffect for the list of possible values. grabbed true when the accessible object has been selected for dragging. ha...
Gecko states
, which means that its appearance has changed to indicate that the mouse pointer is located over it. isn't used state_default this state represents the default button in a window. state_expanded children of this object that have the role_outlineitem role are displayed. state_collapsed children of this object that have the role_outlineitem role are hidden. state_busy the control cannot
accept input at this time. state_floating children "owned" not "contained" by parent state_checkable indicates scrolling or moving text or graphics. state_animated the object's appearance changes rapidly or constantly. graphics that are occasionally animated are described as role_graphic with the state property set to state_animated. this state is used to indicate that the object's location is cha...
Aggregating the In-Memory Datasource
are still in flux (a wee bit). aggregation to the rescue! here are the gory details on how. when it won't work although this magic is terribly convenient to use, it won't work in the case that you want to "override" some of the in-memory datasource's methods. for example, while writing the bookmarks datasource, i wanted to be able to trap assert() to enforce the bookmarks datasource would only
accept "bookmarks related" assertions. if i'd just delegated to the in-memory datasource, assert() would've taken any old random garbage. similarly, i wanted to trap flush() so that i could write the bookmarks.html file back to disk. in short, the only case where this technique is useful is when you're implementing a datasource to get "read-only reflection". that is, you want to reflect the contents of...
Avoiding leaks in JavaScript XPCOM components
ts second private_data to 1 fns1[1]() + "."; // doubles first private_data to 10 } this shows that closures are quite powerful. but it's also easy to accidentally use that power when it's not needed. ...
XPCOM changes in Gecko 2.0
e.manifest: # the {classid} here must match the classid in mycomponent.js component {e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8} components/mycomponent.js contract @foobar/mycomponent;1 {e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8} category profile-after-change mycomponent @foobar/mycomponent;1 the javascript code no longer exports a nsgetmodule() function. it now must export a nsgetfactory() function, which
accepts a class id (cid) as a parameter. for example, in your component's javascript code : components.utils.import("resource://gre/modules/xpcomutils.jsm"); function mycomponent() { } mycomponent.prototype = { // this must match whatever is in chrome.manifest! classid: components.id("{e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8}"), queryinterface: xpcomutils.generateqi([components.interfaces.nsimycomp...
Creating the Component Code
t and moving outward, the first object is the xpcom object. this is the object that contains the business logic, that implements functionality such as starting a network download, implementing interfaces that listen to the download progress, or providing a new content type handler. in weblock, this is the part that brings together various gecko services and prevents users from leaving the list of
acceptable domains. in a way, the factory and module layers are glue to plug the xpcom object into the larger xpcom system. one layer above the object itself is the nsifactory object. this object provides basic abstraction of the xpcom object itself. as you can see in onion peel view of xpcom component creation, the main accessor for the xpcom object is createinstance, which is expected to return the o...
Starting WebLock
the service manager and call unlock or lock. for example, the user interface may bring up a dialog asking the user for a password before calling unlock. another area of code, such as a "profile manager" that starts up and lets users choose which profile to use, may unconditionally call unlock on such a component when switching a profile. the next set of functionality manages the white list where
acceptable domains are stored: void addsite(in string url); void removesite(in string url); attribute nsisimpleenumerator sites; operations in this set - add, remove, and enumerate - will be called from a user interface that manages the white list and adds the current website to the white list. there is no policy applied to what sites get added or removed to this list, or who can remove a site.
Using XPCOM Utilities to Make Things Easier
k is outside the scope of this book, but we can show you how to use strings in the weblock component. the first thing to note is that the string classes themselves are not frozen, which means that you should not link against them when you can avoid it. linking the full string library (.lib or .a) into a component may raise its footprint by more than 100k (on windows), which in many cases is an un
acceptable gain (see the xpcom string guide). for weblock, where the string classes need to be only wrappers around already existing string data, trading advanced functionality for a much smaller footprint is the right way to go. the weblock string classes don't need to append, concatenate, search, or do any other real work on the string data; they just need to represent char* and other data and pass th...
Components.interfaces
r another might or might not implement. it reflects only those interfaces which have been designated in their .idl description as scriptable, that is the interfaces which xpconnect is capable of reflecting into javascript. properties of the components.interfaces object are used where xpcom methods expect a parameter of type nsid. this includes nsisupports.queryinterface(), the optional parameter
accepted by nsijscid.getservice(), nsijscid.createinstance() when called from javascript, and nsiclassinfo.getinterfaces(). the properties of the components.interfaces object can be enumerated using a for...in loop. usage accessing an interface object properties of the components.interfaces object are indexed by interface name. you can retrieve an interface object using: var iface = components.inte...
Components.utils.Sandbox
.contentprincipal]; // this is now an expanded (aka extended) principal var sandbox = components.utils.sandbox(principal); null principal you can create a null principal using code like: cc["@mozilla.org/nullprincipal;1"].createinstance(ci.nsiprincipal); from firefox 37 onwards, you can also specify the null principal by simply passing null as the principal argument. options the constructor
accepts an optional parameter. this parameter is an object with the following optional properties: freshzone if true creates a new gc region separate from both the calling context's and the sandbox prototype's region. addons creating sandboxes whose expected lifetime is tied to that of a content window object will want to use samezoneas instead. samezoneas a javascript object in whose garbage ...
Components object
ays property in the javascript environment. utils.relimit provides access to the value of the relimit property in the javascript environment. utils.reporterror reports a javascript error object to the error console. utils.scheduleprecisegc requests that garbage collection occur sometime in the future when no javascript code is running;
accepts a callback function to receive notification once collection is complete. utils.setgczeal() sets the gc zeal level for the context. utils.strict provides access to the value of the strict property in the javascript environment. utils.werror provides access to the value of the werror property in the javascript environment. ...
XPCshell Test Manifest Expressions
operators in order of decreasing precedence: () == != && || literal values booleans: the literal strings true and false. integers: a series of contiguous digits. only decimal integers are supported. strings: any series of characters enclosed in double quotes " or single quotes '. no escape sequences are supported. ...
Observer Notifications
shutdown. observer must not spin event loop. xpcom-shutdown assortment of critical services stop operating. many things will not be available here. web-workers-shutdown called inside xpcom-shutdown. this shuts down all web workers. xpcom-shutdown-threads shuts down the thread manager, causing all nsthreads to finish processing any events already queued and stop
accepting new events. browser these topics indicate interesting things that happen that the browser alerts you to. topic description browser:purge-session-history sent when the sanitizer runs to purge all history and other information. browser:purge-domain-data sent after domain-specific history and other information have been purged. the data value is a stri...
RefPtr
t's unclear to me when the compiler will reject an attempt to use nscomptr to hold a concrete class pointer and when it will not (will it only rejecte it if a qi is involved in the construction or or assignment to the nscomptr (common in implementation details of nscomptr) but not when an instance of the concrete class is assigned directly?). and it's not clear what happens when the compiler does
accept this pattern. what goes wrong at runtime - uaf? memory leak? qi failure and null-deref crashes?. note: in the above example, "nscomptr<nsfoo>" might compile and work ok (it won't if your xpcom class multiply-inherits nsisupports). but this is considered bad form, and may soon be made a compile-time error. don't do it! can i queryinterface a refptr to get a nscomptr from the object it points ...
nsIAccessibleSelectable
the object's selection. if the specified object was not selected, then it does nothing. void removechildfromselection( in long index ); parameters index zero-based accessible child index. exceptions thrown ns_error_failure if the specified object is not selectable. selectallselection() select all children. boolean selectallselection(); parameters none. return value if the object does not
accept multiple selection, return false. otherwise, returns true. ...
nsIAccessibleStates
. state_default 0x00000100 this state represents the default button in a window. state_expanded 0x00000200 children of this object that have the role_outlineitem role are displayed. (see nsiaccessiblerole.constants). state_collapsed 0x00000400 children of this object that have the role_outlineitem role are hidden. (see nsiaccessiblerole.constants). state_busy 0x00000800 the control cannot
accept input at this time. state_floating 0x00001000 children "owned" not "contained" by parent. state_marqueed 0x00002000 the object is scrolling or moving text or graphics. state_animated 0x00004000 the object's appearance changes rapidly or constantly. graphics that are occasionally animated are described as role_graphic (see nsiaccessiblerole.constants) with the state property set to state_ani...
nsIAlertsService
notification background becomes lighter and the cursor turns to a pointer. prior to gecko 32 the text was made to look like a link. cookie optional a blind cookie the alert passes back to the consumer during alert listener callbacks. alertlistener optional an object to receive callbacks from the alert; may be null if you don't care about callbacks. it must implement an observe() method that
accepts three parameters: subject: always null. topic: "alertfinished" when the alert disappears, "alertclickcallback" if the user clicks the text or "alertshow" (since gecko 22) when the alert is shown. data: the value of the cookie parameter passed into the showalertnotification method. name optional a name for the notification; this is not displayed in the alert. however, certain notif...
nsIClipboardDragDropHooks
thods allowdrop() tells gecko whether a drop is allowed on this content area. boolean allowdrop( in nsidomevent event, in nsidragsession session ); parameters event the dom event (drag gesture). session the drag session from which client can get the flavors present or the actual data. return value true indicates to the operating system that if a drop does happen on this browser, it will be
accepted. otherwise, false to indicates to the operating system that drop is not allowed. on win32, this will change the cursor to "reject". allowstartdrag() prevents the drag from starting. boolean allowstartdrag( in nsidomevent event ); parameters event the dom event (drag gesture). return value true if the drag can proceed. otherwise, false to show the drag is canceled (does not go to operating ...
nsICookie
ring the path pertaining to the cookie. read only. policy nscookiepolicy holds the sites compact policy value. read only. status nscookiestatus holds the p3p status of cookie. read only. value acstring the cookie value. read only. constants constant value description status_unknown 0 the cookie collected in a previous session, and its information no longer exists. available status_
accepted 1 the cookie was
accepted. status_downgraded 2 the cookie was
accepted but downgraded to a session cookie. status_flagged 3 the cookie was not
accepted. status_rejected 4 the cookie was rejected. policy_unknown 0 the cookie collected in a previous session, and its information no longer available. policy_none 1 the site did not send a compact policy along with the cookie. policy_no_c...
nsICookieManager
annot be found, no exception is thrown. typically, the arguments to this method will be obtained directly from the desired nsicookie object. void remove( in autf8string ahost, in acstring aname, in autf8string apath, in boolean ablocked, in jsval aoriginattributes ); parameters ahost the host or domain for which the cookie was set. see nsicookiemanager2.add() for a description of
acceptable host strings. if the target cookie is a domain cookie, a leading dot must be present. aname the name specified in the cookie. apath the path for which the cookie was set. ablocked indicates if cookies from this host should be permanently blocked. aoriginattributes the originattributes of this cookie. removeall() this method is called to remove all cookies from the cookie list. voi...
nsIDOMGeoPositionCallback
dom/interfaces/geolocation/nsidomgeopositioncallback.idlscriptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void handleevent(in nsidomgeoposition position); methods handleevent() called when new position information is available. ...
nsIDOMWindowUtils
different types. note: this method cannot be called from unprivileged content; that is, it's not accessible from web content. it will throw a dom security error if called without universalxpconnect privileges. the event is dispatched via the top-level window, so it could go to any window under that top level. in some cases, it may not even reach the target window, if one of those other windows
accepts it. boolean sendtouchevent( in astring atype, [array, size_is(count)] in pruint32 aidentifiers, [array, size_is(count)] in print32 axs, [array, size_is(count)] in print32 ays, [array, size_is(count)] in pruint32 arxs, [array, size_is(count)] in pruint32 arys, [array, size_is(count)] in float arotationangles, [array, size_is(count)] in float aforces, in pruint32 count, in lon...
getFile
rresponding for a given standard path location. the individual platform implementation of nsidirectoryserviceprovider maps the symbolic path location passed to this function and returns the appropriate nsifile. nsifile getfile( in string aname, out boolean apersistent ); parameters aname [in] the symbolic name for a file or directory location. see symbolic names below for a list of
accepted values. xpcom file system aliases apersistent [out] this output parameter indicates to the caller whether or not the returned location is persistent. if true, this lets the directory service cache results to improve the performance of directory lookups. if false, then the directory service will not cache the results of this method. symbolic names the list of symbolic names is subject...
nsIFaviconService
in gecko 22.0. you should use the new async api moziasyncfavicons.replacefavicondatafromdataurl() instead. this method stores the data of a given favicon. the data is provided using a data url string. this function tries to optimize the favicon size; if it's bigger than a defined limit, gecko attempts to convert it to a 16x16 pixel png image. if that fails and the image is bigger than a maximum
acceptable favicon size, the entire operation fails and the favicon isn't saved. it is best to set the favicon data, and then associate it with a page. this will make the notifications more efficient since the icon will already have data when the set favicon observer messages goes out. the expiration time is stored. this will be used if you call setandloadfaviconforpage() to see whether the data needs r...
nsIFocusManager
e aflags return value the element that was focused. setfocus() changes the focused element reference within the window containing aelement to aelement. void setfocus( in nsidomelement aelement, in unsigned long aflags ); parameters aelement aflags native code only!windowhidden called when a document in a window has been hidden or otherwise can no longer
accept focus. void windowhidden( in nsidomwindow awindow ); parameters awindow native code only!windowlowered called when a window has been lowered. void windowlowered( in nsidomwindow awindow ); parameters awindow native code only!windowraised called when a window has been raised. void windowraised( in nsidomwindow awindow ); parameters awindow native code o...
Building an Account Manager Extension
we are required to include a property named prefpanel-devmo-account. prefpanel-devmo-account=devmo demo panel step4: the new panel and javascript the javascript for an account manager panel needs to implement at least the following functions. these functions are invoked by the account manager. function onpreinit(account, accountvalues) { } function oninit(pageid, serverid) { } function on
accepteditor() { } function onsave() { } function updatepage() {} step5: putting it all together // todo build an demo extension for this tutorial... how to build an xpcom component in javascript ...
nsIObserver
ce.removeobserver(this, "mytopicid"); } } instantiation - this should be fired once you're ready to start observing (for example a window's load event). observer = new myobserver(); destruction - this should be fired once you're done observing (for example a window's unload event). failure to do so may result in memory leaks. observer.unregister(); "get everything" - note that "*" is an
acceptable value (be careful with this, because it observes many events, and can degrade performance). observer.register("*"); see also nsiobserverservice observer_notifications ...
nsIOutputStream
lock the calling thread for an indeterminate amount of time. this exception may only be thrown if isnonblocking() returns true. isnonblocking() note: writing to a blocking output stream will block the calling thread until all given data can be consumed by the stream. note: a non-blocking output stream may implement nsiasyncoutputstream to provide consumers with a way to wait for the stream to
accept more data once its write() method is unable to
accept any data without blocking. boolean isnonblocking(); parameters none. return value true if stream is non-blocking. exceptions thrown ns_base_stream_would_block a non-blocking stream may throw this exception when written to if space for the data is not immediately available. write() this method copies data from a buffer into the st...
nsIPromptService
selects the standard set of ok/cancel buttons. (button_title_ok *button_pos_0) +(button_title_cancel * button_pos_1) std_yes_no_buttons 1027 selects the standard set of yes/no buttons. (button_title_yes *button_pos_0) +(button_title_no * button_pos_1) methods alert() alert shows an alert dialog with an ok button. it works the same way as window.alert, but
accepts a title for the dialog. you should use this method instead of window.alert in chrome code. void alert( in nsidomwindow aparent, in wstring adialogtitle, in wstring atext ); parameters aparent the parent window for the dialog, or null, in which case the parent window will be nsiwindowwatcher.activewindow. adialogtitle text to appear in the title of the dialog. atext ...
nsISupports proxies
print32 proxytype, void * *result); ns_imethod getproxy(nsieventqueue *destqueue, const nsiid & cid, nsisupports *aouter, const nsiid & iid, print32 proxytype, void * *result); the two apis are essentially the same. the only difference is that the first
accepts a created object object, and the latter will create an object for you. this creation will happen off the destination's event queue. for instance, if you need to not only use an object remotely, but also have it created remotely, use the second api. the iid that you are requesting must be in the typelib. these means that you should have had to create and idl for it and have generated a typelib. ...
nsITaskbarPreviewController
h ÷ height will equal the thumbnailaspectratio, within the margin of rounding errors. return value true if you want a frame drawn around the thumbnail, otherwise false. onactivate() invoked when the user clicks on the tab preview. boolean onactivate(); parameters none. return value true if the top level window corresponding to the preview should be activated, false if activation is not
accepted. onclick() invoked when one of the buttons on the window preview's toolbar is clicked by the user. void onclick( in nsitaskbarpreviewbutton button ); parameters button an nsitaskbarpreviewbutton object representing the button that was pressed. this can be compared to the buttons returned by the nsitaskbarwindowpreview.getbutton(). onclose() invoked when the user presses the close ...
nsITransferable
ablecanexport() returns a list of flavors (mime types as nsisupportscstring) that the transferable can export, either through intrinsic knowledge or output data converters. nsisupportsarray flavorstransferablecanexport(); parameters none. return value missing description flavorstransferablecanimport() computes a list of flavors (mime types as nsisupportscstring) that the transferable can
accept into it, either through intrinsic knowledge or input data converters. nsisupportsarray flavorstransferablecanimport(); parameters none. return value missing description getanytransferdata() returns the best flavor in the transferable, given those that have been added to it with adddataflavor(). void getanytransferdata( out string aflavor, out nsisupports adata, out unsigned long ad...
nsITransport
the stream is closed. if this flag is not specified, then the stream has non-blocking stream semantics. this means that if the stream is full and is not closed, then writing to it returns ns_base_stream_would_block. in addition, in non- blocking mode, the stream is guaranteed to support nsiasyncoutputstream. this interface allows the consumer of the stream to be notified when the stream can again
accept more data. open_unbuffered if specified, the resulting stream may not support writesegments and writefrom. writesegments and writefrom are only guaranteed to be implemented when this flag is not specified. asegmentsize if open_unbuffered is not set, then this parameter specifies the size of each buffer segment (pass 0 to use default value). asegmentcount if open_unbuffered is not set, then this ...
nsIWebBrowserChrome
he window modal (that is, currently executing a modal loop)? boolean iswindowmodal(); parameters none. return value true if it's a modal window. setstatus() called when the status text in the chrome needs to be updated. void setstatus( in unsigned long statustype, in wstring status ); parameters statustype indicates what is setting the text. status status string. null is an
acceptable value meaning no status. showasmodal() shows the window as a modal window. void showasmodal(); parameters none. return value note: the function error code returned by this corresponds to the status value specified in exitmodaleventloop. sizebrowserto() tells the chrome to size itself such that the browser will be the specified size. void sizebrowserto( in long acx, in long acy ); param...
nsIWebBrowserChrome2
be updated. this method may be called instead of nsiwebbrowserchrome.setstatus(). an implementor of this method, should still implement nsiwebbrowserchrome.setstatus(). void setstatuswithcontext( in unsigned long statustype, in astring statustext, in nsisupports statuscontext ); parameters statustype indicates what is setting the text. statustext status string. null is an
acceptable value meaning no status. statuscontext an object that provides context pertaining to the status type. if statustype is status_link, then this may be a dom node corresponding to the source of the link. this value can be null if there is no context. see also nsiwebbrowserchrome ...
nsIWebBrowserPersist
a, in string aextraheaders, in nsisupports afile, in boolean aisprivate); attributes attribute type description currentstate unsigned long current state of the persister object. read only. persistflags unsigned long flags governing how data is fetched and saved from the network. it is best to set this value explicitly unless you are prepared to
accept the default values. progresslistener nsiwebprogresslistener callback listener for progress notifications. the object that the embbedder supplies may also implement nsiinterfacerequestor and be prepared to return nsiauthprompt or other interfaces that may be required to download data. result unsigned long value indicating the success or failure of the persist operatio...
nsIWebSocketChannel
e_going_away the endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection. 1002 close_protocol_error the endpoint is terminating the connection due to a protocol error. 1003 close_unsupported the connection is being terminated because the endpoint received data of a type it cannot
accept (for example, a text-only endpoint received binary data). 1004 close_too_large the endpoint is terminating the connection because a data frame was received that is too large. 1005 close_no_status reserved. indicates that no status code was provided even though one was expected. 1006 close_abnormal reserved. used to indicate that a connection was close...
XPCOM Interface Reference
ernsiconsolelistenernsiconsolemessagensiconsoleservicensicontainerboxobjectnsicontentframemessagemanagernsicontentprefnsicontentprefcallback2nsicontentprefobservernsicontentprefservicensicontentprefservice2nsicontentsecuritypolicynsicontentsniffernsicontentviewnsicontentviewmanagernsicontentviewernsicontrollernsicontrollersnsiconverterinputstreamnsiconverteroutputstreamnsicookiensicookie2nsicookie
acceptdialognsicookieconsentnsicookiemanagernsicookiemanager2nsicookiepermissionnsicookiepromptservicensicookieservicensicookiestoragensicrashreporternsicryptohmacnsicryptohashnsicurrentcharsetlistenernsicyclecollectorlistenernsidbchangelistenernsidbfolderinfonsidnslistenernsidnsrecordnsidnsrequestnsidnsservicensidomcanvasrenderingcontext2dnsidomchromewindownsidomclientrectnsidomdesktopnotificationnsido...
XPCOM Interface Reference by grouping
oxyservice nsiproxyinfo preferences nsiiniparser nsiiniparserfactory nsiprefbranch nsiprefbranch2 nsipreflocalizedstring nsiprefservice nsistringbundle nsistringbundleservice security cookies nsicookie nsicookie2 nsicookie
acceptdialog nsicookieconsent nsicookiemanager nsicookiemanager2 nsicookiepermission nsicookiepromptservice nsicookieservice nsicookiestorage nsisessionstore crypto nsicryptohash filter nsiparentalcontrolsservice ...
Getting Started Guide
herwise harmful, and has the same impact as passing an nscomptr by value if the caller only supplied a raw pointer. void f( nscomptr<t>* ) avoid passing an nscomptr by address, if possible this practice requires callers to have an nscomptr, and requires them to do a little extra work, as operator& for nscomptrs is private (to help prevent leaks caused by casting; also see bug 59414). this is an
acceptable way to declare `in/out' parameters, but prefer passing nscomptrs by reference, as below. // passing an |nscomptr| by pointer requires extra work... void f( nscomptr<nsifoo>* ); // ... nscomptr<nsifoo> myfoo = ...; f( address_of(myfoo) ); void f( nscomptr<t>& ) do pass an nscomptr by reference for `in/out' parameters this is the prefered scheme for providing `in/...
Using the clipboard
then we use gettransferdata to retrieve the data from the transferable. we specify the flavor we would like to get. the data will be converted if it is not available in the desired flavor, and a conversion from an available flavor is possible. if you originally copied data of multiple flavors onto the clipboard, you can retrieve the data in the best format necessary. for example, a textbox would
accept "text/unicode" (or "text/plain") while a composer window might
accept html and image data. the variable str now holds the data from the clipboard. we need to convert the data back into a javascript string from an xpcom object. the code below can be used for this purpose: if (str) { var pastetext = str.value.queryinterface(ci.nsisupportsstring).data; } because the data from the transferable i...
Autoconfiguration in Thunderbird
ss=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. domain hoster if you are an isp that hosts domains for your customers - for example, you are hoster.com and your customer registers fancy.com or example.com, and your servers
accept and serve the mail for example.com -, you should set up an autoconfig server. dns for each customer domain, you add a dns record (in addition to the existing mx, a www etc. dns records): autoconfig in a 10.2.3.4 or autoconfig in cname autoconfig.hoster.com. ... where 10.2.3.4 and autoconfig.hoster.com are ip addresses / hostnames you own. this allows thunderbird to find you as hoster. to ...
Thunderbird Binaries
the very latest bleeding-edge changes and updates. the trunk can be very unstable at times, so it's good to ask around before using trunk builds. what is a branch? branches are "forks" in the code, split from the trunk and destined to become end-user releases. at conception, a branch contains everything that the trunk contains, but from that point onwards, only certain fixes or changes will be
accepted. therefore, over time, the branch becomes more stable. why branch? wouldn't it be better to have everyone working towards a release? many developers prefer to work on areas of the code which are too risky to change when approaching a release. some of their changes may also take months to test and implement correctly. their changes will be made to the trunk so that they don't delay the release...
Working with windows in chrome code
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 the new window will not affect the calling code. example 5: using nsiwindowwatcher for passing an arbri...
Using js-ctypes
tring itself. note that this only works correctly if the string is in fact under 256 characters; if it's longer, this will fail spectacularly. in line 9, the carbon library is loaded from the system's carbon framework. line 11 declares the stdalert() function, which will call the carbon standardalert routine. it uses the default abi, returns a 16-bit integer (which is a carbon oserr value), and
accepts an integer (the alert type), two strings, a pointer to a parameter block, which we aren't using, and another integer, which is used to return the hit item. see apple's documentation for standardalert for details. after that, we simply set up our parameters by using makestr() to generate the two str255 strings we need, then call stdalert(), which produces the following alert window: the last ...
Gecko Plugin API Reference - Plugins
a plug-in is windowless invalidating the drawing area forcing a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless plug-ins streams 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...
Accessibility Inspector - Firefox Developer Tools
e contrast is not sufficient, readers with visual impairments such as low vision or color blindness will be unable to read the text. see color contrast for details about recommended contrast ratios. for example: the color contrast in the image above is 2.86, so potentially not enough contrast to make it easy to read. notice the warning symbol that indicates that the contrast fails to meet the
acceptable contrast ratio. as of firefox 65, viewing this information for some foreground text that has a complex background image (e.g. a gradient) gives you a range of color contrast values. for example: in this example, the contrast ranges from 4.72 to 5.98. the numbers are followed by aaa and a checkmark in green, indicating that the large text has a contrast ratio of 4.5:1 or more, meeting the ...
Debugger.Object - Firefox Developer Tools
erties, reporting events by callinghandler's methods. any previous watchpoint handler on this debugger.object instance is replaced. ifhandler is null, the referent is no longer watched.handler may have the following methods, called under the given circumstances: add(frame,name,descriptor) a property namedname has been added to the referent.descriptor is a property descriptor of the sort
accepted by debugger.object.prototype.defineproperty, giving the newly added property's attributes. delete(frame,name) the property namedname is about to be deleted from the referent. change(frame,name,olddescriptor,newdescriptor) the existing property namedname on the referent is being changed from those given byolddescriptor to those given bynewdescriptor. this handler method is on...
Examine and edit CSS - Firefox Developer Tools
in the rules view you can edit it and see the results immediately. you can also tab through the different existing properties and values, and start editing them by pressing enter or space. to add a new declaration to a rule, click on the last line of the rule (the line occupied by the closing brace). as you start typing a property name, you'll see a list of autocomplete suggestions. press tab to
accept the current suggestion or up and down to move through the list. the default choice is the most common property that starts with the letters you've typed. for example, here the user has typed "c" and the default choice is "color": if you enter an invalid value for a property when editing it, or an unknown property name, a yellow alert icon appears besides the declaration. edits that you make i...
Frame rate - Firefox Developer Tools
ent triggers some javascript that changes the element's appearance, and that triggers a reflow and a repaint, then all this work needs to be completed in that frame. if it takes too long for the browser to process the frame, then the browser will appear momentarily unresponsive (janky). similarly, if scrolling through a page involves a lot of complex page updates and the browser can't keep up an
acceptable frame rate, scrolling the page will appear sluggish or will occasionally freeze. in general, a high and consistent frame rate will make the user's interaction with the site more enjoyable and engaging. a frame rate of 60fps is reckoned to be the target for smooth performance, giving you a time budget of 16.7ms for all the updates that need to be made synchronously in response to some event...
Animating CSS properties - Firefox Developer Tools
out" but is also sometimes called "reflow". paint: finally, the browser needs to repaint the elements to the screen. one last step is not shown in this sequence: the page may be split into layers, which are painted independently and then combined in a process called "composition". this sequence needs to fit into a single frame, since the screen isn't updated until it is complete. it's commonly
accepted that 60 frames per second is the rate at which animations will appear smooth. for a rate of 60 frames per second, that gives the browser 16.7 milliseconds to execute the complete flow. css property cost in the context of the rendering waterfall, some properties are more expensive than others: property type cost examples properties that affect an element's geometry...
Waterfall - Firefox Developer Tools
out" but is also sometimes called "reflow". paint: finally, the browser needs to repaint the elements to the screen. one last step is not shown in this sequence: the page may be split into layers, which are painted independently and then combined in a process called "composition". this sequence needs to fit into a single frame, since the screen isn't updated until it is complete. it's commonly
accepted that 60 frames per second is the rate at which animations will appear smooth. for a rate of 60 frames per second, that gives the browser 16.7 milliseconds to execute the complete flow. importantly for responsiveness, the browser doesn't always have to go through every step: css animations update the page without having to run any javascript. not all css property changes cause a reflow. cha...
Web Console Helpers - Firefox Developer Tools
g", "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.queryselector to locate the iframe element the iframe element itself the content window inside the iframe see working with iframes. clear() clears the console output area. clearhistory() just like a normal command line, the console comm...
about:debugging (before Firefox 68) - Firefox Developer Tools
ns connecting the add-on debugger the add-ons page in about:debugging lists all restartless add-ons that are currently installed (note that this list may include add-ons that came preinstalled with your firefox). next to each entry is a button labeled "debug". if the "debug" button is disabled, check the "enable add-on debugging" box. if you click "debug", you'll see a dialog asking you to
accept an incoming connection. click "ok", and the add-on debugger will start in a separate window. note that sometimes the debugger window is hidden by the main firefox window. see the page on the add-on debugger for all the things you can do with this tool. the "enable add-on debugging" button works by turning on the devtools.chrome.enabled and devtools.debugger.remote-enabled preferences. both p...
about:debugging - Firefox Developer Tools
the link between your android device and your computer is not authorized yet. first make sure you have installed android debug bridge from android tools on your computer in order for it to be able to connect to your device. next, disable every debugging setting already activated and repeat the steps described before. your device should show a popup to authorize your computer to connect to it —
accept this and then click the refresh devices button again. the device should appear. note: you do not need to install the full android studio sdk. only adb is needed. to start a debugging session, first open the page that you wish to debug and then click connect next to the device name to open a connection to it. if the connection was successful, you can now click the name of the device to switch ...
ANGLE_instanced_arrays.drawArraysInstancedANGLE() - Web APIs
iangle_strip gl.triangle_fan gl.triangles: draws a triangle for a group of three vertices. first a glint specifying the starting index in the array of vector points. count a glsizei specifying the number of indices to be rendered. primcount a glsizei specifying the number of instances of the range of elements to execute. return value none. exceptions if mode is not one of the
accepted values, a gl.invalid_enum error is thrown. if first, count or primcount are negative, a gl.invalid_value error is thrown. if gl.current_program is null, a gl.invalid_operation error is thrown. examples var ext = gl.getextension('angle_instanced_arrays'); ext.drawarraysinstancedangle(gl.points, 0, 8, 4); specifications specification status comment angle_instanced_...
ANGLE_instanced_arrays.drawElementsInstancedANGLE() - Web APIs
nsigned_byte gl.unsigned_short when using the oes_element_index_uint extension: gl.unsigned_int offset a glintptr specifying an offset in the element array buffer. must be a valid multiple of the size of the given type. primcount a glsizei specifying the number of instances of the set of elements to execute. return value none. exceptions if mode is not one of the
accepted values, a gl.invalid_enum error is thrown. if offset is a invalid multiple of the size of the given type, a gl.invalid_operation error is thrown. if count or primcount are negative, a gl.invalid_value error is thrown. examples var ext = gl.getextension('angle_instanced_arrays'); ext.drawelementsinstancedangle(gl.points, 2, gl.unsigned_short, 0, 4); specifications specification ...
AddressErrors - Web APIs
. the contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. usage notes keep in mind that some violation errors may be outside the ability of the user to fix. try to avoid asking the user to make corrections to things they can't change, and there may be situations in which you need to allow validation errors to be
accepted anyway (for example, if you validate addresses against a postal service database and a new home has been built and its address is not yet in the database). examples snippet: limiting destination countries this first example is just a snippet showing an implementation of the event handler for the shippingaddresschange event which checks to be sure the chosen address is located within one of a...
AesGcmParams - Web APIs
number. this determines the size in bits of the authentication tag generated in the encryption operation and used for authentication in the corresponding decryption. according to the web crypto specification this must have one of the following values: 32, 64, 96, 104, 112, 120, or 128. the aes-gcm specification recommends that it should be 96, 104, 112, 120 or 128, although 32 or 64 bits may be
acceptable in some applications: appendix c of the specification provides additional guidance here. taglength is optional and defaults to 128 if it is not specified. examples see the examples for subtlecrypto.encrypt() and subtlecrypto.decrypt(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.aesgcmparams' in that specific...
AudioBuffer.copyFromChannel() - Web APIs
mber the channel number of the current audiobuffer to copy the channel data from. startinchannel optional an optional offset into the source channel's buffer from which to begin copying samples. if not specified, a value of 0 (the beginning of the buffer) is assumed by default. return value undefined. exceptions indexsizeerror one of the input parameters has a value that is outside the
accepted range: the value of channelnumber specifies a channel number which doesn't exist (that is, it's greater than or equal to the value of numberofchannels on the channel). the value of startinchannel is outside the current range of samples that already exist in the source buffer; that is, it's greater than its current length. example this example creates a new audio buffer, then copies...
AudioContextLatencyCategory - Web APIs
by using these strings rather than a numeric value when specifying a latency to a audiocontext, you can allow the user agent to select an appropriate latency for your use case that makes sense on the device on which your content is being used. audiocontextlatencycategory can be used when constructing a new audiocontext by passing one of these values as the latencyhint option in the audiocontext() constructor's options dictionary. ...
AudioNode.disconnect() - Web APIs
audionode interface lets you disconnect one or more nodes from the node on which the method is called. syntax audionode.disconnect(); audionode.disconnect(output); audionode.disconnect(destination); audionode.disconnect(destination, output); audionode.disconnect(destination, output, input); return value undefined parameters there are several versions of the disconnect() method, which
accept different combinations of parameters to control which nodes to disconnect from. if no parameters are provided, all outgoing connections are disconnected. destination optional an audionode or audioparam specifying the node or nodes to disconnect from. if this value is an audionode, a single node is disconnected from, with any other, optional, parameters (output and/or input) further limiting w...
AudioTrackList.onaddtrack - Web APIs
has been added to the media element whose audio tracks the audiotracklist represents. the event is passed into the event handler in the form of a trackevent object, whose track property identifies the newly-added track. note: you can also add a handler for the addtrack event using addeventlistener(). syntax audiotracklist.onaddtrack = eventhandler; value set onaddtrack to a function that
accepts as input a trackevent object which indicates in its track property which audio track has been added to the media. usage notes the addtrack event is called whenever a new track is added to the media element whose audio tracks are represented by the audiotracklist object. this happens when tracks are added to the element when the media is first attached to the element; one addtrack event will oc...
AudioTrackList.onremovetrack - Web APIs
re also from the audiotracklist. the event is passed into the event handler in the form of a trackevent object, whose track property identifies the track that was removed from the media element's audiotracklist. note: you can also add a handler for the removetrack event using addeventlistener(). syntax audiotracklist.onremovetrack = eventhandler; value set onremovetrack to a function that
accepts as input a trackevent object which indicates in its track property which audio track has been removed from the media element. example this simple example just fetches the current number of audio tracks in the media element whenever a track is removed from the media element. document.queryselector("my-video").audiotracks.onremovetrack = function(event) { mytrackcount = document.queryselector...
Blob - Web APIs
terface is based on blob, inheriting blob functionality and expanding it to support files on the user's system. using blobs to construct a blob from other non-blob objects and data, use the blob() constructor. to create a blob that contains a subset of another blob's data, use the slice() method. to obtain a blob object for a file on the user's file system, see the file documentation. the apis
accepting blob objects are also listed in the file documentation. constructor blob() returns a newly created blob object which contains a concatenation of all of the data in the array passed into the constructor. instance properties blob.prototype.size read only the size, in bytes, of the data contained in the blob object. blob.prototype.type read only a string indicating the mime type of...
Bluetooth.requestDevice() - Web APIs
luetoothdevice) { ... }) returns a promise to a bluetoothdevice object. parameters options optional an object that sets options for the device request. the available options are: filters[]: an array of bluetoothscanfilters. this filter consists of an array of bluetoothserviceuuids, a name parameter, and a nameprefix parameter. optionalservices[]: an array of bluetoothserviceuuids.
acceptalldevices: a boolean indicating that the requesting script can
accept all bluetooth devices. the default is false. exceptions typeerror the provided options do not makes sense. for example, options.filters is present and options.
acceptalldevices is true, or if options.filters is not present and options.
acceptalldevices is false. or options.filters is []. notfounderror there is no blue...
Body.arrayBuffer() - Web APIs
function readfile(file) { return new response(file).arraybuffer(); } <input type="file" onchange="readfile(this.files[0])"> specifications specification status comment fetchthe definition of 'arraybuffer()' in that specification. living standard ...
CSSPrimitiveValue.setFloatValue() - Web APIs
syntax cssprimitivevalue.setfloatvalue(unittype, floatvalue); parameters unittype an unsigned short representing the code for the unit type, in which the value should be returned. valid values are: constant description css_cm the value is a <length> in centimeters. css_deg the value is an <angle> in degrees. ...
CSSPrimitiveValue.setStringValue() - Web APIs
syntax cssprimitivevalue.setstringvalue(stringtype, stringvalue); parameters stringtype an unsigned short representing the type of the value. possible values are: constant description css_attr the value is an attr() function. css_ident the value is an identifier. css_string the value is a <string>. css_uri the value is a <uri>. ...
CSSPrimitiveValue - Web APIs
is raised. modification to the corresponding style property can be achieved using the rect interface. cssprimitivevalue.getstringvalue() this method is used to get the string value. if the css value doesn't contain a string value, a domexception is raised. cssprimitivevalue.setfloatvalue() a method to set the float value with a specified unit. if the property attached with this value can not
accept the specified unit or the float value, the value will be unchanged and a domexception will be raised. cssprimitivevalue.setstringvalue() a method to set the string value with the specified unit. if the property attached to this value can't
accept the specified unit or the string value, the value will be unchanged and a domexception will be raised. specifications specification sta...
CSSStyleDeclaration.setProperty() - Web APIs
phen case) to be modified. value optional is a domstring containing the new property value. if not specified, treated as the empty string. note: value must not contain "!important" -- that should be set using the priority parameter. priority optional is a domstring allowing the "important" css priority to be set. if not specified, treated as the empty string. the following values are
accepted: string value "important" keyword undefined string empty value "" return value undefined exceptions domexception (nomodificationallowederror): if the property or declaration block is read only. if priority can be omitted, javascript has a special simpler syntax for setting a css property on a style declaration object: style.csspropertyname = 'value'; examples in ...
Managing screen orientation - Web APIs
rientation property. screen.addeventlistener("orientationchange", function () { console.log("the orientation of the screen is: " + screen.orientation); }); preventing orientation change any web application can lock the screen to suits its own needs. the screen is locked using the screen.lockorientation() method and unlocked using the screen.unlockorientation(). the screen.lockorientation()
accepts a string (or series of strings) to define the kind of lock to apply.
accepted values are: portrait-primary, portrait-secondary, landscape-primary, landscape-secondary, portrait, landscape (see screen.lockorientation to know more about each of those values). screen.lockorientation('landscape'); note: a screen lock is web application dependent. if application a is locked to landscape and appli...
Using the CSS Painting API - Web APIs
10) + 10, y ); ctx.lineto( (blockwidth) + (start * 10) + 20, y ); ctx.lineto( (blockwidth) + (start * 10) + 20 + (highlightheight), highlightheight ); ctx.lineto( (blockwidth) + (start * 10) + 10 + (highlightheight), highlightheight ); ctx.lineto( (blockwidth) + (start * 10) + 10, y ); ctx.closepath(); ctx.fill(); } } // paint }); we can then create a little html that will
accept this image as backgrounds: <h1 class="fancy">largest header</h1> <h3 class="fancy">medium size header</h3> <h6 class="fancy">smallest header</h6> we give each header a different value for the --highcolour custom property .fancy { background-image: paint(headerhighlight); } h1 { --highcolour: hsla(155, 90%, 60%, 0.7); } h3 { --highcolour: hsla(255, 90%, 60%, 0.5); } h6 { --highcolour: hsla(35...
Cache.match() - Web APIs
by the browser as if there were no service worker involvement. if fetch() returns a valid http response 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. ...
CanvasRenderingContext2D.setTransform() - Web APIs
e: see also the transform() method; instead of overriding the current transform matrix, it multiplies it with a given one. syntax ctx.settransform(a, b, c, d, e, f); ctx.settransform(matrix); the transformation matrix is described by: [acebdf001]\left[ \begin{array}{ccc} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{array} \right] parameters settransform() has two types of parameter that it can
accept. the older type consists of several parameters representing the individual components of the transformation matrix to set: a (m11) horizontal scaling. a value of 1 results in no scaling. b (m12) vertical skewing. c (m21) horizontal skewing. d (m22) vertical scaling. a value of 1 results in no scaling. e (dx) horizontal translation (moving). f (dy) vertical translation (moving). th...
Drawing shapes with canvas - Web APIs
you want to build objects from several components, for example. path2d.addpath(path [, transform]) adds a path to the current path with an optional transformation matrix. path2d example in this example, we are creating a rectangle and a circle. both are stored as a path2d object, so that they are available for later usage. with the new path2d api, several methods got updated to optionally
accept a path2d object to use instead of the current path. here, stroke and fill are used with a path argument to draw both objects onto the canvas, for example. <html> <body onload="draw();"> <canvas id="canvas" width="130" height="100"></canvas> </body> </html> function draw() { var canvas = document.getelementbyid('canvas'); if (canvas.getcontext) { var ctx = canvas.getcontext('2d')...
CloseEvent() - Web APIs
optional and defaulting to false, of type long, indicates if the connection has been closed cleanly or not. "code", optional and defaulting to 0, of type unsigned short, that is the connection close code sent by the server. "reason", optional and defaulting to '', of type domstring, that is a human-readable reason why the server closed the connection. the closeeventinit dictionary also
accepts fields from the eventinit dictionary. specifications specification status comment html living standardthe definition of 'closeevent()' in that specification. living standard initial definition. ...
CloseEvent - Web APIs
ing away the endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection. 1002 protocol error the endpoint is terminating the connection due to a protocol error. 1003 unsupported data the connection is being terminated because the endpoint received data of a type it cannot
accept (for example, a text-only endpoint received binary data). 1004 reserved. a meaning might be defined in the future. 1005 no status received reserved. indicates that no status code was provided even though one was expected. 1006 abnormal closure reserved. used to indicate that a connection was closed abnormally (that is, with no close fr...
CompositionEvent.CompositionEvent() - Web APIs
rg is a domstring representing the name of the event. compositioneventinit optional a compositioneventinit dictionary object, which can contain the following members: data initializes the data attribute of the compositionevent object to the characters generated by the ime composition. note: the compositioneventinit dictionary inherits from the uieventinit dictionary, so can also
accept members defined on there. specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'compositionevent()' in that specification. obsolete initial definition. ...
console - Web APIs
the logging method, like this: var car = "dodge charger"; var someobject = { str: "some text", id: 5 }; console.info("my first car was a", car, ". the object is:", someobject); this output will look like this: [09:28:22.711] my first car was a dodge charger . the object is: ({str:"some text", id:5}) using string substitutions when passing a string to one of the console object's methods that
accepts a string (such as log()), you may use these substitution strings: %o or %o outputs a javascript object. clicking the object name opens more information about it in the inspector. %d or %i outputs an integer. number formatting is supported, for example console.log("foo %.2d", 1.1) will output the number as two significant figures with a leading 0: foo 01 %s outputs a string. %f outputs...
ConstrainDouble - Web APIs
he user agent does its best to match the value once all other more stringent constraints are met. properties if the value of a constraindouble is an object rather than a number, it may have the properties below in addition the properties it inherits from doublerange. exact a double-precision floating-point number specifying a specific, required, value the property must have to be considered
acceptable. ideal a double-precision floating-point number specifying a value the property would ideally have, but which can be considered optional if necessary to find a match. specifications specification status comment media capture and streamsthe definition of 'constraindouble' in that specification. candidate recommendation initial definition technically, ...
ConstrainULong - Web APIs
g integer value, in which case the user agent does its best to match the value once all other more stringent constraints are met. properties if the value of a constrainulong is an object rather than a number, it may have the properties below in addition to the properties it inherits from ulongrange. exact an integer specifying precise, required, value the property must have to be considered
acceptable. ideal an integer specifying a value the property would ideally have, but which can be considered optional if necessary to find a match. specifications specification status comment media capture and streamsthe definition of 'constrainulong' in that specification. candidate recommendation initial definition technically, constrainulong is actually base...
CustomEvent() - Web APIs
le in web workers. syntax event = new customevent(typearg, customeventinit); parameters typearg a domstring representing the name of the event. customeventinit optional a customeventinit dictionary, having the following fields: "detail", optional and defaulting to null, of type any, that is an event-dependent value associated with the event. the customeventinit dictionary also
accepts fields from the eventinit dictionary. return value a new customevent object of the specified type, with any other properties configured according to the customeventinit dictionary (if one was provided). example // add an appropriate event listener obj.addeventlistener("cat", function(e) { process(e.detail) }); // create and dispatch the event var event = new customevent("cat", { deta...
DOMHighResTimeStamp - Web APIs
ent is the first one loaded in the window, the time origin is the time at which the browser context was created. if during the process of unloading the previous document which was loaded in the window, a confirmation dialog was displayed to let the user confirm whether or not to leave the previous page, the time origin is the time at which the user confirmed that navigating to the new page was
acceptable. if neither of the above determines the time origin, then the time origin is the time at which the navigation responsible for creating the window's current document took place. if the script's global object is a workerglobalscope (that is, the script is running as a web worker), the time origin is the moment at which the worker was created. in all other cases, the time origin is und...
DOMMatrixReadOnly.translate() - Web APIs
dommatrix.translate(translatex, translatey[, translatez]) parameters translatex a number representing the abscissa (x-coordinate) of the translating vector. translatey a number representing the ordinate (y-coordinate) of the translating vector. translatez optional a number representing the z component of the translating vector. if not supplied, this defaults to 0. ...
DOMPoint.DOMPoint() - Web APIs
syntax point = new dompoint(x, y, z, w); parameters x optional the x coordinate for the new dompoint. y optional the y coordinate for the new dompoint. z optional the z coordinate for the new dompoint. w optional the perspective value of the new dompoint. ...
DOMString - Web APIs
domstring is a utf-16 string. as javascript already uses such strings, domstring is mapped directly to a string. passing null to a method or parameter
accepting a domstring typically stringifies to "null". specifications specification status comment web idlthe definition of 'domstring' in that specification. candidate recommendation ...
DataTransferItem.getAsString() - Web APIs
back with the drag data item's string data as the argument if the item's kind is a plain unicode string (i.e. kind is string). syntax datatransferitem.getasstring(callback); parameters callback a callback function that has access to the data transfer item's string data. see callback below for details. return value undefined callback the callback parameter is a callback function which
accepts one parameter: domstring the drag data item's string data. the callback return value is undefined. example this example shows the use of the getasstring() method as an inline function in a drop event handler. function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'stri...
DedicatedWorkerGlobalScope.postMessage() - Web APIs
the data may be any value or javascript object handled by the structured clone algorithm, which includes cyclical references. the main scope that spawned the worker can send back information to the thread that spawned it using the worker.postmessage method. syntax postmessage(amessage, transferlist); parameters amessage the object to deliver to the main thread; this will be in the data field in the event delivered to the worker.onmessage handler. ...
Locating DOM elements using selectors - Web APIs
rall() is not live, which means that changes in the dom are not reflected in the collection. this is different from other dom querying methods that return live node lists. you may find examples and details by reading the documentation for the element.queryselector() and element.queryselectorall() methods, as well as in the article code snippets for queryselector. selectors the selector methods
accept one or more comma-separated selectors to determine what element or elements should be returned. for example, to select all paragraph (p) elements in a document whose css class is either warning or note, you can do the following: var special = document.queryselectorall( "p.warning, p.note" ); you can also query by id. for example: var el = document.queryselector( "#main, #basic, #exclamation" )...
EXT_color_buffer_float - Web APIs
ty: this extension is available to webgl 2 contexts only. for webgl 1, see the ext_color_buffer_half_float and webgl_color_buffer_float extensions. extended methods the following sized formats become color-renderable: gl.r16f, gl.rg16f, gl.rgba16f, gl.r32f, gl.rg32f, gl.rgba32f, gl.r11f_g11f_b10f. color-renderable means: the webglrenderingcontext.renderbufferstorage() method now
accepts these formats. framebuffers with attached textures of these formats may now be framebuffer_complete. examples gl must be a webgl2renderingcontext. this extension does not work in webgl 1 contexts. var ext = gl.getextension('ext_color_buffer_float'); gl.renderbufferstorage(gl.renderbuffer, gl.rgba16f, 256, 256); specifications specification status comment ext_colo...
EXT_color_buffer_half_float - Web APIs
ension implicitly enables this extension. constants ext.rgba16f_ext rgba 16-bit floating-point color-renderable format. ext.rgb16f_ext rgb 16-bit floating-point color-renderable format. ext.framebuffer_attachment_component_type_ext ? ext.unsigned_normalized_ext ? extended methods this extension extends webglrenderingcontext.renderbufferstorage(): the internalformat parameter now
accepts ext.rgba16f_ext and ext.rgba16f_ext. examples var ext = gl.getextension('ext_color_buffer_half_float'); gl.renderbufferstorage(gl.renderbuffer, ext.rbga16f_ext, 256, 256); specifications specification status comment ext_color_buffer_half_floatthe definition of 'ext_color_buffer_half_float' in that specification. recommendation initial definition. ...
EffectTiming.delay - Web APIs
the value of delay corresponds directly to effecttiming.delay in timing objects returned by animationeffectreadonly, keyframeeffectreadonly, and keyframeeffect. ...
EffectTiming.direction - Web APIs
the direction property of the web animations api dictionary effecttiming indicates an animation's playback direction along its timeline, as well as its behavior when it reaches the end of an iteration element.animate(), keyframeeffectreadonly(), and keyframeeffect() all
accept an object of timing properties including direction. the value of direction corresponds directly to animationeffecttimingreadonly.direction in timing objects returned by animationeffectreadonly, keyframeeffectreadonly, and keyframeeffect. syntax var timingproperties = { direction: "normal" | "reverse" | "alternate" | "alternate-reverse" }; timingproperties.direction = "normal" | "reverse" | "alternate" | "alternate-reverse"; value a domstring which specifies the direction in which the animation should ...
EffectTiming.duration - Web APIs
the duration property of the dictionary effecttiming in the web animations api specifies the duration in milliseconds that a single iteration (from beginning to end) the animation should take to complete. element.animate(), keyframeeffectreadonly(), and keyframeeffect() all
accept an object of timing properties including duration. the value of duration corresponds directly to animationeffecttimingreadonly.duration in timing objects returned by animationeffectreadonly, keyframeeffectreadonly, and keyframeeffect. syntax var timingproperties = { duration: durationinmilliseconds | "auto" }; timingproperties.duration = durationinmilliseconds | "auto"; value the number of milliseconds long a single beginning-to-end iteration of the animation should take. the default is "auto". th...
EffectTiming.endDelay - Web APIs
on, plus its end delay. this is useful for sequencing animations based on the end time of another animation; note, however, that many of the sequence effectst that will benefit most from this property have not been defined in the specification yet. for now, its main purpose is to represent the value of the svg min attribute. element.animate(), keyframeeffectreadonly(), and keyframeeffect() all
accept an object of timing properties including enddelay. the value of enddelay corresponds directly to animationeffecttimingreadonly.enddelay in timing objects returned by animationeffectreadonly, keyframeeffectreadonly, and keyframeeffect. syntax var timingproperties = { enddelay: delayinmilliseconds } timingproperties.enddelay = delayinmilliseconds; value a number representing the end delay,...
EffectTiming.fill - Web APIs
sures that once the animation's end time has been passed, the element will continue to be drawn in the state it was in at its last rendered frame. note that authors are discouraged from using fill modes to persist the effect of an animation indefinitely. see the alternatives to fill modes section below for approaches that are simpler and more performant. element.animate(), and keyframeeffect()
accept an object of timing properties including fill. the value of fill corresponds directly to fill in effecttiming objects returned by gettiming() in animationeffect and keyframeeffect. syntax var timingproperties = { fill: "none" | "forwards" | "backwards" | "both" | "auto" } value a domstring indicating the fill type to use in order to properly render an affected element when outside the ani...
EffectTiming.iterationStart - Web APIs
web animations api's effecttiming dictionary's iterationstart property specifies the repetition number which repetition the animation begins at and its progress through it. element.animate(), keyframeeffectreadonly.keyframeeffectreadonly(), and keyframeeffect.keyframeeffect() all
accept an object of timing properties including iterationstart. the value of iterationstart corresponds directly to animationeffecttimingreadonly.iterationstart in timing objects returned by animationeffectreadonly, keyframeeffectreadonly, and keyframeeffect. syntax var timingproperties = { iterationstart = iterationnumber }; timingproperties.iterationstart = iterationnumber; value a floating-point value whose value is at least 0 and is not +infinity, indicating the offset into the number of itera...
EffectTiming.iterations - Web APIs
ictionary effecttiming's iterations property specifies the number of times the animation should repeat. the default value is 1, indicating that it should only play once, but you can set it to any floating-point value (including positive infinity defaults to 1, and can also take a value of infinity to make it loop infinitely. element.animate(), keyframeeffectreadonly(), and keyframeeffect() all
accept an object of timing properties including iterations. the value of iterations corresponds directly to animationeffecttimingreadonly.iterations in timing objects returned by animationeffectreadonly, keyframeeffectreadonly, and keyframeeffect. syntax var timingproperties = { iterations: numberofiterations }; timingproperties.iterations = numberofiterations; value a floating-point value spec...
EffectTiming - Web APIs
(alternate), or runs backwards and switches direction after each iteration (alternate-reverse). defaults to "normal". duration optional the number of milliseconds each iteration of the animation takes to complete. defaults to 0. although this is technically optional, keep in mind that your animation will not run if this value is 0. easing optional the rate of the animation's change over time.
accepts the pre-defined values "linear", "ease", "ease-in", "ease-out", and "ease-in-out", or a custom "cubic-bezier" value like "cubic-bezier(0.42, 0, 0.58, 1)". defaults to "linear". enddelay optional the number of milliseconds to delay after the end of an animation. this is primarily of use when sequencing animations based on the end time of another animation. defaults to 0. fill optional dictat...
Element.animate() - Web APIs
(alternate), or runs backwards and switches direction after each iteration (alternate-reverse). defaults to "normal". duration optional the number of milliseconds each iteration of the animation takes to complete. defaults to 0. although this is technically optional, keep in mind that your animation will not run if this value is 0. easing optional the rate of the animation's change over time.
accepts the pre-defined values "linear", "ease", "ease-in", "ease-out", and "ease-in-out", or a custom "cubic-bezier" value like "cubic-bezier(0.42, 0, 0.58, 1)". defaults to "linear". enddelay optional the number of milliseconds to delay after the end of an animation. this is primarily of use when sequencing animations based on the end time of another animation. defaults to 0. fill optional dictat...
Event - Web APIs
ogrammatically, such as by calling the htmlelement.click() method of an element, or by defining the event, then sending it to a specified target using eventtarget.dispatchevent(). there are many types of events, some of which use other interfaces based on the main event interface. event itself contains the properties and methods which are common to all events. many dom elements can be set up to
accept (or "listen" for) these events, and execute code in response to process (or "handle") them. event-handlers are usually connected (or "attached") to various html elements (such as <button>, <div>, <span>, etc.) using eventtarget.addeventlistener(), and this generally replaces using the old html event handler attributes. further, when properly added, such handlers can also be disconnected if needed...
EventListener - Web APIs
this is shown in the example below. properties this interface neither implements, nor inherits, any properties. methods this interface doesn't inherit any methods. eventlistener.handleevent() a function that is called whenever an event of the specified type occurs. ...
EventTarget.addEventListener() - Web APIs
dd-ons, as well as the browser itself. return value undefined usage notes the event listener callback the event listener can be specified as either a callback function or an object that implements eventlistener, whose handleevent() method serves as the callback function. the callback function itself has the same parameters and return value as the handleevent() method; that is, the callback
accepts a single parameter: an object based on event describing the event that has occurred, and it returns nothing. for example, an event handler callback that can be used to handle both fullscreenchange and fullscreenerror might look like this: function eventhandler(event) { if (event.type == 'fullscreenchange') { /* handle a full screen toggle */ } else /* fullscreenerror */ { /* handle...
EventTarget - Web APIs
event); } return !event.defaultprevented; }; specifications specification status comment domthe definition of 'eventtarget' in that specification. living standard no change. document object model (dom) level 3 events specificationthe definition of 'eventtarget' in that specification. obsolete a few parameters are now optional (listener), or
accepts the null value (usecapture). document object model (dom) level 2 events specificationthe definition of 'eventtarget' in that specification. obsolete initial definition. ...
File.getAsDataURL() - Web APIs
u should use the filereader method readasdataurl() instead. syntax var url = instanceoffile.getasdataurl(); returns a string representing a data: url example // fileinput is a htmlinputelement: <input type="file" id="myfileinput" multiple> var fileinput = document.getelementbyid("myfileinput"); // files is a filelist object (similar to nodelist) var files = fileinput.files; // array with
acceptable file types var
accept = ["image/png"]; // img is a htmlimgelement: <img id="myimg"> var img = document.getelementbyid("myimg"); // if we
accept the first selected file type if (
accept.indexof(files[0].mediatype) > -1) { // display the image // same as <img src="data:image/png,<imagedata>"> img.src = files[0].getasdataurl(); } specification not part of any specification. ...
File - Web APIs
ed 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.createobjecturl(), 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; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin me...
FileSystemEntrySync - Web APIs
ementrysync interface of the file and directory entries api represents an entry in a file system; it can be either a fileentrysync or directoryentry. it includes methods for working with files—including copying, moving, removing, and reading files—as well as information about the file it points to—including the file name and its path from the root to the entry. warning: 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: tourl(). i...
FileSystemFlags.exclusive - Web APIs
syntax filesystemflags.exclusive = booleanvalue values the table below describes the result of each possible combination of these flags depending on whether or not the target file or directory path already exists. ...
FileSystemFlags - Web APIs
the filesystemflags dictionary defines a set of values which are used when specifying option flags when calling certain methods in the file and directory entries api. methods which
accept an options parameter of this type may specify zero or more of these flags as fields in an object, like this: datadirectoryentry.getdirectory("workspace", { create: true }, function(entry) { }); here, we see that the create property is provided, with a value of true, indicating that the directory should be created if it's not already there. note that these option flags currently don't have any useful meaning when used in the scope of web content, where security precautions prevent the creation of new files or the replacement of existing ones. properties create optional if this property is true, and ...
FocusEvent() - Web APIs
the focusevent() constructor also inherits arguments from uievent() and from event(). typearg is a domstring representing the name of the event. focuseventinit optional is a focuseventinit dictionary, having the following fields: "relatedtarget", optional and defaulting to null, is an eventtarget representing the secondary target of a focusevent. the focuseventinit dictionary also
accepts fields from the uieventinit and eventinit dictionaries. specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'focusevent()' in that specification. obsolete initial definition ...
Using the Geolocation API - Web APIs
omething(position.coords.latitude, position.coords.longitude); }); the watchposition() method returns an id number that can be used to uniquely identify the requested position watcher; you use this value in tandem with the clearwatch() method to stop watching the user's location. navigator.geolocation.clearwatch(watchid); fine tuning the response both getcurrentposition() and watchposition()
accept a success callback, an optional error callback, and an optional positionoptions object. this object allows you to specify whether to enable high accuracy, a maximum age for the returned position value (up until this age it will be cached and reused if the same position is requested again; after this the browser will request fresh position data), and a timeout value that dictates how long the bro...
Geolocation API - Web APIs
me it is requested. concepts and usage you will often want to retrieve a user's location information in your web app, for example to plot their location on a map, or display personalized information relevant to their location. the geolocation api is accessed via a call to navigator.geolocation; this will cause the user's browser to ask them for permission to access their location data. if they
accept, then the browser will use the best available functionality on the device to access this information (for example, gps). the developer can now access this location information in a couple of different ways: geolocation.getcurrentposition(): retrieves the device's current location. geolocation.watchposition(): registers a handler function that will be called automatically each time the positi...
GlobalEventHandlers.onerror - Web APIs
or 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 type errorevent contains all the information about the event and the error. element.onerror element.onerror = function(event) { ... } element.onerror
accepts a function with a single argument of type event. a good example for this is when you are using an image tag, and need to specify a backup image in case the one you need is not available on the server for any reason. <img src="imagenotfound.gif" onerror="this.onerror=null;this.src='imagefound.gif';" /> the reason we have the this.onerror=null in the function is that the browser will be stuck ...
HTMLButtonElement - Web APIs
tmlbuttonelement.autofocus is a boolean indicating whether or not the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. only one form-associated element in a document can have this attribute specified. htmlbuttonelement.disabled is a boolean indicating whether or not the control is disabled, meaning that it does not
accept any clicks. htmlbuttonelement.form read only is a htmlformelement reflecting the form that this button is associated with. if the button is a descendant of a form element, then this attribute is the id of that form element. if the button is not a descendant of a form element, then the attribute can be the id of any form element in the same document it is related to, or the null value if none ...
HTMLIFrameElement - Web APIs
ement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmliframeelement.align is a domstring that specifies the alignment of the frame with respect to the surrounding context. htmliframeelement.allow is a list of origins the the frame is allowed to display content from. this attribute also
accepts the values self and src which represent the origin in the iframe's src attribute. the default value is src. htmliframeelement.allowfullscreen is a boolean indicating whether the inline frame is willing to be placed into full screen mode. see using full-screen mode for details. htmliframeelement.allowpaymentrequest is a boolean indicating whether the payment request api may be invoked insid...
HTMLImageElement.alt - Web APIs
ntains the alternate text to display when the image is not loaded or for use by assistive devices. the alt attribute is officially mandatory; it's meant to always be specified. if the image doesn't require a fallback (such as for an image which is simply decorative or an advisory icon of minimal importance), you may specify an empty string (""). for compatibility reasons, browsers generally will
accept an image without an alt attribute, but you should try to get into the habit of using it. usage notes the fundamental guideline for the alt attribute is that every image's alternate text should be able to replace the image without altering the meaning of the page. you should never use alt for text that could be construed as a caption or title. there are separate attributes and elements designed ...
HTMLImageElement - Web APIs
"12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlimageelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor image() the image() constructor creates and returns a new htmlimageelement object representing an html <img> element which is not attached to any dom tree. it
accepts optional width and height parameters. when called without parameters, new image() is equivalent to calling document.createelement("img"). properties inherits properties from its parent, htmlelement. htmlimageelement.alt a domstring that reflects the alt html attribute, thus indicating the alternate fallback content to be displayed if the image has not been loaded. htmlimageelement.comple...
HTMLSelectElement - Web APIs
which indicates whether the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. only one form-associated element in a document can have this attribute specified. htmlselectelement.disabled a boolean reflecting the disabled html attribute, which indicates whether the control is disabled. if it is disabled, it does not
accept clicks. htmlselectelement.formread only an htmlformelement referencing the form that this element is associated with. if the element is not associated with of a <form> element, then it returns null. htmlselectelement.labelsread only a nodelist of <label> elements associated with the element. htmlselectelement.length an unsigned long the number of <option> elements in this select element. ...
File drag and drop - Web APIs
the main steps to drag and drop are to define a drop zone (i.e. a target element for the file drop) and to define event handlers for the drop and dragover events. these steps are described below, including example code snippets. the full source code is available in mdn's drag-and-drop repository (pull requests and/or issues are welcome). ...
Headers() - Web APIs
eader to this using headers.append: myheaders.append('content-type', 'image/jpeg'); myheaders.get('content-type'); // returns 'image/jpeg' or you can add the headers you want as the headers object is created. ...
Headers.has() - Web APIs
ot a valid http header name, this method throws a typeerror. returns a boolean. example creating an empty headers object is simple: var myheaders = new headers(); // currently empty you could add a header to this using headers.append, then test for the existence of it using has(): myheaders.append('content-type', 'image/jpeg'); myheaders.has('content-type'); // returns true myheaders.has('
accept-encoding'); // returns false specifications specification status comment fetchthe definition of 'has()' in that specification. living standard ...
Headers.keys() - Web APIs
the headers.keys() method returns an iterator allowing to go through all keys contained in this object. ...
Headers - Web APIs
ct. headers.set() sets a new value for an existing header inside a headers object, or adds the header if it does not already exist. headers.values() returns an iterator allowing you to go through all values of the key/value pairs contained in this object. note: to be clear, the difference between headers.set() and headers.append() is that if the specified header does already exist and does
accept multiple values, headers.set() will overwrite the existing value with the new one, whereas headers.append() will append the new value onto the end of the set of values. see their dedicated pages for example code. note: all of the headers methods will throw a typeerror if you try to pass in a reference to a name that isn't a valid http header name. the mutation operations will throw a typeerror...
Basic concepts - Web APIs
rom http://www.example.com/dir/, because they have the same origin, it cannot retrieve data from http://www.example.com:8080/dir/ (different port) or https://www.example.com/dir/ (different protocol), because they have different origins. note: third party window content (e.g. <iframe> content) can access the indexeddb store for the origin it is embedded into, unless the browser is set to never
accept third party cookies (see bug 1147821.) definitions this section defines and explains terms used in the indexeddb api. database database a repository of information, typically comprising one or more object stores. each database must have the following: name. this identifies the database within a specific origin and stays constant throughout its lifetime. the name can be any string va...
InputEvent() - Web APIs
to or removed from editible content. iscomposing: (optional) a boolean indicating that the event is part of a composition session, meaning it is after a compositionstart event but before a compositionend event. the default is false. ranges: (optional) an array of static ranges that will be affected by a change to the dom if the input event is not canceled. the inputeventinit dictionary also
accepts fields from uieventinit and from eventinit dictionaries. ...
KeyboardEvent() - Web APIs
and defaulting to 0, of type unsigned long, that sets the value of the deprecated keyboardevent.charcode. "keycode", optional and defaulting to 0, of type unsigned long, that sets the value of the deprecated keyboardevent.keycode. "which", optional and defaulting to 0, of type unsigned long, that sets the value of the deprecated keyboardevent.which. the keyboardeventinit dictionary also
accepts fields from the uieventinit and eventinit dictionaries. specifications specification status comment ui eventsthe definition of 'keyboardevent()' in that specification. working draft current definition. document object model (dom) level 3 events specificationthe definition of 'keyboardevent()' in that specification. obsolete initial definiti...
KeyboardEvent.getModifierState() - Web APIs
nd "shift" may be supported. all modifiers (except "fnlock", "hyper", "super" and "symbol" which are defined after gecko implements this) are always supported for untrusted events on gecko. this doesn't depend on the platform. "accel" virtual modifier note: the "accel" virtual modifier has been effectively deprecated in current drafts of the dom3 events specification. getmodifierstate() also
accepts a deprecated virtual modifier named "accel". event.getmodifierstate("accel") returns true when at least one of keyboardevent.ctrlkey or keyboardevent.metakey is true. in old implementations and outdated specifications, it returned true when a modifier which is the typical modifier key for the shortcut key is pressed. for example, on windows, pressing ctrl key may make it return true. however, o...
KeyframeEffect.KeyframeEffect() - Web APIs
(alternate), or runs backwards and switches direction after each iteration (alternate-reverse). defaults to "normal". duration optional the number of milliseconds each iteration of the animation takes to complete. defaults to 0. although this is technically optional, keep in mind that your animation will not run if this value is 0. easing optional the rate of the animation's change over time.
accepts the pre-defined values "linear", "ease", "ease-in", "ease-out", and "ease-in-out", or a custom "cubic-bezier" value like "cubic-bezier(0.42, 0, 0.58, 1)". defaults to "linear". enddelay optional the number of milliseconds to delay after the end of an animation. this is primarily of use when sequencing animations based on the end time of another animation. defaults to 0. fill optional dictat...
KeyframeEffectOptions - Web APIs
(alternate), or runs backwards and switches direction after each iteration (alternate-reverse). defaults to "normal". duration optional the number of milliseconds each iteration of the animation takes to complete. defaults to 0. although this is technically optional, keep in mind that your animation will not run if this value is 0. easing optional the rate of the animation's change over time.
accepts the pre-defined values "linear", "ease", "ease-in", "ease-out", and "ease-in-out", or a custom "cubic-bezier" value like "cubic-bezier(0.42, 0, 0.58, 1)". defaults to "linear". enddelay optional the number of milliseconds to delay after the end of an animation. this is primarily of use when sequencing animations based on the end time of another animation. defaults to 0. fill optional dictat...
MediaDevices.ondevicechange - Web APIs
es a function to be called when the devicechange event occurs on a mediadevices instance. this happens whenever the set of media devices available to the user agent and, by extension, to the web site or app has changed. you can at any time use enumeratedevices() to get the updated list of available devices. syntax mediadevices.ondevicechange = eventhandler; value a function you provide which
accepts as input a event object describing the devicechange event that occurred. there is no information about the change included in the event object; to get the updated list of devices, you'll have to use enumeratedevices(). example in this example, we create a function called updatedevicelist(), which is called once when mediadevices.getusermedia() successfully obtains a stream, and then is called ...
MediaRecorder.mimeType - Web APIs
}) .catch(function(error) { console.log(error.message); }); changing line 14 to the following causes mediarecorder to try to use avc constrained baseline profile level 4 for video and aac-lc (low complexity) for audio, which is good for mobile and other possible resource-constrained situations. mimetype: 'video/mp4; codecs="avc1.424028, mp4a.40.2"' assuming this configuration is
acceptable to the user agent, the value returned later by m.mimetype would then be video/mp4; codecs="avc1.424028, mp4a.40.2". specifications specification status comment mediastream recordingthe definition of 'mediarecorder.mimetype' in that specification. working draft initial definition ...
MediaStream.onaddtrack - Web APIs
enegotiated or a stream being captured using htmlmediaelement.capturestream() gets a new set of tracks because the media element being captured loaded a new source. the addtrack event does not get fired when javascript code explicitly adds tracks to the stream (by calling addtrack()). syntax mediastream.onaddtrack = eventhandler; value this should be set to a function which you provide that
accepts as input a mediastreamtrackevent object representing the addtrack event which has occurred. the mediastreamtrack representing the track which was added is specified in the event's track property. example this example adds a listener which, when a new track is added to the stream, appends a new item to a list of tracks; the new item shows the track's kind ("audio" or "video") and label. stream...
MediaStream.onremovetrack - Web APIs
a stream being captured using htmlmediaelement.capturestream() gets a new set of tracks because the media element being captured loaded a new source. the removetrack event does not get fired when javascript code explicitly removes tracks from the stream (by calling removetrack()). syntax mediastream.onremovetrack = eventhandler; value this should be set to a function which you provide that
accepts as input a mediastreamtrackevent object representing the removetrack event which has occurred. the mediastreamtrack representing the track which was removed is specified in the event's track property. example this example adds a listener which, when a track is removed from the stream, logs the track that was removed. stream.onremovetrack = function(event) { let tracklist = document.geteleme...
MediaStreamTrack.applyConstraints() - Web APIs
the applyconstraints() method of the mediastreamtrack interface applies a set of constraints to the track; these constraints let the web site or app establish ideal values and
acceptable ranges of values for the constrainable properties of the track, such as frame rate, dimensions, echo cancelation, and so forth. constraints can be used to ensure that the media meets certain guidelines you prefer. for example, you may prefer high-density video but require that the frame rate be a little low to help keep the data rate low enough not overtax the network. constraints can also specify ideal and/or
acceptable sizes or ranges of sizes. see applying constraints in capabilities, constraints, and settings for more information on how to apply your preferred constraints. syntax const appliedpromise = t...
MediaStreamTrack.getCapabilities() - Web APIs
the getcapabilities() method of the mediastreamtrack interface returns a mediatrackcapabilities object which specifies the values or range of values which each constrainable property, based upon the platform and user agent. once you know what the browser's capabilities are, your script can use applyconstraints() to ask for the track to be configured to match ideal or
acceptable settings. see capabilities, constraints, and settings for details on how to work with constrainable properties. syntax const capabilities = track.getcapabilities() return value a mediatrackcapabilities object which specifies the value or range of values which are supported for each of the user agent's supported constrainable properties. specifications specification status comment media capt...
MediaStreamTrack.getConstraints() - Web APIs
the getconstraints() method of the mediastreamtrack interface returns a mediatrackconstraints object containing the set of constraints most recently established for the track using a prior call to applyconstraints(). these constraints indicate values and ranges of values that the web site or application has specified are required or
acceptable for the included constrainable properties. constraints can be used to ensure that the media meets certain guidelines you prefer. for example, you may prefer high definition video but require that the frame rate be a little low to help keep the data rate low enough not overtax the network. constraints can also specify ideal and/or
acceptable sizes or ranges of sizes. see capabilities, constraints, and settings for details on how to work with constrainable...
MediaStreamTrack - Web APIs
tched on or off using the enabled attribute. "ended" which indicates that the input is not giving any more data and will never provide new data. mediastreamtrack.remote read only returns a boolean with a value of true if the track is sourced by a rtcpeerconnection, false otherwise. methods mediastreamtrack.applyconstraints() lets the application specify the ideal and/or ranges of
acceptable values for any number of the available constrainable properties of the mediastreamtrack. mediastreamtrack.clone() returns a duplicate of the mediastreamtrack. mediastreamtrack.getcapabilities() returns the a list of constrainable properties available for the mediastreamtrack. mediastreamtrack.getconstraints() returns a mediatrackconstraints object containing the currently set constraint...
MediaTrackConstraints.aspectRatio - Web APIs
ted by checking the value of mediatracksupportedconstraints.aspectratio as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { aspectratio: constraint }; constraintsobject.aspectratio = constraint; value a constraindouble describing the
acceptable or required value(s) for a video track's aspect ratio. the value is the width divided by the height and is rounded to ten decimal places. for example, the standard high-definition video aspect ratio of 16:9 can be computed as 1920/1080, or 1.7777777778. if this value is a number, the user agent will attempt to obtain media whose aspect ratio is as close as possible to this number given the c...
MediaTrackConstraints.deviceId - Web APIs
ly this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { deviceid: constraint }; constraintsobject.deviceid = constraint; value an object based on constraindomstring specifying one or more
acceptable, ideal, and/or exact (mandatory) device ids which are
acceptable as the source of media content. device ids are unique for a given origin, and are guaranteed to be the same across browsing sessions on the same origin. however, the value of the deviceid is determined by the source of the track's content, and there's no particular format mandated by the specification (although some kind of gui...
MediaTrackConstraints.frameRate - Web APIs
supported by checking the value of mediatracksupportedconstraints.framerate as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { framerate: constraint }; constraintsobject.framerate = constraint; value a constraindouble describing the
acceptable or required value(s) for a video track's frame rate, in frames per second. if this value is a number, the user agent will attempt to obtain media whose frame rate is as close as possible to this number given the capabilities of the hardware and the other constraints specified. otherwise, the value of this constraindouble will guide the user agent in its efforts to provide an exact match to t...
MediaTrackConstraints.groupId - Web APIs
the value of mediatracksupportedconstraints.groupid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { groupid: constraint }; constraintsobject.groupid = constraint; value an object based on constraindomstring specifying one or more
acceptable, ideal, and/or exact (mandatory) group ids which are
acceptable as the source of media content. group ids are unique for a given origin for the duration of a single browsing session, and are shared by all media sources that come from the same physical device. for example, the microphone and speaker on the same headset would share a group id. this makes it possible to use the group id to ensu...
MediaTrackControls.volume - Web APIs
raint is supported by checking the value of mediatracksupportedconstraints.volume as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { volume: constraint }; constraintsobject.volume = constraint; value a constraindouble describing the
acceptable or required value(s) for an audio track's volume, on a linear scale where 0.0 means silence and 1.0 is the highest supported volume. if this value is a number, the user agent will attempt to obtain media whose volume is as close as possible to this number given the capabilities of the hardware and the other constraints specified. otherwise, the value of this constraindouble will guide the us...
MediaTrackSupportedConstraints.frameRate - Web APIs
ksupportedconstraints dictionary's framerate property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the framerate constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. the framerate constraint can be used to establish
acceptable upper and lower bounds on the video frame rate for a new video track, or to specify an exact frame rate that must be provided for the request to succeed. checking the value of this property lets you determine if the user agent allows constraining the video track configuration by frame rate. see the example to see how this can be used. syntax framerateconstraintsupported = supportedconstrain...
MediaTrackSupportedConstraints - Web APIs
no error will occur. instead, the specified constraints will be applied, with any unrecognized constraints stripped from the request.that can lead to confusing and hard to debug errors, so be sure to use getsupportedconstraints() to retrieve this information before attempting to establish constraints if you need to know the difference between silently ignoring a constraint and a constraint being
accepted. an actual constraint set is described using an object based on the mediatrackconstraints dictionary. to learn more about how constraints work, see capabilities, constraints, and settings. properties some combination—but not necessarily all—of the following properties will exist on the object. autogaincontrol a boolean whose value is true if the autogaincontrol constraint is support...
MouseEvent() - Web APIs
tering (in case of a mouseout or mouseleave). "region", optional and defaulting to null, of type domstring, is the id of the hit region affected by the event. the absence of any hit region is affected, is represented by the null value. in some implementations, passing anything other than a number for the screen and client fields will throw a typeerror. the mouseeventinit dictionary also
accepts fields from uieventinit and from eventinit dictionaries. specifications specification status comment css object model (cssom) view modulethe definition of 'mouseevent' in that specification. working draft redefines screen and client fields long to double. document object model (dom) level 3 events specificationthe definition of 'mouseevent()' in ...
Navigator.registerProtocolHandler() - Web APIs
ayed to the user, such as prompting “allow this site to handle [scheme] links?” or listing registered handlers in the browser’s settings. note: the title has been removed from the spec due to spoofing concerns, but all current browsers still require it. it is recommended to always set the title, since browsers that support the updated spec most likely will be backwards-compatible and still
accept the title (but not use it). exceptions securityerror the user agent blocked the registration. this might happen if: the registered scheme (protocol) is invalid, such as a scheme the browser handles itself (https:, about:, etc.) the handler url’s origin does not match the origin of the page calling this api. the browser requires that this function is called from a secure context. ...
NavigatorLanguage.languages - Web APIs
representing the user's preferred languages. the language is described using bcp 47 language tags. in the returned array they are ordered by preference with the most preferred language first. the value of navigator.language is the first element of the returned array. when its value changes, as the user's preferred languages are changed a languagechange event is fired on the window object. the
accept-language http header in every http request from the user's browser uses the same value for the navigator.languages property except for the extra qvalues (quality values) field (e.g. en-us;q=0.8). syntax preferredlanguages = globalobj.navigator.languages examples navigator.language //"en-us" navigator.languages //["en-us", "zh-cn", "ja-jp"] specifications specification statu...
Node.isDefaultNamespace() - Web APIs
syntax result = node.isdefaultnamespace(namespaceuri); parameters namespaceuri is a string representing the namespace against which the element will be checked. return value result is a boolean that holds the return value true or false. ...
Node.lookupNamespaceURI() - Web APIs
syntax var namespace = node.lookupnamespaceuri(prefix); parameters prefix the prefix to look for. if this parameter is null, the method will return the default namespace uri, if any. return value a domstring containing the the namespace uri. if the prefix is not found, it returns null. ...
NodeIterator.detach() - Web APIs
nodeiterator from the set over which it iterates, releasing any resources used by the set and setting the iterator's state to invalid. once this method had been called, calls to other methods on nodeiterator would raise the invalid_state_err exception. syntax nodeiterator.detach(); example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); nodeiterator.detach(); // detaches the iterator nodeiterator.nextnode(); // throws an invalid_state_err exception specifications specification status comment domthe definition of 'nodeiterator.detach' in that specification. living standard transformed in a no-op document object mode...
NodeIterator.expandEntityReferences - Web APIs
odeiterator. if this value is false, the children of entity reference nodes (as well as all of their descendants) are rejected. this takes precedence over the value of the nodeiterator.whattoshow method and the associated filter. syntax expand = nodeiterator.expandentityreferences; example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); expand = nodeiterator.expandentityreferences; specifications specification status comment document object model (dom) level 2 traversal and range specificationthe definition of 'nodeiterator.expandentityreferences' in that specification. obsolete initial definition. ...
NodeIterator.nextNode() - Web APIs
no nodes left in the set. in old browsers, as specified in old versions of the specifications, the method may throws the invalid_state_err domexception if this method is called after the nodeiterator.detach()method. recent browsers never throw. syntax node = nodeiterator.nextnode(); example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false // this optional argument is not used any more ); currentnode = nodeiterator.nextnode(); // returns the next node specifications specification status comment domthe definition of 'nodeiterator.nextnode' in that specification. living standard as detach() is now a no-op method, this method cannot ...
NodeIterator.pointerBeforeReferenceNode - Web APIs
de read-only property returns a boolean flag that indicates whether the nodefilter is anchored before (if this value is true) or after (if this value is false) the anchor node indicated by the nodeiterator.referencenode property. syntax flag = nodeiterator.pointerbeforereferencenode; example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); flag = nodeiterator.pointerbeforereferencenode; specifications specification status comment domthe definition of 'nodeiterator.pointerbeforereferencenode' in that specification. living standard initial definition. ...
NodeIterator.referenceNode - Web APIs
the nodeiterator.referencenode read-only returns the node to which the iterator is anchored; as new nodes are inserted, the iterator remains anchored to the reference node as specified by this property. syntax node = nodeiterator.referencenode; example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); node = nodeiterator.referencenode; specifications specification status comment domthe definition of 'nodeiterator.referencenode' in that specification. living standard initial definition. ...
NodeIterator.root - Web APIs
the nodeiterator.root read-only property represents the node that is the root of what the nodeiterator traverses. syntax root = nodeiterator.root; example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); root = nodeiterator.root; // document.body in this case specifications specification status comment domthe definition of 'nodeiterator.root' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification. document object model (dom) level 2 traversal and range specificationthe definition of 'nodeiterator.root' in that specification. obsolete initial de...
Using the Notifications API - Web APIs
o request this from the user. in its simplest form, we just include the following: notification.requestpermission().then(function(result) { console.log(result); }); this uses the promise-based version of the method. if you want to support older versions, you might have to use the older callback version, which looks like this: notification.requestpermission(); the callback version optionally
accepts a callback function that is called once the user has responded to the request to display permissions. example in our todo list demo, we include an "enable notifications" button that, when pressed, requests notification permissions for the app. <button id="enable">enable notifications</button> clicking this calls the asknotificationpermission() function: function asknotificationpermission() ...
OES_element_index_uint - Web APIs
ble using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. extended methods this extension extends webglrenderingcontext.drawelements(): the type parameter now
accepts gl.unsigned_int. examples var ext = gl.getextension('oes_element_index_uint'); gl.drawelements(gl.points, 8, gl.unsigned_int, 0); specifications specification status comment oes_element_index_uintthe definition of 'oes_element_index_uint' in that specification. recommendation initial definition. ...
OES_texture_float - Web APIs
xtension() method. for more information, see also using extensions in the webgl tutorial. availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. extended methods this extension extends webglrenderingcontext.teximage2d() and webglrenderingcontext.texsubimage2d(): the type parameter now
accepts gl.float. the pixels parameter now
accepts an arraybufferview of type float32array. limitation: linear filtering linear filtering on floating-point textures is not allowed with this extension. if you set the magnification or minification filter in the webglrenderingcontext.texparameter() method to one of gl.linear, gl.linear_mipmap_nearest, gl.nearest_mipmap_linear, or gl.linear_mipmap_linea...
OES_texture_half_float - Web APIs
extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. the constant in webgl2 is gl.half_float. constants ext.half_float_oes half floating-point type (16-bit). extended methods this extension extends webglrenderingcontext.teximage2d() and webglrenderingcontext.texsubimage2d(): the type parameter now
accepts ext.half_float_oes. limitation: linear filtering linear filtering on half floating-point textures is not allowed with this extension. if you set the magnification or minification filter in the webglrenderingcontext.texparameter() method to one of gl.linear, gl.linear_mipmap_nearest, gl.nearest_mipmap_linear, or gl.linear_mipmap_linear, and use half floating-point textures, the texture will be...
OVR_multiview2.framebufferTextureMultiviewOVR() - Web APIs
ecifying the mipmap level of the texture image to be attached. must be 0. baseviewindex a glint specifying the base view index of the framebuffer object attachment. numviews a glsizei specifying the number of views of the framebuffer object attachment. return value none. exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer. attachment is not one of the
accepted attachment points. a gl.invalid_value error is thrown if level is not 0. if numviews is less than one or more than max_views_ovr. a gl.invalid_operation error is thrown if texture isn't 0 or the name of an existing texture object. examples ext.framebuffertexturemultiviewovr(gl.draw_framebuffer, gl.color_attachment0, colortex, 0, 0, 2); specifications specifi...
OscillatorNode.OscillatorNode() - Web APIs
the oscillatornode() constructor of the web audio api creates a new oscillatornode object which is an audionode that represents a periodic waveform, like a sine wave, optionally setting the node's properties' values to match values in a specified object. if the default values of the properties are
acceptable, you can optionally use the audiocontext.createoscillator() factory method instead. syntax var oscillatornode = new oscillatornode(context, options) parameters inherits parameters from the audionodeoptions dictionary. context a reference to an audiocontext. options optional an object whose properties specify the initial values for the oscillator node's properties. any properties omitted from the object will take on the default value as documented. type the shape of the wave...
OscillatorNode - Web APIs
umber of inputs 0 number of outputs 1 channel count mode max channel count 2 (not used in the default count mode) channel interpretation speakers constructor oscillatornode() creates a new instance of an oscillatornode object, optionally providing an object specifying default values for the node's properties. if the default values are
acceptable, you can simply call the baseaudiocontext.createoscillator() factory method. properties inherits properties from its parent, audioscheduledsourcenode, and adds the following properties: oscillatornode.frequency an a-rate audioparam representing the frequency of oscillation in hertz (though the audioparam returned is read-only, the value it represents is not). the default value is 440 h...
PannerNode.PannerNode() - Web APIs
annernode.coneouterangle you want the pannernode to have (the default is 360.) coneoutergain: the pannernode.coneoutergain you want the pannernode to have. the default is 0, and its value can be in the range 0–1. return value a new pannernode object instance. exceptions rangeerror the refdistance, maxdistance, or rollofffactor properties have been given a value that is outside the
accepted range. invalidstateerror the coneoutergain property has been given a value outside the
accepted range (0–1). example var ctx = new audiocontext(); var options = { positionx : 1, maxdistance: 5000 } var mypanner = new pannernode(ctx, options); specifications specification status comment web audio apithe definition of 'pannernode()' in that specification. ...
PannerNode.coneOuterGain - Web APIs
he coneouterangle attribute. the coneoutergain property's default value is 0, meaning that no sound can be heard outside the cone. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.coneoutergain = 0; value a double. the default is 0, and its value can be in the range 0–1. exceptions invalidstateerror the property has been given a value outside the
accepted range (0–1). example in this example, we'll demonstrate how changing the orientation parameters of a pannernode in combination with coneinnerangle and coneouterangle affects volume. to help us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector. the x and z components are alwa...
PannerNode.maxDistance - Web APIs
duced any further. this value is used only by the linear distance model. the maxdistance property's default value is 10000. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.maxdistance = 10000; value a double. the default is 10000, and non-positive values are not allowed. exceptions rangeerror the property has been given a value that is outside the
accepted range. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a ch...
PannerNode.refDistance - Web APIs
ction starts taking effect. this value is used by all distance models. the refdistance property's default value is 1. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.refdistance = 1; value a non-negative number. if the value is set to less than 0, a rangeerror is thrown. exceptions rangeerror the property has been given a value that is outside the
accepted range. example this example demonstrates how different values of refdistance affect how the volume of a sound decays as it moves away from the listener. unlike rollofffactor, changing this value also delays the volume decay until the sound moves past the reference point. const context = new audiocontext(); // all our test tones will last this many seconds const note_length = 6; // this is h...
PannerNode.rolloffFactor - Web APIs
(); var panner = audioctx.createpanner(); panner.rollofffactor = 1; value a number whose range depends on the distancemodel of the panner as follows (negative values are not allowed): "linear" the range is 0 to 1. "inverse" the range is 0 to infinity. "exponential" the range is 0 to infinity. exceptions rangeerror the property has been given a value that is outside the
accepted range. example this example demonstrates how different rollofffactor values affect how the volume of the test tone decreases with increasing distance from the listener: const context = new audiocontext(); // all our test tones will last this many seconds const note_length = 4; // this is how far we'll move the sound const z_distance = 20; // this function creates a graph for the test tone ...
PaymentAddress.region - Web APIs
thin the country in which the address is located. this region has different names in different countries, such as: state, province, oblast, prefecture, or county. usage notes in some countries, like belgium, it's uncommon for people to provide a region as part of their postal address. in such cases, the browser returns an empty string as the value of region. however, the address should still be
acceptable to use for its intended purpose (e.g., to ship a product). however, always verify addresses to make sure what the user provides is usable. specifications specification status comment payment request apithe definition of 'paymentaddress.region' in that specification. candidate recommendation initial definition. ...
PaymentRequest.PaymentRequest() - Web APIs
the paymentrequest() constructor creates a new paymentrequest object which will be used to handle the process of generating, validating, and submitting a payment request. syntax var paymentrequest = new paymentrequest(methoddata, details, [options]); parameters methoddata contains an array of identifiers for the payment methods the merchant web site
accepts and any associated payment method specific data. each item in the array contains the following fields: supportedmethods for early implementations of the spec, this was a sequence of identifiers for payment methods that the merchant website
accepts. starting with more recent browsers, this parameter is more generic than credit cards, it is a single domstring, and the meaning of the data parameter changes with the supportedmetho...
PaymentRequest.canMakePayment() - Web APIs
the paymentrequest method canmakepayment() determines whether or not the request is configured in a way that is compatible with at least one payment method supported by the user agent. you can call this before calling show() to provide a streamlined user experience when the user's browser can't handle any of the payment methods you
accept. for instance, you might call canmakepayment() to determine if the browser will let the user pay using payment request api, and if it won't, you could fall back to another payment method, or offer a list of methods that aren't handled by payment request api (or even provide instructions for paying by mail or by phone). syntax paymentrequest.canmakepayment() .then( canpay => { ... }) .catch( error => { ... }) canpay = await paymentrequest.canmakep...
PaymentRequest - Web APIs
constructor paymentrequest() secure context creates a new paymentrequest object. properties paymentrequest.id read only secure context an unique identifier for a particular paymentrequest, which can be set via details.id. when none is set, it defaults to a uuid. ...
PaymentRequestEvent() - Web APIs
type must always be 'paymentrequest'. options optional options are as follows: instrumentkey: a paymentinstrument object reflecting the payment instrument selected by the user or an empty string if the user has not registered or chosen a payment instrument. methoddata: an array of paymentmethoddata objects containing payment method identifers for the payment methods that the web site
accepts and any associated payment method specific data. modifiers: an array of objects containing changes to payment details. paymentrequestid: the id of the paymentrequest object. paymentrequestorigin: the origin where the paymentrequest object was initialized. topleveorigin: the top-level origin where the paymentrequest object was initialized. total: the total amount being requested for pay...
PaymentRequestEvent.methodData - Web APIs
the methoddata read-only property of the paymentrequestevent interface returns an array of paymentmethoddata objects containing payment method identifers for the payment methods that the web site
accepts and any associated payment method specific data. syntax var methoddata[] = paymentrequestevent.methoddata value an array of paymentmethoddata objects. specifications specification status comment payment handler apithe definition of 'methoddata' in that specification. working draft initial definition. ...
PaymentRequestEvent - Web APIs
es a new paymentrequestevent object. properties instrumentkeyread only returns a paymentinstrument object reflecting the payment instrument selected by the user or an empty string if the user has not registered or chosen a payment instrument. methoddataread only returns an array of paymentmethoddata objects containing payment method identifers for the payment methods that the web site
accepts and any associated payment method specific data. modifiersread only returns an array of objects containing changes to payment details. paymentrequestidread 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 objec...
PaymentResponse.complete() - Web APIs
syntax completepromise = paymentrequest.complete(result); parameters result optional a domstring indicating the state of the payment operation upon completion. it must be one of the following: success the payment was successfully processed. ...
PaymentResponse.retry() - Web APIs
mple below for a thorough example, but the basic concept, in outline form, is: create a new paymentrequest (new paymentrequest()) display the payment request (paymentrequest.show() if show() resolves, the returned paymentresponse describes the requested payment and the options chosen by the user. continue by... validate the returned reponse; if there are any fields whose values are not
acceptable, call the response's complete() method with a value of "fail" to indicate failure. if the response's data is valid and
acceptable, call complete("success") to finalize the payment and proces it. if show() is rejected, the payment request failed, usually because either there's already one being processed, because the user agent doesn't support any of the specified payment methods, or ...
Payment processing concepts - Web APIs
payment handler api can be used to establish support for additional payment method providers, in browsers that support it. in either case, the payment handler is responsible for: making sure a payment can be made. the conditions that make payment possible vary depending on the payment method and the user's payment request; for example, if the user chooses to pay using a credit card that isn't
accepted by the payee, the payment can't be made. if merchant validation is supported by the payment handler, respond to merchant validation requests from the user agent. see merchant validation for details. verify that the information provided by the user results in a valid transaction. this results in the creation and returning of a payment method-specific object that contains the information needed...
Payment Request API - Web APIs
dentials" across devices, making it easy for users to jump from desktop to mobile and back again when buying things. consistent error handling: the browser can check the validity of card numbers, and can tell the user if a card has expired (or is about to expire). the browser can automatically suggest which card to use based on past usage patterns or restrictions from the merchant (e.g, "we only
accept visa or mastercard"), or allow the user to say which is their default/favorite card. to request a payment, a web page creates a paymentrequest object in response to a user action that initiates a payment, such as clicking a "purchase" button. the paymentrequest allows the web page to exchange information with the user agent while the user provides input to complete the transaction. you can fin...
Pbkdf2Params - Web APIs
ber representing the number of times the hash function will be executed in derivekey(). this determines how computationally expensive (that is, slow) the derivekey() operation will be. in this context, slow is good, since it makes it more expensive for an attacker to run a dictionary attack against the keys. the general guidance here is to use as many iterations as possible, subject to keeping an
acceptable level of performance for your application. examples see the examples for subtlecrypto.derivekey(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.pbkdf2params' in that specification. recommendation ...
PointerEvent.PointerEvent() - Web APIs
defaulting to 0, of type long, that sets the value of the instance's pointerevent.twist. pointertype — optional and defaulting to "", of type domstring, that sets the value of the instance's pointerevent.pointertype. isprimary — optional and defaulting to false, of type boolean, that sets the value of the instance's pointerevent.isprimary. note: the pointereventinit dictionary also
accepts fields from the mouseevent, uieventinit and eventinit dictionaries. example var moveevent = new pointerevent("pointermove"); var downevent = new pointerevent("pointerdown", {pointerid: 1, bubbles: true, cancelable: true, pointertype: "touch", width: 100, height: 100, isprimary: true }); ...
Using Pointer Events - Web APIs
this guide demonstrates how to use pointer events and the html <canvas> element to build a multi-touch enabled drawing application. this example is based on the one in the touch events overview, except it uses the pointer events input event model. another difference is that because pointer events are pointer device agnostic, the application
accepts coordinate-based inputs from a mouse, a pen, or a fingertip using the same code. this application will only work on a browser that supports pointer events. a live version of this application is available on github. the source code is available on github and pull requests and bug reports are welcome. definitions surface a touch-sensitive surface. this may be a trackpad, a touch screen, or even a virtual mapping of a user's desk surface (or mous...
PositionOptions.maximumAge - Web APIs
if set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position. if set to infinity the device must return a cached position regardless of its age. ...
PositionOptions - Web APIs
positive long value representing the maximum length of time (in milliseconds) the device is allowed to take in order to return a position. the default value is infinity, meaning that getcurrentposition() won't return until the position is available. positionoptions.maximumage secure context is a positive long value indicating the maximum age in milliseconds of a possible cached position that is
acceptable to return. if set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position. if set to infinity the device must return a cached position regardless of its age. default: 0. specifications specification status comment geolocation apithe definition of 'positionoptions' in that specification. recommendation...
PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() - Web APIs
e in an <iframe> for example. syntax publickeycredential.isuserverifyingplatformauthenticatoravailable() parameters none. return value a promise which resolves to a boolean indicating whether or a not a user-verifying platform authenticator is available. as of today (march 2019), this is basically indicating if windows hello may be used with the web authentication api and that the user has
accepted its use. note: this is a static method which is directly called on the publickeycredential interface and not on an instance. note: in earlier versions of the specification, the boolean also conveyed the consent of the user to disclose such an authenticator existed. examples publickeycredential.isuserverifyingplatformauthenticatoravailable() .then(function(available){ if(available)...
PublicKeyCredentialCreationOptions.extensions - Web APIs
ray of arrays with 3 values containing information about how the user was verified (e.g. fingerprint, pin, pattern), how the key is protected, how the matcher (tool used for the authentication operation) is protected. biometricperfbounds object with two numerical properties: far and frr biometric authenticator performance bounds. the client must not use any authenticator with false
acceptance rate (far) and false rejection rate (frr) below the inputs. the client outputs true if this was taken into account. note: extensions are optional and different browsers may recognize different extensions. all extensions are optional for the client to process them: if a browser does not know a given extension, that will not cause any failure, the extension simply will not be processed.
PublicKeyCredentialCreationOptions.timeout - Web APIs
be overridden by the browser. note: an analogous option exists for the fetching operation (navigators.credentials.get()), see publickeycredentialrequestoptions.timeout. syntax timeout = publickeycredentialcreationoptions.timeout value a numerical hint, expressed in milliseconds, giving the time to wait for the creation operation to complete. examples var publickey = { timeout: 6000, //
accepting to wait for a minute before giving up. challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ...
PublicKeyCredentialRequestOptions.allowCredentials - Web APIs
this is an array of credential descriptors. note: publickeycredentialcreationoptions.excludecredentials may be used during the creation of the credentials in order to avoid creating new credentials for an existing user with existing public key credential. contrary to allowcredentials, it is used to filter out credentials. ...
PublicKeyCredentialRequestOptions - Web APIs
peration to complete. this hint may be overridden by the browser. publickeycredentialrequestoptions.rpid optional a usvstring which indicates the relying party's identifier (ex. "login.example.org"). if this option is not provided, the client will use the current origin's domain. publickeycredentialrequestoptions.allowcredentials optional an array of credentials descriptor which restricts the
acceptable existing credentials for retrieval. publickeycredentialrequestoptions.userverification optional a string qualifying how the user verification should be part of the authentication process. publickeycredentialrequestoptions.extensions optional an object with several client extensions' inputs. those extensions are used to request additional processing (e.g. dealing with legacy fido apis cred...
Web Push API Notifications best practices - Web APIs
ingly, since they can be the most annoying. your notifications should be assistive, not disruptive. building trust some studies have shown that as many as 60% of push notifications are blocked. allowing your site to push notifications in realtime requires trust. you can build trust by having a well-designed website that provides good content that shows respect for the user, and a clear value to
accepting push notifications. browser mitigations because of abuses of push notifications in the past, web browser developers have begun to implement strategies to help mitigate this problem. for example, safari 12.1 now requires—and other browsers either already do, or are planning[1] to do so—that the user interact with the page in some way before the page can request permission to perform push ...
RTCConfiguration.iceTransportPolicy - Web APIs
n server. this can be used to prevent the remote endpoint from receiving 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 recomme...
RTCDataChannel.send() - Web APIs
e same ones. for example, if one peer is a modern browser that supports using the eor (end of record) flag to indicate when a received message is the last piece of a multi-part object sent using send(). for more information about message size restrictions, see understanding message size limits in using webrtc data channels. example in this example, a routine called sendmessage() is created; it
accepts an object as input and sends to the remote peer, over the rtcdatachannel, a json string with the specified object and a time stamp. var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("backchannel"); function sendmessage(msg) { let obj = { "message": msg, "timestamp": new date() } dc.send(json.stringify(obj)); } specifications specification status co...
RTCIceCandidate.address - Web APIs
attribute line (a-line) which describes an ice candidate: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the fifth field, "192.168.0.56" is the ip address in this candidate's a-line string. example this code snippet uses the value of address to implement an ip address based ban feature. if (ipbanlist.includes(candidate.address)) { rejectcandidate(candidate); } else {
acceptcandidate(candidate); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate: address' in that specification. candidate recommendation initial definition. ...
RTCIceCandidate - Web APIs
ction. for details on how the ice process works, see lifetime of a webrtc session. the article webrtc connectivity provides additional useful details. constructor rtcicecandidate() creates an rtcicecandidate object to represent a single ice candidate, optionally configured based on an object based on the rtcicecandidateinit dictionary. note: for backward compatibility, the constructor also
accepts as input a string containing the value of the candidate property instead of a rtcicecandidateinit object, since the candidate includes all of the information that rtcicecandidateinit does and more. properties candidate read only a domstring representing the transport address for the candidate that can be used for connectivity checks. the format of this address is a candidate-attribute a...
RTCIceCandidateInit.candidate - Web APIs
that usage would change the above sample to look like this: function goticecandidatemessage(msg) { var icecandidate = new rtcicecandidate(msg.candidate); pc.addicecandidate(icecandidate).catch({ /* handle error */ }); } specifications specification status comment we...
RTCIceCandidatePairStats.priority - Web APIs
er the webrtc layer thinks this pair of candidates is compared to the others, and the more likely a pair is to be selelcted for use. note: this property was removed from the specification as its value cannot be guaranteed to be accurately represented in a javascript number. you can calculcate its value using the algorithm described in rfc 5245, section 5.7.2 if you need this information and can
accept the risk that the result may not be entirely accurate. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.priority' in that specification. candidate recommendation initial specification. ...
RTCIceTransport.getSelectedCandidatePair() - Web APIs
date pair's two endpoints. local describes the configuration of the local end of the connection, while remote describes the remote peer's configuration. the return value is null if no pair of candidates has been selected yet. usage notes as the ice agent performs negotiation of a rtcpeerconnection, it gathers and analyzes candidate configurations from each the two peers. as soon as it finds an
acceptable matching pair of candidates, meeting the requirements for the connection, a selectedcandidatepairchange event is fired at the rtcicetransport. from that time forward, the best matching pair of candidates will always be available by calling getselectedcandidatepair(). as ice negotiation continues, any time a pair of candidates is discovered that is better than the currently-selected pair, the...
RTCIceTransport.state - Web APIs
f those found in the enumerated type rtcicetransportstate, which indicates the stage of ice gathering that's currently underway. its value will be one of the following: "new" the rtcicetransport is currently gathering local candidates, or is waiting for the remote device to begin to transmit the remote candidates, or both. in this state, checking of candidates to look for those which might be
acceptable has not yet begun. "checking" at least one remote candidate has been received, and the rtcicetransport has begun examining pairings of remote and local candidates in order to attempt to identify viable pairs that could be used to establish a connection. keep in mind that gathering of local candidates may still be underway, and, similarly, the remote device also may still be gathering candid...
RTCIceTransportState - Web APIs
e returned by the state property on rtcicetransport objects. the transport state indicates which stage of the candidate gathering process is currently underway. values "new" the rtcicetransport is currently gathering local candidates, or is waiting for the remote device to begin to transmit the remote candidates, or both. in this state, checking of candidates to look for those which might be
acceptable has not yet begun. "checking" at least one remote candidate has been received, and the rtcicetransport has begun examining pairings of remote and local candidates in order to attempt to identify viable pairs that could be used to establish a connection. keep in mind that gathering of local candidates may still be underway, and, similarly, the remote device also may still be gathering candid...
RTCPeerConnection.addTrack() - Web APIs
ent from one peer to another, not streams. since streams are specific to each peer, specifying one or more streams means the other peer will create a corresponding stream (or streams) automatically on the other end of the connection, and will then automatically add the received track to those streams. streamless tracks if no streams are specified, then the track is streamless. this is perfectly
acceptable, although it will be up to the remote peer to decide what stream to insert the track into, if any. this is a very common way to use addtrack() when building many types of simple applications, where only one stream is needed. for example, if all you're sharing with the remote peer is a single stream with an audio track and a video track, you don't need to deal with managing what track is in wh...
RTCPeerConnection.onaddstream - Web APIs
erconnection.onaddstream = eventhandler; value a function which handles addstream events. these events, of type mediastreamevent, are sent when streams are added to the connection by the remote peer. the first time an event occurs may be nearly immediately after the remote end of the connection is set using rtcpeerconnection.setremotedescription(); it doesn't wait for a particular stream to be
accepted or rejected using sdp negotiation. example this code, based on an older version of our signaling and video calling sample, responds to addstream events by setting the video source for a <video> element to the stream specified in the event, and then enabling a "hang up" button in the app's user interface. pc.onaddstream = function(event) { document.getelementbyid("received_video").srcobject...
RTCPeerConnection.onicecandidate - Web APIs
ce agent perform negotiation with the remote peer without the browser itself needing to know any specifics about the technology being used for signaling; simply implement this method to use whatever messaging technology you choose to send the ice candidate to the remote peer. syntax rtcpeerconnection.onicecandidate = eventhandler; value this should be set to a function which you provide that
accepts as input an rtcpeerconnectioniceevent object representing the icecandidate event. the function should deliver the ice candidate, whose sdp can be found in the event's candidate property, to the remote peer through the signaling server. if the event's candidate property is null, ice gathering has finished. this message should not be sent to the remote peer. when this happens, the connection's ic...
RTCPeerConnection.ontrack - Web APIs
ck has been added to the rtcpeerconnection. the function receives as input the event object, of type rtctrackevent; this event is sent when a new incoming mediastreamtrack has been created and associated with an rtcrtpreceiver object which has been added to the set of receivers on connection. syntax rtcpeerconnection.ontrack = eventhandler; value set ontrack to be a function you provide that
accepts as input a rtctrackevent object describing the new track and how it's being used. this information includes the mediastreamtrack object representing the new track, the rtcrtpreceiver and rtcrtptransceiver, and a list of mediastream objects which indicates which stream or streams the track is part of.. example this example, taken from the code for the article signaling and video calling, connec...
RTCPeerConnection.setLocalDescription() - Web APIs
ed version of this function used. this has been deprecated and its use is strongly discouraged, as it will be removed in the future. you should update any existing code to use the promise-based version of setlocaldescription() instead. the parameters for the older form of setlocaldescription() are described below, to aid in updating existing code. successcallback a javascript function which
accepts no input parameters to be be called once the description has been successfully set. at that time, the offer can be sent to a remote peer via the signaling server. errorcallback a function matching the signature rtcpeerconnectionerrorcallback which gets called if the description can't be set. it is passed a single domexception object explaining why the request failed. this deprecated form o...
RTCPeerConnection.setRemoteDescription() - Web APIs
ted and its use is strongly discouraged. you should update any existing code to use the promise-based version of setremotedescription() instead. the parameters for the older form of setremotedescription() are described below, to aid in updating existing code. pc.setremotedescription(sessiondescription, successcallback, errorcallback); parameters successcallback a javascript function which
accepts no input parameters to be be called once the description has been successfully set. at that time, the offer can be sent to a remote peer via the signaling server. errorcallback a function matching the signautre rtcpeerconnectionerrorcallback which gets called if the description can't be set. it is passed a single domexception object explaining why the request failed. this deprecated form o...
RTCPeerConnection - Web APIs
constructorrtcpeerconnection() the rtcpeerconnection() constructor returns a newly-created rtcpeerconnection, which represents a connection between the local device and a remote peer.propertiesalso inherits properties from: eventtargetcantrickleicecandidatesthe read-only rtcpeerconnection property cantrickleicecandidates returns a boolean which indicates whether or not the remote peer can
accept trickled ice candidates.connectionstate the read-only connectionstate property of the rtcpeerconnection interface indicates the current state of the peer connection by returning one of the string values specified by the enum rtcpeerconnectionstate.currentlocaldescription read only the read-only property rtcpeerconnection.currentlocaldescription returns an rtcsessiondescription object describing ...
RTCRtpTransceiver.currentDirection - Web APIs
member of the rtcrtptransceiverdirection enumerated type. the rtcrtptransceiverdirection type is an enumeration of string values. each describes how the transceiver's associated rtcrtpsender and rtcrtpreceiver behave as shown in the table below. value rtcrtpsender behavior rtcrtpreceiver behavior "sendrecv" offers to send rtp data, and will do so if the other peer
accepts the connection and at least one of the sender's encodings is active1. offers to receive rtp data, and does so if the other peer
accepts. "sendonly" offers to send rtp data, and will do so if the other peer
accepts the connection and at least one of the sender's encodings is active1. does not offer to receive rtp data and will not do so. "recvonly" does not offer to ...
RTCRtpTransceiver.direction - Web APIs
ed type, indicating the transceiver's preferred direction. the rtcrtptransceiverdirection type is an enumeration of string values. each describes how the transceiver's associated rtcrtpsender and rtcrtpreceiver behave as shown in the table below. value rtcrtpsender behavior rtcrtpreceiver behavior "sendrecv" offers to send rtp data, and will do so if the other peer
accepts the connection and at least one of the sender's encodings is active1. offers to receive rtp data, and does so if the other peer
accepts. "sendonly" offers to send rtp data, and will do so if the other peer
accepts the connection and at least one of the sender's encodings is active1. does not offer to receive rtp data and will not do so. "recvonly" does not offer to ...
RTCRtpTransceiverDirection - Web APIs
the currentdirection properties are of this type. values the rtcrtptransceiverdirection type is an enumeration of string values. each describes how the transceiver's associated rtcrtpsender and rtcrtpreceiver behave as shown in the table below. value rtcrtpsender behavior rtcrtpreceiver behavior "sendrecv" offers to send rtp data, and will do so if the other peer
accepts the connection and at least one of the sender's encodings is active1. offers to receive rtp data, and does so if the other peer
accepts. "sendonly" offers to send rtp data, and will do so if the other peer
accepts the connection and at least one of the sender's encodings is active1. does not offer to receive rtp data and will not do so. "recvonly" does not offer to ...
RTCSessionDescriptionCallback - Web APIs
em to create offers or answers. because this function type is part of the legacy webrtc api, you should avoid using it (and the callback-based forms of createoffer() and createanswer() that make use of it). syntax rtcsessiondescriptioncallback(description); parameters description an rtcsessiondescriptioninit (or rtcsessiondescription) object describing the session being offered or being
accepted. this object contains the type and sdp properties which are part of rtcsessiondescription. return value the callback doesn't need to return anything, so the return value is undefined. example var pc = new rtcpeerconnection(); var descriptioncallback = function(offer) { pc.setlocaldescription(offer); } pc.createoffer(descriptioncallback); specifications specification status...
Using the Screen Capture API - Web APIs
ementations of startcapture() return the mediastream containing the captured display imagery. see options and constraints, below, for more on both how to specify the type of surface you want as well as other ways to adjust the resulting stream. example of a window allowing the user to select a display surface to capture you can then use the captured stream, capturestream, for anything that
accepts a stream as input. the examples below show a few ways to make use of the stream. visible vs logical display surfaces for the purposes of the screen capture api, a display surface is any content object that can be selected by the api for sharing purposes. sharing surfaces include the contents of a browser tab, a complete window, all of the applications of a window combined into a single surface...
SharedWorker() - Web APIs
the sharedworker() constructor creates a sharedworker object that executes the script at the specified url. this script must obey the same-origin policy. note: there is disagreement among browser manufacturers about whether a data uri is of the same origin or not. although gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7) and later
accept data uris, that's not the case in all other browsers. syntax var myworker = new sharedworker(aurl, name); var myworker = new sharedworker(aurl, options); parameters aurl a domstring representing the url of the script the worker will execute. 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 debuggin...
StorageManager.estimate() - Web APIs
ntly used in storageestimate.usage. the returned values are not exact; between compression, deduplication, and obfuscation for security reasons, they will be imprecise. you may find that the quota varies from origin to origin. this variance is based on factors such as: how often the user visits public site popularity data user engagement signals like bookmarking, adding to homescreen, or
accepting push notifications example in this example, we obtain the usage estimates and present the percentage of storage capacity currently used to the user. html content <label> you’re currently using about <output id="percent"> </output>% of your available storage. </label> javascript content navigator.storage.estimate().then(function(estimate) { document.getelementbyid("percent").val...
SubmitEvent.submitter - Web APIs
als established by the payment processors. each of the submit elements' id is used to identify which payment processor the button corresponds to. let form = document.queryselector("form"); form.addeventlistener("submit", (event) => { let submitter = event.submitter; let handler = submitter.id; if (handler) { processorder(form, handler); } else { showalertmessage("an unknown or un
accepted payment type was selected. please try again.", "ok"); } }); the handler id is obtained by using the submit event's submitter property to get the submit button, from which we then get the id. with that in hand, we can call a processorder() function to handle the order, passing along the form and the handler id. specifications specification status comment html l...
SubmitEvent - Web APIs
als established by the payment processors. each of the submit elements' id is used to identify which payment processor the button corresponds to. let form = document.queryselector("form"); form.addeventlistener("submit", (event) => { let submitter = event.submitter; let handler = submitter.id; if (handler) { processorder(form, handler); } else { showalertmessage("an unknown or un
accepted payment type was selected. please try again.", "ok"); } }); the handler id is obtained by using the submit event's submitter property to get the submit button, from which we then get the id. with that in hand, we can call a processorder() function to handle the order, passing along the form and the handler id. specifications specification status comment html l...
SubtleCrypto.importKey() - Web APIs
syntax const result = crypto.subtle.importkey( format, keydata, algorithm, extractable, usages ); parameters format is a string describing the data format of the key to import. it can be one of the following: raw: raw format. pkcs8: pkcs #8 format. ...
TextDecoder() - Web APIs
'iso-2022-jp' "csshiftjis", "ms_kanji", "shift-jis", "shift_jis", "sjis", "windows-31j", "x-sjis" 'shift-jis' "cseuckr", "csksc56011987", "euc-kr", "iso-ir-...
TextEncoder() - Web APIs
the textencoder() constructor returns a newly created utf-8 textencoder object. syntax encoder = new textencoder(); parameters textencoder() takes no parameters since firefox 48 and chrome 53 note: prior to firefox 48 and chrome 53, an encoding type label was
accepted as a paramer to the textencoder object, since then both browers have removed support for any encoder type other than utf-8, to match the spec. any type label passed into the textencoder constructor will now be ignored and a utf-8 textencoder will be created. exceptions textencoder() throws no exceptions since firefox 48 and chrome 53 note: prior to firefox 48 and chrome 53 an exception would be thrown for an unknown encoding type. specifications specification status comment encoding...
TextTrackList.onaddtrack - Web APIs
ack has been added to the media element whose text tracks the texttracklist represents. the event is passed into the event handler in the form of a trackevent object, whose track property identifies the newly-added track. note: you can also add a handler for the addtrack event using addeventlistener(). syntax texttracklist.onaddtrack = eventhandler; value set onaddtrack to a function that
accepts as input a trackevent object which indicates in its track property which video track has been added to the media. usage notes the addtrack event is called whenever a new track is added to the media element whose video tracks are represented by the texttracklist object. this happens when tracks are added to the element when the media is first attached to the element; one addtrack event will occ...
TextTrackList.onremovetrack - Web APIs
efore also from the texttracklist. the event is passed into the event handler in the form of a trackevent object, whose track property identifies the track that was removed from the media element's texttracklist. note: you can also add a handler for the removetrack event using addeventlistener(). syntax texttracklist.onremovetrack = eventhandler; value set onremovetrack to a function that
accepts as input a trackevent object which indicates in its track property which text track has been removed from the media element. example this simple example just fetches the current number of text tracks in the first media element whenever a track is removed from the media element. document.queryselectorall("video, audio")[0].texttracks.onremovetrack = function(event) { mytrackcount = document.
TreeWalker.currentNode - Web APIs
the treewalker.currentnode property represents the node on which the treewalker is currently pointing at. syntax node = treewalker.currentnode; treewalker.currentnode = node; example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); root = treewalker.currentnode; // the root element as it is the first element! specifications specification status comment domthe definition of 'treewalker.currrentnode' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.curr...
TreeWalker.expandEntityReferences - Web APIs
e to the treewalker. if this value is false, the children of entity reference nodes (as well as all of their descendants) are rejected. this takes precedence over the value of the treewalker.whattoshow method and the associated filter. syntax expand = treewalker.expandentityreferences; example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); expand = treewalker.expandentityreferences; specifications document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.expandentityreferences' in that specification. obsolete initial definition. ...
TreeWalker.filter - Web APIs
the treewalker.filter read-only property returns a nodefilter that is the filtering object associated with the treewalker. when creating the treewalker, the filter object is passed in as the third parameter, and its method nodefilter.
acceptnode() is called on every single node to determine whether or not to
accept it. syntax nodefilter = treewalker.filter; example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); nodefilter = treewalker.filter; // document.body in this case specifications specification status comment domthe definition of 'treewalker.filter' in that specification. living standard no change from document object mode...
TreeWalker.firstChild() - Web APIs
treewalker.firstchild() method moves the current node to the first visible child of the current node, and returns the found child. it also moves the current node to this child. if no such child exists, returns null and the current node is not changed. syntax node = treewalker.firstchild; example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); var node = treewalker.firstchild(); // returns the first child of the root element, or null if none specifications specification status comment domthe definition of 'treewalker.firstchild' in that specification. living standard no change from document object model (dom) level 2 traversal and...
TreeWalker.lastChild() - Web APIs
treewalker.lastchild() method moves the current node to the last visible child of the current node, and returns the found child. it also moves the current node to this child. if no such child exists, returns null and the current node is not changed. syntax node = treewalker.lastchild(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); var node = treewalker.lastchild(); // returns the last visible child of the root element specifications specification status comment domthe definition of 'treewalker.lastchild' in that specification. living standard no change from document object model (dom) level 2 traversal and range specif...
TreeWalker.nextNode() - Web APIs
the treewalker.nextnode() method moves the current node to the next visible node in the document order, and returns the found node. it also moves the current node to this one. if no such node exists, returns null and the current node is not changed. syntax node = treewalker.nextnode(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); var node = treewalker.nextnode(); // returns the first child of root, as it is the next node in document order specifications specification status comment domthe definition of 'treewalker.nextnode' in that specification. living standard no change from document object model (dom) level 2 trave...
TreeWalker.nextSibling() - Web APIs
the treewalker.nextsibling() method moves the current node to its next sibling, if any, and returns the found sibling. if there is no such node, return null and the current node is not changed. syntax node = treewalker.nextsibling(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); treewalker.firstchild(); var node = treewalker.nextsibling(); // returns null if the first child of the root element has no sibling specifications specification status comment domthe definition of 'treewalker.nextsibling' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification ...
TreeWalker.parentNode() - Web APIs
.parentnode() method moves the current node to the first visible ancestor node in the document order, and returns the found node. if no such node exists, or if it is above the treewalker's root node, returns null and the current node is not changed. syntax node = treewalker.parentnode(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); var node = treewalker.parentnode(); // returns null as there is no parent specifications specification status comment domthe definition of 'treewalker.parentnode' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification ...
TreeWalker.previousNode() - Web APIs
node in the document order, and returns the found node. it also moves the current node to this one. if no such node exists,or if it is before that the root node defined at the object construction, returns null and the current node is not changed. syntax node = treewalker.previousnode(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); var node = treewalker.previousnode(); // returns null as there is no parent specifications specification status comment domthe definition of 'treewalker.previousnode' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification ...
TreeWalker.previousSibling() - Web APIs
the treewalker.previoussibling() method moves the current node to its previous sibling, if any, and returns the found sibling. if there is no such node, return null and the current node is not changed. syntax node = treewalker.previoussibling(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); var node = treewalker.previoussibling(); // returns null as there is no previous sibiling specifications specification status comment domthe definition of 'treewalker.previoussibling' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification document object m...
TreeWalker.root - Web APIs
the treewalker.root read-only property returns the node that is the root of what the treewalker traverses. syntax root = treewalker.root; example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); root = treewalker.root; // document.body in this case specifications specification status comment domthe definition of 'treewalker.root' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.root' in that specification. obsolete initial definition. ...
TreeWalker.whatToShow - Web APIs
pear when traversing over the document tree. nodefilter.show_processing_instruction 64 shows processinginstruction nodes. nodefilter.show_text 4 shows text nodes. syntax nodetypes = treewalker.whattoshow; example var treewalker = document.createtreewalker( document.body, nodefilter.show_element + nodefilter.show_comment + nodefilter.show_text, {
acceptnode: function(node) { return nodefilter.filter_
accept; } }, false ); if( (treewalker.whattoshow == nodefilter.show_all) || (treewalker.whattoshow % (nodefilter.show_comment*2)) >= nodefilter.show_comment) { // treewalker will show comments } specifications specification status comment domthe definition of 'treewalker.whattoshow' in that specification. liv...
UIEvent() - Web APIs
ssociated with the event. uievent.detail lists the semantic for standard events. view: optional and defaulting to null, of type windowproxy, that is the window associated with the event . sourcecapabilities: an instance of the inputdevicecapabilities interface which provides information about the physical device responsible for generating a touch event. the uieventinit dictionary also
accepts fields from the eventinit dictionary. specifications specification status comment inputdevicecapabilities draft added sourcecapabilities property. document object model (dom) level 3 events specificationthe definition of 'uievent()' in that specification. obsolete initial definition. ...
UserDataHandler - Web APIs
obsolete since gecko 26 (firefox 26 / thunderbird 26 / seamonkey 2.23 / firefox os 1.2)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. summary when associating user data with a key on a node, node.setuserdata() can also
accept, in its third argument, a handler which will be called when the object is cloned, imported, deleted, renamed, or adopted. per the specification, exceptions should not be thrown in a userdatahandler. in both document.importnode() and node.clonenode(), although user data is not copied over, the handler will be called. properties none. methods handle (operation, key, data, src, dst) (no return value) this method is a callback which will be called if a node is be...
VideoTrackList.onaddtrack - Web APIs
has been added to the media element whose video tracks the videotracklist represents. the event is passed into the event handler in the form of a trackevent object, whose track property identifies the newly-added track. note: you can also add a handler for the addtrack event using addeventlistener(). syntax videotracklist.onaddtrack = eventhandler; value set onaddtrack to a function that
accepts as input a trackevent object which indicates in its track property which video track has been added to the media. usage notes the addtrack event is called whenever a new track is added to the media element whose video tracks are represented by the videotracklist object. this happens when tracks are added to the element when the media is first attached to the element; one addtrack event will oc...
VideoTrackList.onremovetrack - Web APIs
re also from the videotracklist. the event is passed into the event handler in the form of a trackevent object, whose track property identifies the track that was removed from the media element's videotracklist. note: you can also add a handler for the removetrack event using addeventlistener(). syntax videotracklist.onremovetrack = eventhandler; value set onremovetrack to a function that
accepts as input a trackevent object which indicates in its track property which video track has been removed from the media element. example this simple example just fetches the current number of video tracks in the media element whenever a track is removed from the media element. document.queryselector("my-video").videotracks.onremovetrack = function(event) { mytrackcount = document.queryselector...
WEBGL_color_buffer_float - Web APIs
on implicitly enables this extension. constants ext.rgba32f_ext rgba 32-bit floating-point color-renderable format. ext.rgb32f_ext ( ) rgb 32-bit floating-point color-renderable format. ext.framebuffer_attachment_component_type_ext ? ext.unsigned_normalized_ext ? extended methods this extension extends webglrenderingcontext.renderbufferstorage(): the internalformat parameter now
accepts ext.rgba32f_ext and ext.rgb32f_ext ( ). examples var ext = gl.getextension('webgl_color_buffer_float'); gl.renderbufferstorage(gl.renderbuffer, ext.rbga32f_ext, 256, 256); specifications specification status comment webgl_color_buffer_floatthe definition of 'webgl_color_buffer_float' in that specification. recommendation initial definition. ...
WEBGL_depth_texture - Web APIs
webgl2, the functionality of this extension is available on the webgl2 context by default. the constant in webgl2 is gl.unsigned_int_24_8. constants this extension adds a new constant: ext.unsigned_int_24_8_webgl unsigned integer type for 24-bit depth texture data. extended methods this extension extends webglrenderingcontext.teximage2d(): the format and internalformat parameters now
accept gl.depth_component and gl.depth_stencil. the type parameter now
accepts gl.unsigned_short, gl.unsigned_int, and ext.unsigned_int_24_8_webgl. the pixels parameter now
accepts an arraybufferview of type uint16array and uint32array. this extension extends webglrenderingcontext.framebuffertexture2d(): the attachment parameter now
accepts gl.depth_stencil_attachment. incorrectly stated as th...
WebGL2RenderingContext.drawBuffers() - Web APIs
ich fragment colors will be written. possible values are: gl.none: fragment shader output is not written into any color buffer. gl.back: fragment shader output is written into the back color buffer. gl.color_attachment{0-15}: fragment shader output is written in the nth color attachment of the current framebuffer. return value none. exceptions if buffers contains not one of the
accepted values, a gl.invalid_enum error is thrown. examples gl.drawbuffers([gl.none, gl.color_attachment1]); specifications specification status comment webgl 2.0the definition of 'drawbuffers' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gldrawbuffers' in that specification. standard man page of t...
WebGL2RenderingContext.drawElementsInstanced() - Web APIs
ned_byte gl.unsigned_short when using the oes_element_index_uint extension: gl.unsigned_int offset a glintptr specifying an offset in the element array buffer. must be a valid multiple of the size of the given type. instancecount a glsizei specifying the number of instances of the set of elements to execute. return value none. exceptions if mode is not one of the
accepted values, a gl.invalid_enum error is thrown. if offset is a valid multiple of the size of the given type, a gl.invalid_operation error is thrown. if count or instancecount are negative, a gl.invalid_value error is thrown. examples gl.drawelementsinstanced(gl.points, 2, gl.unsigned_short, 0, 4); specifications specification status comment webgl 2.0the definition of ...
WebGL2RenderingContext.drawRangeElements() - Web APIs
ecifying the number of elements to be rendered. type a glenum specifying the type of the values in the element array buffer. possible values are: gl.unsigned_byte gl.unsigned_short gl.unsigned_int offset a glintptr specifying an offset in the element array buffer. must be a valid multiple of the size of the given type. return value none. exceptions if mode is not one of the
accepted values, a gl.invalid_enum error is thrown. if offset is a valid multiple of the size of the given type, a gl.invalid_operation error is thrown. if count is negative, a gl.invalid_value error is thrown. examples gl.drawrangeelements(gl.points, 0, 7, 8, gl.unsigned_byte, 0); specifications specification status comment webgl 2.0the definition of 'drawrangeelements' ...
WebGL2RenderingContext - Web APIs
<canvas> element. to get an object of this interface, call getcontext() on a <canvas> element, supplying "webgl2" as the argument: var canvas = document.getelementbyid('mycanvas'); var gl = canvas.getcontext('webgl2'); webgl 2 is an extension to webgl 1. the webgl2renderingcontext interface implements all members of the webglrenderingcontext interface. some methods of the webgl 1 context can
accept additional values when used in a webgl 2 context. you will find this info noted on the webgl 1 reference pages. the webgl tutorial has more information, examples, and resources on how to get started with webgl. constants see the webgl constants page. state information webgl2renderingcontext.getindexedparameter() returns the indexed value for the given target. buffers webgl2rendering...
WebGLRenderingContext.clear() - Web APIs
can affect the clear() method. syntax void gl.clear(mask); parameters mask a glbitfield bitwise or mask that indicates the buffers to be cleared. possible values are: gl.color_buffer_bit gl.depth_buffer_bit gl.stencil_buffer_bit return value none. exceptions if mask is not one of the listed possible values, a gl.invalid_enum error is thrown. examples the clear() method
accepts multiple values. gl.clear(gl.depth_buffer_bit); gl.clear(gl.depth_buffer_bit | gl.color_buffer_bit); to get the current clear values, query the color_clear_value, depth_clear_value, and stencil_clear_value constants. gl.getparameter(gl.color_clear_value); gl.getparameter(gl.depth_clear_value); gl.getparameter(gl.stencil_clear_value); specifications specification status comm...
WebGLRenderingContext.drawArrays() - Web APIs
he last vertex back to the first. gl.lines: draws a line between a pair of vertices. gl.triangle_strip gl.triangle_fan gl.triangles: draws a triangle for a group of three vertices. first a glint specifying the starting index in the array of vector points. count a glsizei specifying the number of indices to be rendered. return value none. exceptions if mode is not one of the
accepted values, a gl.invalid_enum error is thrown. if first or count are negative, a gl.invalid_value error is thrown. if gl.current_program is null, a gl.invalid_operation error is thrown. examples gl.drawarrays(gl.points, 0, 8); specifications specification status comment webgl 1.0the definition of 'drawarrays' in that specification. recommendation initial defini...
WebGLRenderingContext.drawElements() - Web APIs
ifying the type of the values in the element array buffer. possible values are: gl.unsigned_byte gl.unsigned_short when using the oes_element_index_uint extension: gl.unsigned_int offset a glintptr specifying a byte offset in the element array buffer. must be a valid multiple of the size of the given type. return value none. exceptions if mode is not one of the
accepted values, a gl.invalid_enum error is thrown. if offset is not a valid multiple of the size of the given type, a gl.invalid_operation error is thrown. if count is negative, a gl.invalid_value error is thrown. examples gl.drawelements(gl.points, 8, gl.unsigned_byte, 0); specifications specification status comment webgl 1.0the definition of 'drawelements' in that spec...
WebGLRenderingContext.framebufferTexture2D() - Web APIs
positive z face of the cube. gl.texture_cube_map_negative_z: image for the negative z face of the cube. texture a webgltexture object whose image to attach. level a glint specifying the mipmap level of the texture image to be attached. must be 0. return value none. exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer. attachment is not one of the
accepted attachment points. textarget is not one of the
accepted texture targets. a gl.invalid_value error is thrown if level is not 0. a gl.invalid_operation error is thrown if texture isn't 0 or the name of an existing texture object. examples gl.framebuffertexture2d(gl.framebuffer, gl.color_attachment0, gl.texture_2d, texture, 0); specifications specification status com...
WebGLRenderingContext.getFramebufferAttachmentParameter() - Web APIs
views_ovr a glsizei indicating the number of views of the framebuffer object attachment. ext.framebuffer_attachment_texture_base_view_index_ovr a glint indicating the base view index of the framebuffer object attachment. exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer, gl.draw_framebuffer, gl.read_framebuffer or if attachment is not one of the
accepted attachment points. examples gl.getframebufferattachmentparameter(gl.framebuffer, gl.color_attachment0, gl.framebuffer_attachment_object_type); specifications specification status comment webgl 1.0the definition of 'getframebufferattachmentparameter' in that specification. recommendation initial definition for webgl. ...
WebGLRenderingContext.readPixels() - Web APIs
ew object to read data into. the array type must match the type of the type parameter. uint8array for gl.unsigned_byte. uint16array for gl.unsigned_short_5_6_5, gl.unsigned_short_4_4_4_4, or gl.unsigned_short_5_5_5_1. float32array for gl.float. dstoffset optional offset. defaults to 0. return value none. exceptions a gl.invalid_enum error is thrown if format or type is not an
accepted value. a gl.invalid_operation error is thrown if type is gl.unsigned_short_5_6_5 and format is not gl.rgb. type is gl.unsigned_short_4_4_4_4 and format is not gl.rgba. type does not match the typed array type of pixels. a gl.invalid_framebuffer_operation error is thrown if the currently bound framebuffer is not framebuffer complete. examples var canvas = document.getelemen...
WebGLRenderingContext.stencilOp() - Web APIs
fail a glenum specifying the function to use when the stencil test fails. the default value is gl.keep. zfail a glenum specifying the function to use when the stencil test passes, but the depth test fails. the default value is gl.keep. ...
WebGLRenderingContext.stencilOpSeparate() - Web APIs
face a glenum specifying whether the front and/or back stencil state is updated. the possible values are: gl.front gl.back gl.front_and_back fail a glenum specifying the function to use when the stencil test fails. the default value is gl.keep. ...
A basic 2D WebGL animation example - Web APIs
egrees) is set to 0.0, since we haven't performed any rotation yet, and the rotation speed (in degrees per screen refresh period, typically 60 fps) is set to 6. finally, animatescene() is called to render the first frame and schedule the rendering of the next frame of the animation. compiling and linking the shader program constructing and linking the program the buildshaderprogram() function
accepts as input an array of objects describing a set of shader functions to be compiled and linked into the shader program and returns the shader program after it's been built and linked. function buildshaderprogram(shaderinfo) { let program = gl.createprogram(); shaderinfo.foreach(function(desc) { let shader = compileshader(desc.id, desc.type); if (shader) { gl.attachshader(progra...
Using textures in WebGL - Web APIs
ear, as neither mipmap. gl.texparameteri(gl.texture_2d, gl.texture_min_filter, gl.linear); // prevents s-coordinate wrapping (repeating). gl.texparameteri(gl.texture_2d, gl.texture_wrap_s, gl.clamp_to_edge); // prevents t-coordinate wrapping (repeating). gl.texparameteri(gl.texture_2d, gl.texture_wrap_t, gl.clamp_to_edge); again, with these parameters, compatible webgl devices will automatically
accept any resolution for that texture (up to their maximum dimensions). without performing the above configuration, webgl requires all samples of npot textures to fail by returning transparent black: rgba(0,0,0,0). to load the image, add a call to our loadtexture() function within our main() function. this can be added after the initbuffers(gl) call. // load texture const texture = loadtexture(gl, 'c...
Introduction to WebRTC protocols - Web APIs
an still be discovered on the internet. some routers will have restrictions on who can connect to devices on the network. this can mean that even though we have the public ip address found by the stun server, not anyone can create a connection. in this situation we need to turn to turn. turn some routers using nat employ a restriction called ‘symmetric nat’. this means the router will only
accept connections from peers you’ve previously connected to. traversal using relays around nat (turn) is meant to bypass the symmetric nat restriction by opening a connection with a turn server and relaying all information through that server. you would create a connection with a turn server and tell all peers to send packets to the server which will then be forwarded to you. this obviously comes wi...
Taking still photos with WebRTC - Web APIs
on-zero (meaning that there's at least potentially valid image data), we set the width and height of the canvas to match that of the captured frame, then call drawimage() to draw the current frame of the video into the context, 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.todataurl() 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), w...
Using DTMF with WebRTC - Web APIs
newly-created answer by calling receiverpc.setlocaldescription(). then the answer is "transmitted" to the caller by calling callerpc.setremotedescription(). this lets the caller know what the receiver's configuration is. if at any time an error occurs, the catch() clause outputs an error message to the log. tracking other state changes we can also watch for changes to the signaling state (by
accepting signalingstatechange events) and the ice gathering state (by
accepting icegatheringstatechange events). we aren't using these for anything, so all we do is log them. we could simply have not set up these event listeners at all. function handlecallersignalingstatechangeevent() { log("caller's signaling state changed to " + callerpc.signalingstate); } function handlecallergatheringstatechang...
Writing WebSocket client applications - Web APIs
vailable in web workers. note: the example snippets in this article are taken 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 string...
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
igidtransform object which is the inverse of the parent transform. since the xrview representing the view has a transform property which is an xrrigidtransform providing the camera view, you can get the model view matrix—the transform matrix needed to move the world to simulate the desired camera position—like this: let viewmatrix = view.transform.inverse.matrix; if the library you're using
accepts an xrrigidtransform object directly, you can instead get view.transform.inverse, rather than pulling out just the array representing the view matrix. composing multiple transforms if your camera needs to be performing multiple transforms simultaneously, such as zooming and panning at the same time, you can multiply the transform matrices together to compose them into a single matrix that appli...
Fundamentals of WebXR - Web APIs
h as vr headsets and glasses with integrated augmented reality features. this includes both managing the process of rendering the views needed to simulate the 3d experience and the ability to sense the movement of the headset or other motion sensing apparatus to provide the needed data to let you update the imagery shown to the user based on that movement. webxr additionally provides support for
accepting inputs from control devices such as handheld vr controllers or specialized mixed reality gamepads. webxr is not a rendering technology, and provides no features for actually managing 3d data or rendering it to the display. this is an important fact to keep in mind; while webxr manages the timing, scheduling, and the various points of view relevant when drawing the scene, it does not actually ...
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
ng resumes you can detect when tracking has resumed after being lost when the user position jumps while at the same time the value of emulatedposition changes from true to false. how you handle this depends on your application. if your app provides a way for the user to move through the virtual world without physically moving in the real world (a so-called teleportation mechanic), you can simply
accept the new position and continue, allowing the jump from your previously-assumed position to be immediately corrected with the new position. on the other hand, if your app involves the user physically moving in real space to move around through your virtual world, simply adopting the new tracking position and jumping there can be unsettling to the user, and should be avoided if possible. instead, u...
Keyframe Formats - Web APIs
there are several options to this format, which are explained below. syntax there are two different ways to format keyframes: an array of objects (keyframes) consisting of properties and values to iterate over. this is the canonical format returned by the getkeyframes() method. element.animate([ { // from opacity: 0, color: "#fff" }, { // to opacity: 1, color: "#000" } ], 2000); offsets for each keyframe can be specified by providing an offset value. ...
Web Animations API Concepts - Web APIs
ly one kind of timeline object: the one based on the active document’s timeline. in the future we may see timeline objects that correspond to the length of the page, perhaps a scrolltimeline, or other things entirely. animation animation objects can be imagined as dvd players: they’re used for controlling media playback, but without media to play, they don’t do anything. animation objects
accept media in the form of animation effects, specifically keyframe effects (we’ll get to those in a moment). like a dvd player, we can use the animation object’s methods to play, pause, seek, and control the animation’s playback direction and speed. animation effect if animation objects are dvd players, we can think of animation effects, or keyframe effects, as dvds. keyframe effects are a b...
Web Animations API - Web APIs
ocumenttimeline and future timeline objects) and is not itself accessed by developers. animationevent actually part of css animations. documenttimeline represents animation timelines, including the default document timeline (accessed using the document.timeline property). effecttiming element.animate(), keyframeeffectreadonly.keyframeeffectreadonly(), and keyframeeffect.keyframeeffect() all
accept an optional dictionary object of timing properties. extensions to other interfaces the web animations api adds some new features to document and element. extensions to the document interface document.timeline the documenttimeline object representing the default document timeline. document.getanimations() returns an array of animation objects currently in effect on elements in the docume...
Using IIR filters - Web APIs
r iirfilter co-efficients when creating an iir filter, we pass in the feedforward and feedback coefficients as options (coefficients is how we describe the values). both of these parameters are arrays, neither of which can be larger than 20 items. when setting our coefficients, the feedforward values can't all be set to zero, otherwise nothing would be sent to the filter. something like this is
acceptable: let feedforward = [0.00020298, 0.0004059599, 0.00020298]; our feedback values cannot start with zero, otherwise on the first pass nothing would be sent back: let feedbackward = [1.0126964558, -1.9991880801, 0.9873035442]; note: these values are calculated based on the lowpass filter specified in the filter characteristics of the web audio api specification. as this filter node gains m...
WheelEvent() - Web APIs
are: constant value description dom_delta_pixel 0x00 the delta values are specified in pixels. dom_delta_line 0x01 the delta values are specified in lines. dom_delta_page 0x02 the delta values are specified in pages. the wheeleventinit dictionary also
accepts fields from the mouseeventinit, uieventinit and eventinit dictionaries. specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'wheelevent()' in that specification. obsolete initial definition ...
Window.requestFileSystem() - Web APIs
kers have decided that they will not implement it. it has even been removed from the proposed specification. do not use this method! syntax this method is prefixed with webkit in all browsers that implement it (that is, google chrome). window.requestfilesystem(type, size, successcallback[, errorcallback]); parameters type the type of storage to request. specify window.temporary if it's
acceptable for the browser to delete the files at its own discretion, such as if storage space runs low, or window.persistent if you need the files to remain in place unless the user or the web site or app explicitly permit it. persistent storage requires that the user grant the site quota. size the amount of storage space you wish to have allocated for your app's use. successcallback a function whi...
Window - Web APIs
windoworworkerglobalscope.btoa() creates a base-64 encoded ascii string from a string of binary data. windoworworkerglobalscope.clearinterval() cancels the repeated execution set using windoworworkerglobalscope.setinterval(). windoworworkerglobalscope.cleartimeout() cancels the delayed execution set using windoworworkerglobalscope.settimeout(). windoworworkerglobalscope.createimagebitmap()
accepts a variety of different image sources, and returns a promise which resolves to an imagebitmap. optionally the source is cropped to the rectangle of pixels originating at (sx, sy) with width sw, and height sh. windoworworkerglobalscope.fetch() starts the process of fetching a resource from the network. eventtarget.removeeventlistener removes an event listener from the window. windoworworkergl...
self.createImageBitmap() - Web APIs
the createimagebitmap() method creates a bitmap from a given source, optionally cropped to contain only a portion of that source. the method exists on the global scope in both windows and workers. it
accepts a variety of different image sources, and returns a promise which resolves to an imagebitmap. syntax const imagebitmappromise = createimagebitmap(image[, options]); const imagebitmappromise = createimagebitmap(image, sx, sy, sw, sh[, options]); parameters image an image source, which can be an <img>, svg <image>, <video>, <canvas>, htmlimageelement, svgimageelement, htmlvideoelement, htmlcanvaselement, blob, imagedata, imagebitmap, or offscreencanvas object. sx the x coordinate of the reference point of the rectangle from which the imagebitmap will be extracted. sy the y coordina...
WindowOrWorkerGlobalScope.fetch() - Web APIs
er 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 corrected in firefox 65 — see bug 1508661). headers any h...
WindowOrWorkerGlobalScope - Web APIs
windoworworkerglobalscope.btoa() creates a base-64 encoded ascii string from a string of binary data. windoworworkerglobalscope.clearinterval() cancels the repeated execution set using windoworworkerglobalscope.setinterval(). windoworworkerglobalscope.cleartimeout() cancels the delayed execution set using windoworworkerglobalscope.settimeout(). windoworworkerglobalscope.createimagebitmap()
accepts a variety of different image sources, and returns a promise which resolves to an imagebitmap. optionally the source is cropped to the rectangle of pixels originating at (sx, sy) with width sw, and height sh. windoworworkerglobalscope.fetch() starts the process of fetching a resource from the network. windoworworkerglobalscope.queuemicrotask() enqueues a microtask—a short function to be exe...
Worker() - Web APIs
the worker() constructor creates a worker object that executes the script at the specified url. this script must obey the same-origin policy. note: that there is a disagreement among browser manufacturers about whether a data uri is of the same origin or not. though gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7) and later
accept data uris, that's not the case in all other browsers. syntax var myworker = new worker(aurl, options); parameters aurl a usvstring representing the url of the script the worker will execute. 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...
WorkerGlobalScope - Web APIs
windoworworkerglobalscope.btoa() creates a base-64 encoded ascii string from a string of binary data. windoworworkerglobalscope.clearinterval() cancels the repeated execution set using windoworworkerglobalscope.setinterval(). windoworworkerglobalscope.cleartimeout() cancels the delayed execution set using windoworworkerglobalscope.settimeout(). windoworworkerglobalscope.createimagebitmap()
accepts a variety of different image sources, and returns a promise which resolves to an imagebitmap. optionally the source is cropped to the rectangle of pixels originating at (sx, sy) with width sw, and height sh. windoworworkerglobalscope.fetch() starts the process of fetching a resource from the network. windoworworkerglobalscope.setinterval() schedules a function to execute every time a given n...
WritableStreamDefaultWriter.write() - Web APIs
the write() property of the writablestreamdefaultwriter interface writes a passed chunk of data to a writablestream and its underlying sink, then returns a promise that resolves to indicate the success or failure of the write operation. note that what "success" means is up to the underlying sink; it might indicate simply that the chunk has been
accepted, and not necessarily that it is safely saved to its ultimate destination. syntax var promise = writablestreamdefaultwriter.write(chunk); parameters chunk a block of binary data to pass to the writablestream. return value a promise, which fulfills with the undefined upon a successful write, or rejects if the write fails or stream becomes errored before the writing process is initiated. exceptions typeerror the target stream is n...
Sending and Receiving Binary Data - Web APIs
throw away high-order byte (f7) the example above fetches the byte at offset x within the loaded binary data. the valid range for x is from 0 to filestream.length-1. see downloading binary streams with xmlhttprequest for a detailed explanation. see also downloading files. sending binary data the send method of the xmlhttprequest has been extended to enable easy transmission of binary data by
accepting an arraybuffer, blob, or file object. the following example creates a text file on-the-fly and uses the post method to send the "file" to the server. this example uses plain text, but you can imagine the data being a binary file instead. var oreq = new xmlhttprequest(); oreq.open("post", url, true); oreq.onload = function (oevent) { // uploaded. }; var blob = new blob(['abc123'], {type: '...
XMLHttpRequest.getAllResponseHeaders() - Web APIs
if a network error happened, an empty string is returned. an example of what a raw header string looks like: date: fri, 08 dec 2017 21:04:30 gmt\r\n content-encoding: gzip\r\n x-content-type-options: nosniff\r\n server: meinheld/0.6.1\r\n x-frame-options: deny\r\n content-type: text/html; charset=utf-8\r\n connection: keep-alive\r\n strict-transport-security: max-age=63072000\r\n vary: cookie,
accept-encoding\r\n content-length: 6502\r\n x-xss-protection: 1; mode=block\r\n each line is terminated by both carriage return and line feed characters (\r\n). these are essentially delimiters separating each of the headers. note: in modern browsers, the header names are returned in all lower case, as per the latest spec. example this example examines the headers in the request's readystatechang...
XMLHttpRequest.send() - Web APIs
the xmlhttprequest method send() sends the request to the server. if the request is asynchronous (which is the default), this method returns as soon as the request is sent and the result is delivered using events. if the request is synchronous, this method doesn't return until the response has arrived. send()
accepts an optional parameter which lets you specify the request's body; this is primarily used for requests such as put. if the request method is get or head, the body parameter is ignored and the request body is set to null. if no
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 w...
XMLHttpRequest.setRequestHeader() - Web APIs
alue of an http request header. when using setrequestheader(), you must call it after calling open(), but before calling send(). if this method is called several times with the same header, the values are merged into one single request header. each time you call setrequestheader() after the first time you call it, the specified text is appended to the end of the existing header's content. if no
accept header has been set using this, an
accept header with the type "*/*" is sent with the request when send() is called. for security reasons, some headers can only be controlled by the user agent. these headers include the forbidden header names and forbidden response header names. note: for your custom fields, you may encounter a "not allowed by access-control-allow-headers in preflight respons...
XMLSerializer - Web APIs
ually instead call importnode() method to import the new node into the dom, then call one of the following methods to add the node to the dom tree: the document and element methods append() and prepend() the node.replacewith() method (to replace an existing node with the new one) the document.insertadjacentelement() and element.insertadjacentelement() methods. because insertadjacenthtml()
accepts a string and not a node as its second parameter, xmlserializer is used to first convert the node into a string. var inp = document.createelement('input'); var xmls = new xmlserializer(); var inp_xmls = xmls.serializetostring(inp); // first convert dom node into a string // insert the newly created node into the document's body document.body.insertadjacenthtml('afterbegin', inp_xmls); the code...
XRInputSourceArray.forEach() - Web APIs
the xrinputsourcearray method foreach() executes the specified callback once for each input source in the array, starting at index 0 and progressing until the end of the list. syntax xrinputsourcearray.foreach(callback, thisarg); parameters callback a function to execute once for each entry in the array xrinputsourcearray. the callback
accepts up to three parameters: currentvalue a xrinputsource object which is the value of the item from within the xrinputsourcearray which is currently being processed. currentindex optional an integer value providing the index into the array at which the element given by currentvalue is located. if you don't need to know the index number, you can omit this. sourcelist optional the xrinputsourcearray object which is being processed. if...
Using the article role - Accessibility
the article role is used to identify a section of a page that forms an independent part of a document, page or site. examples of an article include web log posts, newspaper or magazine articles and use-submitted comments. it is independent in that its contents could stand alone, for example in syndication. articles can be nested; for example, a web log entry on a site that
accepts user-submitted comments could represent the comments as articles nested within the article for the web log entry. the aria article role is similar to the html5 article element; however the article element should still be given the aria role of article, since not all assistive technologies support html5 yet. possible effects on user agents and assistive technology when the user navigates an element assigned...
ARIA: Comment role - Accessibility
class="comment-text">i really think this moment could use more cowbell.</p> <p><time datetime="2019-03-30t19:29">march 30 2019, 19:29</time></p> </div> to associate the comment with the text being commented, we need to wrap the commented text with an element containing the aria-details attribute, the value of which should be the id of the comment. ...
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
elshutdown">shut down computer after</span> <input aria-labelledby="labelshutdown shutdowntime shutdownunit" id="shutdowntime" type="text" value="10" /> <span id="shutdownunit"> minutes</span> a note for jaws 8 users jaws 8.0 has its own logic to find labels, causing it to always override the accessiblename the textbox of an html document gets. with jaws 8, i have not found a way to make it to
accept the label from the example above. but nvda and window-eyes do it just fine, and orca on linux also has no problems. tbd: add more compatibility info can this be done without aria? community member ben millard has pointed out in a blog post that controls can be embedded in labels as shown in the above example using html 4, simply by embedding the input into the label. thanks for that info, ben!
Operable - Accessibility
users with conditions such as epilepsy or could cause physical reactions (like dizziness) for users with conditions such as vestibular disorders. success criteria how to conform to the criteria practical resource 2.3.1 three flashes, or below threshold (a) content doesn't contain any aspect that flashes more than three times per second, or flashing content is below
acceptable flash and red flash thresholds. 2.3.2 three flashes (aaa) content doesn't contain any aspect that flashes more than three times per second. 2.3.3 animations from interactions (aaa) added in 2.1 allow users to disable animations from interactions (unless the animation is essential). understanding animations from interactions note: also see the wcag d...
-moz-user-focus - CSS: Cascading Style Sheets
<xul:textbox> elements, because the textbox itself never takes focus. instead, xbl creates an anonymous html <input> element inside the textbox, and that element is what receives focus. you can stop the textbox from taking keyboard focus by setting its tab index to -1, and from taking mouse focus by preventing the default action of mousedown events. syntax values ignore the element does not
accept the keyboard focus and will be skipped in the tab order. normal the element can
accept the keyboard focus. select-after ? select-before ? select-menu ? select-same ? select-all ? none ? formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax ignore | normal | select-after | select-before | select-menu | ...
::after (:after) - CSS: Cascading Style Sheets
{ content: "→"; } note: the pseudo-elements generated by ::before and ::after are contained by the element's formatting box, and thus don't apply to replaced elements such as <img>, or to <br> elements. syntax /* css3 syntax */ ::after /* css2 syntax */ :after note: css3 introduced the ::after notation (with two colons) to distinguish pseudo-classes from pseudo-elements. browsers also
accept :after, introduced in css2. examples simple usage let's create two classes: one for boring paragraphs and one for exciting ones. we can use these classes to add pseudo-elements to the end of paragraphs. html <p class="boring-text">here is some plain old boring text.</p> <p>here is some normal text that is neither boring nor exciting.</p> <p class="exciting-text">contributing to mdn is easy ...
::before (:before) - CSS: Cascading Style Sheets
content: "♥"; } note: the pseudo-elements generated by ::before and ::after are contained by the element's formatting box, and thus don't apply to replaced elements such as <img>, or to <br> elements. syntax /* css3 syntax */ ::before /* css2 syntax */ :before note: css3 introduced the ::before notation (with two colons) to distinguish pseudo-classes from pseudo-elements. browsers also
accept :before, introduced in css2. examples adding quotation marks one simple example of using ::before pseudo-elements is to provide quotation marks. here we use both ::before and ::after to insert quotation characters. html <q>some quotes,</q> he said, <q>are better than none.</q> css q::before { content: "«"; color: blue; } q::after { content: "»"; color: red; } result decorat...
::first-letter (:first-letter) - CSS: Cascading Style Sheets
ed by browsers; see the browser compatibility table below.) a combination of the ::before pseudo-element and the content property may inject some text at the beginning of the element. in that case, ::first-letter will match the first letter of this generated content. css3 introduced the ::first-letter notation (with two colons) to distinguish pseudo-classes from pseudo-elements. browsers also
accept :first-letter, introduced in css2. allowable properties only a small subset of css properties can be used with the ::first-letter pseudo-element: all font properties : font, font-style, font-feature-settings, font-kerning, font-language-override, font-stretch, font-synthesis, font-variant, font-variant-alternates, font-variant-caps, font-variant-east-asian, font-variant-ligatures, font-vari...
::first-line (:first-line) - CSS: Cascading Style Sheets
o the first line of a block-level element. note that the length of the first line depends on many factors, including the width of the element, the width of the document, and the font size of the text. /* selects the first line of a <p> */ p::first-line { color: red; } css3 introduced the ::first-line notation (with two colons) to distinguish pseudo-classes from pseudo-elements. browsers also
accept :first-line, introduced in css2. allowable properties only a small subset of css properties can be used with the ::first-line pseudo-element: all font-related properties: font, font-kerning, font-style, font-variant, font-variant-numeric, font-variant-position, font-variant-east-asian, font-variant-caps, font-variant-alternates, font-variant-ligatures, font-synthesis, font-feature-settings,...
:enabled - CSS: Cascading Style Sheets
/* 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. ...
:lang() - CSS: Cascading Style Sheets
ote: in html, the language is determined by a combination of the lang attribute, the <meta> element, and possibly by information from the protocol (such as http headers). for other document types there may be other document methods for determining the language. syntax formal syntax :lang( <language-code> ) parameter <language-code> a <string> representing the language you want to target.
acceptable values are specified in the html spec. examples in this example, the :lang() pseudo-class is used to match the parents of quote elements (<q>) using child combinators. note that this doesn't illustrate the only way to do this, and that the best method to use depends on the type of document. also note that unicode values are used to specify some of the special quote characters. html <div ...
font-stretch - CSS: Cascading Style Sheets
ce than normal, with ultra-condensed as the most condensed. semi-expanded, expanded, extra-expanded, ultra-expanded specifies a more expanded font face than normal, with ultra-expanded as the most expanded. <percentage> a <percentage> value between 50% and 200% (inclusive). negative values are not allowed for this property. in earlier versions of the font-stretch specification, the property
accepts only the nine keyword values. css fonts level 4 extends the syntax to
accept a <percentage> value as well. this enables variable fonts to offer something more like a continuum of character widths. for truetype or opentype variable fonts, the "wdth" variation is used to implement varying widths. if the font does not provide a face that exactly matches the given value, then values less than 100% ...
-moz-device-pixel-ratio - CSS: Cascading Style Sheets
and by ie 11 for windows phone 8.1 as -webkit-device-pixel-ratio. the min and max prefixes as implemented by gecko are named min--moz-device-pixel-ratio and max--moz-device-pixel-ratio; but the same prefixes as implemented by webkit are named -webkit-min-device-pixel-ratio and -webkit-max-device-pixel-ratio. syntax <number> the number of device pixels per css pixel. media: media/visual
accepts min/max prefixes: yes examples basic compatibility example -moz-device-pixel-ratio may be used for compatibility with firefox older than 16, and alongside -webkit-device-pixel-ratio for compatibility with webkit-based browsers that do not support dppx. example: @media (-webkit-min-device-pixel-ratio: 2), /* webkit-based browsers */ (min--moz-device-pixel-ratio: 2), /* older firefo...
-ms-high-contrast - CSS: Cascading Style Sheets
application is being displayed in high contrast mode, and with what color variation. high contrast mode is a specialized display mode that prioritizes making content as legible as possible by dynamically replacing foreground and background colors with a user-specified theme. for web content, theme colors are mapped to content types. this media feature applies to bitmap media types. it does not
accept min/max prefixes. syntax the -ms-high-contrast media feature is specified as one of the following values. values none ... no longer supported as of microsoft edge 18. active indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with any color variation. black-on-white indicates that the subsequent styling rules will be appl...
shape - CSS: Cascading Style Sheets
rect the shape is an axis aligned rectangle or square, or a similar shape such as rounded rectangle for which the traditional designs are appropriate. round the shape is rounded or a similar shape to the circle such as an oval, an ellipse for which distinctively rounded designs are appropriate. ...
@media - CSS: Cascading Style Sheets
specifications specification comment feedback media queries level 5the definition of '@media descriptors' in that specification. reinstates ...
Coordinate systems - CSS: Cascading Style Sheets
= document.queryselector(".log"); function setcoords(e, type) { let idx = type + "x"; let idy = type + "y"; document.getelementbyid(idx).innertext = e[idx]; document.getelementbyid(idy).innertext = e[idy]; } a reference to the <div> inside the inner box which contains the paragraphs that will show the coordinate information is fetched into log. the setcoords() function is designed to
accept as input a mouseevent and the name of the origin to use when obtaining the coordinates. the implementation is then quite simple. the variables idx and idy are set to strings with the names of the properties corresponding to the coordinates in the given coordinate system. for example, if the value of type is "page", then idx is "pagex" and idy is "pagey". handling the mouse events setcoords() is...
Using CSS animations - CSS: Cascading Style Sheets
for the different animations. let’s look at some quick examples to explain the different permutations: in this first example, we have three animation names set, but only one duration and iteration count. in this case a...
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
cal-lr then you can set writing-mode: vertical-lr on the element and this will change the direction of the blocks and therefore the inline direction as well. while certain languages will use a particular writing mode or text direction, we can also use these properties for creative effect, such as running a heading vertically. the writing-mode property and block flow the writing-mode property
accepts the values horizontal-tb, vertical-rl and vertical-lr. these values control the direction that blocks flow on the page. the initial value is horizontal-tb, which is a top to bottom block flow direction with a horizontal inline direction. left to right languages, such as english, and right to left languages. such as arabic, are all horizontal-tb. the following example shows blocks using horizont...
Logical properties for margins, borders and padding - CSS: Cascading Style Sheets
u can also try changing the writing-mode from horizontal-tb to vertical-rl. again, notice how the margins stay in the same place for the first box, but switch around to follow the text direction in the second. margin shorthands as we can now target both sides of a box — either both inline sides or both block sides — there are new shorthands available, margin-inline and margin-block, which
accept two values. the first value will apply to the start of that dimension, the second to the end. if you only use one value it is applied to both. in a horizontal writing mode this css would apply a 5px margin to the top of the box and a 10px margin to the bottom. .box { margin-block: 5px 10px; } note: the shorthand properties margin-inline and margin-block shipped in firefox 66. as these are n...
Shorthand properties - CSS: Cascading Style Sheets
d, the margins apply to the top, right, bottom, and left in that order (clockwise). the universal shorthand property css provides a universal shorthand property, all, which applies its value to every property in the document. its purpose is to change the properties' inheritance model to one of: css provides four special universal property values for controlling inheritance. every css property
accepts these values. inherit sets the property value applied to a selected element to be the same as that of its parent element. effectively, this "turns on inheritance". initial sets the property value applied to a selected element to the initial value of that property. unset resets the property to its natural value, which means that if the property is naturally inherited it acts like inherit,...
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
owser which supports css custom properties to choose a different value if the given variable isn't defined or has an invalid value. the first argument to the function is the name of the custom property to be substituted. the second argument to the function, if provided, is a fallback value, which is used as the substitution value when the referenced custom property is invalid. the function only
accepts two parameters, assigning everything following the first comma as the second parameter. if that second parameter is invalid, such as if a comma-separated list is provided, the fallback will fail. for example: .two { color: var(--my-var, red); /* red if --my-var is not defined */ } .three { background-color: var(--my-var, var(--my-background, pink)); /* pink if --my-var and --my-background ...
Value definition syntax - CSS: Cascading Style Sheets
teractions between them. a component can be a keyword, some characters considered as a literal, or a value of a given css data type or of another css property. component value types keywords generic keywords a keyword with a predefined meaning appears literally, without quotation marks. for example: auto, smaller or ease-in. the specific case of inherit, initial and unset all css properties
accept the keywords inherit, initial and unset, that are defined throughout css. they are not shown in the value definition, and are implicitly defined. literals in css, a few characters can appear on their own, like the slash ('/') or the comma (','), and are used in a property definition to separate its parts. the comma is often used to separate values in enumerations, or parameters in mathematical-...
animation - CSS: Cascading Style Sheets
rst value that can be parsed as a <time> is assigned to the animation-duration, and the second one is assigned to animation-delay. the order within each animation definition is also important for distinguishing animation-name values from other keywords. when parsed, keywords that are valid for properties other than animation-name, and whose values were not found earlier in the shorthand, must be
accepted for those properties rather than for animation-name. furthermore, when serialized, default values of other properties must be output in at least the cases necessary to distinguish an animation-name that could be a value of another property, and may be output in additional cases. values <single-animation-iteration-count> the number of times the animation is played. the value must be one of ...
aspect-ratio - CSS: Cascading Style Sheets
this appears in the browser's internal ua stylesheet. chrome is also shipping this feature. in firefox, the internal stylesheet rule looks like this: img, input[type="image"], video, embed, iframe, marquee, object, table { aspect-ratio: attr(width) / attr(height); } specifications specification status comment css box sizing module le...
background-size - CSS: Cascading Style Sheets
dimension, if there is one. if there is no such intrinsic dimension, it becomes the corresponding dimension of the background positioning area. note: background sizing for vector images that lack intrinsic dimensions or proportions is not yet fully implemented in all browsers. be careful about relying on the behavior described above, and test in multiple browsers to be sure the results are
acceptable. working with gradients if you use a <gradient> as the background and specify a background-size to go with it, it's best not to specify a size that uses a single auto component, or is specified using only a width value (for example, background-size: 50%). rendering of <gradient>s in such cases changed in firefox 8, and at present is generally inconsistent across browsers, which do not all ...
box-sizing - CSS: Cascading Style Sheets
ith the area for content being 330px wide. the content box can't be negative and is floored to 0, making it impossible to use border-box to make the element disappear. here the dimensions of the element are calculated as: width = border + padding + width of the content, and height = border + padding + height of the content. formal definition initial valuecontent-boxapplies toall elements that
accept width or heightinheritednocomputed valueas specifiedanimation typediscrete formal syntax content-box | border-box examples box sizes with content-box and border-box this example shows how different box-sizing values alter the rendered size of two otherwise identical elements. html <div class="content-box">content box</div> <br> <div class="border-box">border box</div> css div { width: ...
calc() - CSS: Cascading Style Sheets
zoomed. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 usage with integers when calc() is used where an <integer> is expected, the value will be rounded to the nearest integer. for example: .modal { z-index: calc(3 / 2); } this will give .modal a final z-index value of 2. note: the chrome browser currently won’t
accept some values returned by calc() when an integer is expected. this includes any division, even if it results in an integer. ie. z-index: calc(4 / 2); will not be
accepted. examples positioning an object on screen with a margin calc() makes it easy to position an object with a set margin. in this example, the css creates a banner that stretches across the window, with a 40-pixel gap between both...
conic-gradient() - CSS: Cascading Style Sheets
and then specifying a list of color-stops. unlike linear and radial gradients, whose color-stops are placed by specifying a length, the color-stops of a conic gradient are specified with an angle. units include deg for degrees, grad for gradients, rad for radians, and turn for turns. there are 360 degrees, 400 gradians, 2π radians, and 1 turn in a circle. browsers supporting conic gradients also
accept percent values, with 100% equaling 360 degrees, but this is not in the specification. similar to radial gradients, the conic gradient syntax provides for positioning the center of the gradient anywhere within, or even outside, the image. the values for the position are similar to the syntax for 2-value background-position. the gradient arc is the circumference of the gradient. the starting poin...
drop-shadow() - CSS: Cascading Style Sheets
olor and composited below the image. note: this function is somewhat similar to the box-shadow property. the box-shadow property creates a rectangular shadow behind an element's entire box, while the drop-shadow() filter function creates a shadow that conforms to the shape (alpha channel) of the image itself. syntax drop-shadow(offset-x offset-y blur-radius color) the drop-shadow() function
accepts a parameter of type <shadow> (defined in the box-shadow property), with the exception that the inset keyword and spread parameters are not allowed. parameters offset-x offset-y (required) two <length> values that determine the shadow offset. offset-x specifies the horizontal distance, where negative values place the shadow to the left of the element. offset-y specifies the vertical distance...
fit-content() - CSS: Cascading Style Sheets
nimum size by auto, which is calculated similar to auto (i.e., minmax(auto, max-content)), except that the track size is clamped at argument if it is greater than the auto minimum. the function can also be used as laid out box size for width, height, min-width, min-height, max-width and max-height, where the maximum and minimum sizes refer to the content size. syntax the fit-content() function
accepts a <length> or a <percentage> as an argument. /* <length> values */ fit-content(200px) fit-content(5cm) fit-content(30vw) fit-content(100ch) /* <percentage> value */ fit-content(40%) values <length> an absolute length. <percentage> a percentage relative to the available space in the given axis. in grid properties it is relative to the inline size of the grid container in column tracks ...
flex-direction - CSS: Cascading Style Sheets
the main-start and main-end points are the same as the content direction. row-reverse behaves the same as row but the main-start and main-end points are permuted. column the flex container's main-axis is the same as the block-axis. the main-start and main-end points are the same as the before and after ...
flex-wrap - CSS: Cascading Style Sheets
mples and send us a pull request. see using css flexible boxes for more properties and information. syntax flex-wrap: nowrap; /* default value */ flex-wrap: wrap; flex-wrap: wrap-reverse; /* global values */ flex-wrap: inherit; flex-wrap: initial; flex-wrap: unset; the flex-wrap property is specified as a single keyword chosen from the list of values below. values the following values are
accepted: nowrap the flex items are laid out in a single line which may cause the flex container to overflow. the cross-start is either equivalent to start or before depending on the flex-direction value. this is the default value. wrap the flex items break into multiple lines. the cross-start is either equivalent to start or before depending flex-direction value and the cross-end is the opposite ...
font-family - CSS: Cascading Style Sheets
t the first font in the list that is installed or that can be downloaded using a @font-face at-rule. it is often convenient to use the shorthand property font to set font-size and other font related properties all at once. you should always include at least one generic family name in a font-family list, since there's no guarantee that any given font is available. this lets the browser select an
acceptable fallback font when necessary. the font-family property specifies a list of fonts, from highest priority to lowest. font selection does not simply stop at the first font in the list that is on the user's system. rather, font selection is done one character at a time, so that if an available font does not have a glyph for a needed character, the latter fonts are tried. (however, this doesn't w...
font-stretch - CSS: Cascading Style Sheets
ce than normal, with ultra-condensed as the most condensed. semi-expanded, expanded, extra-expanded, ultra-expanded specifies a more expanded font face than normal, with ultra-expanded as the most expanded. <percentage> a <percentage> value between 50% and 200% (inclusive). negative values are not allowed for this property. in earlier versions of the font-stretch specification, the property
accepts only the nine keyword values. css fonts level 4 extends the syntax to
accept a <percentage> value as well. this enables variable fonts to offer something more like a continuum of character widths. for truetype or opentype variable fonts, the "wdth" variation is used to implement varying widths. however, note that the <percentage> syntax is not yet supported by all browsers: check the browser co...
font-style - CSS: Cascading Style Sheets
e <angle> modifier for the oblique keyword. for truetype or opentype variable fonts, the "slnt" variation is used to implement varying slant angles for oblique, and the "ital" variation with a value of 1 is used to implement italic values. see font-variation-settings. for the example below to work, you'll need a browser that supports the css fonts level 4 syntax in which font-style: oblique can
accept an <angle>. html <header> <input type="range" id="slant" name="slant" min="-90" max="90" /> <label for="slant">slant</label> </header> <div class="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 /* amstelvaralpha-vf is created by david berlow (https://g...
grid-template - CSS: Cascading Style Sheets
uto for any missing sizes), and splicing in the named lines defined before/after each size, and grid-template-columns to the track listing specified after the slash (or none, if not specified). note: the repeat() function isn’t allowed in these track listings, as the tracks are intended to visually line up one-to-one with the rows/columns in the “ascii art”. note: the grid shorthand
accepts the same syntax, but also resets the implicit grid properties to their initial values. use grid (as opposed to grid-template) to prevent these values from cascading in seperately. formal definition initial valueas each of the properties of the shorthand:grid-template-columns: nonegrid-template-rows: nonegrid-template-areas: noneapplies togrid containersinheritednopercentagesas each of the prop...
image-rendering - CSS: Cascading Style Sheets
elated; /* global values */ image-rendering: inherit; image-rendering: initial; image-rendering: unset; values auto the scaling algorithm is ua dependent. since version 1.9 (firefox 3.0), gecko uses bilinear resampling (high quality). smooth the image should be scaled with an algorithm that maximizes the appearance of the image. in particular, scaling algorithms that "smooth" colors are
acceptable, such as bilinear interpolation. this is intended for images such as photos. high-quality identical to smooth, but with a preference for higher-quality scaling. if system resources are constrained, images with high-quality should be prioritized over those with any other value, when considering which images to degrade the quality of and to what degree. crisp-edges the image must be scale...
<length-percentage> - CSS: Cascading Style Sheets
.5em; /* length examples */ text-shadow: 1px 1px 1px red; border: 5px solid red; letter-spacing: 3px; /* percentage example */ text-size-adjust: 20%; } result use in calc() where a <length-percentage> is specified as an allowable type, this means that the percentage resolves to a length and therefore can be used in a calc() expression. therefore, all of the following values are
acceptable for width: width: 200px; width: 20%; width: calc(100% - 200px); specifications specification status comment css values and units module level 4the definition of '<length-percentage>' in that specification. editor's draft css values and units module level 3the definition of '<length-percentage>' in that specification. candidate recommendation ...
<position> - CSS: Cascading Style Sheets
this is not allowed in other properties that use <position>. interpolation when animated, a point's abscissa and ordinate values are interpolated independently. however, because the speed of the interpolation is determined by a single timing function for both coordinates, the point will move in a straight line. examples valid positions center left center top right 8.
repeating-conic-gradient() - CSS: Cascading Style Sheets
e, the center of the gradient, and then specifying a list of color-stops. like non-repeating conic gradients, the color-stops of a repeating conic gradient are specified with an <angle>. units include deg for degrees, grad for gradients, rad for radians, and turn for turns. there are 360 degrees, 400 gradians, 2π radians, and 1 turn in a circle. browsers supporting repeating conic gradients also
accept percent values, with 100% equaling 360 degrees, but this is not in the specification. radial and conic gradient syntax provides for positioning the center of the gradient anywhere within, or even outside, the image. the values for the position are similar to the syntax for 2-value background-position. the gradient arc is part of the circumference of the gradient. 0 degress is north, or 12:00pm.
text-shadow - CSS: Cascading Style Sheets
each shadow is described by some combination of x and y offsets from the element, blur radius, and color. 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. ...
<time-percentage> - CSS: Cascading Style Sheets
r <time> and <percentage> for details of the individual syntaxes allowed by this type. examples use in calc() where a <time-percentage> is specified as an allowable type, this means that the percentage resolves to a time and therefore can be used in a calc() expression. valid percentages 50% +50% optional plus sign -50% negative percentages are not valid for all properties that
accept percentages invalid percentages 50 % space not allowed between the space and the percentage sign valid times 12s positive integer -456ms negative integer 4.3ms non-integer 14ms the unit is case-insensitive, although capital letters are not recommended. +0s zero with a leading + and a unit -0ms zero with a leading - and a unit invalid times 0 ...
matrix() - CSS: Cascading Style Sheets
ansformation matrix. its result is a <transform-function> data type. note: matrix(a, b, c, d, tx, ty) is a shorthand for matrix3d(a, b, 0, 0, c, d, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1). syntax the matrix() function is specified with six values. the constant values are implied and not passed as parameters; the other parameters are described in the column-major order. note: until firefox 16, gecko
accepted a <length> value for tx and ty. matrix(a, b, c, d, tx, ty) values a b c d are <number>s describing the linear transformation. tx ty are <number>s describing the translation to apply. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 ac bd actxbdty001 actx...
matrix3d() - CSS: Cascading Style Sheets
function> data type. syntax the matrix3d() function is specified with 16 values. they are described in the column-major order. matrix3d(a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4) values a1 b1 c1 d1 a2 b2 c2 d2 a3 b3 c3 d3 are <number>s describing the linear transformation. a4 b4 c4 d4 are <number>s describing the translation to apply. note: until firefox 16, gecko
accepted a <length> value for a4, b4 and c4. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 this transformation applies to the 3d space and can't be represented on the plane. a generic 3d affine transformation can't be represented using a cartesian-coordinate matrix, as translations are ...
Getting Started - Developer guides
we'll change the request method from get to post, and include our data as a parameter in the call to httprequest.send(): function makerequest(url, username) { ... httprequest.onreadystatechange = alertcontents; httprequest.open('post', url); httprequest.setrequestheader('content-type', 'application/x-www-form-urlencoded'); ht...
Live streaming web audio and video - Developer guides
ttp (mpeg-dash) mpeg-dash media source demo dash reference client dynamic streaming over http the state of mpeg-dash deployment look, no plugins: live streaming to the browser using media source extensions and mpeg-dash media source extensions (w3c) icecast shoutcast gstreamer streaming gstreamer pipelines via http streaming media using gstreamer on the web gstreamer and raspberry pi
acceptance of media source extensions as w3c candidate recommendation will accelerate adoption of dash.js comparison of streaming media systems mozilla hacks - streaming media on demand with media source extensions ...
Video player styling basics - Developer guides
plementing the button functionality. play/pause and mute now that the buttons actually look like buttons and have images that indicate what they do, some changes need to be made so that the "dual functionality" buttons (such as the play/pause button) are in the correct "state" and display the correct image. ...
Writing Web Audio API code that works in every browser - Developer guides
you will have to wait until it is supported, or maybe, if you're really eager, hack in some replacement using scriptprocessornode, which allows you to write a node with callbacks that get called periodically, so that your javascript code generates or processes audio. the node parameters you use must also be supported in firefox too. if they aren't, you might be able to change them into something "
acceptable" for the time being, and count on the talented audio developers to implement those very soon. for example, up until a couple of days ago pannernode did not support the default hrtf panning model yet, and attempting to use a pannernode with that configuration simply resulted in silence or a mono output coming out from that node, depending on the build you used. today the support is already pre...
Localizations and character encodings - Developer guides
central and eastern european locales, middle eastern locales and east asian locales. in order to avoid the problem of web authors creating new utf-8 content without declaring that the content uses utf-8 and in order to maximize the ability of users to read content cross-locale, do not set the fallback encoding to utf-8 for any newly-introduced localization. note that firefox no longer sends the
accept-charset http header, so there is no need to consider what gets advertised in
accept-charset when setting the fallback encoding. for locales where the fallback encoding is currently iso-8859-1, it should be changed to windows-1252. iso-8859-1 is decoded in the exact same way as windows-1252, but firefox is moving to treating windows-1252 as the preferred label for this encoding in accordance with...
Mobile Web Development - Developer guides
s in css by querying for screen height, width, and pixel ratio. you can also make use of css properties to implement visual effects like gradients and shadows without images. mobile apis finally, you can take advantage of the new possibilities offered by mobile devices, such as orientation and geolocation. cross-browser development write cross-browser code to create web sites that will work
acceptably across different mobile browsers: try to avoid using browser-specific features, such as vendor-prefixed css properties. if you do need to use these features, check whether other browsers implement their own versions of these features, and target them too. for browsers that don't support these features, provide an
acceptable fallback. for example, if you set a gradient as a background f...
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
r "#00f". to make it 25% opaque, you can use "#0000ff44" or "#00f4". rgb functional notation rgb (red/green/blue) functional notation, like hexadecimal string notation, represents colors using their red, green, and blue components (as well as, optionally, an alpha channel component for opacity). however, instead of using a string, the color is defined using the css function rgb(). this function
accepts as its input parameters the values of the red, green, and blue components and an optional fourth parameter, the value for the alpha channel. legal values for each of these parameters are: red, green, and blue each must be an <integer> value between 0 and 255 (inclusive), or a <percentage> from 0% to 100%. alpha the alpha channel is a number between 0.0 (fully transparent) and 1.0 (fully o...
HTML attribute: max - HTML: Hypertext Markup Language
if the value of the element is greater than this, the element fails constraint validation. this value must be greater than or equal to the value of the min attribute. if the max attribute is present by is not specified or is invalid, no max value is applied. if the max attribute is valid and a non-empty value is greater than the maximum allowed by the max attribute, constraint validation will prevent form submission. ...
HTML attribute: min - HTML: Hypertext Markup Language
if the value of the element is less than this, the element fails constraint validation. this value must be less than or equal to the value of the max attribute. if a value is specified for min that isn't a valid number, the input has no minimum value. valid for the numeric input types, including the date, month, week, time, datetime-local, number and range types, and the <meter> element, the min attribute is a number that specifies the most negative value a form control to be considered valid. ...
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, heading content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content; don't use a heading element as a child of the <hgroup> element — it is now deprecated. implicit aria role heading permitted aria roles tab, presentation or none dom interface htmlheadingelement attributes these elements only include the global attributes. the align attribute is obsolete; don't use it. usage notes heading informat...
<a>: The Anchor element - HTML: Hypertext Markup Language
ment for image maps instead. properties content categories flow content, phrasing content, interactive content, palpable content. permitted content transparent, containing either flow content (excluding interactive content) or phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content, or any element that
accepts flow content, but not other <a> elements. implicit aria role link when href attribute is present, otherwise no corresponding role permitted aria roles when href attribute is present: button checkbox menuitem menuitemcheckbox menuitemradio option radio switch tab tree...
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
ou'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content permitted content phrasing content tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only supports the global attributes. the title attribute has a specific semantic meaning when used with the <abbr> element; it must contain a full human-readable description or expansion of the abbreviation. this text is ...
<acronym> - HTML: Hypertext Markup Language
t differently than a <span> element. opera, firefox, chrome, and some others add a dotted underline to the content of the element. a few browsers not only add a dotted underline, but also put it in small caps; to avoid this styling, adding something like font-variant: none in the css takes care of this case. it is therefore recommended that web authors either explicitly style this element, or
accept some cross-browser variation. specifications specification status comment html 4.01 specificationthe definition of '<acronym>' in that specification. recommendation 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...
<address>: The Contact Address element - HTML: Hypertext Markup Language
ontent, palpable content. permitted content flow content, but with no nested <address> element, no heading content (<hgroup>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>), no sectioning content (<article>, <aside>, <section>, <nav>), and no <header> or <footer> element. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content, but always excluding <address> elements (according to the logical principle of symmetry, if <address> tag, as a parent, can not have nested <address> element, then the same <address> content can not have <address> tag as its parent). implicit aria role no corresponding role permitted aria roles any dom interface htmlelement prior to gecko 2.0 (fi...
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
t browsers no longer support use of plug-ins, including the java plug-in. content categories flow content, phrasing content, embedded content, interactive content, palpable content. permitted content zero or more <param> elements, then transparent. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts embedded content. dom interface htmlappletelement attributes align this attribute is used to position the applet on the page relative to content that might flow around it. the html 4.01 specification defines values of bottom, left, middle, right, and top, whereas microsoft and netscape also might support absbottom, absmiddle, baseline, center, and texttop. alt this attri...
<area> - HTML: Hypertext Markup Language
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. content categories flow content, phrasing content. permitted content none, it is an empty element. tag omission must have a start tag and must not have an end tag. permitted parents any element that
accepts phrasing content. the <area> element must have an ancestor <map>, but it need not be a direct parent. implicit aria role link when href attribute is present, otherwise no corresponding role permitted aria roles no role permitted dom interface htmlareaelement attributes this element's attributes include the global attributes. alt a text string alter...
<article>: The Article Contents element - HTML: Hypertext Markup Language
rticle one after another as the reader scrolls, each post would be contained in an <article> element, possibly with one or more <section>s within. content categories flow content, sectioning content, palpable content permitted content flow content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content. note that an <article> element must not be a descendant of an <address> element. implicit aria role article permitted aria roles application, document, feed, main, none, presentation, region dom interface htmlelement attributes this element only includes the global attributes. usage notes each <article> should be identified, typically...
<aside>: The Aside element - HTML: Hypertext Markup Language
u'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, sectioning content, palpable content. permitted content flow content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content. note that an <aside> element must not be a descendant of an <address> element. implicit aria role complementary permitted aria roles feed, none, note, presentation, region, search dom interface htmlelement attributes this element only includes the global attributes. usage notes do not use the <aside> element to tag parenthesized text,...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
more <track> elements followed by transparent content that contains no <audio> or <video> media elements. else: zero or more <source> elements followed by zero or more <track> elements followed by transparent content that contains no <audio> or <video> media elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts embedded content. implicit aria role no corresponding role permitted aria roles application dom interface htmlaudioelement specifications specification status comment html living standardthe definition of '<audio>' in that specification. living standard html5the definition of '<audio>' in that specification. ...
<b>: The Bring Attention To element - HTML: Hypertext Markup Language
'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes use the <b> for cases like keywords in a summary, product names in a review, or other spans of text whose typical presentation would be boldfaced (but not including an...
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
wed to ignore css styling. embedding the characters in <span dir="auto"> has the same effect as using <bdi>, but its semantics are less clear. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes like all other html elements, this element supports the global attributes, except that the dir attribute behaves differently than normal: it defaults to auto, meaning its value is never inherited from the parent element. this means t...
<bdo>: The Bidirectional Text Override element - HTML: Hypertext Markup Language
ing point in the given direction; the individual characters' orientation is not affected (so characters don't get drawn backward, for example). content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement up to gecko 1.9.2 (firefox 4) inclusive, firefox implements the htmlspanelement interface for this element. attributes this element's attributes include the global attributes. dir the direction in which text should be rendered in this eleme...
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
f you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, sectioning root, palpable content. permitted 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 refere...
<br>: The Line Break element - HTML: Hypertext Markup Language
. use <p> elements, and use css properties like margin to control their spacing. technical summary content categories flow content, phrasing content. permitted content none, it is an empty element. tag omission must have a start tag, and must not have an end tag. in xhtml documents, write this element as <br />. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles none, presentation dom interface htmlbrelement specifications specification status comment html living standardthe definition of '<br>' in that specification. living standard html5the definition of '<br>' in that specification. ...
<button>: The Button element - HTML: Hypertext Markup Language
end us a pull request. content categories flow content, phrasing content, interactive content, listed, labelable, and submittable form-associated element, palpable content. permitted content phrasing content but there must be no interactive content tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role button permitted aria roles checkbox, link, menuitem, menuitemcheckbox, menuitemradio, option, radio, switch, tab dom interface htmlbuttonelement attributes this element's attributes include the global attributes. autofocus html5 this boolean attribute specifies that the button should have input focus when the p...
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
ies flow content, phrasing content, embedded content, palpable content. permitted content transparent but with no interactive content descendants except for <a> elements, <button> elements, <input> elements whose type attribute is checkbox, radio, or button. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlcanvaselement attributes this element's attributes include the global attributes. height the height of the coordinate space in css pixels. defaults to 150. moz-opaque lets the canvas know whether or not translucency will be a factor. if the c...
<cite>: The Citation element - HTML: Hypertext Markup Language
d like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement up to gecko 1.9.2 (firefox 4) inclusive, firefox implements the htmlspanelement interface for this element. attributes this element only includes the global attributes. usage notes in the context of the <cite> element, a creative work that mi...
<code>: The Inline Code element - HTML: Hypertext Markup Language
'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement up to gecko 1.9.2 (firefox 4) inclusive, firefox implements the htmlspanelement interface for this element. attributes this element only includes the global attributes. example a paragraph of text that includes <code>: <p>the function <code>...
<content>: The Shadow DOM Content Placeholder element (obsolete) - HTML: Hypertext Markup Language
uld not be used. it is documented here to assist in adapting code written during the time it was included in the spec to work with newer versions of the specification. content categories transparent content. permitted content flow content. tag omission none, both the starting and ending tag are mandatory. permitted parent elements any element that
accepts flow content. dom interface htmlcontentelement attributes this element includes the global attributes. select a comma-separated list of selectors. these have the same syntax as css selectors. they select the content to insert in place of the <content> element. example here is a simple example of using the <content> element. it is an html file with everything needed in ...
<data> - HTML: Hypertext Markup Language
'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmldataelement attributes this element's attributes include the global attributes. value this attribute specifies the machine-readable translation of the content of the element. examples the following example displays product names but also associa...
<datalist>: The HTML Data List element - HTML: Hypertext Markup Language
the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content. permitted content either phrasing content or zero or more <option> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role listbox permitted aria roles no role permitted dom interface htmldatalistelement attributes this element has no other attributes than the global attributes, common to all elements. examples <label for="mybrowser">choose a browser from this list:</label> <input list="browsers" id="mybrowser" name="mybrowser" /> <da...
<del>: The Deleted Text element - HTML: Hypertext Markup Language
//github.com/mdn/interactive-examples and send us a pull request. this element is often (but need not be) rendered by applying a strike-through style to the text. content categories phrasing content or flow content. permitted content transparent. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlmodelement attributes this element's attributes include the global attributes. cite a uri for a resource that explains the change (for example, meeting minutes). datetime this attribute indicates the time and date of the change and must be a vali...
<details>: The Details disclosure element - HTML: Hypertext Markup Language
customize its appearance further. see customizing the disclosure widget for further details. content categories flow content, sectioning root, interactive content, palpable content. permitted content one <summary> element followed by flow content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content. implicit aria role group permitted aria roles no role permitted dom interface htmldetailselement attributes this element includes the global attributes. open this boolean attribute indicates whether or not the details — that is, the contents of the <details> element — are currently visible. the default, false, means the details ar...
<dfn>: The Definition element - HTML: Hypertext Markup Language
amples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content, but no <dfn> element must be a descendant. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role term permitted aria roles any dom interface htmlelement attributes this element's attributes include the global attributes. in html5, the title attribute has special meaning, as noted below. usage notes there are some not-entirely-obvious aspects to using the <dfn> element. we examine those here. specifying the ...
<dialog>: The Dialog element - HTML: Hypertext Markup Language
the html <dialog> element represents a dialog box or other interactive component, such as a dismissable alert, inspector, or subwindow. content categories flow content, sectioning root permitted 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 dialog permitted aria roles alertdialog dom interface htmldialogelement attributes this element includes the global attributes. the tabindex attribute must not be used on the <dialog> element. open indicates that the dialog is active and can be interacted with. when the open attribute is not set, the dialog shouldn't be shown to the user. usag...
<div>: The Content Division element - HTML: Hypertext Markup Language
categories flow content, palpable content. permitted content flow content. or (in whatwg html): if the parent is a <dl> element: one or more <dt> elements followed by one or more <dd> elements, optionally intermixed with <script> and <template> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content. or (in whatwg html): <dl> element. implicit aria role no corresponding role permitted aria roles any dom interface htmldivelement attributes this element includes the global attributes. note: the align attribute is obsolete; do not use it anymore. instead, you should use css properties or techniques such as css grid or css flexbox t...
<dl>: The Description List element - HTML: Hypertext Markup Language
ither: zero or more groups each consisting of one or more <dt> elements followed by one or more <dd> elements, optionally intermixed with <script> and <template> elements. or: one or more <div> elements, optionally intermixed with <script> and <template> elements. 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 group, list, none, presentation dom interface htmldlistelement attributes this element only includes the global attributes. examples single term and description <dl> <dt>firefox</dt> <dd> a free, open source, cross-platform, graphical web browser developed by the...
<em>: The Emphasis element - HTML: Hypertext Markup Language
'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement up to gecko 1.9.2 (firefox 4) inclusive, firefox implements the htmlspanelement interface for this element. attributes this element only includes the global attributes. usage notes the <em> element is for words that have a stressed emphasis c...
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
ed> is generally not wise if you want your site to be operable on the average user's browser. content categories flow content, phrasing content, embedded content, interactive content, palpable content. permitted content none, it is an empty element. tag omission must have a start tag, and must not have an end tag. permitted parents any element that
accepts embedded 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. sr...
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
wd" value="wookie"> </div> </fieldset> </form> technical summary content categories flow content, sectioning root, listed, form-associated element, palpable content. permitted content an optional <legend> element, followed by flow content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content. implicit aria role group permitted aria roles radiogroup, presentation, none dom interface htmlfieldsetelement specifications specification status comment html living standardthe definition of '<fieldset>' in that specification. living standard definition of the fieldset element html5the definiti...
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
active-examples and send us a pull request. content categories flow content, sectioning root, palpable content. permitted content a <figcaption> element, followed by flow content; or flow content followed by a <figcaption> element; or flow content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content. implicit aria role figure permitted aria roles with no figcaption descendant: any, otherwise no permitted roles dom interface htmlelement attributes this element only includes the global attributes. usage notes usually a <figure> is an image, illustration, diagram, code snippet, etc., that is referenced in the main flow of a document,...
<footer> - HTML: Hypertext Markup Language
the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, palpable content. permitted content flow content, but with no <footer> or <header> descendants. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content. note that a <footer> element must not be a descendant of an <address>, <header> or another <footer> element. implicit aria role contentinfo, or no corresponding role if a descendant of an article, aside, main, nav or section element, or an element with role=article, complementary, main, navigation or region permitted aria roles group, presentation or none ...
<header> - HTML: Hypertext Markup Language
the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, palpable content. permitted content flow content, but with no <header> or <footer> descendant. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content. note that a <header> element must not be a descendant of an <address>, <footer> or another <header> element. implicit aria role banner, or no corresponding role if a descendant of an article, aside, main, nav or section element, or an element with role=article, complementary, main, navigation or region permitted aria roles group, presentation or none ...
<hgroup> - HTML: Hypertext Markup Language
tive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, heading content, palpable content. permitted content one or more <h1>, <h2>, <h3>, <h4>, <h5>, and/or <h6>. 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 htmlelement attributes this element only includes the global attributes. usage notes the <hgroup> element has been removed from the html5 (w3c) specification, but it still is in the whatwg version of html. it is partially implemented in most browsers, thoug...
<hr>: The Thematic Break (Horizontal Rule) element - HTML: Hypertext Markup Language
ers, this element is now defined in semantic terms, rather than presentational terms, so if you wish to draw a horizontal line, you should do so using appropriate css. content categories flow content. permitted content none, it is an empty element. tag omission it must have start tag, but must not have an end tag. permitted parents any element that
accepts flow content. implicit aria role separator permitted aria roles presentation or none dom interface htmlhrelement attributes this element's attributes include the global attributes. align sets the alignment of the rule on the page. if no value is specified, the default value is left. color sets the color of the rule through color name or hexad...
<i>: The Idiomatic Text element - HTML: Hypertext Markup Language
'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes use the <i> element for text that is set off from the normal prose for readability reasons. this would be a range of text with different semantic meaning than the surr...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
computing resources. while theoretically you can use as many <iframe>s as you like, check for performance problems. content categories flow content, phrasing content, embedded content, interactive content, palpable content. permitted content none. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts embedded content. implicit aria role no corresponding role permitted aria roles application, document, img, none, presentation dom interface htmliframeelement attributes this element includes the global attributes. allow specifies a feature policy for the <iframe>. see the article privacy, permissions, and information security for details on securi...
<ins> - HTML: Hypertext Markup Language
b 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. content categories phrasing content or flow content. permitted content transparent. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlmodelement attributes this element includes the global attributes. cite this attribute defines the uri of a resource that explains the change, such as a link to meeting minutes or a ticket in a troubleshooting system. datetime this attribute indi...
<isindex> - HTML: Hypertext Markup Language
ntering a query string. when sent, the server would return a list of pages matching the query. its support depended on both the browser and the server 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> ...
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
y be nested in various combinations with the <samp> (sample output) element to represent various forms of input or output based on visual cues. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes other elements can be used in tandem with <kbd> to represent more specific scenarios: nesting a <kbd> element within another <kbd> element represents an actual key or...
<keygen> - HTML: Hypertext Markup Language
of the process will be a signed certificate. content categories flow content, phrasing content, interactive content, listed, labelable, submittable, resettable form-associated element, palpable content. permitted content none, it is an empty element. tag omission must have a start tag and must not have an end tag. permitted parents any element that
accepts phrasing content. permitted aria roles none dom interface htmlkeygenelement attributes this element includes the global attributes. autofocus this boolean attribute lets you specify that the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. only one form element in a document can ha...
<label> - HTML: Hypertext Markup Language
content categories flow content, phrasing content, interactive content, form-associated element, palpable content. permitted content phrasing content, but no descendant label elements. no labelable elements other than the labeled control are allowed. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmllabelelement specifications specification status comment html living standardthe definition of '<label>' in that specification. living standard html5the definition of '<label>' in that specifica...
<map> - HTML: Hypertext Markup Language
to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content any transparent element. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlmapelement attributes this element includes the global attributes. name the name attribute gives the map a name so that it can be referenced. the attribute must be present and must have a non-empty value with no space characters. the ...
<mark>: The Mark Text element - HTML: Hypertext Markup Language
'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes typical use cases for <mark> include: when used in a quotation (<q>) or block quote (<blockquote>), it generally indicates text which is of special interest but is no...
<menu> - HTML: Hypertext Markup Language
(list menu is the default state, unless the parent element is a <menu> in the context menu state.) if the element is in the context menu state: zero or more occurrences, in any order, of <menu> (context menu state only), <menuitem>, <hr>, <script>, and <template>. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content. implicit aria role list permitted aria roles directory, group, listbox, menu, menubar, none, presentation, radiogroup, tablist, toolbar or tree dom interface htmlmenuelement attributes this element includes the global attributes. label the name of the menu as shown to the user. used within nested menus, to provide a label through wh...
<meter>: The HTML Meter element - HTML: Hypertext Markup Language
github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, labelable content, palpable content. permitted content phrasing content, but there must be no <meter> element among its descendants. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlmeterelement attributes this element includes the global attributes. value the current numeric value. this must be between the minimum and maximum values (min attribute and max attribute) if they are specified. if unspecified or malfo...
<nav>: The Navigation Section element - HTML: Hypertext Markup Language
u'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, sectioning content, palpable content. permitted 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 navigation permitted aria roles no role permitted dom interface htmlelement attributes this element only includes the global attributes. usage notes it's not necessary for all links to be contained in a <nav> element. <nav> is intended only for major block of navigation links; typically the <footer> element often ha...
<nextid>: The NeXT ID element (Obsolete) - HTML: Hypertext Markup Language
s html version 2 strict level 2 this excludes these depreciated elements and also forbids such constructs as nesting a header (<h*> element) within a link (<a> element), or having a forms <input> element which is not within a block level element such as <p> html version 3.2 <nextid> has vanished altogether, never to be heard from again. attributes like all other html elements, this element
accepts the global attributes. n reference to anchor. example the user enters four section headings into the table of contents (and presumably also writing paragraph material within these sections). the heading for each of the four sections would be assigned name values of "z0", "z1", "z2", and "z3". the first of these would produce an entry in the table of contents like this: <a name="z0" href="...
<noscript> - HTML: Hypertext Markup Language
more <style> elements, and zero or more <meta> elements. when scripting is disabled and when it isn't a descendant of the <head> element: any transparent content, but no <noscript> element must be among its descendants. otherwise: flow content or phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content, if there are no ancestor <noscript> element, or in a <head> element (but only for an html document), here again if there are no ancestor <noscript> element. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlelement attributes this element only includes the global attributes. examples <...
<object> - HTML: Hypertext Markup Language
content categories flow content; phrasing content; embedded content, palpable content; if the element has a usemap attribute, interactive content; listed, submittable form-associated element. permitted content zero or more <param> elements, then transparent. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts embedded content. implicit aria role no corresponding role permitted aria roles application, document, image dom interface htmlobjectelement attributes this element includes the global attributes. archivehtml 4 onlyobsolete since html5 a space-separated list of uris for archives of resources for the object. borderdeprecated since html4.01obsolete ...
<ol>: The Ordered List element - HTML: Hypertext Markup Language
om/mdn/interactive-examples and send us a pull request. content categories flow content, and if the <ol> element's children include at least one <li> element, palpable content. permitted content zero or more <li>, <script> and <template> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content. implicit aria role list permitted aria roles directory, group, listbox, menu, menubar, none, presentation, radiogroup, tablist, toolbar, tree dom interface htmlolistelement attributes this element also
accepts the global attributes. reversed this boolean attribute specifies that the list’s items are in reverse order. items will be n...
<output>: The Output element - HTML: Hypertext Markup Language
h a site or app can inject the results of a calculation or the outcome of a user action. content categories flow content, phrasing content, listed, labelable, resettable form-associated element, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role status permitted aria roles any dom interface htmloutputelement attributes this element includes the global attributes. for a space-separated list of other elements’ ids, indicating that those elements contributed input values to (or otherwise affected) the calculation. form the <form> element to associate t...
<p>: The Paragraph element - HTML: Hypertext Markup Language
lement is immediately followed by an <address>, <article>, <aside>, <blockquote>, <div>, <dl>, <fieldset>, <footer>, <form>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <header>, <hr>, <menu>, <nav>, <ol>, <pre>, <section>, <table>, <ul> or another <p> element, or if there is no more content in the parent element and the parent element is not an <a> element. permitted parents any element that
accepts flow content. implicit aria role no corresponding role permitted aria roles any dom interface htmlparagraphelement attributes this element only includes the global attributes. note: the align attribute on <p> tags is obsolete and shouldn't be used. example html <p>this is the first paragraph of text. this is the first paragraph of text. this ...
<plaintext>: The Plain Text element (Deprecated) - HTML: Hypertext Markup Language
lement (<plaintext>) renders everything following the start tag as raw text, ignoring any following html. there is no closing tag, since everything after it is considered raw text. note: do not use this element. <plaintext> is deprecated since html 2, and not all browsers implemented it. browsers that did implement it didn't do so consistently. <plaintext> is obsolete in html5; browsers that
accept it may instead treat it as a <pre> element that still interprets html within. if <plaintext> is the first element on the page (other than any non-displayed elements, like <head>), do not use html at all. instead serve a text file with the text/plain mime-type. instead of <plaintext>, use the <pre> element or, if semantically accurate (such as for inline text), the <code> element. escape any <, ...
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
epository. 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. content categories flow content, palpable content. permitted content phrasing 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 htmlpreelement attributes this element only includes the global attributes. cols contains the preferred count of characters that a line should have. it was a non-standard synonym of width. to achieve such an effect, use css width instead. width cont...
<progress>: The Progress Indicator element - HTML: Hypertext Markup Language
hub.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, labelable content, palpable content. permitted content phrasing content, but there must be no <progress> element among its descendants. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role progressbar permitted aria roles no role permitted dom interface htmlprogresselement attributes this element includes the global attributes. max this attribute describes how much work the task indicated by the progress element requires. the max attribute, if present, must have a value greater than 0 and be a val...
<q>: The Inline Quotation element - HTML: Hypertext Markup Language
'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit 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. ci...
<ruby> - HTML: Hypertext Markup Language
'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. examples example 1: character <ruby> 漢 <rp>(</rp><rt>kan</rt><rp>)</rp> 字 <rp>(</rp><rt>ji</rt><rp>)</rp> </ruby> example 2: word <ruby> 明日 <rp>(</rp><rt>ashita</rt...
<s> - HTML: Hypertext Markup Language
ository. 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. content categories phrasing content or flow content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. implementation note: up to gecko 1.9.2 inclusive, firefox implements the htmlspanelement interface for this element. examples <s>today's special: salmon</s> sold out<br> <span styl...
<samp>: The Sample Output element - HTML: Hypertext Markup Language
d like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes you can use a css rule to override the browser's default font face for the <samp> element; however, it's possible that the browser's preferences may take precedence over...
<script>: The Script element - HTML: Hypertext Markup Language
e. the <script> element can also be used with other languages, such as webgl's glsl shader programming language and json. content categories metadata content, flow content, phrasing content. permitted content dynamic script such as text/javascript. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts metadata content, or any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlscriptelement attributes this element includes the global attributes. asynchtml5 for classic scripts, if the async attribute is present, then the classic script will be fetched in parall...
<section>: The Generic Section element - HTML: Hypertext Markup Language
ection>. note: if the contents of the element would make sense syndicated as a standalone piece, the <article> element may be a better choice. content categories flow content, sectioning content, palpable content. permitted content flow content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content. note that a <section> element must not be a descendant of an <address> element. implicit aria role region if the element has an accessible name, otherwise no corresponding role permitted aria roles alert, alertdialog, application, banner, complementary, contentinfo, dialog, document, feed, log, main, marquee, navigation, none, note, presentation, search, sta...
<slot> - HTML: Hypertext Markup Language
eholder inside a web component that you can fill with your own markup, which lets you create separate dom trees and present them together. content categories flow content, phrasing content permitted content transparent events slotchange tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlslotelement attributes this element includes the global attributes. name the slot's name. a named slot is a <slot> element with a name attribute. examples <template id="element-details-template"> <style> details {font-family:...
<small>: the side comment element - HTML: Hypertext Markup Language
ithub 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. content categories flow content, phrasing content permitted content phrasing content tag omission none, must have both a start tag and an end tag. permitted parents any element that
accepts phrasing content, or any element that
accepts flow content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. examples basic usage <p>this is the first sentence. <small>this whole sentence is in small letters.</small> </p> css alternative <p>...
<span> - HTML: Hypertext Markup Language
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. content categories flow content, phrasing content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content, or any element that
accepts flow content. implicit aria role no corresponding role permitted aria roles any dom interface htmlspanelement (before html5, the interface was htmlelement) attributes this element only includes the global attributes. example example 1 html <p><span>some text</span></p> result example 2 html <li><s...
<style>: The Style Information element - HTML: Hypertext Markup Language
yellow; } </style> </head> <body> <p>this is my paragraph.</p> </body> </html> technical summary content categories metadata content, and if the scoped attribute is present: flow content. permitted content text content matching the type attribute, that is text/css. tag omission neither tag is omissible. permitted parents any element that
accepts metadata content. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlstyleelement specifications specification status comment html living standardthe definition of 'style' in that specification. living standard html5the definition of 'style' in that specification. ...
<sub>: The Subscript element - HTML: Hypertext Markup Language
'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes the <sub> element should be used only for typographical reasons—that is, to change the position of the text to comply with typographical conventions or standards, rath...
<table>: The Table element - HTML: Hypertext Markup Language
ional <caption> element, zero or more <colgroup> elements, an optional <thead> element, either one of the following: zero or more <tbody> elements one or more <tr> elements an optional <tfoot> element tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content implicit aria role table permitted aria roles any dom interface htmltableelement attributes this element includes the global attributes. deprecated attributes align this enumerated attribute indicates how the table must be aligned inside the containing document. it may have the following values: left: the table is displayed o...
<template>: The Content Template element - HTML: Hypertext Markup Language
ng the page, it does so only to ensure that those contents are valid; the element's contents are not rendered, however. content categories metadata content, flow content, phrasing content, script-supporting element permitted content no restrictions tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts metadata content, phrasing content, or script-supporting elements. also allowed as a child of a <colgroup> element that does not have a span attribute. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmltemplateelement attributes this element only includes the global attributes. however, the htmltemplatee...
<time> - HTML: Hypertext Markup Language
'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmltimeelement attributes like all other html elements, this element supports the global attributes. datetime this attribute indicates the time and/or date of the element and must be in one of the formats described below. usage notes this element i...
<tt>: The Teletype Text element (obsolete) - HTML: Hypertext Markup Language
tional font), you should consider using the <span> element, styling it as desired using css. the font-family property is a good place to start. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes examples basic example this example uses <tt> to show text entered into, and output by, a terminal application. <p>enter the following at the telnet command prompt: <code>set localecho</code><br /> the telnet client should display: ...
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
ve-examples and send us a pull request. see the usage notes section for further details on when it's appropriate to use <u> and when it isn't. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes along with other pure styling elements, the original html underline (<u>) element was deprecated in html 4; however, <u> was restored in html 5 with a new, semantic, mea...
<ul>: The Unordered List element - HTML: Hypertext Markup Language
om/mdn/interactive-examples and send us a pull request. content categories flow content, and if the <ul> element's children include at least one <li> element, palpable content. permitted content zero or more <li>, <script> and <template> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts flow content. implicit aria role list permitted aria roles directory, group, listbox, menu, menubar, none, presentation, radiogroup, tablist, toolbar, tree dom interface htmlulistelement attributes this element includes the global attributes. compact this boolean attribute hints that the list should be rendered in a compact style. the interpretat...
<var>: The Variable element - HTML: Hypertext Markup Language
'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes related elements other elements that are used in contexts in which <var> is commonly used include: <code>: the html code element <kbd>: the html keyboard input elem...
<video>: The Video Embed element - HTML: Hypertext Markup Language
by transparent content that contains no media elements–that is no <audio> or <video> else: zero or more <source> elements, followed by zero or more <track> elements, followed by transparent content that contains no media elements–that is no <audio> or <video>. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that
accepts embedded content. implicit aria role no corresponding role permitted aria roles application dom interface htmlvideoelement specifications specification feedback html living standardthe definition of '<video>' in that specification. whatwg html github issues ...
<wbr> - HTML: Hypertext Markup Language
you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content. permitted content empty tag omission it is an empty element; it must have a start tag, but must not have an end tag. permitted parents any element that
accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. notes on utf-8 encoded pages, <wbr> behaves like the u+200b zero-width space code point. in particular, it behaves like a unicode bidi bn code point, meaning it has no effect on bid...
HTML elements reference - HTML: Hypertext Markup Language
er controls. <fieldset> the html <fieldset> element is used to group several controls as well as labels (<label>) within a web form. <form> the html <form> element represents a document section containing interactive controls for submitting information. <input> the html <input> element is used to create interactive controls for web-based forms in order to
accept data from the user; a wide variety of types of input data and control widgets are available, depending on the device and user agent. <label> the html <label> element represents a caption for an item in a user interface. <legend> the html <legend> element represents a caption for the content of its parent <fieldset>. <meter> the html <meter> element repre...
id - HTML: Hypertext Markup Language
ent html living standardthe definition of 'id' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'id' in that specification. recommendation snapshot of html living standard, no change from html5 html5the definition of 'id' in that specification. recommendation snapshot of html living standard, now
accept '_', '-' and '.' if not at the beginning of the id. it is also a true global attribute. html 4.01 specificationthe definition of 'id' in that specification. recommendation supported on all elements but <base>, <head>, <html>, <meta>, <script>, <style>, and <title>. ...
tabindex - HTML: Hypertext Markup Language
dex global attribute indicates that its element can be focused, and where it participates in sequential keyboard navigation (usually with the tab key, hence the name). 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. it
accepts an integer as a value, with different results depending on the integer's value: a negative value (usually tabindex="-1") means that the element is not reachable via sequential keyboard navigation, but could be focused with javascript or visually by clicking with the mouse. it's mostly useful to create accessible widgets with javascript. a negative value is useful when you have off-scree...
Identifying resources on the Web - HTTP
server with the request. usage notes when using urls in html content, you should generally only use a few of these url schemes. when referring to subresources — that is, files that are being loaded as part of a larger document — you should only use the http and https schemes. increasingly, browsers are removing support for using ftp to load subresources, for security reasons. ftp is still
acceptable at the top level (such as typed directly into the browser's url bar, or the target of a link), although some browsers may delegate loading ftp content to another application. examples https://developer.mozilla.org/docs/learn tel:+1-816-555-1212 git@github.com:mdn/browser-compat-data.git ftp://example.org/resource.txt urn:isbn:9780141036144 mailto:help@supercyberhelpdesk.info specification...
Basics of HTTP - HTTP
n of http to support persistent connection and pipelining. this article explains both concepts. connection management in http/2 http/2 completely revisited how connections are created and maintained. this article explains how http frames allow multiplexing and solve the 'head-of-line' blocking problem of former http versions. content negotiation http introduces a set of headers, starting with
accept as a way for a browser to announce the format, language, or encoding it prefers. this article explains how this advertisement happens, how the server is expected to react, and how it chooses the most adequate response. ...
Reason: CORS header 'Access-Control-Allow-Origin' does not match 'xyz' - HTTP
by the access-control-allow-origin header. this error can also occur if the response includes more than one access-control-allow-origin header. if the service your code is accessing using a cors request is under your control, make sure that it's configured to include your origin in its access-control-allow-origin header, and that only one such header is included in responses. the header itself
accepts a comma-delineated list of origins, so adding a new origin is not difficult. for example, in apache, add a line such as the following to the server's configuration (within the appropriate <directory>, <location>, <files>, or <virtualhost> section). the configuration is typically found in a .conf file (httpd.conf and apache.conf are common names for these), or in an .htaccess file. header set a...
Reason: Multiple CORS header 'Access-Control-Allow-Origin' not allowed - HTTP
reason reason: multiple cors header ‘access-control-allow-origin’ not allowed what went wrong? more than one access-control-allow-origin header was sent by the server. this isn't allowed. if you have access to the server you can change your implementation to echo back an origin in the access-control-allow-origin header. you cannot send back a list of origins, because browsers only
accept a value that is either a single origin or null ...
HTTP conditional requests - HTTP
ent: all browsers manage a cache and send such conditional requests without any special work to be done by web developers. integrity of a partial download partial downloading of files is a functionality of http that allows to resume previous operations, saving bandwidth and time, by keeping the already obtained information: a server supporting partial downloads broadcasts this by sending the
accept-ranges header. once this happens, the client can resume a download by sending a ranges header with the missing ranges: the principle is simple, but there is one potential problem: if the downloaded resource has been modified between both downloads, the obtained ranges will correspond to two different versions of the resource, and the final document will be corrupted. to prevent this, conditio...
Cross-Origin Resource Policy (CORP) - HTTP
eed for browsers to sniff mime types. usage note: due to a bug in chrome, setting cross-origin-resource-policy can break pdf rendering, preventing visitors from being able to read past the first page of some pdfs. exercise caution using this header in a production environment. web applications set a cross-origin resource policy via the cross-origin-resource-policy http response header, which
accepts one of three values: same-site only requests from the same site can read the resource. warning: this is less secure than an origin. the algorithm for checking if two origins are same site is defined in the html standard and involves checking the registrable domain. same-origin only requests from the same origin (i.e. scheme + host + port) can read the resource. cross-origin req...
Access-Control-Allow-Headers - HTTP
aders when it specifies support for multiple headers. access-control-allow-headers: x-custom-header, upgrade-insecure-requests bypassing additional restrictions although cors-safelisted request headers are always allowed and don't usually need to be listed in access-control-allow-headers, listing them anyway will circumvent the additional restrictions that apply. access-control-allow-headers:
accept example preflight request let's look at an example of a preflight request involving access-control-allow-headers. request first, the request. the preflight request is an options request which includes some combination of the three preflight request headers: access-control-request-method, access-control-request-headers, and origin, such as: options /resource/foo access-control-request-method...
Content-Encoding - HTTP
ost unix distributions, this content-encoding is not used by many browsers today, partly because of a patent issue (it expired in 2003). deflate using the zlib structure (defined in rfc 1950) with the deflate compression algorithm (defined in rfc 1951). identity indicates the identity function (i.e., no compression or modification). this token, except if explicitly specified, is always deemed
acceptable. br a format using the brotli algorithm. examples compressing with gzip on the client side, you can advertise a list of compression schemes that will be sent along in an http request. the
accept-encoding header is used for negotiating content encoding.
accept-encoding: gzip, deflate the server responds with the scheme used, indicated by the content-encoding response header. content-e...
CSP: trusted-types - HTTP
this allows authors to define rules guarding writing values to the dom and thus reducing the dom xss attack surface to small, isolated parts of the web application codebase, facilitating their monitoring and code review. this directive declares a white-list of trusted type policy names created with trustedtypes.createpolicy from trusted types api. ...
Content-Security-Policy - HTTP
(sic) header for links away from a page. use the referrer-policy header instead. require-sri-for requires the use of sri for scripts or styles on the page. require-trusted-types-for enforces trusted types at the dom xss injection sinks. trusted-types used to specify an allow-list of trusted types policies. trusted types allows applications to lock down dom xss injection sinks to only
accept non-spoofable, typed values in place of strings. upgrade-insecure-requests instructs user agents to treat all of a site's insecure urls (those served over http) as though they have been replaced with secure urls (those served over https). this directive is intended for web sites with large numbers of insecure legacy urls that need to be rewritten. csp in workers workers are in general not...
If-Unmodified-Since - HTTP
if the resource has been modified after the given date, the response will be a 412 (precondition failed) error. there are two common use cases: in conjunction with non-safe methods, like post, it can be used to implement an optimistic concurrency control, like done by some wikis: editions are rejected if the stored document has been modified since the original has been retrieved. ...
SameSite cookies - HTTP
this is the default value in modern browsers. strict cookies will only be sent in a first-party context and not be sent along with requests initiated by third party websites. none cookies will be sent in all contexts, i.e sending cross-origin is allowed. ...
Transfer-Encoding - HTTP
lempel-ziv coding (lz77), with a 32-bit crc. this is originally the format of the unix gzip program. the http/1.1 standard also recommends that the servers supporting this content-encoding should recognize x-gzip as an alias, for compatibility purposes. identity indicates the identity function (i.e. no compression, nor modification). this token, except if explicitly specified, is always deemed
acceptable. examples chunked encoding chunked encoding is useful when larger amounts of data are sent to the client and the total size of the response may not be known until the request has been fully processed. for example, when generating a large html table resulting from a database query or when transmitting large images. a chunked response looks like this: http/1.1 200 ok content-type: text/pla...
Want-Digest - HTTP
sha-512. some of the supported algorithms, including unixsum and md5 are subject to collisions and are thus not suitable for applications in which collision-resistance is important. <q-value> the quality value to apply to that option. ...
Link prefetching FAQ - HTTP
t frame and all its "child" frames finish loading. what happens if i click on a link while something is being prefetched? when the user clicks on a link, or initiates any kind of page load, link prefetching will stop and any prefetch hints will be discarded. if a prefetched document is partially downloaded, then the partial document will still be stored in the cache provided the server sent an "
accept-ranges: bytes" response header. this header is typically generated by webservers when serving up static content. when the user visits a prefetched document for real, the remaining portion of the document will be fetched using a http byte-range request. what if i'm downloading something in the background? will link prefetching compete for bandwidth? yes and no. if you are downloading something u...
DELETE - HTTP
ource. request has body may successful response has body may safe no idempotent yes cacheable no allowed in html forms no syntax delete /file.html http/1.1 example request delete /file.html http/1.1 responses if a delete method is successfully applied, there are several response status codes possible: a 202 (
accepted) status code if the action will likely succeed but has not yet been enacted. a 204 (no content) status code if the action has been enacted and no further information is to be supplied. a 200 (ok) status code if the action has been enacted and the response message includes a representation describing the status. http/1.1 200 ok date: wed, 21 oct 2015 07:28:00 gmt <html> <body> <h1>fil...
PATCH - HTTP
y overwrite it (since it overwrites everything), but not necessarily so for patch. patch (like put) may have side-effects on other resources. to find out whether a server supports patch, a server can advertise its support by adding it to the list in the allow or access-control-allow-methods (for cors) response headers. another (implicit) indication that patch is allowed, is the presence of the
accept-patch header, which specifies the patch document formats
accepted by the server. request has body yes successful response has body yes safe no idempotent no cacheable no allowed in html forms no syntax patch /file.txt http/1.1 example request patch /file.txt http/1.1 host: www.example.com content-type: applicatio...
An overview of HTTP - HTTP
e an answer. the client may open a new connection, reuse an existing connection, or open several tcp connections to the servers. send an http message: http messages (before http/2) are human-readable. with http/2, these simple messages are encapsulated in frames, making them impossible to read directly, but the principle remains the same. for example: get / http/1.1 host: developer.mozilla.org
accept-language: fr read the response sent by the server, such as: http/1.1 200 ok date: sat, 09 oct 2010 14:28:02 gmt server: apache last-modified: tue, 01 dec 2009 20:18:22 gmt etag: "51142bc1-7449-479b075b2891b"
accept-ranges: bytes content-length: 29769 content-type: text/html <!doctype html... (here comes the 29769 bytes of the requested web page) close or reuse the connection for further ...
411 Length Required - HTTP
note: by specification, when sending data in a series of chunks, the content-length header is omitted and at the beginning of each chunk you need to add the length of the current chunk in hexadecimal format. see transfer-encoding for more details. ...
415 Unsupported Media Type - HTTP
the format problem might be due to the request's indicated content-type or content-encoding, or as a result of inspecting the data directly. ...
511 Network Authentication Required - HTTP
the http 511 network authentication required response status code indicates that the client needs to authenticate to gain network access. this status is not generated by origin servers, but by intercepting proxies that control access to the network. network operators sometimes require some authentication,
acceptance of terms, or other user interaction before granting access (for example in an internet café or at an airport). they often identify clients who have not done so using their media access control (mac) addresses. status 511 network authentication required specifications specification title rfc 6585, section 6: 511 network authentication required additional http status codes ...
Functions - JavaScript
ike object. within a function, you can address the arguments passed to it as follows: arguments[i] where i is the ordinal number of the argument, starting at 0. so, the first argument passed to a function would be arguments[0]. the total number of arguments is indicated by arguments.length. using the arguments object, you can call a function with more arguments than it is formally declared to
accept. this is often useful if you don't know in advance how many arguments will be passed to the function. you can use arguments.length to determine the number of arguments actually passed to the function, and then access each argument using the arguments object. for example, consider a function that concatenates several strings. the only formal argument for the function is a string that specifies th...
Iterators and generators - JavaScript
']; // ["a", "b", "c"] function* gen() { yield* ['a', 'b', 'c']; } gen().next(); // { value: "a", done: false } [a, b, c] = new set(['a', 'b', 'c']); a; // "a" advanced generators generators compute their yielded values on demand, which allows them to efficiently represent sequences that are expensive to compute (or even infinite sequences, as demonstrated above). the next() method also
accepts a value, which can be used to modify the internal state of the generator. a value passed to next() will be received by yield . note: a value passed to the first invocation of next() is always ignored. here is the fibonacci generator using next(x) to restart the sequence: function* fibonacci() { let current = 0; let next = 1; while (true) { let reset = yield current; [current, ...
Keyed collections - JavaScript
t reference page for more examples and the complete api. let myset = new set(); myset.add(1); myset.add('some text'); myset.add('foo'); myset.has(1); // true myset.delete('foo'); myset.size; // 2 for (let item of myset) console.log(item); // 1 // "some text" converting between array and set you can create an array from a set using array.from or the spread operator. also, the set constructor
accepts an array to convert in the other direction. note: remember that set objects store unique values—so any duplicate elements from an array are deleted when converting! array.from(myset); [...myset2]; myset2 = new set([1, 2, 3, 4]); array and set compared traditionally, a set of elements has been stored in arrays in javascript in a lot of situations. the new set object, however, has some a...
Using Promises - JavaScript
reduce an array of asynchronous functions down to a promise chain equivalent to: promise.resolve().then(func1).then(func2).then(func3); this can be made into a reusable compose function, which is common in functional programming: const applyasync = (acc,val) => acc.then(val); const composeasync = (...funcs) => x => funcs.reduce(applyasync, promise.resolve(x)); the composeasync() function will
accept any number of functions as arguments, and will return a new function that
accepts an initial value to be passed through the composition pipeline: const transformdata = composeasync(func1, func2, func3); const result3 = transformdata(data); in ecmascript 2017, sequential composition can be done more simply with async/await: let result; for (const f of [func1, func2, func3]) { result = await ...
Array.prototype.filter() - JavaScript
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 let newarray = arr.filter(callback(element[, index, [array]])[, thisarg]) parameters callback function is a predicate, to test each element of the array. return true to keep the element, false otherwise. it
accepts three arguments: element the current element being processed in the array. indexoptional the index of the current element being processed in the array. arrayoptional the array filter was called upon. thisargoptional value to use as this when executing callback. return value a new array with the elements that pass the test. if no elements pass the test, an empty array will...
Array.prototype.forEach() - JavaScript
on once for each array 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 arr.foreach(callback(currentvalue [, index [, array]])[, thisarg]) parameters callback function to execute on each element. it
accepts between one and three arguments: currentvalue the current element being processed in the array. index optional the index currentvalue in the array. array optional the array foreach() was called upon. thisarg optional value to use as this when executing callback. return value undefined. description foreach() calls a provided callback function once for each element in an...
Array.prototype.map() - JavaScript
ject, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax let new_array = arr.map(function callback( currentvalue[, index[, array]]) { // return element for new_array }[, thisarg]) parameters callback function that is called for every element of arr. each time callback executes, the returned value is added to new_array. the callback function
accepts the following arguments: currentvalue the current element being processed in the array. indexoptional the index of the current element being processed in the array. arrayoptional the array map was called upon. thisargoptional value to use as this when executing callback. return value a new array with each element being the result of the callback function. description ma...
Date.UTC() - JavaScript
it returns the number of milliseconds since january 1, 1970, 00:00:00 utc. 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 since ecmascript 2017: date.utc(year[, month[, day[, hour[, minute[, second[, millisecond]]]]]]) ecmascript 2016 and earlier: (month used to be required) date.utc(year, month[, day[, hour[, minute[, second[, millisecond]]]]]) parameters year a full year. month an integer between 0 (january) and 11 (december) representing the month. ...
Date - JavaScript
nt time—the number of milliseconds elapsed since january 1, 1970 00:00:00 utc, with leap seconds ignored. date.parse() parses a string representation of a date and returns the number of milliseconds since 1 january, 1970, 00:00:00 utc, with leap seconds ignored. note: parsing of strings with date.parse is strongly discouraged due to browser differences and inconsistencies. date.utc()
accepts the same parameters as the longest form of the constructor (i.e. 2 to 7) and returns the number of milliseconds since january 1, 1970, 00:00:00 utc, with leap seconds ignored. instance methods date.prototype.getdate() returns the day of the month (1–31) for the specified date according to local time. date.prototype.getday() returns the day of the week (0–6) for the specified date acc...
Function.prototype.call() - JavaScript
hod belonging to one object to be assigned and called for a different object. call() provides a new value of this to the function/method. with call(), you can write a method once and then inherit it in another object, without having to rewrite the method for the new object. note: while the syntax of this function is almost identical to that of apply(), the fundamental difference is that call()
accepts an argument list, while apply()
accepts a single array of arguments. examples using call to chain constructors for an object you can use call to chain constructors for an object (similar to java). in the following example, the constructor for the product object is defined with two parameters: name and price. two other functions, food and toy, invoke product, passing this, name, and price. ...
Intl - JavaScript
e language-sensitive relative time formatting. static methods intl.getcanonicallocales() returns canonical locale names. locale identification and negotiation the internationalization constructors as well as several language sensitive methods of other constructors (listed under see also) use a common pattern for identifying locales and determining the one they will actually use: they all
accept locales and options arguments, and negotiate the requested locale(s) against the locales they support using an algorithm specified in the options.localematcher property. locales argument the locales argument requests that a particular locale (or a locale from a list of them) be considered for use in a given operation. a single locale may be specified by either an intl.locale object or a string...
JSON.stringify() - JavaScript
only if you are directly interpreting the result of json.stringify do you need to carefully handle json.stringify's two possible encodings of these code points. specifications specification ecmascript (ecma-262)the definition of 'json.stringify' i...
Math.random() - JavaScript
is less than (but not equal to) max. function getrandomint(min, max) { min = math.ceil(min); max = math.floor(max); return math.floor(math.random() * (max - min) + min); //the maximum is exclusive and the minimum is inclusive } it might be tempting to use math.round() to accomplish that, but doing so would cause your random numbers to follow a non-uniform distribution, which may not be
acceptable for your needs. getting a random integer between two values, inclusive while the getrandomint() function above is inclusive at the minimum, it's exclusive at the maximum. what if you need the results to be inclusive at both the minimum and the maximum? the getrandomintinclusive() function below accomplishes that. function getrandomintinclusive(min, max) { min = math.ceil(min); max = m...
Math.random() - JavaScript
is less than (but not equal to) max. function getrandomint(min, max) { min = math.ceil(min); max = math.floor(max); return math.floor(math.random() * (max - min) + min); //the maximum is exclusive and the minimum is inclusive } it might be tempting to use math.round() to accomplish that, but doing so would cause your random numbers to follow a non-uniform distribution, which may not be
acceptable for your needs. getting a random integer between two values, inclusive while the getrandomint() function above is inclusive at the minimum, it's exclusive at the maximum. what if you need the results to be inclusive at both the minimum and the maximum? the getrandomintinclusive() function below accomplishes that. function getrandomintinclusive(min, max) { min = math.ceil(min); max = m...
Math.tan() - JavaScript
n value the tangent of the given number. description the math.tan() method returns a numeric value that represents the tangent of the angle. because tan() is a static method of math, you always use it as math.tan(), rather than as a method of a math object you created (math is not a constructor). examples using math.tan() math.tan(1); // 1.5574077246549023 because the math.tan() function
accepts radians, but it is often easier to work with degrees, the following function
accepts a value in degrees, converts it to radians and returns the tangent. function gettandeg(deg) { var rad = deg * math.pi/180; return math.tan(rad); } specifications specification ecmascript (ecma-262)the definition of 'math.tan' in that specification. ...
Math - JavaScript
. math.tanh(x) returns the hyperbolic tangent of x. math.trunc(x) returns the integer portion of x, removing any fractional digits. examples converting between degrees and radians the trigonometric functions sin(), cos(), tan(), asin(), acos(), atan(), and atan2() expect (and return) angles in radians. ...
Object.entries() - JavaScript
with object.entries, you can easily convert from object to map: const obj = { foo: 'bar', baz: 42 }; const map = new map(object.entries(obj)); console.log(map); // map { foo: "bar", baz: 42 } iterating through an object using array destructuring, you can iterate through objects easily. const obj = { foo: 'bar', baz: 42 }; object.entries(obj).foreach(([key, value]) =>...
Promise() constructor - JavaScript
back to the tethered promiseobj. the promiseobj (asynchronously) invokes any .then() associated with it. the value received by promiseobj.then() is passed to the invocation of handlefulfilled as an input parameter (see "chained promises" section). the executor might also include a try{} catch() block that invokes rejectionfunc upon error. the signatures of these two functions are simple, they
accept a single parameter of any type. of course, the actual names of these functions can be whatever is desired, i.e. they are named as the parameters of executor. each function is used by simply calling it when appropriate. resolutionfunc(value) // call on fulfilled rejectionfunc(reason) // call on rejected the returned value can be another promise object, in which case the promise gets dynam...
Promise - JavaScript
ly has consequences further down the promise chain. sometimes there is no choice, because an error must be handled immediately. (see throw -999 in the example, below, for a technique to handle the consequences.) on the other hand, in the absence of an immediate need, it is simpler to leave out error handling until a final .catch() statement. the signatures of these two functions are simple, they
accept a single parameter of any type. these functions are written by you, the programmer. the termination condition of these functions determines the "settled" state of the next promise in the chain. any termination other than a throw creates a "resolved" state, while terminating with a throw creates a "rejected" state. handlefulfilled(value) { /*...*/; return nextvalue; } handlerejection(reaso...
SharedArrayBuffer - JavaScript
an be used to create views on shared memory. unlike an arraybuffer, a sharedarraybuffer cannot become detached. description allocating and sharing memory to share memory using sharedarraybuffer objects from one agent in the cluster to another (an agent is either the web page’s main program or one of its web workers), postmessage and structured cloning is used. the structured clone algorithm
accepts sharedarraybuffers and typedarrays mapped onto sharedarraybuffers. in both cases, the sharedarraybuffer object is transmitted to the receiver resulting in a new, private sharedarraybuffer object in the receiving agent (just as for arraybuffer). however, the shared data block referenced by the two sharedarraybuffer objects is the same data block, and a side effect to the block in one agent will e...
String.prototype.replace() - JavaScript
hn this logs 'smith, john'. using an inline function that modifies the matched characters in this example, all occurrences of capital letters in the string are converted to lower case, and a hyphen is inserted just before the match location. the important thing here is that additional operations are needed on the matched item before it is given back as a replacement. the replacement function
accepts the matched snippet as its parameter, and uses it to transform the case and concatenate the hyphen before returning. function stylehyphenformat(propertyname) { function uppertohyphenlower(match, offset, string) { return (offset > 0 ? '-' : '') + match.tolowercase(); } return propertyname.replace(/[a-z]/g, uppertohyphenlower); } given stylehyphenformat('bordertop'), this returns 'bor...
WebAssembly.compileStreaming() - JavaScript
source is not a typed array, a typeerror is thrown. if compilation fails, the promise rejects with a webassembly.compileerror. examples compile streaming the following example (see our compile-streaming.html demo on github, and view it live also) directly streams a .wasm module from an underlying source then compiles it to a webassembly.module object. because the compilestreaming() function
accepts a promise for a response object, you can directly pass it a windoworworkerglobalscope.fetch() call, and it will pass the response into the function when it fulfills. var importobject = { imports: { imported_func: arg => console.log(arg) } }; webassembly.compilestreaming(fetch('simple.wasm')) .then(module => webassembly.instantiate(module, importobject)) .then(instance => instance.exports.expor...
WebAssembly.instantiateStreaming() - JavaScript
mbly.linkerror, or webassembly.runtimeerror, depending on the cause of the failure. examples instantiating streaming the following example (see our instantiate-streaming.html demo on github, and view it live also) directly streams a .wasm module from an underlying source then compiles and instantiates it, the promise fulfilling with a resultobject. because the instantiatestreaming() function
accepts a promise for a response object, you can directly pass it a windoworworkerglobalscope.fetch() call, and it will pass the response into the function when it fulfills. var importobject = { imports: { imported_func: arg => console.log(arg) } }; webassembly.instantiatestreaming(fetch('simple.wasm'), importobject) .then(obj => obj.instance.exports.exported_func()); the resultobject's instance memb...
WebAssembly - JavaScript
tes are valid webassembly code (true) or not (false). examples stream a .wasm module then compile and instantiate it the following example (see our instantiate-streaming.html demo on github, and view it live also) directly streams a .wasm module from an underlying source then compiles and instantiates it, the promise fulfilling with a resultobject. because the instantiatestreaming() function
accepts a promise for a response object, you can directly pass it a windoworworkerglobalscope.fetch() call, and it will pass the response into the function when it fulfills. var importobject = { imports: { imported_func: arg => console.log(arg) } }; webassembly.instantiatestreaming(fetch('simple.wasm'), importobject) .then(obj => obj.instance.exports.exported_func()); the resultobject's instance memb...
Iteration protocols - JavaScript
s built-in iterables string, array, typedarray, map, and set are all built-in iterables, because each of their prototype objects implements an @@iterator method. user-defined iterables you can make your own iterables like this: let myiterable = {}; myiterable[symbol.iterator] = function* () { yield 1; yield 2; yield 3; }; console.log([...myiterable]); // [1, 2, 3] built-in apis
accepting iterables there are many apis that
accept iterables. some examples include: new map([iterable]) new weakmap([iterable]) new set([iterable]) new weakset([iterable]) new map([[1, 'a'], [2, 'b'], [3, 'c']]).get(2); // "b" let myobj = {}; new weakmap([ [{}, 'a'], [myobj, 'b'], [{}, 'c'] ]).get(myobj); // "b" new set([1, 2, 3]).has(3); // true new set('123').has(...
Exponentiation (**) - 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. syntax operator: var1 ** var2 description the exponentiation operator is right-associative: a ** b ** c is equal to a ** (b ** c). ...
throw - JavaScript
; } catch (e) { monthname = 'unknown'; console.error(e.message, e.name); // pass exception object to err handler } another example of throwing an object the following example tests an input string for a u.s. zip code. if the zip code uses an invalid format, the throw statement throws an exception by creating an object of type zipcodeformatexception. /* * creates a zipcode object. * *
accepted formats for a zip code are: * 12345 * 12345-6789 * 123456789 * 12345 6789 * * if the argument passed to the zipcode constructor does not * conform to one of these patterns, an exception is thrown. */ function zipcode(zip) { zip = new string(zip); pattern = /[0-9]{5}([- ]?[0-9]{4})?/; if (pattern.test(zip)) { // zip code value will be the first match in the st...
Strict mode - JavaScript
o these categories: changes converting mistakes into errors (as syntax errors or at runtime), changes simplifying how the particular variable for a given use of a name is computed, changes simplifying eval and arguments, changes making it easier to write "secure" javascript, and changes anticipating future ecmascript evolution. converting mistakes into errors strict mode changes some previously-
accepted mistakes into errors. javascript was designed to be easy for novice developers, and sometimes it gives operations which should be errors non-error semantics. sometimes this fixes the immediate problem, but sometimes this creates worse problems in the future. strict mode treats these mistakes as errors so that they're discovered and promptly fixed. first, strict mode makes it impossible to acci...
Values - MathML
units unit description em font-relative unit ex font-relative unit. (the "x"-height of the element, 1ex ≈ 0.5em in many fonts) px pixels in inches (1 inch = 2.54 centimeters) cm centimeters mm millimeters pt points (1 point = 1/72 inch) pc picas (1 pica = 12 points) % percentage of the default value. ...
MathML attribute reference - MathML
this is an alphabetical list of mathml attributes. more details for each attribute are available on particular element pages. notes: the mathml <mstyle> and <math> elements
accept all attributes of all mathml presentation elements. see values for notes on values and units in mathml. the attributes background, color, fontfamily, fontsize, fontstyle, fontweight and xlink:href are deprecated. the xlink attributes on mathml elements: xlink:actuate, xlink:href, xlink:show and xlink:type are deprecated as well. name elements
accepting attribute description accent <mo>, <mover>, <munderover> a boolean value specifying whether the operator should be treated as an accent. accentunder <munder>, <munderover> a boolean value specifying whether the ...
Authoring MathML - MathML
cle.css" /> ... </head> <body> ... <div class="latex"> \documentclass[12pt]{article} \begin{document} \title{latexml example} \maketitle \begin{abstract} this is a sample latexml document. \end{abstract} \section{first section} $$ \sum_{n=1}^{+\infty} \frac{1}{n^2} = \frac{\pi^2}{6} $$ \end{document} </div> ... jqmath is another script to parse a simple latex-like syntax but which also
accepts non-ascii characters like √{∑↙{n=1}↖{+∞} 6/n^2} = π to write ∑ n = 1 + ∞ 6 n 2 = π . the installation is similar: download and copy the relevant javascript and css files on your web site and reference them in your page header (see the copy-me.html file from the zip archive for an example). one of the advantage of jqmath over the previous scripts is that it will...
<maction> - MathML
to specify which child elements are addressed by the action, you can make use of the selection attribute. attributes actiontype the action which specifies what happens for this element. possible values are: statusline: if there is a click on the expression or the reader moves the pointer over it, the message is sent to the browser's status line. the syntax is: <maction actiontype="statusline"> expression message </maction>. ...
<math> - MathML
class, id, style provided for use with stylesheets. dir overall directionality of formulas. ...
<mfrac> - MathML
class, id, style provided for use with stylesheets. denomalign the alignment of the denominator under the fraction. possible values are: left, center (default), and right. this attribute is deprecated and will be removed in the future. use css text-align instead. href used to set a hyperlink to a specified uri. linethickness the thickness of the horizontal fraction line. this attributes
accepts any length values. the values medium, thin, and thick are deprecated and will be removed in the future. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color and also the fraction line color. you can use #rgb, #rrggbb and html color names. numalign the alignment of the numerator over the fraction. possible values are: left, center ...
<mroot> - MathML
attributes class, id, style provided for use with stylesheets. href used to set a hyperlink to a specified url. 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. ...
<msqrt> - MathML
attributes class, id, style provided for use with stylesheets. href used to set a hyperlink to a specified uri. 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. ...
<mtable> - MathML
the corresponding rows (e.g. rowlines="none none solid"). possible values are: none (default), solid and dashed. unimplemented rowspacing specifies the space between table rows. unimplemented side specifies the position where <mlabeledtr> label elements should be placed. possible values are: left, right (default), leftoverlap and rightoverlap. width specifies the width of the entire table.
accepts length values. examples alignment with row number rendering: <math> <mi>x</mi> <mo>=</mo> <mtable frame="solid" rowlines="solid" align="axis 3"> <mtr> <mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> </mtr> <mtr> <mtd><mi>c</mi></mtd> <mtd><mi>d</mi></mtd> </mtr> <mtr> <mtd><mi>...
Image file type and format guide - Web media technologies
lossless licensing free and open under the creative commons attribution-sharealike license (cc-by-sa) version 3.0 or later. bmp (bitmap file) the bmp (bitmap image) file type is most prevalent on windows computers, and is generally used only for special cases in web apps and content. note: you should typically avoid using bmp for web site content, as it's not a generally-
accepted use of the format. bmp theoretically supports a variety of internal data representations. the simplest, and most commonly used, form of bmp file is an uncompressed raster image, with each pixel occupying 3 bytes representing its red, green, and blue components, and each row padded with 0x00 bytes to a multiple of 4 bytes wide. while other data representations are defined in the specification...
Mapping the width and height attributes of media container elements to their aspect-ratio - Web media technologies
en brought the idea up in the wicg community group and discussed it further until representatives from chrome were onboard with the idea. due to this work, browsers are working on adding a new mechanism for sizing images before the actual image is loaded. firefox has added an internal aspect-ratio property (in version 69 onwards) that applies to replaced elements, and other related elements that
accept width and height attributes. this appears in the browser's internal ua stylesheet, similar to the following: img, input[type="image"], video, embed, iframe, marquee, object, table { aspect-ratio: attr(width) / attr(height); } this actually affects any element that acts as a container for complex or mixed visual media — <embed>, <iframe>, <marquee>, <object>, <table>, and <video>, in additio...
OpenSearch description format
s larger than 10 kilobytes. url describes the url or urls to use for the search. the template attribute indicates the base url for the search query. firefox supports three url types: type="text/html" specifies the url for the actual search query. type="application/x-suggestions+json" specifies the url for fetching search suggestions. in firefox 63 onwards, type="application/json" is
accepted as an alias of this. type="application/x-moz-keywordsearch" specifies the url used when a keyword search is entered in the location bar. this is supported only in firefox. for these url types, you can use {searchterms} to substitute the search terms entered by the user in the search bar or location bar. other supported dynamic search parameters are described in opensearch 1.1 parameters. ...
Animation performance and frame rate - Web Performance
animation as a transition from each keyframe to the next. compared with animating elements using javascript, css animations can be easier to create. they can also give better performance, as they give the browser more control over when to render frames, and to drop frames if necessary. however, the performance cost of modifying a css property can vary from one property to another. it's commonly
accepted that 60 frames per second is the rate at which animations will appear smooth. for a rate of 60 frames per second, the browser has 16.7 milliseconds to execute scripts, recalculate styles and layout if needed, and repaint the area being updated. slow scripts and animating expensive css properties can result in jank as the browser struggles to hit a smooth frame rate. the rendering waterfall th...
Introduction to progressive web apps - Progressive web apps (PWAs)
e requests (for example storing them offline), the cache api for storing responses to network requests offline (very useful for storing site assets), and client-side data storage technologies such as web storage and indexeddb to store application data offline. progressive enhancement suppport modern web apps can be developed to provide an excellent experience to fully capable browsers, and an
acceptable (although not quite as shiny) experience to less capable browsers. we've been doing this for years with best practices such as progressive enhancement. by using progressive enhancement, pwas are cross-browser. this means developers should take into account the differences in implementation of some pwa features and technologies between different browser implementations. re-engageability on...
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
tification(); } }); }); this shows a popup using the operating system’s own notifications service: when the user confirms to receive notifications, the app can then show them. the result of the user action can be default, granted or denied. the default option is chosen when the user won't make a choice, and the other two are set when the user clicks yes or no respectively. when
accepted, the permission works for both notifications and push. create a notification the example app creates a notification out of the available data — a game is picked at random, and the chosen one feeds the notification with the content: it sets the game's name as the title, mentioning the author in the body, and showing the image as an icon: function randomnotification() { var randomitem = ...
Media - Progressive web apps (PWAs)
estricted 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 follows. place your mouse over the items in this list to see the actual pointer shapes in your browser: selector selects pointer indicating a link wait indicating that the program cannot
accept input progress indicating that the program is working, but can still
accept input default the default (usually an arrow) an outline property creates an outline that is often used to indicate keyboard focus. its values are similar to the border property, except that you cannot specify individual sides. some other features of user interfaces are implemented using att...
The building blocks of responsive design - Progressive web apps (PWAs)
ng at the mobile app view. to achieve this, we applied the brick css to the page using a separate <link> element with a media attribute: <link href="dist/brick.css" type="text/css" rel="stylesheet" media="all and (max-width: 480px)"> this says that the whole stylesheet will not be linked to the html unless the viewport width is 480px or less. moving on to the javascript, <script> elements don't
accept media attributes, so i had to do this a different way. fortunately there is a javascript construct called window.matchmedia(), which can conditionally run javascript constructs depending on whether a media query returns true or not. we opened up the brick.js file and wrapped the whole lot in the following: if (window.matchmedia("(max-width: 480px)").matches) { // the whole of brick.js goes her...
font-weight - SVG: Scalable Vector Graphics
value normal | bold | bolder | lighter | <number> default value normal animatable yes for a description of the values, please refer to the css font-weight property. specifications specification status comment css fonts module level 4the definition of 'font-weight' in that specification. working draft defines font-weight to
accept any numbers between 1 and 1000. css fonts module level 3the definition of 'font-weight' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'font-weight' in that specification. recommendation initial definition browser compatibility the compatibility table on this page is generated fro...
requiredExtensions - SVG: Scalable Vector Graphics
lement. if the attribute is used in other situations, then it represents a simple switch on the given element whether to render the element or not. note: if several extension reference objects are enclosed in a <switch> and none of them matches, this may lead to situations where no content is displayed. it is thus recommended to include a "catch-all" choice at the end of such a <switch> which is
acceptable in all cases. if the attribute is not present, then it implicitly evaluates to "true". if a null string or empty string value is given, the attribute evaluates to "false". the iri names for the extension should include versioning information, such as "http://example.org/svgextensionxyz/1.0", so that script writers can distinguish between different versions of a given extension. specificati...
systemLanguage - SVG: Scalable Vector Graphics
ement. if the attribute is used in other situations, then it represents a simple switch on the given element whether to render the element or not. note: if several alternative language objects are enclosed in a <switch> and none of them matches, this may lead to situations where no content is displayed. it is thus recommended to include a "catch-all" choice at the end of such a <switch> which is
acceptable in all cases. the attribute evaluates to "true" if one of the language tags indicated by user preferences is a case-insensitive match or prefix (followed by a "-") of one of the language tags given in the value of this parameter. otherwise it evaluates to "false". note: the prefix matching rule does not imply that if a user understands a language with a certain tag, that the user will also ...
version - SVG: Scalable Vector Graphics
the version attribute is used to indicate what specification a svg document conforms to. it is only allowed on the root <svg> element. it is purely advisory and has no influence on rendering or processing. while it is specified to
accept any number, the only two valid choices are currently 1.0 and 1.1. <svg version="1.1" viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="80" height="80"/> </svg> usage notes value <number> default value none animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'version' in that specification. recommendation initial definition ...
Getting started - SVG: Scalable Vector Graphics
ter. avoid gzip-compressed svg except when you are publishing to a webserver that you know will serve it correctly (see below). a word on webservers now that you have an idea of how to create basic svg files, the next stage is to upload them to a webserver. there are some gotchas at this stage though. for normal svg files, 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...
Types of attacks - Web security
<script>window.addeventlistener('domcontentloaded', (e) => { document.queryselector('form').submit(); }</script> there are a few techniques that should be used to prevent this from happening: get endpoints should be idempotent—actions that enact a change and do not simply retrieve data should require sending a post (or other http method) request. post endpoints should not interchangeably
accept get requests with parameters in the query string. a csrf token should be included in <form> elements via a hidden input field. this token should be unique per user and stored (for example, in a cookie) such that the server can look up the expected value when the request is sent. for all non-get requests that have the potential to perform an action, this input field should be compared against the...
concat - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the concat function concatenates two or more strings and returns the resulting string. syntax concat(string1 ,string2 [,stringn]* ) arguments stringn this function
accepts two or more arguments. each of these arguments is a string. returns a single string that is the concatenation of all the strings passed to the function as arguments. defined xpath 1.0 4.2 gecko support supported. ...
<xsl:output> - XSLT: Extensible Stylesheet Language Transformations
ibutes method specifies output format. version specifies the value of the version attribute of the xml or html declaration in the output document. this attribute is only used when method="html" or method="xml". encoding specifies the value of the encoding attribute in the output document. omit-xml-declaration indicates whether or not to include an xml declaration in the output.
acceptable values are "yes" or "no". standalone (not supported.) if present, indicates that a standalone declaration should occur in the output document and gives its value.
acceptable values are "yes" or "no". doctype-public specifies the value of the public attribute of the doctype declaration in the output document. doctype-system specifies the value of the system attribute of the doct...
An Overview - XSLT: Extensible Stylesheet Language Transformations
its own specialized syntax, an xslt stylesheet is an xml document, which must conform to all xml rules, including well-formedness. so the model for transformation is that one xml document is used to transform another xml document. an xslt stylesheet is marked as such by the inclusion of a standard xslt heading. the outermost element in an xslt stylesheet must be the <xsl:stylesheet> element (an
acceptable alternate is the <xsl:transform> element). this element will include at least one namespace declaration and the mandatory version attribute. other namespaces and three optional attributes may also be included. the mandatory namespace for xslt is "http://www.w3.org/1999/xsl/transform". namespaces are the subject of a fair amount of confusion in xml. despite the fact that very often namespa...
Understanding WebAssembly text format - WebAssembly
let’s look at an example: (module (import "console" "log" (func $log (param i32))) (func (export "logit") i32.const 13 call $log)) webassembly has a two-level namespace so the import statement here is saying that we’re asking to import the log function from the console module. you can also see that the exported logit function calls the import...
Using the WebAssembly JavaScript API - WebAssembly
tiple modules. to create a webassembly global instance from inside your javascript, you use the webassembly.global() constructor, which looks like this: const global = new webassembly.global({value:'i32', mutable:true}, 0); you can see that this takes two parameters: an object that contains two properties describing the global variable: value: its data type, which can be any data type
accepted within webassembly modules — i32, i64, f32, or f64. mutable: a boolean defining whether the value is mutable or not. a value containing the variable's actual value. this can be any value, as long as its type matches the specified data type. so how do we use this? in the following example we define a global as a mutable i32 type, with a value of 0. the value of the global is then c...