Search completed in 1.30 seconds.
664 results for "Coding":
Your results are loading. Please wait...
Localizations and character encodings - Developer guides
however, a way of representing characters in terms of bytes (character encoding) is used for transferring text over the network to the browser.
... the html specification recommends the use of the utf-8 encoding (which can represent all of unicode) and regardless of the encoding used requires web content to declare what encoding was used.
... the <meta> element's charset attribute is used to specify the page's character encoding.
...And 32 more matches
TextDecoder.prototype.encoding - Web APIs
the textdecoder.prototype.encoding read-only property returns a domstring containing the name of the decoding algorithm used by the specific decoder.
... it can be one of the following values: the recommended encoding for the web: 'utf-8'.
... the legacy single-byte encodings: 'ibm866', 'iso-8859-2', 'iso-8859-3', 'iso-8859-4', 'iso-8859-5', 'iso-8859-6', 'iso-8859-7', 'iso-8859-8'', 'iso-8859-8i', 'iso-8859-10', 'iso-8859-13', 'iso-8859-14', 'iso-8859-15', 'iso-8859-16', 'koi8-r', 'koi8-u', 'macintosh', 'windows-874', 'windows-1250', 'windows-1251', 'windows-1252', 'windows-1253', 'windows-1254', 'windows-1255', 'windows-1256', 'windows-1257', 'windows-1258', or 'x-mac-cyrillic'.
...And 8 more matches
Transfer-Encoding - HTTP
the transfer-encoding header specifies the form of encoding used to safely transfer the payload body to the user.
... http/2 doesn't support http 1.1's chunked transfer encoding mechanism, as it provides its own, more efficient, mechanisms for data streaming.
... transfer-encoding is a hop-by-hop header, that is applied to a message between two nodes, not to a resource itself.
...And 8 more matches
RTCRtpEncodingParameters - Web APIs
an instance of the webrtc api's rtcrtpencodingparameters dictionary describes a single configuration of a codec for an rtcrtpsender.
... it's used in the rtcrtpsendparameters describing the configuration of an rtp sender's encodings; rtcrtpdecodingparameters is used to describe the configuration of an rtp receiver's encodings.
... properties active if true, the described encoding is currently actively being used.
...And 6 more matches
RTCRtpSendParameters.encodings - Web APIs
the rtcrtpsendparameters dictionary's encodings property is an rtcrtpencodingparameters object providing configuration settings for the encoder being used for the rtcrtpsender's track.
... syntax sendparameters.encodings = encodingparameterlist; encodingparameterlist = sendparameters.encodings; value an array of objects conforming to the rtcrtpencodingparameters dictionary, each of which contains properties which provide settings and parameters that describe and configure a single codec that could be used to encode the track.
... each object's properties are: active if true, the described encoding is currently actively being used.
...And 6 more matches
Content-Encoding - HTTP
the content-encoding entity header is used to compress the media-type.
... when present, its value indicates which encodings were applied to the entity-body.
... header type entity header forbidden header name no syntax content-encoding: gzip content-encoding: compress content-encoding: deflate content-encoding: identity content-encoding: br // multiple, in the order in which they were applied content-encoding: gzip, identity content-encoding: deflate, gzip directives gzip a format using the lempel-ziv coding (lz77), with a 32-bit crc.
...And 6 more matches
Accept-Encoding - HTTP
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.
... 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.
...And 5 more matches
Percent-encoding - MDN Web Docs Glossary: Definitions of Web-related terms
percent-encoding is a mechanism to encode 8-bit characters that have specific meaning in the context of urls.
... it is sometimes called url encoding.
... the encoding consists of substitution: a '%' followed by the hexadecimal representation of the ascii value of the replace character.
...And 4 more matches
HTMLImageElement.decoding - Web APIs
the decoding property of the htmlimageelement interface represents a hint given to the browser on how it should decode the image.
... syntax refstr = imgelem.decoding; imgelem.decoding = refstr; values a domstring representing the decoding hint.
... auto: default mode, which indicates no preference for the decoding mode.
...And 3 more matches
Transcoding assets for Media Source Extensions - Web APIs
[0] (c) copyright 2008, blender foundation / www.bigbuckbunny.org / https://peach.blender.org/about/ tools required when working with mse, the following tools are a must have: ffmpeg — a command-line utility for transcoding your media into the required formats.
... because the audio codec in the mov container is already aac and the video codec is h.264, we can instruct ffmpeg not to perform transcoding.
... instead, it will just copy the audio and video tracks over without performing any transcoding, which is relatively faster than having to transcode.
...And 3 more matches
MediaCapabilities.decodingInfo() - Web APIs
the mediacapabilities.decodinginfo() method, part of the media capabilities api, returns a promise with the tested media configuration's mediacapabilitiesinfo; this contains the three boolean properties supported, smooth, and powerefficient, which describe whether decoding the media described would be supported, smooth, and powerefficient.
... syntax mediacapabilities.decodinginfo(mediadecodingconfiguration) parameters mediadecodingconfiguration a valid mediadecodingconfiguration dictionary containing a valid media decoding type of file or media-source and a valid media configuration: either an audioconfiguration or a videoconfiguration.
... return value a promise fulfilling with a mediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration passed to the decodinginfo() method is invalid, either because the type is not video or audio, the contenttype is not a valid codec mime type, the media decoding configuration is not a valid value for the media decoding type, or any other error in the media configuration passed to the method, including omitting values required in the media decoding configuration.
...And 2 more matches
MediaCapabilities.encodingInfo() - Web APIs
the mediacapabilities.encodinginfo() method, part of the mediacapabilities interface of the media capabilities api, returns a promise with the tested media configuration's mediacapabilitiesinfo; this contains the three boolean properties supported, smooth, and powerefficient, which describe how compatible the device is with the type of media.
... syntax mediacapabilities.encodinginfo(mediaencodingconfiguration) parameters mediaencodingconfiguration a valid mediaencodingconfiguration dictionary containing a valid media encoding type of record or transmission and a valid media configuration: either an audioconfiguration or videoconfiguration dictionary.
... return value a promise fulfilling with a mediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration passed to the encodinginfo() method is invalid, either because the type is not video or audio, the contenttype is not a valid codec mime type, or any other error in the media configuration passed to the method, including omitting any of the media encoding configuration elements.
...And 2 more matches
SVGImageElement.decoding - Web APIs
the decoding property of the svgimageelement interface represents a hint given to the browser on how it should decode the image.
... syntax var refstr = svgimageelement.decoding svgimageelement.decoding = refstr; values a domstring representing the decoding hint.
... auto: default mode, which indicates no preference for the decoding mode.
...And 2 more matches
Character encoding - MDN Web Docs Glossary: Definitions of Web-related terms
an encoding defines a mapping between bytes and text.
...by specifying a particular encoding (such as utf-8), we specify how the sequence of bytes is to be interpreted.
... for example, in html we normally declare a character encoding of utf-8, using the following line: <meta charset="utf-8"> this ensures that you can use characters from just about any human language in your html document, and they will display reliably.
... learn more general knowledge character encoding on w3c character encoding on wikipedia ...
nsCStringEncoding
« xpcom api reference summary the nscstringencoding enumeration describes the set of character encodings understood by the ns_cstringtoutf16 and ns_utf16tocstring functions.
... ns_cstring_encoding_ascii conversion between ascii and utf-16 assumes that all bytes in the source string are 7-bit ascii and can be inflated to utf-16 by inserting null bytes.
...ns_cstring_encoding_utf8 conversion between utf-8 and utf-16 is non-lossy.
... ns_cstring_encoding_native_filesystem conversion from utf-16 to the native filesystem charset may result in a loss of information.
Document.xmlEncoding - Web APIs
returns the encoding as determined by the xml declaration.
... if the xml declaration states: <?xml version="1.0" encoding="utf-16"?> ...the result should be "utf-16".
... however, firefox 3.0 includes information on endianness (e.g., utf-16be for big endian encoding), and while this extra information is removed as of firefox 3.1b3, firefox 3.1b3 is still consulting the file's encoding, rather than the xml declaration as the spec defines it ("an attribute specifying, as part of the xml declaration, the encoding of this document.").
... specification http://www.w3.org/tr/dom-level-3-cor...ment3-encoding this has been removed from dom core level 4wd ...
MediaDecodingConfiguration - Web APIs
the mediadecodingconfiguration dictionary of the media capabilities api is used to define the type of media being tested when calling mediacapabilities.decodinginfo() to query whether a specific media configuration is supported, smooth, and/or power efficient.
... properties a mediadecodingconfiguration dictionary takes two properties: type — the type of media being tested.
... } }; // check support and performance navigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ?
... '' : 'not ') + 'supported.') }); specifications specification status comment media capabilitiesthe definition of 'mediadecodingconfiguration' in that specification.
MediaEncodingConfiguration - Web APIs
the mediaencodingconfiguration dictionary of the media capabilities api is used to define the type of media being tested when calling mediacapabilities.encodinginfo() to query whether a specific media configuration is supported, smooth, and/or power efficient.
... properties a mediaencodingconfiguration dictionary takes two properties: type — the type of media being tested; takes one of two values: record — represents a configuration for recording of media, e.g.
... } }; // check support and performance navigator.mediacapabilities.encodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ?
... '' : 'not ') + 'supported.') }); specifications specification status comment media capabilitiesthe definition of 'mediaencodingconfiguration' in that specification.
PushManager.supportedContentEncodings - Web APIs
the supportedcontentencodings read-only property of the pushmanager interface returns an array of supported content codings that can be used to encrypt the payload of a push message.
... syntax var encodings[] = pushmanager.supportedcontentencodings value an array of strings.
... specifications specification status comment push apithe definition of 'supportedcontentencodings' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsupportedcontentencodings experimentalchrome full support 60edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable service workers preference.
XUL Coding Style Guidelines - Archive of obsolete content
to make xul files easy to read and maintain, localization friendly, and portable across user agents, we need to have a set of coding style guidelines to ensure our objectives are achievable.
... xml, xul, html, and xhtml guidelines the following are considered good coding style for xml/xul documents.
... <?xml version="1.0" encoding='utf-8'?> <!-- do not localize this file: [reason...] it isn't part of the build; --> when translators see this line, they won't bother to look at the rest of the file.
Encodings for localization files
when creating a localization for mozilla products, it’s important to be aware of the encoding of the files that you generate.
...this is tricky to hook up in the build process, so here it goes: file encoding notes toolkit/installer/windows/charset.mk ascii the win_installer_charset variable must be set to an encoding which matches toolkit/installer/windows/install.it charset= parameter.
... browser/installer/installer.inc utf-8 toolkit/installer/unix/install.it utf-8 native windows encodings the following table lists native windows encodings, and the win_installer_charset and charset= values for each: encoding name win_installer_charset (charset.mk) charset= (windows/install.it) ansi_charset cp1252 0 baltic_charset cp1257 186 chinesebig5_charset cp950 136 easteurope_charset cp1250 238 gb2312_charse...
JS_GetStringEncodingLength
syntax size_t js_getstringencodinglength(jscontext *cx, jsstring *str); name type description cx jscontext * a context.
... description js_getstringencodinglength returns the length of the specified string in bytes, regardless of its encoding.
... see also mxr id search for js_getstringencodinglength js_encodestringtobuffer js::deflatestringtoutf8buffer js::getdeflatedutf8stringlength bug 607292 ...
NDEFRecord.encoding - Web APIs
the encoding property ofthe ndefrecord interface is usvstring containing the name of the encoding used to encode ndef payload if it contains textual data.
... syntax ndefrecord.encoding value a usvstring which can be one of the following: "utf-8", "utf-16", "utf-16le" or "utf-16be".
... specifications specification status comment web nfc, ndefrecord.encoding draft initial definition.
RTCRtpEncodingParameters.maxBitrate - Web APIs
the rtcrtpencodingparameters dictionary's maxbitrate property specifies the maximum number of bits per second to allow a track encoded with this encoding to use.
... syntax rtpencodingparameters.maxbitrate = maxbitspersecond; rtpencodingparameters = { maxbitrate: maxbitspersecond }; maxbitspersecond = rtpencodingparameters.maxbitrate; value an unsigned long integer value specifying the maximum bandwidth this encoding is permitted to use for a track of media it encodes in terms of bits per second.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpencodingparameters.maxbitrate' in that specification.
RTCRtpEncodingParameters.scaleResolutionDownBy - Web APIs
the rtcrtpencodingparameters dictionary's scaleresolutiondownby property can be used to specify a factor by which to reduce the size of a video track during encoding.
... syntax rtpencodingparameters.scaleresolutiondownby = scalingfactor; rtpencodingparameters = { scaleresolutiondownby: scalingfactor }; value a double-precison floating-point number specifying the amount by which to reduce the size of the video during encoding.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpencodingparameters.scaleresolutiondownby' in that specification.
SpiderMonkey coding conventions - Archive of obsolete content
use the spidermonkey c++ coding style page on wikimo which is more up to date and the canonical source.
... the spidermonkey project owners enforce coding conventions pretty strictly during code reviews.
Encoding API - Web APIs
the encoding api provides a mechanism for handling text in various character encodings, including legacy non-utf-8 encodings.
... specifications specification status comment encoding living standard initial definition.
TextEncoder.encoding - Web APIs
the textencoder.encoding read-only property returns a domstring containing the name of the encoding algorithm used by the specific encoder.
... syntax b = encoder.encoding; specifications specification status comment encodingthe definition of 'textencoder.encoding' in that specification.
Gecko Coding Help Wanted - Archive of obsolete content
not up for coding yet?
HTMLFormElement.encoding - Web APIs
the htmlformelement.encoding property is an alternative name for the enctype element on the dom htmlformelement object.
WebRTC coding guide - Web APIs
this coding guide will explain in depth how webrtc works, and will dive into actual code that uses webrtc to do useful things.
Index - MDN Web Docs Glossary: Definitions of Web-related terms
found 528 pages: # page tags and summary 1 mdn web docs glossary: definitions of web-related terms beginner, definitions, dictionary, glossary, index, landing, terminology web technologies contain long lists of jargon and abbreviations that are used in documentation and coding.
... 5 api codingscripting, glossary, infrastructure an api (application programming interface) is a set of features and rules that exist inside a software program (the application) enabling interaction with it through software - as opposed to a human user interface.
... 8 ascii glossary, infrastructure ascii (american standard code for information interchange) is one of the most popular coding method used by computers for converting letters, numbers, punctuation and control codes into digital form.
...And 179 more matches
Index - Learn web development
this set of articles aims to provide complete beginners to web development with all that they need to start coding websites.
... 2 accessibility aria, accessibility, articles, beginner, css, codingscripting, html, javascript, landing, learn, module learning some html, css, and javascript is useful if you want to become a web developer.
... 3 accessible multimedia accessibility, article, audio, beginner, codingscripting, html, images, javascript, learn, multimedia, video, captions, subtitles, text tracks this chapter has provided a summary of accessibility concerns for multimedia content, along with some practical solutions.
...And 108 more matches
Index - Web APIs
WebAPIIndex
121 audioconfiguration api, audio, audioconfiguration, experimental, interface, media capabilities api, reference, video the audioconfiguration dictionary of the media capabilities api defines the audio file being tested when calling mediacapabilities.encodinginfo() or mediacapabilities.decodinginfo() to query whether a specific audio configuration is supported, smooth, and/or power efficient.
... 296 blobevent.blobevent() api, blobevent, constructor, dom, dom reference, experimental, media stream encoding, reference the blobevent() constructor returns a newly created blobevent object with an associated blob.
... 871 document.characterset api, dom, document, property, read-only, reference the document.characterset read-only property returns the character encoding of the document that it's currently rendered with.
...And 56 more matches
StringView - Archive of obsolete content
bufferview in javascript) based upon the javascript arraybuffer interface to create a highly extensible library that anyone can extend by adding methods to the object stringview.prototype to create a collection of methods for such string-like objects (since now: stringviews) which work strictly on arrays of numbers rather than on creating new immutable javascript strings to work with unicode encodings other than javascript's default utf-16 domstrings introduction as web applications become more and more powerful, adding features such as audio and video manipulation, access to raw data using websockets, and so forth, it has become clear that there are times when it would be helpful for javascript code to be able to quickly and easily manipulate raw binary data.
...|*| http://www.gnu.org/licenses/lgpl-3.0.html |*| \*/ function stringview (vinput, sencoding /* optional (default: utf-8) */, noffset /* optional */, nlength /* optional */) { var ftaview, awhole, araw, fputoutptcode, fgetoutptchrsize, ninptlen, nstartidx = isfinite(noffset) ?
... noffset : 0, ntranscrtype = 15; if (sencoding) { this.encoding = sencoding.tostring(); } encswitch: switch (this.encoding) { case "utf-8": fputoutptcode = stringview.pututf8charcode; fgetoutptchrsize = stringview.getutf8charlength; ftaview = uint8array; break encswitch; case "utf-16": fputoutptcode = stringview.pututf16charcode; fgetoutptchrsize = stringview.getutf16charlength; ftaview = uint16array; break encswitch; case "utf-32": ftaview = uint32array; ntranscrtype &= 14; break encswitch; default: /* case "ascii", or case "binarystring" or unknown cases */ ftaview = uint8array; ntranscrtype &= 14; } typeswitch: switch (typeof vinput) { case "string": /* the input argument i...
...And 39 more matches
Web video codec guide - Web media technologies
codec name (short) full codec name container support av1 aomedia video 1 mp4, webm avc (h.264) advanced video coding 3gp, mp4, webm h.263 h.263 video 3gp hevc (h.265) high efficiency video coding mp4 mp4v-es mpeg-4 video elemental stream 3gp, mp4 mpeg-1 mpeg-1 part 2 visual mpeg, quicktime mpeg-2 mpeg-2 part 2 visual mp4, mpeg, quicktime theora theora ogg vp8 video processor 8 3gp, ogg, webm vp9 ...
... video processor 9 mp4, ogg, webm factors affecting the encoded video as is the case with any encoder, there are two basic groups of factors affecting the size and quality of the encoded video: specifics about the source video's format and contents, and the characteristics and configuration of the codec used while encoding the video.
... assuming the frame rate is not reduced during encoding, higher frame rates cause larger compressed video sizes.
...And 30 more matches
Web audio codec guide - Web media technologies
additionally, webrtc implementations generally use a subset of these codecs for their encoding and decoding of media, and may support additional codecs as well, for optimal cross-platform support of video and audio conferencing, and to integrate better with legacy telecommunication solutions.
... codec name (short) full codec name container support aac advanced audio coding mp4, adts, 3gp alac apple lossless audio codec mp4, quicktime (mov) amr adaptive multi-rate 3gp flac free lossless audio codec mp4, ogg, flac g.711 pulse code modulation (pcm) of voice frequencies rtp / webrtc g.722 7 khz audio coding within 64 kbps (for telephony/voip) rtp / webrtc mp3 mpeg-1 audio layer ii...
... factors affecting the encoded audio there are two general categories of factors that affect the encoded audio which is output by an audio codec's encoder: details about the source audio's format and contents, and the codec and its configuration during the encoding process.
...And 27 more matches
Mozilla internal string guide
a 8-bit string can be in one of many character encodings while a 16-bit string is always in potentially-invalid utf-16.
... (you can make a 16-bit string guaranteed-valid utf-16 by passing it to ensureutf16validity().) the most common encodings are: ascii - 7-bit encoding for basic english-only strings.
... ucs2 - 16-bit encoding for a subset of unicode, bmp.
...And 13 more matches
Media Capabilities API - Web APIs
the media capabilities api allows developers to determine decoding and encoding abilities of the device, exposing information such as whether media is supported and whether playback should be smooth and power efficient, with real time feedback about playback to better enable adaptive streaming, and access to display property information.
... examples detect audio file support and expected performance this example defines a audio configuration then checks to see if the user agent supports decoding that media configuration, and whether it will perform well in terms of smoothness and power efficiency.
... if ('mediacapabilities' in navigator) { const audiofileconfiguration = { type : 'file', audio : { contenttype: "audio/mp3", channels: 2, bitrate: 132700, samplerate: 5200 } }; navigator.mediacapabilities.decodinginfo(audiofileconfiguration).then(result => { console.log('this configuration is ' + (result.supported ?
...And 13 more matches
Digital audio concepts - Web media technologies
the audio bandwidth is also affected by the codec, if it chooses to discard any frequency bands while encoding the sound.
... the process of compressing and decompressing audio is performed by encoding and decoding it using an audio codec (coder/decoder).
... psychoacoustics if you know what kind of audio you're most likely to handle, you can potentially find special filtering techniques applicable specifically to that kind of sound, that will optimize the encoding.
...And 12 more matches
nsIFile
[native character encoding variant] changing the leaf name of a nsifile does not affect the underlying filesystem.
...[native character encoding variant] the value of this attribute is a platform-specific file path.
...[native character encoding variant] the value of this attribute is a platform-specific file path.
...And 11 more matches
Using the Media Capabilities API - Web APIs
these features include: the ability to query the browser to determine its ability to encode or decode media given a specified set of encoding parameters.
...you can, therefore, test for the presence of the api like so: if ("mediacapabilities" in navigator) { // mediacapabilities is available } else { // mediacapabilities is not available } taking video as an example, to obtain information about video decoding abilities, you create a video decoding configuration which you pass as a parameter to mediacapabilities.decodinginfo() method.
... this returns a promise that fulfills with information about the media capabilities as to whether the video can be decoded, and whether decoding will be smooth and power efficient.
...And 11 more matches
Reading textual data - Archive of obsolete content
in order to read textual data, you need to know which character encoding the data is in.
... files and network sockets contain bytes, not characters - to give these bytes a meaning, you need to know the character encoding.
... determining the character encoding of data if you have a network channel (nsichannel), you can try the contentcharset property of it.
...And 8 more matches
Reading from Files - Archive of obsolete content
using the former will cause characters in the stream to be interpreted with a particular character encoding.
...the difference is that text streams process the bytes being read into characters in a particular character encoding whereas binary streams always read bytes.
...reading text files characters are interpreted from a text input stream using a specified character encoding.
...And 8 more matches
The "codecs" parameter in common media types - Web media technologies
0 0 yuv 4:4:4 1 0 0 yuv 4:2:2 1 1 0 yuv 4:2:0 1 1 1 yuv 4:0:0 (monochrome) the third digit in ccc indicates the chroma sample position, with a value of 0 indicating that the position is unknown and must be separately provided during decoding; a value of 1 indicating that the sample position is horizontally colocated with the (0, 0) luma sample; and a value of 2 indicating that the sample position is colocated with (0, 0) luma.
... 64 00 progressive high profile (phip) essentially high profile without support for field coding.
...also includes support for up to 14 bits per color sample and efficient lossless region coding.
...And 7 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
listing 1: calling xpcom functions using xpconnect <?xml version="1.0" encoding="utf-8"?> <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript"><![cdata[ var ioservice = components.classes['@mozilla.org/network/io-service;1'] .getservice(components.interfaces.nsiioservice); alert(ioservice); ]]></script> </page> calling xpconnect using local files try saving the contents of listing 1...
... text file input listing 15 shows an example of opening a text file encoded as shift-jis (a double-byte character encoding for japanese).
...rstream.readstring(filestream.available(), out); var filecontents = out.value; converterstream.close(); filestream.close(); alert(filecontents); outputting text files fixme: not sure this example is relevant in an english context, maybe something from the snippets listing 16 shows how to take text internally represented as unicode and output it to a file encoded using euc-jp (a japanese text encoding).
...And 6 more matches
Creating a Microsummary - Archive of obsolete content
to begin building the generator, create a new empty text file and add an xml declaration and empty <generator> tag to it: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1"> </generator> giving it a name generators should have name attributes which are arbitrary descriptions of the microsummaries the generator creates.
...since our generator will be creating microsummaries displaying the firefox download count, let's give it the name "firefox download count": <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> </generator> adding an xslt transform sheet generators must include an xslt transform sheet (also known as an xslt stylesheet) which transforms the page content into its microsummary.
... add the xslt transform sheet to the generator by including it within a <template> element: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> </transform> </template> </generator> note that while microsummary generators can include arbitrary xslt, including xslt that produces rich text output, firefox currently only displays the text version of the xslt output.
...And 6 more matches
Data URLs - HTTP
note the use of percent-encoding (url-encoding) for the quote and space characters.
... also, for csv data (mime type "text/csv"), percent-encoding is needed to preserve the line endings that delimit rows of the spreadsheet.
... encoding data into base64 format base64 is a group of binary-to-text encoding schemes that represent binary data in an ascii string format by translating it into a radix-64 representation.
...And 6 more matches
TE - HTTP
WebHTTPHeadersTE
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).
... see also the transfer-encoding response header for more details on transfer encodings.
...And 6 more matches
HTTP Index - HTTP
WebHTTPIndex
17 content negotiation 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).
... 50 accept-charset content negotiation, http, http header, reference, request header the accept-charset request http header advertises which character encodings the client understands.
... 51 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.
...And 6 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
the namespace uri is : http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul if the character encoding is utf-8, both the encoding specifier and the xml declaration can be omitted.
... <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href="chrome://global/skin/"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <!-- contents go here.
... <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href="chrome://global/skin/"?> <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="my dialog" buttons="accept,cancel" ondialogaccept="savevalues(); window.close();" ondialogcancel="window.close();"> <checkbox label="my option"/> </dialog> listing 8: a dialog figure 5: output from listing 8 note: the functions behind t...
...And 5 more matches
Index - Archive of obsolete content
20 reddit example advanced, codingscripting, javascript, mobile no summary!
...as a rough overview this is a version string split by periods, some examples: 240 extensions support in seamonkey 2 add-ons, codingscripting, extensions, javascript, seamonkey, url, thunderbird starting with seamonkey 2 alpha 1 seamonkey supports toolkit/-style extensions.
... 267 adding events and commands add-ons, codingscripting, dom, glossary, guide, javascript, xul, events no summary!
...And 5 more matches
Writing textual data - Archive of obsolete content
when writing textual data to an output stream or to a file, you need to pick a character encoding.
... some character encodings (utf-8, utf-16, utf-32) can represent "all" characters (the full repertoire of unicode) while others can only represent a subset of the full repertoire.
... writing to a stream in gecko 1.8 (seamonkey 1.0, firefox 1.5), you can use nsiconverteroutputstream: var charset = "utf-8"; // can be any character encoding name that mozilla supports var os = components.classes["@mozilla.org/intl/converter-output-stream;1"] .createinstance(components.interfaces.nsiconverteroutputstream); // this assumes that fos is the nsioutputstream you want to write to os.init(fos, charset, 0, 0x0000); os.writestring("umlaute: \u00fc \u00e4\n"); os.writestring("hebrew: \u05d0 \u05d1\n"); // etc.
...And 5 more matches
Writing to Files - Archive of obsolete content
writing text files characters are written to a text input stream using a specified character encoding, which defaults to utf-8.
...this encoding is done automatically as long as you specify the 'text' flag to nsiscriptableio.newoutputstream().
... other character encodings are available; see writing other character encodings below for details about writing text in other encodings.
...And 5 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
your operating system normally provides them: a way to create and work with files and directories a text editor for plain text files character encoding some text editors have a setting for character encoding.
... if your language uses only plain latin (ascii) characters, set your text editor to use any encoding except unicode.
... if your language uses accents or other non-latin characters, set your text editor to save files using the utf-8 encoding.
...And 5 more matches
The Business Benefits of Web Standards - Archive of obsolete content
contrary to popular belief, coding to standards does not mean producing less compelling content.
...in many cases, rendering differences are caused by ambiguous coding.
...using validation tools such as the w3c validator helps by spotting coding errors and making sure html code is well-formed, which eliminates ambiguity in parsing by browsers.
...And 5 more matches
Internationalized Domain Names (IDN) Support in Mozilla Browsers
ascii-compatible encoding (ace) the next step is to convert the 8-bit characters in unicode to 7-bit ones using only restricted ascii characters.
... during the discussion phase of the idn protocols development, there were some competing ascii-compatible encoding (ace) schemes proposed but an agreement was reached eventually to standardize on a type of ace called "punycode".
... this is defined in rfc 3492 (punycode: a bootstring encoding of unicode for internationalized domain names in applications (idna)).
...And 5 more matches
OS.File for the main thread
example: read the contents of a file as text the following snippet opens a file "file.txt" and read its contents as a string, using the default encoding (utf-8).
... example: write a string to a file the following snippet writes the text "this is some text" to a string "file.txt", using the default encoding (utf-8).
...at the time of this writing, write does not support encoding option so the text to be written has to be encoded with textencoder.
...And 5 more matches
Using Objective-C from js-ctypes
// [nsstring getbytes:maxlength:usedlength:encoding:options:range:remainingrange:] sel foo = sel_registername("getbytes:maxlength:usedlength:encoding:options:range:remainingrange:"); method which returns non-id type if a method returns a type which is compatible with id, we can cast it, or just use it as id type (since we don't need to use a different type for each instance, in terms of c).
... nsstring* text = [nsstring initwithcstring: "hello, firefox!" encoding: nsutf8stringencoding]; this will be converted into the following c code.
... nsutf8stringencoding is defined as 4.
...And 5 more matches
RTCRtpSender.setParameters() - Web APIs
in other words, setparameters() updates the configuration of the rtp transmission as well as the encoding configuration for a specific media track on the webrtc connection.
... syntax var promise = rtcrtpsender.setparameters(parameters) parameters parameters an object conforming with the rtcrtpsendparameters dictionary, specifying options for the rtcrtpsender; these include potential codecs that could be use for encoding the sender's track.
... encodings an array of rtcrtpencodingparameters objects, each specifying the parameters for a single codec that could be used to encode the track's media.
...And 5 more matches
SubtleCrypto.verify() - Web APIs
*/ function getmessageencoding() { const messagebox = document.queryselector(".rsassa-pkcs1 #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature.
...*/ async function verifymessage(publickey) { const signaturevalue = document.queryselector(".rsassa-pkcs1 .signature-value"); signaturevalue.classlist.remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( "rsassa-pkcs1-v1_5", publickey, signature, encoded ); signaturevalue.classlist.add(result ?
...*/ function getmessageencoding() { const messagebox = document.queryselector(".rsa-pss #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature.
...And 5 more matches
@charset - CSS: Cascading Style Sheets
WebCSS@charset
the @charset css at-rule specifies the character encoding used in the style sheet.
... as there are several ways to define the character encoding of a style sheet, the browser will try the following methods in the following order (and stop as soon as one yields a result) : the value of the unicode byte-order character placed at the beginning of the file.
... use the character encoding defined by the referring document: the charset attribute of the <link> element.
...And 5 more matches
Android-specific test suites
android-checkstyle ensures that the java coding style is consistent throughout.
... android-findbugs ensures that the code avoids common java coding errors.
... android-lint ensures that the code avoids common android coding errors.
...And 4 more matches
Document.characterSet - Web APIs
the document.characterset read-only property returns the character encoding of the document that it's currently rendered with.
... (a character encoding is a set of characters and how to interpret bytes into those characters.) a “character set” and a “character encoding” are related, but different.
... despite the name of this property, it returns the encoding.
...And 4 more matches
TextEncoder - Web APIs
note: there is a polyfill implementation to support non-utf-8 text encodings on github.
... example const encoder = new textencoder() const view = encoder.encode('€') console.log(view); // uint8array(3) [226, 130, 172] constructor textencoder() returns a newly constructed textencoder that will generate a byte stream with utf-8 encoding.
... textencoder.prototype.encodingread only always returns "utf-8".
...And 4 more matches
Writing a WebSocket server in C# - Web APIs
using system.text; using system.text.regularexpressions; while(client.available < 3) { // wait for enough bytes to be available } byte[] bytes = new byte[client.available]; stream.read(bytes, 0, bytes.length); //translate bytes of request to string string data = encoding.utf8.getstring(bytes); if (regex.ismatch(data, "^get")) { } else { } the response is easy to build, but might be a little bit difficult to understand.
...7da-95ca-c5ab0dc85b11" (a special guid specified by rfc 6455) compute sha-1 and base64 hash of the new value write the hash back as the value of "sec-websocket-accept" response header in an http response if (new system.text.regularexpressions.regex("^get").ismatch(data)) { const string eol = "\r\n"; // http/1.1 defines the sequence cr lf as the end-of-line marker byte[] response = encoding.utf8.getbytes("http/1.1 101 switching protocols" + eol + "connection: upgrade" + eol + "upgrade: websocket" + eol + "sec-websocket-accept: " + convert.tobase64string( system.security.cryptography.sha1.create().computehash( encoding.utf8.getbytes( new system.text.regularexpressions.regex("sec-websocket-key: (.*)").match(data).
...groups[1].value.trim() + "258eafa5-e914-47da-95ca-c5ab0dc85b11" ) ) ) + eol + eol); stream.write(response, 0, response.length); } decoding messages after a successful handshake, the client will send encoded messages to the server.
...And 4 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
WebHTTPCORS
to handle the privileges: let's look at what the browser will send to the server in this case, and let's see how the server responds: get /resources/public-data/ http/1.1 host: bar.other user-agent: mozilla/5.0 (macintosh; intel mac os x 10.14; rv:71.0) gecko/20100101 firefox/71.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 origin: https://foo.example the request header of note is origin, which shows that the invocation is coming from https://foo.example.
... http/1.1 200 ok date: mon, 01 dec 2008 00:23:53 gmt server: apache/2 access-control-allow-origin: * keep-alive: timeout=2, max=100 connection: keep-alive transfer-encoding: chunked content-type: application/xml […xml data…] in response, the server sends back an access-control-allow-origin header.
...the first exchange is the preflight request/response: options /doc http/1.1 host: bar.other user-agent: mozilla/5.0 (macintosh; intel mac os x 10.14; rv:71.0) gecko/20100101 firefox/71.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 origin: http://foo.example access-control-request-method: post access-control-request-headers: x-pingother, content-type http/1.1 204 no content date: mon, 01 dec 2008 01:15:39 gmt server: apache/2 access-control-allow-origin: https://foo.example access-control-allow-methods: post, get, options access-control-allow-headers: x-pingother, content-type access-c...
...And 4 more matches
Accept-Charset - HTTP
the accept-charset request http header advertises which character encodings the client understands.
... using content negotiation, the server selects one of the encodings, uses it, and informs the client of its choice within the content-type response header, usually in a charset= parameter.
... if the server cannot serve any character encoding from this request header, it can theoretically send back a 406 not acceptable error code.
...And 4 more matches
Index - HTTP
WebHTTPHeadersIndex
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.
... 23 content-encoding http, headers, reference the content-encoding entity header is used to compress the media-type.
...And 4 more matches
Custom toolbar button - Archive of obsolete content
your operating system normally provides them: a way to create and work with files and directories a text editor for plain text files character encoding some text editors have a setting for character encoding.
... if your language uses only plain latin (ascii) characters, set your text editor to use any encoding except unicode.
... if your language uses accents or other non-latin characters, set your text editor to save files using the utf-8 encoding.
...And 3 more matches
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
items var xincludes = docu.getelementsbytagnamens('http://www.w3.org/2001/xinclude', 'include'); if (xincludes) { for (i=0; i < xincludes.length; i++) { 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(...
... // fix: we test for file extensions as well in case file:// doesn't return content type (as seems to be the case); can some other tool be uesd in ff (or ie) to detect encoding of local file?
... probably just need bom test since other encodings must be specified var patternxml = /\.(svg|xml|xul|rdf|xhtml)$/; if ((contenttype && contenttype.match(/[text|application]\/(.*)\+?xml/)) || (href.indexof('file://') === 0 && href.match(patternxml))) { /* grab the response as text (see below for that routine) and then find encoding within*/ var encname = '([a-za-z][a-za-z0-9._-]*)'; var pattern = new regexp('^<\\?xml\\s+.*encoding\\s*=\\s*([\'"])'+encname+'\\1.*\\?>'); // check document if not?
...And 3 more matches
Client-Server Overview - Learn web development
i&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=1; _ga=ga1.2.1688886003.1471911953; ffo=true the first and second lines contain most of the information we talked about above: ...
... it can accept gzip compressed information (accept-encoding: gzip).
... http/1.1 200 ok server: apache x-backend-server: developer1.webapp.scl3.mozilla.com vary: accept,cookie, accept-encoding content-type: text/html; charset=utf-8 date: wed, 07 sep 2016 00:11:31 gmt keep-alive: timeout=5, max=999 connection: keep-alive x-frame-options: deny allow: get x-cache-info: caching content-length: 41823 <!doctype html> <html lang="en-us" dir="ltr" class="redesign no-js" data-ffo-opensanslight=false data-ffo-opensans=false > <head prefix="og: http://ogp.me/ns#"> <meta charset="utf-8"> <...
...And 3 more matches
NS_UTF16ToCString
« xpcom api reference summary the ns_utf16tocstring function converts the value of a nsastring instance from utf-16 to the specified multi-byte encoding and stores the result in a nsacstring instance.
... #include "nsstringapi.h" nsresult ns_utf16tocstring( const nsastring& asrc, nscstringencoding adestencoding, nsacstring& adest ); parameters asrc [in] a nsastring instance containing the source utf-16 string to be converted.
... adestencoding [in] the character encoding of the destination string.
...And 3 more matches
MediaConfiguration - Web APIs
the mediaconfiguration mediacapabilities dictionary of the media capabilities api describes how media and audio files must be configured, or defined, to be passed as a parameter of the mediacapabilities.encodinginfo() and mediacapabilities.encodinginfo() methods.
... properties a valid configuration includes a valid encoding configuration type or decoding configuration type and a valid audio configuration or video configuration.
... if you plan on querying encoding information, set the media type to record or transmission.
...And 3 more matches
TextDecoder() - Web APIs
the textdecoder() constructor returns a newly created textdecoder object for the encoding specified in parameter.
... if the value for utflabel is unknown, or is one of the two values leading to a 'replacement' decoding algorithm ( "iso-2022-cn" or "iso-2022-cn-ext"), a domexception with the "typeerror" value is thrown.
...each label is associated with a specific encoding type: possible values of utflabel encoding "unicode-1-1-utf-8", "utf-8", "utf8" 'utf-8' "866", "cp866", "csibm866", "ibm866" 'ibm866' "csisolatin2", "iso-8859-2", "iso-ir-101", "iso8859-2", "iso88592", "iso_8859-2", "iso_8859-2:1987", "l2", "latin2" 'iso-8859-2' "csisolatin3", "iso-8859-3", "iso-ir-109", "iso8859-3", "iso88593", "iso_8859-3", "iso_8859-3:1988", "l3", "latin3" 'iso-8859-3' "csisolatin4", "iso-8859-4", "iso-ir-110", "iso8859-4", "iso88594", "iso_8859-4", "iso_8859-4:1988"...
...And 3 more matches
Using XMLHttpRequest - Web APIs
if you are using the post method the server will receive a string similar to one of the following three examples, depending on the encoding type you are using: method: post; encoding type: application/x-www-form-urlencoded (default): content-type: application/x-www-form-urlencoded foo=bar&baz=the+first+line.%0d%0athe+second+line.%0d%0a method: post; encoding type: text/plain: content-type: text/plain foo=bar baz=the first line.
... method: post; encoding type: multipart/form-data: content-type: multipart/form-data; boundary=---------------------------314911788813839 -----------------------------314911788813839 content-disposition: form-data; name="foo" bar -----------------------------314911788813839 content-disposition: form-data; name="baz" the first line.
...submitting..."); */ submitdata (odata); } function pushsegment (ofrevt) { this.owner.segments[this.segmentidx] += ofrevt.target.result + "\r\n"; this.owner.status--; processstatus(this.owner); } function plainescape (stext) { /* how should i treat a text/plain form encoding?
...And 3 more matches
Content negotiation - HTTP
in http, content negotiation is the mechanism that is used for serving different representations of a resource at the same uri, so that the user agent can specify which is best suited for the user (for example, which language of a document, which image format, or which content encoding).
... the http/1.1 standard defines list of the standard headers that start server-driven negotiation (accept, accept-charset, accept-encoding, accept-language).
... the accept-charset header the accept-charset header indicates to the server what kinds of character encodings are understood by the user-agent.
...And 3 more matches
HTTP headers - HTTP
WebHTTPHeaders
headers can also be grouped according to how proxies handle them: connection keep-alive proxy-authenticate proxy-authorization te trailer transfer-encoding upgrade (see also protocol upgrade mechanism).
... 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.
...And 3 more matches
Digital video concepts - Web media technologies
encoding color representing the colors in an image or video requires several values for each pixel.
...there are several color models, and video codec makes use of one or more of these to represent their pixels during the encoding process as well as after decoding the video frames.
... yuv unlike rgb, the yuv (or y'uv) color encoding system is based around how humans perceive a color image.
...And 3 more matches
Base64 - MDN Web Docs Glossary: Definitions of Web-related terms
base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ascii string format by translating it into a radix-64 representation.
... the term base64 originates from a specific mime content transfer encoding.
... base64 encoding schemes are commonly used when there is a need to encode binary data that needs to be stored and transferred over media that are designed to deal with ascii.
...And 2 more matches
What’s in the head? Metadata in HTML - Learn web development
specifying your document's character encoding in the example we saw above, this line was included: <meta charset="utf-8"> this element simply specifies the document's character encoding — the character set that the document is permitted to use.
...for example, your page could handle english and japanese just fine: if you set your character encoding to iso-8859-1, for example (the character set for the latin alphabet), your page rendering may appear all messed up: note: some browsers (e.g.
... chrome) automatically fix incorrect encodings, so depending on what browser you use, you may not see this problem anyway.
...And 2 more matches
Index
in addition to the freebl, softoken, and ckbi modules, there is an utility library for general operations (e.g., encoding/decoding between data formats, a list of standardized object identifiers (oid)).
...jss also provides a pure java interface for asn.1 types and ber/der encoding.
... -s turn on ssl parsing and decoding.
...And 2 more matches
nss tech note1
this was written to be a generic decoder, that includes both der (distinguished encoding rules) and ber (basic encoding rules).† it handles both streaming and non-streaming input.
... sec_asn1_skip: specifies that the decoder should skip decoding of the component.
...sec_quickderdecodeitem supports skipping the decoding of optional components if you define the tag of the component in the template sec_asn1_inner: recurse into the component and saves its content, without the surrounding asn.1 tag and length sec_asn1_save: saves the component data, but does not proceed to the next component if within a sequence template array.
...And 2 more matches
nsICryptoHash
since hash functions are computed over bytes, you will first need to convert the string to a series of bytes using nsiscriptableunicodeconverter and a unicode encoding that you specify.
... note: different encodings will produce different hash values!
... you should always use the same encoding if you intend to compare results.
...And 2 more matches
NS_CStringToUTF16
#include "nsstringapi.h" nsresult ns_cstringtoutf16( const nsacstring& asrc, nscstringencoding asrcencoding, nsastring& adest ); parameters asrc [in] a nsacstring instance containing the source string to be converted.
... asrcencoding [in] the character encoding of the source string.
... see nscstringencoding for the set of values that can be passed for this parameter.
...And 2 more matches
PKCS #11 Netscape Trust Objects - Network Security Services
attribute type description cka_class ck_object_class cko_netscape_trust cka_issuer byte array der-encoding of the certificate issuer name.
... cka_subject byte array der-encoding of the certificate subject name.
... cka_serial_number byte array der-encoding of the certificate serial number.
...And 2 more matches
TextDecoder - Web APIs
the textdecoder interface represents a decoder for a specific text encoding, such as utf-8, iso-8859-2, koi8-r, gbk, etc.
...console.log(utf8decoder.decode(u8arr)); console.log(utf8decoder.decode(i8arr)); console.log(utf8decoder.decode(u16arr)); console.log(utf8decoder.decode(i16arr)); console.log(utf8decoder.decode(i32arr)); handling non-utf8 text in this example, we decode the russian text "Привет, мир!", which means "hello, world." in our textdecoder() constructor, we specify the windows-1251 character encoding, which is appropriate for cyrillic script.
... constructor textdecoder() returns a newly constructed textdecoder that will generate a code point stream with the decoding method specified in parameters.
...And 2 more matches
Setting up adaptive streaming media sources - Developer guides
mpeg-dash encoding mpeg-dash is an adaptive bitrate streaming technique that enables streaming of media content over the internet delivered from conventional http web servers.
... <?xml version="1.0" encoding="utf-8"?> <mpd xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemalocation="urn:mpeg:dash:schema:mpd:2011 dash-mpd.xsd" type="static" mediapresentationduration="pt654s" minbuffertime="pt2s" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011"> <baseurl>http://example.com/ondemand/</baseurl> <period> <!-- english audio --> ...
... note: since mpeg-dash decoding is done partially using javascript and mse files are often grabbed using xhr, keep same origin rules in mind.
...And 2 more matches
Compression in HTTP - HTTP
the browser sends an accept-encoding header with the algorithm it supports and its order of precedence, the server picks one, uses it to compress the body of the response and uses the content-encoding header to tell the browser the algorithm it has chosen.
... as content negotiation has been used to choose a representation based on its encoding, the server must send a vary header containing at least accept-encoding alongside this header in the response; that way, caches will be able to cache the different representations of the resource.
... to do this, http uses a mechanism similar to the content negotiation for end-to-end compression: the node transmitting the request advertizes its will using the te header and the other node chooses the adequate method, applies it, and indicates its choice with the transfer-encoding header.
...And 2 more matches
encodeURIComponent() - JavaScript
the encodeuricomponent() function encodes a uri by replacing each instance of certain characters by one, two, three, or four escape sequences representing the utf-8 encoding of the character (will only be four escape sequences for characters composed of two "surrogate" characters).
...this will encode "&" symbols that may inadvertently be generated during data entry for special html entities or other characters that require encoding/decoding.
... to be more stringent in adhering to rfc 3986 (which reserves !, ', (, ), and *), even though these characters have no formalized uri delimiting uses, the following can be safely used: function fixedencodeuricomponent(str) { return encodeuricomponent(str).replace(/[!'()*]/g, function(c) { return '%' + c.charcodeat(0).tostring(16); }); } examples encoding for content-disposition and link headers the following example provides the special encoding required within utf-8 content-disposition and link server response header parameters (e.g., utf-8 filenames): var filename = 'my file(2).txt'; var header = "content-disposition: attachment; filename*=utf-8''" + encoderfc5987valuechars(filename); console.log(header); // logs "content-dispos...
...And 2 more matches
io/text-streams - Archive of obsolete content
lose(); } } return text; } function writetexttofile(text, filename) { var fileio = require("sdk/io/file"); var textwriter = fileio.open(filename, "w"); if (!textwriter.closed) { textwriter.write(text); textwriter.close(); } } globals constructors textreader(inputstream, charset) creates a buffered input stream that reads text from a backing stream using a given text encoding.
... charset : string inputstream is expected to be in the character encoding named by this value.
... textwriter(outputstream, charset) creates a buffered output stream that writes text to a backing stream using a given text encoding.
... charset : string text will be written to outputstream using the character encoding named by this value.
Appendix D: Loading Scripts - Archive of obsolete content
the script will be read with the utf-8 encoding, based on the encoding of the overlay, and will execute as javascript version 1.8, based on the version specified in the script tag.
... <?xml version="1.0" encoding="utf-8"?> <!doctype overlay> <overlay id="script-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript;version=1.8" src="overlay.js"/> </overlay> evalinsandbox the components.utils.evalinsandbox method may be used to load arbitrary code into components.utils.sandbox objects.
... let context = {}; services.scriptloader.loadsubscript("chrome://my-package/content/foo-script.js", context, "utf-8" /* the script's encoding */); the following code will execute a simple script loaded from a local file in the same directory as the current script.
...all communication between these contexts and outer contexts is marshalled through json encoding and decoding.
Promises - Archive of obsolete content
these apis allow asynchronous operation to be achieved with a coding style similar to synchronous variants.
... let config = json.parse( yield os.file.read(configpath, { encoding: "utf-8" })); let files = []; // get the directory contents from a list of directories.
... config.indexstats = processor.stats; yield os.file.writeatomic(configpath, json.stringify(config), { tmppath: configpath + "." + math.random(), encoding: "utf-8" }) timestamp = new date; }); http requests http requests should, in nearly all circumstances, be made via the standard xmlhttprequest api.
... try { this.data = json.parse( yield os.file.read(this.path, { encoding: "utf-8" })); } catch (e if e.becausenosuchfile) { this.data = json.parse(json.stringify(default_)); } // create a saver to write our json-stringified data to our // path, at 1000ms minimum intervals.
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
(or firefox.cfg if for firefox...) file encoding if needed, the encoding can be done with the perl script: moz-byteshift.pl available at http://www.alain.knaff.lu/howto/mozi...z-byteshift.pl.
... $ cat mci-mozilla-web-tux.js lockpref("general.config.vendor", "mci-mozilla-web-tux"); lockpref("autoadmin.global_config_url","http://corbeau.int-evry.fr/cgi-bin/mci-mozilla-glob-prefs-tux.cgi"); encoding mozilla.js file to mozilla.cfg just use the moz-byteshift.pl perl script which for mozilla 1.x and netscape 6/7 uses a shift of 13, in netscape 4.x it was 7.
...getldapattributes("ldap2.int-evry.fr", "ou=people,dc=int-evry,dc=fr", "uid=" +env_user, "uid,cn,mail"); } catch(e) { displayerror("lockedpref", e); } eop print $page; windows peculiarities without web base cgi file, beware that in windows, the original (before encoding) mozilla.js file must start with: //begin ce prefs , if not you'll get "failed to read configuration file..." message, and mozilla won't start :-( in windows environment variables like user or home, are username and homepath, that's why we must create a different pair of configuration files (cfg and cgi) for both systems (linux/windows).
...// any changes // from now on can be made here w/o re-encoding the netscape.jsc file to // netscape.cfg.
Character sets supported by Gecko - Gecko Redirect 1
gecko supports the character encodings defined in the encoding standard.
... in gecko-internal apis, it is necessary to use particular (potentially) mixed-case names for the encodings.
... for encodings that have a compatibility name in the dom standard, except gbk, this is the compatibilty name.
... for other encodings, including gbk, this is the lower-case name from the encoding standard.
Getting started with Svelte - Learn web development
you can just read the content to get a good understanding of svelte features, but you'll get the most out of this tutorial if you follow along coding the app with us as you go.
... svelte also provides an online repl, which is a playground for live-coding svelte apps on the web without having to install anything on your machine.
... we provide a repl for each article so you can start coding along right away.
... we will provide a repl at the beginning and end of each article so that you can start coding with us right away.
NSS API Guidelines
crypto wrapper lib/pk11wrap pk11func.h, secmod.h, secmodt.h pkcs12 provides functions and types for encoding and decoding pkcs #12 data.
... pkcs #12 lib/pkcs12 pkcs12t.h, pkcs12.h, p12plcy.h, p12.h, p12t.h pkcs7 provides functions and types for encoding and decoding encrypted data in pkcs #7 format.
...the library supports base-64 encoding/decoding, reader-writer locks, the secitem data type, der encoding/decoding, error types and numbers, oid handling, and secure random number generation.
...these rules are derived from existing coding practices inside the security library, since consistency is more important than debates about what might look nice.
nsIExternalHelperAppService
to access this service, use: var externalhelperappservice = components.classes["@mozilla.org/uriloader/external-helper-app-service;1"] .getservice(components.interfaces.nsiexternalhelperappservice); method overview boolean applydecodingforextension(in autf8string aextension, in acstring aencodingtype); nsistreamlistener docontent(in acstring amimecontenttype, in nsirequest arequest, in nsiinterfacerequestor awindowcontext, in boolean aforcesave); methods applydecodingforextension() determines whether or not data whose filename has the specified extension should be decoded from the specified encoding type before be...
...boolean applydecodingforextension( in autf8string aextension, in acstring aencodingtype ); parameters aextension the filename extension to check.
... aencodingtype the encoding type to check.
... return value true if data from urls with the specified extension and encoding should be decoded prior to saving the file or delivering it to a helper application; otherwise false.
nsILocalFile
appendrelativenativepath appends a relative, native character encoding, path to the current path of the nsilocalfile object.
... return value an opaque string value with undefined character encoding.
... remarks the methods initwithnativepath() and appendrelativenativepath() take string valued parameters that are encoded using the native character encoding.
...see nsifile for more information on the native character encoding.
nsIWebBrowserPersist
bedding/browser/nswebbrowserpersist;1"] .createinstance(components.interfaces.nsiwebbrowserpersist); method overview void cancelsave(); void savechannel(in nsichannel achannel, in nsisupports afile); void savedocument(in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn); void saveuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext); void saveprivacyawareuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream ...
... void savedocument( in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn ); parameters adocument document to save to file.
... aencodingflags flags to pass to the encoder.
...parameter is ignored if wrapping is not specified by the encoding flags.
MediaCapabilities - Web APIs
the mediacapabilities interface of the media capabilities api provides information about the decoding abilities of the device, system and browser.
... the api can be used to query the browser about the decoding abilities of the device based on codecs, profile, resolution, and bitrates.
... methods mediacapabilities.encodinginfo() when passed a valid media configuration, it returns a promise with information as to whether the media type is supported, and whether encoding such media would be smooth and power efficient.
... mediacapabilities.decodinginfo() when passed a valid media configuration, it returns a promise with information as to whether the media type is supported, and whether decoding such media would be smooth and power efficient.
SubtleCrypto.encrypt() - Web APIs
function getmessageencoding() { const messagebox = document.queryselector(".rsa-oaep #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } function encryptmessage(publickey) { let encoded = getmessageencoding(); return window.crypto.subtle.encrypt( { name: "rsa-oaep" }, publickey, encoded ); } aes-ctr this code fetches the contents of a ...
... function getmessageencoding() { const messagebox = document.queryselector(".aes-ctr #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } function encryptmessage(key) { let encoded = getmessageencoding(); // counter will be needed for decryption counter = window.crypto.getrandomvalues(new uint8array(16)); return window.crypto.subtle.encrypt( { name: "aes-ctr", counter, length: 64 }, key, encoded ); } let iv = new uint8array(16); let key = new uint8array(16); let data = new uint8array(12345); //crypto functions are wrapped in promises so we have to use await and make sure the function t...
... function getmessageencoding() { const messagebox = document.queryselector(".aes-cbc #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } function encryptmessage(key) { let encoded = getmessageencoding(); // iv will be needed for decryption iv = window.crypto.getrandomvalues(new uint8array(16)); return window.crypto.subtle.encrypt( { name: "aes-cbc"...
... function getmessageencoding() { const messagebox = document.queryselector(".aes-gcm #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } function encryptmessage(key) { let encoded = getmessageencoding(); // iv will be needed for decryption iv = window.crypto.getrandomvalues(new uint8array(12)); return window.crypto.subtle.encrypt( { name: "aes-gcm", iv: iv }, key, encoded ); } specifications specification status comment web cryptography apithe definition of 'subtlecrypto.encry...
SubtleCrypto.sign() - Web APIs
WebAPISubtleCryptosign
*/ function getmessageencoding() { const messagebox = document.queryselector(".rsassa-pkcs1 #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } let encoded = getmessageencoding(); let signature = await window.crypto.subtle.sign( "rsassa-pkcs1-v1_5", privatekey, encoded ); rsa-pss this code fetches the contents of a text box, encodes it for signing, and signs ...
...*/ function getmessageencoding() { const messagebox = document.queryselector(".rsa-pss #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } let encoded = getmessageencoding(); let signature = await window.crypto.subtle.sign( { name: "rsa-pss", saltlength: 32, }, privatekey, encoded ); ecdsa this code fetches the contents of a text box, encodes it for signing, and signs it with a private key.
...*/ function getmessageencoding() { const messagebox = document.queryselector(".ecdsa #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } let encoded = getmessageencoding(); let signature = await window.crypto.subtle.sign( { name: "ecdsa", hash: {name: "sha-384"}, }, privatekey, encoded ); hmac this code fetches the contents of a text box, encodes it for signing, and signs it with a secret key.
...*/ function getmessageencoding() { const messagebox = document.queryselector(".hmac #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } let encoded = getmessageencoding(); let signature = await window.crypto.subtle.sign( "hmac", key, encoded ); specifications specification status comment web cryptography apithe definition of 'subtlecrypto.sign()' in that specification.
WebGLRenderingContext.getFramebufferAttachmentParameter() - Web APIs
when using the ext_srgb extension: ext.framebuffer_attachment_color_encoding_ext: the framebuffer color encoding.
... when using a webgl 2 context, the following values are available additionally: gl.framebuffer_attachment_alpha_size gl.framebuffer_attachment_blue_size gl.framebuffer_attachment_color_encoding gl.framebuffer_attachment_component_type gl.framebuffer_attachment_depth_size gl.framebuffer_attachment_green_size gl.framebuffer_attachment_red_size gl.framebuffer_attachment_stencil_size gl.framebuffer_attachment_texture_layer when using the ovr_multiview2 extension: ext.framebuffer_attachment_texture_num_views_ovr: the number of views of the framebuffer object attachment.
... gl.framebuffer_attachment_color_encoding a glenum indicating the encoding of components of the specified attachment.
... ext.framebuffer_attachment_color_encoding_ext a glenum indicating the framebuffer color encoding.
WebGL constants - Web APIs
er 0x8c8e transform_feedback_buffer_binding 0x8c8f transform_feedback 0x8e22 transform_feedback_paused 0x8e23 transform_feedback_active 0x8e24 transform_feedback_binding 0x8e25 framebuffers and renderbuffers constant name value description framebuffer_attachment_color_encoding 0x8210 framebuffer_attachment_component_type 0x8211 framebuffer_attachment_red_size 0x8212 framebuffer_attachment_green_size 0x8213 framebuffer_attachment_blue_size 0x8214 framebuffer_attachment_alpha_size 0x8215 framebuffer_attachment_depth_size 0x8216 framebuffer_attachment_ste...
... compressed_rgba_atc_explicit_alpha_webgl 0x8c92 compresses rgba textures using explicit alpha encoding (useful when alpha transitions are sharp).
... compressed_rgba_atc_interpolated_alpha_webgl 0x87ee compresses rgba textures using interpolated alpha encoding (useful when alpha transitions are gradient).
... framebuffer_attachment_color_encoding_ext 0x8210 returns the framebuffer color encoding.
WebRTC API - Web APIs
rtcrtpsender manages the encoding and transmission of data for a mediastreamtrack on an rtcpeerconnection.
... rtcrtpreceiver manages the reception and decoding of data for a mediastreamtrack on an rtcpeerconnection.
... interfaces rtcdtmfsender manages the encoding and transmission of dual-tone multi-frequency (dtmf) signaling for an rtcpeerconnection.
... establishing a connection: the perfect negotiation pattern perfect negotiation is a design pattern which is recommended for your signaling process to follow, which provides transparency in negotiation while allowing both sides to be either the offerer or the answerer, without significant coding needed to differentiate the two.
Accessibility documentation index - Accessibility
the alert role is most useful for information that requires the user's immediate attention, for example: 16 using the alertdialog role aria, accessibility, codingscripting, html, needscontent, role(2), web development, agent, alertdialog, alerts, modal, user, useragent the alertdialog role is used to notify the user of urgent information that demands the user's immediate attention.
... 19 using the aria-hidden attribute aria, accessibility, attribute, codingscripting, html, javascript, needscontent, role(2), agent, alert, user, useragent this technique demonstrates how to use the aria-hidden attribute.
... 20 using the aria-invalid attribute aria, accessibility, attribute, codingscripting, html, javascript, needscontent, role(2), agent, alert, user, useragent the aria-invalid attribute is used to indicate that the value entered into an input field does not conform to the format expected by the application.this may include formats such as email addresses or telephone numbers.
... 21 using the aria-label attribute aria, accessibility, codingscripting, html, needscontent, reference, référence(2), agent, aria-label, user, useragent the aria-label attribute is used to define a string that labels the current element.
Index - Developer guides
WebGuideIndex
29 index guide, index found 31 pages: 30 introduction to web development beginner, css, codingscripting, development, html, javascript, web whether you're just getting started with web development, or are just expanding your horizons into new realms of web awesomeness, the links here should help you get started.
... 31 localizations and character encodings character encodings, html, localization, needsmarkupwork browsers process text as unicode internally.
... however, a way of representing characters in terms of bytes (character encoding) is used for transferring text over the network to the browser.
... the html specification recommends the use of the utf-8 encoding (which can represent all of unicode) and regardless of the encoding used requires web content to declare what encoding was used.
Developer guides
localizations and character encodings browsers process text as unicode internally.
... however, a way of representing characters in terms of bytes (character encoding) is used for transferring text over the network to the browser.
... the html specification recommends the use of the utf-8 encoding (which can represent all of unicode), and regardless of the encoding used requires web content to declare that encoding.
...the transmission is in the same format that the form's submit() method would use to send the data if the form's encoding type were set to "multipart/form-data".
<input type="checkbox"> - HTML: Hypertext Markup Language
WebHTMLElementinputcheckbox
<fieldset> <legend>choose your interests</legend> <div> <input type="checkbox" id="coding" name="interest" value="coding"> <label for="coding">coding</label> </div> <div> <input type="checkbox" id="music" name="interest" value="music"> <label for="music">music</label> </div> </fieldset> in this example you will see that we've given each checkbox the same name.
... if both checkboxes are checked and then the form is submitted, you'll get a string of name/value pairs submitted like this: interest=coding&interest=music.
...see the below example: <fieldset> <legend>choose your interests</legend> <div> <input type="checkbox" id="coding" name="interest" value="coding" checked> <label for="coding">coding</label> </div> <div> <input type="checkbox" id="music" name="interest" value="music"> <label for="music">music</label> </div> </fieldset> providing a bigger hit area for your checkboxes in the above examples, you may have noticed that you can toggle a checkbox by clicking on its associated <label> element as...
... html <form> <fieldset> <legend>choose your interests</legend> <div> <input type="checkbox" id="coding" name="interest" value="coding"> <label for="coding">coding</label> </div> <div> <input type="checkbox" id="music" name="interest" value="music"> <label for="music">music</label> </div> <div> <input type="checkbox" id="art" name="interest" value="art"> <label for="art">art</label> </div> <div> <input type="checkbox" id="sports" name="int...
<input type="image"> - HTML: Hypertext Markup Language
WebHTMLElementinputimage
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 data formenctype the encoding method to use when submitting the form data formmethod the http method to use when submitting the form formnovalidate a boolean which, if present, indicates that the form shouldn't be validated before submission formtarget a string indicating a browsing context from where to load the results of submitting the form height the height, in css pixels, a...
... formenctype a string that identifies the encoding method to use when submitting the form data to the server.
... there are three permitted values: application/x-www-form-urlencoded this, the default value, sends the form data as a string after url encoding the text using an algorithm such as encodeuri().
...you must use this encoding type if your form includes any <input> elements of type file (<input type="file">).
<input type="submit"> - HTML: Hypertext Markup Language
WebHTMLElementinputsubmit
efault label in your browser: <input type="submit"> additional attributes in addition to the attributes shared by all <input> elements, submit button inputs support the following attributes: attribute description formaction the url to which to submit the form's data; overrides the form's action attribute, if any formenctype a string specifying the encoding type to use for the form data formmethod the http method (get or post) to use when submitting the form.
... formenctype a string that identifies the encoding method to use when submitting the form data to the server.
... there are three permitted values: application/x-www-form-urlencoded this, the default value, sends the form data as a string after url encoding the text using an algorithm such as encodeuri().
...you must use this encoding type if your form includes any <input> elements of type file (<input type="file">).
URIError: malformed URI sequence - JavaScript
the javascript exception "malformed uri sequence" occurs when uri encoding or decoding wasn't successful.
... uri encoding or decoding wasn't successful.
... examples encoding encoding replaces each instance of certain characters by one, two, three, or four escape sequences representing the utf-8 encoding of the character.
...for example: encodeuri('\ud800\udfff'); // "%f0%90%8f%bf" decoding decoding replaces each escape sequence in the encoded uri component with the character that it represents.
XML introduction - XML: Extensible Markup Language
<?xml version="1.0" encoding="utf-8"?> attributes: version : used version xml in this document.
... encoding : used encoding in this document.
... example <?xml version="1.0" encoding="utf-8"?> <message> <warning> hello world <!--missing </warning> --> </message> now let's look at a corrected version of that same document: <?xml version="1.0" encoding="utf-8"?> <message> <warning> hello world </warning> </message> a document that contains an undefined tag is invalid.
...for example, to create a new &warning; entity, you can do this: <?xml version="1.0" encoding="utf-8"?> <!doctype body [ <!entity warning "warning: something bad happened...
Compiling an Existing C Module to WebAssembly - WebAssembly
get an image from javascript into wasm getting the encoder's version number is great, but encoding an actual image would be more impressive.
...looking at the encoding api of libwebp, you'll find that it expects an array of bytes in rgb, rgba, bgr or bgra.
... the result of the encoding operation is an output buffer and its length.
... size = webpencodergba(img_in, width, height, width * 4, quality, &img_out); result[0] = (int)img_out; result[1] = size; } emscripten_keepalive void free_result(uint8_t* result) { webpfree(result); } emscripten_keepalive int get_result_pointer() { return result[0]; } emscripten_keepalive int get_result_size() { return result[1]; } now with all of that in place, you can call the encoding function, grab the pointer and image size, put it in a javascript buffer of your own, and release all the wasm buffers allocated in the process: api.encode(p, image.width, image.height, 100); const resultpointer = api.get_result_pointer(); const resultsize = api.get_result_size(); const resultview = new uint8array(module.heap8.buffer, resultpointer, resultsize); const result = new uint8array(res...
Locked config settings - Archive of obsolete content
the encoding is a simple "byte-shifting" with an offset of 13 (netscape 4 used a similar encoding, but with a of 7 instead).
...as the encoding of the file is pretty trivial, the encoding as such does not provide any real security.
...} catch(e) { displayerror("test", e); } clear text configuration if you don't care about encoding the mozilla.cfg file, append this config to all.js instead : pref("general.config.obscure_value", 0); pref("general.config.filename", "mozilla.cfg"); ...
Developing New Mozilla Features - Archive of obsolete content
learn the codebase and coding practices before you start your feature include learning time in your schedule.
...and of course, we have a set of coding practices to help everyone live together.
...it’s possible developers may not pay much attention to you because they believe your proposed feature is not a high priority, or is not wanted at all, or that you haven’t demonstrated that you understand the codebase and mozilla coding practices well enough for them to spend a lot of time with you.
International characters in XUL JavaScript - Archive of obsolete content
how the character encoding is determined in gecko 1.8 and later when the javascript file is loaded from a chrome:// url, a byte order mark (fixme: )(bom) is used to determine the character encoding of the script.
... otherwise, the character encoding will be the same as the one used by the xul file (which can be specified using an encoding attribute in the <?xml?> tag).
... if the script file is loaded via http, the http header can contain a character encoding declaration as part of the content-type header, for example: content-type: application/javascript; charset=utf-8 if no charset parameter is specified, the same rules as above apply.
Gecko Compatibility Handbook - Archive of obsolete content
solution quick reference as discussed in mozilla's using web standards in your web pages, coding for cross-browser compatibility requires you write standard markup that gecko-based browsers, netscape 4, and ie browsers can render properly.
... upgrade to the most recent version of hiermenu common coding and server problems this section details solutions to the most common problems affecting standards-based browsers as well as issues that may specifically affect gecko browsers.
... plugins coding you'll find for that some plugins behave differently in gecko than in netscape navigator 4.
Reference - Archive of obsolete content
thanks :) -- dria 21:06, 26 aug 2005 (pdt) coding style should semicolons be added to all the examples?
...--nickolay 00:58, 26 aug 2005 (pdt) (more coding style questions) --maian 04:06, 31 aug 2005 (pdt) i'd say, just make a note here about decisions you make.
...--nickolay 05:37, 31 aug 2005 (pdt) gonna follow mozilla's coding guides here: http://www.mozilla.org/hacking/mozil...de.html#visual --maian 00:30, 20 september 2005 (pdt) btoa() and atob() base64 encode and decode functions this documentation is missing the base64 encode (btoa) and decode (atob) functions.
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
for example, an organization may decide that c++, java, and javascript will be the primary coding languages.
...coding practices are consistent.
...development efforts would consequently support similar levels of standards support, which could possibly lead to cross-application coding, or code reuse.
Building up a basic demo with PlayCanvas - Game development
engine vs editor the engine itself can be used as a standard library by including its javascript file directly in your html, so you can start coding right away; in addition the playcanvas toolset comes with an online editor that you can use to drag and drop components onto the scene — a great way to create games and other apps requiring scenes if you're more of a designer than a coder.
... playcanvas editor instead of coding everything from the beginning you can also use the online editor.
... summary of course, it depends on your approach — designers may favor the online editor while programmers will prefer having the full control over the coding environment and will probably use the engine's source files.
Unicode - MDN Web Docs Glossary: Definitions of Web-related terms
by assigning each character a number, programmers can create character encodings, to let computers store, process, and transmit any combination of languages in the same file or program.
... the most common unicode character encoding on the web is utf-8.
... other encodings exist, like utf-16 or the obsolete ucs-2, but utf-8 is recommended.
MDN Web Docs Glossary: Definitions of Web-related terms
web technologies contain long lists of jargon and abbreviations that are used in documentation and coding.
...r browsing context buffer c cache cacheable caldav call stack callback function canonical order canvas card sorting carddav caret cdn certificate authority certified challenge-response authentication character character encoding character set chrome cia cipher cipher suite ciphertext class client hints closure cms code splitting codec compile compile time computer programming conditional constant constructor continuous media control flow ...
...erence oop opengl openssl opera browser operand operator origin ota owasp p p2p pac packet page load time page prediction parameter parent object parse parser pdf perceived performance percent-encoding php pixel placeholder names plaintext png polyfill polymorphism pop3 port prefetch preflight request prerender presto primitive privileged privileged code progressive enhancement progressive web apps promise property ...
Developer guide
there are lots of ways to contribute to the mozilla project: coding, testing, improving the build process and tools, or contributing to the documentation.
... working with mozilla source code a code overview, how to get the code, and the coding style guide.
... mozilla much more additional information about mozilla coding practices.
Mozilla Web Developer FAQ
characters in html 4 and xml documents are unicode characters (even if the document has been encoded using a legacy encoding for transfer)—not font glyph indexes.
...if you are using a legacy encoding that cannot represent that character, you can use a numeric character reference: &#945;.
... meta tags are not examined for character encoding information.
Enc Dec MAC Output Public Key as CSR
rn privkey; } /* * generate the certificate request with subject */ static secstatus certreq(seckeyprivatekey *privk, seckeypublickey *pubk, keytype keytype, secoidtag hashalgtag, certname *subject, prbool ascii, const char *certreqfilename) { certsubjectpublickeyinfo *spki = null; certcertificaterequest *cr = null; secitem *encoding = null; secoidtag signalgtag; secitem result; secstatus rv = secsuccess; print32 numbytes; void *exthandle; prarenapool *arena = null; prfiledesc *outfile = null; /* open the certificate request file to write */ outf...
...fprintf(stderr, "out of memory"); rv = secfailure; goto cleanup; } exthandle = cert_startcertificaterequestattributes(cr); if (exthandle == null) { port_freearena (arena, pr_false); rv = secfailure; goto cleanup; } cert_finishextensions(exthandle); cert_finishcertificaterequestattributes(cr); /* der encode the request */ encoding = sec_asn1encodeitem(arena, null, cr, sec_asn1_get(cert_certificaterequesttemplate)); if (encoding == null) { pr_fprintf(pr_stderr, "der encoding of request failed\n"); rv = secfailure; goto cleanup; } /* sign the request */ signalgtag = sec_getsignaturealgorithmoidtag(keytype, hashalgtag); if (signalgtag == sec_oid_un...
...known) { pr_fprintf(pr_stderr, "unknown key or hash type\n"); rv = secfailure; goto cleanup; } rv = sec_dersigndata(arena, &result, encoding->data, encoding->len, privk, signalgtag); if (rv) { pr_fprintf(pr_stderr, "signing of data failed\n"); rv = secfailure; goto cleanup; } /* encode request in specified format */ if (ascii) { char *obuf; char *name, *email, *org, *state, *country; secitem *it; int total; it = &result; obuf = btoa_convertitemtoascii(it); total = pl_strlen(obuf); name = cert_getcommonname(subject); if (!name) { name = strdup("(not specified)"); } email = cert_getcertemailaddress(...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
; print32 numbytes; secstatus rv = secsuccess; prarenapool *arena = null; void *exthandle = null; prfiledesc *outfile = null; certsubjectpublickeyinfo *spki = null; certcertificaterequest *cr = null; secitem *encoding = null; /* if the certificate request file already exists, delete it */ if (pr_access(certreqfilename, pr_access_exists) == pr_success) { pr_delete(certreqfilename); } /* open the certificate request file to write */ outfile = pr_open(certreqfilename, pr_create_file | pr_rdwr | pr_truncate, 00660); if (!outfile) { pr_fprintf(pr_stderr, ...
..."out of memory"); rv = secfailure; goto cleanup; } exthandle = cert_startcertificaterequestattributes(cr); if (exthandle == null) { port_freearena (arena, pr_false); rv = secfailure; goto cleanup; } cert_finishextensions(exthandle); cert_finishcertificaterequestattributes(cr); /* der encode the request */ encoding = sec_asn1encodeitem(arena, null, cr, sec_asn1_get(cert_certificaterequesttemplate)); if (encoding == null) { pr_fprintf(pr_stderr, "der encoding of request failed\n"); rv = secfailure; goto cleanup; } /* sign the request */ signalgtag = sec_getsignaturealgorithmoidtag(keytype, hashalgtag); if (signalgtag == se...
...c_oid_unknown) { pr_fprintf(pr_stderr, "unknown key or hash type\n"); rv = secfailure; goto cleanup; } rv = sec_dersigndata(arena, &result, encoding->data, encoding->len, privk, signalgtag); if (rv) { pr_fprintf(pr_stderr, "signing of data failed\n"); rv = secfailure; goto cleanup; } /* encode request in specified format */ if (ascii) { char *obuf; char *name, *email, *org, *state, *country; secitem *it; int total; it = &result; obuf = btoa_convertitemtoascii(it); total = pl_strlen(obuf); name = cert_getcommonname(subject); if (!name) { name = strdup("(not specified)"); } email = c...
sample2
q(seckeyprivatekey *privk, seckeypublickey *pubk, keytype keytype, secoidtag hashalgtag, certname *subject, prbool ascii, const char *certreqfilename) { secoidtag signalgtag; secitem result; print32 numbytes; secstatus rv = secsuccess; prarenapool *arena = null; void *exthandle = null; prfiledesc *outfile = null; certsubjectpublickeyinfo *spki = null; certcertificaterequest *cr = null; secitem *encoding = null; /* if the certificate request file already exists, delete it */ if (pr_access(certreqfilename, pr_access_exists) == pr_success) { pr_delete(certreqfilename); } /* open the certificate request file to write */ outfile = pr_open(certreqfilename, pr_create_file | pr_rdwr | pr_truncate, 00660); if (!outfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing (%ld, %ld).\n", certreqfil...
...oto cleanup; } arena = port_newarena(der_default_chunksize); if (!arena) { fprintf(stderr, "out of memory"); rv = secfailure; goto cleanup; } exthandle = cert_startcertificaterequestattributes(cr); if (exthandle == null) { port_freearena (arena, pr_false); rv = secfailure; goto cleanup; } cert_finishextensions(exthandle); cert_finishcertificaterequestattributes(cr); /* der encode the request */ encoding = sec_asn1encodeitem(arena, null, cr, sec_asn1_get(cert_certificaterequesttemplate)); if (encoding == null) { pr_fprintf(pr_stderr, "der encoding of request failed\n"); rv = secfailure; goto cleanup; } /* sign the request */ signalgtag = sec_getsignaturealgorithmoidtag(keytype, hashalgtag); if (signalgtag == sec_oid_unknown) { pr_fprintf(pr_stderr, "unknown key or hash type\n"); rv = secfailure; ...
...goto cleanup; } rv = sec_dersigndata(arena, &result, encoding->data, encoding->len, privk, signalgtag); if (rv) { pr_fprintf(pr_stderr, "signing of data failed\n"); rv = secfailure; goto cleanup; } /* encode request in specified format */ if (ascii) { char *obuf; char *name, *email, *org, *state, *country; secitem *it; int total; it = &result; obuf = btoa_convertitemtoascii(it); total = pl_strlen(obuf); name = cert_getcommonname(subject); if (!name) { name = strdup("(not specified)"); } email = cert_getcertemailaddress(subject); if (!email) email = strdup("(not specified)"); org = cert_getorgname(subject); if (!org) org = strdup("(not specified)"); state = cert_getstatename(subject); if (!state) state = strdup("(not specified)"); country = cert_getcountryname(subject); if (!country) country = st...
nss tech note7
pk11_sign does not do the ber encoding of the hash (as is done in sgn_ functions).
...it's used to support ssl2, which modifies the key encoding to include the ssl version number.
... pkcs #1 v1.5 block formatting question: in pkcs #1 v1.5 (section 8.1 encryption-block formatting) and v2.1 (section 7.2.1 encryption operation), pkcs1 v1.5 padding is described like this: 00 || 02 || ps || 00 || m but in pkcs #1 v2.0 (section 9.1.2.1 encoding operation, step 3) and on the w3c web site (http://www.w3.org/tr/xmlenc-core/#rsa-1_5), pkcs1 v1.5 padding is described like this: 02 || ps || 00 || m 00 at the beginning is missing.
Python binding for NSS
but sock.recv() does not guarantee how much data will be received, thus this was a coding mistake.
... fix incorrect format strings in pyarg_parsetuple* for: generalname basicconstraints cert_x509_key_usage fix bug when decoding certificate basicconstraints extension fix hang in setup_certs.
... setup.py build enhancements now searches for the nss and nspr header files rather than hardcoding their location.
NSS tools : certutil
--dump-ext-val oid for single cert, print binary der encoding of extension oid.
... add one or multiple extensions that certutil cannot encode yet, by loading their encodings from external files.
...9v1, prime239v2, prime239v3, c2pnb163v1, c2pnb163v2, c2pnb163v3, c2pnb176v1, c2tnb191v1, c2tnb191v2, c2tnb191v3, c2pnb208w1, c2tnb239v1, c2tnb239v2, c2tnb239v3, c2pnb272w1, c2pnb304w1, c2tnb359w1, c2pnb368w1, c2tnb431r1, secp112r1, secp112r2, secp128r1, secp128r2, sect113r1, sect113r2 sect131r1, sect131r2 -r display a certificate's binary der encoding when listing information about that certificate with the -l option.
Index
5 future directions guide, mozilla, spidermonkey this article documents future directions in functionality, design, and coding practices for spidermonkey.
...it returns the length of the whole string encoding or (size_t)-1 if the string can't be encoded as bytes.
...warnings: 342 js_getstringcharsandlength jsapi reference, obsolete, spidermonkey js_getstringcharsandlength gets the characters and the length of the string, str 343 js_getstringencodinglength jsapi reference, reference, référence(2), spidermonkey js_getstringencodinglength returns the length of the specified string in bytes, regardless of its encoding.
Secure Development Guidelines
introduction provide developers with information on specific security issues cover common coding mistakes and how they affect a product how to avoid making them how to mitigate them everything is oriented toward c/c++ introduction: gaining control specifics about the underlying architecture, using x86 as an example 6 basic registers (eax, ebx, ecx, edx, edi, esi) 2 stack-related registers (esp, ebp) mark top and bottom of current stack frame status register (eflags) contains various state information instruction pointer (eip) points to register being executed; can’t be modified...
...is exploitable (in some browsers) with a simple request such as: http://www.victim.com?something=<script>alert('oops')</script> xss: prevention escape all dynamic input that will be sent back to the user html encoding &amp; → & &lt; → < &gt; → > &quot; → " &apos; → ' url encoding % encoding java/vbscript escaping depends on the context; in a single-quoted string, escaping ' would suffice sql injection occurs when un-trusted input is mixed with a sql string sql is a language used to interact with databases code injection attack that is similar to x...
... unlock(locka); unlock(lockb); } writing secure code: good coding practices banned api list badly designed apis can often lead to vulnerabilities it’s too easy to use the api inappropriately for example, consider the libc string handling apis strcpy() performs no bounds checking strncpy() doesn’t always 0-terminate strncat() length parameter is very confusing banned api list examples of incorrect strncat usage buffer overfl...
Index
MozillaTechXPCOMIndex
112 using xpcom utilities to make things easier needsupdate, xpcom this chapter goes back over the code you've already created in the first part of the tutorial (see weblock1.cpp in the previous chapter) and uses xpcom tools that make coding a lot easier and more efficient.
... 1188 nscstring class declaration 1189 nscstring external needscontent, reference, référence(2), strings class declaration 1190 nscstringcontainer (external) reference, référence(2), needsattention, strings class declaration 1191 nscstringencoding xpcom, xpcom api reference the nscstringencoding enumeration describes the set of character encodings understood by the ns_cstringtoutf16 and ns_utf16tocstring functions.
... 1254 ns_utf16tocstring xpcom, xpcom api reference the ns_utf16tocstring function converts the value of a nsastring instance from utf-16 to the specified multi-byte encoding and stores the result in a nsacstring instance.
nsACString
nsacstring by itself does not imply a particular character encoding.
...the character encoding in use for a particular nsacstring instance depends on the context in which it is used.
... if used with xpidl, then the character encodings of the corresponding xpidl data types applies.
nsAString
nsastring by itself does not imply a particular character encoding.
...the character encoding in use for a particular nsastring instance depends on the context in which it is used.
... if used with xpidl, then the character encodings of the corresponding xpidl data types applies.
mozIJSSubScriptLoader
jsval loadsubscript( in string url, in object targetobj optional, in string charset optional, ); example let context = {}; services.scriptloader.loadsubscript("chrome://my-package/content/foo-script.js", context, "utf-8" /* the script's encoding */); parameters url the url pointing to the script to load.
... charset an optional string to specify the character encoding of the file.
... charset string an optional string to specify the character encoding of the file.
nsIConverterInputStream
this allows reading unicode strings from a stream, automatically converting the bytes from a selected character encoding.
...acharset the character encoding to use for converting the bytes of the stream.
... a value of null or "utf-8" equals utf-8 encoding.
nsIConverterOutputStream
xpcom/io/nsiconverteroutputstream.idlscriptable this interface allows writing strings to a stream, doing automatic character encoding conversion.
...acharset the character set to use for encoding the characters.
... exceptions thrown ns_error_loss_of_significant_data if areplacementcharacter is not encodable in the selected character encoding and an attempt is made to write the character.
nsIDocShell
reading this value reports the encoding that was used when loading the data into the document.
... setting this attribute overrides the encoding; however, to update the dom or display of the content, you need have the data reparsed.
... overriding the character set also sets the fallback encoding for the container frame.
nsIXmlRpcClient
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void init(in string serverurl); void setauthentication(in string username, in string password); void clearauthentication(in string username, in string password); void setencoding(in string encoding); void setencoding(in unsigned long type, out nsiidref uuid, out nsqiresult result); void asynccall (in nsixmlrpcclientlistener listener, in nsisupports ctxt, in string methodname, in nsisupports arguments, in pruint32 count); attributes attribute type description serverurl readonly nsiurl the url of the xml-rpc server inprogress readonly boolean whether or not a ...
...entication to be enabled void setauthentication ( in string username, in string password ) ; parameters username username to be used if asked to authenticate password password to be used if asked to authenticate clearauthentication() clear authentication info void setauthentication ( in string username, in string password ) ; parameters username password setencoding() set character encoding.
... the default charset if this function is not called is "utf-8" void setauthentication ( in string encoding ) ; parameters encoding encoding charset to be used asynccall() call remote method methodname asynchronously with given arguments.
Network request details - Firefox Developer Tools
{ "name": "age", "value": "0" }, { "name": "backend-timing", "value": "d=74716 t=1560258099074460" }, { "name": "cache-control", "value": "private, must-revalidate, max-age=0" }, { "name": "content-disposition", "value": "inline; filename=api-result.js" }, { "name": "content-encoding", "value": "gzip" }, { "name": "content-length", "value": "673" }, { "name": "content-type", "value": "text/javascript; charset=utf-8" }, { "name": "date", "value": "tue, 11 jun 2019 13:01:39 gmt" }, { "name": "mediawiki-login-suppressed", "value": "true" }, { ...
...ralautologin/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", "value"...
...": "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-2019; mwphp7seed=5c9; geoip=us:ny:port_jervis:41.38:-74.67:v4" }, ...
File.getAsText() - Web APIs
WebAPIFilegetAsText
summary the getastext method provides the file's data interpreted as text using a given encoding.
... syntax var str = instanceoffile.getastext(encoding); parameters encoding a string indicating the encoding to use for the returned data.
... returns a string containing the file's data interpreted as text in the specified encoding.
FileReaderSync.readAsText() - Web APIs
syntax readastext(file); readastext(blob); readastext(file, encoding); readastext(blob, encoding); parameters blob the dom file or blob to read.
... encoding the optional parameter specifies encoding to be used (e.g., iso-8859-1 or utf-8).
... encodingerror is raised when the resource is a data url and exceed the limit length defined by each browser.
HTMLFormElement - Web APIs
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.
... htmlformelement.acceptcharset a domstring reflecting the value of the form's accept-charset html attribute, representing the character encoding that the server accepts.
...the following properties have been added: autocomplete, novalidate, and encoding.
MediaCapabilitiesInfo - Web APIs
the mediacapabilitiesinfo interface of the media capabilities api is made available when the promise returned by the mediacapabilities.encodinginfo() or mediacapabilities.decodinginfo() methods of the mediacapabilities interface fulfills, providing information as to whether the media type is supported, and whether encoding or decoding such media would be smooth and power efficient.
... properties the mediacapabilitiesinfo interface contains three boolean attribues: supported: given the properties defined in the mediaconfiguration, can the specified piece of media content be encoded (if mediaencodingconfiguration is set) or decode (if mediadecodingconfiguration is set) at all?
... example // mediaconfiguration to be tested const mediaconfig = { type : 'file', audio : { contenttype : "audio/ogg", channels : 2, bitrate : 132700, samplerate : 5200 }, }; // check support and performance navigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { // result contains the media capabilities information console.log('this configuration is ' + (result.supported ?
Media Source API - Web APIs
the two most common use cases for dash involve watching content “on demand” or “live.” on demand allows a developer to take their time transcoding the assets into multiple resolutions of various quality.
... live profile content can introduce latency due to its transcoding and broadcasting, so dash is not suitable for real time communication like webrtc is.
... there are numerous available free and open source tools for transcoding content and preparing it for use with dash, dash file servers, and dash client libraries written in javascript.
PerformanceResourceTiming.decodedBodySize - Web APIs
the decodedbodysize read-only property returns the size (in octets) received from the fetch (http or cache) of the message body, after removing any applied content-codings.
... if the resource is retrieved from an application cache or local resources, it returns the size of the payload after removing any applied content-codings.
... syntax resource.decodedbodysize; return value the size (in octets) received from the fetch (http or cache) of the message body, after removing any applied content-codings.
PerformanceResourceTiming.encodedBodySize - Web APIs
the encodedbodysize read-only property represents the size (in octets) received from the fetch (http or cache), of the payload body, before removing any applied content-codings.
... if the resource is retrieved from an application cache or a local resource, it must return the size of the payload body before removing any applied content-codings.
... syntax resource.encodedbodysize; return value a number representing the size (in octets) received from the fetch (http or cache), of the payload body, before removing any applied content-codings.
RTCRtpTransceiver.currentDirection - Web APIs
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.
... "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.
... [1] to determine if a sender has at least one active encoding, the user agent gets its parameters using rtcrtpsender.getparameters(), then looks at the parameters' encodings property; if any of the listed encodings has its active property set to true, the sender has an active encoding.
RTCRtpTransceiver.direction - Web APIs
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.
... "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.
... [1] to determine if a sender has at least one active encoding, the user agent gets its parameters using rtcrtpsender.getparameters(), then looks at the parameters' encodings property; if any of the listed encodings has its active property set to true, the sender has an active encoding.
RTCRtpTransceiver - Web APIs
receiver read only the rtcrtpreceiver object that handles receiving and decoding incoming media.
... sender read only the rtcrtpsender object responsible for encoding and sending data to the remote peer.
...the associated sender stops sending data, and the associated receiver likewise stops receiving and decoding incoming data.
RTCRtpTransceiverDirection - Web APIs
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.
... "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.
... [1] to determine if a sender has at least one active encoding, the user agent gets its parameters using rtcrtpsender.getparameters(), then looks at the parameters' encodings property; if any of the listed encodings has its active property set to true, the sender has an active encoding.
TextEncoder() - Web APIs
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.
... 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 encodingthe definition of 'textencoder()' in that specification.
Window.open() - Web APIs
WebAPIWindowopen
coding carelessly to open new windows can no longer be assured of success, cannot succeed by force and, if it does, it will annoy a majority of users.
... opening new windows, even with reduced features, uses considerably a lot of the user's system resources (cpu, ram) and involves considerably a lot of coding in the source code (security management, memory management, various code branchings sometimes quite complex, window frame/chrome/toolbars building, window positioning and sizing, etc.).
... always identify links that will create (or will re-use) a new, secondary window identify links that will open new windows in a way that helps navigation for users by coding the title attribute of the link, by adding an icon at the end of the link or by coding the cursor accordingly.
HTML in XMLHttpRequest - Web APIs
view on jsfiddle character encoding if the character encoding is declared in the http content-type header, that character encoding is used.
... failing that, if there is a byte order mark, the encoding indicated by the byte order mark is used.
... failing that, if there is a <meta> element that declares the encoding within the first 1024 bytes of the file, that encoding is used.
Web APIs
WebAPI
aambient light eventsbbackground tasksbattery api beaconbluetooth apibroadcast channel apiccss counter stylescss font loading api cssomcanvas apichannel messaging apiconsole apicredential management apiddomeencoding apiencrypted media extensionsffetch apifile system api frame timing apifullscreen apiggamepad api geolocation apihhtml drag and drop apihigh resolution timehistory apiiimage capture apiindexeddbintersection observer apillong tasks api mmedia capabilities api media capture and streamsmedia session apimedia source extensions mediastream recordingnnavigation timingnetwork information api ppage...
...lmediastream location lock lockmanager lockedfile m midiaccess midiconnectionevent midiinput midiinputmap midimessageevent midioutputmap mscandidatewindowhide mscandidatewindowshow mscandidatewindowupdate msgestureevent msgraphicstrust msmanipulationevent msrangecollection mssitemodeevent magnetometer mathmlelement mediacapabilities mediacapabilitiesinfo mediaconfiguration mediadecodingconfiguration mediadeviceinfo mediadevices mediaelementaudiosourcenode mediaencodingconfiguration mediaerror mediaimage mediakeymessageevent mediakeysession mediakeystatusmap mediakeysystemaccess mediakeysystemconfiguration mediakeys medialist mediametadata mediapositionstate mediaquerylist mediaquerylistevent mediaquerylistlistener mediarecorder mediarecordererrorevent mediasession mediasessi...
...tstate rtcidentityassertion rtcidentityerrorevent rtcidentityevent rtcinboundrtpstreamstats rtcnetworktype rtcofferansweroptions rtcofferoptions rtcoutboundrtpstreamstats rtcpeerconnection rtcpeerconnectioniceerrorevent rtcpeerconnectioniceevent rtcremoteoutboundrtpstreamstats rtcrtcpparameters rtcrtpcapabilities rtcrtpcodeccapability rtcrtpcodecparameters rtcrtpcontributingsource rtcrtpencodingparameters rtcrtpparameters rtcrtpreceiveparameters rtcrtpreceiver rtcrtpsendparameters rtcrtpsender rtcrtpstreamstats rtcrtpsynchronizationsource rtcrtptransceiver rtcrtptransceiverdirection rtcrtptransceiverinit rtcsctptransport rtcsessiondescription rtcsessiondescriptioncallback rtcstats rtcstatsicecandidatepairstate rtcstatsreport rtcstatstype rtctrackevent rtctrackeventinit radionodelis...
HTML attribute reference - HTML: Hypertext Markup Language
charset <meta>, <script> declares the character encoding of the page or script.
... decoding <img> indicates the preferred method to decode the image.
... formenctype <button>, <input> if the button/input is a submit button (type="submit"), this attribute sets the encoding type to use during form submission.
<form> - HTML: Hypertext Markup Language
WebHTMLElementform
accept-charset space-separated character encodings the server accepts.
...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 textual form elements should be automatically capitalized.
<input type="hidden"> - HTML: Hypertext Markup Language
WebHTMLElementinputhidden
additional attributes in addition to the attributes common to all <input> elements, hidden inputs offer the following attributes: attribute description name like all input types, the name of the input to report when submitting the form; the special value _charset_ causes the hidden input's value to be reported as the character encoding used to submit the form name this is actually one of the common attributes, but it has a special meaning available for hidden inputs.
...however, when the form is submitted, a hidden input whose name is set to _charset_ will automatically be reported with the value set to the character encoding used to submit the form.
...the key's composition and encoding would do that.
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
WebHTMLElementmeta
if the http-equiv is not an encoding declaration, it can also be inside a <noscript> element, itself inside a <head> element.
... if the charset attribute is set, the meta element is a charset declaration, giving the character encoding in which the document is encoded.
... charset this attribute declares the document's character encoding.
Evolution of HTTP - HTTP
content negotiation, including language, encoding, or type, has been introduced, and allows a client and a server to agree on the most adequate content to exchange.
... a typical flow of requests, all through one single connection is now looking like this: get /docs/glossary/simple_header http/1.1 host: developer.mozilla.org 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, 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, ac...
...cept-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=315360000 connection: keep-alive content-length: 3077 content-type: image/png date: thu, 31 mar 2016 13:34:46 gmt last-modified: wed, 21 oct 2015 18:27:50 gmt server: apache (image content of 3077 bytes) http/1.1 was first published as rfc 2068 in january 1997.
Digest - HTTP
WebHTTPHeadersDigest
the selected representation depends on the content-type and content-encoding header values: so a single resource may have multiple different digest values.
... <digest-value> the result of applying the digest algorithm to the resource representation and encoding the result.
... the choice of digest algorithm also determines the encoding to use: for example sha-256 uses base64 encoding.
Trailer - HTTP
WebHTTPHeadersTrailer
these header fields are disallowed: message framing headers (e.g., transfer-encoding and content-length), routing headers (e.g., host), request modifiers (e.g., controls and conditionals, like cache-control, max-forwards, or te), authentication headers (e.g., authorization or set-cookie), or content-encoding, content-type, content-range, and trailer itself.
... examples chunked transfer encoding using a trailing header in this example, the expires header is used at the end of the chunked message and serves as a trailing header.
... http/1.1 200 ok content-type: text/plain transfer-encoding: chunked trailer: expires 7\r\n mozilla\r\n 9\r\n developer\r\n 7\r\n network\r\n 0\r\n expires: wed, 21 oct 2015 07:28:00 gmt\r\n \r\n specifications specification title rfc 7230, section 4.4: trailer hypertext transfer protocol (http/1.1): message syntax and routing rfc 7230, section 4.1.2: chunked trailer part hypertext transfer protocol (http/1.1): message syntax and routing ...
encodeURI() - JavaScript
the encodeuri() function encodes a uri by replacing each instance of certain characters by one, two, three, or four escape sequences representing the utf-8 encoding of the character (will only be four escape sequences for characters composed of two "surrogate" characters).
... encoding a lone high surrogate throws an urierror will be thrown if one attempts to encode a surrogate which is not part of a high-low pair, e.g., // high-low pair ok console.log(encodeuri('\ud800\udfff')); // lone high surrogate throws "urierror: malformed uri sequence" console.log(encodeuri('\ud800')); // lone low surrogate throws "urierror: malformed uri sequence" console.log(encodeuri('\udfff')); ...
... encoding for ipv6 if one wishes to follow the more recent rfc3986 for urls, which makes square brackets reserved (for ipv6) and thus not encoded when forming something which could be part of a url (such as a host), the following code snippet may help: function fixedencodeuri(str) { return encodeuri(str).replace(/%5b/g, '[').replace(/%5d/g, ']'); } specifications specification ecmascript (ecma-262)the definition of 'encodeuri' in that specification.
<semantics> - MathML
beware that <annotation-xml> elements are only recognized, if the encoding attribute is set to one of the following: "application/mathml-presentation+xml" "mathml-presentation" "svg1.1" "text/html" "image/svg+xml" "application/xml".
... encoding the encoding of the semantic information in the annotation (e.g.
... example <math> <semantics> <!-- presentation mathml --> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>+</mo> <mi>y</mi> </mrow> <!-- content mathml --> <annotation-xml encoding="mathml-content"> <apply> <plus/> <apply> <power/> <ci>x</ci> <cn type="integer">2</cn> </apply> <ci>y</ci> </apply> </annotation-xml> <!-- annotate an image --> <annotation encoding="image/png" src="some/path/formula.png"/> <!-- annotate tex --> <annotation encoding="application/x-tex"> x^{2} + ...
Codecs used by WebRTC - Web media technologies
both µ-law and a-law encodings are allowed.
...also present in the list will be entries for retransmission (rtx), redundant coding (red), and forward error correction (fec).
...if you select avc, make sure you're; aware of any potential fees you may need to pay; that said, the patent holders have generally said that most typical web site developers shouldn't need to worry about paying the license fees, which are typically focused more on the developers of the encoding and decoding software.
base64 - Archive of obsolete content
data encoding and decoding using base64 algorithms.
...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.
url - Archive of obsolete content
if base64 is true, the data property is encoded using base-64 encoding.
... base64 defines the encoding for the value in data property.
Unit Testing - Archive of obsolete content
to demonstrate how it works we'll write some unit tests for a simple base64 encoding module.
... a simple base64 module in a web page, you can perform base64 encoding and decoding using the btoa() and atob() functions.
HTML in XUL for rich tooltips - Archive of obsolete content
this example is what the final xul overlay could look like, assuming a javascript overlay titled overlay.js: <?xml version="1.0" encoding="utf-8"?> <overlay id="htmltip-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> <script type="application/x-javascript" src="overlay.js"/> <popup id="contentareacontextmenu"> <menuitem id="htmltip1" label="foo1" onmouseover="htmltip.onmousetooltip(event)" tooltip="myhtmltip" /> <menuitem id="htmltip2" ...
... <?xml version="1.0" encoding="utf-8"?> <overlay id="htmltip-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> <script type="application/x-javascript" src="overlay.js"/> <popup id="contentareacontextmenu"> <menuitem id="htmltip3" label="foo3" tooltip="mytip3html" /> </popup> <popupset id="mainpopupset"> <toolt...
Downloading JSON and JavaScript in extensions - Archive of obsolete content
downloading json if the extension is downloading json, then the developer should be using one of the json decoding methods discussed here and not using eval() at all.
...the json decoding methods available to extension developers protect the extension from malicious json and javascript.
Extension Versioning, Update and Compatibility - Archive of obsolete content
<?xml version="1.0" encoding="utf-8"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <!-- this description resource includes all the update and compatibility information for a single add-on with the id foobar@developer.mozilla.org.
...oxmcif8d/9evwm8eh/ixuxyzlmrzts3o5tv9eway5ubctqdf1wgtsgk jrgzow1fitkzi7w0//c8ekdmlatguegfns2iltd5p/0kh/hf1rpc1wuqeqkcd4+l bcvq13ad</em:signature> </rdf:description> </rdf:rdf> some people prefer this alternate format (note that much of the information has been trimmed from this example for brevity in order to show the basic structure): <?xml version="1.0" encoding="utf-8"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <!-- this description resource includes all the update and compatibility information for a single add-on with the id foobar@developer.mozilla.org.
Index of archived content - Archive of obsolete content
an interview with douglas bowman of wired news archived mozilla and build documentation activex control for hosting netscape plug-ins in ie archived spidermonkey docs file object open merging tracemonkey repo spidermonkey coding conventions autodial for windows nt automated testing tips and tricks automatic mozilla configurator enabling quicklaunch for all users how mozilla finds its configuration files how thunderbird and firefox find their configuration files introduction kill the xul...
...ackaging firefox style system overview using microformats firefox sync code snippets javascript client api syncing custom preferences force rtl gre gre registration gecko coding help wanted http class overview hacking wiki help viewer creating a help content pack helper apps (and a bit of save as) hidden prefs how to write and land nanojit patches io guide/directory keys introducing the audio api extension isp data ...
jspage - Archive of obsolete content
int"].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.headers);},onstatechange:function(){if(this.xhr.readystate!=4||!this.running){return; }this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bi...
...=string(k.url),a=k.method.tolowercase(); switch($type(g)){case"element":g=document.id(g).toquerystring();break;case"object":case"hash":g=hash.toquerystring(g);}if(this.options.format){var j="format="+this.options.format; g=(g)?j+"&"+g:j;}if(this.options.emulation&&!["get","post"].contains(a)){var h="_method="+a;g=(g)?h+"&"+g:h;a="post";}if(this.options.urlencoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:""; this.headers.set("content-type","application/x-www-form-urlencoded"+c);}if(this.options.nocache){var f="nocache="+new date().gettime();g=(g)?f+"&"+g:f; }var e=b.lastindexof("/");if(e>-1&&(e=b.indexof("#"))>-1){b=b.substr(0,e);}if(g&&a=="get"){b=b+(b.contains("?")?"&":"?")+g;g=null;}this.xhr.open(a.touppercase(),b,this.options.async); this.xhr.onreadystatech...
URIs and URLs - Archive of obsolete content
for example, "%20" is the escaped encoding for the us-ascii space character.
...normally, the only time escape encodings can safely be made is when the uri is being created from its component parts; each component may have its own set of characters that are reserved, so only the mechanism responsible for generating or interpreting that component can determine whether or not escaping a character will change its semantics.
Elements - Archive of obsolete content
default encoding in xml documents (including xbl files) is utf-8.
... an explicit encoding declarations may be present to override the default, for example <?xml version="1.0" encoding="iso-8859-1"?> uri in namespace declarations is an opaque string used to uniquely identify the namespace.
Mozilla release FAQ - Archive of obsolete content
the mozilla newsgroups are intended to be used by people who will be working with mozilla, either in an organizational fashion, suggesting features, or coding.
...this project is largely about coding.
References - Archive of obsolete content
making your web page compatible with mozilla from nicolás lichtmaier complete css guide from westciv.com css lessons and tutorials from alsacreations html and css lessons and tutorials from htmldog.com preparing for standard-compliant browsers, part 1 from makiko itoh preparing for standard-compliant browsers, part 2 from makiko itoh javascript best practices lists 15 of the most frequent coding practices which create problems for javascript and dhtml-driven webpages.
... the webpage explains and proposes with small examples the best coding practices and most recommendable ways of developing problem-free javascript code.
Index - Game development
mozilla's a-frame framework provides a markup language allowing us to build 3d vr landscapes using a system familiar to web developers, which follows game development coding principles; this is useful for quickly and successfully building prototypes and demos, without having to write a lot of javascript or glsl.
... 18 building up a basic demo with playcanvas 3d, animation, beginner, canvas, games, playcanvas, tutorial, webgl, camera, lighting, rendering of course, it depends on your approach — designers may favor the online editor while programmers will prefer having the full control over the coding environment and will probably use the engine's source files.
Response header - MDN Web Docs Glossary: Definitions of Web-related terms
note that strictly speaking, the content-encoding and content-type headers are entity header: 200 ok access-control-allow-origin: * connection: 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 ...
UTF-8 - MDN Web Docs Glossary: Definitions of Web-related terms
utf-8 (ucs transformation format 8) is the world wide web's most common character encoding.
...each byte has some bits reserved for encoding purposes.
Organizing your CSS - Learn web development
does your project have a coding style guide?
...these methodologies are essentially css coding guides that take a very structured approach to writing and organising css.
Sending forms through JavaScript - Learn web development
but neither xml nor json fit into form data request encoding.
...to send form data with xmlhttprequest, prepare the data by url-encoding it, and obey the specifics of form data requests.
Getting started with HTML - Learn web development
note: you don't need to use entity references for any other symbols, as modern browsers will handle the actual symbols just fine as long, as your html's character encoding is set to utf-8.
...the purpose of comments is to allow you to include notes in the code to explain your logic or coding.
Graceful asynchronous programming with Promises - Learn web development
next, we call our function three times to begin the process of fetching and decoding the images and text and store each of the returned promises in a variable.
... note: if you were improving this code, you might want to loop through a list of items to display, fetching and decoding each one, and then loop through the results inside promise.all(), running a different function to display each one depending on what the type of code was.
Asynchronous JavaScript - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you can try out (most of) the code examples in an online coding program such as jsbin or glitch.
... choosing the right approach to finish this module off, we'll consider the different coding techniques and features we've discussed throughout, looking at which ones you should use when, with recommendations and reminders of common pitfalls where appropriate.
JavaScript building blocks - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... functions — reusable blocks of code another essential concept in coding is functions.
Adding features to our bouncing balls demo - Learn web development
read the whole assessment before you start coding, and take each step slowly and carefully.
...this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Introduction to client-side frameworks - Learn web development
it is an older framework that has less users than more modern alternatives such as react and vue, but it still enjoys a fair amount of popularity due to its stability, community support, and some clever coding principles.
...they're a good solution for large projects, especially projects that require input from content writers who have limited coding ability, or for programmers who want to save time.
Strategies for carrying out testing - Learn web development
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.
...serve the full site, which should work, at least with the fallbacks provided by our defensive coding.
Learn web development
this set of articles aims to provide complete beginners to web development with all that they need to start coding websites.
... moving onto scripting: if you are comfortable with html and css already, or you are mainly interested in coding, you'll want to move on to javascript or server-side development.
Creating MozSearch plugins
the following xml is the bundled firefox 2 search plugin for searching using yahoo!: <searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"> <shortname>yahoo</shortname> <description>yahoo search</description> <inputencoding>utf-8</inputencoding> <image width="16" height="16">data:image/x-icon;base64,r0lgodlheaaqajecap8aaaaaap///waaach5baeaaaialaaaaaaqabaaaaipli+py+0nogquybdened2khkffwuamezmpzsfmaihphrrguum/ft+uwaaow==</image> <url type="application/x-suggestions+json" method="get" template="http://ff.search.yahoo.com/gossip?output=fxjson&amp;command={searchterms}" /> <url type="text/html" method="get" template=...
... <searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"> <shortname>mdc</shortname> <description>mozilla developer center search</description> <inputencoding>utf-8</inputencoding> <image width="16" height="16">data:image/x-icon;base64,ivborw0kggoaaaansuheugaaabaaaaaqcayaaaaf8%2f9haaaabgdbtueaak%2finwwk6qaaabl0rvh0u29mdhdhcmuaqwrvymugsw1hz2vszwfkexhjztwaaahwsurbvhjayvz%2f%2fz8djqaggjiqoe%2ffv2fv7oz8rays%2fn%2bvkfg%2fiynjfyd%2f1%2brvq7ffu3dpfpsbaaheahibcj85c8bn2nj4vwsdw%2f8zqlwkio8ccroqu0dxqlwrdshuwzbaaigjmtnnpgya9j8uqhfelwpxf2mideirksn9fwsjorkaeeam0dd4...
mach
text encoding issues (especially on windows where latin-1 is not the default system encoding).
...random scripts are hard to find and may not conform to coding conventions or best practices.
Error codes returned by Mozilla APIs
try using utf-8 encoding instead.
... ns_error_port_access_not_allowed (0x804b0013) ns_error_net_reset (0x804b0014) ns_error_ftp_login (0x804b0015) ns_error_ftp_cwd (0x804b0016) ns_error_ftp_pasv (0x804b0017) ns_error_ftp_pwd (0x804b0018) ns_error_not_resumable (0x804b0019) ns_error_invalid_content_encoding (0x804b001b) the content encoding of the source document was incorrect, for example returning a plain html document advertised as content-encoding: gzip ns_error_ftp_list (0x804b001c) ns_error_unknown_host (0x804b001e) ns_error_redirect_loop (0x804b001f) ns_error_entity_changed (0x804b0020) ns_error_unknown_proxy_host (0x804b002a) ns_error_unknown_socket_type (0x804b0033) ...
HTML parser threading
normal (non-speculative) parsing initially, dodataavailable performs character encoding sniffing on the data if an encoding wasn't declared on the enclosing protocol (http) level.
...there are two such pieces of information: the manifest url for an app cache manifest and the character encoding for the document.
Mozilla DOM Hacking Guide
with that information in hand, we can start coding.
...it is unfortunately impossible to describe all the uses of the scriptable helpers, you will have to use your coding skills and/or copy existing code.
NSPR Contributor Guide
coding style nspr does not have a documented coding style guide.
...use a coding style consistent with the source file you are changing.
NSS 3.12.4 release notes
bug 321755: implement crldistributionpoint extension in libpkix bug 391434: avoid multiple encoding/decoding of pkix_pl_oid to and from ascii string bug 405297: problems building nss/lib/ckfw/capi/ with mingw gcc bug 420991: libpkix returns wrong nss error code bug 427135: add super-h (sh3,4) architecture support bug 431958: improve des and sha512 for x86_64 platform bug 433791: win16 support should be deleted from nss bug 449332: secu_parsecommandline does not validate its inputs bug 453735: w...
...corruption when importing a large certificate (>64k) bug 486405: allocator mismatches in pk12util.c bug 486537: disable execstack in freebl x86_64 builds on linux bug 486698: facilitate the building of major components independently and in a chain manner by downstream distributions bug 486999: calling ssl_setsockpeerid a second time leaks the previous value bug 487007: make lib/jar conform to nss coding style bug 487162: ckfw/capi build failure on windows bug 487239: nssutil.rc doesn't compile on wince bug 487254: sftkmod.c uses posix file io functions on wince bug 487255: sdb.c uses posix file io functions on wince bug 487487: cert_nametoascii reports !invalid ava!
NSS_3.12_release_notes.html
bug 384926: libpkix build problems bug 389411: mingw build error - undefined reference to `_imp__pkix_errornames' bug 389904: avoid multiple decoding/encoding while creating and using pkix_pl_x500name bug 390209: pkix aia manager tries to get certs using aia url with ocsp access method bug 390233: umbrella bug for libpkix cert validation failures discovered from running vfyserv bug 390499: libpkix does not check cached cert chain for revocation bug 390502: libpkix fails cert validation when no valid crl (nist validation policy is always enforc...
... 353902: klocwork bugs in stanpcertdb.c bug 353903: klocwork oom crash in softoken/keydb.c bug 353908: klocwork oom crash in tdcache.c bug 353909: klocwork ptr dereference before null check in devutil.c bug 353912: misc klocwork bugs in lib/ckfw bug 354008: klocwork bugs in freebl bug 359331: modutil -changepw strict shutdown failure bug 373367: verify ocsp response signature in libpkix without decoding and reencoding bug 390542: libpkix fails to validate a chain that consists only of one self issued, trusted cert bug 390728: pkix_pl_ocsprequest_create throws an error if it was not able to get aia location bug 397825: libpkix: ifdef code that uses user object types bug 397832: libpkix leaks memory if a macro calls a function that returns an error bug 402727: functions responsible for creating an...
NSS 3.28.3 release notes
seckeyecpublickey had been extended with a new attribute, named "encoding".
...with this nss release seckeyecpublickey.encoding is deprecated.
NSS 3.29.1 release notes
seckeyecpublickey had been extended with a new attribute, named "encoding".
...with this nss release seckeyecpublickey.encoding is deprecated.
NSS tools : ssltab
-s turn on ssl parsing and decoding.
...there is no ssl parsing or decoding.
NSS tools : ssltap
-s turn on ssl parsing and decoding.
...there is no ssl parsing or decoding.
sslerr.html
sec_error_pkcs12_decoding_pfx -8114 unable to import.
... decoding error.
NSS Tools ssltap
-s turn on ssl parsing and decoding.
...there is no ssl parsing or decoding.
NSS tools : ssltap
MozillaProjectsNSStoolsssltap
-s turn on ssl parsing and decoding.
...there is no ssl parsing or decoding.
Multithreading in Necko
multithreaded image decoding).
...the jar protocol handler, for rexample, passes a special nsiinputstream impl that does gzip decoding on the fly.
Rhino shell
readfile(path [, charactercoding]) read given file and convert its bytes to a string using the specified character coding or default character coding if explicit coding argument is not given.
... readurl(url [, charactercoding]) open an input connection to the given string url, read all its bytes and convert them to a string using the specified character coding or default character coding if explicit coding argument is not given.
Future directions
this article documents future directions in functionality, design, and coding practices for spidermonkey.
... practical coding bits experimental language features new language features (es6+) and apis often get added to spidermonkey while the spec is still being drafted, or before the feature has stabilized.
JS_EncodeStringToBuffer
it returns the length of the whole string encoding or (size_t)-1 if the string can't be encoded as bytes.
... see also mxr id search for js_encodestringtobuffer js_encodestring js_encodestringtoutf8 js_getstringencodinglength js::deflatestringtoutf8buffer js::getdeflatedutf8stringlength bug 607292 ...
JS_GetStringBytes
instead, you should use js_encodestring, js_getstringencodinglength, js_encodestringtobuffer.
...see also js_encodestring js_encodestringtoutf8 js_getstringencodinglength js_encodestringtobuffer js_comparestrings js_getstringlength js_valuetostring bug 607292 ...
SpiderMonkey 1.8.5
previous spidermonkey versions usually represented integer values smaller than 2^31 as jsvals encoding jsint; e.g.
...lobalforscopechain js_getinternedstringchars js_getinternedstringcharsandlength js_getownpropertydescriptor js_getpropertyattrsgetterandsetterbyid js_getpropertybyid js_getpropertybyiddefault js_getpropertydefault js_getpropertydescriptorbyid js_getruntimesecuritycallbacks js_getsecuritycallbacks js_getstringcharsandlength js_getstringcharsz js_getstringcharszandlength js_getstringencodinglength js_haspropertybyid js_initctypesclass js_internjsstring js_isconstructing_possiblywithgiventhisobject js_isextensible js_isinrequest js_leavecrosscompartmentcall js_lookuppropertybyid js_lookuppropertywithflagsbyid js_new js_newcompartmentandglobalobject js_newdateobject js_newdateobjectmsec js_newfunctionbyid body new c++ helpers while jsapi remains a c api, the engine is n...
SpiderMonkey 1.8.7
previous spidermonkey versions usually represented integer values smaller than 2^31 as jsvals encoding jsint; e.g.
...lobalforscopechain js_getinternedstringchars js_getinternedstringcharsandlength js_getownpropertydescriptor js_getpropertyattrsgetterandsetterbyid js_getpropertybyid js_getpropertybyiddefault js_getpropertydefault js_getpropertydescriptorbyid js_getruntimesecuritycallbacks js_getsecuritycallbacks js_getstringcharsandlength js_getstringcharsz js_getstringcharszandlength js_getstringencodinglength js_haspropertybyid js_initctypesclass js_internjsstring js_isconstructing_possiblywithgiventhisobject js_isextensible js_isinrequest js_leavecrosscompartmentcall js_lookuppropertybyid js_lookuppropertywithflagsbyid js_new js_newcompartmentandglobalobject js_newdateobject js_newdateobjectmsec js_newfunctionbyid body new c++ helpers while jsapi remains a c api, the engine is n...
Shell global objects
wasmtexttobinary(str) translates the given text wasm module into its binary encoding.
... wasmbinarytotext(bin) translates binary encoding to text format wasmextractcode(module) extracts generated machine code from webassembly.module.
A Web PKI x509 certificate primer
error code what it means what can i do sec_error_bad_der a certificate is not properly encoded according to asn.1 (der) encoding re-generate the improperly-encoded certificate sec_error_ca_cert_invalid an end-entity certificate is being used to issue another certificate ensure that any certificate intended to issue certificates has a basic constraints extension with ca: true sec_error_bad_signature a signature on a certificate is improperly formatted or the certificate has been tampered with ...
...not assert a required usage re-generate the certificate with the appropriate key usage values sec_error_invalid_algorithm a certificate has been signed with an unknown algorithm re-sign the certificate with a standardized certificate signing algorithm sec_error_invalid_time a time field in a certificate has an invalid value re-generate the certificate with valid encodings for time fields mozilla_pkix_error_key_pinning_failure sec_error_path_len_constraint_invalid sec_error_unknown_critical_extension a certificate contains an extension marked as critical that is not handled by mozilla::pkix re-generate the certificate without the extension or with it not marked as critical sec_error_unknown_issuer either...
Embedded Dialog API
to make our embedding api as consistent as possible, we'd like to impose a few coding conventions on these dialog-posing interfaces.
... embedded dialog posing interface coding conventions the nsidomwindow *aparent parameter mentioned above should be the first parameter to each method in which it appears.
Introduction to XPCOM for the DOM
you should however be absolutely sure of what you are doing before coding such a cast.
...instead of coding interfaces directly in c++ , one can use xpidl.
imgIContainer
void decodingcomplete(); obsolete since gecko 2.0 void draw(in gfxcontext acontext, in gfxgraphicsfilter afilter, [const] in gfxmatrix auserspacetoimagespace, [const] in gfxrect afill, [const] in nsintrect asubimage, [const] in nsintsize aviewportsize, in pruint32 aflags); native code only!
... return value missing description exceptions thrown missing exception missing description decodingcomplete() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) void decodingcomplete(); parameters none.
imgIDecoderObserver
unfortunately, this is currently the only way to signal decoding errors to consumers, and the only decoding errors that consumers care about (indeed, the only ones that they're prepared to hear about) are failures to instantiate the decoder (<img src="foo.html"> for example).
... status missing description statusarg missing description onstopframe() a decode notification that is called when a frame is finished decoding.
nsIIDNService
.getservice(components.interfaces.nsiidnservice); method overview autf8string convertacetoutf8(in acstring input); autf8string converttodisplayidn(in autf8string input, out boolean isascii); acstring convertutf8toace(in autf8string input); boolean isace(in acstring input); autf8string normalize(in autf8string input); methods convertacetoutf8() converts an ace (ascii compatible encoding) hostname into unicode format, returning a utf-8 format string.
...the resulting string is useful for display purposes, and ensures that the encoding is consistent with nsiuri.gethost().
nsIINIParserWriter
constant value description write_utf16 0x1 windows and the nsis installer code sometimes expect ini files to be in utf-16 encoding.
... on windows only, this flag to writefile() can be used to change the encoding from its default utf-8.
nsIJSON
charset the string encoding to use.
... only the five unicode encodings "utf-8", "utf-16le", "utf-16be", "utf-32le" and "utf-32be" are supported.
nsIProtocolHandler
(many servers do not support utf-8 iris at the present time, so we must be careful about tracking the native charset of the origin server.) nsiuri newuri( in autf8string aspec, in string aorigincharset, in nsiuri abaseuri ); parameters aspec the uri string in utf-8 encoding.
...if this is null, then utf-8 encoding is assumed and no character transformation is not performed.
nsIURI
nsiuri clone(); nsiuri cloneignoringref(); boolean equals(in nsiuri other); boolean equalsexceptref(in nsiuri other); autf8string resolve(in autf8string relativepath); boolean schemeis(in string scheme); attributes attribute type description asciihost acstring the uri host with an ascii compatible encoding.
... asciispec acstring (us-ascii) the uri spec with an ascii compatible encoding.
Network request list - Firefox Developer Tools
for more details on the color-coding used here, see the section on the timings page.
... if the "accept-encoding" header is present, the curl command includes --compressed instead of -h "accept-encoding: gzip, deflate".
Web Console remoting - Firefox Developer Tools
starting with firefox 19: for non-text response types we send the content in base64 encoding (again, most likely a longstringactor grip).
... to tell the difference just check if response.content.encoding == "base64".
AudioConfiguration - Web APIs
the audioconfiguration dictionary of the media capabilities api defines the audio file being tested when calling mediacapabilities.encodinginfo() or mediacapabilities.decodinginfo() to query whether a specific audio configuration is supported, smooth, and/or power efficient.
... } }; // check support and performance navigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ?
Background Tasks API - Web APIs
this establishes a box (id "container") that's used to present the progress of an operation (because you never know how long decoding "quantum filament tachyon emissions" will take, after all) as well as a second main box (with the id "logbox"), which is used to display textual output.
...</p> <div class="container"> <div class="label">decoding quantum filament tachyon emissions...</div> <progress id="progress" value="0"></progress> <div class="button" id="startbutton"> start </div> <div class="label counter"> task <span id="currenttasknumber">0</span> of <span id="totaltaskcount">0</span> </div> </div> <div class="logbox"> <div class="logheader"> log </div> <div id="log"> </div> </div> the progress box uses a <progress> element to show the progress, along with a label with sections that are changed to present numeric information about the progress.
BaseAudioContext.decodeAudioData() - Web APIs
successcallback a callback function to be invoked when the decoding successfully finishes.
...new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { source.buffer = buffer; source.connect(audioctx.destination); source.loop = true; }, function(e){ console.log("error with decoding audio data" + e.err); }); } request.send(); } // wire up buttons to stop and play audio play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); } stop.onclick = function() { source.stop(0); play.removeattribute('disabled'); } // dump script to pre element pre.innerhtml = myscript.innerhtml; new promise-based syntax ctx.decodeaudio...
Canvas API - Web APIs
pts.js is a library for creative coding and visualization in canvas and svg.
... the zim framework provides conveniences, components, and controls for coding creativity on the canvas — includes accessibility and hundreds of colorful tutorials.
DirectoryEntrySync - Web APIs
exceptions this method can raise a fileexception with the following codes: exception description encoding_err the path supplied is invalid.
... exceptions this method can raise a fileexception with the following codes: exception description encoding_err the path supplied is invalid.
Document - Web APIs
WebAPIDocument
document.inputencoding read only alias of document.characterset.
... document.xmlencoding returns the encoding as determined by the xml declaration.
EXT_sRGB - Web APIs
WebAPIEXT sRGB
the constants in webgl2 are: gl.srgb, gl.srgb8, gl.srgb8_alpha8 and gl.framebuffer_attachment_color_encoding.
... ext.framebuffer_attachment_color_encoding_ext returns the framebuffer color encoding (gl.linear or ext.srgb_ext).
FileReader.readAsText() - Web APIs
syntax instanceoffilereader.readastext(blob[, encoding]); parameters blob the blob or file from which to read.
... encoding optional a string specifying the encoding to use for the returned data.
FileSystemEntrySync - Web APIs
exceptions this method can raise a fileexception with the following codes: exception description encoding_err the name supplied is invalid, because at least one of the characters is reserved or illegal.
... exceptions this method can raise a fileexception with the following codes: exception description encoding_err the name supplied is invalid, because at least one of the characters is reserved or illegal.
HTMLImageElement.decode() - Web APIs
exceptions encodingerror a domexception indicating that an error occurred while decoding the image.
... const img = new image(); img.src = 'nebula.jpg'; img.decode() .then(() => { document.body.appendchild(img); }) .catch((encodingerror) => { // do something with the error.
HTMLImageElement - Web APIs
htmlimageelement.decoding an optional domstring representing a hint given to the browser on how it should decode the image.
...read the decoding page for details on the implications of this property's values.
LockedFile.readAsText() - Web APIs
syntax var request = instanceoflockedfile.readastext(size[, encoding]); parameters size a number representing the number of bytes to read in the file.
... encoding optional a string indicating the encoding to use for the returned data.
MediaRecorder - Web APIs
mediarecorder.videobitspersecond read only returns the video encoding bit rate in use.
... mediarecorder.audiobitspersecond read only returns the audio encoding bit rate in use.
Navigator.mediaCapabilities - Web APIs
the navigator.mediacapabilities read-only property returns a mediacapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities as defined by the media capabilities api.
... examples navigator.mediacapabilities.decodinginfo({ type : 'file', audio : { contenttype : "audio/mp3", channels : 2, bitrate : 132700, samplerate : 5200 } }).then(function(result) { console.log('this configuration is ' + (result.supported ?
PerformanceResourceTiming - Web APIs
performanceresourcetiming.encodedbodysizeread only a number representing the size (in octets) received from the fetch (http or cache), of the payload body, before removing any applied content-codings.
... performanceresourcetiming.decodedbodysizeread only a number that is the size (in octets) received from the fetch (http or cache) of the message body, after removing any applied content-codings.
RTCPeerConnection.addTransceiver() - Web APIs
sendencodings optional a list of encodings to allow when sending rtp media from the rtcrtpsender.
... each entry is of type rtcrtpencodingparameters.
RTCRtpSendParameters - Web APIs
encodings an array of rtcrtpencodingparameters objects, each specifying the parameters for a single codec that could be used to encode the track's media.
... priority a string from the rtcprioritytype enumerated type which indicates the encoding's priority.
RTCRtpSender - Web APIs
with it, you can configure the encoding used for the corresponding track, get information about the device's media capabilities, and so forth.
... methods rtcrtpsender.getparameters() returns a rtcrtpparameters object describing the current configuration for the encoding and transmission of media on the track.
RTCRtpTransceiver.receiver - Web APIs
the read-only receiver property of webrtc's rtcrtptransceiver interface indicates the rtcrtpreceiver responsible for receiving and decoding incoming media data for the transceiver's stream.
... syntax var rtpreceiver = rtcrtptransceiver.receiver; value an rtcrtpreceiver object which is responsible for receiving and decoding incoming media data whose media id is the same as the current value of mid.
RTCRtpTransceiverInit - Web APIs
sendencodings optional a list of encodings to allow when sending rtp media from the rtcrtpsender.
... each entry is of type rtcrtpencodingparameters.
Using the Resource Timing API - Web APIs
the encodedbodysize property returns the size (in octets) received from the fetch (http or cache), of the payload body, before removing any applied content-codings.
... decodedbodysize returns the size (in octets) received from the fetch (http or cache) of the message body, after removing any applied content-codings.
Resource Timing API - Web APIs
the encodedbodysize property returns the size (in octets) received from the fetch (http or cache), of the payload body, before removing any applied content-codings.
... decodedbodysize returns the size (in octets) received from the fetch (http or cache) of the message body, after removing any applied content-codings.
SVGImageElement - Web APIs
svgimageelement.decoding returns a domstring representing a hint given to the browser on how it should decode the image.
... svgimageelement.decode() initiates asynchronous decoding of the image data.
TextEncoder.prototype.encodeInto() - Web APIs
the textencoder.prototype.encodeinto() method takes a usvstring to encode and a destination uint8array to put resulting utf-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
...this : self : global); source: https://github.com/anonyco/fastestsmallesttextencoderdecoder specifications specification status comment encodingthe definition of 'textencoder.encode()' in that specification.
TransformStream - Web APIs
const tes = { start(){this.encoder = new textencoder()}, transform(chunk, controller) { controller.enqueue(this.encoder.encode(chunk)) } } let _jstes_wm = new weakmap(); /* info holder */ class jstextencoderstream extends transformstream { constructor() { let t = {...tes} super(t) _jstes_wm.set(this, t) } get encoding() {return _jstes_wm.get(this).encoder.encoding} } similarly, textdecoderstream can be written as such: const tes = { start(){ this.decoder = new textdecoder(this.encoding, this.options) }, transform(chunk, controller) { controller.enqueue(this.decoder.decode(chunk)) } } let _jstds_wm = new weakmap(); /* info holder */ class jstextdecoderstream extends transformstream { constr...
...uctor(encoding = 'utf-8', {...options} = {}) { let t = {...tds, encoding, options} super(t) _jstes_wm.set(this, t) } get encoding() {return _jstds_wm.get(this).decoder.encoding} get fatal() {return _jstds_wm.get(this).decoder.fatal} get ignorebom() {return _jstds_wm.get(this).decoder.ignorebom} } chaining multiple readablestreams together this is a useful one, where multiple streams can be conjoined.
VideoConfiguration - Web APIs
the videoconfiguration dictionary of the media capabilities api is used to define the video file being tested when calling the mediacapabilities methods encodinginfo() and decodinginfo() to determine whether or not the described video configuration is supported, and how smoothly and how smoooth and power-efficient it can be handled.
... examples // create media configuration to be tested const mediaconfig = { type : 'file', // see mediadecodingconfiguration and mediaencodingconfiguration video : { contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s.
WEBGL_compressed_texture_atc - Web APIs
ext.compressed_rgba_atc_explicit_alpha_webgl compresses rgba textures using explicit alpha encoding (useful when alpha transitions are sharp).
... ext.compressed_rgba_atc_interpolated_alpha_webgl compresses rgba textures using interpolated alpha encoding (useful when alpha transitions are gradient).
Writing WebSocket servers - Web APIs
to get it, concatenate 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.
... decoding payload length to read the payload data, you must know when to stop reading.
Writing a WebSocket server in Java - Web APIs
ponse = ("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.
... decoding algorithm decoded byte = encoded byte xor (position of encoded byte bitwise and 0x3)th byte of key example in java: byte[] decoded = new byte[6]; byte[] encoded = new byte[] { (byte) 198, (byte) 131, (byte) 130, (byte) 182, (byte) 194, (byte) 135 }; byte[] key = new byte[] { (byte) 167, (byte) 225, (byte) 225, (byte) 210 }; for (int i = 0; i < encoded.length; i++) { d...
Migrating from webkitAudioContext - Web APIs
the example below shows old code which downloads an audio file over the network, and then decoded it using createbuffer(): var xhr = new xmlhttprequest(); xhr.open("get", "/path/to/audio.ogg", true); xhr.responsetype = "arraybuffer"; xhr.send(); xhr.onload = function() { var decodedbuffer = context.createbuffer(xhr.response, false); if (decodedbuffer) { // decoding was successful, do something useful with the audio buffer } else { alert("decoding the audio buffer failed"); } }; converting this code to use decodeaudiodata() is relatively simple, as can be seen below: var xhr = new xmlhttprequest(); xhr.open("get", "/path/to/audio.ogg", true); xhr.responsetype = "arraybuffer"; xhr.send(); xhr.onload = function() { context.decodeaudiodata(xhr.resp...
...onse, function onsuccess(decodedbuffer) { // decoding was successful, do something useful with the audio buffer }, function onfailure() { alert("decoding the audio buffer failed"); }); }; note that the decodeaudiodata() method is asynchronous, which means that it will return immediately, and then when the decoding finishes, one of the success or failure callback functions will get called depending on whether the audio decoding was successful.
Web Audio API - Web APIs
learning coding is like playing cards — you learn the rules, then you play, then you go back and learn the rules again, then you play again.
...an audio context controls the creation of the nodes it contains and the execution of the audio processing, or decoding.
Web Accessibility: Understanding Colors and Luminance - Accessibility
in speaking specifically to relative luminance, wcag's definition of relative luminance notes: "note 2: almost all systems used today to view web content assume srgb encoding.
... measuring relative luminance when evaluating luminance, bear in mind the w3c's wiki on relative luminance "almost all systems used today to view web content assume srgb encoding.
Live streaming web audio and video - Developer guides
for example, you could implement mpeg-dash using javascript while offloading the decoding to mse.
... note: you can find a guide to encoding hls and mpeg-dash for use on the web at setting up adaptive streaming media sources.
Audio and Video Delivery - Developer guides
your files have been encoded incorrectly your files may have been encoded incorrectly — try encoding using one of the following tools, which are proven to be pretty reliable: audacity — free audio editor and recorder miro — free, open-source music and video player handbrake — open source video transcoder firefogg — video and audio encoding for firefox ffmpeg2 — comprehensive command line encoder libav — comprehensive command line encoder vid.ly — video player,transcoding a...
...nd delivery internet archive — free transcoding and storage detecting when no sources have loaded to detect that all child <source> elements have failed to load, check the value of the media element's networkstate attribute.
<img>: The Image Embed element - HTML: Hypertext Markup Language
WebHTMLElementimg
decoding provides an image decoding hint to the browser.
... auto default: no preference for the decoding mode.
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
ontrol is checked dirname text, search name of form field to use for sending the element's directionality in form submission disabled all whether the form control is disabled form all associates the control with a form element formaction image, submit url to use for form submission formenctype image, submit form data set encoding type to use for form submission formmethod image, submit http method to use for form submission formnovalidate image, submit bypass form control validation for form submission formtarget image, submit browsing context for form submission height image same as height attribute for <img>; vertical dimension list almost all va...
...(disabled controls, unchecked radio buttons, unchecked checkboxes, and reset buttons are also not sent.) there are two special cases: _charset_ : if used as the name of an <input> element of type hidden, the input's value is automatically set by the user agent to the character encoding being used to submit the form.
HTTP authentication - HTTP
character encoding of http authentication browsers use utf-8 encoding for usernames and passwords.
... security of basic authentication as the user id and password are passed over the network as clear text (it is base64 encoded, but base64 is a reversible encoding), the basic authentication scheme is not secure.
Configuring servers for Ogg media - HTTP
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.
... another probelm with allowing http compression for media streaming: apache servers don't send the content-length response header if gzip encoding is used.
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.
Authorization - HTTP
note: base64 encoding does not mean encryption or hashing!
... this method is equally secure as sending the credentials in clear text (base64 is a reversible encoding).
Proxy-Authorization - HTTP
note: base64 encoding does not mean encryption or hashing!
... this method is equally secure as sending the credentials in clear text (base64 is a reversible encoding).
WWW-Authenticate - HTTP
charset=<charset> tells the client the server's prefered encoding scheme when submitting a username and password.
...this does not relate to the encoding of the realm string.
OPTIONS - HTTP
WebHTTPMethodsOPTIONS
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.
... http/1.1 204 no content date: mon, 01 dec 2008 01:15:39 gmt server: apache/2.0.61 (unix) access-control-allow-origin: https://foo.example access-control-allow-methods: post, get, options access-control-allow-headers: x-pingother, content-type access-control-max-age: 86400 vary: accept-encoding, origin keep-alive: timeout=2, max=100 connection: keep-alive specifications specification title rfc 7231, section 4.3.7: options hypertext transfer protocol (http/1.1): semantics and content ...
A typical HTTP session - HTTP
WebHTTPSession
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 2018 17:33:...
... text/html; charset=utf-8 content-length: 38217 connection: keep-alive cache-control: no-cache, no-store, must-revalidate, max-age=0 content-language: en-us date: thu, 06 dec 2018 17:35:13 gmt expires: thu, 06 dec 2018 17:35:13 gmt 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 x-cache: error from cloudfront <!doctype html...
Functions - JavaScript
encodeuri() the encodeuri() method encodes a uniform resource identifier (uri) by replacing each instance of certain characters by one, two, three, or four escape sequences representing the utf-8 encoding of the character (will only be four escape sequences for characters composed of two "surrogate" characters).
... encodeuricomponent() the encodeuricomponent() method encodes a uniform resource identifier (uri) component by replacing each instance of certain characters by one, two, three, or four escape sequences representing the utf-8 encoding of the character (will only be four escape sequences for characters composed of two "surrogate" characters).
Grammar and types - JavaScript
ble: javascript special characters character meaning \0 null byte \b backspace \f form feed \n new line \r carriage return \t tab \v vertical tab \' apostrophe or single quote \" double quote \\ backslash character \xxx the character with the latin-1 encoding specified by up to three octal digits xxx between 0 and 377.
... \xxx the character with the latin-1 encoding specified by the two hexadecimal digits xx between 00 and ff.
Media container formats (file types) - Web media technologies
a good example of this is the mp3 audio file, which is in fact an mpeg-1 container with a single audio track encoded using mpeg-1 audio layer iii encoding.
... if you have any specific encoding requirements, make sure the container you choose supports the appropriate codecs.
Image file type and format guide - Web media technologies
webp image webp supports lossy compression via predictive coding based on the vp8 video codec, and lossless compression that uses substitutions for repeating data.
... mime type image/webp file extension(s) .webp specification riff container specification rfc 6386: vp8 data format and decoding guide (lossy encoding) webp lossless bitstream specification browser compatibility feature chrome edge firefox internet explorer opera safari lossy webp support 17 18 65 no 11.10 (presto) 15 (blink) no lossless webp ...
Media type and format guide: image, audio, and video content - Web media technologies
WebMediaFormats
digital video concepts a guide to fundamental concepts involved with digital video as used on the web, including basics about color formats, chroma subsampling, how human perception influences video coding, and so forth.
... other topics media capabilities api the media capabilities api lets you discover the encoding and decoding capabilities of the device your app or site is running on.
OpenSearch description format
<opensearchdescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/"> <shortname>[snk]</shortname> <description>[search engine full name and summary]</description> <inputencoding>[utf-8]</inputencoding> <image width="16" height="16" type="image/x-icon">[https://example.com/favicon.ico]</image> <url type="text/html" template="[searchurl]"> <param name="[key name]" value="{searchterms}"/> <!-- other params if you need them… --> <param name="[other key name]" value="[parameter value]"/> </url> <url type="application/x-suggestions+json" template="[sugges...
... inputencoding the character encoding to use when submitting input to the search engine.
Performance fundamentals - Web Performance
many years of improvements targeting this content, like parallel html parsing, intelligent scheduling of reflows and image decoding, clever layout algorithms, etc., translate just as well to improving web applications on firefox.
... specific coding tips for application performance the following practical tips will help improve one or more of the application performance factors discussed above.
Optimizing startup performance - Web Performance
if you need to decode asset files (for example, decoding jpeg files and turning them into raw texture data for later use by webgl), that's great to do in workers.
... when dealing with data supported by the browser (for example, decoding image data), use the decoders built into the browser or device rather than rolling your own or using one from the original codebase.
Linking - SVG: Scalable Vector Graphics
WebSVGLinking
when svg documents are embedded within a parent html document using the tag: page1.html: <html> <body> <p>this is a svg button:</p> <object width="100" height="50" type="image/svg+xml" data="button.svg"/> </body> </html> button.svg: <?xml version="1.1" encoding="utf-8"?> <svg xmlns="http://www.w3.org/2000/svg"> <a xlink:href="page2.html" target="_top"> <g> <!-- button graphical elements here --> </g> </a> </svg> the specification says that the browser should navigate to the html document page2.html when the button graphics are clicked.
... to get around this, requires a little ugly javascript hacking: button.svg: <?xml version="1.1" encoding="utf-8"?> <svg xmlns="http://www.w3.org/2000/svg"> <g onclick="top.document.href='page2.html'" cursor="pointer"> <!-- button graphical elements here --> </g> </svg> example for an example of this solution at work see www.codedread.com.
<xsl:output> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementoutput
syntax <xsl:output method="xml" | "html" | "text" version=string encoding=string omit-xml-declaration="yes" | "no" standalone="yes" | "no" doctype-public=string doctype-system=string cdata-section-elements=list-of-names indent="yes" | "no" media-type=string /> required attributes none.
... encoding specifies the value of the encoding attribute in the output document.
2015 MDN Fellowship Program - Archive of obsolete content
github: chrisdavidmills twitter: @chrisdavidmills why increase the reach and impact of your expertise grow your skills beyond coding and managing to educating and communicating build something used by hundreds of thousands (or more) developers worldwide directly impact and grow the value of the open web when application deadline: april 1, 2015 orientation: early june (dates tbd) graduation: august 11-12, 2015 where orientation: a mozilla location (tbd).
Private Properties - Archive of obsolete content
however, the use of an underscore prefix is just a coding convention and is not enforced by the language: there is nothing to prevent a user from directly accessing a property that is supposed to be private.
High-Level APIs - Archive of obsolete content
base64 data encoding and decoding using base64 algorithms.
/loader - Archive of obsolete content
optionally more options may be specified: options.encoding: source encoding, defaults to 'utf-8'.
Localization - Archive of obsolete content
the files: use the .properties format are named "xx-yy.properties", where "xx-yy" is the name of the locale in question contain one entry for each string you want to localize, consisting of an identifier for the string and its translation in that locale, in the format identifier=translation need to use utf-8 without bom encoding lines starting with "#" (after optional whitespace) are comments suppose your add-on contains a single localizable string, represented in english as "hello!", and you want to supply us english and french french localizations.
Bootstrapped extensions - Archive of obsolete content
edward lee shows off some helpful coding patterns and examples you can use in your bootstrapped add-on.
Embedding SVG - Archive of obsolete content
<?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <body> <!-- html and svg go here --> </body> </html> example: <?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" ...
File I/O - Archive of obsolete content
createinstance(components.interfaces.nsiconverterinputstream); fstream.init(file, -1, 0, 0); cstream.init(fstream, "utf-8", 0, 0); // you can use another encoding here if you wish let (str = {}) { let read = 0; do { read = cstream.readstring(0xffffffff, str); // read as much as we can and put it in str.value data += str.value; } while (read != 0); } cstream.close(); // this closes fstream alert(data); reading line by line note: the sample code below does not handle text with non-ascii characters.
Extension Etiquette - Archive of obsolete content
coding practices namespace conflicts there are many namespaces which extensions often must share with other consumers, be they other add-ons, web code, or the browser itself.
Install Manifests - Archive of obsolete content
layout the basic layout of an install manifest is like so: <?xml version="1.0" encoding="utf-8"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <!-- properties --> </description> </rdf> some properties are required, some are optional.
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
xml coding css coding basic javascript syntax xml: a text-based structural language extensible markup language (xml) is a meta-language for expressing various kinds of data.
Adding sidebars - Archive of obsolete content
it should be evident at this point that hand-coding a tree would take quite some time and yields a great deal of xml code that is hard to follow.
Adding windows and dialogs - Archive of obsolete content
using the prompt service will save you a lot of xul coding, and you'll be at ease knowing that you're using mozilla's tried and tested code.
Connecting to Remote Content - Archive of obsolete content
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <xsl:template match="/data"> <xul:vbox> <xsl:for-each select="shops/name"> <xul:hbox> <xul:label value="name:" /> <xul:label> <xsl:value-of select="." /> </xul:label> ...
Local Storage - Archive of obsolete content
if you manage to get your display code to use templates, you will have saved a lot of coding.
The Essentials of an Extension - Archive of obsolete content
most of our coding standards are based on mozilla's or other known and used standards.
Useful Mozilla Community Sites - Archive of obsolete content
happy coding!
Search Extension Tutorial (Draft) - Archive of obsolete content
search.xml <?xml version="1.0" encoding="utf-8"?> <searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"> <shortname>example engine</shortname> <description>example search engine</description> <inputencoding>utf-8</inputencoding> <image width="16" height="16" type="image/png">data:image/png;base64, ...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
wired news redesign in a nutshell driven by xhtml 1.0 transitional and css; allows centralized control over layout and appearance for thousands of pages; simple markup allows for rapid changes to templates; average page weight dropped by almost half; page layout accomplished with simple css positioning; vastly increased accessibility without special coding or user agent detection.
Creating a dynamic status bar extension - Archive of obsolete content
write the xul file we need a slightly more complicated xul file this time, in order to add a reference to the javascript code that will do the real work: <?xml version="1.0" encoding="utf-8"?> <!doctype overlay> <overlay id="stockwatcher-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://stockwatcher/content/stockwatcher.js"/> <!-- firefox --> <statusbar id="status-bar"> <statusbarpanel id="stockwatcher" label="loading..." tooltiptext="current value" onclick="stockwatcher.ref...
Creating a status bar extension - Archive of obsolete content
our overlay file, status-bar-sample-1.xul, looks like this: <?xml version="1.0" encoding="utf-8"?> <!doctype overlay > <overlay id="status-bar-sample-1-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <!-- firefox --> <statusbar id="status-bar"> <statusbarpanel id="status-bar-sample-1" label="hello world" tooltiptext="sample status bar item" /> </statusbar> </overlay> the first order of business in the status-bar-samp...
JXON - Archive of obsolete content
translation json the root element will be absorbed, for there is only one: <root>test</root> becomes "test" element names become object properties: <root><name>xml</name><encoding>ascii</encoding></root> becomes { "name": "xml", "encoding": "ascii" } numbers are recognized (integers and decimals): <root><age>12</age><height>1.73</height></root> becomes { "age": 12, "height": 1.73 } booleans are recognized case insensitive: <root><checked>true</checked><answer>false</answer></root> becomes { "checked": true, "answer": false ...
List of Mozilla-Based Applications - Archive of obsolete content
abstract accounting tool adobe acrobat and adobe reader portable document format (pdf) software uses mozilla spidermonkey adobe flash player popular browser plug-in uses nss in linux version adwatch content management system uses xul and xpcom aicpcu/iia exam app exam delivery software aliwal geocoder geocoding & data on a map amarok xul remote remote control for amarok music player ample sdk javascript gui-framework aol instant messenger im client uses nss apache web server doesn't use nss by default, but can be configured to use nss with mod_nss ssl module apicawatch site performance monitoring tool uses firefox as part o...
Creating a Firefox sidebar extension - Archive of obsolete content
install.rdf <?xml version="1.0" encoding="utf-8"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <em:id>emptysidebar@yourdomain.com</em:id> <em:name>emptysidebar extension</em:name> <em:version>1.0</em:version> <em:creator>your name</em:creator> <em:description>example extension for creation and registrat...
Error Console - Archive of obsolete content
warning usually lets the program compile but warns of bad coding and suggests design flaws.
HTTP Class Overview - Archive of obsolete content
tion implements nsistreamlistener & nsistreamprovider talks to the socket transport service feeds data to its transaction object routes progress notifications nshttpconnectioninfo identifies a connection nshttptransaction implements nsirequest encapsulates a http request and response parses incoming data nshttpchunkeddecoder owned by a transaction strips chunked transfer encoding nshttprequesthead owns a nshttpheaderarray knows how to fill a request buffer nshttpresponsehead owns a nshttpheaderarray knows how to parse response lines performs common header manipulations/calculations nshttpheaderarray stores http "<header>:<value>" pairs nshttpauthcache stores authentication credentials for http auth domains nshttpbasicauth implements nsihttpauth...
Helper Apps (and a bit of Save As) - Archive of obsolete content
ongoing work support synchronous dialogs, not just asynchronous ones (fixes many issues related to pre-downloading, content-decoding, etc).
Isp Data - Archive of obsolete content
tools needed the files are simple text files, in utf-8 encoding, so use your favorite modern text editor.
Microsummary XML grammar reference - Archive of obsolete content
example the microsummary generator created in the creating a microsummary tutorial: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> <output method="text"/> <template match="/"> <value-of select="id('download-count')"/> <text> fx downloads</text> </template> </transform> </template> <pages> <inc...
Microsummary topics - Archive of obsolete content
for example, the following code snippet installs the microsummary generator from the creating a microsummary tutorial: var generatortext = ' \ <?xml version="1.0" encoding="utf-8"?> \ <generator xmlns="http://www.mozilla.org/microsummaries/0.1" \ name="firefox download count" \ uri="urn:{835daeb3-6760-47fa-8f4f-8e4fdea1fb16}"> \ <template> \ <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> \ <output method="text"/> \ <template match="/"> \ <value-of select="id(\'download-count\')"...
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
athematical markup language: mathml version 2.0 extensible markup language (xml): xml 1.0, namespaces in xml, associating style sheets with xml documents 1.0, fragment identifier for xml xsl transformations: xslt 1.0 xml path language: xpath 1.0 resource description framework: rdf simple object access protocol: soap 1.1 ecma-262, revision 3 (javascript 1.5): ecma-262 general cross-browser coding tips even though web standards do exist, different browsers behave differently (in fact, the same browser may behave differently depending on the platform).
New Skin Notes - Archive of obsolete content
it's just sloppy coding.
File object - Archive of obsolete content
file.type a string specifying the type of data or encoding contained in the file.
Archived SpiderMonkey docs - Archive of obsolete content
between resolving conflicts, finding a good time to land, watching the tree, and marking bugs as fixed, it takes around half a day.spidermonkey coding conventionsthe spidermonkey project owners enforce coding conventions pretty strictly during code reviews.
Cmdline tests - Archive of obsolete content
the testsuite allows more flexibility by coding scripts in python allowing any executable to run, sending commands to stdin, and asserting output using regular expressions.
XPInstall - Archive of obsolete content
<?xml version="1.0" encoding="utf-8"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <!-- properties --> </description> </rdf> cross-platform install (xpinstall) is a technology used by mozilla application suite, mozilla firefox, mozilla thunderbird and other xul-based applications for installing exten...
Index - Archive of obsolete content
ArchiveMozillaXULIndex
977 xul coding style guidelines xul no summary!
Introduction to XUL - Archive of obsolete content
internationalization is discussed more completely in the xul coding style guidelines document.
Keyboard Shortcuts - Archive of obsolete content
<?xml version="1.0" encoding="utf-8"?> <window xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul"> <keyset> <key id="cut_cmd" modifiers="accel" key="x"/> <key id="copy_cmd" modifiers="accel" key="c"/> <key id="paste_cmd" modifiers="accel" key="v"/> <key id="close_cmd" keycode="vk_escape" oncommand="window.close();"/> </keyset> <vbox flex="1"> <toolbox> <menubar id="findfiles-menubar"> <men...
Localization - Archive of obsolete content
instead of hard-coding text directly into an application, each piece of text is only a reference into the string table.
XPCOM Interfaces - Archive of obsolete content
the third parameter is the bookmark type which will normally be 0 and the last parameter is the character encoding of the document being bookmarked, which may be null.
Deploying XULRunner - Archive of obsolete content
here's a sample one: <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple computer//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>cfbundledevelopmentregion</key> <string>english</string> <key>cfbundleexecutable</key> <string>xulrunner</string> <key>cfbundlegetinfostring</key> <string>1.0</string> <key>cfbundleiconfile</key> <string>app_icon.icns</string> <key>cf...
Archived Mozilla and build documentation - Archive of obsolete content
these components and services include: force rtl (this is a temporary placeholder/stub for the force rtl page) gecko coding help wanted take a look through lxr, and you'll realize that mozilla's source code is a big place.
2006-10-06 - Archive of obsolete content
discussions is thunderbird using a valid w3c coding?
2006-10-20 - Archive of obsolete content
--------------010306060708080008030904 content-type: audio/mpeg; name="eternals - babalus's wedding dayfinal.mp3" content-transfer-encoding: base64 content-id: <part1.00030607.05030...@gmail.com> content-disposition: inline; filename="eternals - babalus's wedding dayfinal.mp3" he wonders why this is.
JS-Engine FAQ - Archive of obsolete content
to write wrappers in pure javascript to interface with any c library on the system there are mechanisms such as xpcshell, wxjs, jsdb, jsni coding spidermonkey in c check out this tutorial how to compile tamarin on linux/x86 there is a patch that allows you to compile it.
Vulnerabilities - Archive of obsolete content
vulnerability categories a software flaw vulnerability is caused by an unintended error in the design or coding of software.
Using the W3C DOM - Archive of obsolete content
deprecated coding practices appropriate dom 2 replacements ie5+: elemref.style.pixelleft dom level 2: parseint(elemref.style.left, 10) ie5+: elemref.style.pixeltop dom level 2: parseint(elemref.style.top, 10) ie5+: elemref.style.pixelleft = x; elemref.style.pixeltop = y; dom level 2: elemref.style.left = x + "px"; elemref.style.top = y + "px"; w3c dom2 refl...
Using Web Standards in your Web Pages - Archive of obsolete content
the other sections address dom and dhtml coding practices which are at odds with the w3c web standards and suggest replacements.
Browser Detection and Cross Browser Support - Archive of obsolete content
studying how other authors use browser detection and cross browser coding techniques is the best way to learn.
XForms Custom Controls - Archive of obsolete content
it is bound to <xf:output mediatype="image/*"/> mimicking the current xforms 1.1 draft: <?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.1//en" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"> <head> <title>custom image control sample</title> <bindings id="xformsbindings" xmlns="http://www.mozilla.org/xbl" xmlns:html="http://www.w3.org/1999/xhtml"> <binding i...
RDF in Fifty Words or Less - Archive of obsolete content
and a "bookmark" could really have arbitrary properties associated with it: you might want to invent your own "classification" scheme for a bookmarka la macintosh's "hot", "warm", "cool" color coding.
Common causes of memory leaks in extensions - Extensions
this page explains coding patterns that cause extension to cause memory leaks.
Building up a basic demo with A-Frame - Game development
mozilla's a-frame framework provides a markup language allowing us to build 3d vr landscapes using a system familiar to web developers, which follows game development coding principles; this is useful for quickly and successfully building prototypes and demos, without having to write a lot of javascript or glsl.
Building up a basic demo with PlayCanvas editor - Game development
instead of coding everything from scratch you can also use the online playcanvas editor.
Building up a basic demo with the PlayCanvas engine - Game development
drawing everything for given shape is taken care of by the engine, so we can focus on the high level coding.
Building up a basic demo with Three.js - Game development
detail like drawing required vertices and faces, for a given shape, is handled by the three framework, so we can focus on higher level coding.
3D games on the Web - Game development
the rise of libraries and frameworks coding raw webgl is fairly complex, but you'll want to get to grips with it in the long run, as your projects get more advanced (see our webgl documentation to get started.) for real-world projects you'll probably also make use of a framework to speed up development and help you manage the project you're working on.
Audio for Web games - Game development
encoding your audio at lower bit rates means smaller file sizes but lower seeking accuracy.
Finishing up - Game development
have fun coding!
2D maze game with device orientation - Game development
in this tutorial we used phaser, but there are a number of other frameworks worth considering too like impactjs, construct 2 or playcanvas — it depends on your preferences, coding skills (or lack thereof), project scale, requirements and other aspects.
Visual-js game engine - Game development
visual-js source editor (2d part only) is new and better way .in future visual staff will be better (real time simulator will be implemented).for now this place is good for coding .
ASCII - MDN Web Docs Glossary: Definitions of Web-related terms
ascii (american standard code for information interchange) is one of the most popular coding method used by computers for converting letters, numbers, punctuation and control codes into digital form.
Codec - MDN Web Docs Glossary: Definitions of Web-related terms
a given codec knows how to handle a specific encoding or compression technology.
Cross-site scripting - MDN Web Docs Glossary: Definitions of Web-related terms
these attacks succeed if the web app does not employ enough validation or encoding.
Entity header - MDN Web Docs Glossary: Definitions of Web-related terms
headers like content-length, content-language, content-encoding are entities headers.
Forbidden header name - MDN Web Docs Glossary: Definitions of Web-related terms
forbidden header names start with proxy- or sec-, or are one of the following names: accept-charset accept-encoding access-control-request-headers access-control-request-method connection content-length cookie cookie2 date dnt expect feature-policy host keep-alive origin proxy- sec- referer te trailer transfer-encoding upgrade via note: the user-agent header is no longer forbidden, as per spec — see forbidden header name list (this was implemented in firefox 43) — it can now be set ...
HTTP header - MDN Web Docs Glossary: Definitions of Web-related terms
a basic request with one header: get /example.http http/1.1 host: example.com redirects have mandatory headers (location): 302 found location: /newpage.html a typical set of headers: 304 not modified access-control-allow-origin: * age: 2318192 cache-control: public, max-age=315360000 connection: keep-alive date: mon, 18 jul 2016 16:06:00 gmt server: apache vary: accept-encoding via: 1.1 3dc30c7222755f86e824b93feb8b5b8c.cloudfront.net (cloudfront) x-amz-cf-id: tol0fem6ui4fgldrkjx0vao5hpkkgzulyn2twd2gawltr7vlnjtvzw== x-backend-server: developer6.webapp.scl3.mozilla.com x-cache: hit from cloudfront x-cache-info: cached ...
Quality values - MDN Web Docs Glossary: Definitions of Web-related terms
more information http headers using q-values in their syntax: accept, accept-charset, accept-language, accept-encoding, te.
RDF - MDN Web Docs Glossary: Definitions of Web-related terms
rdf provides a standard way of encoding resource information so that it can be exchanged in a fully automated way between applications.
Request header - MDN Web Docs Glossary: Definitions of Web-related terms
a few request headers after a get request: get /home.html http/1.1 host: developer.mozilla.org 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, br referer: https://developer.mozilla.org/testpage.html connection: keep-alive upgrade-insecure-requests: 1 if-modified-since: mon, 18 jul 2016 02:36:04 gmt if-none-match: "c561c68d0ba92bbeb8b0fff2a9199f722e3a621a" cache-control: max-age=0 strictly speaking, the content-length header in this example is not a request header like the others, but an entity header: post /myform.html...
Web standards - MDN Web Docs Glossary: Definitions of Web-related terms
and use of uris, http, and mime w3c: specifications for markup language (e.g., html), style definitions (i.e., css), dom, accessibility iana (internet assigned numbers authority): name and number registries ecma intl.: scripting standards, most prominently for javascript iso (international organization for standardization): standards governing a diverse array of aspects, including character encodings, website management, and user-interface design learn more general knowledge web standards on wikipedia ...
Brotli - MDN Web Docs Glossary: Definitions of Web-related terms
it compresses data using a combination of a modern variant of the lz77 algorithm, huffman coding, and second-order context modeling, providing a compression ratio comparable to the best currently available general-purpose compression methods.
Character - MDN Web Docs Glossary: Definitions of Web-related terms
learn more general knowledge character (computing) on wikipedia character encoding on wikipedia ascii on wikipedia utf-8 on wikipedia unicode on wikipedia ...
Character set - MDN Web Docs Glossary: Definitions of Web-related terms
a character set is an encoding system to let computers know how to recognize character, including letters, numbers, punctuation marks, and whitespace.
JPEG - MDN Web Docs Glossary: Definitions of Web-related terms
jpeg compression is composed of three compression techniques applied in successive layers, including chrominance subsampling, discrete cosine transformation and quantization, and run-length delta & huffman encoding.
Assessment: Accessibility troubleshooting - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: CSS and JavaScript accessibility - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: HTML accessibility - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: WAI-ARIA - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Accessibility - Learn web development
note: if you are working on a computer/tablet/other devices where you don't have the ability to create your own files, you can try out most of the code examples in an online coding program such as jsbin or glitch.
A cool-looking box - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: The Cascade - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Creating fancy letterheaded paper - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Debugging CSS - Learn web development
take a step back from the problem any coding problem can be frustrating, especially css problems because you often don't get an error message to search for online to help with finding a solution.
Fundamental CSS comprehension - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Images and Form elements - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Overflow - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: The Box Model - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Selectors - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: sizing - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: tables - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: backgrounds and borders - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: values and units - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Writing Modes and Logical Properties - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
CSS building blocks - Learn web development
note: if you are working on a computer/tablet/another device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
Test your skills: Flexbox - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: floats - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test Your Skills: Fundamental layout comprehension - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Grid Layout - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Multicol - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: position - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Media Queries and Responsive Design - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
CSS layout - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
How CSS is structured - Learn web development
comments as with any coding work, it is best practice to write comments along with css.
Using your new knowledge - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
CSS first steps - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
Using CSS generated content - Learn web development
for details, see referring to characters not represented in a character encoding and characters and case in the css specification.
Typesetting a community school homepage - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Styling text - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin, codepen or glitch.
What text editors are available? - Learn web development
make your file more legible by color-coding keywords based on the technology you're using.
How can we design for all types of users? - Learn web development
(most designs are done in pixel-based software, so the math has to be done by the person coding the css).
How do I use GitHub Pages? - Learn web development
github is a "social coding" site.
What software do I need to build a website? - Learn web development
these editors are all straightforward, but lack special features for webpage coding.
How to build custom form controls - Learn web development
here are a few libraries you should consider before coding your own: jquery ui axe accessible custom select dropdowns msdropdown nice forms if you do create alternative controls via radio buttons, your own javascript, or with a 3rd party library, ensure it is accessible and feature-proof; that is, it needs to be able to work better with a variety of browsers whose compatibility with the web standards they use vary.
How to structure a web form - Learn web development
above all, it is up to you to find a comfortable coding style that results in accessible, usable forms.
Styling web forms - Learn web development
before we start coding, we need three additional assets: the postcard background — download this image and save it in the same directory as your working html file.
Test your skills: Advanced styling - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Basic controls - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Form structure - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Form validation - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: HTML5 controls - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Other controls - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Styling basics - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Web forms — Working with user data - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
JavaScript basics - Learn web development
if you master these fundamentals, you have a head start on coding in other languages too!
Publishing your website - Learn web development
using an online tool like github or google app engine some tools let you publish your website online: github is a "social coding" site.
Marking up a letter - Learn web development
it's very hard to help someone with a coding problem without seeing their code.
Structuring a page of content - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Advanced HTML text - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: HTML text basics - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Links - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Introduction to HTML - Learn web development
note: if you are working on a computer/tablet/other devices that doesn't let you create your own files, you can try out (most of) the code examples in an online coding program such as jsbin or glitch.
Test your skills: HTML images - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Mozilla splash page - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Multimedia and embedding - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Multimedia and Embedding - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
Assessment: Structuring planet data - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
HTML Tables - Learn web development
LearnHTMLTables
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
Choosing the right approach - Learn web development
previous overview: asynchronous to finish this module off, we'll provide a brief discussion of the different coding techniques and features we've discussed throughout, looking at which one you should use when, with recommendations and reminders of common pitfalls where appropriate.
Functions — reusable blocks of code - Learn web development
previous overview: building blocks next another essential concept in coding is functions, which allow you to store a piece of code that does a single task inside a defined block, and then call that code whenever you need it using a single short command — rather than having to type out the same code multiple times.
Image gallery - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Conditionals - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Events - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Functions - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Loops - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Drawing graphics - Learn web development
yes, using one of these means learning another new api (a third party one, in this case), but they are a lot simpler than coding raw webgl.
Client-side web APIs - Learn web development
note: if you are working on a device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
Silly story generator - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Arrays - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Math - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Strings - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: variables - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
JavaScript First Steps - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
Test your skills: Object-oriented JavaScript - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Test your skills: Object basics - Learn web development
this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
Introducing JavaScript objects - Learn web development
note: if you are working on a computer/tablet/other devices where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
Aprender y obtener ayuda - Learn web development
this sounds obvious, but it is easy to forget when you get really into coding.
Multimedia: Images - Learn web development
doesn't support progressive display and the image decoding is not hardware accellerated and therefore resource intensive on the browser's main thread.
Introduction to the server side - Learn web development
after reading this article you'll understand the additional power available to websites through server-side coding.
Server-side website programming first steps - Learn web development
after reading this article, you'll understand the additional power available to websites through server-side coding.
Server-side website programming - Learn web development
similarly, expertise in client-side coding is not required, but a basic knowledge will help you work better with the developers creating your client-side web "front end".
Framework main features - Learn web development
i'm sure you’re enthusiastic to get going and actually do some coding, and that's what you are going to do next!
Handling common accessibility problems - Learn web development
instead, it is more about making a reasonable effort to make as much of your content accessible to as many people as possible via defensive coding and sticking to best practices.
Introduction to cross browser testing - Learn web development
note: we'll cover defensive coding later in the module too.
Handling common JavaScript problems - Learn web development
in this case we are creating a modified audiocontext constructor, then creating a new audio context instance to use for our web audio coding.
Git and GitHub - Learn web development
however, it is recommended that you know some coding so that you have reasonable computer literacy, and some code to store in your repositories!
Introducing a complete toolchain - Learn web development
since this module is all about learning the tools around web development, not web development code itself, we won’t be teaching you any actual coding — you’ll find that information in the rest of mdn!
Mozilla's Section 508 Compliance
(i) color coding shall not be used as the only means of conveying information, indicating an action, prompting a response, or distinguishing a visual element.
Mozilla’s UAAG evaluation report
(p1) c uses standard keyboard api, works with a number of assistive technologies 6.7 api character encodings.
What to do and what not to do in Bugzilla
reports of problems with specific websites that result from bad coding practices already determined to be “tech evangelism” cases by the module owner or peer, or problems that result from the use of proprietary technology, should be be moved to the tech evangelism product rather than being resolved as invalid.
ESLint
this automatic linting can happen either while coding, in a code editor, or when using the command line.
Eclipse CDT Manual Setup
download this first pass at an eclipse formatter configuration for mozilla c/c++ coding style, and install it by opening the workspace preferences, selecting "c/c++ > code style > formatter", and then using the "import" button to import that file.
Performance best practices for Firefox front-end engineers
indexeddb is also arguably better than storing and retrieving json from a file—particularly if the json encoding or decoding is occurring on the main thread.
mozbrowsererror
possible values are: fatal(crash) unknownprotocolfound filenotfound dnsnotfound connectionfailure netinterrupt nettimeout cspblocked phishingblocked malwareblocked unwantedblocked offline malformeduri redirectloop unknownsockettype netreset notcached isprinting deniedportaccess proxyresolvefailure proxyconnectfailure contentencodingfailure remotexul unsafecontenttype corruptedcontenterror certerror other example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsererror", function( event ) { console.log("an error occurred:" + event.detail); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsericonchange mozbrowserloadend mozbrowse...
How Mozilla determines MIME Types
however, starting in mozilla 1.7alpha, mozilla does do content sniffing, like this: when the content-type sent by the server is one of (case-sensitively) text/plain text/plain; charset=iso-8859-1 text/plain; charset=iso-8859-1 and the server did not send a content-encoding header, mozilla will sniff the first block of data it gets and check for non-text bytes.
JNI.jsm
astr a javascript string, use any encoding desired.
NetUtil.jsm
options the aoptions parameter is a javascript object which can have any or all of the following fields: field name description charset the character encoding to use when interpreting the input stream.
Application Translation with Mercurial
c:\mozilla\coding\buildtools\mozillabuild\start-shell-msvc2010.bat you can autocomplete the file path after typing a few characters and then pressing the tabulator key.
Index
3 bootstrapping a new locale localization, mercurial, translate, bit bucket (see also https://developer.mozilla.org/en/create_a_new_localization) 4 encodings for localization files internationalization, localization when creating a localization for mozilla products, it’s important to be aware of the encoding of the files that you generate.
Localizing extension descriptions
make sure to use utf-8 encoding (without bom) to ensure foreign characters display correctly.
Localization sign-off reviews
encoding some tools add bom to utf-8 encoded files, and some change the encoding altogether.
Localization technical reviews
there should not be any utf-7 encodings in the file toolkit/chrome/global/intl.properties.
gettext
# #, fuzzy msgid "" msgstr "" "project-id-version: package version\n" "report-msgid-bugs-to: \n" "pot-creation-date: 2009-09-28 16:18+0200\n" "po-revision-date: year-mo-da ho:mi+zone\n" "last-translator: full name <email@address>\n" "language-team: language <ll@li.org>\n" "mime-version: 1.0\n" "content-type: text/plain; charset=charset\n" "content-transfer-encoding: 8bit\n" "plural-forms: nplurals=integer; plural=expression;\n" #.
Patches and pushes
<searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"> <shortname>yahoo</shortname> <description>yahoo search</description> <inputencoding>utf-8</inputencoding> <image width="16" height="16">data:image/x-icon;base64,r0lgodlheaaqajecap8aaaaaap///waaach5baeaaaialaaaaaaqabaaaaipli+py+0nogquybdened2khkffwuamezmpzsfmaihphrrguum/ft+uwaaow==</image> ***this tag is optional***<url type="application/x-suggestions+json" method="get" template="http://ff.search.yahoo.com/gossip?output=fxjson&amp;command={searchterms}" />*** <url type="text...
PRIntervalTime
the proper coding style to test the expiration of an interval is as follows: if ((printervaltime)(now - epoch) > interval) <...
PR_SetLibraryPath
this allows an environment to express policy decisions globally and lazily, rather than hardcoding and distributing the decisions throughout the code.
An overview of NSS Internals
in addition to the freebl, softoken, and ckbi modules, there is an utility library for general operations (e.g., encoding/decoding between data formats, a list of standardized object identifiers (oid)).
JSS
MozillaProjectsNSSJSS
jss also provides a pure java interface for asn.1 types and ber/der encoding.
NSS_3.12.1_release_notes.html
caller chooses encoding rules.
NSS 3.21.4 release notes
bugs fixed in nss 3.21.4 bug 1344380 / out-of-bounds write in base64 encoding in nss (cve-2017-5461) bug 1345089 / drbg flaw in nss (cve-2017-5462) acknowledgements the nss development team would like to thank ronald crane and vladimir klebanov for responsibly disclosing the issues by providing advance copies of their research.
NSS 3.28.4 release notes
bugs fixed in nss 3.28.4 bug 1344380 / out-of-bounds write in base64 encoding in nss (cve-2017-5461) bug 1345089 / drbg flaw in nss (cve-2017-5462) bug 1342358 - crash in tls13_destroykeyshares acknowledgements the nss development team would like to thank ronald crane and vladimir klebanov for responsibly disclosing the issues by providing advance copies of their research.
NSS 3.29.5 release notes
bugs fixed in nss 3.29.5 bug 1344380 / out-of-bounds write in base64 encoding in nss (cve-2017-5461) bug 1345089 / drbg flaw in nss (cve-2017-5462) acknowledgements the nss development team would like to thank ronald crane and vladimir klebanov for responsibly disclosing the issues by providing advance copies of their research.
NSS 3.30.1 release notes
bugs fixed in nss 3.30.1 bug 1344380 / out-of-bounds write in base64 encoding in nss (cve-2017-5461) acknowledgements the nss development team would like to thank ronald crane for responsibly disclosing the issue by providing advance copies of their research.
NSS 3.31 release notes
corrected the encoding of domain name constraints extensions created by certutil nss supports a clean seeding mechanism for *nix systems now using only /dev/urandom.
NSS 3.39 release notes
starting with version 3.39, nss requires the encoding to contain the null parameter.
NSS 3.54 release notes
bug 1646520 - stricter enforcement of asn.1 integer encoding.
NSS Developer Tutorial
nss coding style formatting line length should not exceed 80 characters.
NSS Sample Code Sample1
// - the application sends or uses the result (possibly // after base64 encoding it.
NSS Sample Code Utilities_1
this code shows the following: extract seed from noise file read der encoding from a file extract the password from a text file get the module password print as ascii or hexadecimal sample code #include <prlog.h> #include <termios.h> #include <base64.h> #include <unistd.h> #include <sys/stat.h> #include <prprf.h> #include "util.h" /* * these utility functions are adapted from those found in * the sectool library used by the nss security tools and * other nss test applications.
nss tech note4
} } an example custom cert extension struct _mycertextdata { secitem version; secitem streetaddress; secitem phonenum; secitem rfc822name; secitem id; secitem maxusers; }; typedef struct _mycertextdata mycertextdata; /* template used for decoding the extension */ const sec_asn1template mycertexttemplate[] = { { sec_asn1_sequence, 0, null, sizeof( mycertextdata ) }, { sec_asn1_integer, offsetof(mycertextdata, version) }, { sec_asn1_octet_string, offsetof( mycertextdata, streetaddress ) }, { sec_asn1_octet_string, offsetof( mycertextdata, phonenum ) }, { sec_asn1...
NSS_3.12.3_release_notes.html
bug 426413: audit messages need distinct types bug 438870: free freebl hashing code of dependencies on nspr and libutil bug 439115: db merge allows nickname conflicts in merged db bug 439199: sse2 instructions for bignum are not implemented on windows 32-bit bug 441321: tolerate incorrect encoding of dsa signatures in ssl 3.0 handshakes bug 444404: libpkix reports unknown issuer for nearly all certificate errors bug 452391: certutil -k incorrectly reports ec private key as an orphan bug 453234: support for seed cipher suites to tls rfc4010 bug 453364: improve pk11_cipherop error reporting (was: pk11_createcontextbysymkey returns null bug 456406: slot list leaks in symkeyutil bu...
NSS Tools certutil
-r display a certificate's binary der encoding when listing information about that certificate with the -l option.
certutil
-r display a certificate's binary der encoding when listing information about that certificate with the -l option.
Network Security Services
coding style, maintaining abi compatibility.
Bytecode Descriptions
jsop::zero, jsop::one, jsop::int8, jsop::uint16, and jsop::uint24 are all compact encodings for jsop::int32.
Invariants
(the jsval encoding depends on this.) the jsstackframe::down chain never forms a cycle.
SpiderMonkey Internals
each property has an id, either a nonnegative integer or an atom (unique string), with the same tagged-pointer encoding as a jsval.
JSVAL_TO_INT
the jsval encoding of the integer 4, for instance, is not ((jsval) 4) but some other pattern of bits.
JS_CStringsAreUTF8
api users should switch to functions which take utf-8 explicitly or handle their own string encoding and decoding.
JSAPI reference
spidermonkey 1.8.5 js_flatstringequalsascii added in spidermonkey 1.8.5 js_stringhaslatin1chars added in spidermonkey 38 js_getstringcharat added in spidermonkey 38 js_getflatstringcharat added in spidermonkey 38 js_getstringlength js_encodestring added in spidermonkey 1.8 js_encodestringtoutf8 added in spidermonkey 24 js_encodestringtobuffer added in spidermonkey 1.8.5 js_getstringencodinglength added in spidermonkey 1.8.5 js_getlatin1flatstringchars added in spidermonkey 38 js_gettwobyteflatstringchars added in spidermonkey 38 js_getlatin1stringcharsandlength added in spidermonkey 38 js_gettwobytestringcharsandlength added in spidermonkey 38 js::getdeflatedutf8stringlength added in spidermonkey 38 js::deflatestringtoutf8buffer added in spidermonkey 38 js_fileescapedstrin...
SpiderMonkey: The Mozilla JavaScript runtime
tips, tricks and philosophy future directions future directions for functionality, design, and coding practices.
Redis Tips
you can be clever and sneak extra data in by encoding something else after the decimal.
Setting up an update server
<?xml version="1.0" encoding="utf-8"?> <updates> <update type="minor" displayversion="2000.0a1" appversion="2000.0a1" platformversion="2000.0a1" buildid="21181002100236"> <patch type="complete" url="http://127.0.0.1:8000/<mar name>" hashfunction="sha512" hashvalue="<hash>" size="<size>"/> </update> </updates> if you've downloaded the mar you're using, you'll find the sha512 value in a file called sha512sums ...
Animated PNG graphics
MozillaTechAPNG
frame timings should be independent of the time required for decoding and display of each frame, so that animations will run at the same rate regardless of the performance of the decoder implementation.
Using the Places history service
you should not count on this format, always use this function instead of hard-coding your own query strings.
Creating the Component Code
coding for the registration process when xpcom discovers your component for the first time (via xpinstall or regxpcom, both of which are discussed in component installation overview), the first thing it tries to do is load your library and find the symbol nsgetmodule.
Using XPCOM Utilities to Make Things Easier
« previousnext » this chapter goes back over the code you've already created in the first part of the tutorial (see weblock1.cpp in the previous chapter) and uses xpcom tools that make coding a lot easier and more efficient.
Creating XPCOM components
autoregistration the shutdown process three parts of a xpcom component library xpcom glue the glue library xpcom string classes creating the component code what we'll be working on component registration the regxpcom program registration alternatives overview of the weblock module source digging in: required includes and constants identifiers in xpcom coding for the registration process the registration methods creating an instance of your component weblock1.cpp using xpcom utilities to make things easier xpcom macros generic xpcom module macros common implementation macros declaration macros weblock2.cpp string classes in xpcom using strings nsembedstring and nsembedcstring smart pointers starting weblock ...
Inheriting from implementation classes
see also dbaron's coding practices nsisupportsimpl.h comments author ben bucksch.
NS_NewNativeLocalFile
this string should be encoded using ascii or the multibyte character coding corresponding to the native filesystem.
XPCOM glue classes
is utility class simplifies managing xpcom interface references from c++ code.nscountedrefnscountedref<t> is a template class implementing an object that takes a strong reference to a reference-counted resource that must be released, typically on destruction of the object.</t>nscstringclass declarationnscstring externalclass declarationnscstringcontainer (external)class declaration nscstringencodingthe nscstringencoding enumeration describes the set of character encodings understood by the ns_cstringtoutf16 and ns_utf16tocstring functions.nsdependentcstringclass declarationnsdependentcstring externalclass declarationnsdependentcsubstringclass declarationnsdependentcsubstring externalclass declarationnsdependentstringclass declarationnsdependentstring externalclass declarationnsdependentsubst...
imgIEncoder
remarks for encoding images which may contain multiple frames, the 1-shot initfromdata() interface is too simplistic.
mozIStorageStatementParams
for example, say you create a statement like so: var statement = dbconn.createstatement("select * from table_name where id = :item_id"); this object would have one property, item_id, that you can use to bind a value to that named parameter like so: statement.params.item_id = 2; for more details on why you should bind parameters as opposed to hard-coding them into your statement, please see the overview document about binding parameters.
nsIDOMSerializer
charset the name of the character set to use for the encoding to a byte stream.
nsIDirIndex
this is encoded with the encoding specified in the nsidirindexparser, and is also escaped.
nsIDirIndexParser
encoding string the encoding to use.
nsIFeedContainer
keep in mind that some feeds have no title, and some use markup in their titles, so be cautious when decoding this attribute.
nsILocale
nsilocale_messages - related to fonts, character encodings and so on.
Building an Account Manager Extension
<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href="chrome://messenger/skin/accountmanage.css" type="text/css"?> <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="parent.onpanelloaded('am-devmo-account.xul');"> <script type="application/javascript" src="chrome://messenger/content/accountmanager.js"/> <script type="application/javascript" src="chrome://example@mozilla.o...
nsIMsgCompFields
rbool bcc astring body astring bodyisasciionly prbool cc astring characterset char * defaultcharacterset char * readonly drafid char * dsn prbool fcc astring fcc2 astring followupto char * forcemsgencoding prbool forceplaintext prbool from astring hasrecipients prbool readonly new in thunderbird 23 indicates whether something is filled in in the to, cc, or bcc attribute.
nsIWebNavigation
load_flags_charset_change 1024 this flag specifies that a reload was triggered as a result of detecting an incorrect character encoding while parsing a previously loaded document.
nsIXMLHttpRequest
the 'onload', 'onerror', and 'onreadystatechange' attributes moved to nsijsxmlhttprequest, but if you're coding in c++ you should avoid using those.
NS_CStringContainerInit2
it is generally better to use one of the helper classes, such as nscstring, instead of coding directly to ns_cstringcontainerinit2 because those classes take care of cleaning up the string object when it goes out of scope.
XPCOM string functions
this is a low-level api.ns_utf16tocstringthe ns_utf16tocstring function converts the value of a nsastring instance from utf-16 to the specified multi-byte encoding and stores the result in a nsacstring instance.
Storage
return transaction.commit(); } collation (sorting) sqlite provides several collation methods (binary, nocase, and rtrim), but these are all very simple and have no support for various text encodings or the user's locale.
Address book sync client design
the general architecture for the sync component is the following: mozilla ui ab sync logic mork ab database sync protocol encoding sync protocol decoding http "post" api mozilla networking client side sync logic the client synchronization logic defers to the server peforming some intelligence in handling duplicate entries for the sync process.
Filter Incoming Mail
by example, setting it to lower case subject = subject.tolocalelowercase(); // then we rebuild a subject objet by rencoding the string // and assign it to the message headers and we're done amsghdr.subject = mimeconvert.encodemimepartiistr_utf8(subject, false, "utf-8", 0, 72); } } }; function init() { var notificationservice = components.classes["@mozilla.org/messenger/msgnotificationservice;1"] .getservice(components.interfaces.nsimsgfoldernotificationservice); notificationservice.addl...
customDBHeaders Preference
chrome.manifest \ chrome/content/ \ chrome/content/superfluous.js \ chrome/content/superfluous_overlay.xul \ install.rdf superfluous.xpi: ${deps} zip $@ ${deps} chrome.manifest: content superfluous chrome/content/ overlay chrome://messenger/content/messenger.xul chrome://superfluous/content/superfluous_overlay.xul install.rdf: <?xml version='1.0' encoding='utf-8'?> <rdf xmlns='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:em='http://www.mozilla.org/2004/em-rdf#'> <description about='urn:mozilla:install-manifest'> <em:id>superfluous@yoursite.com</em:id> <em:version>0.1.1</em:version> <em:type>2</em:type> <!-- 2 is type 'extension' --> <em:targetapplication> <description> <!-- this next line ident...
Add to iPhoto
the string can be stored in any of a number of encodings, so you use assorted functions that know how to cope with different encodings to set and get values of cfstrings, as well as to perform typical string operations.
Working with data
if you need a utf-16 string, you can do this: var myutf16string = ctypes.jschar.array()("original string."); note: at this time, there's no way to specify a particular encoding; you may only retrieve the string in utf-8 or utf-16 as shown above.
Mozilla
developer guide there are lots of ways to contribute to the mozilla project: coding, testing, improving the build process and tools, or contributing to the documentation.
Plug-in Basics - Plugins
this guide notes platform-specific differences in coding for the ms windows, mac os x, and unix platforms.
View Source - Firefox Developer Tools
among the errors that don't get reported: bytes that are illegal according to the document's encoding aren't marked as errors.
AudioBufferSourceNode.loop - Web APIs
st.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // wire up buttons to stop and play audio, and range slider control play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); playbackcontrol.removeattribute('disabled'); } specification specification status comment web audio apithe definition of 'loop' in that specifi...
AudioBufferSourceNode.loopEnd - Web APIs
fer = buffer; songlength = buffer.duration; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; loopstartcontrol.setattribute('max', math.floor(songlength)); loopendcontrol.setattribute('max', math.floor(songlength)); }, function(e){"error with decoding audio data" + e.err}); } request.send(); } ...
AudioBufferSourceNode.loopStart - Web APIs
fer = buffer; songlength = buffer.duration; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; loopstartcontrol.setattribute('max', math.floor(songlength)); loopendcontrol.setattribute('max', math.floor(songlength)); }, function(e){"error with decoding audio data" + e.err}); } request.send(); } ...
AudioBufferSourceNode.playbackRate - Web APIs
st.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // wire up buttons to stop and play audio, and range slider control play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); playbackcontrol.removeattribute('disabled'); } stop.onclick = function() { source.stop(0); play.removeattribute('disabled'); playbackcontrol.setattribute('disabled', ...
AudioContext.createMediaStreamDestination() - Web APIs
<!doctype html> <html> <head> <title>createmediastreamdestination() demo</title> </head> <body> <h1>createmediastreamdestination() demo</h1> <p>encoding a pure sine wave to an opus file </p> <button>make sine wave</button> <audio controls></audio> <script> var b = document.queryselector("button"); var clicked = false; var chunks = []; var ac = new audiocontext(); var osc = ac.createoscillator(); var dest = ac.createmediastreamdestination(); var mediarecorder = new mediarecorder(dest.stream); osc...
AudioContext - Web APIs
an audio context controls both the creation of the nodes it contains and the execution of the audio processing, or decoding.
AudioProcessingEvent - Web APIs
audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingevent) { // the input buffer is the song we loaded earlier var inputbuffer = audioprocessingevent.inputbuffer; // the output buffer contains the samples that will be modified and played var outputbuffer = audioprocessingevent.outputbuffer...
AuthenticatorAttestationResponse.attestationObject - Web APIs
syntax attestobj = authenticatorattestationresponse.attestationobject properties after decoding the cbor encoded arraybuffer, the resulting javascript object will contain the following properties: authdata the same as authenticatorassertionresponse.authenticatordata.
AuthenticatorResponse.clientDataJSON - Web APIs
it has two properties: status: a string which is either "supported" which indicates the client support token binding but did not negotiate with the relying party or "present" when token binding was used already id: a domstring which is the base64url encoding of the token binding id which was used for the communication.
BaseAudioContext.createBuffer() - Web APIs
note: createbuffer() used to be able to take compressed data and give back decoded samples, but this ability was removed from the spec, because all the decoding was done on the main thread, therefore createbuffer() was blocking other code execution.
BaseAudioContext.createConvolver() - Web APIs
equest(); ajaxrequest.open('get', 'concert-crowd.ogg', true); ajaxrequest.responsetype = 'arraybuffer'; ajaxrequest.onload = function() { var audiodata = ajaxrequest.response; audioctx.decodeaudiodata(audiodata, function(buffer) { concerthallbuffer = buffer; soundsource = audioctx.createbuffersource(); soundsource.buffer = concerthallbuffer; }, function(e){"error with decoding audio data" + e.err}); } ajaxrequest.send(); ...
BaseAudioContext.createScriptProcessor() - Web APIs
audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingevent) { // the input buffer is the song we loaded earlier var inputbuffer = audioprocessingevent.inputbuffer; // the output buffer contains the samples that will be modified and played var outputbuffer = audioprocessingevent.outputbuffer...
Beacon API - Web APIs
not only do these techniques represent poor coding patterns, some of them are unreliable and result in the perception of poor page load performance for the next navigation.
Blob.text() - Web APIs
WebAPIBlobtext
blob.text() always uses utf-8 as encoding, while filereader.readastext() can use a different encoding depending on the blob's type and a specified encoding name.
A basic ray-caster - Web APIs
not exactly a new member of the id software family, but pretty decent considering it's a fully interpreted environment, and i didn't have to worry about memory allocation or video modes or coding inner routines in assembler or anything.
ConvolverNode.buffer - Web APIs
equest(); ajaxrequest.open('get', 'concert-crowd.ogg', true); ajaxrequest.responsetype = 'arraybuffer'; ajaxrequest.onload = function() { var audiodata = ajaxrequest.response; audioctx.decodeaudiodata(audiodata, function(buffer) { concerthallbuffer = buffer; soundsource = audioctx.createbuffersource(); soundsource.buffer = concerthallbuffer; }, function(e){"error with decoding audio data" + e.err}); } ajaxrequest.send(); ...
ConvolverNode.normalize - Web APIs
equest(); ajaxrequest.open('get', 'concert-crowd.ogg', true); ajaxrequest.responsetype = 'arraybuffer'; ajaxrequest.onload = function() { var audiodata = ajaxrequest.response; audioctx.decodeaudiodata(audiodata, function(buffer) { concerthallbuffer = buffer; soundsource = audioctx.createbuffersource(); soundsource.buffer = concerthallbuffer; }, function(e){"error with decoding audio data" + e.err}); } ajaxrequest.send(); ...
DOMException - Web APIs
(legacy code value: 25 and legacy constant name: data_clone_err) encodingerror the encoding or decoding operation failed (no legacy code value and constant name).
DedicatedWorkerGlobalScope - Web APIs
for example: importscripts('foo.js', 'bar.js'); implemented from other places windowbase64.atob() decodes a string of data which has been encoded using base-64 encoding.
FileError - Web APIs
WebAPIFileError
constant value description encoding_err 5 the url is malformed.
FileException - Web APIs
constant value description encoding_err 5 the url is malformed.
FileReader - Web APIs
an optional encoding name can be specified.
FileReaderSync.readAsArrayBuffer() - Web APIs
encodingerror is raised when the resource is a data url and exceed the limit length defined by each browser.
FileReaderSync.readAsBinaryString() - Web APIs
encodingerror is raised when the resource is a data url and exceed the limit length defined by each browser.
FileReaderSync.readAsDataURL() - Web APIs
encodingerror is raised when the resource is a data url and exceed the limit length defined by each browser.
FileReaderSync - Web APIs
the optional encoding parameter indicates the encoding to be used (e.g., iso-8859-1 or utf-8).
Using FormData Objects - Web APIs
the transmitted data is in the same format that the form's submit() method would use to send the data if the form's encoding type were set to multipart/form-data.
FormData - Web APIs
WebAPIFormData
it uses the same format a form would use if the encoding type were set to "multipart/form-data".
HTMLAnchorElement - Web APIs
obsolete properties htmlanchorelement.charset is a domstring representing the character encoding of the linked resource.
HTMLFormElement.acceptCharset - Web APIs
the htmlformelement.acceptcharset property represents a list of the supported character encodings for the given <form> element.
HTMLLinkElement - Web APIs
obsolete properties htmllinkelement.charset is a domstring representing the character encoding for the target resource.
HTMLMediaElement: timeupdate event - Web APIs
user agents are encouraged to vary the frequency of the event based on the system load and the average cost of processing the event each time, so that the ui updates are not any more frequent than the user agent can comfortably handle while decoding the video.
HTMLScriptElement - Web APIs
htmlscriptelement.charset is a domstring representing the character encoding of an external script.
Using microtasks in JavaScript with queueMicrotask() - Web APIs
it starts by encoding it as json using the json.stringify() method.
Headers.append() - Web APIs
WebAPIHeadersappend
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.
Headers.get() - Web APIs
WebAPIHeadersget
t('not-set'); // returns null you could add a header to this using headers.append, then retrieve it using get(): myheaders.append('content-type', 'image/jpeg'); myheaders.get('content-type'); // returns "image/jpeg" if the header has multiple values associated with it, the byte string will contain all the values, in the order they were added to the headers object: myheaders.append('accept-encoding', 'deflate'); myheaders.append('accept-encoding', 'gzip'); myheaders.get('accept-encoding'); // returns "deflate,gzip" note: headers.getall used to have this functionality, with headers.get returning only the first value added to the headers object.
Headers.getAll() - Web APIs
WebAPIHeadersgetAll
ders(); // currently empty you could add a header to this using headers.append, then retrieve it using getall(): myheaders.append('content-type', 'image/jpeg'); myheaders.getall('content-type'); // returns [ "image/jpeg" ] if the header has multiple values associated with it, the array will contain all the values, in the order they were added to the headers object: myheaders.append('accept-encoding', 'deflate'); myheaders.append('accept-encoding', 'gzip'); myheaders.getall('accept-encoding'); // returns [ "deflate", "gzip" ] note: use headers.get to return only the first value added to the headers object.
Headers.has() - Web APIs
WebAPIHeadershas
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.
Headers.set() - Web APIs
WebAPIHeadersset
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.
LocalFileSystem - Web APIs
returns void exceptions this method can raise an fileerror with the following code: exception description encoding_err the syntax of the url was invalid.
LocalFileSystemSync - Web APIs
exceptions this method can raise a fileexception with the following codes: exception description encoding_err the syntax of the url was invalid.
MediaCapabilitiesInfo - Web APIs
the interface of the promise returned by the the mediacapabilities's encodinginfo() and decodinginfo() methods returning whether the media configuration tested is supported, smooth, and powerefficient.
MediaError.message - Web APIs
.onerror = function() { let s = ""; let err = audioelement.error; switch(err.code) { case mediaerror.media_err_aborted: s += "the user canceled the audio."; break; case mediaerror.media_err_network: s+= "a network error occurred while fetching the audio."; break; case mediaerror.media_err_decode: s+= "an error occurred while decoding the audio."; break; case mediaerror.media_err_src_not_supported: s+= "the audio is missing or is in a format not supported by your browser."; break; default: s += "an unknown error occurred."; break; } let message = err.message; if (message && message.length) { s += " " + message; } displayerrormessage("<strong>error...
MediaRecorder.audioBitsPerSecond - Web APIs
the audiobitspersecond read-only property of the mediarecorder interface returns the audio encoding bit rate in use.
MediaRecorder.isTypeSupported - Web APIs
recording may still fail if there are insufficient resources to support the recording and encoding process.
MediaRecorder.videoBitsPerSecond - Web APIs
the videobitspersecond read-only property of the mediarecorder interface returns the video encoding bit rate in use.
MediaSource.endOfStream() - Web APIs
when you make an xmlhttprequest call for a media chunk, and onabort or onerror triggers, you might want to call endofstream('network'), display a descriptive message in the ui, and maybe retry the network request immediately or wait until the network is back up (via some kind of polling.) decode: terminates playback and signals that a decoding error has occured.
Using the MediaStream Recording API - Web APIs
this is your entry point into using the mediarecorder api — the stream is now ready to be captured into a blob, in the default encoding format of your browser.
NDEFRecord - Web APIs
ndefrecord.encoding read only represents the encoding name used for encoding the payload in the case it is textual data.
Navigator - Web APIs
WebAPINavigator
navigator.locks read only returns a lockmanager object which provides methods for requesting a new lock object and querying for an existing lock object navigator.mediacapabilities read only returns a mediacapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities.
NotifyAudioAvailableEvent - Web APIs
properties framebuffer read only a float32array containing the raw 32-bit floating-point audio data obtained from decoding the audio (e.g., the raw data being sent to the audio hardware vs.
PublicKeyCredential - Web APIs
publickeycredential.id read only secure context inherited from credential and overridden to be the base64url encoding of publickeycredential.rawid.
PushManager - Web APIs
properties pushmanager.supportedcontentencodings returns an array of supported content codings that can be used to encrypt the payload of a push message.
RTCInboundRtpStreamStats.pliCount - Web APIs
this may trigger the sender to send a full frame in order to allow the receiver to re-synchronize, since lost data may be an irrecoverable situation for decoding media.
RTCOutboundRtpStreamStats.qualityLimitationReason - Web APIs
the qualitylimitationreason property of the rtcoutboundrtpstreamstats dictionary is a string indicating the reason why the media quality in the stream is currently being reduced by the codec during encoding, or none if no quality reduction is being performed.
RTCOutboundRtpStreamStats - Web APIs
totalencodetime a floating-point value indicating the total number of seconds that have been spent encoding the frames encoded so far by this rtcrtpsender.
RTCPeerConnection.getReceivers() - Web APIs
each rtp receiver manages the reception and decoding of data for a mediastreamtrack on an rtcpeerconnection syntax var receivers = rtcpeerconnection.getreceivers(); return value an array of rtcrtpreceiver objects, one for each track on the connection.
RTCPeerConnection.getSenders() - Web APIs
a sender object provides methods and properties for examining and controlling the encoding and transmission of the track's data.
RTCPeerConnection - Web APIs
each rtp receiver manages the reception and decoding of data for a mediastreamtrack on an rtcpeerconnectiongetsenders()the rtcpeerconnection method getsenders() returns an array of rtcrtpsender objects, each of which represents the rtp sender responsible for transmitting one track's data.getstats()the rtcpeerconnection method getstats() returns a promise which resolves with data providing statistics about either the overall connection or about the ...
RTCRtpReceiver.getParameters() - Web APIs
the getparameters() method of the rtcrtpreceiver interface returns an rtcrtpreceiveparameters object describing the current configuration for the encoding and transmission of media on the receiver's track.
RTCRtpReceiver - Web APIs
the rtcrtpreceiver interface of the webrtc api manages the reception and decoding of data for a mediastreamtrack on an rtcpeerconnection.
RTCRtpSender.getParameters() - Web APIs
the getparameters() method of the rtcrtpsender interface returns an rtcrtpsendparameters object describing the current configuration for the encoding and transmission of media on the sender's track.
RTCRtpStreamStats.pliCount - Web APIs
this may trigger the sender to send a full frame in order to allow the receiver to re-synchronize, since lost data may be an irrecoverable situation for decoding media.
RTCRtpStreamStats - Web APIs
a fir packet is sent by the receiving end of the stream when it falls behind or has lost packets and is unable to continue decoding the stream; the sending end of the stream receives the fir packet and responds by sending a full frame instead of a delta frame, thereby letting the receiver "catch up." the higher this number is, the more often a problem of this nature arose, which can be a sign of network congestion or an overburdened receiving device.
RTCRtpTransceiver.sender - Web APIs
the read-only sender property of webrtc's rtcrtptransceiver interface indicates the rtcrtpsender responsible for encoding and sending outgoing media data for the transceiver's stream.
SVGGraphicsElement: copy event - Web APIs
example html <?xml version="1.0" encoding="utf-8"?> <svg viewbox="0 0 100 30" width="600" height="320" xmlns="http://www.w3.org/2000/svg"> <text x="5" y="10" id="text-to-copy">copy this text</text> <foreignobject x="5" y="20" width="90" height="20"> <input xmlns="http://www.w3.org/1999/xhtml" placeholder="paste it here"/> </foreignobject> </svg> css input { font-size: 10px; width: 100%; height: 90%; box-sizi...
SVGGraphicsElement: paste event - Web APIs
example html <?xml version="1.0" encoding="utf-8"?> <svg viewbox="0 0 140 30" width="600" height="320" xmlns="http://www.w3.org/2000/svg"> <foreignobject x="5" y="-10" width="90" height="20"> <input xmlns="http://www.w3.org/1999/xhtml" value="copy this text"/> </foreignobject> <text x="5" y="30" id="element-to-paste-text" tabindex="1">paste it here</text> </svg> css input { font-size: 10px; width: 100%; height...
SVGImageElement.decode - Web APIs
the decode() method of the svgimageelement interface initiates asynchronous decoding of an image, returning a promise that resolves once the image data is ready for use.
ScriptProcessorNode.bufferSize - Web APIs
an audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingevent) { // the input buffer is the song we loaded earlier var inputbuffer = audioprocessingevent.inputbuffer; // the output buffer contains the samples that will be modified and played var outputbuffer = audioprocessingevent.outputbuffer...
ScriptProcessorNode.onaudioprocess - Web APIs
audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingevent) { // the input buffer is the song we loaded earlier var inputbuffer = audioprocessingevent.inputbuffer; // the output buffer contains the samples that will be modified and played var outputbuffer = audioprocessingevent.outputbuffer...
ScriptProcessorNode - Web APIs
an audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingevent) { // the input buffer is the song we loaded earlier var inputbuffer = audioprocessingevent.inputbuffer; // the output buffer contains the samples that will be modified and played var outputbuffer = audioprocessingevent.outputbuffer...
SharedWorkerGlobalScope - Web APIs
for example: importscripts('foo.js', 'bar.js'); implemented from other places windowbase64.atob() decodes a string of data which has been encoded using base-64 encoding.
SourceBuffer.abort() - Web APIs
in this case you would want to manually call abort() on the source buffer to stop the decoding of the current buffer, then fetch and append the newly requested segment that relates to the current new position of the video.
SubtleCrypto.importKey() - Web APIs
der is a set of rules for encoding asn.1 structures into a binary form.
TextDecoder.prototype.decode() - Web APIs
pt const encoder = new textencoder(); const array = encoder.encode('€'); // uint8array(3) [226, 130, 172] document.getelementbyid('encoded-value').textcontent = array; const decoder = new textdecoder(); const str = decoder.decode(array); // string "€" document.getelementbyid('decoded-value').textcontent = str; result specifications specification status comment encodingthe definition of 'textdecoder.decode()' in that specification.
TextEncoder.prototype.encode() - Web APIs
ample paragraph.</p> <p class="result">encoded result: </p> const sourcepara = document.queryselector('.source'); const resultpara = document.queryselector('.result'); const string = sourcepara.textcontent; const textencoder = new textencoder(); let encoded = textencoder.encode(string); resultpara.textcontent += encoded; specifications specification status comment encodingthe definition of 'textencoder.prototype.encode()' in that specification.
VideoPlaybackQuality.droppedVideoFrames - Web APIs
frames are typically dropped either before or after decoding them, when it's determined that it will not be possible to draw them to the screen at the correct time.
WebGL: 2D and 3D graphics for the web - Web APIs
WebAPIWebGL API
philogl is a webgl framework for data visualization, creative coding, and game development.
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
these correspond to the following three types of transport supported by rtcpeerconnection: rtcrtpsender rtcrtpsenders handle the encoding and transmission of mediastreamtrack data to a remote peer.
WebXR performance guide - Web APIs
you're now protected from several possible coding mistakes, and your entire animation will be smoother and more performant as well.
Functions and classes available to Web Workers - Web APIs
40 (40) no support (yes) no support textencoder and textdecoder create and return a new textencoder, or respectively textdecoder, allowing to encode or decode strings into specific encodings.
Window - Web APIs
WebAPIWindow
windoworworkerglobalscope.atob() decodes a string of data which has been encoded using base-64 encoding.
WindowOrWorkerGlobalScope.atob() - Web APIs
the windoworworkerglobalscope.atob() function decodes a string of data which has been encoded using base64 encoding.
WindowOrWorkerGlobalScope.btoa() - Web APIs
in javascript strings are represented using the utf-16 character encoding: in this encoding, strings are represented as a sequence of 16-bit (2 byte) units.
WindowOrWorkerGlobalScope - Web APIs
windoworworkerglobalscope.atob() decodes a string of data which has been encoded using base-64 encoding.
WorkerGlobalScope - Web APIs
methods implemented from elsewhere windoworworkerglobalscope.atob() decodes a string of data which has been encoded using base-64 encoding.
Sending and Receiving Binary Data - Web APIs
you will need a png decoding library for that.
XMLHttpRequest.getAllResponseHeaders() - Web APIs
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).
ARIA - Accessibility
videos following talks are a great way to understand aria: aria, accessibility apis and coding like you give a damn!
Cognitive accessibility - Accessibility
define abbreviations abbreviations can be confusing for people who: have difficulty decoding words.
Guide to Web APIs - Developer guides
WebGuideAPI
web apis from a to z aambient light eventsbbackground tasksbattery api beaconbluetooth apibroadcast channel apiccss counter stylescss font loading api cssomcanvas apichannel messaging apiconsole apicredential management apiddomeencoding apiencrypted media extensionsffetch apifile system api frame timing apifullscreen apiggamepad api geolocation apihhtml drag and drop apihigh resolution timehistory apiiimage capture apiindexeddbintersection observer apillong tasks api mmedia capabilities api media capture and streamsmedia session apimedia source extensions mediastream recordingnnavigation timingnetwork information api ppage...
XHTML - Developer guides
WebGuideHTMLXHTML
html document content-type: text/html <!doctype html> <html lang=en> <head> <meta charset=utf-8> <title>html</title> </head> <body> <p>i am a html document</p> </body> </html> xhtml document content-type: application/xhtml+xml <?xml version="1.0" encoding="utf-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>xhtml</title> </head> <body> <p>i am a xhtml document</p> </body> </html> in practice, very few "xhtml" documents are served over the web with a content-type: application/xhtml+xml header.
<a>: The Anchor element - HTML: Hypertext Markup Language
WebHTMLElementa
obsolete attributes charsetobsolete since html5 hinted at the character encoding of the linked url.
<link>: The External Resource Link element - HTML: Hypertext Markup Language
WebHTMLElementlink
obsolete attributes charset this attribute defines the character encoding of the linked resource.
<script>: The Script element - HTML: Hypertext Markup Language
WebHTMLElementscript
it’s unnecessary to specify the charset attribute, because documents must use utf-8, and the script element inherits its character encoding from the document.
MIME types (IANA media types) - HTTP
/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="mytextfield" test -----------------------------8721656041911415653955004498 content-disposition: form-data; name="...
Basics of HTTP - HTTP
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.
Browser detection using the user agent - HTTP
lastly, the above code snippets bring about a critical issue with cross-browser coding that must always be taken into account.
Cache-Control - HTTP
other no-transform an intermediate cache or proxy cannot edit the response body, content-encoding, content-range, or content-type.
Connection - HTTP
except for the standard hop-by-hop headers (keep-alive, transfer-encoding, te, connection, trailer, upgrade, proxy-authorization and proxy-authenticate), any hop-by-hop headers used by the message must be listed in the connection header, so that the first proxy knows it has to consume them and not forward them further.
Content-Disposition - HTTP
filename* the parameters filename and filename* differ only in that filename* uses the encoding defined in rfc 5987.
Content-Type - HTTP
charset the character encoding standard.
Keep-Alive - HTTP
examples a response containing a keep-alive header: http/1.1 200 ok connection: keep-alive content-encoding: gzip content-type: text/html; charset=utf-8 date: thu, 11 aug 2016 15:23:13 gmt keep-alive: timeout=5, max=1000 last-modified: mon, 25 jul 2016 04:32:39 gmt server: apache (body) specifications specification title http keep-alive header keep-alive header (ietf internet draft) rfc 7230, appendix a.1.2: keep-alive hypertext transfer protocol (http/1.1): m...
Save-Data - HTTP
with save-data: on request: get /image.jpg http/1.0 host: example.com save-data: on response: http/1.0 200 ok content-length: 102832 vary: accept-encoding, save-data cache-control: public, max-age=31536000 content-type: image/jpeg [...] without save-data request: get /image.jpg http/1.0 host: example.com response: http/1.0 200 ok content-length: 481770 vary: accept-encoding, save-data cache-control: public, max-age=31536000 content-type: image/jpeg [...] specifications specification title draft-grigorik-http-client-...
Server - HTTP
WebHTTPHeadersServer
however, exposed apache versions helped browsers work around a bug those versions had with content-encoding combined with range.
Set-Cookie - HTTP
encoding: many implementations perform url encoding on cookie values, however it is not required per the rfc specification.
Warning - HTTP
WebHTTPHeadersWarning
199 miscellaneous warning arbitrary, non-specific warning 214 transformation applied added by a proxy if it applies any transformation to the representation, such as changing the content-coding, media-type or the like.
HTTP Messages - HTTP
WebHTTPMessages
single-resource bodies, consisting of a single file of unknown length, encoded by chunks with transfer-encoding set to chunked.
Network Error Logging - HTTP
dress_unreachable the ip address is unreachable tcp.failed the tcp connection failed due to reasons not covered by previous errors http.error the user agent successfully received a response, but it had a 4xx or 5xx status code http.protocol.error the connection was aborted due to an http protocol error http.response.invalid response is empty, has a content-length mismatch, has improper encoding, and/or other conditions that prevent user agent from processing the response http.response.redirect_loop the request was aborted due to a detected redirect loop http.failed the connection failed due to errors in http protocol not covered by previous errors specifications specification network error logging ...
HTTP range requests - HTTP
comparison to chunked transfer-encoding the transfer-encoding header allows chunked encoding, which is useful when larger amounts of data are sent to the client and the total size of the response is not known until the request has been fully processed.
406 Not Acceptable - HTTP
WebHTTPStatus406
proactive content negotiation headers include: accept accept-charset accept-encoding accept-language in practice, this error is very rarely used.
411 Length Required - HTTP
WebHTTPStatus411
see transfer-encoding for more details.
415 Unsupported Media Type - HTTP
WebHTTPStatus415
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.
HTTP response status codes - HTTP
WebHTTPStatus
226 im used (http delta encoding) the server has fulfilled a get request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance.
Array.prototype.map() - JavaScript
let numbers = [1, 4, 9] let doubles = numbers.map(function(num) { return num * 2 }) // doubles is now [2, 8, 18] // numbers is still [1, 4, 9] using map generically this example shows how to use map on a string to get an array of bytes in the ascii encoding representing the character values: let map = array.prototype.map let a = map.call('hello world', function(x) { return x.charcodeat(0) }) // a now equals [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100] using map generically queryselectorall this example shows how to iterate through a collection of objects collected by queryselectorall.
Function.prototype.bind() - JavaScript
thankfully, these deviations from the specification rarely (if ever) come up in most coding situations.
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.
Object.create() - JavaScript
note that such a different order may arise statically via disparate fixed codings such as here, but also dynamically via whatever the order any such property-adding code-branches actually get executed at runtime as depends on inputs and/or random-variables.
String.prototype.charCodeAt() - JavaScript
the first 128 unicode code points are a direct match of the ascii character encoding.
String.prototype.codePointAt() - JavaScript
g.charcodeat(index); var second; if ( // check if it’s the start of a surrogate pair first >= 0xd800 && first <= 0xdbff && // high surrogate size > index + 1 // there is a next code unit ) { second = string.charcodeat(index + 1); if (second >= 0xdc00 && second <= 0xdfff) { // low surrogate // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae return (first - 0xd800) * 0x400 + second - 0xdc00 + 0x10000; } } return first; }; if (defineproperty) { defineproperty(string.prototype, 'codepointat', { 'value': codepointat, 'configurable': true, 'writable': true }); } else { string.prototype.codepointat = codepointat; } }()); } exampl...
String.fromCodePoint() - JavaScript
point clause handles decimals and negatives if (!(codepoint < 0x10ffff && (codepoint>>>0) === codepoint)) throw rangeerror("invalid code point: " + codepoint); if (codepoint <= 0xffff) { // bmp code point codelen = codeunits.push(codepoint); } else { // astral code point; split in surrogate halves // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae codepoint -= 0x10000; codelen = codeunits.push( (codepoint >> 10) + 0xd800, // highsurrogate (codepoint % 0x400) + 0xdc00 // lowsurrogate ); } if (codelen >= 0x3fff) { result += stringfromcharcode.apply(null, codeunits); codeunits.length = 0; } } return result + string...
WebAssembly.CompileError() constructor - JavaScript
the webassembly.compileerror() constructor creates a new webassembly compileerror object, which indicates an error during webassembly decoding or validation.
WebAssembly.CompileError - JavaScript
the webassembly.compileerror object indicates an error during webassembly decoding or validation.
WebAssembly - JavaScript
constructor properties webassembly.compileerror() indicates an error during webassembly decoding or validation.
decodeURI() - JavaScript
examples decoding a cyrillic url decodeuri('https://developer.mozilla.org/ru/docs/javascript_%d1%88%d0%b5%d0%bb%d0%bb%d1%8b'); // "https://developer.mozilla.org/ru/docs/javascript_шеллы" catching errors try { var a = decodeuri('%e0%a4%a'); } catch(e) { console.error(e); } // urierror: malformed uri sequence specifications specification ecmascript (ecma-262)the definition of 'd...
decodeURIComponent() - JavaScript
examples decoding a cyrillic url component decodeuricomponent('javascript_%d1%88%d0%b5%d0%bb%d0%bb%d1%8b'); // "javascript_шеллы" catching errors try { var a = decodeuricomponent('%e0%a4%a'); } catch(e) { console.error(e); } // urierror: malformed uri sequence decoding query parameters from a url decodeuricomponent cannot be used directly to parse query parameters from a url.
Lexical grammar - JavaScript
it represents a code unit in the utf-16 encoding.
Authoring MathML - MathML
for example, the xhtml version of the previous example looks like this: <?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.1 plus mathml 2.0//en" "http://www.w3.org/math/dtd/mathml2/xhtml-math11-f.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>xhtml+mathml example</title> </head> <body> <h1>xhtml+mathml example</h1> <p> square root of two: <math xmlns="http://www.w3.org/1998/math/mathml"> <msqrt> <mn>2</mn> </msqr...
<math> - MathML
WebMathMLElementmath
tle> </head> <body> <math> <mrow> <mrow> <msup> <mi>a</mi> <mn>2</mn> </msup> <mo>+</mo> <msup> <mi>b</mi> <mn>2</mn> </msup> </mrow> <mo>=</mo> <msup> <mi>c</mi> <mn>2</mn> </msup> </mrow> </math> </body> </html> xhtml notation <?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.1 plus mathml 2.0//en" "http://www.w3.org/math/dtd/mathml2/xhtml-math11-f.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>mathml in xhtml</title> </head> <body> <math xmlns="http://www.w3.org/1998/math/mathml"> <mrow> <mrow> <msup> <mi>a</mi> <mn>2</mn> </msup> <mo>+</mo>...
Web media technologies
apis media capabilities api the media capabilities api lets you determine the encoding and decoding capabilities of the device your app or site is running on.
Web Performance
in this guide we'll discuss some alternative media formats, how to use them responsibly so that non-supporting browsers don't get left out in the cold, and some advanced guidance on transcoding your existing assets to them.
Mobile first - Progressive web apps (PWAs)
in our planning your app article, we provided a high level look into the kinds of planning and functionality decisions you should make before you start coding an app, including some ideas for desktop and mobile design.
Progressive web apps (PWAs)
instant loading web apps with an application shell architecture — a guide to using the app shell coding pattern to create apps that load quickly.
Getting started - SVG: Scalable Vector Graphics
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.
Types of attacks - Web security
these attacks succeed if the web app does not employ enough validation or encoding.
Introduction to using XPath in JavaScript - XPath
for example with this document: <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/atom"> <entry /> <entry /> <entry /> </feed> doc.evaluate('//entry', doc, nsresolver, xpathresult.any_type, null) will return an empty set, where nsresolver is the resolver returned by creatensresolver.
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
etparameter(null, "myorder", "descending"); // initiate the transformation var fragment = xsltprocessor.transformtofragment(xmlref, document); // clear the contents document.getelementbyid("example").innerhtml = ""; mydom = fragment; // add the new content from the transformation document.getelementbyid("example").appendchild(fragment) } // xsl stylesheet: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="html" indent="yes" /> <xsl:param name="myorder" /> <xsl:template match="/"> <xsl:apply-templates select="/div//div"> <xsl:sort select="." data-type="number" order="{$myorder}" /> </xsl:ap...
Understanding WebAssembly text format - WebAssembly
(we specify utf8 here, but many other encodings are supported.) function consolelogstring(offset, length) { var bytes = new uint8array(memory.buffer, offset, length); var string = new textdecoder('utf8').decode(bytes); console.log(string); } the last missing piece of the puzzle is where consolelogstring gets access to the webassembly memory.